10Sstevel@tonic-gate /* 2*2881Smp153739 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 30Sstevel@tonic-gate * Use is subject to license terms. 40Sstevel@tonic-gate */ 50Sstevel@tonic-gate 60Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 70Sstevel@tonic-gate /* 80Sstevel@tonic-gate * Copyright 1987, 1988 by MIT Student Information Processing Board 90Sstevel@tonic-gate * 100Sstevel@tonic-gate * For copyright information, see mit-sipb-copyright.h. 110Sstevel@tonic-gate */ 120Sstevel@tonic-gate 130Sstevel@tonic-gate #ifndef _ss_h 140Sstevel@tonic-gate #define _ss_h __FILE__ 150Sstevel@tonic-gate 16*2881Smp153739 #include <errno.h> 170Sstevel@tonic-gate #include <ss/ss_err.h> 180Sstevel@tonic-gate 190Sstevel@tonic-gate #ifdef __STDC__ 200Sstevel@tonic-gate #define __SS_CONST const 210Sstevel@tonic-gate #define __SS_PROTO (int, const char * const *, int, void *) 220Sstevel@tonic-gate #else 230Sstevel@tonic-gate #define __SS_CONST 240Sstevel@tonic-gate #define __SS_PROTO () 250Sstevel@tonic-gate #endif 260Sstevel@tonic-gate 270Sstevel@tonic-gate typedef struct _ss_request_entry { 280Sstevel@tonic-gate __SS_CONST char * __SS_CONST *command_names; /* whatever */ 290Sstevel@tonic-gate void (* __SS_CONST function) __SS_PROTO; /* foo */ 300Sstevel@tonic-gate char *info_string; /* Already L10ed cmd message */ 310Sstevel@tonic-gate int flags; /* 0 */ 320Sstevel@tonic-gate } ss_request_entry; 330Sstevel@tonic-gate 340Sstevel@tonic-gate typedef __SS_CONST struct _ss_request_table { 350Sstevel@tonic-gate int version; 360Sstevel@tonic-gate ss_request_entry *requests; 370Sstevel@tonic-gate } ss_request_table; 380Sstevel@tonic-gate 390Sstevel@tonic-gate #define SS_RQT_TBL_V2 2 400Sstevel@tonic-gate 410Sstevel@tonic-gate typedef struct _ss_rp_options { /* DEFAULT VALUES */ 420Sstevel@tonic-gate int version; /* SS_RP_V1 */ 430Sstevel@tonic-gate void (*unknown) __SS_PROTO; /* call for unknown command */ 440Sstevel@tonic-gate int allow_suspend; 450Sstevel@tonic-gate int catch_int; 460Sstevel@tonic-gate } ss_rp_options; 470Sstevel@tonic-gate 480Sstevel@tonic-gate #define SS_RP_V1 1 490Sstevel@tonic-gate 500Sstevel@tonic-gate #define SS_OPT_DONT_LIST 0x0001 510Sstevel@tonic-gate #define SS_OPT_DONT_SUMMARIZE 0x0002 520Sstevel@tonic-gate 530Sstevel@tonic-gate void ss_help __SS_PROTO; 54*2881Smp153739 void ss_list_requests __SS_PROTO; 55*2881Smp153739 void ss_quit __SS_PROTO; 560Sstevel@tonic-gate char *ss_current_request(); 57*2881Smp153739 char *ss_name(int); 580Sstevel@tonic-gate void ss_error (int, long, char const *, ...); 590Sstevel@tonic-gate void ss_perror (int, long, char const *); 60*2881Smp153739 int ss_listen (int); 61*2881Smp153739 int ss_create_invocation(char *, char *, char *, ss_request_table *, int *); 62*2881Smp153739 void ss_delete_invocation(int); 63*2881Smp153739 void ss_add_info_dir(int , char *, int *); 64*2881Smp153739 void ss_delete_info_dir(int , char *, int *); 65*2881Smp153739 int ss_execute_command(int sci_idx, char **); 66*2881Smp153739 void ss_abort_subsystem(int, int); 67*2881Smp153739 void ss_set_prompt(int, char *); 68*2881Smp153739 char *ss_get_prompt(int); 69*2881Smp153739 void ss_add_request_table(int, ss_request_table *, int, int *); 70*2881Smp153739 void ss_delete_request_table(int, ss_request_table *, int *); 71*2881Smp153739 int ss_execute_line (int, char*); 720Sstevel@tonic-gate extern ss_request_table ss_std_requests; 730Sstevel@tonic-gate 740Sstevel@tonic-gate /* toggles the display of debugging messages */ 750Sstevel@tonic-gate void debugDisplaySS(int onOff); 760Sstevel@tonic-gate 770Sstevel@tonic-gate #endif /* _ss_h */ 78