libXmu: Branch 'master' - 5 commits

Alan Coopersmith alanc at kemper.freedesktop.org
Wed Jun 9 13:24:56 PDT 2010


 doc/Xmu.xml               |  305 ++++++++++++++++++++++++++++++++++++----------
 include/X11/Xmu/SysUtil.h |    6 
 include/X11/Xmu/Xmu.h     |    7 -
 3 files changed, 243 insertions(+), 75 deletions(-)

New commits:
commit dc02453cde3047bce48a8ca23c27c807642b1670
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Wed Jun 9 11:30:17 2010 -0700

    Use _X_ATTRIBUTE_PRINTF from Xfuncproto.h in Xmu headers
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Mikhail Gusarov <dottedmag at dottedmag.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>

diff --git a/include/X11/Xmu/SysUtil.h b/include/X11/Xmu/SysUtil.h
index 9f5b033..5adf404 100644
--- a/include/X11/Xmu/SysUtil.h
+++ b/include/X11/Xmu/SysUtil.h
@@ -48,11 +48,7 @@ int XmuSnprintf
  _Xconst char		*fmt,
     ...
  )
-#if defined(__GNUC__) && \
-    ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ > 4)))
-__attribute((format(printf,3,4)))
-#endif
-;
+_X_ATTRIBUTE_PRINTF(3,4);
 #endif
 
 _XFUNCPROTOEND
diff --git a/include/X11/Xmu/Xmu.h b/include/X11/Xmu/Xmu.h
index c503a41..27b7fb2 100644
--- a/include/X11/Xmu/Xmu.h
+++ b/include/X11/Xmu/Xmu.h
@@ -35,6 +35,7 @@ in this Software without prior written authorization from The Open Group.
 #ifndef _XMU_H_
 #define _XMU_H_
 
+#include <X11/Xfuncproto.h>
 #include <X11/Intrinsic.h>
 #include <X11/Xmu/Atoms.h>		/* _XA_... */
 #include <X11/Xmu/CharSet.h>		/* CopyISOLatin1Lowered */
@@ -117,11 +118,7 @@ XmuScanline *XmuScanlineXorSegment(XmuScanline*, XmuSegment*);
 
 #ifndef _SYSUTIL_H_
 int XmuSnprintf(char *str, int size, _Xconst char *fmt, ...)
-#if defined(__GNUC__) && \
-    ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ > 4)))
-__attribute((format(printf,3,4)))
-#endif
-;
+    _X_ATTRIBUTE_PRINTF(3,4);
 #endif
 
 #endif /* _XMU_H_ */
commit eb8ed42cc7f40d8dd506aeebb759dd99dac1552e
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Wed Jun 9 11:25:12 2010 -0700

    Document which functions are in libXmu vs. libXmuu
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

diff --git a/doc/Xmu.xml b/doc/Xmu.xml
index f0d6a05..9e3815b 100644
--- a/doc/Xmu.xml
+++ b/doc/Xmu.xml
@@ -5,7 +5,7 @@
 
 <article id='xmu'>
   <articleinfo>
-    <title>Xmu Library</title>
+    <title>Xmu and Xmuu Library API Reference</title>
     <abstract><para>&ldquo;Don't ask.&rdquo;</para></abstract>
 
     <legalnotice>
@@ -55,6 +55,24 @@ utility functions that have been useful in building various applications
 and widgets.  This library is required by the Athena Widgets.
     </para>
 
+    <para>
+Starting in XFree86 4.1.0, and incorporated into X11R6.7 and later releases,
+a subset of the functions that do not rely on the Athena Widgets (libXaw)
+or X Toolkit Instrinsics (libXt) are provided in a second library, libXmuu.
+    </para>
+
+    <para>
+Programs using either of these libraries are encouraged to determine the
+correct compiler and linker options via the <userinput>xmu</userinput> or
+<userinput>xmuu</userinput> module names for <command>pkg-config</command>,
+such as:
+
+      <screen>
+cc -c xapplication.c `pkg-config --cflags xmu`
+cc -o xapplication xapplication.o `pkg-config --libs xmu`
+      </screen>
+    </para>
+
   </sect1>
 
   <sect1 id='atom_functions'>
@@ -63,7 +81,8 @@ and widgets.  This library is required by the Athena Widgets.
     <para>
 To use the functions and macros defined in this section, you should include
 the header file
-&lt;<filename class='headerfile'>X11/Xmu/Atoms.h</filename>&gt;.
+&lt;<filename class='headerfile'>X11/Xmu/Atoms.h</filename>&gt;
+and link against the libXmu library.
     </para>
 
     <funcsynopsis>
@@ -331,7 +350,8 @@ The caller is responsible for preallocating the array pointed at by atoms.
     <para>
 To use the functions defined in this section, you should include the header
 file
-&lt;<filename class='headerfile'>X11/Xmu/Error.h</filename>&gt;.
+&lt;<filename class='headerfile'>X11/Xmu/Error.h</filename>&gt;
+and link against the libXmu or libXmuu library.
     </para>
 
     <para>
@@ -417,7 +437,8 @@ and 0 if the caller should not exit.
     <para>
 To use the functions defined in this section, you should include the header
 file
-&lt;<filename class='headerfile'>X11/Xmu/SysUtil.h</filename>&gt;.
+&lt;<filename class='headerfile'>X11/Xmu/SysUtil.h</filename>&gt;
+and link against the libXmu or libXmuu library.
     </para>
 
     <para>
@@ -491,6 +512,9 @@ in software that needs to continue to support non-Unix98 compliant platforms.
 To use the functions defined in this section, you should include the header
 file
 &lt;<filename class='headerfile'>X11/Xmu/WinUtil.h</filename>&gt;.
+To use <function>XmuClientWindow</function>, you may link against either the
+libXmu or libXmuu libraries.   The other functions in this section require
+linking against the libXmu library.
     </para>
 
     <para>
@@ -611,7 +635,8 @@ is returned.
     <para>
 To use the functions defined in this section, you should include the header
 file
-&lt;<filename class='headerfile'>X11/Xmu/CurUtil.h</filename>&gt;.
+&lt;<filename class='headerfile'>X11/Xmu/CurUtil.h</filename>&gt;
+and link against the libXmu or libXmuu library.
     </para>
 
     <para>
@@ -645,7 +670,8 @@ manual.
     <para>
 To use the functions defined in this section, you should include the header
 file
-&lt;<filename class='headerfile'>X11/Xmu/Drawing.h</filename>&gt;.
+&lt;<filename class='headerfile'>X11/Xmu/Drawing.h</filename>&gt;
+and link against the libXmu library.
     </para>
 
     <para>
@@ -1233,7 +1259,8 @@ The created pixmap is returned.
     <para>
 To use the functions defined in this section, you should include the header
 file
-&lt;<filename class='headerfile'>X11/Xmu/StdSel.h</filename>&gt;.
+&lt;<filename class='headerfile'>X11/Xmu/StdSel.h</filename>&gt;
+and link against the libXmu library.
     </para>
 
     <para>
@@ -1316,7 +1343,8 @@ if the conversion was successful, else it returns
     <para>
 To use the functions defined in this section, you should include the header
 file
-&lt;<filename class='headerfile'>X11/Xmu/Converters.h</filename>&gt;.
+&lt;<filename class='headerfile'>X11/Xmu/Converters.h</filename>&gt;
+and link against the libXmu library.
     </para>
 
     <para>
@@ -2108,7 +2136,8 @@ XtSetTypeConverter(XtRString, XtRWidget, XmuNewCvtStringToWidget,
 <para>
 To use the functions defined in this section, you should include the header
 file
-&lt;<filename class='headerfile'>X11/Xmu/CharSet.h</filename>&gt;.
+&lt;<filename class='headerfile'>X11/Xmu/CharSet.h</filename>&gt;
+and link against the libXmu or libXmuu library.
 </para>
 
     <warning><para>
@@ -2293,11 +2322,12 @@ less than second.  The two strings are assumed to be encoded using ISO
   <sect1 id='keyboard_event'>
     <title>Keyboard Event Translation Functions</title>
 
-<para>
+    <para>
 To use the functions defined in this section, you should include the header
 file
 &lt;<filename class='headerfile'>X11/Xmu/Lookup.h</filename>&gt;.
-</para>
+and link against the libXmu library.
+    </para>
 
     <warning><para>
 The functions in this section are <emphasis remap='B'>deprecated</emphasis> because they don't work
@@ -2866,7 +2896,8 @@ except that it maps a key event to an APL string.
 The functions defined in this section are for parsing Compound Text strings,
 decomposing them into individual segments. Definitions needed to use these
 routines are in the include file
-&lt;<filename class='headerfile'>X11/Xmu/Xct.h</filename>&gt;.
+&lt;<filename class='headerfile'>X11/Xmu/Xct.h</filename>&gt;
+and link against the libXmu library.
     </para>
 
     <warning><para>
@@ -3204,7 +3235,8 @@ structure.
     <para>
 To use the functions defined in this section, you should include the header
 file
-&lt;<filename class='headerfile'>X11/Xmu/CloseHook.h</filename>&gt;.
+&lt;<filename class='headerfile'>X11/Xmu/CloseHook.h</filename>&gt;
+and link against the libXmu library.
     </para>
 
     <para>
@@ -3365,8 +3397,10 @@ if a matching callback exists, else returns
     <para>
 To use the functions and types defined in this section, you should include the
 header file
-&lt;<filename class='headerfile'>X11/Xmu/DisplayQue.h</filename>&gt;.
-It defines the following types:
+&lt;<filename class='headerfile'>X11/Xmu/DisplayQue.h</filename>&gt;
+and link against the libXmu library.
+<filename class='headerfile'>DisplayQue.h</filename> defines the following
+types:
 
       <synopsis>
 typedef int (*XmuCloseDisplayQueueProc)(XmuDisplayQueue *queue,
@@ -3604,7 +3638,8 @@ is not called on the display.
     <para>
 To use the functions defined in this section, you should include the header
 file
-&lt;<filename class='headerfile'>X11/Xmu/Initer.h</filename>&gt;.
+&lt;<filename class='headerfile'>X11/Xmu/Initer.h</filename>&gt;
+and link against the libXmu library.
     </para>
 
     <para>
@@ -3672,7 +3707,8 @@ Otherwise, this function does nothing.
     <para>
 To use the functions defined in this section, you should include the header
 file
-&lt;<filename class='headerfile'>X11/Xmu/StdCmap.h</filename>&gt;.
+&lt;<filename class='headerfile'>X11/Xmu/StdCmap.h</filename>&gt;
+and link against the libXmu library.
     </para>
 
     <para>
@@ -4190,6 +4226,7 @@ widget set itself.
     <para>
 The definitions needed to use these interfaces are in the header file
 &lt;<filename class='headerfile'>X11/Xmu/WidgetNode.h</filename>&gt;.
+To call these functions, you need to link against the libXmu library.
 The following function must be called before any of the others described
 below:
 
@@ -4338,7 +4375,8 @@ widget name or widget class name.  If no match is found, it returns
     <para>
 To participate in the editres protocol, applications which are not based
 on the Athena widget set should include the header file
-&lt;<filename class='headerfile'>X11/Xmu/Editres.h</filename>&gt;.
+&lt;<filename class='headerfile'>X11/Xmu/Editres.h</filename>&gt;
+and link against the libXmu library.
     </para>
 
     <para>
commit bde1baeddb216b7ab6322646d9bdf3bb629c4c25
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Wed Jun 9 11:04:17 2010 -0700

    Add XmuNCopyISOLatin1Lowered & XmuNCopyISOLatin1Uppered to doc/Xmu.xml
    
    Also add notes to the originals warning about buffer overflow
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

diff --git a/doc/Xmu.xml b/doc/Xmu.xml
index 10d1c11..f0d6a05 100644
--- a/doc/Xmu.xml
+++ b/doc/Xmu.xml
@@ -2146,6 +2146,49 @@ assumed to be encoded using ISO 8859-1.
     </para>
 
     <para>
+Note that like <function>strcpy</function> the caller is responsible for
+ensuring the size of <parameter>dst</parameter> is at least as large as the
+size of <parameter>src</parameter>.
+    </para>
+
+    <para>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuNCopyISOLatin1Lowered</function></funcdef>
+	  <paramdef>char *<parameter>dst</parameter></paramdef>
+	  <paramdef>const char *<parameter>src</parameter></paramdef>
+	  <paramdef>int <parameter>size</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dst</parameter></term>
+	  <listitem><para>
+returns the string copy
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>src</parameter></term>
+	  <listitem><para>
+specifies the string to copy
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>size</parameter></term>
+	  <listitem><para>
+maximum number of characters (including the null terminator) to write to dst
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function copies up to <code><parameter>size</parameter> - 1</code>
+characters of a null terminated string from <parameter>src</parameter>
+to <parameter>dst</parameter>, and terminates it with a null,
+changing all Latin-1 uppercase letters to lowercase.  The string is
+assumed to be encoded using ISO 8859-1.
+    </para>
+
+    <para>
       <funcsynopsis>
 	<funcprototype>
 	  <funcdef>void <function>XmuCopyISOLatin1Uppered</function></funcdef>
@@ -2174,6 +2217,49 @@ assumed to be encoded using ISO 8859-1.
     </para>
 
     <para>
+Note that like <function>strcpy</function> the caller is responsible for
+ensuring the size of <parameter>dst</parameter> is at least as large as the
+size of <parameter>src</parameter>.
+    </para>
+
+    <para>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>void <function>XmuNCopyISOLatin1Uppered</function></funcdef>
+	  <paramdef>char *<parameter>dst</parameter></paramdef>
+	  <paramdef>const char *<parameter>src</parameter></paramdef>
+	  <paramdef>int <parameter>size</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+      <variablelist>
+	<varlistentry>
+	  <term><parameter>dst</parameter></term>
+	  <listitem><para>
+returns the string copy
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>src</parameter></term>
+	  <listitem><para>
+specifies the string to copy
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>size</parameter></term>
+	  <listitem><para>
+maximum number of characters (including the null terminator) to write to dst
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function copies up to <code><parameter>size</parameter> - 1</code>
+characters of a null terminated string from <parameter>src</parameter>
+to <parameter>dst</parameter>, and terminates it with a null,
+changing all Latin-1 lowercase letters to uppercase.  The string is
+assumed to be encoded using ISO 8859-1.
+    </para>
+
+    <para>
       <funcsynopsis>
 	<funcprototype>
 	  <funcdef>int <function>XmuCompareISOLatin1</function></funcdef>
commit 6b98e89515ba0ee755bdc9c4783b84b464d2a10c
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Wed Jun 9 10:50:23 2010 -0700

    Update docs to match headers
    
    - caddr_t is now XPointer
    - a number of char * arguments are now unsigned char * or constified
    - XmuLookup* functions are in Lookup.h, so split into new section
    
    There are still a bunch of headers with undocumented functions/#defines:
     - CvtCache.h
     - EditresP.h
     - ExtAgent.h
     - Misc.h
     - WhitePoint.h
     - Xmu.h
     - some of the functions in Converters.h
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

diff --git a/doc/Xmu.xml b/doc/Xmu.xml
index 97135d8..10d1c11 100644
--- a/doc/Xmu.xml
+++ b/doc/Xmu.xml
@@ -176,7 +176,7 @@ another round-trip to the server.
       <funcsynopsis>
 	<funcprototype>
 	  <funcdef>AtomPtr <function>XmuMakeAtom</function></funcdef>
-	  <paramdef>char *<parameter>name</parameter></paramdef>
+	  <paramdef>const char *<parameter>name</parameter></paramdef>
 	</funcprototype>
       </funcsynopsis>
       <variablelist>
@@ -221,13 +221,13 @@ The function returns the name of an AtomPtr.
       <funcsynopsis>
 	<funcprototype>
 	  <funcdef>Atom <function>XmuInternAtom</function></funcdef>
-	  <paramdef>Display *<parameter>d</parameter></paramdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
 	  <paramdef>AtomPtr <parameter>atom_ptr</parameter></paramdef>
 	</funcprototype>
       </funcsynopsis>
       <variablelist>
 	<varlistentry>
-	  <term><parameter>d</parameter></term>
+	  <term><parameter>dpy</parameter></term>
 	  <listitem><para>
 specifies the connection to the X server
 	    </para></listitem>
@@ -254,13 +254,13 @@ such that subsequent requests do not cause another round-trip to the server.
       <funcsynopsis>
 	<funcprototype>
 	  <funcdef>char *<function>XmuGetAtomName</function></funcdef>
-	  <paramdef>Display *<parameter>d</parameter></paramdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
 	  <paramdef>Atom <parameter>atom</parameter></paramdef>
 	</funcprototype>
       </funcsynopsis>
       <variablelist>
 	<varlistentry>
-	  <term><parameter>d</parameter></term>
+	  <term><parameter>dpy</parameter></term>
 	  <listitem><para>
 specifies the connection to the X server
 	   </para></listitem>
@@ -283,7 +283,7 @@ requests do not cause another round-trip to the server.
       <funcsynopsis>
 	<funcprototype>
 	  <funcdef>void <function>XmuInternStrings</function></funcdef>
-	  <paramdef>Display *<parameter>d</parameter></paramdef>
+	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
 	  <paramdef>String *<parameter>names</parameter></paramdef>
 	  <paramdef>Cardinal <parameter>count</parameter></paramdef>
 	  <paramdef>Atom *<parameter>atoms</parameter></paramdef>
@@ -291,7 +291,7 @@ requests do not cause another round-trip to the server.
       </funcsynopsis>
       <variablelist>
 	<varlistentry>
-	  <term><parameter>d</parameter></term>
+	  <term><parameter>dpy</parameter></term>
 	  <listitem><para>
 specifies the connection to the X server
 	   </para></listitem>
@@ -618,7 +618,7 @@ file
       <funcsynopsis>
 	<funcprototype>
 	  <funcdef>int <function>XmuCursorNameToIndex</function></funcdef>
-	  <paramdef>char *<parameter>name</parameter></paramdef>
+	  <paramdef>const char *<parameter>name</parameter></paramdef>
 	</funcprototype>
       </funcsynopsis>
       <variablelist>
@@ -1021,7 +1021,7 @@ interpretation as the return value for
       <funcsynopsis>
 	<funcprototype>
 	  <funcdef>int <function>XmuReadBitmapDataFromFile</function></funcdef>
-	  <paramdef>char *<parameter>filename</parameter></paramdef>
+	  <paramdef>const char *<parameter>filename</parameter></paramdef>
 	  <paramdef>unsigned int *<parameter>width</parameter></paramdef>
 	  <paramdef>unsigned int *<parameter>height</parameter></paramdef>
 	  <paramdef>unsigned char **<parameter>datap</parameter></paramdef>
@@ -1081,7 +1081,7 @@ interpretation as the return value for
 	<funcprototype>
 	  <funcdef>Pixmap <function>XmuLocateBitmapFile</function></funcdef>
 	  <paramdef>Screen *<parameter>screen</parameter></paramdef>
-	  <paramdef>char *<parameter>name</parameter></paramdef>
+	  <paramdef>const char *<parameter>name</parameter></paramdef>
 	  <paramdef>char *<parameter>srcname</parameter></paramdef>
 	  <paramdef>int <parameter>srcnamelen</parameter></paramdef>
 	  <paramdef>int *<parameter>widthp</parameter></paramdef>
@@ -1245,7 +1245,7 @@ file
 	  <paramdef>Atom *<parameter>selection</parameter></paramdef>
 	  <paramdef>Atom *<parameter>target</parameter></paramdef>
 	  <paramdef>Atom *<parameter>type</parameter></paramdef>
-	  <paramdef>caddr_t *<parameter>value</parameter></paramdef>
+	  <paramdef>XPointer <parameter>value</parameter></paramdef>
 	  <paramdef>unsigned long *<parameter>length</parameter></paramdef>
 	  <paramdef>int *<parameter>format</parameter></paramdef>
 	</funcprototype>
@@ -2112,10 +2112,9 @@ file
 </para>
 
     <warning><para>
-The functions in this section are <emphasis remap='B'>deprecated</emphasis> because they don't work
-in most locales now supported by X11; the function
-<function>XmbLookupString</function>
-provides a better alternative.
+The functions in this section are <emphasis remap='B'>deprecated</emphasis>
+because they don't work in most locales now supported by X11; most platforms
+provide alternatives in their system libraries.
       </para></warning>
 
     <para>
@@ -2123,7 +2122,7 @@ provides a better alternative.
 	<funcprototype>
 	  <funcdef>void <function>XmuCopyISOLatin1Lowered</function></funcdef>
 	  <paramdef>char *<parameter>dst</parameter></paramdef>
-	  <paramdef>char *<parameter>src</parameter></paramdef>
+	  <paramdef>const char *<parameter>src</parameter></paramdef>
 	</funcprototype>
       </funcsynopsis>
       <variablelist>
@@ -2151,7 +2150,7 @@ assumed to be encoded using ISO 8859-1.
 	<funcprototype>
 	  <funcdef>void <function>XmuCopyISOLatin1Uppered</function></funcdef>
 	  <paramdef>char *<parameter>dst</parameter></paramdef>
-	  <paramdef>char *<parameter>src</parameter></paramdef>
+	  <paramdef>const char *<parameter>src</parameter></paramdef>
 	</funcprototype>
       </funcsynopsis>
       <variablelist>
@@ -2178,8 +2177,8 @@ assumed to be encoded using ISO 8859-1.
       <funcsynopsis>
 	<funcprototype>
 	  <funcdef>int <function>XmuCompareISOLatin1</function></funcdef>
-	  <paramdef>char *<parameter>first</parameter></paramdef>
-	  <paramdef>char *<parameter>second</parameter></paramdef>
+	  <paramdef>const char *<parameter>first</parameter></paramdef>
+	  <paramdef>const char *<parameter>second</parameter></paramdef>
 	</funcprototype>
       </funcsynopsis>
       <variablelist>
@@ -2203,13 +2202,30 @@ according to whether first is lexicographically greater than, equal to, or
 less than second.  The two strings are assumed to be encoded using ISO
 8859-1.
     </para>
+  </sect1>
+
+  <sect1 id='keyboard_event'>
+    <title>Keyboard Event Translation Functions</title>
+
+<para>
+To use the functions defined in this section, you should include the header
+file
+&lt;<filename class='headerfile'>X11/Xmu/Lookup.h</filename>&gt;.
+</para>
+
+    <warning><para>
+The functions in this section are <emphasis remap='B'>deprecated</emphasis> because they don't work
+in most locales now supported by X11; the function
+<function>XmbLookupString</function>
+provides a better alternative.
+      </para></warning>
 
     <para>
       <funcsynopsis>
 	<funcprototype>
 	  <funcdef>int <function>XmuLookupLatin1</function></funcdef>
 	  <paramdef>XKeyEvent *<parameter>event</parameter></paramdef>
-	  <paramdef>char *<parameter>buffer</parameter></paramdef>
+	  <paramdef>unsigned char *<parameter>buffer</parameter></paramdef>
 	  <paramdef>int <parameter>nbytes</parameter></paramdef>
 	  <paramdef>KeySym *<parameter>keysym</parameter></paramdef>
 	  <paramdef>XComposeStatus *<parameter>status</parameter></paramdef>
@@ -2258,7 +2274,7 @@ and exists only for naming symmetry with other functions.
 	<funcprototype>
 	  <funcdef>int <function>XmuLookupLatin2</function></funcdef>
 	  <paramdef>XKeyEvent *<parameter>event</parameter></paramdef>
-	  <paramdef>char *<parameter>buffer</parameter></paramdef>
+	  <paramdef>unsigned char *<parameter>buffer</parameter></paramdef>
 	  <paramdef>int <parameter>nbytes</parameter></paramdef>
 	  <paramdef>KeySym *<parameter>keysym</parameter></paramdef>
 	  <paramdef>XComposeStatus *<parameter>status</parameter></paramdef>
@@ -2308,7 +2324,7 @@ to an Latin-2 (ISO 8859-2) string, or to an ASCII control string.
 	<funcprototype>
 	  <funcdef>int <function>XmuLookupLatin3</function></funcdef>
 	  <paramdef>XKeyEvent *<parameter>event</parameter></paramdef>
-	  <paramdef>char *<parameter>buffer</parameter></paramdef>
+	  <paramdef>unsigned char *<parameter>buffer</parameter></paramdef>
 	  <paramdef>int <parameter>nbytes</parameter></paramdef>
 	  <paramdef>KeySym *<parameter>keysym</parameter></paramdef>
 	  <paramdef>XComposeStatus *<parameter>status</parameter></paramdef>
@@ -2358,7 +2374,7 @@ to an Latin-3 (ISO 8859-3) string, or to an ASCII control string.
 	<funcprototype>
 	  <funcdef>int <function>XmuLookupLatin4</function></funcdef>
 	  <paramdef>XKeyEvent *<parameter>event</parameter></paramdef>
-	  <paramdef>char *<parameter>buffer</parameter></paramdef>
+	  <paramdef>unsigned char *<parameter>buffer</parameter></paramdef>
 	  <paramdef>int <parameter>nbytes</parameter></paramdef>
 	  <paramdef>KeySym *<parameter>keysym</parameter></paramdef>
 	  <paramdef>XComposeStatus *<parameter>status</parameter></paramdef>
@@ -2408,7 +2424,7 @@ to an Latin-4 (ISO 8859-4) string, or to an ASCII control string.
 	<funcprototype>
 	  <funcdef>int <function>XmuLookupKana</function></funcdef>
 	  <paramdef>XKeyEvent *<parameter>event</parameter></paramdef>
-	  <paramdef>char *<parameter>buffer</parameter></paramdef>
+	  <paramdef>unsigned char *<parameter>buffer</parameter></paramdef>
 	  <paramdef>int <parameter>nbytes</parameter></paramdef>
 	  <paramdef>KeySym *<parameter>keysym</parameter></paramdef>
 	  <paramdef>XComposeStatus *<parameter>status</parameter></paramdef>
@@ -2461,7 +2477,7 @@ X201-1976.
 	<funcprototype>
 	  <funcdef>int <function>XmuLookupJISX0201</function></funcdef>
 	  <paramdef>XKeyEvent *<parameter>event</parameter></paramdef>
-	  <paramdef>char *<parameter>buffer</parameter></paramdef>
+	  <paramdef>unsigned char *<parameter>buffer</parameter></paramdef>
 	  <paramdef>int <parameter>nbytes</parameter></paramdef>
 	  <paramdef>KeySym *<parameter>keysym</parameter></paramdef>
 	  <paramdef>XComposeStatus *<parameter>status</parameter></paramdef>
@@ -2511,7 +2527,7 @@ to a string in the JIS X0201-1976 encoding, including ASCII control.
 	<funcprototype>
 	  <funcdef>int <function>XmuLookupArabic</function></funcdef>
 	  <paramdef>XKeyEvent *<parameter>event</parameter></paramdef>
-	  <paramdef>char *<parameter>buffer</parameter></paramdef>
+	  <paramdef>unsigned char *<parameter>buffer</parameter></paramdef>
 	  <paramdef>int <parameter>nbytes</parameter></paramdef>
 	  <paramdef>KeySym *<parameter>keysym</parameter></paramdef>
 	  <paramdef>XComposeStatus *<parameter>status</parameter></paramdef>
@@ -2561,7 +2577,7 @@ to a Latin/Arabic (ISO 8859-6) string, or to an ASCII control string.
 	<funcprototype>
 	  <funcdef>int <function>XmuLookupCyrillic</function></funcdef>
 	  <paramdef>XKeyEvent *<parameter>event</parameter></paramdef>
-	  <paramdef>char *<parameter>buffer</parameter></paramdef>
+	  <paramdef>unsigned char *<parameter>buffer</parameter></paramdef>
 	  <paramdef>int <parameter>nbytes</parameter></paramdef>
 	  <paramdef>KeySym *<parameter>keysym</parameter></paramdef>
 	  <paramdef>XComposeStatus *<parameter>status</parameter></paramdef>
@@ -2611,7 +2627,7 @@ to a Latin/Cyrillic (ISO 8859-5) string, or to an ASCII control string.
 	<funcprototype>
 	  <funcdef>int <function>XmuLookupGreek</function></funcdef>
 	  <paramdef>XKeyEvent *<parameter>event</parameter></paramdef>
-	  <paramdef>char *<parameter>buffer</parameter></paramdef>
+	  <paramdef>unsigned char *<parameter>buffer</parameter></paramdef>
 	  <paramdef>int <parameter>nbytes</parameter></paramdef>
 	  <paramdef>KeySym *<parameter>keysym</parameter></paramdef>
 	  <paramdef>XComposeStatus *<parameter>status</parameter></paramdef>
@@ -2661,7 +2677,7 @@ to a Latin/Greek (ISO 8859-7) string, or to an ASCII control string.
 	<funcprototype>
 	  <funcdef>int <function>XmuLookupHebrew</function></funcdef>
 	  <paramdef>XKeyEvent *<parameter>event</parameter></paramdef>
-	  <paramdef>char *<parameter>buffer</parameter></paramdef>
+	  <paramdef>unsigned char *<parameter>buffer</parameter></paramdef>
 	  <paramdef>int <parameter>nbytes</parameter></paramdef>
 	  <paramdef>KeySym *<parameter>keysym</parameter></paramdef>
 	  <paramdef>XComposeStatus *<parameter>status</parameter></paramdef>
@@ -2711,7 +2727,7 @@ to a Latin/Hebrew (ISO 8859-8) string, or to an ASCII control string.
 	<funcprototype>
 	  <funcdef>int <function>XmuLookupAPL</function></funcdef>
 	  <paramdef>XKeyEvent *<parameter>event</parameter></paramdef>
-	  <paramdef>char *<parameter>buffer</parameter></paramdef>
+	  <paramdef>unsigned char *<parameter>buffer</parameter></paramdef>
 	  <paramdef>int <parameter>nbytes</parameter></paramdef>
 	  <paramdef>KeySym *<parameter>keysym</parameter></paramdef>
 	  <paramdef>XComposeStatus *<parameter>status</parameter></paramdef>
@@ -2787,7 +2803,7 @@ A Compound Text string is represented as the following type:
       <funcsynopsis>
 	<funcprototype>
 	  <funcdef>XctData <function>XctCreate</function></funcdef>
-	  <paramdef>XctString <parameter>string</parameter></paramdef>
+	  <paramdef>const XctString <parameter>string</parameter></paramdef>
 	  <paramdef>int <parameter>length</parameter></paramdef>
 	  <paramdef>XctFlags <parameter>flags</parameter></paramdef>
 	</funcprototype>
@@ -3111,8 +3127,8 @@ file
 	  <funcdef>CloseHook <function>XmuAddCloseDisplayHook</function></funcdef>
 	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
 	  <paramdef>int <parameter>( *func )</parameter>
-	    <funcparams>Display *, caddr_t</funcparams></paramdef>
-	  <paramdef>caddr_t <parameter>arg</parameter></paramdef>
+	    <funcparams>Display *, XPointer</funcparams></paramdef>
+	  <paramdef>XPointer <parameter>arg</parameter></paramdef>
 	</funcprototype>
       </funcsynopsis>
       <variablelist>
@@ -3163,8 +3179,8 @@ returns an opaque handle that can be used to remove or lookup the callback.
 	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
 	  <paramdef>CloseHook <parameter>handle</parameter></paramdef>
 	  <paramdef>int <parameter>( *func )</parameter>
-	    <funcparams>Display *, caddr_t</funcparams></paramdef>
-	  <paramdef>caddr_t <parameter>arg</parameter></paramdef>
+	    <funcparams>Display *, XPointer</funcparams></paramdef>
+	  <paramdef>XPointer <parameter>arg</parameter></paramdef>
 	</funcprototype>
       </funcsynopsis>
       <variablelist>
@@ -3212,8 +3228,8 @@ if a callback was removed, else returns
 	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
 	  <paramdef>CloseHook <parameter>handle</parameter></paramdef>
 	  <paramdef>int <parameter>( *func )</parameter>
-	    <funcparams>Display *, caddr_t</funcparams></paramdef>
-	  <paramdef>caddr_t <parameter>arg</parameter></paramdef>
+	    <funcparams>Display *, XPointer</funcparams></paramdef>
+	  <paramdef>XPointer <parameter>arg</parameter></paramdef>
 	</funcprototype>
       </funcsynopsis>
       <variablelist>
@@ -3267,19 +3283,24 @@ header file
 It defines the following types:
 
       <synopsis>
+typedef int (*XmuCloseDisplayQueueProc)(XmuDisplayQueue *queue,
+                                        XmuDisplayQueueEntry *entry);
+
+typedef int (*XmuFreeDisplayQueueProc)(XmuDisplayQueue *queue);
+
 typedef struct _XmuDisplayQueueEntry {
 	struct _XmuDisplayQueueEntry *prev, *next;
 	Display *display;
 	CloseHook closehook;
-	caddr_t data;
+	XPointer data;
 } XmuDisplayQueueEntry;
 
 typedef struct _XmuDisplayQueue {
 	int nentries;
 	XmuDisplayQueueEntry *head, *tail;
-	int (*closefunc)();
-	int (*freefunc)();
-	caddr_t data;
+	XmuCloseDisplayQueueProc closefunc;
+	XmuFreeDisplayQueueProc freefunc;
+	XPointer data;
 } XmuDisplayQueue;
       </synopsis>
     </para>
@@ -3288,11 +3309,9 @@ typedef struct _XmuDisplayQueue {
       <funcsynopsis>
 	<funcprototype>
 	  <funcdef>XmuDisplayQueue *<function>XmuDQCreate</function></funcdef>
-	  <paramdef>int <parameter>( *closefunc )</parameter>
-	    <funcparams>XmuDisplayQueue *, XmuDisplayQueueEntry *</funcparams></paramdef>
-	  <paramdef>int <parameter>( *freefunc )</parameter>
-	    <funcparams>XmuDisplayQueue *</funcparams></paramdef>
-	  <paramdef>caddr_t <parameter>data</parameter></paramdef>
+	  <paramdef>XmuCloseDisplayQueueProc <parameter>closefunc</parameter></paramdef>
+	  <paramdef>XmuFreeDisplayQueueProc <parameter>freefunc</parameter></paramdef>
+	  <paramdef>XPointer <parameter>data</parameter></paramdef>
 	</funcprototype>
       </funcsynopsis>
       <variablelist>
@@ -3355,7 +3374,7 @@ The application is responsible for actually freeing the queue, by calling
 	  <funcdef>XmuDisplayQueueEntry *<function>XmuDQAddDisplay</function></funcdef>
 	  <paramdef>XmuDisplayQueue *<parameter>q</parameter></paramdef>
 	  <paramdef>Display *<parameter>dpy</parameter></paramdef>
-	  <paramdef>caddr_t <parameter>data</parameter></paramdef>
+	  <paramdef>XPointer <parameter>data</parameter></paramdef>
 	</funcprototype>
      </funcsynopsis>
 
@@ -3507,8 +3526,8 @@ file
 	<funcprototype>
 	  <funcdef>void <function>XmuAddInitializer</function></funcdef>
 	  <paramdef>void <parameter>( *func )</parameter>
-	    <funcparams>XtAppContext, caddr_t</funcparams></paramdef>
-	  <paramdef>caddr_t <parameter>data</parameter></paramdef>
+	    <funcparams>XtAppContext, XPointer</funcparams></paramdef>
+	  <paramdef>XPointer <parameter>data</parameter></paramdef>
 	</funcprototype>
       </funcsynopsis>
       <variablelist>
commit 13409196c36151e4b5212ae08e6cfda6d7c93696
Author: Alan Coopersmith <alan.coopersmith at oracle.com>
Date:   Wed Jun 9 10:23:08 2010 -0700

    Add XmuSnprintf to doc/Xmu.xml
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

diff --git a/doc/Xmu.xml b/doc/Xmu.xml
index 34abad7..97135d8 100644
--- a/doc/Xmu.xml
+++ b/doc/Xmu.xml
@@ -450,6 +450,38 @@ such as whether to call <function>gethostname</function> or
 <function>uname</function>.
     </para>
 
+    <para>
+      <funcsynopsis>
+	<funcprototype>
+	  <funcdef>int <function>XmuSnprintf</function></funcdef>
+	  <paramdef>char *<parameter>str</parameter></paramdef>
+	  <paramdef>int <parameter>size</parameter></paramdef>
+	  <paramdef><parameter>...</parameter></paramdef>
+	</funcprototype>
+      </funcsynopsis>
+     <variablelist>
+	<varlistentry>
+	  <term><parameter>str</parameter></term>
+	  <listitem><para>
+string to write output to
+	    </para></listitem>
+	</varlistentry>
+	<varlistentry>
+	  <term><parameter>size</parameter></term>
+	  <listitem><para>
+specifies the size of <parameter>str</parameter>
+	    </para></listitem>
+	</varlistentry>
+      </variablelist>
+
+This function was provided as a portable implementation of
+<function>snprintf</function> before all platforms could be
+relied on to provide their own.   It is now deprecated in favor of
+calling <function>snprintf</function> directly and should only be used
+in software that needs to continue to support non-Unix98 compliant platforms.
+    </para>
+
+
   </sect1>
 
   <sect1 id='window_utility_functions'>


More information about the xorg-commit mailing list