#ifndef _INTERFACE_H_477d2d7c_ #define _INTERFACE_H_477d2d7c_ /* This software is Copyright 1989, 1990, 1992, 1993 by various individuals. Please see the accompanying file COPYRIGHT for details. */ #include "db.h" /* these symbols must be defined by the interface */ extern int notify(dbref, const char *); extern int awakep(dbref); extern int shutdown_flag; /* if non-zero, interface should shut down */ extern void emergency_shutdown(void); extern int boot_off(dbref); extern void dump_descriptors(dbref, const char *); /* the following symbols are provided by game.c */ /* max length of command argument to process_command */ #define MAX_COMMAND_LEN 512 #define BUFFER_LEN ((MAX_COMMAND_LEN)*8) extern int do_builtin_command(dbref, const char *, char *); extern void process_command(dbref, char *); extern dbref create_player(const char *, const char *); extern dbref connect_player(const char *, const char *); extern void do_look_around(dbref); extern int init_game(const char *, const char *, int); extern void free_game(void); extern void register_free(void **); extern void dump_database(void); struct text_block { int nchars; struct text_block *nxt; char *start; char *buf; } ; struct text_queue { struct text_block *head; struct text_block **tail; } ; struct descriptor_data { int descriptor; unsigned int connected : 1; unsigned int booted : 1; unsigned int wordfold : 1; unsigned int waiting : 1; unsigned int hostnamewait : 1; unsigned int usernamewait : 1; unsigned int holdshutdown : 1; unsigned int telnetstate : 3; #define TNS_DONT 0 /* don't do telnet stuff */ #define TNS_DATA 1 /* telnet in data mode */ #define TNS_IAC 2 /* just after IAC */ #define TNS_DO 3 /* after IAC DO */ #define TNS_WILL 4 /* after IAC WILL */ #define TNS_SKIP 5 /* after IAC DONT or IAC WONT - skip next byte */ #define TNS_SB 6 /* after IAC SB, in subnegotiation */ #define TNS_SBI 7 /* after IAC SB, just after IAC in subnegotiation */ unsigned int windows_kludge : 1; dbref player; char *output_prefix; char *output_suffix; int output_fold; int output_col; int output_size; struct text_queue output; struct text_queue input; unsigned char *raw_input; unsigned char *raw_input_at; long last_time; long connected_at; const char *hostname; const char *username; int quota; struct descriptor_data *next; struct descriptor_data **prev; } ; extern struct descriptor_data *descriptor_list; extern void panic(const char *); extern void dump_rusers(struct descriptor_data *); #endif