tbamud/src/sysdep.h
Rumble ebc985f010 jeremyosborne | 2008-04-04 02:36:38 +0200 (Fri, 04 Apr 2008) | 1 line
Minor Bugfix: All game configuration settings now reference the world config 
structure, not the individual config variables found in config.c.
------------------------------------------------------------------------
 rumble | 2008-03-22 13:27:00 +0100 (Sat, 22 Mar 2008) | 1 line

Added lib/world/qst/ directory, index, index.mini, and 0.qst.
------------------------------------------------------------------------
 jeremyosborne | 2008-03-08 03:27:51 +0100 (Sat, 08 Mar 2008) | 3 lines

Bugfix: the include directory (for .h files) is now referenced correctly in the
depend statement.
Deletion: listrent.c removed as a separate utility.
------------------------------------------------------------------------
 jeremyosborne | 2008-03-08 03:08:51 +0100 (Sat, 08 Mar 2008) | 1 line

Enhancement: utils/ Makefile will now use a depends file, and looks for dependen
cies in the ../ directory (shrinks the necessary information to make each utilit
y).
------------------------------------------------------------------------
 Rumble | 2008-03-06 23:39:35 +0100 (Thu, 06 Mar 2008) | 1 line

Made TBA specific changes. do_cheat, removed help level checking, and advance to
level 32.
------------------------------------------------------------------------
 jeremyosborne | 2008-03-06 18:37:12 +0100 (Thu, 06 Mar 2008) | 1 line

Minor Update: Changed header of Makefile.in to read 'tbaMUD' and also added in a
ttribution for the changes. (Thanks seqwith.)
------------------------------------------------------------------------
 jeremyosborne | 2008-03-06 18:31:07 +0100 (Thu, 06 Mar 2008) | 4 lines

Changed Makefile.in to use glob expressions when building the objects. This 
translates into no longer a need to update Makefile.in whenever a new .c file 
is added to the mud code. Other Makefile.* have not yet been changed (and 
need review, anyway).

All CXREF cruft left in Makefile.in has been removed. tbaMUD is now using 
Doxygen. Technically, CXREF provides a bit more auto-documentation than Doxygen
does, however the tbaMUD (and legacy circle code) has never been marked-up with 
the special CXREF codes required to effectively use the program. Since Doxygen 
is easier to use, and provides almost as much functionality as CXREF, CXREF 
support has been dropped.
------------------------------------------------------------------------
 jeremyosborne | 2008-03-06 08:31:02 +0100 (Thu, 06 Mar 2008) | 1 line

Bug Fix: asciiflag_conv* functions now can handle a negative numeric value.
------------------------------------------------------------------------
 jeremyosborne | 2008-03-06 08:16:06 +0100 (Thu, 06 Mar 2008) | 1 line

Bug fix/enhancement: Charmed mobs (specifically charmed mobs with a ->master) 
will no longer attempt to wander off.
------------------------------------------------------------------------
 jeremyosborne | 2008-03-06 08:13:38 +0100 (Thu, 06 Mar 2008) | 6 lines

Based on the compiler warning about mag_materials being an unused function, and
the clone spell being unused.

Bug fix: Clone can now be cast. It is an 'ignore' target spell.

Fix and Modification: Clone, being an effectively unused spell that is only used
by mortal Magic Users at level 30, is now implemented as very simple example of
how to use mag_materials(). The item required by mag_materials is vnum 161, 
which in stock tbaMUD is some sacrificial entrails.
------------------------------------------------------------------------
 jeremyosborne | 2008-03-05 01:43:09 +0100 (Wed, 05 Mar 2008) | 3 lines

Bug Fix for "Did you mean:" including DG commands.
------------------------------------------------------------------------
 jeremyosborne | 2008-03-05 01:29:18 +0100 (Wed, 05 Mar 2008) | 3 lines

Bug Fix: do_simple_move slightly rewritten to handle Leave triggers that purge a
 door.

Documentation: do_simple_move documented.
------------------------------------------------------------------------
 Laoris | 2008-03-01 08:22:12 +0100 (Sat, 01 Mar 2008) | 1 line

Trial run of columnizer function on commands list to see how people like it.
------------------------------------------------------------------------
 jeremyosborne | 2008-02-26 22:36:17 +0100 (Tue, 26 Feb 2008) | 1 line

asciimap, an in game automap, along with a couple of minor bug fixes to do with
the automap, patched in (Thanks Jamdog).
------------------------------------------------------------------------
 jeremyosborne | 2008-02-22 04:08:05 +0100 (Fri, 22 Feb 2008) | 1 line

Minor update: Relocate local variable declaration to the top of ACMD(do_help)
------------------------------------------------------------------------
 jeremyosborne | 2008-02-22 04:04:37 +0100 (Fri, 22 Feb 2008) | 6 lines

Checked in the following placeholders for do_gen_tog:
#define SCMD_AUTOLOOT   24
#define SCMD_AUTOGOLD   25
#define SCMD_AUTOSPLIT  26
#define SCMD_AUTOSAC    27
#define SCMD_AUTOASSIST 28
------------------------------------------------------------------------
 jeremyosborne | 2008-02-22 03:57:06 +0100 (Fri, 22 Feb 2008) | 1 line

The Autoquest patch, along with a couple of minor bug fixes, has been integrated
into tbaMUD. (Thanks Jamdog, Kenneth Ray and Morgaelin.)
------------------------------------------------------------------------
 jeremyosborne | 2008-02-18 21:46:45 +0100 (Mon, 18 Feb 2008) | 2 lines

Minor Fix:
Casted NOWHERE, NOTHING, NOBODY and NOFLAG as IDXTYPE for the signed short int 
index types.
------------------------------------------------------------------------
 jeremyosborne | 2008-02-18 03:36:16 +0100 (Mon, 18 Feb 2008) | 7 lines

Added a new atoidx() conversion function for dealing with string to IDXTYPE 
conversions (in utils.c, prototype exported through utils.h).
Added IDXTYPE_MIN and IDXTYPE_MAX defines (in structs.h).
Replaced atoi references with atoidx in do_oasis_zedit (in zedit.c).
------------------------------------------------------------------------
 Rumble | 2008-02-18 01:44:13 +0100 (Mon, 18 Feb 2008) | 1 line

Fixed direction mapping to give readable directions instead of sub commands. 
------------------------------------------------------------------------
 jeremyosborne | 2008-02-18 00:26:15 +0100 (Mon, 18 Feb 2008) | 5 lines

Since general olc editing are automatically saved to disk, 'shutdown reboot' has
been changed to not-autosave by default. (Small change made to do_shutdown in 
act.wizard.c).
------------------------------------------------------------------------
 jeremyosborne | 2008-02-18 00:12:12 +0100 (Mon, 18 Feb 2008) | 3 lines

Changed:
struct attack_hit_type moved to fight.h
attack_hit_text exported through fight.h
------------------------------------------------------------------------
 jeremyosborne | 2008-02-17 22:32:51 +0100 (Sun, 17 Feb 2008) | 7 lines

- do_file heads or tails files correctly and has also been enhanced to return 
file info (act.wizard.c)
- defines made for common log files created by autorun, and those used by 
do_file (db.h)
- utility functions added: file_head(), file_tail(), file_sizeof(), and 
file_numlines() (defined utils.c and exported through utils.h)
------------------------------------------------------------------------
 Rumble | 2008-02-16 23:24:05 +0100 (Sat, 16 Feb 2008) | 1 line

Fixed export command. (thanks Kyle)
------------------------------------------------------------------------
 jeremyosborne | 2008-02-16 22:42:46 +0100 (Sat, 16 Feb 2008) | 1 line

Files are now tagged as executable. Should be able to be checked out from subver
sion and executed without running chmod.
------------------------------------------------------------------------
 Rumble | 2008-02-15 17:03:06 +0100 (Fri, 15 Feb 2008) | 1 line

 Fixed strcat() writing out of bounds in cedit.c since strdup() only malloc() 
strlen(str)+1 bytes. (thanks Buggo) and moved attack_hit_text back.
------------------------------------------------------------------------
 jeremyosborne | 2008-02-13 20:41:02 +0100 (Wed, 13 Feb 2008) | 1 line

Event queue function definitions, global variables and defines doxygenated.
------------------------------------------------------------------------
 Rumble | 2008-02-12 00:23:38 +0100 (Tue, 12 Feb 2008) | 1 line

Updated levels command to use an arg/range and added color parsing to greetings.
 (thanks Jamdog)
------------------------------------------------------------------------
 jeremyosborne | 2008-02-11 21:06:10 +0100 (Mon, 11 Feb 2008) | 1 line

Doxygen comments completed for weather.c
------------------------------------------------------------------------
 Rumble | 2008-02-11 03:52:50 +0100 (Mon, 11 Feb 2008) | 1 line

Corrected several 64-bit warnings. (thanks Buggo)
------------------------------------------------------------------------
 Rumble | 2008-02-10 22:56:56 +0100 (Sun, 10 Feb 2008) | 1 line

Added get_flag_by_name allowing for new trigedit variable checks like 
%actor.pref(FLAG)% checks. (thanks Jamdog)
------------------------------------------------------------------------
 jeremyosborne | 2008-02-08 21:22:26 +0100 (Fri, 08 Feb 2008) | 3 lines

COMPLETE: tbaMUD code re-org of global and local scope function and variable 
declarations. There may be a few things that I did not catch (some non extern 
keyword declarations of function prototypes within other functions, for 
example).

BUG FIX: Unused functions encrypt_hex() and decrypt_hex() removed from mail.c.
------------------------------------------------------------------------
 jeremyosborne | 2008-02-05 23:31:09 +0100 (Tue, 05 Feb 2008) | 2 lines

Continued clean-up of 'extern' references to functions and variables.
BUG UNCOVERED: set_title() in class.c incorrectly handles the const nature of 
the char * returned from title_female and title_male.
------------------------------------------------------------------------
 jeremyosborne | 2008-02-05 19:38:17 +0100 (Tue, 05 Feb 2008) | 3 lines

More work on mud clean-up.
New file: spec_procs.h
Created this file to house the legacy special procedures (spec_procs.c and 
castle.c) and special feature assignment in general.
------------------------------------------------------------------------
 jeremyosborne | 2008-02-05 00:59:44 +0100 (Tue, 05 Feb 2008) | 3 lines

- Minor Bugfix: Fixed parse error in mobact.c
- Minor Bugfix: act.h is now included in all of the act functions. Forgot to do
that the first time :(
- Additions: ban.h has been added as the external entry point into the ban.c 
globals and functions. Files needing ban.h have been updated.
------------------------------------------------------------------------
 jeremyosborne | 2008-02-04 20:02:11 +0100 (Mon, 04 Feb 2008) | 1 line

All act*.c functions, defines and globals have been prototyped/declared in 
act.h. The file act.h does not contain every ACMD, only those ACMDs and 
utility functions available within the act*.c files.
------------------------------------------------------------------------
 Rumble | 2008-02-04 17:59:47 +0100 (Mon, 04 Feb 2008) | 1 line

Fixed the last few flags missed for the 128 bit conversion.
------------------------------------------------------------------------
 Laoris | 2008-02-04 07:27:56 +0100 (Mon, 04 Feb 2008) | 3 lines

Adding a column formatter for lists.  Accepts printf-like arguments.
Only used by medit right now.

------------------------------------------------------------------------
 jeremyosborne | 2008-02-04 07:09:19 +0100 (Mon, 04 Feb 2008) | 2 lines

- Changed the 'struct queue' to 'struct dg_queue' to avoid namespace conflicts.
- Ongoing cleanup to mud project.
------------------------------------------------------------------------
 Rumble | 2008-02-04 00:07:09 +0100 (Mon, 04 Feb 2008) | 1 line

Fixed run_autowiz which ran twice on advancement.
------------------------------------------------------------------------
 jeremyosborne | 2008-02-03 03:46:22 +0100 (Sun, 03 Feb 2008) | 1 line

act.h created and added. This header will be the external entry point for the 
functions, function subcommands and variables within the act*.c files. It is 
not designed to be the entry point for all ACMD functions.
------------------------------------------------------------------------
 jeremyosborne | 2008-02-03 02:44:29 +0100 (Sun, 03 Feb 2008) | 1 line

Merge of another part of the code cleanup, the dg script stuff.
------------------------------------------------------------------------
 jeremyosborne | 2008-02-02 08:56:03 +0100 (Sat, 02 Feb 2008) | 1 line

Modularizing and organizing files continues. Committing comm.c and comm.h 
because they are hairy, and I don't want to do them over if my hard drive 
crashes.
------------------------------------------------------------------------
 jeremyosborne | 2008-02-02 07:05:08 +0100 (Sat, 02 Feb 2008) | 4 lines

- Marking all file scope functions as 'static'
- Reorganization of the global variables and functions.
------------------------------------------------------------------------
 jeremyosborne | 2008-01-31 10:20:47 +0100 (Thu, 31 Jan 2008) | 1 line

* Protected the conf.h.* system config files from multiple calls.
------------------------------------------------------------------------
 jeremyosborne | 2008-01-31 09:56:18 +0100 (Thu, 31 Jan 2008) | 1 line

* Removed extraneous references to TRUE / FALSE and YES / NO defines.
------------------------------------------------------------------------
 jeremyosborne | 2008-01-31 09:46:20 +0100 (Thu, 31 Jan 2008) | 2 lines

* BUGFIX: NUM_POSITIONS set to 8 (was incorrectly set to 15 before)
* Migrated NUM_* settings from oasis.h to more appropriate locations near where
they are defined. (For Example: NUM_POSITIONS moved to structs.h next to the 
POSITION_* defines.)
------------------------------------------------------------------------
 jeremyosborne | 2008-01-31 03:58:28 +0100 (Thu, 31 Jan 2008) | 1 line

Added Appendix A - Coder Support. Right now, it simply speaks to the fact that 
we have included doxygen config files, are working to document the source code, 
and provides a rudimentary "do this" guide to create the doxygen cross 
references.
------------------------------------------------------------------------
 jeremyosborne | 2008-01-30 07:12:07 +0100 (Wed, 30 Jan 2008) | 2 lines

- All .h files now have doxygen recognized headers, and the format is slightly 
altered to ease editing of headers.
- Protected all .h files from multiple calls. (Standard format is #ifndef _HEADE
R_H_ #define _HEADER_H_ .... #endif)
------------------------------------------------------------------------
 jeremyosborne | 2008-01-29 11:18:14 +0100 (Tue, 29 Jan 2008) | 1 line

constants.h, structs.h and utils.h now protected from multiple includes. This is
 sometimes overkill, but good practice overall.
------------------------------------------------------------------------
 jeremyosborne | 2008-01-29 10:38:18 +0100 (Tue, 29 Jan 2008) | 1 line

Updated documentation for constants.c and constants.h.
------------------------------------------------------------------------
 jeremyosborne | 2008-01-29 10:15:25 +0100 (Tue, 29 Jan 2008) | 3 lines

The standard Doxygen configuration doxyfiles (config files) for tbaMUD. One is 
to be used with the Graphviz DOT (dox_withGraphs), one is designed to be used if
Graphviz is not available.

Now just need a short document describing the usage of doxygen.
------------------------------------------------------------------------
 jeremyosborne | 2008-01-29 10:11:36 +0100 (Tue, 29 Jan 2008) | 1 line

Minor document correction in struct dex_app_tpe.
------------------------------------------------------------------------
 jeremyosborne | 2008-01-28 20:53:51 +0100 (Mon, 28 Jan 2008) | 1 line

*bugfix* do_drink command: When a container is empty, the correct, "It is 
empty." message is now displayed.
------------------------------------------------------------------------
 jeremyosborne | 2008-01-28 07:58:15 +0100 (Mon, 28 Jan 2008) | 3 lines

Merging changes to trunk for:
* utils.h, utils.c and structs.h doxygen comments
* adding file dox_withGraphs.doxyfile
2008-04-12 01:31:58 +00:00

580 lines
14 KiB
C

/**
* @file sysdep.h
* Machine-specific defs based on values in conf.h (from configure)
*
* Part of the core tbaMUD source code distribution, which is a derivative
* of, and continuation of, CircleMUD.
*
* All rights reserved. See license for complete information.
* Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University
* CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991.
*/
#ifndef _SYSDEP_H_
#define _SYSDEP_H_
/* Configurables: tbaMUD uses the crypt(3) function to encrypt player passwords
* in the players file so that they are never stored in plaintext form. However,
* due to U.S. export restrictions on machine-readable cryptographic software,
* the crypt() function is not available on some operating systems such as
* FreeBSD. By default, the 'configure' script will determine if you have
* crypt() available and enable or disable password encryption appropriately.
* #define NOCRYPT (by uncommenting the line below) if you'd like to explicitly
* disable password encryption (i.e., if you have moved your MUD from an OS that
* does not support encryption to one that does). */
/* #define NOCRYPT */
/* If you are porting tbaMUD to a new (untested) platform and you find that
* POSIX-standard non-blocking I/O does *not* work, you can define the constant
* below to work around the problem. Not having non-blocking I/O can cause the
* MUD to freeze if someone types part of a command while the MUD waits for the
* remainder of the command.
*
* NOTE: **DO** **NOT** use this constant unless you are SURE you understand
* exactly what non-blocking I/O is, and you are SURE that your operating system
* does NOT have it! (The only UNIX system I've ever seen that has broken POSIX
* non-blocking I/O is AIX 3.2.) If your MUD is freezing but you're not sure
* why, do NOT use this constant. Use this constant ONLY if you're sure that
* your MUD is freezing because of a non-blocking I/O problem. */
/* #define POSIX_NONBLOCK_BROKEN */
/* The code prototypes library functions to avoid compiler warnings. (Operating
* system header files *should* do this, but sometimes don't.) However, Circle's
* prototypes cause the compilation to fail under some combinations of operating
* systems and compilers. If your compiler reports "conflicting types" for
* functions, you need to define this constant to turn off library function
* prototyping. Note, **DO** **NOT** blindly turn on this constant unless you
* are sure the problem is type conflicts between my header files and the header
* files of your operating system. The error message will look something like
* this: In file included from comm.c:14:
* sysdep.h:207: conflicting types for `random'
* /usr/local/lib/gcc-lib/alpha-dec-osf3.2/2.7.2/include/stdlib.h:253:
* previous declaration of `random' */
/* #define NO_LIBRARY_PROTOTYPES */
/* If using the GNU C library, version 2+, then you can have it trace memory
* allocations to check for leaks, uninitialized uses, and bogus free() calls.
* To see if your version supports it, run:
* info libc 'Allocation Debugging' 'Tracing malloc'
* Example usage (Bourne shell):
* MALLOC_TRACE=/tmp/circle-trace bin/circle
* Read the entire "Allocation Debugging" section of the GNU C library
* documentation before setting this to '1'. */
#define CIRCLE_GNU_LIBC_MEMORY_TRACK 0 /* 0 = off, 1 = on */
/* Do not change anything below this line. */
/* Set up various machine-specific things based on the values determined from
* configure and conf.h. */
#include <stdio.h>
#include <ctype.h>
#include <stdarg.h>
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#if (defined (STDC_HEADERS) || defined (__GNU_LIBRARY__))
#include <stdlib.h>
#else /* No standard headers. */
#ifdef HAVE_MEMORY_H
#include <memory.h>
#endif
extern char *malloc(), *calloc(), *realloc();
extern void free ();
extern void abort (), exit ();
#endif /* Standard headers. */
/* POSIX compliance */
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef CIRCLE_WINDOWS
# include <sys\types.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
/* Now, we #define POSIX if we have a POSIX system. */
#ifdef HAVE_UNISTD_H
/* Ultrix's unistd.h always defines _POSIX_VERSION, but you only get
POSIX.1 behavior with `cc -YPOSIX', which predefines POSIX itself! */
#if defined (_POSIX_VERSION) && !defined (ultrix)
#define POSIX
#endif
/* Some systems define _POSIX_VERSION but are not really POSIX.1. */
#if (defined (butterfly) || defined (__arm) || \
(defined (__mips) && defined (_SYSTYPE_SVR3)) || \
(defined (sequent) && defined (i386)))
#undef POSIX
#endif
#endif /* HAVE_UNISTD_H */
#if !defined (POSIX) && defined (_AIX) && defined (_POSIX_SOURCE)
#define POSIX
#endif
#if defined(_AIX)
#define POSIX_NONBLOCK_BROKEN
#endif
/* Header files common to all source files */
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#ifdef HAVE_NET_ERRNO_H
#include <net/errno.h>
#endif
/* Macintosh */
#ifdef HAVE_SYS_ERRNO_H
#include <sys/errno.h>
#endif
#ifdef HAVE_CRYPT_H
#include <crypt.h>
#endif
#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
# include <sys/time.h>
# else
# include <time.h>
# endif
#endif
#ifdef HAVE_ASSERT_H
#include <assert.h>
#else
#define assert(arg)
#endif
/* Header files only used in comm.c and some of the utils */
#if defined(__COMM_C__) || defined(CIRCLE_UTIL)
#ifndef HAVE_STRUCT_IN_ADDR
struct in_addr {
unsigned long int s_addr; /* for inet_addr, etc. */
}
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_SYS_FCNTL_H
#include <sys/fcntl.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
#ifdef HAVE_SYS_RESOURCE_H
# include <sys/resource.h>
#endif
#ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>
#endif
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
#endif
#ifdef HAVE_NETDB_H
# include <netdb.h>
#endif
#ifdef HAVE_SIGNAL_H
# ifndef _POSIX_C_SOURCE
# define _POSIX_C_SOURCE 2
# include <signal.h>
# undef _POSIX_C_SOURCE
# else
# include <signal.h> /* GNU libc 6 already defines _POSIX_C_SOURCE. */
# endif
#endif
#ifdef HAVE_SYS_UIO_H
# include <sys/uio.h>
#endif
#endif /* __COMM_C__ && CIRCLE_UNIX */
/* Header files that are only used in act.other.c */
#ifdef __ACT_OTHER_C__
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#endif /* __ACT_OTHER_C__ */
/* Basic system dependencies. */
#if CIRCLE_GNU_LIBC_MEMORY_TRACK && !defined(HAVE_MCHECK_H)
#error "Cannot use GNU C library memory tracking without <mcheck.h>"
#endif
/* strcasecmp -> stricmp -> str_cmp */
#if defined(HAVE_STRCASECMP)
# define str_cmp strcasecmp
#elif defined(HAVE_STRICMP)
# define str_cmp stricmp
#endif
/* strncasecmp -> strnicmp -> strn_cmp */
#if defined(HAVE_STRNCASECMP)
# define strn_cmp strncasecmp
#elif defined(HAVE_STRNICMP)
# define strn_cmp strnicmp
#endif
#if !defined(__GNUC__)
# define __attribute__(x) /* nothing */
#endif
#if defined(__MWERKS__)
# define isascii(c) (((c) & ~0x7f) == 0) /* So easy to have, but ... */
#endif
/* Socket/header miscellany. */
#if defined(CIRCLE_WINDOWS) /* Definitions for Win32 */
# define snprintf _snprintf
# define vsnprintf _vsnprintf
# define PATH_MAX MAX_PATH
# if !defined(__BORLANDC__) && !defined(LCC_WIN32) /* MSVC */
# define chdir _chdir
# pragma warning(disable:4761) /* Integral size mismatch. */
# pragma warning(disable:4244) /* Possible loss of data. */
# endif
# if defined(__BORLANDC__) /* Silence warnings we don't care about. */
# pragma warn -par /* to turn off >parameter< 'ident' is never used. */
# pragma warn -pia /* to turn off possibly incorrect assignment. 'if (!(x=a))' */
# pragma warn -sig /* to turn off conversion may lose significant digits. */
# endif
# ifndef _WINSOCK2API_ /* Winsock1 and Winsock 2 conflict. */
# include <winsock.h>
# endif
# ifndef FD_SETSIZE /* MSVC 6 is reported to have 64. */
# define FD_SETSIZE 1024
# endif
#elif defined(CIRCLE_VMS)
/* Necessary Definitions For DEC C With DEC C Sockets Under OpenVMS. */
# if defined(DECC)
# include <stdio.h>
# include <time.h>
# include <stropts.h>
# include <unixio.h>
# endif
#elif !defined(CIRCLE_MACINTOSH) && !defined(CIRCLE_UNIX) && !defined(CIRCLE_ACORN)
# error "You forgot to include conf.h or do not have a valid system define."
#endif
/* SOCKET -- must be after the winsock.h #include. */
#ifdef CIRCLE_WINDOWS
# define CLOSE_SOCKET(sock) closesocket(sock)
typedef SOCKET socket_t;
#else
# define CLOSE_SOCKET(sock) close(sock)
typedef int socket_t;
#endif
#if defined(__cplusplus) /* C++ */
#define cpp_extern extern
#else /* C */
#define cpp_extern /* Nothing */
#endif
/* Guess if we have the getrlimit()/setrlimit() functions */
#if defined(RLIMIT_NOFILE) || defined (RLIMIT_OFILE)
#define HAS_RLIMIT
#if !defined (RLIMIT_NOFILE)
# define RLIMIT_NOFILE RLIMIT_OFILE
#endif
#endif
/* Make sure we have STDERR_FILENO */
#ifndef STDERR_FILENO
#define STDERR_FILENO 2
#endif
/* Make sure we have STDOUT_FILENO too. */
#ifndef STDOUT_FILENO
#define STDOUT_FILENO 1
#endif
#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)
# include "bsd-snprintf.h"
#endif
/* Function prototypes. */
/* Header files of many OS's do not contain function prototypes for the
* standard C library functions. This produces annoying warning messages
* (sometimes, a lot of them) on such OS's when compiling with gcc's -Wall.
*
* Configuration script has been changed to detect which prototypes exist
* already; this header file only prototypes functions that aren't already
* prototyped by the system headers. A clash should be impossible. This
* should give us our strong type-checking back. */
#ifndef NO_LIBRARY_PROTOTYPES
#ifdef NEED_ATOI_PROTO
int atoi(const char *str);
#endif
#ifdef NEED_ATOL_PROTO
long atol(const char *str);
#endif
/* bzero is deprecated - use memset() instead. This prototype is needed for
* FD_xxx macros on some machines. */
#ifdef NEED_BZERO_PROTO
void bzero(char *b, int length);
#endif
#ifdef NEED_CRYPT_PROTO
char *crypt(const char *key, const char *salt);
#endif
#ifdef NEED_FCLOSE_PROTO
int fclose(FILE *stream);
#endif
#ifdef NEED_FDOPEN_PROTO
FILE *fdopen(int fd, const char *mode);
#endif
#ifdef NEED_FFLUSH_PROTO
int fflush(FILE *stream);
#endif
#ifdef NEED_FPRINTF_PROTO
int fprintf(FILE *strm, const char *format, /* args */ ... );
#endif
#ifdef NEED_FREAD_PROTO
size_t fread(void *ptr, size_t size, size_t nitems, FILE *stream);
#endif
#ifdef NEED_FSCANF_PROTO
int fscanf(FILE *strm, const char *format, ...);
#endif
#ifdef NEED_FSEEK_PROTO
int fseek(FILE *stream, long offset, int ptrname);
#endif
#ifdef NEED_FWRITE_PROTO
size_t fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream);
#endif
#ifdef NEED_GETPID_PROTO
pid_t getpid(void);
#endif
#ifdef NEED_PERROR_PROTO
void perror(const char *s);
#endif
#ifdef NEED_QSORT_PROTO
void qsort(void *base, size_t nel, size_t width,
int (*compar) (const void *, const void *));
#endif
#ifdef NEED_REWIND_PROTO
void rewind(FILE *stream);
#endif
#ifdef NEED_SPRINTF_PROTO
int sprintf(char *s, const char *format, /* args */ ... );
#endif
#ifdef NEED_SSCANF_PROTO
int sscanf(const char *s, const char *format, ...);
#endif
#ifdef NEED_STRDUP_PROTO
char *strdup(const char *txt);
#endif
#ifdef NEED_STRERROR_PROTO
char *strerror(int errnum);
#endif
#ifdef NEED_STRLCPY_PROTO
size_t strlcpy(char *dest, const char *src, size_t copylen);
#endif
#ifdef NEED_SYSTEM_PROTO
int system(const char *string);
#endif
#ifdef NEED_TIME_PROTO
time_t time(time_t *tloc);
#endif
#ifdef NEED_UNLINK_PROTO
int unlink(const char *path);
#endif
#ifdef NEED_REMOVE_PROTO
int remove(const char *path);
#endif
/* Function prototypes that are only used in comm.c and some of the utils */
#if defined(__COMM_C__) || defined(CIRCLE_UTIL)
#ifdef NEED_ACCEPT_PROTO
int accept(socket_t s, struct sockaddr *addr, int *addrlen);
#endif
#ifdef NEED_BIND_PROTO
int bind(socket_t s, const struct sockaddr *name, int namelen);
#endif
#ifdef NEED_CHDIR_PROTO
int chdir(const char *path);
#endif
#ifdef NEED_CLOSE_PROTO
int close(int fildes);
#endif
#ifdef NEED_FCNTL_PROTO
int fcntl(int fildes, int cmd, /* arg */ ...);
#endif
#ifdef NEED_FPUTC_PROTO
int fputc(char c, FILE *stream);
#endif
#ifdef NEED_FPUTS_PROTO
int fputs(const char *s, FILE *stream);
#endif
#ifdef NEED_GETPEERNAME_PROTO
int getpeername(socket_t s, struct sockaddr *name, int *namelen);
#endif
#if defined(HAS_RLIMIT) && defined(NEED_GETRLIMIT_PROTO)
int getrlimit(int resource, struct rlimit *rlp);
#endif
#ifdef NEED_GETSOCKNAME_PROTO
int getsockname(socket_t s, struct sockaddr *name, int *namelen);
#endif
#ifdef NEED_GETTIMEOFDAY_PROTO
void gettimeofday(struct timeval *tp, void * );
#endif
#ifdef NEED_HTONL_PROTO
ulong htonl(u_long hostlong);
#endif
#ifdef NEED_HTONS_PROTO
u_short htons(u_short hostshort);
#endif
#if defined(HAVE_INET_ADDR) && defined(NEED_INET_ADDR_PROTO)
unsigned long int inet_addr(const char *cp);
#endif
#if defined(HAVE_INET_ATON) && defined(NEED_INET_ATON_PROTO)
int inet_aton(const char *cp, struct in_addr *inp);
#endif
#ifdef NEED_INET_NTOA_PROTO
char *inet_ntoa(const struct in_addr in);
#endif
#ifdef NEED_LISTEN_PROTO
int listen(socket_t s, int backlog);
#endif
#ifdef NEED_NTOHL_PROTO
u_long ntohl(u_long netlong);
#endif
#ifdef NEED_PRINTF_PROTO
int printf(char *format, ...);
#endif
#ifdef NEED_READ_PROTO
ssize_t read(int fildes, void *buf, size_t nbyte);
#endif
#ifdef NEED_SELECT_PROTO
int select(int nfds, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *timeout);
#endif
#ifdef NEED_SETITIMER_PROTO
int setitimer(int which, const struct itimerval *value,
struct itimerval *ovalue);
#endif
#if defined(HAS_RLIMIT) && defined(NEED_SETRLIMIT_PROTO)
int setrlimit(int resource, const struct rlimit *rlp);
#endif
#ifdef NEED_SETSOCKOPT_PROTO
int setsockopt(socket_t s, int level, int optname, const char *optval,
int optlen);
#endif
#ifdef NEED_SOCKET_PROTO
int socket(int domain, int type, int protocol);
#endif
#ifdef NEED_WRITE_PROTO
ssize_t write(int fildes, const void *buf, size_t nbyte);
#endif
#endif /* __COMM_C__ */
#endif /* NO_LIBRARY_PROTOTYPES */
#endif /* _SYSDEP_H_ */