//+++2004-09-11 // Copyright (C) 2004 Mike Rieker, Beverly, MA USA // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; version 2 of the License. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA //---2004-09-11 /************************************************************************/ /* */ /* Command-line interpreter */ /* */ /************************************************************************/ #include "ozone.h" #include "oz_crtl_malloc.h" #include "oz_io_console.h" #include "oz_io_fs.h" #include "oz_io_mutex.h" #include "oz_io_pipe.h" #include "oz_io_timer.h" #include "oz_knl_ast.h" #include "oz_knl_devio.h" #include "oz_knl_hw.h" #include "oz_knl_lock.h" #include "oz_knl_logname.h" #include "oz_knl_sdata.h" #include "oz_knl_status.h" #include "oz_knl_thread.h" #include "oz_knl_userjob.h" #include "oz_sys_callknl.h" #include "oz_sys_dateconv.h" #include "oz_sys_event.h" #include "oz_sys_exhand.h" #include "oz_sys_handle.h" #include "oz_sys_io.h" #include "oz_sys_io_fs.h" #include "oz_sys_io_fs_printf.h" #include "oz_sys_logname.h" #include "oz_sys_password.h" #include "oz_sys_process.h" #include "oz_sys_spawn.h" #include "oz_sys_thread.h" #include "oz_sys_tzconv.h" #include "oz_sys_userjob.h" #include "oz_sys_xprintf.h" #include "oz_util_start.h" #include #define CMDSIZ 4096 #define MAXLBLNAM 64 #define MAXSYMNAM 64 #define CMDLNMTBL "OZ_CLI_TABLES" #define LASTPROCLNM "OZ_LAST_PROCESS" #define LASTHREADLNM "OZ_LAST_THREAD" #define SECATTRSIZE 4096 #define SYMBOLSTARTCHAR(c) ((c == '_') || ((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z'))) #define SYMBOLCHAR(c) (SYMBOLSTARTCHAR(c) || ((c >= '0') && (c <= '9'))) #define SHOWOPT_PROC_THREADS 0x1 #define SHOWOPT_JOB_PROCS 0x2 #define SHOWOPT_JOB_THREADS (SHOWOPT_PROC_THREADS | SHOWOPT_JOB_PROCS) #define SHOWOPT_USER_JOBS 0x4 #define SHOWOPT_USER_PROCS (SHOWOPT_JOB_PROCS | SHOWOPT_USER_JOBS) #define SHOWOPT_USER_THREADS (SHOWOPT_PROC_THREADS | SHOWOPT_USER_PROCS) #define SHOWOPT_DEVICE_IOCHANS 0x8 #define SHOWOPT_SYSTEM_USERS 0x10 #define SHOWOPT_SYSTEM_JOBS (SHOWOPT_USER_JOBS | SHOWOPT_SYSTEM_USERS) #define SHOWOPT_SYSTEM_PROCS (SHOWOPT_JOB_PROCS | SHOWOPT_SYSTEM_JOBS) #define SHOWOPT_SYSTEM_THREADS (SHOWOPT_PROC_THREADS | SHOWOPT_SYSTEM_PROCS) #define SHOWOPT_SYSTEM_DEVICES 0x20 #define SHOWOPT_SYSTEM_IOCHANS (SHOWOPT_DEVICE_IOCHANS | SHOWOPT_SYSTEM_DEVICES) #define SHOWOPT_SECURITY 0x00010000 #define SHOWOPT_OBJADDR 0x00020000 #define SHOWNHDR_THREAD 0x80000000 #define SHOWNHDR_PROCESS 0x40000000 #define SHOWNHDR_JOB 0x20000000 #define SHOWNHDR_USER 0x10000000 #define SHOWNHDR_IOCHAN 0x8000000 #define SHOWNHDR_DEVICE 0x4000000 #define SHOWNHDR_SYSTEM 0x2000000 #define SHOLNMFLG_SECURITY 0x00000001 typedef struct Attachedthread Attachedthread; typedef struct Command Command; typedef struct Label Label; typedef struct Pipebuf Pipebuf; typedef struct Runopts Runopts; typedef struct Script Script; typedef struct Symbol Symbol; typedef uLong (*Entry) (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *param, int argc, const char *argv[]); struct Attachedthread { Attachedthread *next; OZ_Threadid thread_id; OZ_Handle h_thread; OZ_Handle h_waitevent; OZ_Handle h_haltevent; OZ_Procmode procmode; OZ_Sigargs const *volatile sigargs_p; OZ_Mchargs *volatile mchargs_p; OZ_Mchargx *volatile mchargx_p; OZ_Processid volatile processid; }; struct Command { int async; /* 0: cannot run as a thread; 1: ok to run as a thread */ /* - Basically anything that accesses cli internal static data (like symbol tables and script stacks) cannot be run as a thread. */ /* Also, things like 'abort/wait/suspend/resume thread' and 'run' do their own ctrl-Y processing so do not need to be async. */ char *name; /* command name string; multiple words separated by a single space */ Entry entry; /* entrypoint to the routine */ void *param; /* param to pass to the routine */ char *help; /* corresponding help string */ }; struct Label { Label *next; char name[MAXLBLNAM]; OZ_Dbn blkoffs; uLong bytoffs; }; typedef enum { SYMTYPE_STRING, SYMTYPE_INTEGER } Symtype; struct Symbol { Symbol *next; char name[MAXSYMNAM]; Symtype symtype; uLong (*func) (Symbol *symbol, char *strp, char **rtnp, void *valuep); uLong ivalue; char svalue[1]; }; struct Script { Script *next; /* next outermost script */ OZ_Handle h_input; /* input of next outermost script */ OZ_Handle h_output; /* output of next outermost script */ OZ_Handle h_error; /* error of next outermost script */ Symbol *symbols; /* symbols of next outermost script */ Label *labels; /* labels of next outermost script */ }; typedef enum { OPTYPE_UNKNOWN, OPTYPE_ADD, OPTYPE_BITAND, OPTYPE_BITOR, OPTYPE_BITXOR, OPTYPE_BOOLAND, OPTYPE_BOOLOR, OPTYPE_BOOLXOR, OPTYPE_DIVIDE, OPTYPE_EQ, OPTYPE_GT, OPTYPE_GE, OPTYPE_LT, OPTYPE_LE, OPTYPE_NE, OPTYPE_MODULUS, OPTYPE_MULTIPLY, OPTYPE_SHLEFT, OPTYPE_SHRIGHT, OPTYPE_SUBTRACT } Optype; typedef struct { char *opname; Optype optype; } Operator; static const Operator operators[] = { "||", OPTYPE_BOOLOR, "^^", OPTYPE_BOOLXOR, ">>", OPTYPE_SHRIGHT, ">=", OPTYPE_GE, "==", OPTYPE_EQ, "<>", OPTYPE_NE, "<=", OPTYPE_LE, "<<", OPTYPE_SHLEFT, "&&", OPTYPE_BOOLAND, "!=", OPTYPE_NE, "|", OPTYPE_BITOR, "^", OPTYPE_BITXOR, ">", OPTYPE_GT, "<", OPTYPE_LT, "/", OPTYPE_DIVIDE, "-", OPTYPE_SUBTRACT, "+", OPTYPE_ADD, "*", OPTYPE_MULTIPLY, "&", OPTYPE_BITAND, "%", OPTYPE_MODULUS, NULL, OPTYPE_UNKNOWN }; struct Pipebuf { Pipebuf *next; Runopts *runopts; uLong rlen; char data[256]; }; struct Runopts { const char *defdir; /* -directory name */ const char *error_name; /* -error file name */ const char *ersym_name; /* -ersym symbol name */ const char *exit_name; /* -exit event flag logical name */ const char *init_name; /* -init event flag logical name */ const char *input_name; /* -input file name */ const char *insym_name; /* -insym symbol name */ const char *job_name; /* -job name */ const char *output_name; /* -output file name */ const char *outsym_name; /* -outsym symbol name */ const char *process_name; /* -process logical name */ const char *thread_name; /* -thread logical name */ int debug; /* -debug flag */ int timeit; /* -timeit flag */ int wait; /* opposite of -nowait setting */ int orphan; /* -orphan flag */ OZ_Handle h_err; /* -error io channel handle */ OZ_Handle h_exit; /* -exit event flag handle */ OZ_Handle h_init; /* -init event flag handle */ OZ_Handle h_in; /* -input io channel handle */ OZ_Handle h_job; /* -job handle */ OZ_Handle h_out; /* -output io channel handle */ OZ_Handle h_process; /* created process handle (0 for internal commands) */ OZ_Handle h_thread; /* created thread handle */ OZ_Handle h_ersym; /* read ersym data from this pipe handle */ OZ_Handle h_insym; /* write insym data to this pipe handle */ OZ_Handle h_outsym; /* read outsym data from this pipe handle */ OZ_Handle h_evsym; /* this event sets when symbol stream completes */ Pipebuf *ersym_pipebuf_qh; /* list of buffers for -ersym */ Pipebuf **ersym_pipebuf_qt; char *insym_data; /* pointer to buffer for -insym */ Pipebuf *outsym_pipebuf_qh; /* list of buffers for -outsym */ Pipebuf **outsym_pipebuf_qt; }; static const struct { char *name; OZ_Lockmode valu; } lockmodes[OZ_LOCKMODE_XX] = { "NL", OZ_LOCKMODE_NL, "CR", OZ_LOCKMODE_CR, "CW", OZ_LOCKMODE_CW, "PR", OZ_LOCKMODE_PR, "PW", OZ_LOCKMODE_PW, "EX", OZ_LOCKMODE_EX }; static Attachedthread *attachedthreads; static char *pn, skiplabel[MAXLBLNAM]; static char *defaulttables; static int ctrly_hit, exited, verify; static Label *labels; static OZ_Handle h_s_console; static OZ_Handle h_event_ctrly; static OZ_Handle h_s_error; static OZ_Handle h_s_input; static OZ_Handle h_s_output; static OZ_Handle h_timer; static OZ_IO_fs_getinfo1 scriptinfo; static OZ_IO_fs_readrec scriptread; static Script *scripts; static Symbol *symbols; static void startendmsg (const char *name); static void ctrly_enable (void); static void ctrly_ast (void *dummy, uLong status, OZ_Mchargs *mchargs); static void ctrlt_enable (void); static void ctrlt_ast (void *dummy, uLong status, OZ_Mchargs *mchargs); static void exit_script (void); static char *proclabels (char *cmdbuf); static uLong execute (char *cmdbuf); static uLong exechopped (int argc, const char *argv[], const char *input, const char *output, int nowait); static uLong substitute (char *inbuf, char **outbuf_r); static uLong eval_handle (char *inbuf, char **inbuf_r, OZ_Handle *outval_r, char *objtype, char termch); static uLong eval_integer (char *inbuf, char **inbuf_r, uLong *outval_r, char termch); static uLong eval_string (char *inbuf, char **inbuf_r, char **outbuf_r, char termch); static uLong evaluate (char *inbuf, char **inbuf_r, Symbol **symbol_r, char termch); static uLong get_operand (char *inbuf, char **inbuf_r, Symbol **symbol_r); static Optype get_operator (char *inbuf, char **inbuf_r); static char *cvt_sym_to_str (Symbol *symbol); static uLong func_collapse (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_compress (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_date_add (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_date_dow (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_date_now (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_date_sub (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_date_tzconv (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_event_inc (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_event_set (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_field (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_h_info (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_len (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_lnm_attrs (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_lnm_lookup (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_lnm_nvalues (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_lnm_object (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_lnm_string (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_loc (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_lowercase (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_process (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_sub (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_thread (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_trim (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_uppercase (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong func_verify (Symbol *symbol, char *strp, char **rtnp, void *valuep); static uLong decode_objtype_string (const char *s_objtype, OZ_Objtype *b_objtype_r); static const char *encode_objtype_string (OZ_Objtype b_objtype); static void def_func (char *name, uLong (*func) (Symbol *symbol, char *strp, char **rtnp, void *valuep), Symtype symtype, char *help); static void setscriptsyms (int argc, const char *argv[]); static void insert_symbol (Symbol *symbol, uLong (*func) (Symbol *symbol, char *strp, char **rtnp, void *valuep), uLong level); static Symbol *lookup_symbol (const char *name, uLong level, uLong *level_r); static Command *decode_command (int argc, const char **argv, Command *cmdtbl, int *argc_r); static int cmpcmdname (int argc, const char **argv, char *name); static uLong logname_getobj (const char *name, OZ_Objtype objtype, OZ_Handle *h_object_r); static uLong logname_creobj (const char *name, OZ_Objtype objtype, OZ_Handle h_object); static uLong delete_logical (OZ_Handle h_error, const char *default_table_name, int argc, const char *argv[]); static uLong extcommand (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong runimage (OZ_Handle h_error, Runopts *runopts, const char *image, int argc, const char *argv[]); static uLong decode_runopts (const char *input, const char *output, int nowait, OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, int *argc_r, const char ***argv_r, Runopts *runopts); static uLong setup_runopts (OZ_Handle h_error, Runopts *runopts); static uLong finish_runopts (OZ_Handle h_error, Runopts *runopts); static uLong crepipepair (OZ_Handle *h_read_r, OZ_Handle *h_write_r); static void cleanup_runopts (Runopts *runopts); static void start_ersym_read (Runopts *runopts); static void ersym_read_ast (void *pipebufv, uLong status, OZ_Mchargs *mchargs); static void start_insym_write (Runopts *runopts); static void insym_write_ast (void *runoptsv, uLong status, OZ_Mchargs *mchargs); static void start_outsym_read (Runopts *runopts); static void outsym_read_ast (void *pipebufv, uLong status, OZ_Mchargs *mchargs); static void deferoutsym (const char *sym_name, Pipebuf *pipebuf_qh); static uLong show_device_bylogical (OZ_Handle h_output, OZ_Handle h_error, const char *logical, uLong *showopts); static uLong show_device_byhandle (OZ_Handle h_output, OZ_Handle h_error, OZ_Handle h_device, uLong *showopts); static uLong show_iochan_bylogical (OZ_Handle h_output, OZ_Handle h_error, const char *logical, uLong *showopts); static uLong show_iochan_byhandle (OZ_Handle h_output, OZ_Handle h_error, OZ_Handle h_iochan, uLong *showopts); static uLong show_job_bylogical (OZ_Handle h_output, OZ_Handle h_error, const char *logical, uLong *showopts); static uLong show_job_byhandle (OZ_Handle h_output, OZ_Handle h_error, OZ_Handle h_job, uLong *showopts); static uLong show_logical_table (OZ_Handle h_output, OZ_Handle h_error, int level, uLong sholnmflg, uLong logtblatr, const char *table_name, OZ_Handle h_table); static uLong show_logical_name (OZ_Handle h_output, OZ_Handle h_error, int level, uLong sholnmflg, int table, OZ_Handle h_logname); static uLong show_process_bylogical (OZ_Handle h_output, OZ_Handle h_error, const char *logical, uLong *showopts); static uLong show_process_byhandle (OZ_Handle h_output, OZ_Handle h_error, OZ_Handle h_process, uLong *showopts); static void show_symbol (OZ_Handle h_output, OZ_Handle h_error, Symbol *symbol); static uLong show_system (OZ_Handle h_output, OZ_Handle h_error, uLong *showopts); static uLong show_thread_bylogical (OZ_Handle h_output, OZ_Handle h_error, const char *logical, uLong *showopts); static uLong show_thread_byhandle (OZ_Handle h_output, OZ_Handle h_error, OZ_Handle h_thread, uLong *showopts); static void show_thread_seckeys (OZ_Handle h_output, OZ_Handle h_thread); static void show_secattr (OZ_Handle h_output, OZ_Handle h_object, OZ_Handle_code secattrcode, int prefix_w, const char *prefix); static void *secmalloc (void *dummy, uLong osize, void *obuff, uLong nsize); static uLong show_user_bylogical (OZ_Handle h_output, OZ_Handle h_error, const char *logical, uLong *showopts); static uLong show_user_byhandle (OZ_Handle h_output, OZ_Handle h_error, OZ_Handle h_user, uLong *showopts); static uLong wait_thread (OZ_Handle h_error, OZ_Handle h_thread); static uLong wait_events (uLong nevents, OZ_Handle *h_events); /* Internal command declarations */ static uLong int_abort_thread (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_allocate_device (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_change_password (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_close_handle (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_create_event (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_create_file (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_create_job (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_create_logical_name (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_create_logical_table (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_create_mutex (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_create_symbol (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_deallocate_device (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_delete_logical_name (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_delete_logical_table (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_echo (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_exit (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_goto (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_halt_thread (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_help (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_if (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_more (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_open_file (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_open_mutex (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_read_file (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_resume_thread (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_script (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_set_console (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_set_datetime (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_set_default (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_set_event_interval (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_set_mutex (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_set_thread (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_set_timezone (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_show_datetime (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_show_device (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_show_default (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_show_event (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_show_iochan (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_show_job (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_show_logical_name (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_show_logical_table (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_show_job (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_show_mutex (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_show_process (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_show_symbol (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_show_system (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_show_thread (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_show_user (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_show_volume (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_step_thread (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_suspend_thread (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_wait_event (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_wait_mutex (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_wait_thread (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static uLong int_wait_until (OZ_Handle h_input, OZ_Handle h_output, OZ_Handle h_error, char *name, void *dummy, int argc, const char *argv[]); static Command intcmd[] = { 0, "abort thread", int_abort_thread, NULL, "[-id ] [-nowait] [-status ] []", 0, "allocate device", int_allocate_device, NULL, "[-user] [-job] [-process] [-thread] ", 0, "change password", int_change_password, NULL, "[ []]", 1, "close handle", int_close_handle, NULL, " ...", 0, "create event", int_create_event, NULL, " ", 1, "create file", int_create_file, NULL, "[-lockmode ] [-logical ] ", 0, "create job", int_create_job, NULL, " ", 0, "create logical name", int_create_logical_name, NULL, "[-kernel] [-nooutermode] [-nosupersede] [-copy ] [-link ] [-object ] [-terminal] [-value ] ...", 0, "create logical table", int_create_logical_table, NULL, "[-kernel] [-nooutermode] [-nosupersede] ", 1, "create mutex", int_create_mutex, NULL, " ", 0, "create symbol", int_create_symbol, NULL, "[-global] [-integer] [-level ] [-string] ...", 0, "deallocate device", int_deallocate_device, NULL, "", 0, "delete logical name", int_delete_logical_name, NULL, "", 0, "delete logical table", int_delete_logical_table, NULL, "", 1, "echo", int_echo, NULL, " ...", 0, "exit", int_exit, NULL, "[]", 0, "goto", int_goto, NULL, "