1 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
3 * Copyright 1987, 1988 by MIT Student Information Processing Board
5 * For copyright information, see copyright.h.
8 #ifndef _ss_ss_internal_h
9 #define _ss_ss_internal_h __FILE__
10 #include "k5-platform.h"
13 typedef void * pointer;
18 #define LOCAL_ALLOC(x) __builtin_alloca(x)
22 #define LOCAL_ALLOC(x) alloca(x)
24 extern pointer alloca (unsigned);
26 #if defined(__HIGHC__) /* Barf! */
28 #define LOCAL_ALLOC(x) alloca(x)
30 extern pointer alloca (unsigned);
33 #define LOCAL_ALLOC(x) malloc(x)
34 #define LOCAL_FREE(x) free(x)
37 #endif /* LOCAL_ALLOC stuff */
41 typedef struct _ss_abbrev_entry {
42 char *name; /* abbrev name */
43 char **abbrev; /* new tokens to insert */
44 unsigned int beginning_of_line : 1;
47 typedef struct _ss_abbrev_list {
49 ss_abbrev_entry *first_abbrev;
54 ss_abbrev_list abbrevs[127];
57 typedef struct _ss_data { /* init values */
60 char *subsystem_version;
61 /* current request info */
63 char **argv; /* arg list */
64 char const *current_request; /* primary name */
65 /* info directory for 'help' */
67 /* to be extracted by subroutines */
68 pointer info_ptr; /* (void *) NULL */
69 /* for ss_listen processing */
71 ss_request_table **rqt_tables;
72 ss_abbrev_info *abbrev_info;
74 unsigned int escape_disabled : 1,
78 int abort; /* exit subsystem */
82 #define CURRENT_SS_VERSION 1
84 #define ss_info(sci_idx) (_ss_table[sci_idx])
85 #define ss_current_request(sci_idx,code_ptr) \
86 (*code_ptr=0,ss_info(sci_idx)->current_request)
87 void ss_unknown_function();
88 void ss_delete_info_dir();
89 char **ss_parse (int, char *, int *);
90 ss_abbrev_info *ss_abbrev_initialize (char *, int *);
91 void ss_page_stdin (void);
92 int ss_pager_create (void);
93 void ss_self_identify __SS_PROTO;
94 void ss_subsystem_name __SS_PROTO;
95 void ss_subsystem_version __SS_PROTO;
96 void ss_unimplemented __SS_PROTO;
98 extern ss_data **_ss_table;
99 extern char *ss_et_msgs[];
101 #ifndef HAVE_STDLIB_H
102 extern pointer malloc (unsigned);
103 extern pointer realloc (pointer, unsigned);
104 extern pointer calloc (unsigned, unsigned);
107 #if defined(USE_SIGPROCMASK) && !defined(POSIX_SIGNALS)
108 /* fake sigmask, sigblock, sigsetmask */
113 #define sigmask(x) (1L<<(x)-1)
114 #define sigsetmask(x) sigprocmask(SIG_SETMASK,&x,NULL)
115 static int _fake_sigstore;
116 #define sigblock(x) (_fake_sigstore=x,sigprocmask(SIG_BLOCK,&_fake_sigstore,0))
118 #endif /* _ss_internal_h */