summaryrefslogtreecommitdiff
path: root/tbdiff/tbdiff-xattrs.h
diff options
context:
space:
mode:
authorBen Brewer <ben.brewer@codethink.co.uk>2014-05-30 16:04:21 +0100
committerBen Brewer <ben.brewer@codethink.co.uk>2014-06-02 15:53:42 +0100
commit539ccd77d3017965cd70444ba80ce95799d9337d (patch)
treefd149d1f4c2baf1c42cd46d62dc3da4d981e7cc9 /tbdiff/tbdiff-xattrs.h
parent5e7c9554d4685026e80c95e9efa8a4dae0f399de (diff)
downloadtbdiff-539ccd77d3017965cd70444ba80ce95799d9337d.tar.gz
Remove use of typedef to avoid naming conflicts with POSIX
POSIX reserves the use of the underscore T postfix for types, since most of the time we don't actually need to typedef the types and since it's more clear to prefix structs and enums with the struct and enum keywords, I've removed all uses of typedef and gone with the more simple approach used in the kernel. One typedef remains which is tbd_cmd_type, since this should be a native type of a fixed size. The postfix changed to type to show that it's a type and to ensure it doesn't collide with POSIX.
Diffstat (limited to 'tbdiff/tbdiff-xattrs.h')
-rw-r--r--tbdiff/tbdiff-xattrs.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/tbdiff/tbdiff-xattrs.h b/tbdiff/tbdiff-xattrs.h
index 7052e1a..c263e18 100644
--- a/tbdiff/tbdiff-xattrs.h
+++ b/tbdiff/tbdiff-xattrs.h
@@ -26,24 +26,24 @@
#include <stdint.h>
/* structure for names data */
-typedef struct tbd_xattrs_names {
+struct tbd_xattrs_names {
char const *begin;
char const *end;
-} tbd_xattrs_names_t;
+};
/* gets a list of the names of the file referenced by path */
-int tbd_xattrs_names(char const *path, tbd_xattrs_names_t *names_out);
+int tbd_xattrs_names(char const *path, struct tbd_xattrs_names *names_out);
/* frees up the INTERNAL resources of the list, doesn't free the list itself */
-void tbd_xattrs_names_free(tbd_xattrs_names_t *names);
+void tbd_xattrs_names_free(struct tbd_xattrs_names *names);
/* calls f with every name in the list */
-int tbd_xattrs_names_each(tbd_xattrs_names_t const *names,
+int tbd_xattrs_names_each(struct tbd_xattrs_names const *names,
int (*f)(char const *name, void *ud),
void *ud);
/* gets how many different attributes there are in the list */
-int tbd_xattrs_names_count(tbd_xattrs_names_t const *names, uint32_t *count);
+int tbd_xattrs_names_count(struct tbd_xattrs_names const *names, uint32_t *count);
/* puts the value of the attribute called name into *buf with size *bufsize
* if *buf is NULL or *bufsize is 0 then memory will be allocated for it
@@ -57,8 +57,7 @@ int tbd_xattrs_get(char const *path, char const* name, void **buf,
int tbd_xattrs_removeall(char const *path);
/* calls f for every attribute:value pair in the list */
-typedef int (*tbd_xattrs_pairs_callback_t)(char const *name, void const *data,
- size_t size, void *ud);
-int tbd_xattrs_pairs(tbd_xattrs_names_t const *names, char const *path,
- tbd_xattrs_pairs_callback_t f, void *ud);
+int tbd_xattrs_pairs(struct tbd_xattrs_names const *names, char const *path,
+ int (*f)(char const *, void const *, size_t, void *),
+ void *ud);
#endif /* !__TBDIFF_XATTRS_H__ */