/*
 * Copyright 1987 by MIT Student Information Processing Board
 *
 * For copyright information, see mit-sipb-copyright.h.
 */

#ifndef _SS
#define _SS

extern int errno;

/*
 * should logically be "void", but some compilers can't handle
 * it properly.  since int will work as well (just ignore the
 * return value), we can use it here...
 */
#define	FUNCTION_TYPE int
#define	FUNCTION_TYPE_NAME "int"

typedef struct {
	char **command_names;	/* whatever */
	FUNCTION_TYPE (*function)(); /* foo */
	char *info_string;	/* NULL */
	int flags;		/* 0 */
} ss_request_entry;

typedef struct {
	int version;
	ss_request_entry *requests;
} ss_request_table;

#define SS_RQT_TBL_V2	2

typedef struct {		/* DEFAULT VALUES */
	int version;		/* SS_RP_V1 */
	FUNCTION_TYPE (*unknown)(); /* call for unknown command */
	int allow_suspend;
	int catch_int;
} ss_rp_options;

#define SS_RP_V1 1

#define SS_OPT_DONT_LIST	0x0001
#define SS_OPT_DONT_SUMMARIZE	0x0002

FUNCTION_TYPE ss_help();
char *ss_current_request();
char *ss_name();
void ss_perror();
void ss_abort_subsystem();
#endif _SS

/* ss_err.h follows here */
#define SS_ET_SUBSYSTEM_ABORTED                  ((int)748800)
#define SS_ET_VERSION_MISMATCH                   ((int)748801)
#define SS_ET_NULL_INV                           ((int)748802)
#define SS_ET_NO_INFO_DIR                        ((int)748803)
#define SS_ET_COMMAND_NOT_FOUND                  ((int)748804)
#define SS_ET_LINE_ABORTED                       ((int)748805)
#define SS_ET_EOF                                ((int)748806)
#define SS_ET_PERMISSION_DENIED                  ((int)748807)
#define SS_ET_TABLE_NOT_FOUND                    ((int)748808)
#define SS_ET_NO_HELP_FILE                       ((int)748809)
#define SS_ET_ESCAPE_DISABLED                    ((int)748810)
#define SS_ET_UNIMPLEMENTED                      ((int)748811)
extern int init_ss_err_tbl();
extern int ss_err_base;
