/*
* cslibint.h -- low level I/O
*
* (c) Copyright 1993-1994 Adobe Systems Incorporated.
* All rights reserved.
*
* Permission to use, copy, modify, distribute, and sublicense this software
* and its documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notices appear in all copies and that
* both those copyright notices and this permission notice appear in
* supporting documentation and that the name of Adobe Systems Incorporated
* not be used in advertising or publicity pertaining to distribution of the
* software without specific, written prior permission. No trademark license
* to use the Adobe trademarks is hereby granted. If the Adobe trademark
* "Display PostScript"(tm) is used to describe this software, its
* functionality or for any other purpose, such use shall be limited to a
* statement that this software works in conjunction with the Display
* PostScript system. Proper trademark attribution to reflect Adobe's
* ownership of the trademark shall be given whenever any such reference to
* the Display PostScript system is made.
*
* ADOBE MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THE SOFTWARE FOR
* ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
* ADOBE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
* IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON- INFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL ADOBE BE LIABLE
* TO YOU OR ANY OTHER PARTY FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE, STRICT LIABILITY OR ANY OTHER ACTION ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ADOBE WILL NOT
* PROVIDE ANY TRAINING OR OTHER SUPPORT FOR THE SOFTWARE.
*
* Adobe, PostScript, and Display PostScript are trademarks of Adobe Systems
* Incorporated which may be registered in certain jurisdictions
*
* Portions Copyright 1984, 1985, 1987, 1989 Massachusetts Institute of
* Technology
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. M.I.T. makes no representations about the
* suitability of this software for any purpose. It is provided "as is"
* without express or implied warranty.
*
* Author: Adobe Systems Incorporated and MIT X Consortium
*/
/* $XFree86: xc/lib/dps/cslibint.h,v 1.3 2001/06/30 22:41:44 tsi Exp $ */
/*
* XlibInternal.h - Header definition and support file for the internal
* support routines (XlibInternal) used by the C subroutine interface
* library (Xlib) to the X Window System.
*
* Warning, there be dragons here....
*/
#ifndef _CSLIBINT_H
#define _CSLIBINT_H
/* For SYSV, no gethostname, so fake it */
#if defined(__SCO__)
/* SCO systems define MAXHOSTNAMELEN here */
#endif
#ifndef MAXHOSTNAMELEN
#endif
/* === MACROS === */
/*
* GetReq - Get the next avilable X request packet in the buffer and
* return it.
*
* "name" is the name of the request, e.g. CreatePixmap, OpenFont, etc.
* "req" is the name of the request pointer.
*
*/
#if !defined(UNIXCPP)
#else /* non-ANSI C uses empty comment instead of "##" for token concatenation */
#endif
#ifdef NEEDFORNX
/* GetReqExtra is the same as GetReq, but allocates "n" additional
bytes after the request. "n" must be a multiple of 4! */
#if !defined(UNIXCPP)
#else
#endif
/*
* GetResReq is for those requests that have a resource ID
* (Window, Pixmap, GContext, etc.) as their single argument.
* "rid" is the name of the resource.
*/
#if !defined(UNIXCPP)
#else
#endif
/*
* GetEmptyReq is for those requests that have no arguments
* at all.
*/
#if !defined(UNIXCPP)
#else
#endif
#define SyncHandle() \
/*
* Data - Place data in the buffer and pad the end to provide
* 32 bit word alignment. Transmit if the buffer fills.
*
* "dpy" is a pointer to a Display.
* "data" is a pinter to a data buffer.
* "len" is the length of the data buffer.
* we can presume buffer less than 2^16 bytes, so bcopy can be used safely.
*/
#ifndef DataRoutineIsProcedure
} else\
#endif /* DataRoutineIsProcedure */
/* Allocate bytes from the buffer. No padding is done, so if
* the length is not a multiple of 4, the caller must be
* careful to leave the buffer aligned after sending the
* current request.
*
* "type" is the type of the pointer being assigned to.
* "ptr" is the pointer being assigned to.
* "n" is the number of bytes to allocate.
*
* Example:
* xTextElt *elt;
* BufAlloc (xTextElt *, elt, nbytes)
*/
/*
* provide emulation routines for smaller architectures
*/
#ifndef WORD64
#endif /* not WORD64 */
/* Xlib manual is bogus */
#endif /* NEEDFORNX */
#if !defined(STARTITERATE) && !defined(WORD64)
#define ENDITERATE }
#endif /* STARTITERATE */
#ifndef WORD64
#endif /* not WORD64 */
extern int gNXSyncGCMode;
/* extension hooks */
extern int DPSCAPConnect( char *, char **, int *, int *, int *, char **);
extern int N_XDisconnectDisplay(int);
extern int N_XGetHostname (char *, int);
extern void NXProcData (Display *, char *, long);
extern void N_XReadPad(Display*, char *, long);
extern void N_XWaitForReadable(Display *);
extern void N_XWaitForWritable(Display *);
extern void XDPSGetDefaultColorMaps(
#endif /* _CSLIBINT_H */