/
driver3.2@242/autoconf/
driver3.2@242/doc/LPC/
driver3.2@242/hosts/
driver3.2@242/hosts/amiga/NetIncl/
driver3.2@242/hosts/amiga/NetIncl/netinet/
driver3.2@242/hosts/amiga/NetIncl/sys/
driver3.2@242/hosts/atari/
driver3.2@242/hosts/fcrypt/
driver3.2@242/mudlib/
driver3.2@242/mudlib/sys/
driver3.2@242/util/
driver3.2@242/util/indent/hosts/next/
driver3.2@242/util/make_docs/
#ifndef LINT_H
#define LINT_H

#include "config.h"

#if HAVE_ALLOCA_H
#include <alloca.h>
#else /* !HAVE_ALLOCA_H */
#ifdef __GNUC__
#define alloca __builtin_alloca
#else /* !__GNUC__ */
#ifdef _AIX
 #pragma alloca
#endif /* _AIX */
#endif /* !__GNUC__ */
#endif /* !HAVE_ALLOCA_H */

/*
 * Some structure forward declarations are needed.
 */
struct program;
struct function;
struct svalue;
struct sockaddr;
struct variable;

#ifndef LANG
struct s_lrvalue { struct s_lrvalue *fake_member; };
#endif

#ifdef BUFSIZ
#    define PROT_STDIO(x) PROT(x)
#else /* BUFSIZ */
#    define PROT_STDIO(x) ()
#endif /* BUFSIZ */

#ifdef __STDC__
#    define PROT(x) x
#else /* __STDC__ */
#    define PROT(x) ()
#endif /* __STDC */

#if defined(__GNUC__)
#define VOLATILE volatile
#else
#define VOLATILE
#endif

#if (defined(__GNUC__) || defined(inline)) && !defined(DEBUG)
#define INLINE inline
#else
#define INLINE
#endif

#if defined(__GNUC__) && !defined(DEBUG) && defined(INTERPRET)
#define INTER_INLINE inline
#else
#define INTER_INLINE
#endif

#if defined(__GNUC__) && !defined(DEBUG) && defined(STRALLOC)
#define STRALLOC_INLINE inline
#else
#define STRALLOC_INLINE
#endif

#define _MCTe 0x01 /* escaped character in save/restore object. */
#define _MCTd 0x02 /* numeric digit		*/


#define _MCTs 0x10 /* whitespace EXCLUDING '\n'	*/

#define _MCTx 0x40 /* hexadecimal		*/
#define _MCTa 0x80 /* alphanumeric or '_' 	*/
extern unsigned char _my_ctype[];
#define isescaped(c) (_my_ctype[(unsigned char)(c)]&_MCTe)
#define isalunum( c) (_my_ctype[(unsigned char)(c)]&_MCTa)
#define lexdigit( c) (_my_ctype[(unsigned char)(c)]&_MCTd)

#if defined(sun) && !defined(solaris)
#define SunOS4
#endif

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_LIBC_H
#include <libc.h>
#endif
#if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
#include <memory.h>
#endif
#ifdef HAVE_VALUES_H
#include <values.h>
#endif
#ifdef AMIGA
#include "hosts/amiga/patchfloat.h"
#endif /* AMIGA */
#ifdef ATARI_TT
#include <math-688.h>
#define _MATH_H
#endif
#include <math.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#else
#include <strings.h>
#endif
#include <sys/types.h>
#ifdef HAVE_BSTRING_H
#include <bstring.h>
#endif
#if defined(AMIGA) && defined(_DCC)
extern int current_time;
#define MY_TRUE (current_time)
#define MY_FALSE (!current_time)
#else
#define MY_TRUE (1)
#define MY_FALSE (0)
#endif

#if defined(MALLOC_smalloc) && !defined(MAKE_FUNC)
#if !defined( SMALLOC ) || defined( SBRK_OK )
#undef malloc
#endif
#undef calloc
#ifdef SBRK_OK
#define amalloc         malloc
#define afree           free
#else  /* SBRK_OK */
POINTER amalloc PROT((size_t));
POINTER smalloc_calloc PROT((size_t, size_t));
FREE_RETURN_TYPE afree PROT((POINTER));
#ifndef SMALLOC
#define malloc  amalloc
#endif
#define calloc  smalloc_calloc
#define free    afree
#endif /* SBRK_OK */
void xfree PROT((POINTER));
POINTER rexalloc PROT((POINTER, size_t));
#if MALLOC_ALIGN > SIZEOF_P_INT
#define PFREE_RETURN_TYPE void
#define PFREE_RETURN return;
PFREE_RETURN_TYPE pfree PROT((POINTER));
#else  /* MALLOC_ALIGN */
#define PFREE_RETURN_TYPE FREE_RETURN_TYPE
#define PFREE_RETURN FREE_RETURN
#define pfree  afree
#endif /* MALLOC_ALIGN */
POINTER permanent_xalloc PROT((size_t));
PFREE_RETURN_TYPE pfree PROT((POINTER));
#else  /* MALLOC_smalloc */
#define xfree free
#define rexalloc realloc
#define amalloc         xalloc
#define permanent_xalloc xalloc
#define afree           free
#define pfree		free
#endif /* MALLOC_smalloc */

#if defined(SunOS4) || defined (ultrix)
void bzero PROT((char *, int));
#endif
#if defined(SunOS4)
/* These prototypes used to have a wider scope, but I suspect they are
 * only needed on suns.
 */
void srandom PROT((int));
int gethostname PROT((char *, int));
char *_crypt PROT((char *, char *));
int ioctl PROT((int, ...)); /* should be in <ioctl.h> */
#endif
#ifdef SunOS4
/* cc won't see the types inside PROT(), because it isn't ansi. gcc < 2.5
 * hasn't these prototypes, but 2.5 has, thus types must match.
 */
extern int rename PROT((const char *, const char *));
extern void perror PROT((const char *));
extern long int strtol PROT((const char *, char **, int));
#endif

#ifdef DRAND48
double drand48 PROT((void));
#endif
#ifdef RANDOM
long random PROT((void));
#endif
#ifndef HAVE_MEMMEM
char *memmem PROT((char *, size_t, char *, size_t));
#endif
#if (!defined(HAVE_CRYPT) && !defined(HAVE__CRYPT))
char *crypt PROT((char *, char *));
#endif

struct object;
void save_error PROT((char *, char *, int));
int write_file PROT((char *, char *));
int file_size PROT((char *));
void remove_all_players PROT((void));
void load_wiz_file PROT((void));
void wizlist PROT((char *));
void backend PROT((void));
#if defined(MALLOC_smalloc) && defined(SMALLOC_TRACE)
#define xalloc(size) (smalloc((size), __FILE__, __LINE__))
POINTER smalloc PROT((size_t, char *, int));
#ifdef __STDC__
#define string_copy(s) (_string_copy(s, __FILE__ "::string_copy", __LINE__))
char *_string_copy PROT((char *, char *, int));
#endif /* __STDC__ */
#endif /* SMALLOC_TRACE */
#ifndef xalloc
POINTER xalloc PROT((size_t));
#endif
#ifndef string_copy
char *string_copy PROT((char *));
#endif
void init_string_space PROT((void));
#ifdef AMIGA
VOLATILE void error PROT((char *, ...));
#else
/*VARARGS1*/
VOLATILE void error();
#endif
VOLATILE void fatal();
void add_message();
void trace_log();
void debug_message();
void debug_message_value PROT((struct svalue *)),
	print_local_commands(),
	new_call_out PROT((struct svalue *, int)),
	list_files PROT((char *)),
	enable_commands PROT((int)),
	load_ob_from_swap PROT((struct object *));
int add_action PROT((struct svalue *, struct svalue *, int));
int tail PROT((char *));
struct object *get_interactive_object PROT((int));
void enter_object_hash PROT((struct object *));
void remove_object_hash PROT((struct object *));
struct object *lookup_object_hash PROT((char *));
int show_otable_status PROT((int verbose));
void dumpstat PROT((void));
struct vector;
void free_vector PROT((struct vector *));
void set_vector_user PROT((struct vector *, struct object *ob));
void free_empty_vector PROT((struct vector *));
char *query_load_av PROT((void));
void update_compile_av PROT((int));
void map_array PROT((
		       struct vector *arr,
		       char *func,
		       struct object *ob,
		       int num_extra,
		       struct svalue *extra
		       ));
struct vector *order_alist PROT((struct svalue *, int, int));
struct vector *make_unique PROT((struct vector *arr,char *func,
    struct svalue *skipnum));

char *describe_items PROT((struct svalue *arr,char *func,int live));
struct vector *filter PROT((struct vector *arr,char *func,
			    struct object *ob, int, struct svalue *)); 
struct vector *filter_objects PROT((struct vector *arr, char *func,
				    int num_arg, struct svalue *args));
void map_objects PROT((struct vector *arr, char *func,
				    int num_arg, struct svalue *args));
int match_string PROT((char *, char *, mp_int));
int set_heart_beat PROT((struct object *, int));
struct svalue;

/* When you expect special lvalues, use assign_svalue/transfer_svalue . */
void assign_svalue PROT((struct svalue *, struct svalue *));
void transfer_svalue PROT((struct svalue *, struct svalue *));

INTER_INLINE void
  assign_svalue_no_free   PROT((struct svalue *to, struct svalue *from)),
  transfer_svalue_no_free PROT((struct svalue *to, struct svalue *from)),
  free_string_svalue      PROT((struct svalue *));
void free_svalue PROT((struct svalue *));
void set_svalue_user PROT((struct svalue *, struct object *));
VOLATILE void bad_efun_arg PROT((int, int, struct svalue *));
char *make_shared_string PROT((char *));
char *findstring PROT((char *));
STRALLOC_INLINE void decrement_string_ref PROT((char *));
void free_string PROT((char *));
struct lambda *lambda PROT((struct vector *, struct svalue *, struct object *));
void free_closure PROT((struct svalue *));
void set_closure_user PROT((struct svalue *, struct object *));
void call_lambda PROT((struct svalue *, int));
int add_string_status PROT((int verbose));
void notify_no_command PROT((void));
void clear_notify PROT((void));
void throw_error PROT((void));
void set_living_name PROT((struct object *,char *));
void remove_living_name PROT((struct object *));
struct object *find_living_object PROT((char *, int));
int lookup_predef PROT((char *));
void yyerror PROT((char *));
#if defined(AMIGA)
void yyerrorf PROT((char *format, ...));
#else
/*VARARGS1*/
void yyerrorf();
#endif
int hashstr PROT((char *, int, int));
int whashstr PROT((char *, int));
int chashstr PROT((char *, int));
int lookup_predef PROT((char *));
char *dump_trace PROT((int));
int parse_command PROT((char *, struct object *));
struct svalue *apply PROT((char *, struct object *, int));
struct svalue *secure_apply PROT((char *, struct object *, int));
struct svalue *sapply PROT((char *, struct object *, int));
int find_function PROT((char *, struct program *));
void push_string_malloced PROT((char *));
void push_string_shared   PROT((char *));
void push_malloced_string PROT((char *));
void push_shared_string   PROT((char *));
void push_number PROT((int));
void push_object PROT((struct object *));
void push_referenced_vector PROT((struct vector *));
INTER_INLINE void pop_stack PROT((void));
void drop_stack PROT((void));
int _privilege_violation PROT((char *, struct svalue *, struct svalue *));
int privilege_violation4
	PROT((char *, struct object *, char *, struct svalue *));
struct object *clone_object PROT((char *));
void init_num_args PROT((void));
int restore_object PROT((struct object *, char *));
void tell_object PROT((struct object *, char *));
struct object *first_inventory PROT((struct svalue *));
struct vector *slice_array PROT((struct vector *,int,int));
int query_idle PROT((struct object *));
char *implode_string PROT((struct vector *, char *));
struct object *query_snoop PROT((struct object *));
struct vector *all_inventory PROT((struct object *));
struct vector *deep_inventory PROT((struct object *, int));
struct object *environment PROT((struct svalue *));
struct vector *add_array PROT((struct vector *, struct vector *));
char *get_f_name PROT((int));

void startshutdowngame ();
void startmasterupdate ();

void set_notify_fail_message PROT((char *));
int swap PROT((struct object *));
void set_swapbuf PROT((char *));
int transfer_object PROT((struct object *, struct object *));
struct vector *users PROT((void));
void do_write PROT((struct svalue *));
void log_file PROT((char *, char *));
void remove_call_out PROT((struct object *, struct svalue *));
char *create_wizard PROT((char *, char *));
void destruct_object PROT((struct svalue *));
void emergency_destruct PROT((struct object *));
void set_snoop PROT((struct object *, struct object *));
int new_set_snoop PROT((struct object *, struct object *));
void add_verb PROT((char *, int));
void ed_start PROT((char *, char *, struct object *));
void say PROT((struct svalue *, struct vector *));
void tell_room PROT((struct object *, struct svalue *, struct vector *));
void shout_string PROT((char *));
int command_for_object PROT((char *, struct object *));
int remove_file PROT((char *));
int print_file PROT((char *, int, int));
int print_call_out_usage PROT((int verbose));
struct svalue *input_to PROT((struct svalue *, int));
int parse PROT((char *, struct svalue *, char *, struct svalue *, int));
struct object *object_present PROT((struct svalue *, struct object *));
void add_light PROT((struct object *, int));
int indent_program PROT((char *));
void call_function PROT((struct program *, int));
void store_line_number_info PROT((void));
void store_include_info PROT((char *));
void store_include_end PROT((void));
void push_volatile_string PROT((char *));
void store_line_number_relocation PROT((int));
#define push_constant_string(str) push_volatile_string(str)
void push_svalue PROT((struct svalue *));
void push_lrvalue PROT((struct svalue *));
void push_svalue_block PROT((int, struct svalue *));
void free_prog PROT((struct program *, int));
void stat_living_objects PROT((void));
int heart_beat_status PROT((int verbose));
void opcdump PROT((void));
void slow_shut_down PROT((int));
struct vector *allocate_array PROT((int));
void reset_machine PROT((int));
void clear_state PROT((void));
void load_first_objects PROT((void));
void preload_objects PROT((int));
int random_number PROT((int));
void reset_object PROT((struct object *, int));
int replace_interactive PROT((struct object *ob, struct object *obf, char *));
char *get_wiz_name PROT((char *));
char *get_log_file PROT((char *));
int get_current_time PROT((void));
char *time_string PROT((int));
char *process_string PROT((char *));
int32 renumber_programs();
void update_ref_counts_for_players PROT((void));
void count_ref_from_call_outs PROT((void));
void clear_ref_from_call_outs PROT((void));
void count_ref_in_vector PROT((struct svalue *svp, int num));
void clear_ref_in_vector PROT((struct svalue *svp, int num));
void count_ref_from_string PROT((char *));
void clean_stale_mappings();
void remove_stale_call_outs();
void reference_destructed_object PROT((struct object *));
void note_malloced_block_ref PROT((char *p));
struct ed_buffer;
void clear_ed_buffer_refs PROT((struct ed_buffer *b));
void count_ed_buffer_refs PROT((struct ed_buffer *b));
void clear_ref_from_wiz_list();
void count_ref_from_wiz_list();
void free_unreferenced_memory();
void remove_unknown_identifier();
void count_lex_refs();
void count_compiler_refs();
void free_defines();
void free_all_local_names();
void clear_simul_efun_refs();
void count_simul_efun_refs();
void note_shared_string_table_ref();
void note_otable_ref();
void count_iptable_ref();
void clear_interpreter_refs();
void count_interpreter_refs();
void count_extra_ref_in_vector PROT((struct svalue *svp, int num));
void count_extra_ref_from_wiz_list();
void count_simul_efun_extra_refs();
void count_inherits PROT((struct program *));
void count_ed_buffer_extra_refs PROT((struct ed_buffer *b));
void count_extra_ref_in_object PROT((struct object *));
void check_a_lot_ref_counts PROT((struct program *));
int shadow_catch_message PROT((struct object *ob, char *str));
struct vector *get_all_call_outs PROT((void));
char *read_file PROT((char *file, int, int));
char *read_bytes PROT((char *file, int, int));
int write_bytes PROT((char *file, int, char *str));
struct wiz_list *add_name PROT((char *str));
char *check_valid_path PROT((char *, struct object *, char *, int));
int privilege_violation PROT((char *, struct svalue *));
int get_line_number_if_any PROT((char **));
void logon PROT((struct object *ob));
struct svalue *apply_master_ob PROT((char *fun, int num_arg));
void assert_master_ob_loaded();
void free_interpreter_temporaries();
struct vector *explode_string PROT((char *str, char *del));
struct vector *new_explode_string PROT((char *str, char *del));
void find_call_out PROT((struct object *ob, struct svalue *fun));
void remove_object_from_stack PROT((struct object *ob));
void compile_file PROT((void));
void unlink_swap_file();
char *function_exists PROT((char *, struct object *));
void set_inc_list PROT((struct svalue *sv));
int legal_path PROT((char *path));
struct vector *get_dir PROT((char *path, int));
struct object *get_simul_efun_object PROT((void));
struct function *find_simul_efun PROT((char *));
char *query_simul_efun_file_name PROT((void));
struct vector *match_regexp PROT((struct vector *v, char *pattern));
void setup_print_block_dispatcher();

#ifdef MUDWHO
void sendmudwhoinfo PROT((void));
void sendmudwhologout PROT((struct object *ob));
int rwhocli_setup PROT((char *server, char *serverpw, char *myname,
			char *comment));
int rwhocli_shutdown PROT((void));
int rwhocli_pingalive PROT((void));
int rwhocli_userlogin PROT((char *uid, char *name, int tim));
int rwhocli_userlogout PROT((char *uid));
#endif /* MUDWHO */

#ifndef MAXINT
#define MAXINT (0x7fffffff)
#endif
#define MALLOC_USER   (0)
#define MALLOC_MASTER (1)
#define MALLOC_SYSTEM (2)

#endif /* LINT_H */