diff options
author | vhanquez@kneesa.uk.xensource.com <vhanquez@kneesa.uk.xensource.com> | 2006-01-10 17:16:30 +0000 |
---|---|---|
committer | vhanquez@kneesa.uk.xensource.com <vhanquez@kneesa.uk.xensource.com> | 2006-01-10 17:16:30 +0000 |
commit | ec5303c071f8087397a0bfa7712d12ea75c833ca (patch) | |
tree | 3cf0562fbb1015e6206402b597b6520a68685698 /tools/xenstore/xs.c | |
parent | e2fa4bde2c9f52542e704510198c2796c8cab0c4 (diff) | |
download | xen-ec5303c071f8087397a0bfa7712d12ea75c833ca.tar.gz xen-ec5303c071f8087397a0bfa7712d12ea75c833ca.tar.bz2 xen-ec5303c071f8087397a0bfa7712d12ea75c833ca.zip |
Change xenbus_transaction fake pointer into an opaque type.
Signed-off-by: Vincent Hanquez <vincent@xensource.com>
Diffstat (limited to 'tools/xenstore/xs.c')
-rw-r--r-- | tools/xenstore/xs.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tools/xenstore/xs.c b/tools/xenstore/xs.c index b8d9e23e7c..3ecb462ea3 100644 --- a/tools/xenstore/xs.c +++ b/tools/xenstore/xs.c @@ -292,7 +292,7 @@ static void *read_reply( } /* Send message to xs, get malloc'ed reply. NULL and set errno on error. */ -static void *xs_talkv(struct xs_handle *h, struct xs_transaction_handle *t, +static void *xs_talkv(struct xs_handle *h, xs_transaction_handle t, enum xsd_sockmsg_type type, const struct iovec *iovec, unsigned int num_vecs, @@ -368,7 +368,7 @@ static void free_no_errno(void *p) } /* Simplified version of xs_talkv: single message. */ -static void *xs_single(struct xs_handle *h, struct xs_transaction_handle *t, +static void *xs_single(struct xs_handle *h, xs_transaction_handle t, enum xsd_sockmsg_type type, const char *string, unsigned int *len) @@ -388,7 +388,7 @@ static bool xs_bool(char *reply) return true; } -char **xs_directory(struct xs_handle *h, struct xs_transaction_handle *t, +char **xs_directory(struct xs_handle *h, xs_transaction_handle t, const char *path, unsigned int *num) { char *strings, *p, **ret; @@ -420,7 +420,7 @@ char **xs_directory(struct xs_handle *h, struct xs_transaction_handle *t, * Returns a malloced value: call free() on it after use. * len indicates length in bytes, not including the nul. */ -void *xs_read(struct xs_handle *h, struct xs_transaction_handle *t, +void *xs_read(struct xs_handle *h, xs_transaction_handle t, const char *path, unsigned int *len) { return xs_single(h, t, XS_READ, path, len); @@ -429,7 +429,7 @@ void *xs_read(struct xs_handle *h, struct xs_transaction_handle *t, /* Write the value of a single file. * Returns false on failure. */ -bool xs_write(struct xs_handle *h, struct xs_transaction_handle *t, +bool xs_write(struct xs_handle *h, xs_transaction_handle t, const char *path, const void *data, unsigned int len) { struct iovec iovec[2]; @@ -446,7 +446,7 @@ bool xs_write(struct xs_handle *h, struct xs_transaction_handle *t, /* Create a new directory. * Returns false on failure, or success if it already exists. */ -bool xs_mkdir(struct xs_handle *h, struct xs_transaction_handle *t, +bool xs_mkdir(struct xs_handle *h, xs_transaction_handle t, const char *path) { return xs_bool(xs_single(h, t, XS_MKDIR, path, NULL)); @@ -455,7 +455,7 @@ bool xs_mkdir(struct xs_handle *h, struct xs_transaction_handle *t, /* Destroy a file or directory (directories must be empty). * Returns false on failure, or success if it doesn't exist. */ -bool xs_rm(struct xs_handle *h, struct xs_transaction_handle *t, +bool xs_rm(struct xs_handle *h, xs_transaction_handle t, const char *path) { return xs_bool(xs_single(h, t, XS_RM, path, NULL)); @@ -465,7 +465,7 @@ bool xs_rm(struct xs_handle *h, struct xs_transaction_handle *t, * Returns malloced array, or NULL: call free() after use. */ struct xs_permissions *xs_get_permissions(struct xs_handle *h, - struct xs_transaction_handle *t, + xs_transaction_handle t, const char *path, unsigned int *num) { char *strings; @@ -499,7 +499,7 @@ struct xs_permissions *xs_get_permissions(struct xs_handle *h, * Returns false on failure. */ bool xs_set_permissions(struct xs_handle *h, - struct xs_transaction_handle *t, + xs_transaction_handle t, const char *path, struct xs_permissions *perms, unsigned int num_perms) @@ -636,7 +636,7 @@ bool xs_unwatch(struct xs_handle *h, const char *path, const char *token) * You can only have one transaction at any time. * Returns NULL on failure. */ -struct xs_transaction_handle *xs_transaction_start(struct xs_handle *h) +xs_transaction_handle xs_transaction_start(struct xs_handle *h) { char *id_str; unsigned long id; @@ -648,7 +648,7 @@ struct xs_transaction_handle *xs_transaction_start(struct xs_handle *h) id = strtoul(id_str, NULL, 0); free(id_str); - return (struct xs_transaction_handle *)id; + return (xs_transaction_handle)id; } /* End a transaction. @@ -656,7 +656,7 @@ struct xs_transaction_handle *xs_transaction_start(struct xs_handle *h) * Returns false on failure, which indicates an error: transactions will * not fail spuriously. */ -bool xs_transaction_end(struct xs_handle *h, struct xs_transaction_handle *t, +bool xs_transaction_end(struct xs_handle *h, xs_transaction_handle t, bool abort) { char abortstr[2]; |