msystem.h

Go to the documentation of this file.
00001 /********************************************************************\
00002 
00003   Name:         MSYSTEM.H
00004   Created by:   Stefan Ritt
00005 
00006   Contents:     Function declarations and constants for internal
00007                 routines
00008 
00009   $Id: msystem.h 3197 2006-07-31 19:01:21Z ritt $
00010 
00011 \********************************************************************/
00012 
00013 /* MIDAS library version number. This value is returned by 
00014    cm_get_version and will be incremented whenever changes are done
00015    to the MIDAS library. First digit is major release, second
00016    digit is minor release, third digit is patch level */
00017 
00018 /**dox***************************************************************/
00019 /** @file msystem.h
00020 The Midas System include file
00021 */
00022 
00023 /** @defgroup msystemincludecode The msystem.h & system.c
00024  */
00025 /** @defgroup msdefineh System Define
00026  */
00027 /** @defgroup msmacroh System Macros
00028  */
00029 /** @defgroup mssectionh System Structure Declaration
00030  */
00031 
00032 /**dox***************************************************************/
00033 /** @addtogroup msystemincludecode
00034  *  
00035  *  @{  */
00036 
00037 /**dox***************************************************************/
00038 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00039 
00040 #include "midasinc.h"
00041 
00042 /**dox***************************************************************/
00043 #endif                          /* DOXYGEN_SHOULD_SKIP_THIS */
00044 
00045 /**dox***************************************************************/
00046 /** @addtogroup msdefineh
00047  *  
00048  *  @{  */
00049 
00050 /**
00051 data representations
00052 */
00053 #define DRI_16              (1<<0)  /**< - */
00054 #define DRI_32              (1<<1)  /**< - */
00055 #define DRI_64              (1<<2)  /**< - */
00056 #define DRI_LITTLE_ENDIAN   (1<<3)  /**< - */
00057 #define DRI_BIG_ENDIAN      (1<<4)  /**< - */
00058 #define DRF_IEEE            (1<<5)  /**< - */
00059 #define DRF_G_FLOAT         (1<<6)  /**< - */
00060 #define DR_ASCII            (1<<7)  /**< - */
00061 
00062 /**dox***************************************************************/
00063           /** @} *//* end of msdefineh */
00064 
00065 /**dox***************************************************************/
00066 /** @addtogroup msmacroh
00067  *  
00068  *  @{  */
00069 
00070 /* Byte and Word swapping big endian <-> little endian */
00071 /**
00072 SWAP WORD macro */
00073 #define WORD_SWAP(x) { BYTE _tmp;                               \
00074                        _tmp= *((BYTE *)(x));                    \
00075                        *((BYTE *)(x)) = *(((BYTE *)(x))+1);     \
00076                        *(((BYTE *)(x))+1) = _tmp; }
00077 
00078 /**
00079 SWAP DWORD macro */
00080 #define DWORD_SWAP(x) { BYTE _tmp;                              \
00081                        _tmp= *((BYTE *)(x));                    \
00082                        *((BYTE *)(x)) = *(((BYTE *)(x))+3);     \
00083                        *(((BYTE *)(x))+3) = _tmp;               \
00084                        _tmp= *(((BYTE *)(x))+1);                \
00085                        *(((BYTE *)(x))+1) = *(((BYTE *)(x))+2); \
00086                        *(((BYTE *)(x))+2) = _tmp; }
00087 
00088 /**
00089 SWAP QWORD macro */
00090 #define QWORD_SWAP(x) { BYTE _tmp;                              \
00091                        _tmp= *((BYTE *)(x));                    \
00092                        *((BYTE *)(x)) = *(((BYTE *)(x))+7);     \
00093                        *(((BYTE *)(x))+7) = _tmp;               \
00094                        _tmp= *(((BYTE *)(x))+1);                \
00095                        *(((BYTE *)(x))+1) = *(((BYTE *)(x))+6); \
00096                        *(((BYTE *)(x))+6) = _tmp;               \
00097                        _tmp= *(((BYTE *)(x))+2);                \
00098                        *(((BYTE *)(x))+2) = *(((BYTE *)(x))+5); \
00099                        *(((BYTE *)(x))+5) = _tmp;               \
00100                        _tmp= *(((BYTE *)(x))+3);                \
00101                        *(((BYTE *)(x))+3) = *(((BYTE *)(x))+4); \
00102                        *(((BYTE *)(x))+4) = _tmp; }
00103 
00104 /**dox***************************************************************/
00105           /** @} *//* end of msmacroh */
00106 
00107 /**dox***************************************************************/
00108 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00109 
00110 /**
00111 Definition of implementation specific constants */
00112 #define MESSAGE_BUFFER_SIZE    100000   /**< buffer used for messages */
00113 #define MESSAGE_BUFFER_NAME    "SYSMSG" /**< buffer name for messages */
00114 #define MAX_RPC_CONNECTION     64       /**< server/client connections   */
00115 #define MAX_STRING_LENGTH      256      /**< max string length for odb */
00116 #define NET_BUFFER_SIZE        (ALIGN8(MAX_EVENT_SIZE)+sizeof(EVENT_HEADER)+\
00117 4*8 + sizeof(NET_COMMAND_HEADER))
00118 
00119 /*------------------------------------------------------------------*/
00120 /* flag for conditional compilation of debug messages */
00121 #undef  DEBUG_MSG
00122 
00123 /* flag for local routines (not for pure network clients) */
00124 #if !defined ( OS_MSDOS ) && !defined ( OS_VXWORKS )
00125 #define LOCAL_ROUTINES
00126 #endif
00127 
00128 /* YBOS support not in MSDOS */
00129 #if !defined ( OS_MSDOS )
00130 #define YBOS_SUPPORT
00131 #endif
00132 
00133 /*------------------------------------------------------------------*/
00134 
00135 /* Mapping of function names for socket operations */
00136 
00137 #ifdef OS_MSDOS
00138 
00139 #define closesocket(s) close(s)
00140 #define ioctlsocket(s,c,d) ioctl(s,c,d)
00141 #define malloc(i) farmalloc(i)
00142 
00143 #undef NET_TCP_SIZE
00144 #define NET_TCP_SIZE 0x7FFF
00145 
00146 #undef MAX_EVENT_SIZE
00147 #define MAX_EVENT_SIZE 4096
00148 
00149 #endif                          /* OS_MSDOS */
00150 
00151 #ifdef OS_VMS
00152 
00153 #define closesocket(s) close(s)
00154 #define ioctlsocket(s,c,d)
00155 
00156 #ifndef FD_SET
00157 typedef struct {
00158    INT fds_bits;
00159 } fd_set;
00160 
00161 #define FD_SET(n, p)    ((p)->fds_bits |= (1 << (n)))
00162 #define FD_CLR(n, p)    ((p)->fds_bits &= ~(1 << (n)))
00163 #define FD_ISSET(n, p)  ((p)->fds_bits & (1 << (n)))
00164 #define FD_ZERO(p)      ((p)->fds_bits = 0)
00165 #endif                          /* FD_SET */
00166 
00167 #endif                          /* OS_VMS */
00168 
00169 /* Missing #defines in VMS */
00170 
00171 #ifdef OS_VMS
00172 
00173 #define P_WAIT   0
00174 #define P_NOWAIT 1
00175 #define P_DETACH 4
00176 
00177 #endif
00178 
00179 /* and for UNIX */
00180 
00181 #ifdef OS_UNIX
00182 
00183 #define closesocket(s) close(s)
00184 #define ioctlsocket(s,c,d) ioctl(s,c,d)
00185 
00186 #define P_WAIT   0
00187 #define P_NOWAIT 1
00188 #define P_DETACH 4
00189 
00190 extern char **environ;
00191 
00192 #endif
00193 
00194 #ifndef FD_SETSIZE
00195 #define FD_SETSIZE 32
00196 #endif
00197 
00198 /* and VXWORKS */
00199 
00200 #ifdef OS_VXWORKS
00201 
00202 #define P_NOWAIT 1
00203 #define closesocket(s) close(s)
00204 #define ioctlsocket(s,c,d) ioctl(s,c,d)
00205 
00206 #endif
00207 
00208 /* missing O_BINARY for non-PC */
00209 #ifndef O_BINARY
00210 #define O_BINARY 0
00211 #define O_TEXT   0
00212 #endif
00213 
00214 /* min/max/abs macros */
00215 #ifndef MAX
00216 #define MAX(a,b)            (((a) > (b)) ? (a) : (b))
00217 #endif
00218 
00219 #ifndef MIN
00220 #define MIN(a,b)            (((a) < (b)) ? (a) : (b))
00221 #endif
00222 
00223 #ifndef ABS
00224 #define ABS(a)              (((a) < 0)   ? -(a) : (a))
00225 #endif
00226 
00227 /* missing tell() for some operating systems */
00228 #define TELL(fh) lseek(fh, 0, SEEK_CUR)
00229 
00230 /* reduced shared memory size */
00231 #ifdef OS_SOLARIS
00232 #define MAX_SHM_SIZE      0x20000       /* 128k */
00233 #endif
00234 
00235 /*------------------------------------------------------------------*/
00236 
00237 /* Network structures */
00238 
00239 typedef struct {
00240    DWORD routine_id;            /* routine ID like ID_BM_xxx    */
00241    DWORD param_size;            /* size in Bytes of parameter   */
00242 } NET_COMMAND_HEADER;
00243 
00244 typedef struct {
00245    NET_COMMAND_HEADER header;
00246    char param[32];              /* parameter array              */
00247 } NET_COMMAND;
00248 
00249 
00250 typedef struct {
00251    DWORD serial_number;
00252    DWORD sequence_number;
00253 } UDP_HEADER;
00254 
00255 #define UDP_FIRST 0x80000000l
00256 #define TCP_FAST  0x80000000l
00257 
00258 #define MSG_BM       1
00259 #define MSG_ODB      2
00260 #define MSG_CLIENT   3
00261 #define MSG_SERVER   4
00262 #define MSG_LISTEN   5
00263 #define MSG_WATCHDOG 6
00264 
00265 /* RPC structures */
00266 
00267 struct callback_addr {
00268    char host_name[HOST_NAME_LENGTH];
00269    short host_port1;
00270    short host_port2;
00271    short host_port3;
00272    int debug;
00273    char experiment[NAME_LENGTH];
00274    char directory[MAX_STRING_LENGTH];
00275    char user[NAME_LENGTH];
00276    INT index;
00277 };
00278 
00279 typedef struct {
00280    char host_name[HOST_NAME_LENGTH];    /*  server name        */
00281    INT port;                    /*  ip port                 */
00282    char exp_name[NAME_LENGTH];  /*  experiment to connect   */
00283    int send_sock;               /*  tcp send socket         */
00284    INT remote_hw_type;          /*  remote hardware type    */
00285    char client_name[NAME_LENGTH];       /* name of remote client    */
00286    INT transport;               /*  RPC_TCP/RPC_FTCP        */
00287    INT rpc_timeout;             /*  in milliseconds         */
00288 
00289 } RPC_CLIENT_CONNECTION;
00290 
00291 typedef struct {
00292    char host_name[HOST_NAME_LENGTH];    /*  server name        */
00293    INT port;                    /*  ip port                 */
00294    char exp_name[NAME_LENGTH];  /*  experiment to connect   */
00295    int send_sock;               /*  tcp send socket         */
00296    int recv_sock;               /*  tcp receive socket      */
00297    int event_sock;              /*  event socket            */
00298    INT remote_hw_type;          /*  remote hardware type    */
00299    INT transport;               /*  RPC_TCP/RPC_FTCP        */
00300    INT rpc_timeout;             /*  in milliseconds         */
00301 
00302 } RPC_SERVER_CONNECTION;
00303 
00304 typedef struct {
00305    INT tid;                     /*  thread id               */
00306    char prog_name[NAME_LENGTH]; /*  client program name     */
00307    char host_name[HOST_NAME_LENGTH];    /*  client name        */
00308    int send_sock;               /*  tcp send socket         */
00309    int recv_sock;               /*  tcp receive socket      */
00310    int event_sock;              /*  tcp event socket        */
00311    INT remote_hw_type;          /*  hardware type           */
00312    INT transport;               /*  RPC_TCP/RPC_FTCP        */
00313    INT watchdog_timeout;        /*  in milliseconds         */
00314    DWORD last_activity;         /*  time of last recv       */
00315    INT convert_flags;           /*  convertion flags        */
00316    char *net_buffer;            /*  TCP cache buffer        */
00317    char *ev_net_buffer;
00318    INT net_buffer_size;         /*  size of TCP cache       */
00319    INT write_ptr, read_ptr, misalign;   /* pointers for cache */
00320    INT ev_write_ptr, ev_read_ptr, ev_misalign;
00321    HNDLE odb_handle;            /*  handle to online datab. */
00322    HNDLE client_handle;         /*  client key handle .     */
00323 
00324 } RPC_SERVER_ACCEPTION;
00325 
00326 /**dox***************************************************************/
00327 #endif                          /* DOXYGEN_SHOULD_SKIP_THIS */
00328 
00329 /**dox***************************************************************/
00330 /** @addtogroup mssectionh
00331  *  
00332  *  @{  */
00333 
00334 typedef struct {
00335    INT size;                          /**< size in bytes              */
00336    INT next_free;                     /**< Address of next free block */
00337 } FREE_DESCRIP;
00338 
00339 typedef struct {
00340    INT handle;                        /**< Handle of record base key  */
00341    WORD access_mode;                  /**< R/W flags                  */
00342    WORD flags;                        /**< Data format, ...           */
00343 
00344 } OPEN_RECORD;
00345 
00346 typedef struct {
00347    char name[NAME_LENGTH];      /* name of client             */
00348    INT pid;                     /* process ID                 */
00349    INT tid;                     /* thread ID                  */
00350    INT thandle;                 /* thread handle              */
00351    INT port;                    /* UDP port for wake up       */
00352    INT num_open_records;        /* number of open records     */
00353    DWORD last_activity;         /* time of last activity      */
00354    DWORD watchdog_timeout;      /* timeout in ms              */
00355    INT max_index;               /* index of last opren record */
00356 
00357    OPEN_RECORD open_record[MAX_OPEN_RECORDS];
00358 
00359 } DATABASE_CLIENT;
00360 
00361 typedef struct {
00362    char name[NAME_LENGTH];      /* name of database           */
00363    INT version;                 /* database version           */
00364    INT num_clients;             /* no of active clients       */
00365    INT max_client_index;        /* index of last client       */
00366    INT key_size;                /* size of key area in bytes  */
00367    INT data_size;               /* size of data area in bytes */
00368    INT root_key;                /* root key offset            */
00369    INT first_free_key;          /* first free key memory      */
00370    INT first_free_data;         /* first free data memory     */
00371 
00372    DATABASE_CLIENT client[MAX_CLIENTS]; /* entries for clients        */
00373 
00374 } DATABASE_HEADER;
00375 
00376 /* Per-process buffer access structure (descriptor) */
00377 
00378 typedef struct {
00379    char name[NAME_LENGTH];      /* Name of database             */
00380    BOOL attached;               /* TRUE if database is attached */
00381    INT client_index;            /* index to CLIENT str. in buf. */
00382    DATABASE_HEADER *database_header;    /* pointer to database header   */
00383    void *database_data;         /* pointer to database data     */
00384    HNDLE mutex;                 /* mutex/semaphore handle       */
00385    INT lock_cnt;                /* flag to avoid multiple locks */
00386    HNDLE shm_handle;            /* handle (id) to shared memory */
00387    INT index;                   /* connection index / tid       */
00388    BOOL protect;                /* read/write protection        */
00389 
00390 } DATABASE;
00391 
00392 /* Open record descriptor */
00393 
00394 typedef struct {
00395    HNDLE handle;                /* Handle of record base key  */
00396    HNDLE hDB;                   /* Handle of record's database */
00397    WORD access_mode;            /* R/W flags                  */
00398    void *data;                  /* Pointer to local data      */
00399    void *copy;                  /* Pointer of copy to data    */
00400    INT buf_size;                /* Record size in bytes       */
00401    void (*dispatcher) (INT, INT, void *);       /* Pointer to dispatcher func. */
00402    void *info;                  /* addtl. info for dispatcher */
00403 
00404 } RECORD_LIST;
00405 
00406 /* Event request descriptor */
00407 
00408 typedef struct {
00409    INT buffer_handle;           /* Buffer handle */
00410    short int event_id;          /* same as in EVENT_HEADER */
00411    short int trigger_mask;
00412    void (*dispatcher) (HNDLE, HNDLE, EVENT_HEADER *, void *);   /* Dispatcher func. */
00413 
00414 } REQUEST_LIST;
00415 
00416 /**dox***************************************************************/
00417           /** @} *//* end of mssectionh */
00418 
00419 /**dox***************************************************************/
00420 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00421 
00422 /*---- Logging channel information ---------------------------------*/
00423 
00424 #define CHN_SETTINGS_STR(_name) char *_name[] = {\
00425 "[Settings]",\
00426 "Active = BOOL : 1",\
00427 "Type = STRING : [8] Disk",\
00428 "Filename = STRING : [256] run%05d.mid",\
00429 "Format = STRING : [8] MIDAS",\
00430 "Compression = INT : 0",\
00431 "ODB dump = BOOL : 1",\
00432 "Log messages = DWORD : 0",\
00433 "Buffer = STRING : [32] SYSTEM",\
00434 "Event ID = INT : -1",\
00435 "Trigger mask = INT : -1",\
00436 "Event limit = DWORD : 0",\
00437 "Byte limit = DOUBLE : 0",\
00438 "Tape capacity = DOUBLE : 0",\
00439 "Subdir format = STRING : [32]",\
00440 "Current filename = STRING : [256]",\
00441 "",\
00442 "[Statistics]",\
00443 "Events written = DOUBLE : 0",\
00444 "Bytes written = DOUBLE : 0",\
00445 "Bytes written total = DOUBLE : 0",\
00446 "Files written = INT : 0",\
00447 "",\
00448 NULL}
00449 
00450 typedef struct {
00451    BOOL active;
00452    char type[8];
00453    char filename[256];
00454    char format[8];
00455    INT compression;
00456    BOOL odb_dump;
00457    DWORD log_messages;
00458    char buffer[32];
00459    INT event_id;
00460    INT trigger_mask;
00461    DWORD event_limit;
00462    double byte_limit;
00463    double tape_capacity;
00464    char subdir_format[32];
00465    char current_filename[256];
00466 } CHN_SETTINGS;
00467 
00468 typedef struct {
00469    double events_written;
00470    double bytes_written;
00471    double bytes_written_total;
00472    INT files_written;
00473 } CHN_STATISTICS;
00474 
00475 typedef struct {
00476    INT handle;
00477    char path[256];
00478    INT type;
00479    INT format;
00480    INT buffer_handle;
00481    INT msg_buffer_handle;
00482    INT request_id;
00483    INT msg_request_id;
00484    HNDLE stats_hkey;
00485    HNDLE settings_hkey;
00486    CHN_SETTINGS settings;
00487    CHN_STATISTICS statistics;
00488    void **format_info;
00489    void *ftp_con;
00490 } LOG_CHN;
00491 
00492 #define LOG_TYPE_DISK 1
00493 #define LOG_TYPE_TAPE 2
00494 #define LOG_TYPE_FTP  3
00495 
00496 /*---- VxWorks specific taskSpawn arguments ----------------------*/
00497 
00498 typedef struct {
00499    char name[32];
00500    int priority;
00501    int options;
00502    int stackSize;
00503    int arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10;
00504 } VX_TASK_SPAWN;
00505 
00506 /*---- Channels for ss_suspend_set_dispatch() ----------------------*/
00507 
00508 #define CH_IPC        1
00509 #define CH_CLIENT     2
00510 #define CH_SERVER     3
00511 #define CH_LISTEN     4
00512 
00513 /*---- Function declarations ---------------------------------------*/
00514 
00515 /* make functions callable from a C++ program */
00516 #ifdef __cplusplus
00517 extern "C" {
00518 #endif
00519 
00520 /*---- common function ----*/
00521    INT EXPRT cm_set_path(char *path);
00522    INT EXPRT cm_get_path(char *path);
00523    INT cm_dispatch_ipc(char *message, int socket);
00524    INT EXPRT cm_msg_log(INT message_type, const char *message);
00525    INT EXPRT cm_msg_log1(INT message_type, const char *message, const char *facility);
00526    void EXPRT name2c(char *str);
00527 
00528 /*---- buffer manager ----*/
00529    INT bm_lock_buffer(INT buffer_handle);
00530    INT bm_unlock_buffer(INT buffer_handle);
00531    INT bm_notify_client(char *buffer_name, int socket);
00532    INT EXPRT bm_mark_read_waiting(BOOL flag);
00533    INT bm_push_event(char *buffer_name);
00534    INT bm_check_buffers(void);
00535    INT EXPRT bm_remove_event_request(INT buffer_handle, INT request_id);
00536    void EXPRT bm_defragment_event(HNDLE buffer_handle, HNDLE request_id,
00537                                   EVENT_HEADER * pevent, void *pdata,
00538                                   void (*dispatcher) (HNDLE, HNDLE,
00539                                                       EVENT_HEADER *, void *));
00540 
00541 /*---- online database ----*/
00542    INT EXPRT db_lock_database(HNDLE database_handle);
00543    INT EXPRT db_unlock_database(HNDLE database_handle);
00544    INT db_update_record(INT hDB, INT hKey, int socket);
00545    INT db_close_all_records(void);
00546    INT EXPRT db_flush_database(HNDLE hDB);
00547    INT EXPRT db_notify_clients(HNDLE hDB, HNDLE hKey, BOOL bWalk);
00548    INT EXPRT db_set_client_name(HNDLE hDB, char *client_name);
00549    INT db_delete_key1(HNDLE hDB, HNDLE hKey, INT level, BOOL follow_links);
00550    INT EXPRT db_show_mem(HNDLE hDB, char *result, INT buf_size, BOOL verbose);
00551 
00552 /*---- rpc functions -----*/
00553    RPC_LIST EXPRT *rpc_get_internal_list(INT flag);
00554    INT rpc_server_receive(INT index, int sock, BOOL check);
00555    INT rpc_server_callback(struct callback_addr *callback);
00556    INT EXPRT rpc_server_accept(int sock);
00557    INT rpc_client_accept(int sock);
00558    INT rpc_get_server_acception(void);
00559    INT rpc_set_server_acception(INT index);
00560    INT EXPRT rpc_set_server_option(INT item, POINTER_T value);
00561    POINTER_T EXPRT rpc_get_server_option(INT item);
00562    INT recv_tcp_check(int sock);
00563    INT recv_event_check(int sock);
00564    INT rpc_deregister_functions(void);
00565    INT rpc_check_channels(void);
00566    void EXPRT rpc_client_check();
00567    INT rpc_server_disconnect(void);
00568    int EXPRT rpc_get_send_sock(void);
00569    int EXPRT rpc_get_event_sock(void);
00570    INT EXPRT rpc_set_opt_tcp_size(INT tcp_size);
00571    INT EXPRT rpc_get_opt_tcp_size(void);
00572 
00573 /*---- system services ----*/
00574    INT ss_shm_open(char *name, INT size, void **adr, HNDLE * handle);
00575    INT ss_shm_close(char *name, void *adr, HNDLE handle, INT destroy_flag);
00576    INT ss_shm_flush(char *name, void *adr, INT size);
00577    INT ss_shm_protect(HNDLE handle, void *adr);
00578    INT ss_shm_unprotect(HNDLE handle, void **adr);
00579    INT ss_spawnv(INT mode, char *cmdname, char *argv[]);
00580    INT ss_shell(int sock);
00581    INT EXPRT ss_daemon_init(BOOL keep_stdout);
00582    INT EXPRT ss_system(char *command);
00583    INT EXPRT ss_exec(char *cmd, INT * child_pid);
00584    BOOL EXPRT ss_existpid(INT pid);
00585    INT EXPRT ss_getpid(void);
00586    INT EXPRT ss_gettid(void);
00587    INT ss_getthandle(void);
00588    INT ss_set_async_flag(INT flag);
00589    INT EXPRT ss_mutex_create(char *mutex_name, HNDLE * mutex_handle);
00590    INT EXPRT ss_mutex_wait_for(HNDLE mutex_handle, INT timeout);
00591    INT EXPRT ss_mutex_release(HNDLE mutex_handle);
00592    INT EXPRT ss_mutex_delete(HNDLE mutex_handle, INT destroy_flag);
00593    INT ss_wake(INT pid, INT tid, INT thandle);
00594    INT ss_alarm(INT millitime, void (*func) (int));
00595    INT ss_suspend_get_port(INT * port);
00596    INT ss_suspend_set_dispatch(INT channel, void *connection, INT(*dispatch) ());
00597    INT ss_resume(INT port, char *message);
00598    INT ss_suspend_exit(void);
00599    INT ss_exception_handler(void (*func) ());
00600    void EXPRT ss_force_single_thread();
00601    INT EXPRT ss_suspend(INT millisec, INT msg);
00602    midas_thread_t EXPRT ss_thread_create(INT(*func) (void *), void *param);
00603    INT EXPRT ss_thread_kill(midas_thread_t thread_id);
00604    INT EXPRT ss_get_struct_align(void);
00605    INT EXPRT ss_timezone(void);
00606 
00607 /*---- socket routines ----*/
00608    INT EXPRT send_tcp(int sock, char *buffer, DWORD buffer_size, INT flags);
00609    INT EXPRT recv_tcp(int sock, char *buffer, DWORD buffer_size, INT flags);
00610    INT send_udp(int sock, char *buffer, DWORD buffer_size, INT flags);
00611    INT recv_udp(int sock, char *buffer, DWORD buffer_size, INT flags);
00612    INT EXPRT recv_string(int sock, char *buffer, DWORD buffer_size, INT flags);
00613 
00614 /*---- system logging ----*/
00615    INT EXPRT ss_syslog(const char *message);
00616 
00617 /*---- event buffer routines ----*/
00618    INT EXPRT eb_create_buffer(INT size);
00619    INT EXPRT eb_free_buffer(void);
00620    BOOL EXPRT eb_buffer_full(void);
00621    BOOL EXPRT eb_buffer_empty(void);
00622    EVENT_HEADER EXPRT *eb_get_pointer(void);
00623    INT EXPRT eb_increment_pointer(INT buffer_handle, INT event_size);
00624    INT EXPRT eb_send_events(BOOL send_all);
00625 
00626 /*---- dual memory event buffer routines ----*/
00627    INT EXPRT dm_buffer_create(INT size, INT usize);
00628    INT EXPRT dm_buffer_release(void);
00629    BOOL EXPRT dm_area_full(void);
00630    EVENT_HEADER EXPRT *dm_pointer_get(void);
00631    INT EXPRT dm_pointer_increment(INT buffer_handle, INT event_size);
00632    INT EXPRT dm_area_send(void);
00633    INT EXPRT dm_area_flush(void);
00634    INT EXPRT dm_task(void *pointer);
00635    DWORD EXPRT dm_buffer_time_get(void);
00636    INT EXPRT dm_async_area_send(void *pointer);
00637 
00638 /*---- Include RPC identifiers -------------------------------------*/
00639 
00640 #include "mrpc.h"
00641 
00642 #ifdef __cplusplus
00643 }
00644 #endif
00645 /**dox***************************************************************/
00646 #endif                          /* DOXYGEN_SHOULD_SKIP_THIS */
00647           /**dox***************************************************************//** @} *//* end of msystemincludecode */

Midas DOC Version 1.9.5 ---- PSI Stefan Ritt ----
Contributions: Pierre-Andre Amaudruz - Sergio Ballestrero - Suzannah Daviel - Doxygen - Peter Green - Qing Gu - Greg Hackman - Gertjan Hofman - Paul Knowles - Rudi Meier - Glenn Moloney - Dave Morris - John M O'Donnell - Konstantin Olchanski - Renee Poutissou - Tamsen Schurman - Andreas Suter - Jan M.Wouters - Piotr Adam Zolnierczuk