/* $XdotOrg: xserver/xorg/hw/xfree86/os-support/xf86_libc.h,v 1.10 2006/01/28 02:20:37 anholt Exp $ */
/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86_libc.h,v 3.63 2003/12/08 21:46:55 alanh Exp $ */
/*
* Copyright (c) 1997-2003 by The XFree86 Project, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of the copyright holder(s)
* and author(s) shall not be used in advertising or otherwise to promote
* the sale, use or other dealings in this Software without prior written
* authorization from the copyright holder(s) and author(s).
*/
/*
* This file is an attempt to make developing code for the new loadable module
* architecure simpler. It tries to use macros to hide all libc wrappers so
* that all that is needed to "port" a module to this architecture is to
* include this one header file
*
* Revision history:
*
*
* 0.4 Apr 12 1997 add the ANSI defines
* 0.3 Feb 24 1997 handle getenv
* 0.2 Feb 24 1997 hide few FILE functions
* 0.1 Feb 24 1997 hide the trivial functions mem* str*
*/
#ifndef XF86_LIBC_H
#include <stddef.h>
/*
* The first set of definitions are required both for modules and
*/
#if defined(XFree86LOADER) || defined(NEED_XF86_TYPES)
/*
* First, the new data types
*
* note: if some pointer is declared "opaque" here, pass it between
* xf86* functions only, and don't rely on it having a whatever internal
* structure, even if some source file might reveal the existence of
* such a structure.
*/
extern XF86FILE* xf86stdout;
extern XF86FILE* xf86stderr;
/* (divisble by 8) */
/* Note: the following is POSIX! POSIX only requires the d_name member.
* Normal Unix has often a number of other members, but don't rely on that
*/
};
typedef unsigned long xf86size_t;
typedef signed long xf86ssize_t;
typedef unsigned long xf86dev_t;
typedef unsigned int xf86mode_t;
typedef unsigned int xf86uid_t;
typedef unsigned int xf86gid_t;
struct xf86stat {
};
/* sysv IPC */
typedef int xf86key_t;
#if defined(__ia64__)
#else
#endif
/* for setvbuf */
/* for open (XXX not complete) */
/* for mmap */
/* for fseek */
#define XF86_SEEK_SET 0
/* for access */
#define XF86_R_OK 0
/* for chmod */
/* for mknod */
/*
* errno values
* They start at 1000 just so they don't match real errnos at all
*/
/* sysv IPV */
/* xf86shmget() */
/* xf86shmat() */
/* xf86shmclt() */
#define XF86IPC_RMID 0
#endif /* defined(XFree86LOADER) || defined(NEED_XF86_TYPES) */
/*
* the rest of this file should only be included for code that is supposed
* to go into modules
*/
#if defined(XFree86LOADER) && !defined(DONT_DEFINE_WRAPPERS)
/* XXX Disable assert as if NDEBUG was defined */
/* Some X headers defined this away too */
#define assert(a) ((void)0)
/* non-ANSI C functions */
/* some types */
#define ulong unsigned long
/*
* There should be no need to #undef any of these. If they are already
* defined it is because some illegal header has been included.
*/
/* some vars */
/*
* XXX Basic I/O functions BAD,BAD,BAD!
*/
#if !defined(__DragonFly__)
#endif
/* IPC stuff */
/* Some ANSI macros */
#endif
#endif /* XFree86LOADER && !DONT_DEFINE_WRAPPERS */
#if defined(XFree86LOADER) && \
(!defined(DONT_DEFINE_WRAPPERS) || defined(DEFINE_SETJMP_WRAPPERS))
#endif
#endif /* XF86_LIBC_H */