| 1 | |
|---|
| 2 | |
|---|
| 3 | // reply selected PFT |
|---|
| 4 | |
|---|
| 5 | if (jkv_n /*showv3*/) { |
|---|
| 6 | |
|---|
| 7 | RECSTRU *recp; |
|---|
| 8 | int i,noc; |
|---|
| 9 | //int debug=(cmd >= 3)?1:0; |
|---|
| 10 | |
|---|
| 11 | RECORD(irec,collectiondb,l->mfn); |
|---|
| 12 | |
|---|
| 13 | if (collcollmfntag/*parmcollmfntag*/) { // load v3001,v3003 from colvdb |
|---|
| 14 | |
|---|
| 15 | char *xp=jdv_areap; |
|---|
| 16 | char *xfldp; |
|---|
| 17 | int xdir,xtag,xlen; |
|---|
| 18 | |
|---|
| 19 | RECORD(irectv,colvdb,l->hit); |
|---|
| 20 | |
|---|
| 21 | //sprintf(xp,"d3003a3003%c",0x01); |
|---|
| 22 | //xp+=strlen(xp); recfield(xp,irectv,TAG3,1,""); |
|---|
| 23 | //xp+=strlen(xp); sprintf(xp,"%c",0x01); |
|---|
| 24 | |
|---|
| 25 | for (xdir=0; xdir < MFRnvf; xdir++) { |
|---|
| 26 | xtag=DIRtag(xdir); |
|---|
| 27 | if (xtag == TAG4) continue; |
|---|
| 28 | xlen=DIRlen(xdir); xfldp=FIELDP(xdir); |
|---|
| 29 | sprintf(xp,"H%d %d ",xtag+3000,xlen); xp+=strlen(xp); |
|---|
| 30 | memcpy(xp,xfldp,xlen); xp+=xlen; |
|---|
| 31 | } |
|---|
| 32 | //add v6-like info |
|---|
| 33 | sprintf(xp,"<%d 0>%s</%d>A%d|%"_LD_"^s%f^m%"_LD_"^h%"_LD_"|",5+3000,parmtext,5+3000,6+3000,l->mfn,l->sim,l->xxx,l->hit); xp+=strlen(xp); |
|---|
| 34 | *xp='\0'; |
|---|
| 35 | if (fldupdat(irec,jdv_areap)) fatal("wtrig2/w2ov3/fldupdat"); |
|---|
| 36 | |
|---|
| 37 | } // end if collmfntag |
|---|
| 38 | |
|---|
| 39 | for (i=0, noc=jkv_n; i < noc; i++) { // for each jkv_occ |
|---|
| 40 | int jdvi=jkv_jdvi[i]; |
|---|
| 41 | if (jdvi >= 0) { // it is |
|---|
| 42 | int lns; |
|---|
| 43 | char *p; |
|---|
| 44 | *jdv_areap = '\0'; /* call format */ |
|---|
| 45 | lns=fmt_inter(jdv_pgmp[jdvi],irec,jdv_asize,jdv_areap,jdv_asize); |
|---|
| 46 | if (lns < 0) sprintf(jdv_areap,"<wtrig in=\"w2ov3\" error=\"%d\">format execution error</wtrig>\n",lns); |
|---|
| 47 | for (p=jdv_areap; *p; p++) { // for all chars |
|---|
| 48 | if (convent[*p]) { strcpy(reply,convent[*p]); reply+=strlen(reply); } |
|---|
| 49 | else *reply++ = *p; |
|---|
| 50 | } // end for all chars |
|---|
| 51 | } // end if jdvi |
|---|
| 52 | } // end for each jkv |
|---|
| 53 | |
|---|
| 54 | } // end if jkv_n |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | else { // else if jkv_n |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | if (showv3) { |
|---|
| 61 | |
|---|
| 62 | RECSTRU *recp; |
|---|
| 63 | int xdir,nvf; |
|---|
| 64 | int maxv3len=SHOWV3LEN; |
|---|
| 65 | int xtag=0; |
|---|
| 66 | |
|---|
| 67 | if (collcollmfntag/*parmcollmfntag*/) if (showv3 < 0) { |
|---|
| 68 | RECORD(irectv,colvdb,l->hit); |
|---|
| 69 | xtag=(-showv3); |
|---|
| 70 | for (xdir=0, nvf=MFRnvf; xdir < nvf; xdir++) { // scan dir |
|---|
| 71 | if (DIRtag(xdir) == xtag) { // data |
|---|
| 72 | unsigned char *p=FIELDP(xdir); |
|---|
| 73 | int n=DIRlen(xdir); |
|---|
| 74 | if (n > maxv3len) n=maxv3len; |
|---|
| 75 | for (; n--; p++) { |
|---|
| 76 | if (convent[*p]) { strcpy(reply,convent[*p]); reply+=strlen(reply); } |
|---|
| 77 | else *reply++ = *p; |
|---|
| 78 | } |
|---|
| 79 | *reply='\0'; |
|---|
| 80 | break; |
|---|
| 81 | } // end data |
|---|
| 82 | } // end dir |
|---|
| 83 | } // end if collmfntag |
|---|
| 84 | |
|---|
| 85 | if (!xtag) { |
|---|
| 86 | RECORD(irec,collectiondb,l->mfn); |
|---|
| 87 | xtag=showv3; |
|---|
| 88 | for (xdir=0, nvf=MFRnvf; xdir < nvf; xdir++) { // scan dir |
|---|
| 89 | if (DIRtag(xdir) == xtag) { // data |
|---|
| 90 | unsigned char *p=FIELDP(xdir); |
|---|
| 91 | int n=DIRlen(xdir); |
|---|
| 92 | if (n > maxv3len) n=maxv3len; |
|---|
| 93 | for (; n--; p++) { |
|---|
| 94 | if (convent[*p]) { strcpy(reply,convent[*p]); reply+=strlen(reply); } |
|---|
| 95 | else *reply++ = *p; |
|---|
| 96 | } |
|---|
| 97 | *reply='\0'; |
|---|
| 98 | break; |
|---|
| 99 | } // end data |
|---|
| 100 | } // end dir |
|---|
| 101 | } // end if !xtag |
|---|
| 102 | |
|---|
| 103 | } // end if showv3 reply |
|---|
| 104 | |
|---|
| 105 | else { // else showv3 reply |
|---|
| 106 | |
|---|
| 107 | sprintf(reply,"%"_LD_,l->mfn); |
|---|
| 108 | reply+=strlen(reply); |
|---|
| 109 | |
|---|
| 110 | } // end showv3 reply |
|---|
| 111 | |
|---|
| 112 | |
|---|
| 113 | } // end jkv_n /*showv3*/ reply |
|---|
| 114 | |
|---|
| 115 | // end if w2ov3 |
|---|