2 * Copyright 1987, 1988 by MIT Student Information Processing Board
4 * For copyright information, see copyright.h.
8 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
9 * Use is subject to license terms.
13 #ifndef _ss_ss_internal_h
14 #define _ss_ss_internal_h __FILE__
22 typedef void * pointer
;
27 #define LOCAL_ALLOC(x) __builtin_alloca(x)
31 #define LOCAL_ALLOC(x) alloca(x)
33 extern pointer
alloca (unsigned);
35 #if defined(__HIGHC__) /* Barf! */
37 #define LOCAL_ALLOC(x) alloca(x)
39 extern pointer
alloca (unsigned);
42 #define LOCAL_ALLOC(x) malloc(x)
43 #define LOCAL_FREE(x) free(x)
46 #endif /* LOCAL_ALLOC stuff */
50 typedef struct _ss_abbrev_entry
{
51 char *name
; /* abbrev name */
52 char **abbrev
; /* new tokens to insert */
53 unsigned int beginning_of_line
: 1;
56 typedef struct _ss_abbrev_list
{
58 ss_abbrev_entry
*first_abbrev
;
63 ss_abbrev_list abbrevs
[127];
66 typedef struct _ss_data
{ /* init values */
69 char *subsystem_version
;
70 /* current request info */
72 char **argv
; /* arg list */
73 char const *current_request
; /* primary name */
74 /* info directory for 'help' */
76 /* to be extracted by subroutines */
77 pointer info_ptr
; /* NULL */
78 /* for ss_listen processing */
80 ss_request_table
**rqt_tables
;
81 ss_abbrev_info
*abbrev_info
;
83 unsigned int escape_disabled
: 1,
87 int abort
; /* exit subsystem */
91 #define CURRENT_SS_VERSION 1
93 #define ss_info(sci_idx) (_ss_table[sci_idx])
94 #define ss_current_request(sci_idx,code_ptr) \
95 (*code_ptr=0,ss_info(sci_idx)->current_request)
96 void ss_unknown_function();
97 void ss_delete_info_dir();
98 /* Solaris Kerberos */
99 int ss_parse (int, char *, int *, char ***, int);
100 ss_abbrev_info
*ss_abbrev_initialize (char *, int *);
101 void ss_page_stdin (void);
102 int ss_pager_create (void);
103 void ss_self_identify __SS_PROTO
;
104 void ss_subsystem_name __SS_PROTO
;
105 void ss_subsystem_version __SS_PROTO
;
106 void ss_unimplemented __SS_PROTO
;
108 extern ss_data
**_ss_table
;
109 extern char *ss_et_msgs
[];
111 #ifndef HAVE_STDLIB_H
112 extern pointer
malloc (unsigned);
113 extern pointer
realloc (pointer
, unsigned);
114 extern pointer
calloc (unsigned, unsigned);
117 #if defined(USE_SIGPROCMASK) && !defined(POSIX_SIGNALS)
118 /* fake sigmask, sigblock, sigsetmask */
123 #define sigmask(x) (1L<<(x)-1)
124 #define sigsetmask(x) sigprocmask(SIG_SETMASK,&x,NULL)
125 static int _fake_sigstore
;
126 #define sigblock(x) (_fake_sigstore=x,sigprocmask(SIG_BLOCK,&_fake_sigstore,0))
128 #endif /* _ss_internal_h */