svn commit: samba r22758 - in branches/SAMBA_4_0/source/lib/talloc: .

metze at samba.org metze at samba.org
Tue May 8 09:54:02 GMT 2007


Author: metze
Date: 2007-05-08 09:54:01 +0000 (Tue, 08 May 2007)
New Revision: 22758

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22758

Log:
- add missing _talloc_set_name_const(ret, ret); to talloc_append_string()
- update manpage and add comments about _talloc_set_name_const(ret, ret);
  in all places which use them

metze
Modified:
   branches/SAMBA_4_0/source/lib/talloc/talloc.3.xml
   branches/SAMBA_4_0/source/lib/talloc/talloc.c
   branches/SAMBA_4_0/source/lib/talloc/talloc_guide.txt


Changeset:
Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.3.xml
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/talloc.3.xml	2007-05-08 08:49:52 UTC (rev 22757)
+++ branches/SAMBA_4_0/source/lib/talloc/talloc.3.xml	2007-05-08 09:54:01 UTC (rev 22758)
@@ -583,11 +583,27 @@
         </para>
         <programlisting>talloc_set_name_const(ptr, ptr)</programlisting>
     </refsect2>
+    <refsect2><title>char *talloc_append_string(const void *<emphasis role="italic">t</emphasis>, char *<emphasis role="italic">orig</emphasis>, const char *<emphasis role="italic">append</emphasis>);</title>
+        <para>
+	  The talloc_append_string() function appends the given formatted
+	  string to the given string.
+        </para>
+        <para>
+	  This function sets the name of the new pointer to the new
+	  string. This is equivalent to:
+        </para>
+        <programlisting>talloc_set_name_const(ptr, ptr)</programlisting>
+    </refsect2>
     <refsect2><title>char *talloc_vasprintf(const void *<emphasis role="italic">t</emphasis>, const char *<emphasis role="italic">fmt</emphasis>, va_list <emphasis role="italic">ap</emphasis>);</title>
         <para>
 	  The talloc_vasprintf() function is the talloc equivalent of the C
 	  library function vasprintf(3).
         </para>
+        <para>
+	  This function sets the name of the new pointer to the new
+	  string. This is equivalent to:
+        </para>
+        <programlisting>talloc_set_name_const(ptr, ptr)</programlisting>
     </refsect2>
     <refsect2><title>char *talloc_asprintf(const void *<emphasis role="italic">t</emphasis>, const char *<emphasis role="italic">fmt</emphasis>, ...);</title>
         <para>
@@ -605,6 +621,11 @@
 	  The talloc_asprintf_append() function appends the given formatted
 	  string to the given string.
         </para>
+        <para>
+	  This function sets the name of the new pointer to the new
+	  string. This is equivalent to:
+        </para>
+        <programlisting>talloc_set_name_const(ptr, ptr)</programlisting>
     </refsect2>
     <refsect2><title>(type *)talloc_array(const void *ctx, type, uint_t count);</title>
         <para>

Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/talloc.c	2007-05-08 08:49:52 UTC (rev 22757)
+++ branches/SAMBA_4_0/source/lib/talloc/talloc.c	2007-05-08 09:54:01 UTC (rev 22758)
@@ -1137,6 +1137,8 @@
 	/* append the string with the trailing \0 */
 	memcpy(&ret[olen], append, alenz);
 
+	_talloc_set_name_const(ret, ret);
+
 	return ret;
 }
 

Modified: branches/SAMBA_4_0/source/lib/talloc/talloc_guide.txt
===================================================================
--- branches/SAMBA_4_0/source/lib/talloc/talloc_guide.txt	2007-05-08 08:49:52 UTC (rev 22757)
+++ branches/SAMBA_4_0/source/lib/talloc/talloc_guide.txt	2007-05-08 09:54:01 UTC (rev 22758)
@@ -533,21 +533,34 @@
 string. This is equivalent to:
    talloc_set_name_const(ptr, ptr)
 
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+char *talloc_append_string(const void *t, char *orig, const char *append);
 
+The talloc_append_string() function appends the given formatted
+string to the given string.
+
+This function sets the name of the new pointer to the new
+string. This is equivalent to:
+   talloc_set_name_const(ptr, ptr)
+
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 char *talloc_vasprintf(const void *t, const char *fmt, va_list ap);
 
 The talloc_vasprintf() function is the talloc equivalent of the C
 library function vasprintf()
 
+This functions sets the name of the new pointer to the new
+string. This is equivalent to:
+   talloc_set_name_const(ptr, ptr)
 
+
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 char *talloc_asprintf(const void *t, const char *fmt, ...);
 
 The talloc_asprintf() function is the talloc equivalent of the C
 library function asprintf()
 
-This functions sets the name of the new pointer to the passed
+This functions sets the name of the new pointer to the new
 string. This is equivalent to:
    talloc_set_name_const(ptr, ptr)
 
@@ -558,7 +571,11 @@
 The talloc_asprintf_append() function appends the given formatted 
 string to the given string. 
 
+This functions sets the name of the new pointer to the new
+string. This is equivalent to:
+   talloc_set_name_const(ptr, ptr)
 
+
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 (type *)talloc_array(const void *ctx, type, uint_t count);
 



More information about the samba-cvs mailing list