17c478bd9Sstevel@tonic-gate /* 256a424ccSmp * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 37c478bd9Sstevel@tonic-gate * Use is subject to license terms. 47c478bd9Sstevel@tonic-gate */ 57c478bd9Sstevel@tonic-gate 67c478bd9Sstevel@tonic-gate /* 77c478bd9Sstevel@tonic-gate * Copyright 1987, 1988 by MIT Student Information Processing Board 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * For copyright information, see mit-sipb-copyright.h. 107c478bd9Sstevel@tonic-gate */ 117c478bd9Sstevel@tonic-gate 127c478bd9Sstevel@tonic-gate #ifndef _ss_h 137c478bd9Sstevel@tonic-gate #define _ss_h __FILE__ 147c478bd9Sstevel@tonic-gate 157c478bd9Sstevel@tonic-gate #include <errno.h> 1656a424ccSmp #include <ss/ss_err.h> 177c478bd9Sstevel@tonic-gate 187c478bd9Sstevel@tonic-gate #ifdef __STDC__ 197c478bd9Sstevel@tonic-gate #define __SS_CONST const 207c478bd9Sstevel@tonic-gate #define __SS_PROTO (int, const char * const *, int, void *) 217c478bd9Sstevel@tonic-gate #else 227c478bd9Sstevel@tonic-gate #define __SS_CONST 237c478bd9Sstevel@tonic-gate #define __SS_PROTO () 247c478bd9Sstevel@tonic-gate #endif 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate typedef struct _ss_request_entry { 277c478bd9Sstevel@tonic-gate __SS_CONST char * __SS_CONST *command_names; /* whatever */ 287c478bd9Sstevel@tonic-gate void (* __SS_CONST function) __SS_PROTO; /* foo */ 297c478bd9Sstevel@tonic-gate char *info_string; /* Already L10ed cmd message */ 307c478bd9Sstevel@tonic-gate int flags; /* 0 */ 317c478bd9Sstevel@tonic-gate } ss_request_entry; 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate typedef __SS_CONST struct _ss_request_table { 347c478bd9Sstevel@tonic-gate int version; 357c478bd9Sstevel@tonic-gate ss_request_entry *requests; 367c478bd9Sstevel@tonic-gate } ss_request_table; 377c478bd9Sstevel@tonic-gate 387c478bd9Sstevel@tonic-gate #define SS_RQT_TBL_V2 2 397c478bd9Sstevel@tonic-gate 407c478bd9Sstevel@tonic-gate typedef struct _ss_rp_options { /* DEFAULT VALUES */ 417c478bd9Sstevel@tonic-gate int version; /* SS_RP_V1 */ 427c478bd9Sstevel@tonic-gate void (*unknown) __SS_PROTO; /* call for unknown command */ 437c478bd9Sstevel@tonic-gate int allow_suspend; 447c478bd9Sstevel@tonic-gate int catch_int; 457c478bd9Sstevel@tonic-gate } ss_rp_options; 467c478bd9Sstevel@tonic-gate 477c478bd9Sstevel@tonic-gate #define SS_RP_V1 1 487c478bd9Sstevel@tonic-gate 497c478bd9Sstevel@tonic-gate #define SS_OPT_DONT_LIST 0x0001 507c478bd9Sstevel@tonic-gate #define SS_OPT_DONT_SUMMARIZE 0x0002 517c478bd9Sstevel@tonic-gate 527c478bd9Sstevel@tonic-gate void ss_help __SS_PROTO; 5356a424ccSmp void ss_list_requests __SS_PROTO; 5456a424ccSmp void ss_quit __SS_PROTO; 557c478bd9Sstevel@tonic-gate char *ss_current_request(); 5656a424ccSmp char *ss_name(int); 577c478bd9Sstevel@tonic-gate void ss_error (int, long, char const *, ...); 587c478bd9Sstevel@tonic-gate void ss_perror (int, long, char const *); 5956a424ccSmp int ss_listen (int); 6056a424ccSmp int ss_create_invocation(char *, char *, char *, ss_request_table *, int *); 6156a424ccSmp void ss_delete_invocation(int); 6256a424ccSmp void ss_add_info_dir(int , char *, int *); 6356a424ccSmp void ss_delete_info_dir(int , char *, int *); 6456a424ccSmp int ss_execute_command(int sci_idx, char **); 6556a424ccSmp void ss_abort_subsystem(int, int); 6656a424ccSmp void ss_set_prompt(int, char *); 6756a424ccSmp char *ss_get_prompt(int); 6856a424ccSmp void ss_add_request_table(int, ss_request_table *, int, int *); 6956a424ccSmp void ss_delete_request_table(int, ss_request_table *, int *); 7056a424ccSmp int ss_execute_line (int, char*); 717c478bd9Sstevel@tonic-gate extern ss_request_table ss_std_requests; 727c478bd9Sstevel@tonic-gate 737c478bd9Sstevel@tonic-gate /* toggles the display of debugging messages */ 74*1da57d55SToomas Soome void debugDisplaySS(int onOff); 757c478bd9Sstevel@tonic-gate 767c478bd9Sstevel@tonic-gate #endif /* _ss_h */ 77