X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ftake%2Ftake.h;h=8950c6b5bc91f1c9ed374bb0f60497597efaa019;hp=e0db2902021cff390f46b3330069ecb1b3dd4453;hb=ed6dd33e06c0e8f1c4dd006e0b70d9f2d6ba6c09;hpb=cbabfa8c8bd4757091c7fdb566b97388be890a74;ds=sidebyside diff --git a/ccan/take/take.h b/ccan/take/take.h index e0db2902..8950c6b5 100644 --- a/ccan/take/take.h +++ b/ccan/take/take.h @@ -11,6 +11,17 @@ #define TAKE_LABEL(p) NULL #endif +/** + * TAKES - annotate a formal parameter as being take()-able + * + * This doesn't do anything, but useful for documentation. + * + * Example: + * void print_string(const char *str TAKES); + * + */ +#define TAKES + /** * take - record a pointer to be consumed by the function its handed to. * @p: the pointer to mark, or NULL. @@ -31,7 +42,7 @@ * * Example: * // Silly routine to add 1 - * static int *add_one(const int *num) + * static int *add_one(const int *num TAKES) * { * int *ret; * if (taken(num))