Fix build on Solaris (use inttypes.h)
[free-sw/xcb/libxcb] / src / xcb.h
index 718233f..e19b19d 100644 (file)
--- a/src/xcb.h
+++ b/src/xcb.h
  * authorization from the authors.
  */
 
-#ifndef __XCB_H
-#define __XCB_H
+#ifndef __XCB_H__
+#define __XCB_H__
 #include <sys/types.h>
 
-/* TODO: check for stdint in config? (HAVE_STDINT) fallback? */
+#if HAVE_STDINT_H
 #include <stdint.h>
+#elif HAVE_INTTYPES_H
+#include <inttypes.h>
+#endif
 
 /* FIXME: these names conflict with those defined in Xmd.h. */
 #ifndef XMD_H
@@ -44,14 +47,15 @@ typedef int16_t  INT16;
 typedef int32_t  INT32;
 #endif /* XMD_H */
 
-#include <X11/X.h>
 #include <sys/uio.h>
 #include <pthread.h>
 
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+
 #if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
 #define deprecated __attribute__((__deprecated__))
 #else
@@ -83,13 +87,6 @@ extern "C" {
 
 #define XCB_TYPE_PAD(T,I) (-(I) & (sizeof(T) > 4 ? 3 : sizeof(T) - 1))
 
-
-/** XCBNone is the universal null resource or null atom parameter value for many core X requests */
-#define XCBNone 0L
-
-/** XCBCopyFromParent can be used for many CreateWindow parameters */
-#define XCBCopyFromParent 0L
-
 /* Opaque structures */
 
 /**
@@ -161,11 +158,23 @@ typedef struct {
 } XCBVoidCookie;
 
 
-/* Include the generated xproto and xcb_types headers. */
-#include "xcb_types.h"
+/* Include the generated xproto header. */
 #include "xproto.h"
 
 
+/** XCBNone is the universal null resource or null atom parameter value for many core X requests */
+#define XCBNone 0L
+
+/** XCBCopyFromParent can be used for many CreateWindow parameters */
+#define XCBCopyFromParent 0L
+
+/** XCBCurrentTime can be used in most requests that take an XCBTIMESTAMP */
+#define XCBCurrentTime 0L
+
+/** XCBNoSymbol fills in unused entries in XCBKEYSYM tables */
+#define XCBNoSymbol 0L
+
+
 /* xcb_auth.c */
 
 /**
@@ -290,7 +299,7 @@ typedef struct XCBExtension XCBExtension;  /**< Opaque structure used as key for
  * @brief Caches reply information from QueryExtension requests.
  * @param c: The connection.
  * @param ext: The extension data.
- * @return A pointer to a XCBConnSetupSuccessRep pointer.
+ * @return A pointer to the XCBQueryExtensionRep for the extension.
  *
  * This function is the primary interface to the "extension cache",
  * which caches reply information from QueryExtension
@@ -323,7 +332,7 @@ void XCBPrefetchExtensionData(XCBConnection *c, XCBExtension *ext);
 /**
  * @brief Access the data returned by the server.
  * @param c: The connection.
- * @return A pointer to a XCBConnSetupSuccessRep pointer.
+ * @return A pointer to an XCBSetup structure.
  *
  * Accessor for the data returned by the server when the XCBConnection
  * was initialized. This data includes
@@ -471,11 +480,11 @@ XCBConnection *XCBConnectToDisplayWithAuthInfo(const char *display, XCBAuthInfo
  * @param e: A pointer to an error.
  * @return @c 1 on success, @c 0 otherwise.
  *
- * Blocks the calling thread for the duration of one round trip to the
- * server, ensuring that all events and errors caused by previous
- * requests are available to XCB.
+ * @deprecated This function is deprecated. It must not be used in
+ * newly written code.  XCBFlush is more efficient.
+ * Use XCBAuxSync if absolutely necessary.
  */
-int XCBSync(XCBConnection *c, XCBGenericError **e);
+int XCBSync(XCBConnection *c, XCBGenericError **e) deprecated;
 
 
 /**
@@ -528,4 +537,5 @@ XCBGenericIter XCBConnSetupSuccessRepEnd(XCBSetupIter i) deprecated;
 }
 #endif
 
-#endif
+
+#endif /* __XCB_H__ */