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
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 ""
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>
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>
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 ""
141#define RFIO_open rfio_open
142#define RFIO_close rfio_close
143#define RFIO_read rfio_read
144#define RFIO_lseek rfio_lseek
147#define RFIO_open open
148#define RFIO_close close
149#define RFIO_read read
150#define RFIO_lseek lseek
154#define own_getpid _getpid
156#define own_getpid getpid
238 INTS4 l_total,l_sub,l_sum;
242 pl_next = (
INTS4 *) (ps_ve10_1 + 1);
243 l_total = ps_ve10_1->
l_dlen-4;
246 while(l_sum < l_total)
252 if(pl_lwords != NULL) *pl_lwords = ps_ves10_1->
l_dlen/2-1;
253 if(pl_se != NULL) *pl_se = (
INTS4 *) ps_ves10_1;
254 if(pl_d != NULL) *pl_d = (
INTS4 *) (ps_ves10_1+1);
257 l_sub = ps_ves10_1->
l_dlen+4;
259 pl_next = (
INTS4 *)(ps_ves10_1);
262 if(pl_lwords != NULL) *pl_lwords = ll;
263 if(pl_se != NULL) *pl_se = NULL;
264 if(pl_d != NULL) *pl_d = NULL;
265 if(l_subevent == 0)
return(ll);
312 if((l_hex+l_long) > 0) l_ldata=1;
317 sprintf(c_line,
"--------------------------------------------------------");
318 printf(
"%s\n",c_line);
321 if(ll%512 > 0)ll += 512-ll%512;
324 if(ps_bufhe->
i_type == 2000)
327 sprintf(c_line,
"File header info:");
328 printf(
"%s\n",c_line);
330 printf(
"%s\n",c_line);
332 printf(
"%s\n",c_line);
333 sprintf(c_line,
"File: %s",ps_filhe->
filhe_file);
334 printf(
"%s\n",c_line);
335 sprintf(c_line,
"User: %s",ps_filhe->
filhe_user);
336 printf(
"%s\n",c_line);
337 sprintf(c_line,
"Time: %s",ps_filhe->
filhe_time);
338 printf(
"%s\n",c_line);
339 sprintf(c_line,
"Run: %s",ps_filhe->
filhe_run);
340 printf(
"%s\n",c_line);
341 sprintf(c_line,
"Exp: %s",ps_filhe->
filhe_exp);
342 printf(
"%s\n",c_line);
346 printf(
"%s\n",c_line);
353 sprintf(c_line,
"Buffer %9d, Length %5d[w] Size %5d[b] used %5d[w] %s",
358 printf(
"%s\n",c_line);
359 sprintf(c_line,
" Events %3d Type/Subtype %5d %5d FragEnd=%d FragBegin=%d Total %5d[w]",
366 printf(
"%s\n",c_line);
368 sprintf(c_line,
"--------------------------------------------------------");
369 printf(
"%s\n",c_line);
372 if(ps_evhe == NULL)
return(0);
377 sprintf(c_line,
"Event type %d, subtype %d, data longwords %d",
379 printf(
"%s\n",c_line);
380 if((l_ldata != 0) & ((ps_evhe->
i_type == 4)|(ps_evhe->
i_type == 6)))
382 pl_data = (
INTS4 *)ps_evhe;
386 sprintf(c_line,
"%08x ",*pl_data);
387 strncat(c_full, c_line,
sizeof(c_full)-1);
390 printf(
"%s\n",c_full);
394 if(strlen(c_full) > 2) printf(
"%s\n",c_full);
402 sprintf(c_line,
"Event %9d Type/Subtype %5d %5d Length %5d[w] Trigger %2d",
408 printf(
"%s\n",c_line);
419 if((l_subid < 0)|(l_subid == ps_ves10_1->i_procid))
421 sprintf(c_line,
" SubEv ID %6d Type/Subtype %5d %5d Length %5d[w] Control %2d Subcrate %2d",
422 ps_ves10_1->i_procid,
424 ps_ves10_1->i_subtype,
426 ps_ves10_1->h_control,
427 ps_ves10_1->h_subcrate);
428 printf(
"%s\n",c_line);
431 if((l_long != 0) | (l_hex != 0))
435 if(l_hex != 0) sprintf(c_line,
"%04x.%04x ",(*pl_data>>16)&0xffff,*pl_data&0xffff);
436 else sprintf(c_line,
"%8d ",*pl_data);
437 strncat(c_full, c_line,
sizeof(c_full)-1);
441 printf(
"%s\n",c_full);
445 if(strlen(c_full) > 2)printf(
"%s\n",c_full);
452 sprintf(c_line,
"%8d%8d",*pl_data&0xffff,(*pl_data>>16)&0xffff);
453 strncat(c_full, c_line,
sizeof(c_full)-1);
457 printf(
"%s\n",c_full);
461 if(strlen(c_full) > 2)printf(
"%s\n",c_full);
489 if (l_port>0) printf(
"Use MBS source port %d\n",l_port);
512 if (l_port>0) printf(
"Use MBS source port %d\n",l_port);
556 INTS4 l_swap, l_swap_head, l_is_goosybuf, l_filehead=0, l_size, l_size_head, l_dummy, l_header_size = 0, l_port;
557 CHARS c_file[256], *pc_temp;
567 if((pc_temp=strchr(pc_server,
':')) != NULL) {
576 printf(
"rfio not supported!\n");
581 if(ps_info != NULL) *ps_info=NULL;
587 strcpy(c_file,pc_server);
588 if(strlen(c_file) < 5) strncat(c_file,
".lmd",
sizeof(c_file)-1);
590 pc_temp = (
CHARS *) &c_file[strlen(c_file)-4];
591 if((strcmp(pc_temp,
".LMD") != 0) &&
592 (strcmp(pc_temp,
".lmd") != 0)) strncat(c_file,
".lmd",
sizeof(c_file)-1);
595 if((ps_chan->
l_channel_no=open(c_file,GET__OPEN_FLAG))== -1)
601 printf(
"LMD format error: no LMD file: %s\n",c_file);
619 if(((l_is_goosybuf == 0) & (l_filehead == 0)) | (l_size_head == 0)) {
620 printf(
"LMD format error: swap=%d, header=%d, isLMD=%d, size=%d\n",l_swap_head,l_filehead,l_is_goosybuf,l_size_head);
627 if(l_filehead == 1) {
629 l_header_size=l_size_head;
635 printf(
"LMD format error: no LMD file: %s\n",c_file);
646 if((l_is_goosybuf == 0) | (l_size != l_size_head) | (l_swap != l_swap_head)) {
647 printf(
"LMD format error: swap=%d, isLMD=%d, size=%d\n",l_swap,l_is_goosybuf,l_size);
655 if(ps_info != NULL) *ps_info=NULL;
657 if(l_filehead == 1) {
659 printf(
"LMD format error: no LMD file: %s\n",c_file);
665 if(ps_info != NULL) {
721 printf(
"f_evt_get_open for STREAM: port=%d timeout=%d \n",l_port, ps_chan->
l_timeout);
754 printf(
"f_evt_get_open for TRANSPORT: port=%d timeout=%d \n",l_port, ps_chan->
l_timeout);
781 printf(
"LMD format error: no LMD file: %s\n",pc_server);
788 if(((l_is_goosybuf == 0) & (l_filehead == 0)) | (l_size_head == 0))
790 printf(
"LMD format error: swap=%d, header=%d, isLMD=%d, size=%d\n",l_swap_head,l_filehead,l_is_goosybuf,l_size_head);
801 printf(
"LMD format error: no LMD file: %s\n",pc_server);
813 if((l_is_goosybuf == 0) | (l_size != l_size_head) | (l_swap != l_swap_head))
815 printf(
"LMD format error: swap=%d, isLMD=%d, size=%d\n",l_swap,l_is_goosybuf,l_size);
823 if(ps_info != NULL)*ps_info=NULL;
829 printf(
"LMD format error: no LMD file: %s\n",pc_server);
860 if(ps_info != NULL) *ps_info=NULL;
868 printf(
"Memory allocation error\n");
874 printf(
"Memory allocation error\n");
911 INTS4 l_temp,l_prev_ok = 1, l_stat = 0, l_used;
917 if(ps_chan->
pLmd != NULL) {
939 if(ppl_goobuf)*ppl_goobuf = NULL;
940 *ppl_buffer = (
INTS4 *)pevt;
994 printf(
"Unsolicited file header found!\n");
1060 printf(
"Memory allocation error\n");
1077 if(ppl_goobuf)*ppl_goobuf=(
INTS4 *)(ps_bufhe_cur);
1103 INTS4 l_close_failure;
1106 if(ps_chan->
pLmd != NULL){
1110 free(ps_chan->
pLmd);
1121 if(close(ps_chan->
l_channel_no)==-1) l_close_failure=1;
1199 struct timespec s_timespec;
1201 CHARS c_file[256], *pc_temp;
1222 printf(
"Memory allocation error\n");
1226 strcpy(c_file,pc_file);
1227 if(strlen(c_file) < 5) strncat(c_file,
".lmd",
sizeof(c_file)-1);
1230 pc_temp = (
CHARS *) &c_file[strlen(c_file)-4];
1231 if((strcmp(pc_temp,
".LMD") != 0) &&
1232 (strcmp(pc_temp,
".lmd") != 0)) strncat(c_file,
".lmd",
sizeof(c_file)-1);
1234 if((ps_chan->
l_channel_no=open(c_file,PUT__OPEN_APD_FLAG) )!= -1) {
1239 DEF_FILE_ACCE) )== -1)
1247 if(ps_filhe != NULL) {
1248 memcpy(ps_file_head, ps_filhe,ps_chan->
l_buf_size );
1250 memset( ps_file_head, 0, ps_chan->
l_buf_size);
1257 clock_gettime(CLOCK_REALTIME, &s_timespec);
1266 strncpy(c_mode, ctime(&s_timet),
sizeof(c_mode));
1271 if(l_write_size==-1)
1307 INTS4 l_evt_buf_posi;
1308 INTS4 l_buf_remain_size;
1309 INTS4 l_write_size, l_temp, l_free;
1315 if(ps_chan->
pLmd != NULL){
1332 l_buf_remain_size -= l_temp;
1349 if(ps_bufhe->
l_evt>0)
1362 l_buf_remain_size -= l_temp;
1363 l_buf_remain_size +=
sizeof(
s_evhe);
1371 while(l_evt_buf_posi<ps_chan->l_evt_size)
1378 if(l_evt_buf_posi != 0)
1392 if(l_write_size>(ps_chan->
l_evt_size-l_evt_buf_posi))
1393 l_write_size=(ps_chan->
l_evt_size-l_evt_buf_posi);
1397 l_evt_buf_posi += l_write_size;
1409 if(l_evt_buf_posi!=l_write_size)
1418 if(l_evt_buf_posi<ps_chan->l_evt_size) ps_chan->
ps_bufhe->
h_begin = 1;
1454 if(ps_chan->
pLmd != NULL){
1462 if(l_write_size==-1)
1495 INTS4 l_write_size, l_temp, l_temp2;
1499 if(ps_chan->
pLmd != NULL){
1536 for(l_temp=0;l_temp<l_write_size;l_temp+=ps_chan->
l_buf_size){
1593 sprintf(c_line,
"-I-f_evt: no such input file");
1596 sprintf(c_line,
"-I-f_evt: no such tag file");
1599 sprintf(c_line,
"-I-f_evt: no such event tag");
1602 sprintf(c_line,
"-I-f_evt: time out");
1605 sprintf(c_line,
"-I-f_evt: no such server");
1608 sprintf(c_line,
"-I-f_evt: read server error");
1611 sprintf(c_line,
"-I-f_evt: read tag file error");
1614 sprintf(c_line,
"-I-f_evt: write tag file error");
1617 sprintf(c_line,
"-I-f_evt: data format error");
1620 sprintf(c_line,
"-I-f_evt: no more event");
1623 sprintf(c_line,
"-I-f_evt: close server error");
1626 sprintf(c_line,
"-I-f_evt: failure");
1629 sprintf(c_line,
"-I-f_evt: too many channels");
1632 sprintf(c_line,
"-I-f_evt: input file is no LMD file");
1635 sprintf(c_line,
"-I-f_evt: success");
1638 sprintf(c_line,
"-I-f_evt: output file already exist");
1641 sprintf(c_line,
"-I-f_evt: write file error");
1644 sprintf(c_line,
"-I-f_evt: output file too large");
1647 sprintf(c_line,
"-I-f_evt: event can not fit in a stream");
1650 sprintf(c_line,
"-I-f_evt: close output error");
1653 sprintf(c_line,
"-I-f_evt: output failure");
1656 sprintf(c_line,
"-I-f_evt: too many channels");
1659 sprintf(c_line,
"-I-f_evt: unknown message id %d",l_error);
1660 if(l_out == 0)printf(
"%s\n",c_line);
1661 if(l_out==1)strcpy(pc_dest,c_line);
1665 if(l_out == 0)printf(
"%s\n",c_line);
1666 if(l_out == 1)strcpy(pc_dest,c_line);
1710 else if(l_temp == -1)
1723 else if(l_temp == -1)
1754 if( ((
s_bufhe *)(ps_buffer))->l_free[0] != 1)
1859 if(l_length%4 == 2){
1860 ch_temp=*(pc_source+l_length-2);
1861 *(pc_source+l_length-2)=*(pc_source+l_length-1);
1862 *(pc_source+l_length-1)=ch_temp;
1864 l_length=(l_length/4)*4;
1865 for(p_d=pc_source,p_s=(
CHARS *)&l_save; p_d<pc_source+l_length;)
1867 l_save = *((
INTS4 *)p_d);
1869 *(p_d++) = *(--p_s);
1870 *(p_d++) = *(--p_s);
1871 *(p_d++) = *(--p_s);
1872 *(p_d++) = *(--p_s);
1897 if(ps_bufhe->
i_type == 2000)
1984 printf(
"**** I-f_evt: Stream server request for disconnect!\n");
1997 printf(
"**** I-f_evt: Transport server request for disconnect!\n");
2050 if( (((
s_filhe *)(pc_head))->filhe_subtype==1)&&
2051 (((
s_filhe *)(pc_head))->filhe_type==2000) )
2056 l_size=((
s_bufhe *)(pc_head))->l_dlen*2;
2057 if(l_size%512 > 0) l_size +=
sizeof(
s_bufhe);
2058 if((l_size>>24) > 0) *pl_size=0;
2059 else *pl_size=l_size;
2063 if( (((
s_filhe *)(pc_head))->filhe_subtype==1)&&
2064 (((
s_filhe *)(pc_head))->filhe_type==2000) )
2069 l_size=((
s_bufhe *)(pc_head))->l_dlen*2;
2070 if(l_size%512 > 0) l_size +=
sizeof(
s_bufhe);
2071 if((l_size>>24) > 0) *pl_size=0;
2072 else *pl_size=l_size;
2077 l_size=((
s_bufhe *)(pc_head))->l_dlen*2;
2078 if(l_size%512 > 0) l_size +=
sizeof(
s_bufhe);
2079 if( (((l_size>>24) == 0) && (l_size > 0)) &&
2080 (((
s_bufhe *)(pc_head))->h_begin < 2) &&
2081 (((
s_bufhe *)(pc_head))->h_begin >= 0) &&
2082 (((
s_bufhe *)(pc_head))->h_end < 2) &&
2083 (((
s_bufhe *)(pc_head))->h_end >= 0) &&
2085 ((((
s_bufhe *)(pc_head))->i_used>0)||(((
s_bufhe *)(pc_head))->l_free[2] > 0))&&
2087 ( (((
s_bufhe *)(pc_head))->l_free[0] == 1)||
2088 (((
s_bufhe *)(pc_head))->l_free[0] == 0)||
2090 (((
s_bufhe *)(pc_head))->l_free[0]==256*256*256) ) )
2099 if( (((l_size>>24)== 0)&&(l_size > 0))&&
2100 (((
s_bufhe *)(pc_head))->l_dlen > 0)&&
2101 (((
s_bufhe *)(pc_head))->h_begin < 2)&&
2102 (((
s_bufhe *)(pc_head))->h_begin >= 0)&&
2103 (((
s_bufhe *)(pc_head))->h_end < 2)&&
2104 (((
s_bufhe *)(pc_head))->h_end >= 0)&&
2106 ((((
s_bufhe *)(pc_head))->i_used>0)||(((
s_bufhe *)(pc_head))->l_free[2] > 0))&&
2108 ( (((
s_bufhe *)(pc_head))->l_free[0] == 1)||
2109 (((
s_bufhe *)(pc_head))->l_free[0] == 0)||
2111 (((
s_bufhe *)(pc_head))->l_free[0]==256*256*256) ) )
2135 struct timespec s_timespec;
2151 clock_gettime(CLOCK_REALTIME, &s_timespec);
2208 INTS4 ii,l_take_it,l_temp,l_chan,l_out,l_file_pos=0,l_bufnr=0,l_events=0;
2209 INTS4 l_firste = 0, *pl, l_len, l_last=-1, l_lin=0, l_fragsize;
2210 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;
2212 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);
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;
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;
2413 lseek(l_out, 0, SEEK_SET);
2431 printf(
"Buffers %6d, of size %d, Events %10d, first %d, last %d "
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 == NULL) || (*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;
2596 INTS4 ii = 0,*pl = NULL,kk;
2601 for(kk=0;kk<=l_skip;kk++)
2613 if(pl_event != NULL) *pl_event=pl;
2645 INTS4 ii,kk, l_off,l_typ,l_val,l_evsize,l_fragsize;
2646 INTS4 la_head[2], *pl = NULL;
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;
uint32_t fLmdGetOpen(sLmdControl *pLmdControl, char *Filename, sMbsFileHeader *pBuffHead, uint32_t iBytes, uint32_t iUseOffset)
uint32_t fLmdPutBuffer(sLmdControl *pLmdControl, sMbsHeader *pHeader, uint32_t Items)
uint32_t fLmdGetClose(sLmdControl *pLmdControl)
sLmdControl * fLmdAllocateControl(void)
uint32_t fLmdGetMbsEvent(sLmdControl *pLmdControl, sMbsHeader **event)
uint32_t fLmdCloseMbs(sLmdControl *pLmdControl)
uint32_t fLmdGetElement(sLmdControl *pLmdControl, uint32_t iEvent, sMbsHeader **event)
uint32_t fLmdPutElement(sLmdControl *pLmdControl, sMbsHeader *pHeader)
uint32_t fLmdPutClose(sLmdControl *pLmdControl)
uint32_t fLmdPutOpen(sLmdControl *pLmdControl, char *Filename, sMbsFileHeader *pBuffHead, uint32_t iBytes, uint32_t iOver, uint32_t iUseOffset, uint32_t iLargeFile)
uint32_t fLmdInitMbs(sLmdControl *pLmdControl, char *Nodename, uint32_t iMaxBytes, uint32_t iBuffers, uint32_t iStreams, uint32_t iPort, uint32_t iTimeout)
int f_evcli_con(s_evt_channel *ps_chan, char *pc_node, int l_aport, int l_aevents, int l_asample)
int f_evcli_close(s_evt_channel *ps_chan)
int f_evcli_evt(s_evt_channel *ps_chan)
int f_evcli_buf(s_evt_channel *ps_chan)
INTS4 f_evt_ini_bufhe(s_evt_channel *ps_chan)
INTS4 f_evt_type(s_bufhe *ps_bufhe, s_evhe *ps_evhe, INTS4 l_subid, INTS4 l_long, INTS4 l_hex, INTS4 l_data)
s_evt_channel * f_evt_control(void)
INTS4 f_evt_swap_filhe(s_bufhe *)
INTS4 f_evt_rev_port(INTS4 l_port)
INTS4 f_evt_get_tagopen(s_evt_channel *ps_chan, CHARS *pc_tag, CHARS *pc_lmd, CHARS **ps_head, INTS4 l_prihe)
INTS4 f_evt_get_tagevent(s_evt_channel *ps_chan, INTS4 l_value, INTS4 l_type, INTS4 **pl_event)
INTS4 f_evt_cre_tagfile(CHARS *pc_lmd, CHARS *pc_tag, INTS4(*e_filter)(s_ve10_1 *))
INTS4 f_evt_put_event(s_evt_channel *ps_chan, INTS4 *pl_evt_buf)
INTS4 f_evt_get_buffer(s_evt_channel *ps_chan, INTS4 *ps_buffer)
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_subevent(s_ve10_1 *ps_ve10_1, INTS4 l_subevent, INTS4 **pl_se, INTS4 **pl_d, INTS4 *pl_lwords)
INTS4 f_evt_check_buf(CHARS *, INTS4 *, INTS4 *, INTS4 *, INTS4 *)
INTS4 f_evt_swap(CHARS *pc_source, INTS4 l_length)
INTS4 f_evt_tag_filter(s_ve10_1 *ps_ve10_1)
INTS4 f_evt_put_close(s_evt_channel *ps_chan)
INTS4 f_evt_get_newbuf(s_evt_channel *)
INTS4 f_evt_error(INTS4 l_error, CHARS *pc_dest, INTS4 l_out)
CHARS * f_evt_get_buffer_ptr(s_evt_channel *ps_chan)
static struct s_tcpcomm s_tcpcomm_st_evt
static int l_gl_source_port
INTS4 f_evt_put_buffer(s_evt_channel *ps_chan, s_bufhe *ps_bufhe)
INTS4 f_evt_get_close(s_evt_channel *ps_chan)
INTS4 f_evt_skip_buffer(s_evt_channel *ps_chan, INTS4 l_buffer)
INTS4 f_evt_timeout(s_evt_channel *ps_chan, INTS4 l_sec)
INTS4 f_evt_get_tagclose(s_evt_channel *ps_chan)
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)
static CHARS c_temp[MAX_BUF_LGTH]
INTS4 f_evt_get_event(s_evt_channel *ps_chan, INTS4 **ppl_buffer, INTS4 **ppl_goobuf)
INTS4 f_evt_get_tagnext(s_evt_channel *ps_chan, INTS4 l_skip, INTS4 **pl_event)
INTS4 f_evt_source_port(INTS4 l_port)
INTS4 f_ut_utime(INTS4, INTS4, CHARS *)
#define PUTEVT__CLOSE_ERR
#define PUTEVT__NOCHANNEL
#define PUTEVT__FILE_EXIST
#define GETEVT__NOCHANNEL
#define PUTEVT__TOO_SMALLS
#define GETEVT__NOTAGFILE
#define GETEVT__CLOSE_ERR
#define GETEVT__NOLMDFILE
INTS4 f_stc_write(void *p_buffer, INTS4 i_buflen, INTS4 i_channel)
INTS4 f_stc_read(void *p_buffer, INTS4 i_buflen, INTS4 i_channel, INTS4 i_timeout)
INTS4 f_stc_connectserver(CHARS *c_node, INTS4 l_port, INTS4 *pi_channel, struct s_tcpcomm *ps_client)
INTS4 f_stc_discclient(INTS4 i_channel)
INTS4 f_stc_close(struct s_tcpcomm *ps_tcp)
#define PORT__STREAM_SERV
#define LMD__TYPE_FILE_HEADER_101_1
#define LMD__NO_OVERWRITE
struct cv_string s_strings[30]