43 #include <sys/timeb.h>
44 #include <sys/types.h>
52 #define DEF_FILE_ACCE S_IREAD|S_IWRITE
53 #define GET__OPEN_FLAG O_RDONLY|O_BINARY
54 #define PUT__OPEN_APD_FLAG O_RDWR|O_APPEND
55 #define PUT__CRT_FLAG O_CREAT|O_RDWR
56 #define PUT__CRT_OPT ""
60 #define WS_VERSION_REQD 0x0101
61 #define WS_VERSION_MAJOR HIBYTE(WS_VERSION_REQD)
62 #define WS_VERSION_MINOR LOBYTE(WS_VERSION_REQD)
63 #define MIN_SOCKETS_REQD 6
75 #include <sys/types.h>
77 #define DEF_FILE_ACCE S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH
78 #define GET__OPEN_FLAG O_RDONLY
79 #define PUT__OPEN_APD_FLAG O_RDWR|O_APPEND
80 #define PUT__CRT_FLAG O_CREAT|O_RDWR
81 #define PUT__CRT_OPT ""
92 #include <sys/types.h>
94 #define DEF_FILE_ACCE S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH
95 #define GET__OPEN_FLAG O_RDONLY
96 #define PUT__OPEN_APD_FLAG O_RDWR|O_APPEND
97 #define PUT__CRT_FLAG O_CREAT|O_RDWR
98 #define PUT__CRT_OPT ""
109 #include <sys/types.h>
110 #include <sys/stat.h>
111 #define DEF_FILE_ACCE S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH
112 #define GET__OPEN_FLAG O_RDONLY
113 #define PUT__OPEN_APD_FLAG O_RDWR|O_APPEND
114 #define PUT__CRT_FLAG O_CREAT|O_RDWR
115 #define PUT__CRT_OPT ""
128 #include <sys/types.h>
129 #include <sys/mode.h>
130 #define DEF_FILE_ACCE S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH
131 #define GET__OPEN_FLAG O_RDONLY
132 #define PUT__OPEN_APD_FLAG O_RDWR|O_APPEND
133 #define PUT__CRT_FLAG O_CREAT|O_RDWR
134 #define PUT__CRT_OPT ""
145 #define RFIO_open rfio_open
146 #define RFIO_close rfio_close
147 #define RFIO_read rfio_read
148 #define RFIO_lseek rfio_lseek
151 #define RFIO_open open
152 #define RFIO_close close
153 #define RFIO_read read
154 #define RFIO_lseek lseek
158 #define own_getpid _getpid
160 #define own_getpid getpid
242 INTS4 l_total,l_sub,l_sum;
246 pl_next = (
INTS4 *) (ps_ve10_1 + 1);
247 l_total = ps_ve10_1->
l_dlen-4;
250 while(l_sum < l_total)
256 if(pl_lwords != NULL) *pl_lwords = ps_ves10_1->
l_dlen/2-1;
257 if(pl_se != NULL) *pl_se = (
INTS4 *) ps_ves10_1;
258 if(pl_d != NULL) *pl_d = (
INTS4 *) (ps_ves10_1+1);
261 l_sub = ps_ves10_1->
l_dlen+4;
263 pl_next = (
INTS4 *)(ps_ves10_1);
266 if(pl_lwords != NULL) *pl_lwords = ll;
267 if(pl_se != NULL) *pl_se = NULL;
268 if(pl_d != NULL) *pl_d = NULL;
269 if(l_subevent == 0)
return(ll);
316 if((l_hex+l_long) > 0) l_ldata=1;
321 sprintf(c_line,
"--------------------------------------------------------");
322 printf(
"%s\n",c_line);
325 if(ll%512 > 0)ll += 512-ll%512;
328 if(ps_bufhe->
i_type == 2000)
331 sprintf(c_line,
"File header info:");
332 printf(
"%s\n",c_line);
334 printf(
"%s\n",c_line);
336 printf(
"%s\n",c_line);
337 sprintf(c_line,
"File: %s",ps_filhe->
filhe_file);
338 printf(
"%s\n",c_line);
339 sprintf(c_line,
"User: %s",ps_filhe->
filhe_user);
340 printf(
"%s\n",c_line);
341 sprintf(c_line,
"Time: %s",ps_filhe->
filhe_time);
342 printf(
"%s\n",c_line);
343 sprintf(c_line,
"Run: %s",ps_filhe->
filhe_run);
344 printf(
"%s\n",c_line);
345 sprintf(c_line,
"Exp: %s",ps_filhe->
filhe_exp);
346 printf(
"%s\n",c_line);
350 printf(
"%s\n",c_line);
357 sprintf(c_line,
"Buffer %9d, Length %5d[w] Size %5d[b] used %5d[w] %s",
362 printf(
"%s\n",c_line);
363 sprintf(c_line,
" Events %3d Type/Subtype %5d %5d FragEnd=%d FragBegin=%d Total %5d[w]",
370 printf(
"%s\n",c_line);
372 sprintf(c_line,
"--------------------------------------------------------");
373 printf(
"%s\n",c_line);
376 if(ps_evhe == NULL)
return(0);
381 sprintf(c_line,
"Event type %d, subtype %d, data longwords %d",
383 printf(
"%s\n",c_line);
384 if((l_ldata != 0) & ((ps_evhe->
i_type == 4)|(ps_evhe->
i_type == 6)))
386 pl_data = (
INTS4 *)ps_evhe;
388 for(l=0;l<ps_evhe->
l_dlen/2;l++)
390 sprintf(c_line,
"%08x ",*pl_data);
391 strncat(c_full, c_line,
sizeof(c_full)-1);
394 printf(
"%s\n",c_full);
398 if(strlen(c_full) > 2) printf(
"%s\n",c_full);
406 sprintf(c_line,
"Event %9d Type/Subtype %5d %5d Length %5d[w] Trigger %2d",
412 printf(
"%s\n",c_line);
423 if((l_subid < 0)|(l_subid == ps_ves10_1->
i_procid))
425 sprintf(c_line,
" SubEv ID %6d Type/Subtype %5d %5d Length %5d[w] Control %2d Subcrate %2d",
432 printf(
"%s\n",c_line);
435 if((l_long != 0) | (l_hex != 0))
439 if(l_hex != 0) sprintf(c_line,
"%04x.%04x ",(*pl_data>>16)&0xffff,*pl_data&0xffff);
440 else sprintf(c_line,
"%8d ",*pl_data);
441 strncat(c_full, c_line,
sizeof(c_full)-1);
445 printf(
"%s\n",c_full);
449 if(strlen(c_full) > 2)printf(
"%s\n",c_full);
456 sprintf(c_line,
"%8d%8d",*pl_data&0xffff,(*pl_data>>16)&0xffff);
457 strncat(c_full, c_line,
sizeof(c_full)-1);
461 printf(
"%s\n",c_full);
465 if(strlen(c_full) > 2)printf(
"%s\n",c_full);
493 if (l_port>0) printf(
"Use MBS source port %d\n",l_port);
516 if (l_port>0) printf(
"Use MBS source port %d\n",l_port);
560 INTS4 l_swap, l_swap_head, l_is_goosybuf, l_filehead=0, l_size, l_size_head, l_dummy, l_header_size, l_port;
561 CHARS c_file[256], *pc_temp;
571 if((pc_temp=strchr(pc_server,
':')) != NULL) {
580 printf(
"rfio not supported!\n");
585 if(ps_info != NULL) *ps_info=NULL;
591 strcpy(c_file,pc_server);
592 if(strlen(c_file) < 5) strncat(c_file,
".lmd",
sizeof(c_file)-1);
594 pc_temp = (
CHARS *) &c_file[strlen(c_file)-4];
595 if((strcmp(pc_temp,
".LMD") != 0) &&
596 (strcmp(pc_temp,
".lmd") != 0)) strncat(c_file,
".lmd",
sizeof(c_file)-1);
599 if((ps_chan->
l_channel_no=open(c_file,GET__OPEN_FLAG))== -1)
605 printf(
"LMD format error: no LMD file: %s\n",c_file);
623 if(((l_is_goosybuf==0)&(l_filehead==0))|(l_size_head==0)) {
624 printf(
"LMD format error: swap=%d, header=%d, isLMD=%d, size=%d\n",l_swap_head,l_filehead,l_is_goosybuf,l_size_head);
631 if(l_filehead == 1) {
633 l_header_size=l_size_head;
639 printf(
"LMD format error: no LMD file: %s\n",c_file);
650 if((l_is_goosybuf==0)|(l_size!=l_size_head)|(l_swap!=l_swap_head)) {
651 printf(
"LMD format error: swap=%d, isLMD=%d, size=%d\n",l_swap,l_is_goosybuf,l_size);
659 if(ps_info != NULL) *ps_info=NULL;
661 if(l_filehead == 1) {
663 printf(
"LMD format error: no LMD file: %s\n",c_file);
669 if(ps_info != NULL) {
725 printf(
"f_evt_get_open for STREAM: port=%d timeout=%d \n",l_port, ps_chan->
l_timeout);
758 printf(
"f_evt_get_open for TRANSPORT: port=%d timeout=%d \n",l_port, ps_chan->
l_timeout);
785 printf(
"LMD format error: no LMD file: %s\n",pc_server);
792 if(((l_is_goosybuf==0)&(l_filehead==0))|(l_size_head==0))
794 printf(
"LMD format error: swap=%d, header=%d, isLMD=%d, size=%d\n",l_swap_head,l_filehead,l_is_goosybuf,l_size_head);
805 printf(
"LMD format error: no LMD file: %s\n",pc_server);
817 if((l_is_goosybuf==0)|(l_size!=l_size_head)|(l_swap!=l_swap_head))
819 printf(
"LMD format error: swap=%d, isLMD=%d, size=%d\n",l_swap,l_is_goosybuf,l_size);
827 if(ps_info != NULL)*ps_info=NULL;
833 printf(
"LMD format error: no LMD file: %s\n",pc_server);
864 if(ps_info != NULL) *ps_info=NULL;
872 printf(
"Memory allocation error\n");
878 printf(
"Memory allocation error\n");
915 INTS4 l_temp,l_prev_ok=1, l_stat, l_used;
920 if(ps_chan->
pLmd != NULL) {
942 if(ppl_goobuf)*ppl_goobuf = NULL;
943 *ppl_buffer = (
INTS4 *)pevt;
997 printf(
"Unsolicited file header found!\n");
1063 printf(
"Memory allocation error\n");
1080 if(ppl_goobuf)*ppl_goobuf=(
INTS4 *)(ps_bufhe_cur);
1106 INTS4 l_close_failure;
1109 if(ps_chan->
pLmd != NULL){
1113 free(ps_chan->
pLmd);
1124 if(close(ps_chan->
l_channel_no)==-1) l_close_failure=1;
1202 struct timespec s_timespec;
1204 CHARS c_file[256], *pc_temp;
1225 printf(
"Memory allocation error\n");
1229 strcpy(c_file,pc_file);
1230 if(strlen(c_file) < 5) strncat(c_file,
".lmd",
sizeof(c_file)-1);
1233 pc_temp = (
CHARS *) &c_file[strlen(c_file)-4];
1234 if((strcmp(pc_temp,
".LMD") != 0) &&
1235 (strcmp(pc_temp,
".lmd") != 0)) strncat(c_file,
".lmd",
sizeof(c_file)-1);
1237 if((ps_chan->
l_channel_no=open(c_file,PUT__OPEN_APD_FLAG) )!= -1) {
1242 DEF_FILE_ACCE) )== -1)
1250 if(ps_filhe != NULL) {
1251 memcpy(ps_file_head, ps_filhe,ps_chan->
l_buf_size );
1253 memset( ps_file_head,
'\0', ps_chan->
l_buf_size);
1260 clock_gettime(CLOCK_REALTIME, &s_timespec);
1269 strncpy(c_mode, ctime(&s_timet),
sizeof(c_mode));
1274 if(l_write_size==-1)
1310 INTS4 l_evt_buf_posi;
1311 INTS4 l_buf_remain_size;
1312 INTS4 l_write_size, l_temp, l_free;
1318 if(ps_chan->
pLmd != NULL){
1335 l_buf_remain_size -= l_temp;
1352 if(ps_bufhe->
l_evt>0)
1365 l_buf_remain_size -= l_temp;
1366 l_buf_remain_size +=
sizeof(
s_evhe);
1374 while(l_evt_buf_posi<ps_chan->l_evt_size)
1381 if(l_evt_buf_posi != 0)
1395 if(l_write_size>(ps_chan->
l_evt_size-l_evt_buf_posi))
1396 l_write_size=(ps_chan->
l_evt_size-l_evt_buf_posi);
1400 l_evt_buf_posi += l_write_size;
1412 if(l_evt_buf_posi!=l_write_size)
1421 if(l_evt_buf_posi<ps_chan->l_evt_size) ps_chan->
ps_bufhe->
h_begin = 1;
1457 if(ps_chan->
pLmd != NULL){
1465 if(l_write_size==-1)
1498 INTS4 l_write_size, l_temp, l_temp2;
1502 if(ps_chan->
pLmd != NULL){
1539 for(l_temp=0;l_temp<l_write_size;l_temp+=ps_chan->
l_buf_size){
1596 sprintf(c_line,
"-I-f_evt: no such input file");
1599 sprintf(c_line,
"-I-f_evt: no such tag file");
1602 sprintf(c_line,
"-I-f_evt: no such event tag");
1605 sprintf(c_line,
"-I-f_evt: time out");
1608 sprintf(c_line,
"-I-f_evt: no such server");
1611 sprintf(c_line,
"-I-f_evt: read server error");
1614 sprintf(c_line,
"-I-f_evt: read tag file error");
1617 sprintf(c_line,
"-I-f_evt: write tag file error");
1620 sprintf(c_line,
"-I-f_evt: data format error");
1623 sprintf(c_line,
"-I-f_evt: no more event");
1626 sprintf(c_line,
"-I-f_evt: close server error");
1629 sprintf(c_line,
"-I-f_evt: failure");
1632 sprintf(c_line,
"-I-f_evt: too many channels");
1635 sprintf(c_line,
"-I-f_evt: input file is no LMD file");
1638 sprintf(c_line,
"-I-f_evt: success");
1641 sprintf(c_line,
"-I-f_evt: output file already exist");
1644 sprintf(c_line,
"-I-f_evt: write file error");
1647 sprintf(c_line,
"-I-f_evt: output file too large");
1650 sprintf(c_line,
"-I-f_evt: event can not fit in a stream");
1653 sprintf(c_line,
"-I-f_evt: close output error");
1656 sprintf(c_line,
"-I-f_evt: output failure");
1659 sprintf(c_line,
"-I-f_evt: too many channels");
1662 sprintf(c_line,
"-I-f_evt: unknown message id %d",l_error);
1663 if(l_out==0)printf(
"%s\n",c_line);
1664 if(l_out==1)strcpy(pc_dest,c_line);
1668 if(l_out==0)printf(
"%s\n",c_line);
1669 if(l_out==1)strcpy(pc_dest,c_line);
1713 else if(l_temp == -1)
1726 else if(l_temp == -1)
1757 if( ((
s_bufhe *)(ps_buffer))->l_free[0] !=1)
1862 if(l_length%4 == 2){
1863 ch_temp=*(pc_source+l_length-2);
1864 *(pc_source+l_length-2)=*(pc_source+l_length-1);
1865 *(pc_source+l_length-1)=ch_temp;
1867 l_length=(l_length/4)*4;
1868 for(p_d=pc_source,p_s=(
CHARS *)&l_save; p_d<pc_source+l_length;)
1870 l_save = *((
INTS4 *)p_d);
1872 *(p_d++) = *(--p_s);
1873 *(p_d++) = *(--p_s);
1874 *(p_d++) = *(--p_s);
1875 *(p_d++) = *(--p_s);
1900 if(ps_bufhe->
i_type == 2000)
1910 for(ii=0;ii<ps_filhe->filhe_lines;ii++) {
1987 printf(
"**** I-f_evt: Stream server request for disconnect!\n");
2000 printf(
"**** I-f_evt: Transport server request for disconnect!\n");
2053 if( (((
s_filhe *)(pc_head))->filhe_subtype==1)&&
2054 (((
s_filhe *)(pc_head))->filhe_type==2000) )
2059 l_size=((
s_bufhe *)(pc_head))->l_dlen*2;
2060 if(l_size%512 > 0) l_size +=
sizeof(
s_bufhe);
2061 if((l_size>>24) > 0) *pl_size=0;
2062 else *pl_size=l_size;
2066 if( (((
s_filhe *)(pc_head))->filhe_subtype==1)&&
2067 (((
s_filhe *)(pc_head))->filhe_type==2000) )
2072 l_size=((
s_bufhe *)(pc_head))->l_dlen*2;
2073 if(l_size%512 > 0) l_size +=
sizeof(
s_bufhe);
2074 if((l_size>>24) > 0) *pl_size=0;
2075 else *pl_size=l_size;
2080 l_size=((
s_bufhe *)(pc_head))->l_dlen*2;
2081 if(l_size%512 > 0) l_size +=
sizeof(
s_bufhe);
2082 if( (((l_size>>24)== 0)&&(l_size > 0))&&
2083 (((
s_bufhe *)(pc_head))->h_begin<2)&&
2084 (((
s_bufhe *)(pc_head))->h_begin>=0)&&
2085 (((
s_bufhe *)(pc_head))->h_end<2)&&
2086 (((
s_bufhe *)(pc_head))->h_end>=0)&&
2088 ((((
s_bufhe *)(pc_head))->i_used>0)||(((
s_bufhe *)(pc_head))->l_free[2]>0))&&
2090 ( (((
s_bufhe *)(pc_head))->l_free[0]==1)||
2091 (((
s_bufhe *)(pc_head))->l_free[0]==0)||
2093 (((
s_bufhe *)(pc_head))->l_free[0]==256*256*256) ) )
2102 if( (((l_size>>24)== 0)&&(l_size > 0))&&
2103 (((
s_bufhe *)(pc_head))->l_dlen>0)&&
2104 (((
s_bufhe *)(pc_head))->h_begin<2)&&
2105 (((
s_bufhe *)(pc_head))->h_begin>=0)&&
2106 (((
s_bufhe *)(pc_head))->h_end<2)&&
2107 (((
s_bufhe *)(pc_head))->h_end>=0)&&
2109 ((((
s_bufhe *)(pc_head))->i_used>0)||(((
s_bufhe *)(pc_head))->l_free[2]>0))&&
2111 ( (((
s_bufhe *)(pc_head))->l_free[0]==1)||
2112 (((
s_bufhe *)(pc_head))->l_free[0]==0)||
2114 (((
s_bufhe *)(pc_head))->l_free[0]==256*256*256) ) )
2138 struct timespec s_timespec;
2154 clock_gettime(CLOCK_REALTIME, &s_timespec);
2211 INTS4 ii,l_take_it,l_temp,l_chan,l_out,l_file_pos=0,l_bufnr=0,l_events=0;
2212 INTS4 l_firste,*pl,l_len,l_last=-1,l_lin=0,l_fragsize;
2213 INTS4 l_swap=0, l_swap_head, l_is_goosybuf, l_filehead=0, l_size=0, l_size_head, l_dummy, l_evsize,l_evt_buf_size=0;
2215 CHARS *pc_evt_buf=NULL;
2222 printf(
"LMD file %s, TAG file %s\n",pc_lmd,pc_tag);
2224 if((l_chan=open(pc_lmd,GET__OPEN_FLAG))== -1)
return(
GETEVT__NOFILE);
2233 if(((l_is_goosybuf==0)&(l_filehead==0))|(l_size_head==0))
2235 printf(
"LMD format error: swap=%d, header=%d, isLMD=%d, size=%d\n",l_swap_head,l_filehead,l_is_goosybuf,l_size_head);
2242 lseek(l_chan, 0, SEEK_SET);
2243 if(read(l_chan,
c_temp,l_size_head)!=l_size_head)
2254 if((l_is_goosybuf==0)|(l_size!=l_size_head)|(l_swap!=l_swap_head))
2256 printf(
"LMD format error: swap=%d, isLMD=%d, size=%d\n",l_swap,l_is_goosybuf,l_size);
2262 lseek(l_chan, 0, SEEK_SET);
2264 printf(
"Buffer swap %d, File header %d, LMD buffer %d, size %d[b]\n",l_swap,l_filehead,l_is_goosybuf,l_size);
2269 if(read(l_chan,
c_temp,l_size)!=l_size)
2274 l_file_pos += l_size;
2279 if((l_out=open(pc_tag,PUT__CRT_FLAG,DEF_FILE_ACCE))== -1)
return(
GETEVT__NOFILE);
2280 write(l_out,(
CHARS *)&s_taghe,
sizeof(s_taghe));
2283 if(e_filter != NULL) ii=(*e_filter)(NULL);
2285 while(read(l_chan,
c_temp,l_size)==l_size)
2287 l_file_pos=l_bufnr*l_size;
2296 ps_ve10_1=(
s_ve10_1 *)(ps_bufhe + 1);
2297 pl = (
INTS4 *)ps_ve10_1;
2298 l_file_pos +=
sizeof(
s_bufhe);
2303 l_file_pos += (l_len<<2);
2305 pl = (
INTS4 *)ps_ve10_1;
2309 for(ii=1;ii<ps_bufhe->
l_evt;ii++)
2312 if(e_filter != NULL)l_take_it=(*e_filter)(ps_ve10_1);
2320 if(ps_ve10_1->
l_count != (l_last+1))
2323 if(l_lin == 1)l_firste=ps_ve10_1->
l_count;
2327 if(write(l_out,(
CHARS *)&s_tag,
sizeof(s_tag)) !=
sizeof(s_tag))
2334 l_file_pos += (l_len<<2);
2336 pl = (
INTS4 *)ps_ve10_1;
2339 if(ps_bufhe->
l_evt > 0)
2341 if(ps_ve10_1->
l_dlen < 4) printf(
"Buffer %d Event fragment %10d dlen %d ts %d %d trigger %d\n"
2348 if(e_filter != NULL)
2351 l_evsize=ps_bufhe->
l_free[1]+4;
2352 if(l_evt_buf_size < l_evsize*2)
2354 if(pc_evt_buf != NULL)free(pc_evt_buf);
2355 l_evt_buf_size=l_evsize*2;
2356 pc_evt_buf=(
CHARS *)malloc(l_evt_buf_size);
2359 ps=(
INTU4 *)ps_ve10_1;
2360 pd=(
INTU4 *)pc_evt_buf;
2361 l_fragsize = ps_ve10_1->
l_dlen+4;
2362 for(ii=0;ii<l_fragsize/2;ii++) *pd++ = *ps++;
2364 while(l_fragsize < l_evsize)
2366 if(read(l_chan,
c_temp,l_size) != l_size)
break;
2369 ps = (
INTU4 *) (ps_bufhe+1);
2372 for(ii=0;ii<l_temp/2;ii++) *pd++ = *ps++;
2373 l_fragsize += l_temp;
2375 if(l_fragsize < l_evsize)
break;
2376 ps_ve10_1 = (
s_ve10_1 *)pc_evt_buf;
2377 ps_ve10_1->
l_dlen=l_evsize-4;
2380 lseek(l_chan, -l_size, SEEK_CUR);
2390 if(e_filter != NULL)l_take_it=(*e_filter)(ps_ve10_1);
2395 if(ps_ve10_1->
l_count != (l_last+1))
2398 if(l_lin == 1)l_firste=ps_ve10_1->
l_count;
2402 if(write(l_out,(
CHARS *)&s_tag,
sizeof(s_tag)) !=
sizeof(s_tag))
2413 lseek(l_out, 0, SEEK_SET);
2423 if(write(l_out,(
CHARS *)&s_taghe,
sizeof(s_taghe)) !=
sizeof(s_taghe))
2431 printf(
"Buffers %6d, of size %d, Events %10d, first %d, last %d "
2437 if(s_taghe.
l_linear)printf(
"linear\n");
2438 else printf(
"not linear\n");
2477 if(l_prihe)printf(
"LMD file %s, TAG file %s\n",pc_lmd,pc_tag);
2480 if ((pc_tag==0) || (*pc_tag==0))
2491 *ps_head = (
CHARS *) ps_bufhe;
2494 printf(
"Error opening input file %s\n",pc_lmd);
2498 if(l_prihe) ii =
f_evt_type(ps_bufhe,NULL,0,0,0,0);
2515 printf(
"Buffers %6d, of size %d, Events %10d, first %d, last %d"
2522 else printf(
" not linear\n");
2524 if((ps_chan->
l_channel_no=open(pc_lmd,GET__OPEN_FLAG))== -1)
2559 if(l_prihe) ii =
f_evt_type(ps_bufhe,NULL,0,0,0,0);
2562 if(ps_bufhe->
i_type == 2000) *ps_head = (
CHARS *)ps_bufhe;
2601 for(kk=0;kk<=l_skip;kk++)
2613 if(pl_event != NULL) *pl_event=pl;
2645 INTS4 ii,kk,l_evt,l_off,l_typ,l_val,l_evsize,l_fragsize;
2646 INTS4 la_head[2],*pl;
2662 if(l_val == 0) l_val=1;
2663 for(kk=0;kk<l_val;kk++)
2674 while(ps_ve10_1->
l_count != l_val)
2679 *pl_event = (
INTS4 *)ps_ve10_1;
2699 printf(
"Event index %d not found\n",l_val);
2702 if(l_val == 0) l_val=1;
2703 ps_tag=(
s_tag *)&s_tag_l;
2717 if(ps_tag->
l_event == l_val)
break;
2722 printf(
"Event number %d not found\n",l_val);
2749 l_evsize=ps_bufhe->
l_free[1]+4;
2764 l_fragsize += ps_ve10_1->
l_dlen+4;
2765 pc += ps_ve10_1->
l_dlen*2;
2766 ps_ve10_1->
l_dlen=l_evsize-4;
2768 while(l_fragsize < l_evsize)
2776 l_fragsize += la_head[0];
2783 *pl_event = (
INTS4 *)ps_ve10_1;
INTS4 f_evt_rev_port(INTS4 l_port)
int f_evcli_evt(s_evt_channel *ps_chan)
#define PUTEVT__CLOSE_ERR
INTS4 f_evt_get_subevent(s_ve10_1 *ps_ve10_1, INTS4 l_subevent, INTS4 **pl_se, INTS4 **pl_d, INTS4 *pl_lwords)
INTS4 f_stc_close(struct s_tcpcomm *ps_tcp)
INTS4 f_evt_type(s_bufhe *ps_bufhe, s_evhe *ps_evhe, INTS4 l_subid, INTS4 l_long, INTS4 l_hex, INTS4 l_data)
INTS4 f_evt_tag_filter(s_ve10_1 *ps_ve10_1)
INTS4 f_stc_read(void *p_buffer, INTS4 i_buflen, INTS4 i_channel, INTS4 i_timeout)
INTS4 f_evt_get_close(s_evt_channel *ps_chan)
INTS4 f_evt_get_open(INTS4 l_mode, CHARS *pc_server, s_evt_channel *ps_chan, CHARS **ps_info, INTS4 l_sample, INTS4 l_param)
INTS4 f_evt_get_buffer(s_evt_channel *ps_chan, INTS4 *ps_buffer)
#define LMD__NO_OVERWRITE
INTS4 f_stc_write(void *p_buffer, INTS4 i_buflen, INTS4 i_channel)
INTS4 f_evt_timeout(s_evt_channel *ps_chan, INTS4 l_sec)
#define GETEVT__NOCHANNEL
INTS4 f_evt_put_event(s_evt_channel *ps_chan, INTS4 *pl_evt_buf)
s_evt_channel * f_evt_control()
#define GETEVT__NOLMDFILE
uint32_t fLmdGetMbsEvent(sLmdControl *pLmdControl, sMbsHeader **event)
int f_evcli_close(s_evt_channel *ps_chan)
INTS4 f_evt_source_port(INTS4 l_port)
INTS4 f_evt_error(INTS4 l_error, CHARS *pc_dest, INTS4 l_out)
uint32_t fLmdGetElement(sLmdControl *pLmdControl, uint32_t iEvent, sMbsHeader **event)
INTS4 f_stc_discclient(INTS4 i_channel)
CHARS * f_evt_get_buffer_ptr(s_evt_channel *ps_chan)
#define GETEVT__NOTAGFILE
uint32_t fLmdInitMbs(sLmdControl *pLmdControl, char *Nodename, uint32_t iMaxBytes, uint32_t iBuffers, uint32_t iStreams, uint32_t iPort, uint32_t iTimeout)
uint32_t fLmdPutClose(sLmdControl *pLmdControl)
static int l_gl_source_port
uint32_t fLmdGetClose(sLmdControl *pLmdControl)
INTS4 f_stc_connectserver(CHARS *c_node, INTS4 l_port, INTS4 *pi_channel, struct s_tcpcomm *ps_client)
int f_evcli_buf(s_evt_channel *ps_chan)
struct cv_string s_strings[30]
INTS4 f_evt_get_newbuf(s_evt_channel *)
INTS4 f_evt_check_buf(CHARS *, INTS4 *, INTS4 *, INTS4 *, INTS4 *)
INTS4 f_evt_get_tagnext(s_evt_channel *ps_chan, INTS4 l_skip, INTS4 **pl_event)
INTS4 f_evt_ini_bufhe(s_evt_channel *ps_chan)
#define PUTEVT__TOO_SMALLS
static CHARS c_temp[MAX_BUF_LGTH]
uint32_t fLmdGetOpen(sLmdControl *pLmdControl, char *Filename, sMbsFileHeader *pBuffHead, uint32_t iBytes, uint32_t iUseOffset)
INTS4 f_evt_cre_tagfile(CHARS *pc_lmd, CHARS *pc_tag, INTS4(*e_filter)())
#define PUTEVT__FILE_EXIST
INTS4 f_evt_put_buffer(s_evt_channel *ps_chan, s_bufhe *ps_bufhe)
uint32_t fLmdCloseMbs(sLmdControl *pLmdControl)
INTS4 f_evt_skip_buffer(s_evt_channel *ps_chan, INTS4 l_buffer)
#define PUTEVT__NOCHANNEL
static struct s_tcpcomm s_tcpcomm_st_evt
INTS4 f_evt_get_tagopen(s_evt_channel *ps_chan, CHARS *pc_tag, CHARS *pc_lmd, CHARS **ps_head, INTS4 l_prihe)
INTS4 f_ut_utime(INTS4, INTS4, CHARS *)
INTS4 f_evt_get_tagevent(s_evt_channel *ps_chan, INTS4 l_value, INTS4 l_type, INTS4 **pl_event)
sLmdControl * fLmdAllocateControl()
INTS4 f_evt_put_close(s_evt_channel *ps_chan)
INTS4 f_evt_swap(CHARS *pc_source, INTS4 l_length)
#define PORT__STREAM_SERV
uint32_t fLmdPutElement(sLmdControl *pLmdControl, sMbsHeader *pHeader)
#define LMD__TYPE_FILE_HEADER_101_1
uint32_t fLmdPutOpen(sLmdControl *pLmdControl, char *Filename, sMbsFileHeader *pBuffHead, uint32_t iBytes, uint32_t iOver, uint32_t iUseOffset, uint32_t iLargeFile)
INTS4 f_evt_put_open(CHARS *pc_file, INTS4 l_size, INTS4 l_stream, INTS4 l_type, INTS4 l_subtype, s_evt_channel *ps_chan, CHARS *ps_filhe)
INTS4 f_evt_get_tagclose(s_evt_channel *ps_chan)
INTS4 f_evt_get_event(s_evt_channel *ps_chan, INTS4 **ppl_buffer, INTS4 **ppl_goobuf)
uint32_t fLmdPutBuffer(sLmdControl *pLmdControl, sMbsHeader *pHeader, uint32_t Items)
int f_evcli_con(s_evt_channel *ps_chan, char *pc_node, int l_aport, int l_aevents, int l_asample)
INTS4 f_evt_swap_filhe(s_bufhe *)
#define GETEVT__CLOSE_ERR