ARPDAS_QNX6 1.0
|
00001 /* cmdalgo.h defines entry points into the cmdgen-based algorithms 00002 * Part of the cmdgen distribution 00003 */ 00004 #ifndef CMDALGO_H_INCLUDED 00005 #define CMDALGO_H_INCLUDED 00006 00007 #ifdef __cplusplus 00008 00009 #include "collect.h" 00010 00011 extern "C" { 00012 #endif 00013 00014 void cmd_init(void); 00015 void cmd_interact(void); 00016 int cmd_batch(char *cmd, int test); 00017 typedef struct { 00018 unsigned short state; 00019 unsigned short value; 00020 } cmd_state; 00021 void cmd_report(cmd_state *s); 00022 int cmd_check(cmd_state *s); 00023 void cis_initialize(void); /* in cmdgen.skel or .cmd */ 00024 void cis_terminate(void); /* in cmdgen.skel of .cmd */ 00025 void cis_interfaces(void); /* generated */ 00026 void cis_interfaces_close(void); /* generated */ 00027 #define CMDREP_QUIT 1000 00028 #define CMDREP_SYNERR 2000 00029 #define CMDREP_EXECERR 3000 00030 #define CMDREP_TYPE(x) ((x)/1000) 00031 00032 struct ioattr_s; 00033 #define IOFUNC_ATTR_T struct ioattr_s 00034 extern IOFUNC_ATTR_T *cis_setup_rdr( char *node ); 00035 extern void cis_turf( IOFUNC_ATTR_T *handle, char *format, ... ); 00036 void ci_server(void); /* in tmlib/cis.c */ 00037 #define CMDSRVR_NAME "cmd/server" 00038 #define CMD_INTERP_MAX 256 00039 #define CMD_VERSION_MAX 80 00040 00041 #ifdef __cplusplus 00042 }; 00043 00044 class cmdif_rd { 00045 public: 00046 cmdif_rd( const char *name ); 00047 void Setup(); 00048 void Turf(const char *fmt, ...); 00049 void Shutdown(); 00050 private: 00051 const char *name; 00052 IOFUNC_ATTR_T *handle; 00053 }; 00054 00055 class cmdif_wr { 00056 public: 00057 cmdif_wr(const char *name, const char *path); 00058 void Setup(); 00059 void Turf(const char *fmt, ...); 00060 void Shutdown(); 00061 private: 00062 const char *name; 00063 const char *path; 00064 int ofd; 00065 }; 00066 00067 class cmdif_dgdata { 00068 public: 00069 cmdif_dgdata(const char *name, void *data, int dsize); 00070 // void Setup(); // does nothing. 00071 void Turf(); 00072 void Shutdown(); 00073 private: 00074 const char *name; 00075 void *data; 00076 int dsize; 00077 send_id id; 00078 }; 00079 00080 #endif 00081 00082 #endif