45 #include <sys/timeb.h>
46 #include <sys/types.h>
53 #define DEF_FILE_ACCE S_IREAD|S_IWRITE
54 #define GET__OPEN_FLAG O_RDONLY|O_BINARY
55 #define PUT__OPEN_APD_FLAG O_RDWR|O_APPEND
56 #define PUT__CRT_FLAG O_CREAT|O_RDWR
57 #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
76 #include <sys/timeb.h>
77 #include <sys/types.h>
79 #define DEF_FILE_ACCE S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH
80 #define GET__OPEN_FLAG O_RDONLY
81 #define PUT__OPEN_APD_FLAG O_RDWR|O_APPEND
82 #define PUT__CRT_FLAG O_CREAT|O_RDWR
83 #define PUT__CRT_OPT ""
95 #include <sys/timeb.h>
96 #include <sys/types.h>
98 #define DEF_FILE_ACCE S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH
99 #define GET__OPEN_FLAG O_RDONLY
100 #define PUT__OPEN_APD_FLAG O_RDWR|O_APPEND
101 #define PUT__CRT_FLAG O_CREAT|O_RDWR
102 #define PUT__CRT_OPT ""
113 #include <sys/time.h>
114 #include <sys/timeb.h>
115 #include <sys/types.h>
116 #include <sys/stat.h>
117 #define DEF_FILE_ACCE S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH
118 #define GET__OPEN_FLAG O_RDONLY
119 #define PUT__OPEN_APD_FLAG O_RDWR|O_APPEND
120 #define PUT__CRT_FLAG O_CREAT|O_RDWR
121 #define PUT__CRT_OPT ""
134 #include <sys/time.h>
135 #include <sys/timeb.h>
136 #include <sys/types.h>
137 #include <sys/mode.h>
138 #define DEF_FILE_ACCE S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH
139 #define GET__OPEN_FLAG O_RDONLY
140 #define PUT__OPEN_APD_FLAG O_RDWR|O_APPEND
141 #define PUT__CRT_FLAG O_CREAT|O_RDWR
142 #define PUT__CRT_OPT ""
153 #define RFIO_open rfio_open
154 #define RFIO_close rfio_close
155 #define RFIO_read rfio_read
156 #define RFIO_lseek rfio_lseek
159 #define RFIO_open open
160 #define RFIO_close close
161 #define RFIO_read read
162 #define RFIO_lseek lseek
246 INTS4 l_total,l_sub,l_sum;
250 pl_next = (
INTS4 *) (ps_ve10_1 + 1);
251 l_total = ps_ve10_1->
l_dlen-4;
254 while(l_sum < l_total)
260 if(pl_lwords != NULL) *pl_lwords = ps_ves10_1->
l_dlen/2-1;
261 if(pl_se != NULL) *pl_se = (
INTS4 *) ps_ves10_1;
262 if(pl_d != NULL) *pl_d = (
INTS4 *) (ps_ves10_1+1);
265 l_sub = ps_ves10_1->
l_dlen+4;
267 pl_next = (
INTS4 *)(ps_ves10_1);
270 if(pl_lwords != NULL) *pl_lwords = ll;
271 if(pl_se != NULL) *pl_se = NULL;
272 if(pl_d != NULL) *pl_d = NULL;
273 if(l_subevent == 0)
return(ll);
321 if((l_hex+l_long) > 0) l_ldata=1;
326 sprintf(c_line,
"--------------------------------------------------------");
327 printf(
"%s\n",c_line);
330 if(ll%512 > 0)ll += 512-ll%512;
333 if(ps_bufhe->
i_type == 2000)
336 sprintf(c_line,
"File header info:");
337 printf(
"%s\n",c_line);
339 printf(
"%s\n",c_line);
341 printf(
"%s\n",c_line);
342 sprintf(c_line,
"File: %s",ps_filhe->
filhe_file);
343 printf(
"%s\n",c_line);
344 sprintf(c_line,
"User: %s",ps_filhe->
filhe_user);
345 printf(
"%s\n",c_line);
346 sprintf(c_line,
"Time: %s",ps_filhe->
filhe_time);
347 printf(
"%s\n",c_line);
348 sprintf(c_line,
"Run: %s",ps_filhe->
filhe_run);
349 printf(
"%s\n",c_line);
350 sprintf(c_line,
"Exp: %s",ps_filhe->
filhe_exp);
351 printf(
"%s\n",c_line);
355 printf(
"%s\n",c_line);
362 sprintf(c_line,
"Buffer %9d, Length %5d[w] Size %5d[b] used %5d[w] %s",
367 printf(
"%s\n",c_line);
368 sprintf(c_line,
" Events %3d Type/Subtype %5d %5d FragEnd=%d FragBegin=%d Total %5d[w]",
375 printf(
"%s\n",c_line);
377 sprintf(c_line,
"--------------------------------------------------------");
378 printf(
"%s\n",c_line);
381 if(ps_evhe == NULL)
return(0);
386 sprintf(c_line,
"Event type %d, subtype %d, data longwords %d",
388 printf(
"%s\n",c_line);
389 if((l_ldata != 0) & ((ps_evhe->
i_type == 4)|(ps_evhe->
i_type == 6)))
391 pl_data = (
INTS4 *)ps_evhe;
393 for(l=0;l<ps_evhe->
l_dlen/2;l++)
395 sprintf(c_line,
"%08x ",*pl_data);
396 strcat(c_full,c_line);
399 printf(
"%s\n",c_full);
403 if(strlen(c_full) > 2) printf(
"%s\n",c_full);
411 sprintf(c_line,
"Event %9d Type/Subtype %5d %5d Length %5d[w] Trigger %2d",
417 printf(
"%s\n",c_line);
428 if((l_subid < 0)|(l_subid == ps_ves10_1->
i_procid))
430 sprintf(c_line,
" SubEv ID %6d Type/Subtype %5d %5d Length %5d[w] Control %2d Subcrate %2d",
437 printf(
"%s\n",c_line);
440 if((l_long != 0) | (l_hex != 0))
444 if(l_hex != 0) sprintf(c_line,
"%04x.%04x ",(*pl_data>>16)&0xffff,*pl_data&0xffff);
445 else sprintf(c_line,
"%8d ",*pl_data);
446 strcat(c_full,c_line);
450 printf(
"%s\n",c_full);
454 if(strlen(c_full) > 2)printf(
"%s\n",c_full);
461 sprintf(c_line,
"%8d%8d",*pl_data&0xffff,(*pl_data>>16)&0xffff);
462 strcat(c_full,c_line);
466 printf(
"%s\n",c_full);
470 if(strlen(c_full) > 2)printf(
"%s\n",c_full);
498 if (l_port>0) printf(
"Use MBS source port %d\n",l_port);
521 if (l_port>0) printf(
"Use MBS source port %d\n",l_port);
565 INTS4 l_swap, l_swap_head, l_is_goosybuf, l_filehead=0, l_size, l_size_head, l_dummy, l_header_size, l_port;
567 CHARS c_file[256], *pc_temp;
581 if((pc_temp=strchr(pc_server,
':')) != NULL) {
590 printf(
"rfio not supported!\n");
595 if(ps_info != NULL) *ps_info=NULL;
601 strcpy(c_file,pc_server);
602 if(strlen(c_file) < 5) strcat(c_file,
".lmd");
604 pc_temp = (
CHARS *) &c_file[strlen(c_file)-4];
605 if((strcmp(pc_temp,
".LMD") != 0) &&
606 (strcmp(pc_temp,
".lmd") != 0)) strcat(c_file,
".lmd");
609 if((ps_chan->
l_channel_no=open(c_file,GET__OPEN_FLAG))== -1)
615 printf(
"LMD format error: no LMD file: %s\n",c_file);
633 if(((l_is_goosybuf==0)&(l_filehead==0))|(l_size_head==0)) {
634 printf(
"LMD format error: swap=%d, header=%d, isLMD=%d, size=%d\n",l_swap_head,l_filehead,l_is_goosybuf,l_size_head);
641 if(l_filehead == 1) {
643 l_header_size=l_size_head;
649 printf(
"LMD format error: no LMD file: %s\n",c_file);
660 if((l_is_goosybuf==0)|(l_size!=l_size_head)|(l_swap!=l_swap_head)) {
661 printf(
"LMD format error: swap=%d, isLMD=%d, size=%d\n",l_swap,l_is_goosybuf,l_size);
669 if(ps_info != NULL) *ps_info=NULL;
671 if(l_filehead == 1) {
673 printf(
"LMD format error: no LMD file: %s\n",c_file);
679 if(ps_info != NULL) {
735 printf(
"f_evt_get_open for STREAM: port=%d timeout=%d \n",l_port, ps_chan->
l_timeout);
768 printf(
"f_evt_get_open for TRANSPORT: port=%d timeout=%d \n",l_port, ps_chan->
l_timeout);
795 printf(
"LMD format error: no LMD file: %s\n",pc_server);
802 if(((l_is_goosybuf==0)&(l_filehead==0))|(l_size_head==0))
804 printf(
"LMD format error: swap=%d, header=%d, isLMD=%d, size=%d\n",l_swap_head,l_filehead,l_is_goosybuf,l_size_head);
815 printf(
"LMD format error: no LMD file: %s\n",pc_server);
827 if((l_is_goosybuf==0)|(l_size!=l_size_head)|(l_swap!=l_swap_head))
829 printf(
"LMD format error: swap=%d, isLMD=%d, size=%d\n",l_swap,l_is_goosybuf,l_size);
837 if(ps_info != NULL)*ps_info=NULL;
843 printf(
"LMD format error: no LMD file: %s\n",pc_server);
874 if(ps_info != NULL) *ps_info=NULL;
882 printf(
"Memory allocation error\n");
888 printf(
"Memory allocation error\n");
925 INTS4 l_temp,l_prev_ok=1, l_stat, l_used;
931 if(ps_chan->
pLmd != NULL){
952 if(ppl_goobuf)*ppl_goobuf = NULL;
953 *ppl_buffer = (
INTS4 *)pevt;
1006 printf(
"Unsolicited file header found!\n");
1072 printf(
"Memory allocation error\n");
1089 if(ppl_goobuf)*ppl_goobuf=(
INTS4 *)(ps_bufhe_cur);
1115 INTS4 l_close_failure;
1119 if(ps_chan->
pLmd != NULL){
1123 free(ps_chan->
pLmd);
1134 if(close(ps_chan->
l_channel_no)==-1) l_close_failure=1;
1212 struct timeb s_timeb;
1215 CHARS c_file[256], *pc_temp;
1219 CHARS c_varstr[128];
1241 printf(
"Memory allocation error\n");
1245 strcpy(c_file,pc_file);
1246 if(strlen(c_file) < 5) strcat(c_file,
".lmd");
1249 pc_temp = (
CHARS *) &c_file[strlen(c_file)-4];
1250 if((strcmp(pc_temp,
".LMD") != 0) &&
1251 (strcmp(pc_temp,
".lmd") != 0)) strcat(c_file,
".lmd");
1253 if((ps_chan->
l_channel_no=open(c_file,PUT__OPEN_APD_FLAG) )!= -1)
1258 DEF_FILE_ACCE) )== -1)
1266 if(ps_filhe != NULL)
1268 memcpy(ps_file_head, ps_filhe,ps_chan->
l_buf_size );
1272 memset( ps_file_head,
'\0', ps_chan->
l_buf_size);
1273 sprintf(ps_file_head->
filhe_run,
"Pid %d\0", getpid());
1285 strcpy(ps_file_head->
filhe_user, getenv(
"USER"));
1288 strcpy(c_mode, ctime(&s_timet));
1289 strcpy(ps_file_head->
filhe_time, &c_mode[4]);
1293 if(l_write_size==-1)
1329 INTS4 l_evt_buf_posi;
1330 INTS4 l_buf_remain_size;
1331 INTS4 l_write_size, l_temp, l_free;
1337 if(ps_chan->
pLmd != NULL){
1354 l_buf_remain_size -= l_temp;
1371 if(ps_bufhe->
l_evt>0)
1384 l_buf_remain_size -= l_temp;
1385 l_buf_remain_size +=
sizeof(
s_evhe);
1393 while(l_evt_buf_posi<ps_chan->l_evt_size)
1400 if(l_evt_buf_posi != 0)
1414 if(l_write_size>(ps_chan->
l_evt_size-l_evt_buf_posi))
1415 l_write_size=(ps_chan->
l_evt_size-l_evt_buf_posi);
1419 l_evt_buf_posi += l_write_size;
1431 if(l_evt_buf_posi!=l_write_size)
1440 if(l_evt_buf_posi<ps_chan->l_evt_size) ps_chan->
ps_bufhe->
h_begin = 1;
1472 INTS4 l_write_size, l_temp, l_free;
1477 if(ps_chan->
pLmd != NULL){
1485 if(l_write_size==-1)
1518 INTS4 l_write_size, l_temp, l_temp2;
1523 if(ps_chan->
pLmd != NULL){
1560 for(l_temp=0;l_temp<l_write_size;l_temp+=ps_chan->
l_buf_size){
1617 sprintf(c_line,
"-I-f_evt: no such input file");
1620 sprintf(c_line,
"-I-f_evt: no such tag file");
1623 sprintf(c_line,
"-I-f_evt: no such event tag");
1626 sprintf(c_line,
"-I-f_evt: time out");
1629 sprintf(c_line,
"-I-f_evt: no such server");
1632 sprintf(c_line,
"-I-f_evt: read server error");
1635 sprintf(c_line,
"-I-f_evt: read tag file error");
1638 sprintf(c_line,
"-I-f_evt: write tag file error");
1641 sprintf(c_line,
"-I-f_evt: data format error");
1644 sprintf(c_line,
"-I-f_evt: no more event");
1647 sprintf(c_line,
"-I-f_evt: close server error");
1650 sprintf(c_line,
"-I-f_evt: failure");
1653 sprintf(c_line,
"-I-f_evt: too many channels");
1656 sprintf(c_line,
"-I-f_evt: input file is no LMD file");
1659 sprintf(c_line,
"-I-f_evt: success");
1662 sprintf(c_line,
"-I-f_evt: output file already exist");
1665 sprintf(c_line,
"-I-f_evt: write file error");
1668 sprintf(c_line,
"-I-f_evt: output file too large");
1671 sprintf(c_line,
"-I-f_evt: event can not fit in a stream");
1674 sprintf(c_line,
"-I-f_evt: close output error");
1677 sprintf(c_line,
"-I-f_evt: output failure");
1680 sprintf(c_line,
"-I-f_evt: too many channels");
1683 sprintf(c_line,
"-I-f_evt: unknown message id %d",l_error);
1684 if(l_out==0)printf(
"%s\n",c_line);
1685 if(l_out==1)strcpy(pc_dest,c_line);
1689 if(l_out==0)printf(
"%s\n",c_line);
1690 if(l_out==1)strcpy(pc_dest,c_line);
1734 else if(l_temp == -1)
1747 else if(l_temp == -1)
1778 if( ((
s_bufhe *)(ps_buffer))->l_free[0] !=1)
1884 if(l_length%4 == 2){
1885 ch_temp=*(pc_source+l_length-2);
1886 *(pc_source+l_length-2)=*(pc_source+l_length-1);
1887 *(pc_source+l_length-1)=ch_temp;
1889 l_length=(l_length/4)*4;
1890 for(p_d=pc_source,p_s=(
CHARS *)&l_save; p_d<pc_source+l_length;)
1892 l_save = *((
INTS4 *)p_d);
1894 *(p_d++) = *(--p_s);
1895 *(p_d++) = *(--p_s);
1896 *(p_d++) = *(--p_s);
1897 *(p_d++) = *(--p_s);
1923 if(ps_bufhe->
i_type == 2000)
1933 for(ii=0;ii<ps_filhe->filhe_lines;ii++)
2011 printf(
"**** I-f_evt: Stream server request for disconnect!\n");
2024 printf(
"**** I-f_evt: Transport server request for disconnect!\n");
2077 if( (((
s_filhe *)(pc_head))->filhe_subtype==1)&&
2078 (((
s_filhe *)(pc_head))->filhe_type==2000) )
2083 l_size=((
s_bufhe *)(pc_head))->l_dlen*2;
2084 if(l_size%512 > 0) l_size +=
sizeof(
s_bufhe);
2085 if((l_size>>24) > 0) *pl_size=0;
2086 else *pl_size=l_size;
2090 if( (((
s_filhe *)(pc_head))->filhe_subtype==1)&&
2091 (((
s_filhe *)(pc_head))->filhe_type==2000) )
2096 l_size=((
s_bufhe *)(pc_head))->l_dlen*2;
2097 if(l_size%512 > 0) l_size +=
sizeof(
s_bufhe);
2098 if((l_size>>24) > 0) *pl_size=0;
2099 else *pl_size=l_size;
2104 l_size=((
s_bufhe *)(pc_head))->l_dlen*2;
2105 if(l_size%512 > 0) l_size +=
sizeof(
s_bufhe);
2106 if( (((l_size>>24)== 0)&&(l_size > 0))&&
2107 (((
s_bufhe *)(pc_head))->h_begin<2)&&
2108 (((
s_bufhe *)(pc_head))->h_begin>=0)&&
2109 (((
s_bufhe *)(pc_head))->h_end<2)&&
2110 (((
s_bufhe *)(pc_head))->h_end>=0)&&
2112 ((((
s_bufhe *)(pc_head))->i_used>0)||(((
s_bufhe *)(pc_head))->l_free[2]>0))&&
2114 ( (((
s_bufhe *)(pc_head))->l_free[0]==1)||
2115 (((
s_bufhe *)(pc_head))->l_free[0]==0)||
2117 (((
s_bufhe *)(pc_head))->l_free[0]==256*256*256) ) )
2126 if( (((l_size>>24)== 0)&&(l_size > 0))&&
2127 (((
s_bufhe *)(pc_head))->l_dlen>0)&&
2128 (((
s_bufhe *)(pc_head))->h_begin<2)&&
2129 (((
s_bufhe *)(pc_head))->h_begin>=0)&&
2130 (((
s_bufhe *)(pc_head))->h_end<2)&&
2131 (((
s_bufhe *)(pc_head))->h_end>=0)&&
2133 ((((
s_bufhe *)(pc_head))->i_used>0)||(((
s_bufhe *)(pc_head))->l_free[2]>0))&&
2135 ( (((
s_bufhe *)(pc_head))->l_free[0]==1)||
2136 (((
s_bufhe *)(pc_head))->l_free[0]==0)||
2138 (((
s_bufhe *)(pc_head))->l_free[0]==256*256*256) ) )
2162 struct timeb s_timeb;
2235 INTS4 ii,l_take_it,l_temp,l_chan,l_out,l_file_pos=0,l_bufnr=0,l_events=0;
2236 INTS4 l_firste,*pl,l_len,l_last=-1,l_lin=0,l_fragsize, la_head[2];
2237 INTS4 l_swap, l_swap_head, l_is_goosybuf, l_filehead=0, l_size, l_size_head, l_dummy, l_evsize,l_evt_buf_size=0;
2240 CHARS c_lmd[128], c_tag[128], *pc_temp,*pc_evt_buf=NULL;
2247 printf(
"LMD file %s, TAG file %s\n",pc_lmd,pc_tag);
2249 if((l_chan=open(pc_lmd,GET__OPEN_FLAG))== -1)
return(
GETEVT__NOFILE);
2258 if(((l_is_goosybuf==0)&(l_filehead==0))|(l_size_head==0))
2260 printf(
"LMD format error: swap=%d, header=%d, isLMD=%d, size=%d\n",l_swap_head,l_filehead,l_is_goosybuf,l_size_head);
2267 lseek(l_chan, 0, SEEK_SET);
2268 if(read(l_chan,
c_temp,l_size_head)!=l_size_head)
2279 if((l_is_goosybuf==0)|(l_size!=l_size_head)|(l_swap!=l_swap_head))
2281 printf(
"LMD format error: swap=%d, isLMD=%d, size=%d\n",l_swap,l_is_goosybuf,l_size);
2287 lseek(l_chan, 0, SEEK_SET);
2289 printf(
"Buffer swap %d, File header %d, LMD buffer %d, size %d[b]\n",l_swap,l_filehead,l_is_goosybuf,l_size);
2294 if(read(l_chan,
c_temp,l_size)!=l_size)
2299 l_file_pos += l_size;
2304 if((l_out=open(pc_tag,PUT__CRT_FLAG,DEF_FILE_ACCE))== -1)
return(
GETEVT__NOFILE);
2305 write(l_out,(
CHARS *)&s_taghe,
sizeof(s_taghe));
2308 if(e_filter != NULL) ii=(*e_filter)(NULL);
2310 while(read(l_chan,
c_temp,l_size)==l_size)
2312 l_file_pos=l_bufnr*l_size;
2321 ps_ve10_1=(
s_ve10_1 *)(ps_bufhe + 1);
2322 pl = (
INTS4 *)ps_ve10_1;
2323 l_file_pos +=
sizeof(
s_bufhe);
2328 l_file_pos += (l_len<<2);
2330 pl = (
INTS4 *)ps_ve10_1;
2334 for(ii=1;ii<ps_bufhe->
l_evt;ii++)
2337 if(e_filter != NULL)l_take_it=(*e_filter)(ps_ve10_1);
2345 if(ps_ve10_1->
l_count != (l_last+1))
2348 if(l_lin == 1)l_firste=ps_ve10_1->
l_count;
2352 if(write(l_out,(
CHARS *)&s_tag,
sizeof(s_tag)) !=
sizeof(s_tag))
2359 l_file_pos += (l_len<<2);
2361 pl = (
INTS4 *)ps_ve10_1;
2364 if(ps_bufhe->
l_evt > 0)
2366 if(ps_ve10_1->
l_dlen < 4) printf(
"Buffer %d Event fragment %10d dlen %d ts %d %d trigger %d\n"
2373 if(e_filter != NULL)
2376 l_evsize=ps_bufhe->
l_free[1]+4;
2377 if(l_evt_buf_size < l_evsize*2)
2379 if(pc_evt_buf != NULL)free(pc_evt_buf);
2380 l_evt_buf_size=l_evsize*2;
2381 pc_evt_buf=(
CHARS *)malloc(l_evt_buf_size);
2384 ps=(
INTU4 *)ps_ve10_1;
2385 pd=(
INTU4 *)pc_evt_buf;
2386 l_fragsize = ps_ve10_1->
l_dlen+4;
2387 for(ii=0;ii<l_fragsize/2;ii++) *pd++ = *ps++;
2389 while(l_fragsize < l_evsize)
2391 if(read(l_chan,
c_temp,l_size) != l_size)
break;
2394 ps = (
INTU4 *) (ps_bufhe+1);
2397 for(ii=0;ii<l_temp/2;ii++) *pd++ = *ps++;
2398 l_fragsize += l_temp;
2400 if(l_fragsize < l_evsize)
break;
2401 ps_ve10_1 = (
s_ve10_1 *)pc_evt_buf;
2402 ps_ve10_1->
l_dlen=l_evsize-4;
2405 lseek(l_chan, -l_size, SEEK_CUR);
2415 if(e_filter != NULL)l_take_it=(*e_filter)(ps_ve10_1);
2420 if(ps_ve10_1->
l_count != (l_last+1))
2423 if(l_lin == 1)l_firste=ps_ve10_1->
l_count;
2427 if(write(l_out,(
CHARS *)&s_tag,
sizeof(s_tag)) !=
sizeof(s_tag))
2438 lseek(l_out, 0, SEEK_SET);
2448 if(write(l_out,(
CHARS *)&s_taghe,
sizeof(s_taghe)) !=
sizeof(s_taghe))
2456 printf(
"Buffers %6d, of size %d, Events %10d, first %d, last %d "
2462 if(s_taghe.
l_linear)printf(
"linear\n");
2463 else printf(
"not linear\n");
2502 if(l_prihe)printf(
"LMD file %s, TAG file %s\n",pc_lmd,pc_tag);
2505 if ((pc_tag==0) || (*pc_tag==0))
2516 *ps_head = (
CHARS *) ps_bufhe;
2519 printf(
"Error opening input file %s\n",pc_lmd);
2523 if(l_prihe) ii =
f_evt_type(ps_bufhe,NULL,0,0,0,0);
2540 printf(
"Buffers %6d, of size %d, Events %10d, first %d, last %d"
2547 else printf(
" not linear\n");
2549 if((ps_chan->
l_channel_no=open(pc_lmd,GET__OPEN_FLAG))== -1)
2584 if(l_prihe) ii =
f_evt_type(ps_bufhe,NULL,0,0,0,0);
2587 if(ps_bufhe->
i_type == 2000) *ps_head = (
CHARS *)ps_bufhe;
2626 for(kk=0;kk<=l_skip;kk++)
2638 if(pl_event != NULL) *pl_event=pl;
2670 INTS4 l_temp,l_chan,l_tag,ii,kk,lb,l_tagbufs,l_tagrest,l_evt,l_off,l_typ,l_val,l_evsize,l_fragsize;
2671 INTS4 la_head[2],*pl;
2689 if(l_val == 0) l_val=1;
2690 for(kk=0;kk<l_val;kk++)
2701 while(ps_ve10_1->
l_count != l_val)
2706 *pl_event = (
INTS4 *)ps_ve10_1;
2726 printf(
"Event index %d not found\n",l_val);
2729 if(l_val == 0) l_val=1;
2730 ps_tag=(
s_tag *)&s_tag_l;
2744 if(ps_tag->
l_event == l_val)
break;
2749 printf(
"Event number %d not found\n",l_val);
2776 l_evsize=ps_bufhe->
l_free[1]+4;
2791 l_fragsize += ps_ve10_1->
l_dlen+4;
2792 pc += ps_ve10_1->
l_dlen*2;
2793 ps_ve10_1->
l_dlen=l_evsize-4;
2795 while(l_fragsize < l_evsize)
2803 l_fragsize += la_head[0];
2810 *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
static int l_gl_evt_check
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