00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "typedefs.h"
00018
00019 #ifndef GETEVT
00020 #define GETEVT
00021
00022
00023 #ifdef GSI__WINNT
00024 #include <stdio.h>
00025 #include <stdlib.h>
00026 #include <fcntl.h>
00027 #include <string.h>
00028 #include <memory.h>
00029 #include <sys/timeb.h>
00030 #include <sys/types.h>
00031 #include <sys/stat.h>
00032 #include <fcntl.h>
00033 #define DEF_FILE_ACCE S_IREAD|S_IWRITE
00034 #define GET__OPEN_FLAG O_RDONLY
00035 #define PUT__OPEN_APD_FLAG O_RDWR|O_APPEND
00036 #define PUT__CRT_FLAG O_CREAT|O_RDWR
00037 #define PUT__CRT_OPT ""
00038
00039 #include <winsock.h>
00040 #define WS_VERSION_REQD 0x0101
00041 #define WS_VERSION_MAJOR HIBYTE(WS_VERSION_REQD)
00042 #define WS_VERSION_MINOR LOBYTE(WS_VERSION_REQD)
00043 #define MIN_SOCKETS_REQD 6
00044 WSADATA wsaData;
00045 #endif
00046
00047
00048
00049
00050 #ifdef Linux
00051 #include <stdio.h>
00052 #include <stdlib.h>
00053 #include <fcntl.h>
00054 #include <string.h>
00055 #include <unistd.h>
00056 #include <memory.h>
00057 #include <pwd.h>
00058 #include <sys/time.h>
00059 #include <sys/timeb.h>
00060 #include <sys/types.h>
00061 #include <sys/stat.h>
00062 #define DEF_FILE_ACCE S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH
00063 #define GET__OPEN_FLAG O_RDONLY
00064 #define PUT__OPEN_APD_FLAG O_RDWR|O_APPEND
00065 #define PUT__CRT_FLAG O_CREAT|O_RDWR
00066 #define PUT__CRT_OPT ""
00067 #endif
00068
00069 #ifdef _AIX
00070 #include <stdio.h>
00071 #include <stdlib.h>
00072 #include <fcntl.h>
00073 #include <string.h>
00074 #include <unistd.h>
00075 #include <memory.h>
00076 #include <pwd.h>
00077 #include <sys/time.h>
00078 #include <sys/timeb.h>
00079 #include <sys/types.h>
00080 #include <sys/mode.h>
00081 #define DEF_FILE_ACCE S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH
00082 #define GET__OPEN_FLAG O_RDONLY
00083 #define PUT__OPEN_APD_FLAG O_RDWR|O_APPEND
00084 #define PUT__CRT_FLAG O_CREAT|O_RDWR
00085 #define PUT__CRT_OPT ""
00086 #endif
00087
00088 #ifdef VMS
00089 #include <unixio.h>
00090 #include <unixlib.h>
00091 #include <file.h>
00092 #include <stdio.h>
00093 #include <stdlib.h>
00094 #include <fcntl.h>
00095 #include <string.h>
00096 #include <sys/time.h>
00097 #include <sys/timeb.h>
00098 #include <sys/types.h>
00099 #include <unistd.h>
00100 #define DEF_FILE_ACCE 644
00101 #define GET__OPEN_FLAG O_RDONLY
00102 #define PUT__OPEN_APD_FLAG O_RDWR|O_APPEND
00103 #define PUT__CRT_FLAG O_CREAT|O_WRONLY
00104 #define PUT__CRT_OPT "rfm=fix"
00105 #endif
00106
00107 #define MAX_BUF_LGTH 32768
00108 #define MIN_BUF_LGTH 512
00109 #define MAX_BUFS_IN_STREAM 100
00110 #define MAX_LONG 99999999
00111
00112 struct s_evt_channel
00113 {
00114 INTS4 l_server_type;
00115 INTS4 l_buf_type;
00116 INTS4 l_buf_subtype;
00117 INTS4 l_channel_no;
00118 INTS4 l_buf_size;
00119 INTS4 l_buf_no;
00120 INTS4 l_buf_posi;
00121 INTS4 l_buf_lmt;
00122 INTS4 l_bufs_in_stream;
00123 INTS4 l_stream_bufs;
00124 INTS4 l_io_buf_size;
00125 INTS4 l_io_buf_posi;
00126 INTS4 l_evt_buf_size;
00127 INTS4 l_evt_buf_posi;
00128 INTS4 l_evt_size;
00129 INTS4 l_events;
00130 INTS4 l_buffers;
00131 INTS4 l_kbytes;
00132 INTS4 l_first_get;
00133 INTS4 l_first_put;
00134 INTS4 l_first_buf;
00135 INTS4 l_frag_len;
00136 CHARS *pc_io_buf;
00137 CHARS *pc_evt_buf;
00138 s_bufhe *ps_bufhe;
00139 s_ve10_1 *ps_ve10_1;
00140 CHARS c_channel[128];
00141 } ;
00142
00143 INTS4 f_evt_get_open(INTS4, CHARS *, s_evt_channel *, CHARS **, INTS4, INTS4);
00144 INTS4 f_evt_get_event(s_evt_channel *, INTS4 **, INTS4 **);
00145 INTS4 f_evt_get_buffer(s_evt_channel *, INTS4 *);
00146 INTS4 f_evt_get_close(s_evt_channel *);
00147 INTS4 f_evt_put_open(CHARS *,INTS4,INTS4,INTS4,INTS4,s_evt_channel *,CHARS *);
00148 INTS4 f_evt_put_event(s_evt_channel *, INTS4 *);
00149 INTS4 f_evt_put_buffer(s_evt_channel *, s_bufhe *);
00150 INTS4 f_evt_put_close(s_evt_channel *);
00151 INTS4 f_evt_error( INTS4 , CHARS * , INTS4 );
00152 INTS4 f_evt_swap(CHARS *, INTS4);
00153
00154
00155
00156
00157 #define GETEVT__FILE 1
00158 #define GETEVT__STREAM 2
00159 #define GETEVT__TRANS 3
00160 #define GETEVT__EVENT 4
00161 #define GETEVT__REVSERV 5
00162
00163
00164
00165 #define GETEVT__SUCCESS 0
00166 #define GETEVT__FAILURE 1
00167 #define GETEVT__FRAGMENT 2
00168 #define GETEVT__NOMORE 3
00169 #define GETEVT__NOFILE 4
00170 #define GETEVT__NOSERVER 5
00171 #define GETEVT__RDERR 6
00172 #define GETEVT__CLOSE_ERR 7
00173 #define GETEVT__NOCHANNEL 8
00174
00175 #define PUTEVT__SUCCESS 0
00176 #define PUTEVT__FILE_EXIST 11
00177 #define PUTEVT__FAILURE 12
00178 #define PUTEVT__TOOBIG 13
00179 #define PUTEVT__TOO_SMALLS 14
00180 #define PUTEVT__CLOSE_ERR 15
00181 #define PUTEVT__WRERR 16
00182 #define PUTEVT__NOCHANNEL 17
00183
00184 #endif
00185
00186
00187
00188