r17886: add talloc_ptrtype() and talloc_array_ptrtype(),
[samba.git] / source4 / lib / talloc / talloc.3.xml
index ef032f8426d7cb6425676eec408bebd6e541f502..952083a8056826d8336ecfb1c85e205fbbee6105 100644 (file)
          type checking.
         </para>
     </refsect2>
+    <refsect2><title>(typeof(ptr)) talloc_ptrtype(const void *ctx, ptr);</title>
+        <para>
+         The talloc_ptrtype() macro should be used when you have a pointer and
+         want to allocate memory to point at with this pointer. When compiling
+         with gcc >= 3 it is typesafe. Note this is a wrapper of talloc_size()
+         and talloc_get_name() will return the current location in the source file.
+         and not the type.
+        </para>
+    </refsect2>
     <refsect2><title>int talloc_free(void *ptr);</title>
         <para>
          The talloc_free() function frees a piece of talloc memory, and
@@ -551,6 +560,15 @@ if (ptr) memcpy(ptr, p, strlen(p)+1);</programlisting>
          size instead of a type.
         </para>
     </refsect2>
+    <refsect2><title>(typeof(ptr)) talloc_array_ptrtype(const void *ctx, ptr, uint_t count);</title>
+        <para>
+         The talloc_ptrtype() macro should be used when you have a pointer to an array
+         and want to allocate memory of an array to point at with this pointer. When compiling
+         with gcc >= 3 it is typesafe. Note this is a wrapper of talloc_array_size()
+         and talloc_get_name() will return the current location in the source file.
+         and not the type.
+        </para>
+    </refsect2>
     <refsect2><title>void *talloc_realloc_fn(const void *ctx, void *ptr, size_t size)</title>
         <para>
          This is a non-macro version of talloc_realloc(), which is useful