| iMatix home page
| << | < | > | >>
SFL Logo SFL
Version 2.11

Universal Header File for C programming

Filename: prelude.h
Package: Standard Function Library (SFL)
Written: 1993/03/29 iMatix SFL project team sfl@imatix.com
Revised: 2000/02/11
Copyright: Copyright (c) 1991-99 iMatix Corporation
Version: 2.04
2.04 PH Added BeOS support
2.02 PH Released with SFL 2.02

Synopsis

This header file encapsulates many generally-useful include files and defines lots of good stuff. The intention of this header file is to hide the messy #ifdef's that you typically need to make real programs compile & run. To use, specify as the first include file in your program. The main contributors to this file were:
PH Pieter Hintjens <ph@imatix.com>
EDM Ewen McNeill <ewen@imatix.com>
PA Pascal Antonnaux <pascal@imatix.com>
BW Bruce Walter <walter@fortean.com>
RJ Rob Judd <judd@alphalink.com.au>

List of Functions

List of Symbol Definitions

prelude.h defines these symbols, possibly conditionally:
Symbol: Defined as:
ASSERT(f) (various)
DEBUG TRUE
DOES_BSDSIGNALS TRUE
DOES_SNPRINTF (various)
DOES_SOCKETS /* System supports BSD sockets */
DOES_UID /* System supports uid functions */
EXIT_FAILURE 1 /* GCC, sometimes. */
EXIT_SUCCESS 0 /* but not defined on SunOs with */
FALSE 0
FD_SETSIZE 1024 /* Max. filehandles/sockets */
FOREVER for (;;) /* FOREVER { ... } */
FORK_CHILD 0
FORK_ERROR -1 /* Return codes from fork() */
LINE_MAX 1024 /* Length of line from text file */
MSDOS_FILESYSTEM (various)
NAMEFOLD (various)
O_BINARY 0
O_NDELAY 0
O_NONBLOCK (various)
PATHEND (various)
PATHFOLD (various)
PATHSEP (various)
PATH_MAX 2048 /* if not previously #define'd */
PRELUDE_INCLUDED TRUE
SIGABRT 22 /* Termination by abort() */
SIGALRM (various)
SIGILL 4 /* Illegal instruction */
SIGINT 2 /* Ctrl-C sequence */
SIGSEGV 11 /* Segment violation */
SIGTERM 15 /* Kill signal */
STDERR_FILENO _fileno (stderr)
STDIN_FILENO _fileno (stdin)
STDOUT_FILENO _fileno (stdout)
TIMEZONE (various)
TRUE 1 /* ANSI standard */
_INCLUDE_HPUX_SOURCE TRUE
_INCLUDE_POSIX_SOURCE TRUE
_INCLUDE_XOPEN_SOURCE TRUE
__IS_32BIT__ /* Else assume 32-bit OS/compiler */
__IS_64BIT__ (various)
__MSDOS__ (various)
__NO_CTYPE /* Suppress warnings on tolower() */
__OS2__ TRUE
__STRICT_ANSI__ TRUE
__UNIX__ (various)
__UTYPE_AUX TRUE
__UTYPE_BEOS TRUE
__UTYPE_BSDOS TRUE
__UTYPE_DECALPHA TRUE
__UTYPE_FREEBSD TRUE
__UTYPE_GENERIC TRUE
__UTYPE_HPUX TRUE
__UTYPE_IBMAIX TRUE
__UTYPE_IRIX TRUE
__UTYPE_LINUX TRUE
__UTYPE_MIPS TRUE
__UTYPE_NETBSD TRUE
__UTYPE_NEXT TRUE
__UTYPE_QNX TRUE
__UTYPE_SCO TRUE
__UTYPE_SINIX TRUE
__UTYPE_SUNOS TRUE
__UTYPE_SUNSOLARIS TRUE
__UTYPE_UNIXWARE TRUE
__VMS_XOPEN TRUE
__VMS__ TRUE
__WINDOWS__ (various)
bit_clr(x,bit) ((x) &= ~bit_msk (bit))
bit_msk(bit) (1 << (bit))
bit_set(x,bit) ((x) |= bit_msk (bit))
bit_tst(x,bit) ((x) & bit_msk (bit))
environ _environ
local static void /* Shorthand for local functions */
max(a,b) (((a) > (b))? (a): (b))
memmove(d,s,l) bcopy (s,d,l)
min(a,b) (((a) < (b))? (a): (b))
random(num) (various)
randomize() srand ((unsigned) time (NULL))
sleep(a) (various)
snprintf _snprintf
strclr(s) (*(s) = 0)
streq(s1,s2) (!strcmp ((s1), (s2)))
strerror(n) sys_errlist [n]
strlast(s) ((s) [strlen (s) - 1])
strneq(s1,s2) (strcmp ((s1), (s2)))
strnull(s) (*(s) == 0)
strterm(s) ((s) [strlen (s)])
strused(s) (*(s) != 0)
tbllast(x) (x [tblsize (x) - 1])
tblsize(x) (sizeof (x) / sizeof ((x) [0]))
until(expr) while (!(expr)) /* do { ... } until (expr) */
vsnprintf _vsnprintf

List of Type Definitions

Type name: Defined as:
Bool unsigned short
byte unsigned char
dbyte unsigned short
dword unsigned long
function void (*) (void)
gid_t int
qbyte (various)
uid_t int
word unsigned short

| << | < | > | >> iMatix Copyright © 1996-2000 iMatix Corporation