]> git.ozlabs.org Git - ccan/blobdiff - ccan/take/take.h
take, tal, tal/path, tal/str, tal/talloc: annotate APIs with TAKES.
[ccan] / ccan / take / take.h
index e0db2902021cff390f46b3330069ecb1b3dd4453..8950c6b5bc91f1c9ed374bb0f60497597efaa019 100644 (file)
 #define TAKE_LABEL(p) NULL
 #endif
 
 #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.
 /**
  * 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
  *
  * 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))
  *     {
  *             int *ret;
  *             if (taken(num))