Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. #define _ERRORS_
  2.  
  3. #include "tok.h"
  4.  
  5.  
  6.  
  7. void warningprint(char *str,int line,int file);
  8.  
  9. WARNACT wact[WARNCOUNT]={
  10.  
  11.         warningprint,1,warningprint,1,warningprint,1,warningprint,1,warningprint,1,
  12.  
  13.         warningprint,1,warningprint,1,warningprint,1,warningprint,1,warningprint,1,
  14.  
  15.         warningprint,1,warningprint,1,warningprint,1,warningprint,1,warningprint,1};
  16.  
  17.  
  18.  
  19. int     maxerrors = 16;                                 // number of errors to stop at
  20.  
  21.  
  22.  
  23. void warningprint(char *str,int line,int file);
  24.  
  25. unsigned char mapfile=FALSE;
  26.  
  27. FILE *hmap=NULL;
  28.  
  29.  
  30.  
  31. char shorterr[]="SHORT jump distance too large";
  32.  
  33. char buferr[128];
  34.  
  35.  
  36.  
  37. /* ================== error messages start =========================== */
  38.  
  39.  
  40.  
  41. void FindStopTok()
  42.  
  43. {
  44.  
  45. //      while(tok!=tk_eof&&itok2.type!=tp_stopper/*tok2!=tk_semicolon&&tok2!=tk_camma*/){
  46.  
  47.         do{
  48.  
  49.                 nexttok();
  50.  
  51.         }while(tok!=tk_eof&&itok2.type!=tp_stopper&&itok.type!=tp_stopper/*tok2!=tk_semicolon&&tok2!=tk_camma*/);
  52.  
  53. //      }
  54.  
  55. }
  56.  
  57.  
  58.  
  59. void SkipBlock2()
  60.  
  61. {
  62.  
  63.         cha=cha2;
  64.  
  65.         inptr=inptr2;
  66.  
  67.         SkipBlock();
  68.  
  69.         cha2=cha;
  70.  
  71.         inptr=inptr2;
  72.  
  73.         linenum2=linenumber;
  74.  
  75.         FindStopTok();
  76.  
  77. }
  78.  
  79.  
  80.  
  81. void FindEndLex()
  82.  
  83. {
  84.  
  85.         while(tok2!=tk_semicolon&&tok!=tk_eof)nexttok();
  86.  
  87. }
  88.  
  89.  
  90.  
  91. void  preerror(char *str) /* error on currentline with line number and file name */
  92.  
  93. {
  94.  
  95.         preerror3(str,linenumber);
  96.  
  97. }
  98.  
  99.  
  100.  
  101. void  preerror3(char *str,unsigned int line,unsigned int file)//error message at a different than current line
  102.  
  103. {
  104.  
  105.         if(error<maxerrors){
  106.  
  107.                 error++;
  108.  
  109.                 sprintf((char *)string3,"%s(%d)#%d> %s.\n",startfileinfo==NULL?"":(startfileinfo+file)->filename,line,error,str);
  110.  
  111.                 printf((char *)string3);
  112.  
  113.                 if(errfile.file==NULL)errfile.file=fopen(errfile.name,"w+t");
  114.  
  115.                 if(errfile.file!=NULL)fprintf(errfile.file,(char *)string3);
  116.  
  117.         }
  118.  
  119.         else exit(e_toomanyerrors);
  120.  
  121. }
  122.  
  123.  
  124.  
  125. void internalerror (char *str)// serious internal compiler error message
  126.  
  127. {
  128.  
  129. char buf[200];
  130.  
  131.         sprintf(buf,"*** SERIOUS COMPILER INTERNAL ERROR ***\n>%s",str);
  132.  
  133.         preerror(buf);
  134.  
  135.         printf("STRING:%s\nIDNAME:%s\n",string,itok.name);
  136.  
  137.         printf("TOK:%d SEGM:%d POST:%d RM:%d number:%ld\n",tok,itok.segm,itok.post,itok.rm,itok.number);
  138.  
  139.         printf("STRING2:%s\nIDNAME2:%s\n",string2,itok2.name);
  140.  
  141.         printf("TOK2:%d SEGM2:%d POST2:%d RM2:%d number2:%ld\n",tok2,itok2.segm,itok2.post,itok2.rm,itok2.number);
  142.  
  143.         printf("Out position:%04X\n",outptr);
  144.  
  145.         exit(e_internalerror);
  146.  
  147. }
  148.  
  149.  
  150.  
  151. char *getnumoperand(int type,char *name)
  152.  
  153. {
  154.  
  155.         switch(type){
  156.  
  157.                 case 0:
  158.  
  159.                         return "";
  160.  
  161.                 case 1:
  162.  
  163.                         strcpy(buferr,"1-st ");
  164.  
  165.                         break;
  166.  
  167.                 case 2:
  168.  
  169.                         strcpy(buferr,"2-nd ");
  170.  
  171.                         break;
  172.  
  173.                 case 3:
  174.  
  175.                         strcpy(buferr,"3-rd ");
  176.  
  177.                         break;
  178.  
  179.                 default:
  180.  
  181.                         sprintf(buferr,"%d-th ",type%256);
  182.  
  183.                         break;
  184.  
  185.         }
  186.  
  187.         strcat(buferr,name);
  188.  
  189.         return buferr;
  190.  
  191. }
  192.  
  193.  
  194.  
  195. void  expected (char ch)
  196.  
  197. {
  198.  
  199. char holdstr[80];
  200.  
  201.         sprintf(holdstr,"'%c' expected",ch);
  202.  
  203.         preerror(holdstr);
  204.  
  205. }
  206.  
  207.  
  208.  
  209. void numexpected(int type)
  210.  
  211. {
  212.  
  213. char buf[40];
  214.  
  215.         sprintf(buf,"%snumber expected",getnumoperand(type,"operand "));
  216.  
  217.         preerror(buf);
  218.  
  219. }
  220.  
  221.  
  222.  
  223. void varexpected(int type)
  224.  
  225. {
  226.  
  227. char buf[45];
  228.  
  229.         sprintf(buf,"%svariable expected",getnumoperand(type,"operand "));
  230.  
  231.         preerror(buf);
  232.  
  233. }
  234.  
  235.  
  236.  
  237. void stringexpected()
  238.  
  239. {
  240.  
  241.         preerror("string expected");
  242.  
  243. }
  244.  
  245.  
  246.  
  247. void valueexpected()
  248.  
  249. {
  250.  
  251.         preerror("value expected");
  252.  
  253. }
  254.  
  255.  
  256.  
  257. void wordvalexpected()
  258.  
  259. {
  260.  
  261.         preerror("word value expected");
  262.  
  263. }
  264.  
  265.  
  266.  
  267. void dwordvalexpected()
  268.  
  269. {
  270.  
  271.         preerror("dword value expected");
  272.  
  273. }
  274.  
  275.  
  276.  
  277. void qwordvalexpected()
  278.  
  279. {
  280.  
  281.         preerror("qword value expected");
  282.  
  283. }
  284.  
  285.  
  286.  
  287. void codeexpected()
  288.  
  289. {
  290.  
  291.         preerror("assembly opcode expected");
  292.  
  293. }
  294.  
  295.  
  296.  
  297. void operatorexpected()
  298.  
  299. {
  300.  
  301.         preerror("operator identifier expected");
  302.  
  303. }
  304.  
  305.  
  306.  
  307. void unexpectedeof()
  308.  
  309. {
  310.  
  311.         preerror("unexpected END OF FILE");
  312.  
  313. }
  314.  
  315.  
  316.  
  317. void swaperror()
  318.  
  319. {
  320.  
  321.         preerror("invalid or incompatable swap item");
  322.  
  323. }
  324.  
  325.  
  326.  
  327. void notexternfun()
  328.  
  329. {
  330.  
  331.         preerror("Do not insert extern function");
  332.  
  333. }
  334.  
  335.  
  336.  
  337. void idalreadydefined()
  338.  
  339. {
  340.  
  341. char holdstr[80];
  342.  
  343.         sprintf(holdstr,"identifier '%s' already defined",itok.name);
  344.  
  345.         preerror(holdstr);
  346.  
  347.         FindStopTok();
  348.  
  349. //      nexttok();
  350.  
  351. }
  352.  
  353.  
  354.  
  355. void  jumperror(unsigned int line,char *type)
  356.  
  357. {
  358.  
  359. char smalltype[IDLENGTH];
  360.  
  361. char buf[80];
  362.  
  363.         strcpy(smalltype,type);
  364.  
  365.         strlwr(smalltype);
  366.  
  367.         sprintf(buf,"'%s' jump distance too large, use '%s'",type,smalltype);
  368.  
  369.         preerror3(buf,line);
  370.  
  371. }
  372.  
  373.  
  374.  
  375. void unknowncompop()
  376.  
  377. {
  378.  
  379.         preerror("unknown comparison operator");
  380.  
  381. }
  382.  
  383.  
  384.  
  385. void maxoutputerror()
  386.  
  387. {
  388.  
  389.         preerror("maximum output code size exceeded");
  390.  
  391.         exit( e_outputtoobig );
  392.  
  393. }
  394.  
  395.  
  396.  
  397. void unableopenfile(char *name)
  398.  
  399. {
  400.  
  401. char holdstr[256];
  402.  
  403.         sprintf(holdstr,"unable to open file '%s'",name);
  404.  
  405.         preerror(holdstr);
  406.  
  407. }
  408.  
  409.  
  410.  
  411. void shortjumptoolarge()
  412.  
  413. {
  414.  
  415.         preerror(shorterr);
  416.  
  417. }
  418.  
  419.  
  420.  
  421. void thisundefined(char *str,int next)
  422.  
  423. {
  424.  
  425. char holdstr[80];
  426.  
  427.         sprintf(holdstr,"'%s' undefined",str);
  428.  
  429.         preerror(holdstr);
  430.  
  431.  
  432.  
  433.         if(next)FindStopTok();
  434.  
  435. }
  436.  
  437.  
  438.  
  439. void datatype_expected(int type)
  440.  
  441. {
  442.  
  443. char buf[45];
  444.  
  445.         sprintf(buf,"%smemory variable expected",getnumoperand(type,"operand "));
  446.  
  447.         preerror(buf);
  448.  
  449.         FindStopTok();
  450.  
  451. }
  452.  
  453.  
  454.  
  455. void illegalfloat()
  456.  
  457. {
  458.  
  459.         preerror("illegal use of float point");
  460.  
  461. }
  462.  
  463.  
  464.  
  465. void tobigpost()
  466.  
  467. {
  468.  
  469.         preerror("maximum size of post variables exceeded");
  470.  
  471.         postsize=0xFFFF;
  472.  
  473. }
  474.  
  475.  
  476.  
  477. void unuseableinput()
  478.  
  479. {
  480.  
  481.         preerror("unuseable input");
  482.  
  483.         FindStopTok();
  484.  
  485. }
  486.  
  487.  
  488.  
  489. void ManyLogicCompare()
  490.  
  491. {
  492.  
  493.         preerror("to many use logic compare");
  494.  
  495. }
  496.  
  497.  
  498.  
  499. void ZeroMassiv()
  500.  
  501. {
  502.  
  503.         preerror("size massiv unknown or zero");
  504.  
  505. }
  506.  
  507.  
  508.  
  509. void maxdataerror()
  510.  
  511. {
  512.  
  513.         preerror("maximum output data size exceeded");
  514.  
  515.         exit( e_outputtoobig );
  516.  
  517. }
  518.  
  519.  
  520.  
  521. void errorreadingfile(char *name)
  522.  
  523. {
  524.  
  525. char buf[256];
  526.  
  527.         sprintf(buf,"error reading from file '%s'",name);
  528.  
  529.         preerror(buf);
  530.  
  531. }
  532.  
  533.  
  534.  
  535. void badinfile(char *name)
  536.  
  537. {
  538.  
  539. char buf[256];
  540.  
  541.         sprintf(buf,"bad input file '%s'",name);
  542.  
  543.         preerror(buf);
  544.  
  545. }
  546.  
  547.  
  548.  
  549. void edpip(int num)
  550.  
  551. {
  552.  
  553. char buf[64];
  554.  
  555. //      preerror("error declare parameters in function");
  556.  
  557.         sprintf(buf,"error declare %sparameters in function",getnumoperand(num,""));
  558.  
  559.         preerror(buf);
  560.  
  561. }
  562.  
  563.  
  564.  
  565. void CompareOr()
  566.  
  567. {
  568.  
  569.         preerror("compare logic OR or AND to big distance");
  570.  
  571. }
  572.  
  573.  
  574.  
  575. void dynamiclabelerror()
  576.  
  577. {
  578.  
  579.         preerror("global labels illegal within dynamic functions");
  580.  
  581. }
  582.  
  583.  
  584.  
  585. void OnlyComFile()
  586.  
  587. {
  588.  
  589.         preerror("this option only for COM output files");
  590.  
  591. }
  592.  
  593.  
  594.  
  595. void redeclare(char *name)
  596.  
  597. {
  598.  
  599. char buf[120];
  600.  
  601.         sprintf(buf,"error redeclare function \"%s\"",name);
  602.  
  603.         preerror(buf);
  604.  
  605. }
  606.  
  607.  
  608.  
  609. void retvoid()
  610.  
  611. {
  612.  
  613.         preerror("function has return type of void");
  614.  
  615. }
  616.  
  617.  
  618.  
  619. void extraparam(char *name)
  620.  
  621. {
  622.  
  623. char buf[120];
  624.  
  625.         sprintf(buf,"extra parameter in function %s",name);
  626.  
  627.         preerror(buf);
  628.  
  629. }
  630.  
  631.  
  632.  
  633. void blockerror()
  634.  
  635. {
  636.  
  637.         preerror("illegal syntax within [ ]");
  638.  
  639. }
  640.  
  641.  
  642.  
  643. void block16_32error()
  644.  
  645. {
  646.  
  647.         preerror("only one of 16 or 32 bit allowed within [ ]");
  648.  
  649. }
  650.  
  651.  
  652.  
  653. void notstructname()
  654.  
  655. {
  656.  
  657.         preerror("unique struct name expected");
  658.  
  659. }
  660.  
  661.  
  662.  
  663. void badtoken()
  664.  
  665. {
  666.  
  667. char buf[80];
  668.  
  669.         if(displaytokerrors){
  670.  
  671.                 sprintf(buf,"tokenizer: bad character value - '%c'",cha);
  672.  
  673.                 preerror(buf);
  674.  
  675.         }
  676.  
  677. }
  678.  
  679.  
  680.  
  681. void expectederror(char *str)
  682.  
  683. {
  684.  
  685. char holdstr[80];
  686.  
  687.         if(displaytokerrors){
  688.  
  689.                 sprintf(holdstr,"%s expected",str);
  690.  
  691.                 preerror(holdstr);
  692.  
  693.         }
  694.  
  695. }
  696.  
  697.  
  698.  
  699. void declareanonim()
  700.  
  701. {
  702.  
  703.         preerror("Error declare anonimus union");
  704.  
  705. }
  706.  
  707.  
  708.  
  709. void declareunion()
  710.  
  711. {
  712.  
  713.         preerror("Error declare union");
  714.  
  715. }
  716.  
  717. /*
  718.  
  719. void not_union_static()
  720.  
  721. {
  722.  
  723.         preerror("'static' not use in 'union'");
  724.  
  725. } */
  726.  
  727.  
  728.  
  729. void segoperror()
  730.  
  731. {
  732.  
  733.         preerror("only '=' or '><' operands valid with segment register");
  734.  
  735. }
  736.  
  737.  
  738.  
  739. void segbyteerror()
  740.  
  741. {
  742.  
  743.         preerror("segment registers can not be used in byte or char math");
  744.  
  745. }
  746.  
  747.  
  748.  
  749. void regmathoperror()
  750.  
  751. {
  752.  
  753.         preerror("invalid operation for non-AX register math");
  754.  
  755. }
  756.  
  757.  
  758.  
  759. void begmathoperror()
  760.  
  761. {
  762.  
  763.         preerror("invalid operation for non-AL register math");
  764.  
  765. }
  766.  
  767.  
  768.  
  769. void negregerror()
  770.  
  771. {
  772.  
  773.         preerror("negative non-constant invalid for non-AX register math");
  774.  
  775. }
  776.  
  777.  
  778.  
  779. void regbyteerror()
  780.  
  781. {
  782.  
  783.         preerror("byte or char operands invalid for non-AX register math");
  784.  
  785. }
  786.  
  787.  
  788.  
  789. void begworderror()
  790.  
  791. {
  792.  
  793.         preerror("specified 16 bit operand invalid for non-AL register math");
  794.  
  795. }
  796.  
  797.  
  798.  
  799. void regshifterror()
  800.  
  801. {
  802.  
  803.         preerror("only CL or 1 valid for non AX or AL register bit shifting");
  804.  
  805. }
  806.  
  807.  
  808.  
  809. void regmatherror()
  810.  
  811. {
  812.  
  813.         preerror("invalid operand for non-AX register math");
  814.  
  815. }
  816.  
  817.  
  818.  
  819. void DevideZero()
  820.  
  821. {
  822.  
  823.         preerror("impossible to divide into ZERO");
  824.  
  825. }
  826.  
  827.  
  828.  
  829. void wordnotoper()
  830.  
  831. {
  832.  
  833.         preerror("word or int operands invalid for non-EAX register math");
  834.  
  835. }
  836.  
  837.  
  838.  
  839. void regexpected(int type)
  840.  
  841. {
  842.  
  843. char buf[50];
  844.  
  845.         sprintf(buf,"%sword register expected",getnumoperand(type,"operand "));
  846.  
  847.         preerror(buf);
  848.  
  849. }
  850.  
  851.  
  852.  
  853. void bytevalexpected(int type)
  854.  
  855. {
  856.  
  857. char buf[50];
  858.  
  859.         sprintf(buf,"%sbyte value expected",getnumoperand(type,"operand "));
  860.  
  861.         preerror(buf);
  862.  
  863. }
  864.  
  865.  
  866.  
  867. void shortjumperror()
  868.  
  869. {
  870.  
  871.         preerror("invalid operand for SHORT jump");
  872.  
  873. }
  874.  
  875.  
  876.  
  877. void invalidfarjumpitem()
  878.  
  879. {
  880.  
  881.         preerror("invalid operand for FAR jump");
  882.  
  883. }
  884.  
  885.  
  886.  
  887. void invalidfarcallitem()
  888.  
  889. {
  890.  
  891.         preerror("invalid operand for FAR call");
  892.  
  893. }
  894.  
  895.  
  896.  
  897. void begexpected(int type)
  898.  
  899. {
  900.  
  901. char buf[50];
  902.  
  903.         sprintf(buf,"%sbyte register expected",getnumoperand(type,"operand "));
  904.  
  905.         preerror(buf);
  906.  
  907. }
  908.  
  909.  
  910.  
  911. void reg32expected(int type)
  912.  
  913. {
  914.  
  915. char buf[50];
  916.  
  917.         sprintf(buf,"%s32 bit register expected",getnumoperand(type,"operand "));
  918.  
  919.         preerror(buf);
  920.  
  921. }
  922.  
  923.  
  924.  
  925. void reg32regexpected(int type)
  926.  
  927. {
  928.  
  929. char buf[50];
  930.  
  931.         sprintf(buf,"%s16 or 32 bit register expected",getnumoperand(type,"operand "));
  932.  
  933.         preerror(buf);
  934.  
  935. }
  936.  
  937.  
  938.  
  939. void regBXDISIBPexpected()
  940.  
  941. {
  942.  
  943.         preerror("use only one of BX, DI, SI or BP register");
  944.  
  945. }
  946.  
  947.  
  948.  
  949. void bytedxexpected()
  950.  
  951. {
  952.  
  953.         preerror("byte constant or DX expected");
  954.  
  955. }
  956.  
  957.  
  958.  
  959. void axalexpected()
  960.  
  961. {
  962.  
  963.         preerror("EAX, AX or AL expected");
  964.  
  965. }
  966.  
  967.  
  968.  
  969. void invalidoperand(int type)
  970.  
  971. {
  972.  
  973. char buf[25];
  974.  
  975.         sprintf(buf,"%sinvalid",getnumoperand(type,"operand "));
  976.  
  977.         preerror(buf);
  978.  
  979. }
  980.  
  981.  
  982.  
  983. void mmxregexpected(int type)
  984.  
  985. {
  986.  
  987. char buf[50];
  988.  
  989.         sprintf(buf,"%sMMX register expected",getnumoperand(type,"operand "));
  990.  
  991.         preerror(buf);
  992.  
  993. }
  994.  
  995.  
  996.  
  997. void xmmregexpected(int type)
  998.  
  999. {
  1000.  
  1001. char buf[50];
  1002.  
  1003.         sprintf(buf,"%sXMM register expected",getnumoperand(type,"operand "));
  1004.  
  1005.         preerror(buf);
  1006.  
  1007. }
  1008.  
  1009.  
  1010.  
  1011. void xmmregorvarexpected(int type)
  1012.  
  1013. {
  1014.  
  1015. char buf[60];
  1016.  
  1017.         sprintf(buf,"%sXMM register or memory varible expected",getnumoperand(type,"operand "));
  1018.  
  1019.         preerror(buf);
  1020.  
  1021. }
  1022.  
  1023.  
  1024.  
  1025. void mmxregordwordexpected(int type)
  1026.  
  1027. {
  1028.  
  1029. char buf[60];
  1030.  
  1031.         sprintf(buf,"%sMMX register or memory varible expected",getnumoperand(type,"operand "));
  1032.  
  1033.         preerror(buf);
  1034.  
  1035. }
  1036.  
  1037.  
  1038.  
  1039. void clornumberexpected()
  1040.  
  1041. {
  1042.  
  1043.         preerror("CL or constant expected");
  1044.  
  1045. }
  1046.  
  1047.  
  1048.  
  1049. void fpuvarexpected(int type)
  1050.  
  1051. {
  1052.  
  1053. char buf[70];
  1054.  
  1055.         sprintf(buf,"%sexpected FPU register|long|dword|float var",getnumoperand(type,"operand "));
  1056.  
  1057.         preerror(buf);
  1058.  
  1059. }
  1060.  
  1061.  
  1062.  
  1063. void fpustakexpected(int type)
  1064.  
  1065. {
  1066.  
  1067. char buf[40];
  1068.  
  1069.         sprintf(buf,"%sexpected FPU register",getnumoperand(type,"operand "));
  1070.  
  1071.         preerror(buf);
  1072.  
  1073. }
  1074.  
  1075.  
  1076.  
  1077. void fpu0expected()
  1078.  
  1079. {
  1080.  
  1081.         preerror("2-nd expected only st(0) fpu register");
  1082.  
  1083. }
  1084.  
  1085.  
  1086.  
  1087. void fpustdestroed()
  1088.  
  1089. {
  1090.  
  1091.         preerror("FPU register more 6 destroed");
  1092.  
  1093. }
  1094.  
  1095.  
  1096.  
  1097. void errstruct()
  1098.  
  1099. {
  1100.  
  1101.         preerror("illegal use of struct");
  1102.  
  1103. }
  1104.  
  1105.  
  1106.  
  1107. void tegnotfound()
  1108.  
  1109. {
  1110.  
  1111.         preerror("tag struct not found");
  1112.  
  1113. }
  1114.  
  1115.  
  1116.  
  1117. void ErrWrite()
  1118.  
  1119. {
  1120.  
  1121.         //fprintf(stderr,"unable to write output file.\n");
  1122.         printf("unable to write output file.\n");
  1123. }
  1124.  
  1125.  
  1126.  
  1127. void ErrReadStub()
  1128.  
  1129. {
  1130.  
  1131.         //fprintf(stderr,"unable to read stubfile\n");
  1132.         printf("unable to read stubfile\n");
  1133. }
  1134.  
  1135.  
  1136.  
  1137. void InvOperComp()
  1138.  
  1139. {
  1140.  
  1141.         preerror("invalid operation for compare");
  1142.  
  1143. }
  1144.  
  1145.  
  1146.  
  1147. void mmxormem(int type)
  1148.  
  1149. {
  1150.  
  1151. char buf[60];
  1152.  
  1153.         sprintf(buf,"%sexpected mmx register or memory variable",getnumoperand(type,"operand "));
  1154.  
  1155.         preerror(buf);
  1156.  
  1157. }
  1158.  
  1159.  
  1160.  
  1161. void reg32orword(int type)
  1162.  
  1163. {
  1164.  
  1165. char buf[60];
  1166.  
  1167.         sprintf(buf,"%s32 bit register or word variable expected",getnumoperand(type,"operand "));
  1168.  
  1169.         preerror(buf);
  1170.  
  1171. }
  1172.  
  1173.  
  1174.  
  1175. void undefclass(char *name)
  1176.  
  1177. {
  1178.  
  1179. char buf[30+IDLENGTH];
  1180.  
  1181.         sprintf(buf,"Base class '%s' not defined",name);
  1182.  
  1183.         preerror(buf);
  1184.  
  1185. }
  1186.  
  1187.  
  1188.  
  1189. void unknowntype()
  1190.  
  1191. {
  1192.  
  1193.         preerror("unknown type");
  1194.  
  1195. }
  1196.  
  1197.  
  1198.  
  1199. void destrdestreg()
  1200.  
  1201. {
  1202.  
  1203.         preerror("destroyed destination register");
  1204.  
  1205. }
  1206.  
  1207.  
  1208.  
  1209. void unknownstruct (char *name,char *sname)
  1210.  
  1211. {
  1212.  
  1213. char buf[IDLENGTH*2+30];
  1214.  
  1215.         sprintf(buf,"unknown member '%s' in struct '%s'",name,sname);
  1216.  
  1217.         preerror(buf);
  1218.  
  1219. }
  1220.  
  1221.  
  1222.  
  1223. void unknowntagstruct(char *name)
  1224.  
  1225. {
  1226.  
  1227. char buf[IDLENGTH+16];
  1228.  
  1229.         sprintf(buf,"unknown tag '%s'",name);
  1230.  
  1231.         preerror(buf);
  1232.  
  1233. }
  1234.  
  1235.  
  1236.  
  1237. void unknownobj(char *name)
  1238.  
  1239. {
  1240.  
  1241. char buf[IDLENGTH+32];
  1242.  
  1243.         sprintf(buf,"unknown object for member '%s'",name);
  1244.  
  1245.         preerror(buf);
  1246.  
  1247. }
  1248.  
  1249. void q();
  1250.  
  1251.  
  1252. void unknownpragma(char *name)
  1253.  
  1254. {
  1255.  
  1256. char buf[IDLENGTH+32];
  1257.  
  1258.         sprintf(buf,"unknown parametr for #pragma %s",name);
  1259.  
  1260.         preerror(buf);
  1261.  
  1262. }
  1263.  
  1264.  
  1265.  
  1266. /*-----------------08.08.00 22:49-------------------
  1267.  
  1268.  à¥¤ã¯à¥¦¤¥­¨ï
  1269.  
  1270.         --------------------------------------------------*/
  1271.  
  1272.  
  1273.  
  1274. void warningoptnum()
  1275.  
  1276. {
  1277.  
  1278.         if(wact[0].usewarn)wact[0].fwarn("Optimize numerical expressions",linenumber,currentfileinfo);
  1279.  
  1280. }
  1281.  
  1282.  
  1283.  
  1284. void  warningreg(char *str2)
  1285.  
  1286. {
  1287.  
  1288. char buf[50];
  1289.  
  1290.         if(wact[1].usewarn){
  1291.  
  1292.                 sprintf(buf,"%s has been used by compiler",str2);
  1293.                 wact[1].fwarn(buf,linenumber,currentfileinfo);
  1294.  
  1295.         }
  1296.  
  1297. }
  1298.  
  1299.  
  1300.  
  1301. void  warningjmp(char *str2,int line,int file)
  1302.  
  1303. {
  1304.  
  1305. char buf[50];
  1306.  
  1307.         if(wact[2].usewarn){
  1308.  
  1309.                 sprintf(buf,"Short operator '%s' may be used",str2);
  1310.  
  1311.                 wact[2].fwarn(buf,line,file);
  1312.  
  1313.         }
  1314.  
  1315. }
  1316.  
  1317.  
  1318.  
  1319. void warningstring()
  1320.  
  1321. {
  1322.  
  1323.         if(wact[3].usewarn){
  1324.  
  1325.                 sprintf((char *)string2,"String \"%s\" repeated",string3);
  1326.  
  1327.                 wact[3].fwarn((char *)string2,linenumber,currentfileinfo);
  1328.  
  1329.         }
  1330.  
  1331. }
  1332.  
  1333.  
  1334.  
  1335. void warningexpand()
  1336.  
  1337. {
  1338.  
  1339.         if(wact[4].usewarn)wact[4].fwarn("Expansion variable",linenumber,currentfileinfo);
  1340.  
  1341. }
  1342.  
  1343.  
  1344.  
  1345. void warningretsign()
  1346.  
  1347. {
  1348.  
  1349.         if(wact[5].usewarn)wact[5].fwarn("Signed value returned",linenumber,currentfileinfo);
  1350.  
  1351. }
  1352.  
  1353.  
  1354.  
  1355. void warningprint(char *str,unsigned int line,unsigned int file)
  1356.  
  1357. {
  1358.         if(warning==TRUE){
  1359.  
  1360.                 //if(wartype.name!=NULL&&wartype.file==stdout){
  1361.                 //      if((wartype.file=fopen(wartype.name,"w+t"))==NULL)wartype.file=stdout;
  1362.                 //}
  1363.  
  1364.                 //fprintf(wartype.file,"%s(%d)> Warning! %s.\n",startfileinfo==NULL?"":(startfileinfo+file)->filename,line,str);
  1365.                 printf("%s(%d)> Warning! %s.\n",startfileinfo==NULL?"":(startfileinfo+file)->filename,line,str);
  1366.  
  1367.         }
  1368. }
  1369.  
  1370.  
  1371.  
  1372. void  warningdefined(char *name)
  1373.  
  1374. {
  1375.  
  1376. char buf[IDLENGTH+30];
  1377.  
  1378.         if(wact[6].usewarn){
  1379.  
  1380.                 sprintf(buf,"'%s' defined above, therefore skipped",name);
  1381.  
  1382.                 wact[6].fwarn(buf,linenumber,currentfileinfo);
  1383.  
  1384.         }
  1385.  
  1386. }
  1387.  
  1388.  
  1389.  
  1390. void warningnotused(char *name,int type)
  1391.  
  1392. {
  1393.  
  1394. char buf[IDLENGTH+40];
  1395.  
  1396. char *typenames[]={"Variable","Structure","Function","Local variable",
  1397.  
  1398. "Parameter variable","Local structure"};
  1399.  
  1400.         if(wact[7].usewarn){
  1401.  
  1402.                 sprintf(buf,"%s '%s' possible not used",(char *)typenames[type],name);
  1403.  
  1404.                 wact[7].fwarn(buf,linenumber,currentfileinfo);
  1405.  
  1406.         }
  1407.  
  1408. }
  1409.  
  1410.  
  1411.  
  1412. void warningusenotintvar(char *name)
  1413.  
  1414. {
  1415.  
  1416. char buf[IDLENGTH+50];
  1417.  
  1418.         if(wact[8].usewarn){
  1419.  
  1420.                 sprintf(buf,"Non-initialized variable '%s' may have been used",name);
  1421.  
  1422.                 wact[8].fwarn(buf,linenumber,currentfileinfo);
  1423.  
  1424.         }
  1425.  
  1426. }
  1427.  
  1428.  
  1429.  
  1430. void warningdestroyflags()
  1431.  
  1432. {
  1433.  
  1434.         if(wact[9].usewarn)wact[9].fwarn("Return flag was destroyed",linenumber,currentfileinfo);
  1435.  
  1436. }
  1437.  
  1438.  
  1439.  
  1440. void warningunreach()
  1441.  
  1442. {
  1443.  
  1444.         if(wact[10].usewarn)wact[10].fwarn("Code may not be executable",linenumber,currentfileinfo);
  1445.  
  1446. }
  1447.  
  1448.  
  1449.  
  1450. void warninline()
  1451.  
  1452. {
  1453.  
  1454.         if(wact[11].usewarn)wact[11].fwarn("Don't use local/parametric values in inline functions",linenumber,currentfileinfo);
  1455.  
  1456. }
  1457.  
  1458.  
  1459.  
  1460. void warnsize()
  1461.  
  1462. {
  1463.  
  1464.         if(wact[12].usewarn)wact[12].fwarn("Sources size exceed destination size",linenumber,currentfileinfo);
  1465.  
  1466. }
  1467.  
  1468.  
  1469.  
  1470. void waralreadinit(char *reg)
  1471.  
  1472. {
  1473.  
  1474. #ifdef BETTA
  1475.  
  1476. char buf[IDLENGTH+50];
  1477.  
  1478.         sprintf(buf,"Register %s already initialized",reg);
  1479.  
  1480.         warningprint(buf,linenumber,currentfileinfo);
  1481.  
  1482. #endif
  1483.  
  1484. }
  1485.  
  1486.  
  1487.  
  1488. void waralreadinitreg(char *reg,char *reg2)
  1489.  
  1490. {
  1491.  
  1492. #ifdef BETTA
  1493.  
  1494. char buf[IDLENGTH+50];
  1495.  
  1496.         sprintf(buf,"Register %s same as %s",reg,reg2);
  1497.  
  1498.         warningprint(buf,linenumber,currentfileinfo);
  1499.  
  1500. #endif
  1501.  
  1502. }
  1503.  
  1504.  
  1505.  
  1506. void warpragmapackpop()
  1507.  
  1508. {
  1509.  
  1510.         if(wact[13].usewarn)wact[13].fwarn("Pragma pack pop with no matching pack push",linenumber,currentfileinfo);
  1511.  
  1512. }
  1513.  
  1514.  
  1515.  
  1516. void missingpar(char *name)
  1517.  
  1518. {
  1519.  
  1520. char buf[120];
  1521.  
  1522.         if(wact[14].usewarn){
  1523.  
  1524.                 sprintf(buf,"Missing parameter in function %s",name);
  1525.  
  1526.                 wact[14].fwarn(buf,linenumber,currentfileinfo);
  1527.  
  1528.         }
  1529.  
  1530. //      preerror(buf);
  1531.  
  1532. }
  1533.  
  1534.  
  1535.  
  1536. void warreplasevar(char *name)
  1537.  
  1538. {
  1539.  
  1540. char buf[120];
  1541.  
  1542. //      if(usewarn[14]){
  1543.  
  1544.         if(displaytokerrors){
  1545.  
  1546.                 sprintf(buf,"Variable %s is replased on constant",name);
  1547.  
  1548.                 warningprint(buf,linenumber,currentfileinfo);
  1549.  
  1550.         }
  1551.  
  1552. //      }
  1553.  
  1554. //      preerror(buf);
  1555.  
  1556. }
  1557.  
  1558.  
  1559.  
  1560. void waralreadinitvar(char *name,unsigned int num)
  1561.  
  1562. {
  1563.  
  1564. char buf[120];
  1565.  
  1566. //      if(usewarn[14]){
  1567.  
  1568.         if(displaytokerrors){
  1569.  
  1570.                 sprintf(buf,"Variable %s already initialized by constant %d",name,num);
  1571.  
  1572.                 warningprint(buf,linenumber,currentfileinfo);
  1573.  
  1574.         }
  1575.  
  1576. //      }
  1577.  
  1578. //      preerror(buf);
  1579.  
  1580. }
  1581.  
  1582.  
  1583.  
  1584. void warcompneqconst()
  1585.  
  1586. {
  1587.  
  1588.         warningprint("Comparison not equal constant. Skipped code",linenumber,currentfileinfo);
  1589.  
  1590. }
  1591.  
  1592.  
  1593.  
  1594. void warcompeqconst()
  1595.  
  1596. {
  1597.  
  1598.         warningprint("Comparison equal constant. Skipped compare",linenumber,currentfileinfo);
  1599.  
  1600. }
  1601.  
  1602.  
  1603.  
  1604. void warpointerstruct()
  1605.  
  1606. {
  1607.  
  1608.         warningprint("Compiler not support pointers on structure",linenumber,currentfileinfo);
  1609.  
  1610. }
  1611.  
  1612.  
  1613.  
  1614. void warESP()
  1615.  
  1616. {
  1617.  
  1618.         warningprint("ESP has ambiguous value",linenumber,currentfileinfo);
  1619.  
  1620. }
  1621.  
  1622.  
  1623.  
  1624. /* *****************   map file *************** */
  1625.  
  1626.  
  1627.  
  1628. void OpenMapFile()
  1629.  
  1630. {
  1631.  
  1632. char buf[256];
  1633.  
  1634.         sprintf(buf,"%s.map",rawfilename);
  1635.  
  1636.         hmap=fopen(buf,"w+t");
  1637.  
  1638. }
  1639.  
  1640.  
  1641.  
  1642. char *GetRetType(int type,int flag)
  1643.  
  1644. {
  1645.  
  1646. char *retcode;
  1647.  
  1648.         if(flag&f_interrupt)return "";
  1649.  
  1650.         switch(type){
  1651.  
  1652.                 case tk_bytevar:
  1653.  
  1654.                 case tk_byte:
  1655.  
  1656.                         retcode="byte ";
  1657.  
  1658.                         break;
  1659.  
  1660.                 case tk_charvar:
  1661.  
  1662.                 case tk_char:
  1663.  
  1664.                         retcode="char ";
  1665.  
  1666.                         break;
  1667.  
  1668.                 case tk_wordvar:
  1669.  
  1670.                 case tk_word:
  1671.  
  1672.                         retcode="word ";
  1673.  
  1674.                         break;
  1675.  
  1676.                 case tk_longvar:
  1677.  
  1678.                 case tk_long:
  1679.  
  1680.                         retcode="long ";
  1681.  
  1682.                         break;
  1683.  
  1684.                 case tk_dwordvar:
  1685.  
  1686.                 case tk_dword:
  1687.  
  1688.                         retcode="dword ";
  1689.  
  1690.                         break;
  1691.  
  1692.                 case tk_doublevar:
  1693.  
  1694.                 case tk_double:
  1695.  
  1696.                         retcode="double ";
  1697.  
  1698.                         break;
  1699.  
  1700.                 case tk_fpust:
  1701.  
  1702.                         retcode="fpust ";
  1703.  
  1704.                         break;
  1705.  
  1706.                 case tk_floatvar:
  1707.  
  1708.                 case tk_float:
  1709.  
  1710.                         retcode="float ";
  1711.  
  1712.                         break;
  1713.  
  1714.                 case tk_qwordvar:
  1715.  
  1716.                 case tk_qword:
  1717.  
  1718.                         retcode="qword ";
  1719.  
  1720.                         break;
  1721.  
  1722.                 case tk_void:
  1723.  
  1724.                         retcode="void ";
  1725.  
  1726.                         break;
  1727.  
  1728. /*              case tk_intvar:
  1729.  
  1730.                 case tk_int:
  1731.  
  1732.                         retcode="int ";
  1733.  
  1734.                         break;*/
  1735.  
  1736.                 case tk_structvar:
  1737.  
  1738.                         retcode="struct";
  1739.  
  1740.                         break;
  1741.  
  1742.                 default:
  1743.  
  1744.                         retcode="int ";
  1745.  
  1746.                         break;
  1747.  
  1748.         }
  1749.  
  1750.         return retcode;;
  1751.  
  1752. }
  1753.  
  1754.  
  1755.  
  1756. char *GetTypeProc(int flag)
  1757.  
  1758. {
  1759.  
  1760. char *retcode;
  1761.  
  1762. char *t;
  1763.  
  1764.         string2[0]=0;
  1765.  
  1766.         if(flag&f_interrupt)return "interrupt";
  1767.  
  1768.         if(flag&f_far)strcat((char *)string2,"far ");
  1769.  
  1770.         if(flag&f_extern)strcat((char *)string2,"extern ");
  1771.  
  1772.         if(flag&f_export)strcat((char *)string2,"_export ");
  1773.  
  1774.         if(flag&f_inline)strcat((char *)string2,"inline ");
  1775.  
  1776.         if(flag&f_static)strcat((char *)string2,"static ");
  1777.  
  1778.         if(flag&f_retproc){
  1779.  
  1780.                 t="";
  1781.  
  1782.                 switch(((flag&f_retproc)>>8)+tk_overflowflag-1){
  1783.  
  1784.                         case tk_overflowflag:
  1785.  
  1786.                                 t="OVERFLOW ";
  1787.  
  1788.                                 break;
  1789.  
  1790.                         case tk_notoverflowflag:
  1791.  
  1792.                                 t="NOTOVERFLOW ";
  1793.  
  1794.                                 break;
  1795.  
  1796.                         case tk_carryflag:
  1797.  
  1798.                                 t="CARRYFLAG ";
  1799.  
  1800.                                 break;
  1801.  
  1802.                         case tk_notcarryflag:
  1803.  
  1804.                                 t="NOTCARRYFLAG ";
  1805.  
  1806.                                 break;
  1807.  
  1808.                         case tk_zeroflag:
  1809.  
  1810.                                 t="ZEROFLAG ";
  1811.  
  1812.                                 break;
  1813.  
  1814.                         case tk_notzeroflag:
  1815.  
  1816.                                 t="NOTZEROFLAG ";
  1817.  
  1818.                                 break;
  1819.  
  1820.                         case tk_minusflag:
  1821.  
  1822.                                 t="MINUSFLAG ";
  1823.  
  1824.                                 break;
  1825.  
  1826.                         case tk_plusflag:
  1827.  
  1828.                                 t="PLUSFLAG ";
  1829.  
  1830.                                 break;
  1831.  
  1832.                 }
  1833.  
  1834.                 strcat((char *)string2,t);
  1835.  
  1836.         }
  1837.  
  1838.         switch(flag&f_typeproc){
  1839.  
  1840.                 case tp_pascal:
  1841.  
  1842.                         t="pascal ";
  1843.  
  1844.                         break;
  1845.  
  1846.                 case tp_cdecl:
  1847.  
  1848.                         t="cdecl ";
  1849.  
  1850.                         break;
  1851.  
  1852.                 case tp_stdcall:
  1853.  
  1854.                         t="stdcall ";
  1855.  
  1856.                         break;
  1857.  
  1858.                 case tp_fastcall:
  1859.  
  1860.                         t="fastcall ";
  1861.  
  1862.                         break;
  1863.  
  1864.         }
  1865.  
  1866.         strcat((char *)string2,t);
  1867.  
  1868.         return (char *)string2;
  1869.  
  1870. }
  1871.  
  1872.  
  1873.  
  1874. char *GetFunParam(unsigned char c,unsigned char c2,unsigned char c3)
  1875.  
  1876. {
  1877.  
  1878.         switch(c){
  1879.  
  1880.                 case 'B':
  1881.  
  1882.                         if(c2>=0x30&&c2<=0x37)return begs[c2-0x30];
  1883.  
  1884.                         return "byte";
  1885.  
  1886.                 case 'W':
  1887.  
  1888.                         if(c2>=0x30&&c2<=0x37)return regs[0][c2-0x30];
  1889.  
  1890.                         return "word";
  1891.  
  1892.                 case 'D':
  1893.  
  1894.                         if(c2>=0x30&&c2<=0x37)return regs[1][c2-0x30];
  1895.  
  1896.                         return "dword";
  1897.  
  1898.                 case 'C': return "char";
  1899.  
  1900.                 case 'I': return "int";
  1901.  
  1902.                 case 'L': return "long";
  1903.  
  1904.                 case 'F': return "float";
  1905.  
  1906.                 case 'A': return "...";
  1907.  
  1908.                 case 'Q':
  1909.  
  1910.                         if(c2>=0x30&&c2<=0x37){
  1911.  
  1912.                                 sprintf((char *)string2,"%s:%s",regs[1][c2-0x30],regs[1][c3-0x30]);
  1913.  
  1914.                                 return (char *)string2;
  1915.  
  1916.                         }
  1917.  
  1918.                         return "qword";
  1919.  
  1920.                 case 'E': return "double";
  1921.  
  1922.                 case 'S':
  1923.  
  1924.                         if(c2>=0x30&&c2<=0x37){
  1925.  
  1926.                                 sprintf((char *)string2,"st(%c)",c2);
  1927.  
  1928.                                 return (char *)string2;
  1929.  
  1930.                         }
  1931.  
  1932.                         return "fpust";
  1933.  
  1934.                 case 'T': return "struct";
  1935.  
  1936.                 case 'U': return "void";
  1937.  
  1938.         }
  1939.  
  1940.         return "";;
  1941.  
  1942. }
  1943.  
  1944.  
  1945.  
  1946. char *GetName(char *name,int flag)
  1947.  
  1948. {
  1949.  
  1950. char *tn;
  1951.  
  1952. char iname[IDLENGTH];
  1953.  
  1954.         strcpy(iname,name);
  1955.  
  1956.         if((tn=strchr(iname,'@'))!=NULL)*tn=0;
  1957.  
  1958.         if(flag&fs_constructor)sprintf((char *)string3,"%s::%s",iname,iname);
  1959.  
  1960.         else if(flag&fs_destructor)sprintf((char *)string3,"%s::~%s",iname,iname);
  1961.  
  1962.         else if(flag&f_classproc)sprintf((char *)string3,"%s::%s",searchteg->name,iname);
  1963.  
  1964.         else strcpy((char *)string3,iname);
  1965.  
  1966.         return (char *)string3;
  1967.  
  1968. }
  1969.  
  1970.  
  1971.  
  1972. char *GetSizeVar(int type,int adr)
  1973.  
  1974. {
  1975.  
  1976. char *reg;
  1977.  
  1978. char *sign;
  1979.  
  1980.         if(type==tp_postvar||type==tp_gvar)return "DS:???";
  1981.  
  1982.         if(am32){
  1983.  
  1984.                 if(ESPloc)reg="ESP";
  1985.  
  1986.                 else reg="EBP";
  1987.  
  1988.         }
  1989.  
  1990.         else reg="BP";
  1991.  
  1992.         if(adr<0)sign="";
  1993.  
  1994.         else sign="+";
  1995.  
  1996.         sprintf((char *)string2,"%s%s%d",reg,sign,adr);
  1997.  
  1998.         return (char *)string2;
  1999.  
  2000. }
  2001.  
  2002.  
  2003.  
  2004. void GetRangeUsed(char *buf,localinfo *ptr)
  2005.  
  2006. {
  2007.  
  2008.         if(ptr->count==0)buf[0]=0;
  2009.  
  2010.         else if(ptr->count==1)sprintf(buf,"%d",ptr->usedfirst);
  2011.  
  2012.         else sprintf(buf,"%d-%d",ptr->usedfirst,ptr->usedlast);
  2013.  
  2014. }
  2015.  
  2016.  
  2017.  
  2018. void mapfun(int line)
  2019.  
  2020. {
  2021.  
  2022. treelocalrec *ftlr;
  2023.  
  2024. struct localrec *ptr;
  2025.  
  2026. int i,fheader;
  2027.  
  2028. char buf[32];
  2029.  
  2030.         if(hmap==NULL)OpenMapFile();
  2031.  
  2032.         if(hmap){
  2033.  
  2034.                 fprintf(hmap,"\n%s%s%s(",GetTypeProc(itok.flag),GetRetType(itok.rm,itok.flag),GetName(itok.name,itok.flag));
  2035.  
  2036.                 for(i=0;;i++){
  2037.  
  2038.                         unsigned char c=string[i];
  2039.  
  2040.                         if(c==0)break;
  2041.  
  2042.                         if(c>=0x30&&c<=0x37)continue;
  2043.  
  2044.                         if(i)fputc(',',hmap);
  2045.  
  2046.                         unsigned char c2=string[i+1];
  2047.  
  2048.                         unsigned char c3=string[i+2];
  2049.  
  2050.                         fputs(GetFunParam(c,c2,c3),hmap);
  2051.  
  2052.                 }
  2053.  
  2054.                 fputc(')',hmap);
  2055.  
  2056.                 fprintf(hmap,"\nlocation: line %d-%d file %s",line,linenumber,startfileinfo==NULL?"":(startfileinfo+currentfileinfo)->filename);
  2057.  
  2058.                 fprintf(hmap,"\noffset=0x%X(%d)\tsize=0x%X(%d)",itok.number,itok.number,itok.size,itok.size);
  2059.  
  2060.         }
  2061.  
  2062.         fheader=0;
  2063.  
  2064.         for(ftlr=btlr;ftlr!=NULL;ftlr=ftlr->next){
  2065.  
  2066.                 for(ptr=ftlr->lrec;ptr!=NULL;ptr=ptr->rec.next){
  2067.  
  2068.                         i=ptr->rec.type;
  2069.  
  2070.                         if(i==tp_postvar||i==tp_gvar||i==tp_localvar||i==tp_paramvar){
  2071.  
  2072.                                 if(!fheader){
  2073.  
  2074.                                         fputs("\nType    Address   Used     Count  Size    Name",hmap);
  2075.  
  2076.                                         fputs("\n----------------------------------------------",hmap);
  2077.  
  2078.                                         fheader=TRUE;
  2079.  
  2080.                                 }
  2081.  
  2082.                                 GetRangeUsed(buf,&ptr->li);
  2083.  
  2084.                                 fprintf(hmap,"\n%-8s%-10s%-12s%-4d%-8d",GetRetType(ptr->rec.rectok,0),GetSizeVar(ptr->rec.type,ptr->rec.recnumber),buf,ptr->li.count,ptr->rec.recsize);
  2085.  
  2086.                                 if(ptr->rec.npointr)for(i=ptr->rec.npointr;i>0;i--)fputc('*',hmap);
  2087.  
  2088.                                 fputs(ptr->rec.recid,hmap);
  2089.  
  2090.                         }
  2091.  
  2092.                 }
  2093.  
  2094.         }
  2095.  
  2096.         fputs("\n",hmap);
  2097.  
  2098. }
  2099.  
  2100.  
  2101.  
  2102.