home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume9 / map_go / part02 < prev    next >
Encoding:
Text File  |  1989-11-26  |  89.7 KB  |  3,984 lines

  1. Newsgroups: comp.sources.misc
  2. organization: Marine Research Institute, Reykjavik
  3. subject: v09i008: map program no. 2 of 2
  4. from: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5. Reply-To: gunnaro@hafro.is (Gunnar Orvarsson)
  6.  
  7. Posting-number: Volume 9, Issue 8
  8. Submitted-by: gunnaro@hafro.is (Gunnar Orvarsson)
  9. Archive-name: map_go/part02
  10.  
  11.       
  12.       map program : no. 2 of 2
  13.                     This shell archive contains the source code
  14.                     for the map program.
  15.                     Unwrap no. 1 first.
  16.                     
  17.  
  18.  
  19. #---------------------------------- cut here ----------------------------------
  20. # This is a shell archive.  Remove anything before this line,
  21. # then unpack it by saving it in a file and typing "sh file".
  22. #
  23. # Wrapped by Gunnar Orvarsson <gunnaro@gst> on Mon Nov 20 15:50:11 1989
  24. #
  25. # This archive contains:
  26. #    Map/Src    
  27. #
  28. # Error checking via wc(1) will be performed.
  29.  
  30. LANG=""; export LANG
  31.  
  32. echo mkdir - Map/Src
  33. mkdir Map/Src
  34.  
  35. echo x - Map/Src/Makefile
  36. cat >Map/Src/Makefile <<'@EOF'
  37. INSDIR=/usr/local/bin
  38.  
  39. LIBES=-lm
  40.  
  41. # Choose the appropriate plot library by switching the comment
  42. # sign between the two different definitions.
  43.  
  44. #PLOTLIBRARY=-lplot
  45. PLOTLIBRARY=plotlib.o
  46.  
  47. BINARIES=map course station value symbol shade
  48.  
  49. GENOBJ=geoposi.o mercator.o linetype.o wincol.o 
  50.  
  51. MAPOBJ=map.o iniparms.o getargs.o setenv.o setup.o option.o border.o \
  52.        tic.o label.o comment.o frame.o gtermcap.o $(GENOBJ) $(PLOTLIBRARY)
  53.        
  54. SHADEOBJ=shade.o  minmax.o $(GENOBJ) $(PLOTLIBRARY)
  55.  
  56. STATIONOBJ=station.o  minmax.o $(GENOBJ) $(PLOTLIBRARY)
  57.            
  58. VALUEOBJ=value.o minmax.o $(GENOBJ) $(PLOTLIBRARY)
  59.         
  60. SYMBOLOBJ=symbol.o minmax.o $(GENOBJ) $(PLOTLIBRARY)
  61.         
  62. COURSEOBJ=course.o $(GENOBJ) $(PLOTLIBRARY)
  63.          
  64. OBJECTS=$(MAPOBJ) minmax.o shade.o station.o value.o symbol.o course.o
  65.         
  66. all : $(BINARIES)
  67.     touch all
  68.  
  69. map : $(MAPOBJ) 
  70.     cc    -o map $(MAPOBJ) $(LIBES) 
  71. $(MAPOBJ) : types.h 
  72.  
  73. shade: $(SHADEOBJ)  
  74.     cc   -o shade $(SHADEOBJ) $(LIBES) 
  75. $(SHADEOBJ) : types.h
  76.  
  77. station : $(STATIONOBJ) 
  78.     cc   -o station $(STATIONOBJ) $(LIBES) 
  79. $(STATIONOBJ) : types.h
  80.  
  81. value : $(VALUEOBJ) 
  82.     cc   -o value $(VALUEOBJ) $(LIBES) 
  83. $(VALUEOBJ) : types.h
  84.  
  85. symbol : $(SYMBOLOBJ) 
  86.     cc   -o symbol $(SYMBOLOBJ) $(LIBES) 
  87. $(SYMBOLOBJ) : types.h
  88.  
  89. course : $(COURSEOBJ) 
  90.     cc   -o course $(COURSEOBJ) $(LIBES) 
  91. $(COURSEOBJ) : types.h     
  92.  
  93. install : all
  94.     cp $(BINARIES) $(INSDIR)
  95.  
  96. clean :  
  97.     rm -f $(OBJECTS) $(BINARIES)
  98.  
  99.  
  100.  
  101.  
  102. @EOF
  103. set `wc -lwc <Map/Src/Makefile`
  104. if test $1$2$3 != 651541434
  105. then
  106.     echo ERROR: wc results of Map/Src/Makefile are $* should be 65 154 1434
  107. fi
  108.  
  109. chmod 777 Map/Src/Makefile
  110.  
  111. echo x - Map/Src/Makefile.old
  112. cat >Map/Src/Makefile.old <<'@EOF'
  113. all : map course station value symbol shade iceline
  114. map : map.o iniparms.o getargs.o setenv.o setup.o option.o border.o tic.o label.o comment.o frame.o geoposi.o mercator.o linetype.o gtermcap.o wincol.o
  115.     cc    -o map map.o iniparms.o getargs.o setenv.o setup.o option.o border.o tic.o label.o comment.o frame.o geoposi.o mercator.o linetype.o gtermcap.o wincol.o  -lm -lplot
  116. map.o  iniparms.o getargs.o setenv.o setup.o option.o border.o tic.o label.o comment.o frame.o geoposi.o mercator.o linetype.o gtermcap.o wincol.o : types.h
  117. shade : shade.o geoposi.o mercator.o linetype.o minmax.o wincol.o
  118.     cc   -o shade shade.o geoposi.o mercator.o linetype.o minmax.o wincol.o -lm -lplot
  119. shade.o geoposi.o mercator.o linetype.o minmax.o wincol.o : types.h
  120. station : station.o geoposi.o mercator.o linetype.o minmax.o wincol.o
  121.     cc   -o station station.o geoposi.o mercator.o linetype.o minmax.o wincol.o -lm -lplot
  122. station.o geoposi.o mercator.o linetype.o minmax.o wincol.o : types.h
  123. value : value.o geoposi.o mercator.o linetype.o minmax.o wincol.o
  124.     cc   -o value value.o geoposi.o mercator.o linetype.o minmax.o wincol.o -lm -lplot
  125. value.o geoposi.o mercator.o linetype.o minmax.o wincol.o : types.h
  126. symbol : symbol.o geoposi.o mercator.o linetype.o minmax.o wincol.o 
  127.     cc   -o symbol symbol.o geoposi.o mercator.o linetype.o minmax.o wincol.o -lm -lplot
  128. symbol.o geoposi.o mercator.o linetype.o minmax.o wincol.o : types.h
  129. course : course.o geoposi.o mercator.o linetype.o wincol.o 
  130.     cc   -o course course.o geoposi.o mercator.o linetype.o wincol.o -lm -lplot
  131. course.o geoposi.o mercator.o linetype.o wincol.o : types.h
  132. @EOF
  133. set `wc -lwc <Map/Src/Makefile.old`
  134. if test $1$2$3 != 191981618
  135. then
  136.     echo ERROR: wc results of Map/Src/Makefile.old are $* should be 19 198 1618
  137. fi
  138.  
  139. chmod 777 Map/Src/Makefile.old
  140.  
  141.  
  142. rm -f /tmp/uud$$
  143. (echo "begin 777 /tmp/uud$$\n \nend" | uudecode) >/dev/null 2>&1
  144. if [ -f /tmp/uud$$ ]
  145. then
  146.     rm -f /tmp/uud$$
  147.     unpacker=uudecode
  148. else
  149.     echo Compiling unpacker for non-ascii files
  150.     pwd=`pwd`; cd /tmp
  151.     cat >unpack$$.c <<-'EOF'
  152.     #include <stdio.h>
  153.     #define DEC(c)    (((c) - ' ') & 077)
  154.     main()
  155.     {
  156.         int n;
  157.         char dest[128], a,b,c,d;
  158.  
  159.         scanf("begin %o ", &n);
  160.         gets(dest);
  161.  
  162.         if (freopen(dest, "w", stdout) == NULL) {
  163.             perror(dest);
  164.             exit(1);
  165.         }
  166.  
  167.         while ((n=getchar()) != EOF && (n=DEC(n))!=0)  {
  168.             while (n>0) {
  169.                 a = DEC(getchar());
  170.                 b = DEC(getchar());
  171.                 c = DEC(getchar());
  172.                 d = DEC(getchar());
  173.                 if (n-- > 0) putchar(a << 2 | b >> 4);
  174.                 if (n-- > 0) putchar(b << 4 | c >> 2);
  175.                 if (n-- > 0) putchar(c << 6 | d);
  176.             }
  177.             n=getchar();
  178.         }
  179.         exit(0);
  180.     }
  181.     EOF
  182.     cc -o unpack$$ unpack$$.c
  183.     rm unpack$$.c
  184.     cd $pwd
  185.     unpacker=/tmp/unpack$$
  186. fi
  187.  
  188. echo x - Map/Src/axes.c '[non-ascii]'
  189. $unpacker <<'@eof'
  190. begin 777 Map/Src/axes.c
  191. M(VEN8VQU9&4@/&UA=&@N:#X*(VEN8VQU9&4@/'-T9&EO+F@^"@IM86EN*"D*
  192. M>PH):6YT"4D["@H)9&]U8FQE"4UE<F-A=&]R*"D["@H)9&]U8FQE"5!O:6YT
  193. M.PH)9&]U8FQE"41I<W1A;F-E.PH)9&]U8FQE"4)A<V5$:7-T86YC93L*"@ED
  194. M;W5B;&4)0F%S92 ](#8S+C P,#L*"61O=6)L90E4;W @(#T@-C@N,# P.PH*
  195. M"6]P96YP;"@I.PH)<W!A8V4H,"PP+#4P,"PU,# I.PH*"6UO=F4H,"PP*3L*
  196. M"6-O;G0H,"PT-3@I.PH)8V]N="@V.#0L-#4X*3L*"6-O;G0H-C@T+# I.PH)
  197. M8V]N="@P+# I.PH*"4)A<V5$:7-T86YC92 ]($UE<F-A=&]R*%1O<"DM365R
  198. M8V%T;W(H0F%S92D["@H)9F]R("A)(#T@," [($D@/" Q,2 [($DK*RD*"7L*
  199. M"0E0;VEN=#TH0F%S92LH22HP+C4I*3L*"0E$:7-T86YC93TH365R8V%T;W(H
  200. M4&]I;G0I+4UE<F-A=&]R*$)A<V4I*2]"87-E1&ES=&%N8V4["@D);6]V92@P
  201. M+"@H:6YT*2A$:7-T86YC92HT-3@I*2D["@D)8V]N="@T+"@H:6YT*2A$:7-T
  202. M86YC92HT-3@I*2D["@E]"@E"87-E1&ES=&%N8V4@/2 R."XP("T@,3 N,#L*
  203. M"69O<B H22 ](# @.R!)(#P@,C<@.R!)*RLI"@E["@D);6]V92@H22HS."DL
  204. M-#4X*3L*"0EC;VYT*"A)*C,X*2PT-30I.PH)?0H*"6-L;W-E<&PH*3L*"65X
  205. M:70H,"D["GT*"@ID;W5B;&4)365R8V%T;W(H4&]S:71I;VXI"F1O=6)L90E0
  206. M;W-I=&EO;CL*>PH)9&]U8FQE"5)A9"@I.PH)9&]U8FQE"4-O;G-T86YT(#T@
  207. M,"XP,3<T-3,S.PH)9&]U8FQE"49O=7)T>49I=F4@/2 T-2XP.PH*"7)E='5R
  208. M;BAL;V<Q,"AT86XH4F%D*$9O=7)T>49I=F4I*U)A9"A0;W-I=&EO;B\R+C I
  209. M*2DI.PI]"@H*9&]U8FQE"5)A9"A$96=R965S*0ID;W5B;&4)1&5G<F5E<SL*
  210. M>PH)9&]U8FQE"5!I(#T@,RXQ-#$U,SL*"@ER971U<FXH4&DJ*$1E9W)E97,O
  211. *,3@P+C I*3L*?5!I
  212.  
  213. end
  214. @eof
  215. set `wc -lwc <Map/Src/axes.c`
  216. if test $1$2$3 != 63100910
  217. then
  218.     echo ERROR: wc results of Map/Src/axes.c are $* should be 63 100 910
  219. fi
  220.  
  221. chmod 777 Map/Src/axes.c
  222.  
  223. echo x - Map/Src/border.c
  224. cat >Map/Src/border.c <<'@EOF'
  225. #include <stdio.h>
  226. #include "types.h"
  227.  
  228. double strtodouble();
  229.  
  230.  
  231. Border(ARE,GEO,BP)
  232.  
  233.  
  234.  TypOfSpaceDefinition     ARE;
  235.  TypOfGeographicalDefinition  GEO;
  236.  TypOfBorderParameters     BP;  
  237.  
  238.  {
  239.   FILE        *FPtr;
  240.  
  241.   TypOfDouble     Mercator();
  242.  
  243.   TypOfFloat     FactorX;
  244.   TypOfFloat     FactorY;
  245.  
  246.   TypOfInt      DeltaX;
  247.   TypOfInt      DeltaY;
  248.  
  249.   TypOfDouble     DeltaLongitude;
  250.   TypOfDouble     DeltaLatitude;
  251.  
  252.   TypOfDouble     Longitude;
  253.   TypOfDouble     Latitude;
  254.  
  255.   TypOfInt      PenPos;
  256.  
  257.   TypOfInt      X;
  258.   TypOfInt      Y;
  259.  
  260.   TypOfChar      StrLatitude[10];
  261.   TypOfChar      StrLongitude[10];
  262.  
  263.   TypOfDouble     GeoPosition();
  264.   
  265.   TypOfChar      InputLine[MAXTEXTLEN];
  266.   TypOfChar      HeaderLine[MAXTEXTLEN];
  267.  
  268.   TypOfChar      LineMode[15];
  269.  
  270.  
  271.   FPtr = fopen(BP.BorderDataFile,"r");
  272.   if(FPtr == NULL)
  273.   {
  274.    fprintf(stderr,"Error: Cannot open data file %s\n",BP.BorderDataFile);
  275.    exit(ERROR);
  276.   }
  277.   else
  278.   {
  279.    LineType(BP.BorderPattern/10,LineMode);
  280.    linemod(LineMode);
  281.    color(BP.BorderPattern%10);
  282.    window(ARE.MinX,ARE.MinY,ARE.MaxX,ARE.MaxY);
  283.  
  284.    DeltaX = ARE.MaxX - ARE.MinX;
  285.    DeltaLongitude = GEO.MaxLongitude - GEO.MinLongitude;
  286.    FactorX = DeltaX/DeltaLongitude;
  287.  
  288.    DeltaY = ARE.MaxY - ARE.MinY;
  289.    DeltaLatitude = Mercator(GEO.MaxLatitude) - Mercator(GEO.MinLatitude);
  290.    FactorY = DeltaY/DeltaLatitude;
  291.  
  292.    fgets(HeaderLine,MAXTEXTLEN,FPtr);
  293.    fgets(HeaderLine,MAXTEXTLEN,FPtr);
  294.  
  295.    if (fscanf(FPtr,"%s %s %d",StrLatitude,StrLongitude,&PenPos) != EOF)
  296.      {
  297.        if (StrLatitude[2] != '.')
  298.          {
  299.     Latitude = GeoPosition(StrLatitude);
  300.     Longitude = GeoPosition(StrLongitude);
  301.     
  302.     X = (FactorX*(GEO.MaxLongitude-Longitude))+ARE.MinX;
  303.     Y = (FactorY*(Mercator(Latitude)-Mercator(GEO.MinLatitude)))+ARE.MinY;
  304.  
  305.     if (PenPos == UP) move(X,Y); else cont(X,Y);
  306.  
  307.     while(fscanf(FPtr,"%s %s %d",StrLatitude,StrLongitude,&PenPos) != EOF)
  308.       {
  309.         Latitude = GeoPosition(StrLatitude);
  310.         Longitude = GeoPosition(StrLongitude);
  311.     
  312.         X = (FactorX*(GEO.MaxLongitude-Longitude))+ARE.MinX;
  313.         Y = (FactorY*(Mercator(Latitude)-Mercator(GEO.MinLatitude)))+ARE.MinY;
  314.         
  315.         if (PenPos == UP) move(X,Y); else cont(X,Y);
  316.       }
  317.          }
  318.        else
  319.          {
  320.     Latitude=strtodouble(StrLatitude);
  321.     Longitude=strtodouble(StrLongitude);
  322.     X = (FactorX*(GEO.MaxLongitude-Longitude))+ARE.MinX;
  323.     Y = (FactorY*(Mercator(Latitude)-Mercator(GEO.MinLatitude)))+ARE.MinY;
  324.  
  325.     if (PenPos == UP) move(X,Y); else cont(X,Y);          
  326.  
  327.     while(fscanf(FPtr,"%lf %lf %d",&Latitude,&Longitude,&PenPos) != EOF)
  328.       {
  329.         X = (FactorX*(GEO.MaxLongitude-Longitude))+ARE.MinX;
  330.         Y = (FactorY*(Mercator(Latitude)-Mercator(GEO.MinLatitude)))+ARE.MinY;
  331.  
  332.         if (PenPos == UP) move(X,Y); else cont(X,Y);
  333.       }
  334.          }
  335.      }
  336.   }
  337.   
  338.   fclose(FPtr);
  339.   fflush(stdout);
  340.  
  341.   return(OK);
  342.  }
  343.  
  344.  
  345. double strtodouble(s)
  346.      char s[];
  347. {
  348.   double val,power;
  349.   int i,sign;
  350.   for(i=0;s[i]==' ' || s[i]=='\n' || s[i]=='\t'; i++)  ;
  351.   sign=1;
  352.   if (s[i]=='+' || s[i]=='-')
  353.     sign= (s[i++]=='+') ? 1 : -1;
  354.   for (val=0;s[i]>='0' && s[i]<='9';i++)
  355.     val=10*val+s[i]-'0';
  356.   if (s[i]=='.')  i++;
  357.   for (power=1; s[i]>='0' && s[i]<='9'; i++)
  358.     {
  359.       val=10*val+s[i]-'0';
  360.       power *=10;
  361.     }
  362.   return (sign*val/power);
  363. }
  364. @EOF
  365. set `wc -lwc <Map/Src/border.c`
  366. if test $1$2$3 != 1392533297
  367. then
  368.     echo ERROR: wc results of Map/Src/border.c are $* should be 139 253 3297
  369. fi
  370.  
  371. chmod 777 Map/Src/border.c
  372.  
  373. echo x - Map/Src/box.c
  374. cat >Map/Src/box.c <<'@EOF'
  375. main()
  376. {
  377.     openpl();
  378.     space(0,0,500,500);
  379.     move(0,0);
  380.     cont(0,500);
  381.     cont(500,500);
  382.     cont(500,0);
  383.     cont(0,0);
  384.     move(250,250);
  385.     label("0123456789");
  386.     closepl();
  387.     exit(0);
  388. }    
  389. @EOF
  390. set `wc -lwc <Map/Src/box.c`
  391. if test $1$2$3 != 1414172
  392. then
  393.     echo ERROR: wc results of Map/Src/box.c are $* should be 14 14 172
  394. fi
  395.  
  396. chmod 777 Map/Src/box.c
  397.  
  398. echo x - Map/Src/comment.c
  399. cat >Map/Src/comment.c <<'@EOF'
  400. #include <stdio.h>
  401. #include "types.h"
  402.  
  403.  
  404. TypOfInt Comment(WIN,ARE,CHA,CP)
  405.  
  406.  TypOfSpaceDefinition       WIN;
  407.  TypOfSpaceDefinition       ARE;
  408.  TypOfFontDefinition        CHA;
  409.  TypOfCommentParameters      CP;
  410.  
  411.  {
  412.   TypOfInt            X;
  413.   TypOfInt            Y;
  414.  
  415.   TypOfInt            NumLines();
  416.   TypOfInt            LineCount;
  417.  
  418.   TypOfPtrToChar         ComLine();
  419.   TypOfChar            CommentLine[MAXTEXTLEN];
  420.  
  421.   TypOfChar              LineMode[15];
  422.  
  423.  
  424.   window(WIN.MinX-10,WIN.MinY-10,WIN.MaxX+10,WIN.MaxY+10);
  425.   LineType(CP.CommentPattern/10,LineMode);
  426.   linemod(LineMode);
  427.   color(CP.CommentPattern%10);
  428.  
  429.   for(LineCount = 1; LineCount <= NumLines(CP.CommentText); LineCount++)
  430.   {
  431.    strcpy(CommentLine,ComLine(CP.CommentText,LineCount));
  432.    X = ((WIN.MaxX-WIN.MinX)/2.0)-(CHA.CharWidth*(strlen(CommentLine)/2.0));
  433.    Y = ARE.MinY-((LineCount+1)*CHA.LineHeight);
  434.    move(X,Y);
  435.    label(CommentLine);
  436.   } 
  437.  
  438.   fflush(stdout);
  439.   return(OK);
  440.  }
  441.  
  442.  
  443. TypOfInt NumLines(Text)
  444.  
  445.  TypOfPtrToChar       Text;
  446.  {
  447.   TypOfInt         LineCount;
  448.   TypOfPtrToChar      LineIndex;
  449.  
  450.   LineIndex = Text;
  451.   LineCount = 1;
  452.  
  453.   while(index(LineIndex,LINEBREAK) != 0)
  454.   {
  455.    LineCount++;
  456.    LineIndex = index(LineIndex,LINEBREAK);
  457.    LineIndex++;
  458.   } 
  459.  
  460.   return(LineCount);
  461.  }
  462.  
  463.  
  464. TypOfPtrToChar ComLine(String,LineNumber)
  465.  
  466.  TypOfPtrToChar           String;
  467.  TypOfInt              LineNumber;
  468.  
  469.  {
  470.   TypOfInt             LineCount;
  471.   TypOfInt             NumLines();
  472.  
  473.   TypOfChar             WorkString[MAXTEXTLEN];
  474.  
  475.   TypOfPtrToChar          StrBegin;
  476.   TypOfPtrToChar          StrEnd;
  477.  
  478.   strcpy(WorkString,String);
  479.   StrBegin = WorkString;
  480.   StrEnd = index(WorkString,'\0');
  481.  
  482.   for(LineCount = 1; LineCount < LineNumber; LineCount++)
  483.   {
  484.    StrBegin = index(StrBegin,LINEBREAK);
  485.    StrBegin++;
  486.   }
  487.  
  488.   if(index(StrBegin,LINEBREAK) != 0) StrEnd = index(StrBegin,LINEBREAK);
  489.   *StrEnd = '\0';
  490.   strcpy(WorkString,StrBegin);
  491.   return(WorkString);
  492. }
  493. @EOF
  494. set `wc -lwc <Map/Src/comment.c`
  495. if test $1$2$3 != 931301924
  496. then
  497.     echo ERROR: wc results of Map/Src/comment.c are $* should be 93 130 1924
  498. fi
  499.  
  500. chmod 666 Map/Src/comment.c
  501.  
  502. echo x - Map/Src/compbmax.c '[non-ascii]'
  503. $unpacker <<'@eof'
  504. begin 777 Map/Src/compbmax.c
  505. M(VEN8VQU9&4@/'-T9&EO+F@^"B-I;F-L=61E(#QM871H+F@^"@IM86EN"2AA
  506. M<F=C+&%R9W8I"FEN= EA<F=C.PIC:&%R"2IA<F=V6UT["GL*"6EN= E).PH)
  507. M9&]U8FQE"51E;7 Q.PH)9&]U8FQE"51E;7 R.PH*"61O=6)L90E,36EN.PH)
  508. M9&]U8FQE"4Q-87@["@ED;W5B;&4)0DUI;CL*"61O=6)L90E"36%X.PH)9&]U
  509. M8FQE"4Q.=6T["@ED;W5B;&4)65-I>F5&86-T;W(["@H)9&]U8FQE"4UE<F-A
  510. M=&]R*"D["@ED;W5B;&4)26YV97)S94UE<F-A=&]R*"D["@H)<W-C86YF*&%R
  511. M9W9;,5TL(B5L9B(L)DQ-87@I.PH)<W-C86YF*&%R9W9;,ETL(B5L9B(L)D)-
  512. M:6XI.PH)<W-C86YF*&%R9W9;,UTL(B5L9B(L)DQ.=6TI.PH)<W-C86YF*&%R
  513. M9W9;-%TL(B5L9B(L)EE3:7IE1F%C=&]R*3L*"@E,36EN(#T@3$UA>"U,3G5M
  514. M.PH)5&5M<#$@/2!-97)C871O<B@H9&]U8FQE*2 Q+C I.PH)0DUA>" ]($EN
  515. M=F5R<V5-97)C871O<BA-97)C871O<BA"36EN*2M94VEZ949A8W1O<BI,3G5M
  516. M*E1E;7 Q*3L*"@EP<FEN=&8H(B5F("5F(%QN(BQ,36%X+$)-:6XI.PH)<')I
  517. M;G1F*"(E9B E9B!<;B(L3$UI;BQ"36%X*3L*"0H)97AI="@P*3L*?0H*"F1O
  518. M=6)L90E-97)C871O<BA0;W-I=&EO;BD*9&]U8FQE"5!O<VET:6]N.PI["@ED
  519. M;W5B;&4)4F%D:6%N<R@I.PH)9&]U8FQE"49O=7)T>49I=F4@/2 T-2XP.PH*
  520. M"7)E='5R;BAL;V<H=&%N*%)A9&EA;G,H1F]U<G1Y1FEV92DK4F%D:6%N<RA0
  521. M;W-I=&EO;B\R+C I*2DI.PI]"@H*9&]U8FQE"4EN=F5R<V5-97)C871O<BA9
  522. M3&]C871I;VXI"F1O=6)L90E93&]C871I;VX["GL*"61O=6)L90E$96=R965S
  523. M*"D["@ED;W5B;&4)1F]U<G1Y1FEV92 ](#0U+C ["@H)<F5T=7)N*#(N,"HH
  524. M1&5G<F5E<RAA=&%N*&5X<"A93&]C871I;VXI*2DM1F]U<G1Y1FEV92DI.PI]
  525. M"@H*9&]U8FQE"5)A9&EA;G,H1&5G<F5E<RD*9&]U8FQE"41E9W)E97,["GL*
  526. M"61O=6)L90E0:2 ](#,N,30Q-3D["@H)<F5T=7)N*%!I*BA$96=R965S+S$X
  527. M,"XP*2D["GT*"@ID;W5B;&4)1&5G<F5E<RA2861I86YS*0ID;W5B;&4)4F%D
  528. M:6%N<SL*>PH)9&]U8FQE"5!I(#T@,RXQ-#$U.3L*"@ER971U<FXH,3@P+C J
  529. 0*%)A9&EA;G,O4&DI*3L*?5!I
  530.  
  531. end
  532. @eof
  533. set `wc -lwc <Map/Src/compbmax.c`
  534. if test $1$2$3 != 721031096
  535. then
  536.     echo ERROR: wc results of Map/Src/compbmax.c are $* should be 72 103 1096
  537. fi
  538.  
  539. chmod 777 Map/Src/compbmax.c
  540.  
  541. echo x - Map/Src/complmax.c '[non-ascii]'
  542. $unpacker <<'@eof'
  543. begin 777 Map/Src/complmax.c
  544. M(VEN8VQU9&4@/'-T9&EO+F@^"B-I;F-L=61E(#QM871H+F@^"@IM86EN"2AA
  545. M<F=C+&%R9W8I"FEN= EA<F=C.PIC:&%R"2IA<F=V6UT["GL*"6EN= E).PH)
  546. M9&]U8FQE"51E;7 Q.PH)9&]U8FQE"51E;7 R.PH*"61O=6)L90E,36EN.PH)
  547. M9&]U8FQE"4Q-87@["@ED;W5B;&4)0DUI;CL*"61O=6)L90E"36%X.PH)9&]U
  548. M8FQE"4).=6T["@ED;W5B;&4)65-I>F5&86-T;W(["@H)9&]U8FQE"4UE<F-A
  549. M=&]R*"D["@ED;W5B;&4)26YV97)S94UE<F-A=&]R*"D["@H)<W-C86YF*&%R
  550. M9W9;,5TL(B5L9B(L)DQ-:6XI.PH)<W-C86YF*&%R9W9;,ETL(B5L9B(L)D)-
  551. M:6XI.PH)<W-C86YF*&%R9W9;,UTL(B5L9B(L)D).=6TI.PH)<W-C86YF*&%R
  552. M9W9;-%TL(B5L9B(L)EE3:7IE1F%C=&]R*3L*"@E,36EN(#T@3$UA>"U,3G5M
  553. M.PH)5&5M<#$@/2!-97)C871O<B@H9&]U8FQE*2 Q+C I.PH)0DUA>" ]($EN
  554. M=F5R<V5-97)C871O<BA-97)C871O<BA"36EN*2M94VEZ949A8W1O<BI,3G5M
  555. M*E1E;7 Q*3L*"@EP<FEN=&8H(B5F("5F(%QN(BQ,36%X+$)-:6XI.PH)<')I
  556. M;G1F*"(E9B E9B!<;B(L3$UI;BQ"36%X*3L*"0H)97AI="@P*3L*?0H*"F1O
  557. M=6)L90E-97)C871O<BA0;W-I=&EO;BD*9&]U8FQE"5!O<VET:6]N.PI["@ED
  558. M;W5B;&4)4F%D:6%N<R@I.PH)9&]U8FQE"49O=7)T>49I=F4@/2 T-2XP.PH*
  559. M"7)E='5R;BAL;V<H=&%N*%)A9&EA;G,H1F]U<G1Y1FEV92DK4F%D:6%N<RA0
  560. M;W-I=&EO;B\R+C I*2DI.PI]"@H*9&]U8FQE"4EN=F5R<V5-97)C871O<BA9
  561. M3&]C871I;VXI"F1O=6)L90E93&]C871I;VX["GL*"61O=6)L90E$96=R965S
  562. M*"D["@ED;W5B;&4)1F]U<G1Y1FEV92 ](#0U+C ["@H)<F5T=7)N*#(N,"HH
  563. M1&5G<F5E<RAA=&%N*&5X<"A93&]C871I;VXI*2DM1F]U<G1Y1FEV92DI.PI]
  564. M"@H*9&]U8FQE"5)A9&EA;G,H1&5G<F5E<RD*9&]U8FQE"41E9W)E97,["GL*
  565. M"61O=6)L90E0:2 ](#,N,30Q-3D["@H)<F5T=7)N*%!I*BA$96=R965S+S$X
  566. M,"XP*2D["GT*"@ID;W5B;&4)1&5G<F5E<RA2861I86YS*0ID;W5B;&4)4F%D
  567. M:6%N<SL*>PH)9&]U8FQE"5!I(#T@,RXQ-#$U.3L*"@ER971U<FXH,3@P+C J
  568. 0*%)A9&EA;G,O4&DI*3L*?5!I
  569.  
  570. end
  571. @eof
  572. set `wc -lwc <Map/Src/complmax.c`
  573. if test $1$2$3 != 721031096
  574. then
  575.     echo ERROR: wc results of Map/Src/complmax.c are $* should be 72 103 1096
  576. fi
  577.  
  578. chmod 777 Map/Src/complmax.c
  579.  
  580. echo x - Map/Src/convert.c
  581. cat >Map/Src/convert.c <<'@EOF'
  582. #include <stdio.h>
  583.  
  584. main()
  585. {
  586.     int    Pen = 1;
  587.     int    Old = 0;
  588.     double    X,Y;
  589.  
  590.     while(scanf("%lf %lf %d",&X,&Y,&Pen) != EOF)
  591.     {
  592.         if (Old == 0) printf("%f %f %d \n",X,Y,Old);
  593.         else if (Pen != 0) printf("%f %f %d \n",X,Y,Pen);
  594.         Old = Pen;
  595.     }
  596.     exit(0);
  597. }
  598. @EOF
  599. set `wc -lwc <Map/Src/convert.c`
  600. if test $1$2$3 != 1643247
  601. then
  602.     echo ERROR: wc results of Map/Src/convert.c are $* should be 16 43 247
  603. fi
  604.  
  605. chmod 777 Map/Src/convert.c
  606.  
  607. echo x - Map/Src/course.c
  608. cat >Map/Src/course.c <<'@EOF'
  609. #include <stdio.h>
  610. #include "types.h"
  611.  
  612. main(ArgC,ArgV)
  613.  
  614.  TypOfInt         ArgC;
  615.  TypOfPtrToChar      ArgV[];
  616.  
  617.  {
  618.   TypOfSpaceDefinition        WOR;
  619.   TypOfSpaceDefinition        WIN;
  620.   TypOfSpaceDefinition        ARE;
  621.   TypOfFontDefinition         CHA;
  622.   TypOfGeographicalDefinition     GEO;
  623.   TypOfInt              PAT;
  624.  
  625.   TypOfDouble     Mercator();
  626.  
  627.  
  628.   TypOfFloat     FactorX;
  629.   TypOfFloat     FactorY;
  630.  
  631.   TypOfInt      DeltaX;
  632.   TypOfInt      DeltaY;
  633.  
  634.   TypOfDouble     DeltaLongitude;
  635.   TypOfDouble     DeltaLatitude;
  636.  
  637.   TypOfDouble     Longitude;
  638.   TypOfDouble     Latitude;
  639.  
  640.   TypOfInt      X;
  641.   TypOfInt      Y;
  642.  
  643.   TypOfChar      InputLine[MAXTEXTLEN];
  644.  
  645.   TypOfChar      StrLatitude[10];
  646.   TypOfChar      StrLongitude[10];
  647.  
  648.   TypOfDouble     GeoPosition();
  649.   TypOfChar       LineMode[15];
  650.  
  651.  
  652.   GetArguments(ArgC,ArgV,&WOR,&WIN,&ARE,&CHA,&GEO,&PAT);
  653.  
  654.   window(ARE.MinX,ARE.MinY,ARE.MaxX,ARE.MaxY);
  655.   LineType(PAT/10,LineMode);
  656.   linemod(LineMode);
  657.   color(PAT%10);
  658.  
  659.   DeltaX = ARE.MaxX - ARE.MinX;
  660.   DeltaLongitude = GEO.MaxLongitude - GEO.MinLongitude;
  661.   FactorX = DeltaX/DeltaLongitude;
  662.  
  663.   DeltaY = ARE.MaxY - ARE.MinY;
  664.   DeltaLatitude = Mercator(GEO.MaxLatitude) - Mercator(GEO.MinLatitude);
  665.   FactorY = DeltaY/DeltaLatitude;
  666.  
  667.   gets(InputLine);
  668.   gets(InputLine); 
  669.   if(gets(InputLine) == NULL)
  670.   {
  671.    fprintf(stderr,"Error: Input file for \"course\" is empty\n");   
  672.    exit(ERROR);
  673.   }
  674.   else
  675.   {
  676.    sscanf(InputLine,"%s %s",StrLatitude,StrLongitude);
  677.    Latitude = GeoPosition(StrLatitude);
  678.    Longitude = GeoPosition(StrLongitude);
  679.  
  680.    X = (FactorX*(GEO.MaxLongitude-Longitude))+ARE.MinX;
  681.    Y = (FactorY*(Mercator(Latitude)-Mercator(GEO.MinLatitude)))+ARE.MinY;
  682.  
  683.    move(X,Y);
  684.    
  685.    while(gets(InputLine) != NULL)
  686.    {
  687.     sscanf(InputLine,"%s %s",StrLatitude,StrLongitude);
  688.     Latitude = GeoPosition(StrLatitude);
  689.     Longitude = GeoPosition(StrLongitude);
  690.  
  691.     X = (FactorX*(GEO.MaxLongitude-Longitude))+ARE.MinX;
  692.     Y = (FactorY*(Mercator(Latitude)-Mercator(GEO.MinLatitude)))+ARE.MinY;
  693.    
  694.     cont(X,Y);
  695.    }
  696.   }
  697.   
  698.   fflush(stdout);
  699.   exit(OK);
  700.  }
  701.  
  702.  
  703. TypOfInt GetArguments(ArgC,ArgV,WOR,WIN,ARE,CHA,GEO,PAT)
  704.  
  705.  TypOfInt              ArgC;
  706.  TypOfPtrToChar           ArgV[];
  707.  
  708.  TypOfSpaceDefinition        *WOR;
  709.  TypOfSpaceDefinition        *WIN;
  710.  TypOfSpaceDefinition        *ARE;
  711.  TypOfFontDefinition         *CHA;
  712.  TypOfGeographicalDefinition     *GEO;
  713.  TypOfInt              *PAT;
  714.  
  715.  {
  716.   sscanf(ArgV[1],"%d",&((*WOR).MinX));
  717.   sscanf(ArgV[2],"%d",&((*WOR).MaxX));
  718.   sscanf(ArgV[3],"%d",&((*WOR).MinY));
  719.   sscanf(ArgV[4],"%d",&((*WOR).MaxY));
  720.  
  721.   sscanf(ArgV[5],"%d",&((*WIN).MinX));
  722.   sscanf(ArgV[6],"%d",&((*WIN).MaxX));
  723.   sscanf(ArgV[7],"%d",&((*WIN).MinY));
  724.   sscanf(ArgV[8],"%d",&((*WIN).MaxY));
  725.  
  726.   sscanf(ArgV[9],"%d",&((*ARE).MinX));
  727.   sscanf(ArgV[10],"%d",&((*ARE).MaxX));
  728.   sscanf(ArgV[11],"%d",&((*ARE).MinY));
  729.   sscanf(ArgV[12],"%d",&((*ARE).MaxY));
  730.  
  731.   sscanf(ArgV[13],"%d",&((*CHA).CharWidth));
  732.   sscanf(ArgV[14],"%d",&((*CHA).CharHeight));
  733.   sscanf(ArgV[15],"%d",&((*CHA).LineHeight));
  734.  
  735.   sscanf(ArgV[16],"%lf",&((*GEO).MinLongitude));
  736.   sscanf(ArgV[17],"%lf",&((*GEO).MaxLongitude));
  737.   sscanf(ArgV[18],"%lf",&((*GEO).MinLatitude));
  738.   sscanf(ArgV[19],"%lf",&((*GEO).MaxLatitude));
  739.  
  740.   sscanf(ArgV[20],"%d",PAT);
  741.  
  742.   return;
  743.  }
  744. @EOF
  745. set `wc -lwc <Map/Src/course.c`
  746. if test $1$2$3 != 1351823266
  747. then
  748.     echo ERROR: wc results of Map/Src/course.c are $* should be 135 182 3266
  749. fi
  750.  
  751. chmod 777 Map/Src/course.c
  752.  
  753. echo x - Map/Src/degtoddmmss.c
  754. cat >Map/Src/degtoddmmss.c <<'@EOF'
  755.  
  756. #include <stdio.h>
  757. #include "types.h"
  758.  
  759. main()
  760. {
  761.     TypOfInt                Pen;
  762.     TypOfDouble            Latitude;
  763.     TypOfDouble            Longitude;
  764.  
  765.     TypOfInt                dd;
  766.     TypOfInt                mm;
  767.     TypOfInt                ss;
  768.  
  769.  
  770.     while(scanf("%lf %lf %d",&Longitude,&Latitude,&Pen) != EOF)
  771.     {
  772.         dd = Latitude;
  773.         Latitude = Latitude-((int) Latitude);
  774.  
  775.         mm = Latitude*100*0.6;
  776.         Latitude = (Latitude*100)-((int) (Latitude*100));
  777.  
  778.         ss = Latitude*100*0.6;
  779.         printf("%02d%02d%02d    ",dd,mm,ss);
  780.  
  781.         dd = Longitude;
  782.         Longitude = Longitude-((int) Longitude);
  783.  
  784.         mm = Longitude*100*0.6;
  785.         Longitude = (Longitude*100)-((int) (Longitude*100));
  786.  
  787.         ss = Longitude*100*0.6;
  788.         printf("%02d%02d%02d    ",dd,mm,ss);
  789.  
  790.         printf("%d\n",Pen);
  791.  
  792.     }
  793.  
  794. }
  795. @EOF
  796. set `wc -lwc <Map/Src/degtoddmmss.c`
  797. if test $1$2$3 != 4065670
  798. then
  799.     echo ERROR: wc results of Map/Src/degtoddmmss.c are $* should be 40 65 670
  800. fi
  801.  
  802. chmod 777 Map/Src/degtoddmmss.c
  803.  
  804. echo x - Map/Src/draw.c '[non-ascii]'
  805. $unpacker <<'@eof'
  806. begin 777 Map/Src/draw.c
  807. M(VEN8VQU9&4@/'-T9&EO+F@^"@IM86EN*"D*>PH):6YT"5@["@EI;G0)63L*
  808. M"6EN= E836EN(#T@,#L*"6EN= E936EN(#T@,#L*"6EN= E836%X(#T@-3 P
  809. M.PH):6YT"5E-87@@/2 U,# ["@H):6YT"5!E;CL*"@EF;&]A= E84V-A;&4@
  810. M/2 Q+C0R.PH)9FQO870)65-C86QE(#T@,2XP,#L*"@ED;W5B;&4)6$-O;W)D
  811. M:6YA=&4["@ED;W5B;&4)64-O;W)D:6YA=&4["@H);W!E;G!L*"D["@EE<F%S
  812. M92@I.PH)<W!A8V4H,"PP+#4P,"PU,# I.PH);6]V92@Q+#$I.PH)8V]N="@Q
  813. M+#0W-2D["@EC;VYT*#8Y-2PT-S4I.PH)8V]N="@V.34L,2D["@EC;VYT*#$L
  814. M,2D["@H)=VAI;&4H<V-A;F8H(B5L9B E;&8@)60B+"980V]O<F1I;F%T92PF
  815. M64-O;W)D:6YA=&4L)E!E;BD@(3T@14]&*0H)>PH)"5@@/2!80V]O<F1I;F%T
  816. M92HV.30K,3L*"0E9(#T@64-O;W)D:6YA=&4J-#<T*S$["@D):68@*%!E;B ]
  817. M/2 @,"D@;6]V92A8+%DI.PH)"65L<V4@8V]N="A8+%DI.PH)?0H*"6-L;W-E
  818. 1<&PH*3L*"65X:70H,"D["GT)
  819.  
  820. end
  821. @eof
  822. set `wc -lwc <Map/Src/draw.c`
  823. if test $1$2$3 != 3869512
  824. then
  825.     echo ERROR: wc results of Map/Src/draw.c are $* should be 38 69 512
  826. fi
  827.  
  828. chmod 777 Map/Src/draw.c
  829.  
  830. echo x - Map/Src/frame.c
  831. sed 's/^@//' >Map/Src/frame.c <<'@EOF'
  832. #include <stdio.h>
  833. #include "types.h"
  834.  
  835. Frame(WIN,FP)
  836.  
  837.  TypOfSpaceDefinition     WIN;
  838.  TypOfFrameParameters     FP;
  839.  
  840.  {
  841.   TypOfChar            LineMode[15];
  842.  
  843.   move(0,0);  
  844.   LineType(FP.FramePattern/10,LineMode);
  845.   linemod(LineMode);
  846.   color(FP.FramePattern%10);
  847.   window(WIN.MinX-10,WIN.MinY-10,WIN.MaxX+10,WIN.MaxY+10);
  848.   box(WIN.MinX,WIN.MinY,WIN.MaxX,WIN.MaxY);
  849.   move(0,0);
  850.   
  851.   return(OK);
  852.  } 
  853. @EOF
  854. set `wc -lwc <Map/Src/frame.c`
  855. if test $1$2$3 != 2121400
  856. then
  857.     echo ERROR: wc results of Map/Src/frame.c are $* should be 21 21 400
  858. fi
  859.  
  860. chmod 777 Map/Src/frame.c
  861.  
  862. echo x - Map/Src/geoposi.c
  863. cat >Map/Src/geoposi.c <<'@EOF'
  864. #include <stdio.h>
  865. #include "types.h"
  866.  
  867.  
  868. TypOfDouble GeoPosition(String)
  869.  
  870.     TypOfPtrToChar                        String;
  871.  
  872.     {
  873.         TypOfInt                                Degrees;
  874.         TypOfInt                                Minutes;
  875.         TypOfInt                                Seconds;
  876.  
  877.         sscanf(String,"%2d%2d%2d",&Degrees,&Minutes,&Seconds);
  878.  
  879.         return(Degrees+(Minutes/60.0)+(Seconds/3600.0));
  880.     }
  881. @EOF
  882. set `wc -lwc <Map/Src/geoposi.c`
  883. if test $1$2$3 != 1718300
  884. then
  885.     echo ERROR: wc results of Map/Src/geoposi.c are $* should be 17 18 300
  886. fi
  887.  
  888. chmod 777 Map/Src/geoposi.c
  889.  
  890. echo x - Map/Src/getargs.c
  891. cat >Map/Src/getargs.c <<'@EOF'
  892. #include <stdio.h>
  893. #include "types.h"
  894.  
  895. TypOfInt GetArguments(ArgC,ArgV,EP,MP,OP,BP,TP,LP,CP,FP)
  896.  
  897.     TypOfInt                                ArgC;
  898.     TypOfPtrToChar                                ArgV[];
  899.  
  900.     TypOfEnvironmentParameters        *EP;
  901.     TypOfMapParameters                        *MP;
  902.     TypOfOptionParameters                    *OP;
  903.     TypOfBorderParameters                    *BP;
  904.     TypOfTicParameters                        *TP;
  905.     TypOfLabelParameters                    *LP;
  906.     TypOfCommentParameters                *CP;
  907.     TypOfFrameParameters                    *FP;
  908.     
  909.     {
  910.         TypOfInt        ArgN;
  911.  
  912.         ArgC--;
  913.         ArgN = 1;
  914.         while(ArgN <= ArgC)
  915.         {
  916.             switch(ArgV[ArgN][1])
  917.             {
  918.                 case 'r':    GetRegionArguments(ArgV,&ArgN,EP);
  919.                                     break;
  920.  
  921.                 case 'b': GetBorderArguments(ArgV,&ArgN,MP,BP);
  922.                                     break;
  923.  
  924.                 case 't':    GetTicArguments(ArgV,&ArgN,MP,TP);
  925.                                     break;
  926.  
  927.                 case 'l':    GetLabelArguments(ArgV,&ArgN,MP,LP);
  928.                                     break;
  929.  
  930.                 case 'o':    GetOptionArguments(ArgV,&ArgN,MP,OP);
  931.                                     break;
  932.  
  933.                 case 'w':    GetWindowArguments(ArgV,&ArgN,EP);
  934.                                     break;
  935.  
  936.                 case 'e':    GetEraseArguments(MP);
  937.                                     break;
  938.  
  939.                 case 'f':    GetFrameArguments(MP);
  940.                                     break;
  941.  
  942.                 case 'c':    GetCommentArguments(ArgV,&ArgN,MP,CP);
  943.                                   break;
  944.  
  945.                 case 'p':    GetPatternArguments(ArgV,&ArgN,OP,BP,TP,LP,CP,FP);
  946.                                     break;
  947.  
  948.             }
  949.             ArgN++;
  950.         } 
  951.         return;
  952.     }
  953.  
  954.  
  955. TypOfInt GetRegionArguments(ArgV,ArgN,EP)
  956.  
  957.     TypOfPtrToChar                                    ArgV[];
  958.     TypOfInt                                    *ArgN;
  959.  
  960.     TypOfEnvironmentParameters                *EP;
  961.  
  962.     {
  963.         TypOfDouble            GeoPosition();
  964.     
  965.         (*ArgN)++;
  966.         (*EP).EnvMinLatitude = GeoPosition(ArgV[*ArgN]);
  967.  
  968.         (*ArgN)++;
  969.         (*EP).EnvMaxLatitude = GeoPosition(ArgV[*ArgN]);
  970.  
  971.         (*ArgN)++;
  972.         (*EP).EnvMinLongitude = GeoPosition(ArgV[*ArgN]);
  973.  
  974.         (*ArgN)++;
  975.         (*EP).EnvMaxLongitude = GeoPosition(ArgV[*ArgN]);
  976.  
  977.         return;
  978.     }
  979.  
  980.  
  981. TypOfInt GetOptionArguments(ArgV,ArgN,MP,OP)
  982.  
  983.     TypOfPtrToChar                                    ArgV[];
  984.     TypOfInt                                                *ArgN;
  985.  
  986.     TypOfMapParameters                            *MP;
  987.     TypOfOptionParameters                        *OP;    
  988.  
  989.     {
  990.         TypOfPtrToChar                            NewNodePtr;
  991.  
  992.  
  993.         (*MP).OptionSelected = YES;
  994.  
  995.         NewNodePtr = malloc(sizeof(TypOfNodeForOptionParameters));
  996.  
  997.         if((*OP).CountOfOptionList == 0)
  998.         {
  999.             (*OP).HeadOfOptionList = NewNodePtr;
  1000.             (*OP).TailOfOptionList = NewNodePtr;
  1001.         }
  1002.         else
  1003.         {
  1004.             (*(*OP).TailOfOptionList).OptionNextPointer = NewNodePtr;
  1005.             (*OP).TailOfOptionList = NewNodePtr;
  1006.         }
  1007.             
  1008.         ((*OP).CountOfOptionList)++;
  1009.  
  1010.         (*ArgN)++;
  1011.         sscanf(ArgV[*ArgN],"%s",(*(*OP).TailOfOptionList).OptionName);
  1012.  
  1013.         (*ArgN)++;
  1014.         strcpy((*(*OP).TailOfOptionList).OptionArgumentString,ArgV[*ArgN]);
  1015.  
  1016.         (*(*OP).TailOfOptionList).OptionPattern = (*OP).DefaultOptionPattern;
  1017.  
  1018.         (*(*OP).TailOfOptionList).OptionNextPointer = NULL;
  1019.  
  1020.         return;
  1021.     }
  1022.  
  1023.  
  1024. TypOfInt GetBorderArguments(ArgV,ArgN,MP,BP)
  1025.  
  1026.     TypOfPtrToChar                                    ArgV[];
  1027.     TypOfInt                                                *ArgN;
  1028.  
  1029.     TypOfMapParameters                            *MP;
  1030.     TypOfBorderParameters                        *BP;
  1031.  
  1032.     {
  1033.         (*MP).BorderSelected = YES;
  1034.         
  1035.         (*ArgN)++;
  1036.         strcpy((*BP).BorderDataFile,ArgV[*ArgN]);
  1037.  
  1038.         return;
  1039.     }
  1040.  
  1041.                 
  1042. TypOfInt GetTicArguments(ArgV,ArgN,MP,TP)
  1043.  
  1044.     TypOfPtrToChar                                    ArgV[];
  1045.     TypOfInt                                                *ArgN;
  1046.  
  1047.     TypOfMapParameters                            *MP;
  1048.     TypOfTicParameters                            *TP;    
  1049.  
  1050.     {
  1051.         TypOfDouble                                        GeoPosition();
  1052.  
  1053.         (*MP).TicSelected = YES;
  1054.  
  1055.         (*ArgN)++;
  1056.         (*TP).TicLatitudinalIncrement = GeoPosition(ArgV[*ArgN]);
  1057.         
  1058.         (*ArgN)++;
  1059.         (*TP).TicLongitudinalIncrement = GeoPosition(ArgV[*ArgN]);
  1060.  
  1061.         return;
  1062.     }
  1063.  
  1064.  
  1065. TypOfInt GetLabelArguments(ArgV,ArgN,MP,LP)
  1066.  
  1067.     TypOfPtrToChar                                    ArgV[];
  1068.     TypOfInt                        *ArgN;
  1069.  
  1070.     TypOfMapParameters                            *MP;
  1071.     TypOfLabelParameters                        *LP;
  1072.     
  1073.     {
  1074.         TypOfDouble                            GeoPosition();
  1075.  
  1076.         (*MP).LabelSelected = YES;
  1077.  
  1078.         (*ArgN)++;
  1079.         (*LP).LabelLatitudinalInterval = GeoPosition(ArgV[*ArgN]);
  1080.  
  1081.         (*ArgN)++;
  1082.         (*LP).LabelLongitudinalInterval = GeoPosition(ArgV[*ArgN]);
  1083.  
  1084.         return;    
  1085.     }
  1086.  
  1087.  
  1088. TypOfInt GetCommentArguments(ArgV,ArgN,MP,CP)
  1089.  
  1090.     TypOfPtrToChar                                        ArgV[];
  1091.     TypOfInt                                                    *ArgN;
  1092.  
  1093.     TypOfMapParameters                                *MP;
  1094.     TypOfCommentParameters                        *CP;    
  1095.  
  1096.     {
  1097.         (*MP).CommentSelected = YES;
  1098.  
  1099.         (*ArgN)++;
  1100.         strcpy((*CP).CommentText,ArgV[*ArgN]);
  1101.  
  1102.         return;
  1103.     }
  1104.  
  1105.  
  1106. TypOfInt GetWindowArguments(ArgV,ArgN,EP)
  1107.  
  1108.     TypOfPtrToChar                                    ArgV[];
  1109.     TypOfInt                                                *ArgN;
  1110.  
  1111.     TypOfEnvironmentParameters            *EP;
  1112.  
  1113.     {
  1114.  
  1115.         (*ArgN)++;
  1116.         sscanf(ArgV[*ArgN],"%f",&((*EP).EnvMinX));
  1117.  
  1118.         (*ArgN)++;
  1119.         sscanf(ArgV[*ArgN],"%f",&((*EP).EnvMaxX));
  1120.  
  1121.         (*ArgN)++;
  1122.         sscanf(ArgV[*ArgN],"%f",&((*EP).EnvMinY));
  1123.  
  1124.         (*ArgN)++;
  1125.         sscanf(ArgV[*ArgN],"%f",&((*EP).EnvMaxY));
  1126.  
  1127.         return;
  1128.     }
  1129.  
  1130.  
  1131. TypOfInt GetEraseArguments(MP)
  1132.  
  1133.     TypOfMapParameters                        *MP;
  1134.  
  1135.     {
  1136.         (*MP).EraseSelected = YES;
  1137.  
  1138.         return;
  1139.     }
  1140.  
  1141.     
  1142. TypOfInt GetFrameArguments(MP)
  1143.  
  1144.     TypOfMapParameters                        *MP;
  1145.  
  1146.     {
  1147.         (*MP).FrameSelected = YES;
  1148.  
  1149.         return;
  1150.     }
  1151.  
  1152.  
  1153. TypOfInt GetPatternArguments(ArgV,ArgN,OP,BP,TP,LP,CP,FP)
  1154.  
  1155.     TypOfPtrToChar                                    ArgV[];
  1156.     TypOfInt                                                *ArgN;
  1157.  
  1158.     TypOfOptionParameters                        *OP;
  1159.     TypOfBorderParameters                        *BP;
  1160.     TypOfTicParameters                            *TP;
  1161.     TypOfLabelParameters                        *LP;
  1162.     TypOfCommentParameters                    *CP;
  1163.     TypOfFrameParameters                        *FP;    
  1164.  
  1165.     {
  1166.         switch(ArgV[*ArgN][2])
  1167.         {
  1168.             case 'o':    (*ArgN)++;
  1169.                                 sscanf(ArgV[*ArgN],"%d",&((*OP).DefaultOptionPattern));
  1170.                                 break;
  1171.  
  1172.             case 'b':    (*ArgN)++;
  1173.                                 sscanf(ArgV[*ArgN],"%d",&((*BP).BorderPattern));
  1174.                                 break;
  1175.  
  1176.             case 't':    (*ArgN)++;
  1177.                                 sscanf(ArgV[*ArgN],"%d",&((*TP).TicPattern));
  1178.                                 break;
  1179.  
  1180.             case 'l':    (*ArgN)++;
  1181.                                 sscanf(ArgV[*ArgN],"%d",&((*LP).LabelPattern));
  1182.                                 break;
  1183.  
  1184.             case 'c': (*ArgN)++;
  1185.                                 sscanf(ArgV[*ArgN],"%d",&((*CP).CommentPattern));
  1186.                                 break;
  1187.  
  1188.             case 'f':    (*ArgN)++;
  1189.                                 sscanf(ArgV[*ArgN],"%d",&((*FP).FramePattern));
  1190.                                 break;
  1191.  
  1192.         }
  1193.  
  1194.         return;
  1195.     }
  1196.  
  1197.  
  1198. /* TypOfDouble GeoPosition(String)
  1199.  
  1200.     TypOfPtrToChar                        String;
  1201.  
  1202.     {
  1203.         TypOfInt                                Degrees;
  1204.         TypOfInt                                Minutes;
  1205.         TypOfInt                                Seconds;
  1206.  
  1207.         sscanf(String,"%2d%2d%2d",&Degrees,&Minutes,&Seconds);
  1208.  
  1209.         return(Degrees+(Minutes/60.0)+(Seconds/3600.0));
  1210.     }
  1211.  
  1212. */
  1213. @EOF
  1214. set `wc -lwc <Map/Src/getargs.c`
  1215. if test $1$2$3 != 3213625756
  1216. then
  1217.     echo ERROR: wc results of Map/Src/getargs.c are $* should be 321 362 5756
  1218. fi
  1219.  
  1220. chmod 777 Map/Src/getargs.c
  1221.  
  1222. echo x - Map/Src/gtermcap '[non-ascii]'
  1223. $unpacker <<'@eof'
  1224. begin 777 Map/Src/gtermcap
  1225. M:61S?" Z8W<].2 Z8V@],3 @.FQH/3$X(#IM=STW.3D@.G-W/38S.2 Z<V@]
  1226. M-C,Y(#IS=#TQ(#IF;#TQ(#IC;#TP(#HA"F5P<WP@.F-W/3D@.F-H/3$P(#IL
  1227. M:#TQ." Z;7<]-S$Y(#IS=STU.3D@.G-H/30W.2 Z<W0],2 Z9FP],2 Z8VP]
  1228. M," Z(0ID96-\(#IC=STY(#IC:#TQ," Z;&@],3@@.FUW/38S.2 Z<W<]-#@P
  1229. M(#IS:#TY-3D@.G-T/3$@.F9L/3$@.F-L/3 @.B$*-# Q-'P@.F-W/34S(#IC
  1230. M:#TU.2 Z;&@]-S@@.FUW/30P-38@.G-W/3,Q,C @.G-H/3,Q,C @.G-T/3$@
  1231. M.F9L/3 @.F-L/3 @.B$*<&-\(#IC=STX(#IC:#TX(#IL:#TQ," Z;7<]-C(P
  1232. M(#IS=STT.# @.G-H/3(P," Z<W0],2 Z9FP],2 Z8VP]," Z(0IC<&-\(#IC
  1233. M=STX(#IC:#TX(#IL:#TQ," Z;7<],S$P(#IS=STR-# @.G-H/3(P," Z<W0]
  1234. M,2 Z9FP],2 Z8VP],2 Z(0IG;V=O?" Z8W<],30@.F-H/3(T(#IL:#TS," Z
  1235. M;7<],3 R,R Z<W<]-3$R(#IS:#TU,3(@.G-T/3$@.F9L/3$@.F-L/3 @.B$*
  1236. M<')O?" Z8W<],3(@.F-H/3<@.FQH/3$P(#IM=STY-C @.G-W/38T," Z<V@]
  1237. M,C,Y(#IS=#TQ(#IF;#TQ(#IC;#TP(#HA"F-P<F]\(#IC=STQ,B Z8V@]-R Z
  1238. M;&@],3 @.FUW/3DV," Z<W<]-C0P(#IS:#TR,SD@.G-T/3$@.F9L/3$@.F-L
  1239. M/3$@.B$*:'!\(#IC=STX(#IC:#TX(#IL:#TQ-2 Z;7<]-S$T(#IS=STU,# @
  1240. M.G-H/34P," Z<W0]," Z9FP]," Z8VP],2 Z(0IL<'9\(#IC=STX(#IC:#TX
  1241. M(#IL:#TQ-2 Z;7<]-S$T(#IS=STU,# @.G-H/34P," Z<W0]," Z9FP]," Z
  1242. M8VP],2 Z(0IR8FAC?" Z8W<]." Z8V@]." Z;&@],3 @.FUW/3@S.2 Z<W<]
  1243. M-#@P(#IS:#TR-# @.G-T/3$@.F9L/3$@.F-L/3$@.B$*<F)H9WP@.F-W/3@@
  1244. M.F-H/3@@.FQH/3$P(#IM=STX,SD@.G-W/30X," Z<V@],C0P(#IS=#TQ(#IF
  1245. M;#TQ(#IC;#TQ(#HA"G)B:&U\(#IC=STX(#IC:#TX(#IL:#TQ," Z;7<].#,Y
  1246. M(#IS=STT.# @.G-H/3(T," Z<W0],2 Z9FP],2 Z8VP]," Z(0IR8FQC?" Z
  1247. M8W<]." Z8V@]." Z;&@],3 @.FUW/3,X,R Z<W<],C0P(#IS:#TR-# @.G-T
  1248. M/3$@.F9L/3$@.F-L/3$@.B$*<F)L9WP@.F-W/3@@.F-H/3@@.FQH/3$P(#IM
  1249. M=STS.#,@.G-W/3(T," Z<V@],C0P(#IS=#TQ(#IF;#TQ(#IC;#TQ(#HA"G)B
  1250. M;&U\(#IC=STX(#IC:#TX(#IL:#TQ," Z;7<],S@S(#IS=STR-# @.G-H/3(T
  1251. M," Z<W0],2 Z9FP],2 Z8VP]," Z(0IX?" Z8W<].2 Z8V@],3 @.FQH/3$X
  1252. M(#IM=STW.3D@.G-W/38S.2 Z<V@]-C,Y(#IS=#TQ(#IF;#TQ(#IC;#TQ(#HA
  1253. M"G-U;GP@.F-W/3D@.F-H/3$P(#IL:#TQ." Z;7<]-C,Y(#IS=STV,SD@.G-H
  1254. 9/38S.2 Z<W0],2 Z9FP],2 Z8VP],2 Z(2 Z
  1255.  
  1256. end
  1257. @eof
  1258. set `wc -lwc <Map/Src/gtermcap`
  1259. if test $1$2$3 != 182091330
  1260. then
  1261.     echo ERROR: wc results of Map/Src/gtermcap are $* should be 18 209 1330
  1262. fi
  1263.  
  1264. chmod 777 Map/Src/gtermcap
  1265.  
  1266. echo x - Map/Src/gtermcap.c
  1267. cat >Map/Src/gtermcap.c <<'@EOF'
  1268. #include     <stdio.h>
  1269. #include     "types.h"
  1270.  
  1271. extern    TypOfPtrToChar    environ[];                
  1272.  
  1273. TypOfGraphicsTerminalCapabilities  GraphicsTerminalCapabilities()    
  1274.  
  1275. {
  1276.     FILE                                                                *Ptr;
  1277.     FILE                                                                *fopen();
  1278.  
  1279.     TypOfPtrToChar                            F0 = " %s";
  1280.     TypOfPtrToChar                            F1 = " :cw=%d :ch=%d :lh=%d";
  1281.     TypOfPtrToChar                    F2 = " :mw=%d :sw=%d :sh=%d";
  1282.     TypOfPtrToChar            F3 = " :st=%d :fl=%d :cl=%d";
  1283.     TypOfPtrToChar                        F4 = " %*s";
  1284.  
  1285.     TypOfPtrToChar                getenv();
  1286.  
  1287.     TypOfPtrToChar        GTEnvVar = "GTERM";
  1288.     TypOfPtrToChar            GTCFName = "/usr/hafdjup/jvts/mappro/gtermcap";
  1289.     TypOfPtrToChar                CTN;
  1290.  
  1291.     TypOfChar                                TN[FNAMELEN];
  1292.     TypOfInt                        CW,CH,LH,MW,SW,SH,ST,FL,CL;
  1293.  
  1294.     TypOfInt                                Status;
  1295.  
  1296.     TypOfGraphicsTerminalCapabilities        TempGTC;
  1297.  
  1298.     
  1299.     CTN = getenv(GTEnvVar);
  1300.     if (CTN == NULL)
  1301.     {
  1302.         fprintf(stderr,"Error: cannot read %s ",GTEnvVar);
  1303.         exit(ERROR);
  1304.     }
  1305.     else
  1306.     {
  1307.         Ptr = fopen(GTCFName,"r");
  1308.         if (Ptr == NULL)
  1309.         {
  1310.             fprintf(stderr,"Error: cannot open %s\n",GTCFName);
  1311.             exit(ERROR);
  1312.         }
  1313.         else
  1314.         {
  1315.             Status = fscanf(Ptr,F0,TN);
  1316.  
  1317.             while((Status  == 1) && (strncmp(TN,CTN,strlen(CTN)) != 0)) 
  1318.             {
  1319.                 fscanf(Ptr,F1,&CW,&CH,&LH);
  1320.                 fscanf(Ptr,F2,&MW,&SW,&SH);
  1321.                 fscanf(Ptr,F3,&ST,&FL,&CL);
  1322.                 fscanf(Ptr,F4);
  1323.  
  1324.                 Status = fscanf(Ptr,F0,TN);
  1325.             }
  1326.             if (Status == EOF)
  1327.             {    
  1328.                 fprintf(stderr,"Error: missing device description ");
  1329.                 fprintf(stderr,"for %s ",CTN);
  1330.                 fprintf(stderr,"in file %s\n",GTCFName);
  1331.  
  1332.                 exit(ERROR);
  1333.             }
  1334.             else if (Status == NULL)
  1335.             {
  1336.                 fprintf(stderr,"Error: an error occurred ");
  1337.                 fprintf(stderr,"while reading the file ");
  1338.                 fprintf(stderr,"%s\n",GTCFName);
  1339.  
  1340.                 exit(ERROR);
  1341.             }
  1342.             else
  1343.             {
  1344.                 fscanf(Ptr,F1,&CW,&CH,&LH);
  1345.                 fscanf(Ptr,F2,&MW,&SW,&SH);
  1346.                 fscanf(Ptr,F3,&ST,&FL,&CL);
  1347.                 fscanf(Ptr,F4);
  1348.  
  1349.                 TempGTC.ChrWidth = CW;
  1350.                 TempGTC.ChrHeight = CH;
  1351.                 TempGTC.LinHeight = LH;
  1352.                 TempGTC.ScrMaxWidth = MW;
  1353.                 TempGTC.ScrWidth = SW;
  1354.                 TempGTC.ScrHeight = SH;
  1355.                 TempGTC.RasterSupport = ST;
  1356.                 TempGTC.FillSupport = FL;
  1357.                 TempGTC.ColorSupport = CL; 
  1358.             }
  1359.         }
  1360.     }
  1361.  
  1362.     fclose(Ptr);
  1363.     return(TempGTC);
  1364. }
  1365. @EOF
  1366. set `wc -lwc <Map/Src/gtermcap.c`
  1367. if test $1$2$3 != 971932071
  1368. then
  1369.     echo ERROR: wc results of Map/Src/gtermcap.c are $* should be 97 193 2071
  1370. fi
  1371.  
  1372. chmod 777 Map/Src/gtermcap.c
  1373.  
  1374. echo x - Map/Src/iniparms.c
  1375. cat >Map/Src/iniparms.c <<'@EOF'
  1376. #include    <stdio.h>
  1377. #include    "types.h"
  1378.  
  1379. TypOfInt InitParameters(EP,MP,OP,BP,TP,LP,CP,FP)
  1380.     
  1381.     TypOfEnvironmentParameters                *EP;
  1382.     TypOfMapParameters                                *MP;
  1383.     TypOfOptionParameters                            *OP;
  1384.     TypOfBorderParameters                            *BP;
  1385.     TypOfTicParameters                                *TP;
  1386.     TypOfLabelParameters                            *LP;
  1387.     TypOfCommentParameters                        *CP;
  1388.     TypOfFrameParameters                            *FP;
  1389.  
  1390.     {
  1391.     
  1392.         InitEnvironmentParameters(EP);
  1393.         InitMapParameters(MP);
  1394.         InitOptionParameters(OP);
  1395.         InitBorderParameters(BP);
  1396.         InitTicParameters(TP);
  1397.         InitLabelParameters(LP);
  1398.         InitCommentParameters(CP);
  1399.         InitFrameParameters(FP);
  1400.     
  1401.         return(OK);
  1402.     }
  1403.  
  1404.  
  1405. TypOfInt InitEnvironmentParameters(EP)
  1406.  
  1407.     TypOfEnvironmentParameters                    *EP;
  1408.  
  1409.     {
  1410.         (*EP).EnvMinX = 0.0;
  1411.         (*EP).EnvMinY = 0.0;
  1412.         (*EP).EnvMaxX = 1.0;
  1413.         (*EP).EnvMaxY = 1.0;
  1414.  
  1415.         (*EP).EnvMinLongitude = 10.000;
  1416.         (*EP).EnvMaxLongitude = 28.000;
  1417.         (*EP).EnvMinLatitude = 62.000;
  1418.         (*EP).EnvMaxLatitude = 68.000;
  1419.  
  1420.         return;
  1421.     }
  1422.  
  1423.  
  1424. TypOfInt InitMapParameters(MP)
  1425.  
  1426.     TypOfMapParameters                            *MP;
  1427.  
  1428.     {
  1429.         (*MP).EraseSelected = NO;
  1430.         (*MP).OptionSelected = NO;
  1431.         (*MP).BorderSelected = NO;
  1432.         (*MP).TicSelected = NO;
  1433.         (*MP).LabelSelected = NO;
  1434.         (*MP).CommentSelected = NO;
  1435.         (*MP).FrameSelected = NO;
  1436.     
  1437.         return;
  1438.     }
  1439.  
  1440.  
  1441. TypOfInt InitOptionParameters(OP)
  1442.  
  1443.     TypOfOptionParameters                        *OP;
  1444.  
  1445.     {
  1446.         (*OP).HeadOfOptionList = NULL;
  1447.         (*OP).TailOfOptionList = NULL;
  1448.         (*OP).CountOfOptionList = 0;
  1449.         (*OP).DefaultOptionPattern = 0;
  1450.  
  1451.         return;
  1452.     }
  1453.  
  1454.  
  1455. TypOfInt InitBorderParameters(BP)
  1456.     
  1457.     TypOfBorderParameters                        *BP;
  1458.  
  1459.     {
  1460.         (*BP).BorderPattern = 0;
  1461.  
  1462.         return;
  1463.     }
  1464.  
  1465.  
  1466. TypOfInt InitTicParameters(TP)
  1467.  
  1468.     TypOfTicParameters                            *TP;
  1469.  
  1470.     {
  1471.         (*TP).TicPattern = 0;
  1472.  
  1473.         return;
  1474.     }
  1475.  
  1476.  
  1477. TypOfInt InitLabelParameters(LP)
  1478.  
  1479.     TypOfLabelParameters                        *LP;
  1480.  
  1481.     {
  1482.         (*LP).LabelPattern = 0;
  1483.  
  1484.         return;
  1485.     }
  1486.  
  1487.  
  1488. TypOfInt InitCommentParameters(CP)
  1489.  
  1490.     TypOfCommentParameters                    *CP;
  1491.  
  1492.     {
  1493.         (*CP).CommentPattern = 0;
  1494.  
  1495.         return;
  1496.     }
  1497.  
  1498.  
  1499. TypOfInt InitFrameParameters(FP)
  1500.  
  1501.     TypOfFrameParameters                        *FP;
  1502.  
  1503.     {
  1504.         (*FP).FramePattern = 0;
  1505.  
  1506.         return;
  1507.     }
  1508. @EOF
  1509. set `wc -lwc <Map/Src/iniparms.c`
  1510. if test $1$2$3 != 1321611994
  1511. then
  1512.     echo ERROR: wc results of Map/Src/iniparms.c are $* should be 132 161 1994
  1513. fi
  1514.  
  1515. chmod 777 Map/Src/iniparms.c
  1516.  
  1517. echo x - Map/Src/label.c
  1518. cat >Map/Src/label.c <<'@EOF'
  1519. #include <stdio.h>
  1520. #include "types.h"
  1521.  
  1522. Label(WIN,ARE,CHA,GEO,LB)
  1523.  
  1524.  TypOfSpaceDefinition     WIN;
  1525.  TypOfSpaceDefinition     ARE;
  1526.  TypOfFontDefinition      CHA;
  1527.  TypOfGeographicalDefinition  GEO;
  1528.  TypOfLabelParameters     LB;
  1529.  
  1530.  {
  1531.  
  1532.   TypOfDouble          Mercator();
  1533.  
  1534.   TypOfInt           DeltaX;
  1535.   TypOfInt           DeltaY;
  1536.  
  1537.   TypOfFloat          DeltaLongitude;
  1538.   TypOfFloat          DeltaLatitude;
  1539.  
  1540.   TypOfFloat          FactorX;
  1541.   TypOfFloat           FactorY;
  1542.  
  1543.   TypOfInt           LongitudeLabelNum;
  1544.   TypOfInt           LatitudeLabelNum;
  1545.   
  1546.   TypOfDouble          LabelLongitude;
  1547.   TypOfDouble          LabelLatitude;
  1548.  
  1549.   TypOfInt           X;
  1550.   TypOfInt           Y;
  1551.  
  1552.   TypOfInt           NumDigits();
  1553.  
  1554.  
  1555.   TypOfInt           XLabelLength;
  1556.   TypOfInt           YLabelLength;
  1557.  
  1558.   TypOfChar          LString[30];
  1559.   TypOfChar          LineMode[15];             
  1560.  
  1561.  
  1562.   window(WIN.MinX,WIN.MinY,WIN.MaxX,WIN.MaxY);
  1563.   LineType(LB.LabelPattern/10,LineMode);
  1564.   linemod(LineMode);
  1565.   color(LB.LabelPattern%10);
  1566.  
  1567.   DeltaX = ARE.MaxX - ARE.MinX;
  1568.   DeltaLongitude = GEO.MaxLongitude - GEO.MinLongitude;
  1569.   FactorX = DeltaX/DeltaLongitude;
  1570.  
  1571.   DeltaY = ARE.MaxY - ARE.MinY;
  1572.   DeltaLatitude = Mercator(GEO.MaxLatitude) - Mercator(GEO.MinLatitude);
  1573.   FactorY = DeltaY/DeltaLatitude;
  1574.  
  1575.   XLabelLength = NumDigits(LB.LabelLongitudinalInterval);
  1576.   LongitudeLabelNum = (GEO.MinLongitude / LB.LabelLongitudinalInterval) + 1;
  1577.   while(LongitudeLabelNum * LB.LabelLongitudinalInterval < GEO.MaxLongitude)
  1578.   {
  1579.     LabelLongitude = LongitudeLabelNum * LB.LabelLongitudinalInterval;
  1580.     X = (FactorX*(GEO.MaxLongitude-LabelLongitude));
  1581.     X = X+ARE.MinX-CHA.CharWidth*(XLabelLength/2);
  1582.     Y = ARE.MaxY+(0.5*CHA.CharHeight); 
  1583.     move(X,Y);
  1584.                                 LabelString(LString,LabelLongitude,XLabelLength);
  1585.                                 label(LString);
  1586.     LongitudeLabelNum++;
  1587.   }
  1588.  
  1589.   YLabelLength = NumDigits(LB.LabelLatitudinalInterval);
  1590.   LatitudeLabelNum = (GEO.MinLatitude / LB.LabelLatitudinalInterval) + 1;
  1591.   while(LatitudeLabelNum * LB.LabelLatitudinalInterval < GEO.MaxLatitude)
  1592.   {
  1593.     LabelLatitude = LatitudeLabelNum * LB.LabelLatitudinalInterval;
  1594.     Y = FactorY*(Mercator(LabelLatitude)-Mercator(GEO.MinLatitude));
  1595.     X = ARE.MinX-(CHA.CharWidth*(YLabelLength+0.5));
  1596.     Y = Y+ARE.MinY-(CHA.CharWidth*0.5); 
  1597.     move(X,Y);
  1598.     LabelString(LString,LabelLatitude,YLabelLength);
  1599.                                 label(LString);
  1600.     LatitudeLabelNum++;
  1601.   }
  1602.  
  1603.   fflush(stdout);
  1604.   return(OK);
  1605. }
  1606.  
  1607.  
  1608.  LabelString(LString,Number,Length)
  1609.         
  1610.         TypOfPtrToChar LString;
  1611.  TypOfDouble           Number;
  1612.  TypOfInt            Length;
  1613.  
  1614.  {
  1615.   TypOfLong           Integer;
  1616.   TypOfChar           String[10];
  1617.  
  1618.   switch(Length)
  1619.   {
  1620.    case 2: Integer = Number;
  1621.        sprintf(String,"%2ld\0",Integer);
  1622.        break;
  1623.  
  1624.    case 4: Integer = 100*((int) Number)+60*(Number-((int) Number));
  1625.        sprintf(String,"%4ld\0",Integer);
  1626.        break;
  1627.  
  1628.    case 6: Integer = 10000*((int) Number)+3600*(Number-((int) Number));
  1629.        sprintf(String,"%6ld\0",Integer);
  1630.        break;
  1631.  
  1632.   }
  1633.   strcpy(LString,String);
  1634.  }
  1635.  
  1636.  
  1637.  
  1638. TypOfInt NumDigits(Increment)
  1639.  
  1640.  TypOfDouble        Increment;
  1641.  
  1642.  {
  1643.   TypOfInt        Number;
  1644.   
  1645.   if(Increment < 0.06)
  1646.   {
  1647.    Number = 6;
  1648.   }
  1649.   else
  1650.   {
  1651.    if(Increment < 1.0)
  1652.    {
  1653.     Number = 4;
  1654.    }
  1655.    else
  1656.    {
  1657.     Number = 2;
  1658.    }
  1659.   }
  1660.   return(Number);
  1661.  }
  1662. @EOF
  1663. set `wc -lwc <Map/Src/label.c`
  1664. if test $1$2$3 != 1432313357
  1665. then
  1666.     echo ERROR: wc results of Map/Src/label.c are $* should be 143 231 3357
  1667. fi
  1668.  
  1669. chmod 777 Map/Src/label.c
  1670.  
  1671. echo x - Map/Src/lbxy.c '[non-ascii]'
  1672. $unpacker <<'@eof'
  1673. begin 777 Map/Src/lbxy.c
  1674. M(VEN8VQU9&4@/'-T9&EO+F@^"B-I;F-L=61E(#QM871H+F@^"@IM86EN*"D*
  1675. M>PH):6YT"5!E;CL*"@ED;W5B;&4)6#L*"61O=6)L90E9.PH*"61O=6)L90E-
  1676. M97)C871O<B@I.PH*"61O=6)L90E,36EN+"!"36EN.PH)9&]U8FQE"4Q-87@L
  1677. M($)-87@["@ED;W5B;&4)3$QO8RP@0DQO8SL*"61O=6)L90E,4W!A;BP@0E-P
  1678. M86X["@H)0DUI;B ](#8R+C<U,# P.PH)3$UI;B ](#$P+C P,# P.PH)0DUA
  1679. M>" ](#8X+C P,# P.PH)3$UA>" ](#(X+C P,# P.PH)3%-P86X@/2!,36%X
  1680. M+4Q-:6X["@E"4W!A;B ]($UE<F-A=&]R*$)-87@I+4UE<F-A=&]R*$)-:6XI
  1681. M.PH*( EW:&EL92AS8V%N9B@B)6QF("5L9B E9"(L("9,3&]C+" F0DQO8RP@
  1682. M)E!E;BD@(3T@14]&*0H)>PH)"5@@/2 Q+C M*"A,3&]C+4Q-:6XI+TQ3<&%N
  1683. M*3L*"0E9(#T@*$UE<F-A=&]R*$),;V,I+4UE<F-A=&]R*$)-:6XI*2]"4W!A
  1684. M;CL*"0EP<FEN=&8H(B5F("5F("5D(%QN(BQ8+%DL(%!E;BD["@E]"@EE>&ET
  1685. M*# I.PI]"@H@"F1O=6)L92!-97)C871O<BA0;W-I=&EO;BD*9&]U8FQE"5!O
  1686. M<VET:6]N.PI["@ED;W5B;&4)4F%D*"D["@ED;W5B;&4)1F]U<G1Y1FEV92 ]
  1687. M(#0U+C ["@ED;W5B;&4)0V]N<W1A;G0@/2 P+C Q-S0U,S,["@H)<F5T=7)N
  1688. M*#(N,"HR+C,P,C8J=&%N*%)A9"A0;W-I=&EO;B\R+C I*2D["B\J"7)E='5R
  1689. M;BAL;V<Q,"AT86XH4F%D*$9O=7)T>49I=F4I*U)A9"A0;W-I=&EO;B\R+C I
  1690. M*2DI.PDJ+PI]"@D*"F1O=6)L92!2860H1&5G<F5E<RD*9&]U8FQE"41E9W)E
  1691. M97,["GL*"61O=6)L90E0:2 ](#,N,30Q-3D["@H)<F5T=7)N*%!I*BA$96=R
  1692. .965S+S$X,"XP*2D["GU0
  1693.  
  1694. end
  1695. @eof
  1696. set `wc -lwc <Map/Src/lbxy.c`
  1697. if test $1$2$3 != 5298824
  1698. then
  1699.     echo ERROR: wc results of Map/Src/lbxy.c are $* should be 52 98 824
  1700. fi
  1701.  
  1702. chmod 777 Map/Src/lbxy.c
  1703.  
  1704. echo x - Map/Src/linetype.c
  1705. cat >Map/Src/linetype.c <<'@EOF'
  1706. #include "types.h"
  1707.  
  1708.  void LineType(Selector,TempLineType)
  1709.  
  1710.  TypOfInt        Selector;
  1711.  TypOfPtrToChar  TempLineType;
  1712.  
  1713.  {
  1714.  
  1715.   switch(Selector%5)
  1716.   {
  1717.    case 0: strcpy(TempLineType,"solid");
  1718.        break;
  1719.  
  1720.    case 1: strcpy(TempLineType,"dotted");
  1721.        break;
  1722.  
  1723.    case 2: strcpy(TempLineType,"longdashed");
  1724.        break;
  1725.  
  1726.    case 3: strcpy(TempLineType,"shortdashed");
  1727.        break;
  1728.  
  1729.    case 4: strcpy(TempLineType,"dotdashed");
  1730.        break;
  1731.  
  1732.   }
  1733.  }
  1734. @EOF
  1735. set `wc -lwc <Map/Src/linetype.c`
  1736. if test $1$2$3 != 2833450
  1737. then
  1738.     echo ERROR: wc results of Map/Src/linetype.c are $* should be 28 33 450
  1739. fi
  1740.  
  1741. chmod 777 Map/Src/linetype.c
  1742.  
  1743. echo x - Map/Src/map.c
  1744. sed 's/^@//' >Map/Src/map.c <<'@EOF'
  1745.  
  1746. /*
  1747.  
  1748. Program:@\MAP
  1749.  
  1750. Author:@\HugH~nnun s.f.
  1751.  
  1752. Purpose:@\To draw a map with the options selected by the user.
  1753.  
  1754. Parameters:@\The VENIX operating system supplies this program with two
  1755. parameters:  (1) the number of arguments specified on the command line
  1756. when  this program was executed; and (2) an array containing a copy of
  1757. the arguments specified.  A detailed description of this can be  found
  1758. in chapter two of 'VENIX PROGRAMMING GUIDE'.
  1759.  
  1760. Description:@\This  program  calls  a  variety  of external functions.
  1761. Some are always called, and some are  only  called  if  the  user  has
  1762. specified  that  particular option.  An example is the 'tic' function,
  1763. which is only called when the user wants to make ticmarks on the map's
  1764. edges.  The  following  external  functions  are available to this
  1765. program:
  1766.  
  1767. @@\@W(  InitParameters   initializes parameter packets)
  1768. @@\@W(  GetArguments     gets and processes user arguments)
  1769. @@\@W(  SetEnvironment   sets up the drawing environment)
  1770. @@\@W(  SetUpPlotter     initializes the plotter and draws a box)
  1771. @@\@W(  Frame            draws a frame arround the whole map)
  1772. @@\@W(  Border           draws coastal outlines)
  1773. @@\@W(  Tic              draws lati- and longitudinal ticmarks)
  1774. @@\@W(  Label            draws lati- and longitudinal lables)
  1775. @@\@W(  Comment          inserts comment text below map)
  1776. @@\@W(  Option           calls the special options selected)
  1777. @@\@W(  Finish     
  1778. */
  1779.  
  1780. #include    <stdio.h>
  1781. #include    "types.h"
  1782.  
  1783. main(Argc,Argv)
  1784.  
  1785. TypOfInt        Argc;
  1786. TypOfPtrToChar    Argv[];
  1787. {
  1788.     TypOfEnvironmentParameters        EP;
  1789.     TypOfMapParameters            MP;
  1790.     TypOfOptionParameters        OP;
  1791.     TypOfBorderParameters        BP;
  1792.     TypOfTicParameters            TP;
  1793.     TypOfLabelParameters            LP;
  1794.     TypOfCommentParameters        CP;
  1795.     TypOfFrameParameters            FP;
  1796.  
  1797.     TypOfSpaceDefinition            WOR;
  1798.     TypOfSpaceDefinition            WIN;
  1799.     TypOfSpaceDefinition            ARE;
  1800.     TypOfFontDefinition            CHA;
  1801.     TypOfGeographicalDefinition        GEO;
  1802.  
  1803.     InitParameters(&EP,&MP,&OP,&BP,&TP,&LP,&CP,&FP);
  1804.  
  1805.     GetArguments(Argc,Argv,&EP,&MP,&OP,&BP,&TP,&LP,&CP,&FP);
  1806.  
  1807.     SetEnvironment(EP,MP,LP,CP,&WOR,&WIN,&ARE,&CHA,&GEO);
  1808.  
  1809.     openpl();
  1810.  
  1811.     SetUpPlotter(WIN,ARE,MP.EraseSelected);
  1812.  
  1813.     if (MP.FrameSelected == YES) Frame(WIN,FP);
  1814.     if (MP.TicSelected == YES) Tic(ARE,GEO,TP);
  1815.     if (MP.LabelSelected == YES) Label(WIN,ARE,CHA,GEO,LP);
  1816.     if (MP.BorderSelected == YES) Border(ARE,GEO,BP);
  1817.     if (MP.CommentSelected == YES) Comment(WIN,ARE,CHA,CP);
  1818.     if (MP.OptionSelected == YES) Option(WOR,WIN,ARE,CHA,GEO,OP);
  1819.     closepl();
  1820.  
  1821.     exit(OK);
  1822. }
  1823. @EOF
  1824. set `wc -lwc <Map/Src/map.c`
  1825. if test $1$2$3 != 782682448
  1826. then
  1827.     echo ERROR: wc results of Map/Src/map.c are $* should be 78 268 2448
  1828. fi
  1829.  
  1830. chmod 777 Map/Src/map.c
  1831.  
  1832. echo x - Map/Src/mercator.c '[non-ascii]'
  1833. $unpacker <<'@eof'
  1834. begin 777 Map/Src/mercator.c
  1835. M(VEN8VQU9&4@/&UA=&@N:#X*"F1O=6)L90E-97)C871O<BA0;W-I=&EO;BD*
  1836. M9&]U8FQE"5!O<VET:6]N.PI["@ED;W5B;&4)4F%D:6%N<R@I.PH)9&]U8FQE
  1837. M"49O=7)T>49I=F4@/2 T-2XP.PH*"7)E='5R;BAL;V<H=&%N*%)A9&EA;G,H
  1838. M1F]U<G1Y1FEV92DK4F%D:6%N<RA0;W-I=&EO;B\R+C I*2DI.PI]"@H*9&]U
  1839. M8FQE"4EN=F5R<V5-97)C871O<BA93&]C871I;VXI"F1O=6)L90E93&]C871I
  1840. M;VX["GL*"61O=6)L90E$96=R965S*"D["@ED;W5B;&4)1F]U<G1Y1FEV92 ]
  1841. M(#0U+C ["@H)<F5T=7)N*#(N,"HH1&5G<F5E<RAA=&%N*&5X<"A93&]C871I
  1842. M;VXI*2DM1F]U<G1Y1FEV92DI.PI]"@H*9&]U8FQE"5)A9&EA;G,H1&5G<F5E
  1843. M<RD*9&]U8FQE"41E9W)E97,["GL*"61O=6)L90E0:2 ](#,N,30Q-3D["@H)
  1844. M<F5T=7)N*%!I*BA$96=R965S+S$X,"XP*2D["GT*"@ID;W5B;&4)1&5G<F5E
  1845. M<RA2861I86YS*0ID;W5B;&4)4F%D:6%N<SL*>PH)9&]U8FQE"5!I(#T@,RXQ
  1846. E-#$U.3L*"@ER971U<FXH,3@P+C J*%)A9&EA;G,O4&DI*3L*?5!I
  1847.  
  1848. end
  1849. @eof
  1850. set `wc -lwc <Map/Src/mercator.c`
  1851. if test $1$2$3 != 3750532
  1852. then
  1853.     echo ERROR: wc results of Map/Src/mercator.c are $* should be 37 50 532
  1854. fi
  1855.  
  1856. chmod 777 Map/Src/mercator.c
  1857.  
  1858. echo x - Map/Src/minmax.c
  1859. cat >Map/Src/minmax.c <<'@EOF'
  1860. #include <stdio.h>
  1861. #include "types.h"
  1862.  
  1863.     
  1864. TypOfInt Minimum(Num1,Num2)
  1865.  
  1866.     TypOfInt                                    Num1;
  1867.     TypOfInt                                    Num2;
  1868.  
  1869.     {
  1870.         if(Num2 < Num1) Num1 = Num2;
  1871.         return(Num1);
  1872.     }
  1873.  
  1874.     
  1875. TypOfInt Maximum(Num1,Num2)
  1876.  
  1877.     TypOfInt                                    Num1;
  1878.     TypOfInt                                    Num2;
  1879.  
  1880.     {
  1881.         if(Num2 > Num1) Num1 = Num2;
  1882.         return(Num1);
  1883.     }
  1884.  
  1885. @EOF
  1886. set `wc -lwc <Map/Src/minmax.c`
  1887. if test $1$2$3 != 2534307
  1888. then
  1889.     echo ERROR: wc results of Map/Src/minmax.c are $* should be 25 34 307
  1890. fi
  1891.  
  1892. chmod 777 Map/Src/minmax.c
  1893.  
  1894. echo x - Map/Src/op.c
  1895. cat >Map/Src/op.c <<'@EOF'
  1896. #include <stdio.h>
  1897.  
  1898. main(argc,argv)
  1899.  
  1900.     int                                    argc;
  1901.     char                                *argv[];
  1902.  
  1903. {
  1904.     int                                    c;
  1905.  
  1906.     fprintf(stderr,"her er eg i op\n");
  1907.     while((c = getchar()) != EOF) putchar(c);
  1908.     exit(0);
  1909. }
  1910. @EOF
  1911. set `wc -lwc <Map/Src/op.c`
  1912. if test $1$2$3 != 1423190
  1913. then
  1914.     echo ERROR: wc results of Map/Src/op.c are $* should be 14 23 190
  1915. fi
  1916.  
  1917. chmod 777 Map/Src/op.c
  1918.  
  1919. echo x - Map/Src/option.c '[non-ascii]'
  1920. $unpacker <<'@eof'
  1921. begin 777 Map/Src/option.c
  1922. M(VEN8VQU9&4@/'-T9&EO+F@^"B-I;F-L=61E(")T>7!E<RYH(@H)"@I4>7!/
  1923. M9DEN="!/<'1I;VXH5T]2+%=)3BQ!4D4L0TA!+$=%3RQ/4"D*"@E4>7!/9E-P
  1924. M86-E1&5F:6YI=&EO;@D)"0D)"0E73U(["@E4>7!/9E-P86-E1&5F:6YI=&EO
  1925. M;@D)"0D)"0E724X["@E4>7!/9E-P86-E1&5F:6YI=&EO;@D)"0D)"0E!4D4[
  1926. M"@E4>7!/9D9O;G1$969I;FET:6]N"0D)"0D)"0E#2$$["@E4>7!/9D=E;V=R
  1927. M87!H:6-A;$1E9FEN:71I;VX)"0D)1T5/.PH)5'EP3V9/<'1I;VY087)A;65T
  1928. M97)S"0D)"0D)"4]0.PH*"7L*"0E4>7!/9D-H87()"0D)"0D)"0D)"0E3>7-3
  1929. M=');34%85$585$Q%3ET["@H)"51Y<$]F26YT"0D)"0D)"0D)"0D)3W!T:6]N
  1930. M3G5M.PH)"51Y<$]F3F]D949O<D]P=&EO;E!A<F%M971E<G,)"2I#=7)R96YT
  1931. M3W!T:6]N.PH*"@D)9F]R*$]P=&EO;DYU;2 ](#$[($]P=&EO;DYU;2 \/2!/
  1932. M4"Y#;W5N=$]F3W!T:6]N3&ES=#L@3W!T:6]N3G5M*RLI"@D)>PH)"0E#=7)R
  1933. M96YT3W!T:6]N(#T@3U N2&5A9$]F3W!T:6]N3&ES=#L*"0D)3U N2&5A9$]F
  1934. M3W!T:6]N3&ES=" ]("@J0W5R<F5N=$]P=&EO;BDN3W!T:6]N3F5X=%!O:6YT
  1935. M97(["@D)"7-P<FEN=&8H4WES4W1R+"(E<R E9" E9" E9" E9" E9" E9" E
  1936. M9" E9" E9" E9" E9" E9" E9" E9" E9" E9B E9B E9B E9B E9" E<UQN
  1937. M7# B+"@J0W5R<F5N=$]P=&EO;BDN3W!T:6]N3F%M92Q73U(N36EN6"Q73U(N
  1938. M36%X6"Q73U(N36EN62Q73U(N36%X62Q724XN36EN6"Q724XN36%X6"Q724XN
  1939. M36EN62Q724XN36%X62Q!4D4N36EN6"Q!4D4N36%X6"Q!4D4N36EN62Q!4D4N
  1940. M36%X62Q#2$$N0VAA<E=I9'1H+$-(02Y#:&%R2&5I9VAT+$-(02Y,:6YE2&5I
  1941. M9VAT+$=%3RY-:6Y,;VYG:71U9&4L1T5/+DUA>$QO;F=I='5D92Q'14\N36EN
  1942. M3&%T:71U9&4L1T5/+DUA>$QA=&ET=61E+"@J0W5R<F5N=$]P=&EO;BDN3W!T
  1943. M:6]N4&%T=&5R;BPH*D-U<G)E;G1/<'1I;VXI+D]P=&EO;D%R9W5M96YT4W1R
  1944. M:6YG*3L*"0ES>7-T96TH4WES4W1R*3L*"0E]"@H)"7)E='5R;BA/2RD["@E]
  1945. !"FYG
  1946.  
  1947. end
  1948. @eof
  1949. set `wc -lwc <Map/Src/option.c`
  1950. if test $1$2$3 != 30651036
  1951. then
  1952.     echo ERROR: wc results of Map/Src/option.c are $* should be 30 65 1036
  1953. fi
  1954.  
  1955. chmod 777 Map/Src/option.c
  1956.  
  1957. echo x - Map/Src/plotlib.c
  1958. cat >Map/Src/plotlib.c <<'@EOF'
  1959.  
  1960.  /* A plot(5) library, customised for use with the map program. */
  1961.  
  1962.  
  1963. #include <stdio.h>
  1964.  
  1965.  /* index: Returns pointer to s, where t occurs in it. */
  1966.  
  1967.  char *index(s,t)
  1968.    char *s, t;
  1969.  {
  1970.    if(t == '\0' && *s == t) return(s);
  1971.    if(*s == '\0') return(NULL);
  1972.    if(*s == t) return(s);
  1973.    return(index(s+1,t));
  1974.  }
  1975.  
  1976.  /* putsi: Writes an integer stored in two ascii bytes to standard output. */
  1977.  
  1978.  putsi(x)
  1979.    int x;
  1980.  {
  1981.    unsigned short b, b1, b2;
  1982.  
  1983.    b1 = (unsigned short) x;
  1984.    b2 = (unsigned short) x;
  1985.    b1 = b1 << 8;
  1986.    b2 = b2 >> 8;
  1987.    b = b1 | b2;
  1988.    write(1,&b,2);
  1989.  }
  1990.  
  1991.  
  1992.  openpl(){
  1993.  }
  1994.  
  1995.  closepl(){
  1996.  }
  1997.  
  1998.  char text[256];
  1999.  
  2000.  /* The plot(5) library consists of the following routines. */
  2001.  
  2002.  move(x,y)
  2003.    int x,y;
  2004.  {
  2005.    fprintf(stdout,"m");
  2006.    fflush(stdout);
  2007.    putsi(x);
  2008.    putsi(y);
  2009.  }
  2010.  
  2011.  
  2012.  cont(x,y)
  2013.    int x,y;
  2014.  {
  2015.    fprintf(stdout,"n");
  2016.    fflush(stdout);
  2017.    putsi(x);
  2018.    putsi(y);
  2019.  }
  2020.  
  2021.  
  2022.  point(x,y)
  2023.    int x,y;
  2024.  {
  2025.    fprintf(stdout,"p");
  2026.    fflush(stdout);
  2027.    putsi(x);
  2028.    putsi(y);
  2029.  }
  2030.  
  2031.  
  2032.  line(x0,y0,x1,y1)
  2033.    int x0,y0,x1,y1;
  2034.  {
  2035.    fprintf(stdout,"l");
  2036.    fflush(stdout);
  2037.    putsi(x0);
  2038.    putsi(y0);
  2039.    putsi(x1);
  2040.    putsi(y1);
  2041.  }
  2042.  
  2043.  
  2044.  label(s)
  2045.    char *s;
  2046.  {
  2047.    strcpy(text,s);
  2048.    strcat(text,"\n");
  2049.    fprintf(stdout,"t");
  2050.    fprintf(stdout,"%s",text);
  2051.    fflush(stdout);
  2052.  }
  2053.  
  2054.  
  2055.  arc(x0,y0,x1,y1,x2,y2)
  2056.    int x0,y0,x1,y1,x2,y2;
  2057.  {
  2058.    fprintf(stdout,"a");
  2059.    fflush(stdout);
  2060.    putsi(x0);
  2061.    putsi(y0);
  2062.    putsi(x1);
  2063.    putsi(y1);
  2064.    putsi(x2);
  2065.    putsi(y2);
  2066.  }
  2067.  
  2068.  
  2069.  circle(x0,y0,r)
  2070.    int x0,y0,r;
  2071.  {
  2072.    fprintf(stdout,"c");
  2073.    fflush(stdout);
  2074.    putsi(x0);
  2075.    putsi(y0);
  2076.    putsi(r);
  2077.  }
  2078.  
  2079.  
  2080.  erase(){
  2081.    fprintf(stdout,"e");
  2082.    fflush(stdout);
  2083.  }
  2084.  
  2085.  
  2086.  linemod(s)
  2087.    char *s;
  2088.  {
  2089.    strcpy(text,s);
  2090.    strcat(text,"\n");
  2091.    fprintf(stdout,"f");
  2092.    fprintf(stdout,"%s",text);
  2093.    fflush(stdout);
  2094.  }
  2095.  
  2096.  
  2097.  space(x0,y0,x1,y1)
  2098.    int x0,y0,x1,y1;
  2099.  {
  2100.    fprintf(stdout,"s");
  2101.    fflush(stdout);
  2102.    putsi(x0);
  2103.    putsi(y0);
  2104.    putsi(x1);
  2105.    putsi(y1);
  2106.  }
  2107.  
  2108.  
  2109.  box(x0,y0,x1,y1)
  2110.    int x0,y0,x1,y1;
  2111.  {
  2112.    fprintf(stdout,"b");
  2113.    fflush(stdout);
  2114.    putsi(x0);
  2115.    putsi(y0);
  2116.    putsi(x1);
  2117.    putsi(y1);
  2118.  }
  2119.  
  2120.  
  2121.  labelrotation(s)
  2122.    char *s;
  2123.  {
  2124.    strcpy(text,s);
  2125.    strcat(text,"\n");
  2126.    fprintf(stdout,"r");
  2127.    fprintf(stdout,"%s",text);
  2128.    fflush(stdout);
  2129.  }
  2130.  
  2131.  
  2132.  labelplace(s)
  2133.    char *s;
  2134.  {
  2135.    strcpy(text,s);
  2136.    strcat(text,"\n");
  2137.    fprintf(stdout,"u");
  2138.    fprintf(stdout,"%s",text);
  2139.    fflush(stdout);
  2140.  }
  2141.  
  2142.  
  2143.  linewid(x)
  2144.    int x;
  2145.  {
  2146.    fprintf(stdout,"w");
  2147.    fflush(stdout);
  2148.    putsi(x);
  2149.  }
  2150.  
  2151.  
  2152.  
  2153.  
  2154.    
  2155. @EOF
  2156. set `wc -lwc <Map/Src/plotlib.c`
  2157. if test $1$2$3 != 1962512479
  2158. then
  2159.     echo ERROR: wc results of Map/Src/plotlib.c are $* should be 196 251 2479
  2160. fi
  2161.  
  2162. chmod 666 Map/Src/plotlib.c
  2163.  
  2164. echo x - Map/Src/qgraph.c
  2165. cat >Map/Src/qgraph.c <<'@EOF'
  2166. #include <stdio.h>
  2167.  
  2168. main(argc,argv)
  2169.  
  2170. int argc;
  2171. char *argv[];
  2172. {
  2173.     int        size;
  2174.     int        xcoordinate;
  2175.     int        ycoordinate;
  2176.  
  2177.     float    x,minx,maxx,xrange;
  2178.     float y,miny,maxy,yrange;
  2179.  
  2180.     char    string[100];
  2181.  
  2182.     if(argc == 5)
  2183.     {
  2184.         sscanf(argv[1],"%f",&minx);
  2185.         sscanf(argv[2],"%f",&maxx);
  2186.         sscanf(argv[3],"%f",&miny);
  2187.         sscanf(argv[4],"%f",&maxy);
  2188.  
  2189.         xrange = maxx - minx;
  2190.         yrange = maxy - miny;
  2191.  
  2192.         openpl();
  2193.         space(0,0,1000,1000);
  2194.         window(0,0,1000,1000);
  2195.         gets(string);
  2196.         gets(string);
  2197.         while(scanf("%f %f",&x,&y) != EOF) 
  2198.         {
  2199.             xcoordinate = ((x-minx)/xrange)*996+2;
  2200.             ycoordinate = ((y-miny)/yrange)*996+2;
  2201.             move(xcoordinate-2,ycoordinate);
  2202.             cont(xcoordinate+2,ycoordinate);
  2203.             move(xcoordinate,ycoordinate-2);
  2204.             cont(xcoordinate,ycoordinate+2);
  2205.         } 
  2206.         box(0,0,1000,1000);
  2207.         closepl();    
  2208.         exit(0);
  2209.     }
  2210.     else
  2211.     {
  2212.         fprintf(stderr,"Illegal number of parameters\n");
  2213.         fprintf(stderr,"Usage is: \"qgraph xmin xmax ymin ymax\"\n");
  2214.     }
  2215. }
  2216. @EOF
  2217. set `wc -lwc <Map/Src/qgraph.c`
  2218. if test $1$2$3 != 5078925
  2219. then
  2220.     echo ERROR: wc results of Map/Src/qgraph.c are $* should be 50 78 925
  2221. fi
  2222.  
  2223. chmod 777 Map/Src/qgraph.c
  2224.  
  2225. echo x - Map/Src/setenv.c
  2226. cat >Map/Src/setenv.c <<'@EOF'
  2227. #include <stdio.h>
  2228. #include "types.h"
  2229.  
  2230. TypOfInt SetEnvironment(EP,MP,LP,CP,WOR,WIN,ARE,CHA,GEO)
  2231.  
  2232.     TypOfEnvironmentParameters                            EP;
  2233.     TypOfMapParameters                                            MP;
  2234.     TypOfLabelParameters                                        LP;
  2235.     TypOfCommentParameters                                    CP;
  2236.  
  2237.     TypOfSpaceDefinition                                        *WOR;
  2238.     TypOfSpaceDefinition                                        *WIN;
  2239.     TypOfSpaceDefinition                                        *ARE;
  2240.     TypOfFontDefinition                                            *CHA;
  2241.     TypOfGeographicalDefinition                            *GEO;
  2242.  
  2243.     {
  2244.         SetWorld(WOR);
  2245.         SetCharacterFont(CHA);
  2246.         SetGeographicalRegion(EP,GEO);
  2247.         SetWindow(EP,*WOR,WIN);
  2248.         SetArea(*WIN,*CHA,*GEO,MP,LP,CP,ARE);
  2249.  
  2250.         return(OK);
  2251.     }
  2252.  
  2253.  
  2254. TypOfInt SetWorld(WOR)
  2255.  
  2256.     TypOfSpaceDefinition                                        *WOR;
  2257.  
  2258.     {
  2259.         TypOfGraphicsTerminalCapabilities            GTC;
  2260.         TypOfGraphicsTerminalCapabilities            GraphicsTerminalCapabilities();
  2261.  
  2262.         GTC = GraphicsTerminalCapabilities();
  2263.  
  2264.         (*WOR).MinX = 0;
  2265.         (*WOR).MinY = 0;
  2266.         (*WOR).MaxX = GTC.ScrMaxWidth/((float) GTC.ScrWidth)*XNUMCOORDINATES/2;
  2267.         (*WOR).MaxY = XNUMCOORDINATES;
  2268.     
  2269.         return;
  2270.     }
  2271.  
  2272.  
  2273. TypOfInt SetWindow(EP,WOR,WIN)
  2274.  
  2275.     TypOfEnvironmentParameters            EP;
  2276.     TypOfSpaceDefinition                WOR;
  2277.     TypOfSpaceDefinition                *WIN;
  2278.  
  2279.     {
  2280.         (*WIN).MinX = WOR.MaxY*EP.EnvMinX;
  2281.         (*WIN).MaxX = WOR.MaxY*EP.EnvMaxX;
  2282.         (*WIN).MinY = WOR.MaxY*EP.EnvMinY;
  2283.         (*WIN).MaxY = WOR.MaxY*EP.EnvMaxY;
  2284.     
  2285.         return;
  2286.     }
  2287.  
  2288.  
  2289.     TypOfInt SetCharacterFont(CHA)
  2290.         TypOfFontDefinition        *CHA;
  2291.     {
  2292.         TypOfGraphicsTerminalCapabilities        GTC;
  2293.         TypOfGraphicsTerminalCapabilities        GraphicsTerminalCapabilities();
  2294.  
  2295.         GTC = GraphicsTerminalCapabilities();
  2296.  
  2297.         (*CHA).CharWidth = GTC.ChrWidth*XNUMCOORDINATES/((float) GTC.ScrWidth);
  2298.         (*CHA).CharHeight = GTC.ChrHeight*XNUMCOORDINATES/((float) GTC.ScrHeight);
  2299.         (*CHA).LineHeight = GTC.LinHeight*XNUMCOORDINATES/((float) GTC.ScrHeight);
  2300.     
  2301.         return;
  2302.     }
  2303.  
  2304.  
  2305. TypOfInt SetGeographicalRegion(EP,GEO)
  2306.  
  2307.     TypOfEnvironmentParameters            EP;
  2308.     TypOfGeographicalDefinition            *GEO;
  2309.  
  2310.     {
  2311.         (*GEO).MinLongitude = EP.EnvMinLongitude;
  2312.         (*GEO).MaxLongitude = EP.EnvMaxLongitude;
  2313.         (*GEO).MinLatitude = EP.EnvMinLatitude;
  2314.         (*GEO).MaxLatitude = EP.EnvMaxLatitude;
  2315.     
  2316.         return;
  2317.     }
  2318.  
  2319.  
  2320. TypOfInt SetArea(WIN,CHA,GEO,MP,LP,CP,ARE)
  2321.  
  2322.     TypOfSpaceDefinition                        WIN;
  2323.     TypOfFontDefinition                            CHA;
  2324.     TypOfGeographicalDefinition            GEO;
  2325.     TypOfMapParameters                            MP;
  2326.     TypOfLabelParameters                        LP;
  2327.     TypOfCommentParameters                    CP;
  2328.  
  2329.     TypOfSpaceDefinition                        *ARE;
  2330.     
  2331.     {
  2332.         TypOfInt                                            LeftMargin();
  2333.         TypOfInt                                            RightMargin();
  2334.         TypOfInt                                            BottomMargin();
  2335.         TypOfInt                                            TopMargin();
  2336.  
  2337.         TypOfFloat                                        Scale();
  2338.         TypOfFloat                                        ScalingFactor;
  2339.  
  2340.         TypOfInt                                            Delta;
  2341.  
  2342.         (*ARE).MinX = WIN.MinX+LeftMargin(CHA,MP,LP);
  2343.         (*ARE).MaxX = WIN.MaxX-RightMargin(CHA,MP);
  2344.         (*ARE).MinY = WIN.MinY+BottomMargin(CHA,MP,CP);
  2345.         (*ARE).MaxY = WIN.MaxY-TopMargin(CHA,MP);
  2346.  
  2347.         ScalingFactor = Scale(GEO);
  2348.  
  2349.         if (((*ARE).MaxY-(*ARE).MinY) < (ScalingFactor*((*ARE).MaxX-(*ARE).MinX)))
  2350.         {
  2351.             Delta = ((*ARE).MaxY - (*ARE).MinY) / ScalingFactor;
  2352.             (*ARE).MinX = (*ARE).MinX+(((*ARE).MaxX-(*ARE).MinX)-Delta)/2;
  2353.             (*ARE).MaxX = (*ARE).MinX+Delta;
  2354.         }
  2355.         else
  2356.         { 
  2357.             Delta = ((*ARE).MaxX - (*ARE).MinX) * ScalingFactor;
  2358.             (*ARE).MinY = (*ARE).MinY+(((*ARE).MaxY-(*ARE).MinY)-Delta)/2;
  2359.             (*ARE).MaxY = (*ARE).MinY+Delta;
  2360.         }
  2361.     
  2362.         return;
  2363.     }
  2364.  
  2365.     
  2366. TypOfInt LeftMargin(CHA,MP,LP)
  2367.  
  2368.     TypOfFontDefinition                CHA;
  2369.   TypOfMapParameters                MP;
  2370.     TypOfLabelParameters            LP;
  2371.  
  2372.     {
  2373.         TypOfInt                                M;
  2374.  
  2375.         if(MP.LabelSelected == YES)
  2376.         {
  2377.              M = CHA.CharWidth*(NumDigits(LP.LabelLatitudinalInterval)+1.5);
  2378.         }
  2379.         else
  2380.         {
  2381.             M = 0;
  2382.         }
  2383.  
  2384.         return(M);
  2385.     }
  2386.  
  2387.     
  2388. TypOfInt RightMargin(CHA,MP)
  2389.  
  2390.     TypOfFontDefinition                CHA;
  2391.   TypOfMapParameters                MP;
  2392.  
  2393.     {
  2394.         TypOfInt                                M;
  2395.  
  2396.         M = 0;
  2397.         if(MP.LabelSelected == YES)    M = CHA.CharWidth;
  2398.  
  2399.         return(M);
  2400.     }
  2401.  
  2402.     
  2403. TypOfInt TopMargin(CHA,MP)
  2404.  
  2405.     TypOfFontDefinition                CHA;
  2406.   TypOfMapParameters                MP;
  2407.  
  2408.     {
  2409.         TypOfInt                                M;
  2410.  
  2411.         M = 0;
  2412.         if(MP.LabelSelected == YES) M += CHA.CharHeight+CHA.LineHeight;
  2413.  
  2414.         return(M);
  2415.     }
  2416.  
  2417.     
  2418. TypOfInt BottomMargin(CHA,MP,CP)
  2419.  
  2420.     TypOfFontDefinition                    CHA;
  2421.   TypOfMapParameters                    MP;
  2422.     TypOfCommentParameters            CP;
  2423.  
  2424.     {
  2425.         TypOfInt                                    M;
  2426.         TypOfInt                                    NumLines();
  2427.  
  2428.         M = 0;
  2429.         if(MP.LabelSelected == YES) M += CHA.CharHeight;
  2430.         if(MP.CommentSelected == YES) M += (NumLines(CP.CommentText)+1)*CHA.LineHeight;
  2431.  
  2432.         return(M);
  2433.     }
  2434.  
  2435.     
  2436. TypOfFloat Scale(GEO)
  2437.  
  2438.     TypOfGeographicalDefinition            GEO;
  2439.  
  2440.     {
  2441.         TypOfDouble                                        Mercator();
  2442.  
  2443.         TypOfDouble    MinX;
  2444.         TypOfDouble    MaxX;
  2445.         TypOfDouble    MinY;
  2446.         TypOfDouble    MaxY;
  2447.  
  2448.         MinY = Mercator(GEO.MinLatitude);
  2449.         MaxY = Mercator(GEO.MaxLatitude);
  2450.  
  2451.         MinX = GEO.MinLongitude*Mercator((double) 1.0);
  2452.         MaxX = GEO.MaxLongitude*Mercator((double) 1.0);
  2453.  
  2454.         return((MaxY-MinY)/((float) (MaxX-MinX)));
  2455.     }
  2456. @EOF
  2457. set `wc -lwc <Map/Src/setenv.c`
  2458. if test $1$2$3 != 2293414647
  2459. then
  2460.     echo ERROR: wc results of Map/Src/setenv.c are $* should be 229 341 4647
  2461. fi
  2462.  
  2463. chmod 777 Map/Src/setenv.c
  2464.  
  2465. echo x - Map/Src/setup.c
  2466. cat >Map/Src/setup.c <<'@EOF'
  2467. #include <stdio.h>
  2468. #include "types.h"
  2469.  
  2470. TypOfInt SetUpPlotter(WIN,ARE,ERASE)
  2471.  
  2472.     TypOfSpaceDefinition                        WIN;
  2473.     TypOfSpaceDefinition                        ARE;
  2474.     TypOfInt                                                ERASE;
  2475.  
  2476.     {
  2477.             /* -100 og +250 sett til ad baeta utskrift. Breytist af vild */
  2478.         space(-150,0,XNUMCOORDINATES+250,YNUMCOORDINATES);
  2479.  
  2480.         if(ERASE == YES) erase();
  2481.  
  2482.         window(WIN.MinX,WIN.MinY,WIN.MaxX,WIN.MaxY);
  2483.         box(ARE.MinX,ARE.MinY,ARE.MaxX,ARE.MaxY);
  2484.  
  2485.         fflush(stdout);
  2486.         return;
  2487.     }
  2488. @EOF
  2489. set `wc -lwc <Map/Src/setup.c`
  2490. if test $1$2$3 != 2136452
  2491. then
  2492.     echo ERROR: wc results of Map/Src/setup.c are $* should be 21 36 452
  2493. fi
  2494.  
  2495. chmod 777 Map/Src/setup.c
  2496.  
  2497. echo x - Map/Src/shade.c
  2498. cat >Map/Src/shade.c <<'@EOF'
  2499. #include <stdio.h>
  2500. #include "types.h"
  2501.  
  2502.  
  2503. typedef struct StrOfDataForBreakNode
  2504.  
  2505.  {
  2506.    TypOfDouble      BreakValue;
  2507.    TypOfDouble      ShadeFactor;
  2508.    TypOfInt      ShadeType;
  2509.    TypOfPtrToChar      NextBreak;
  2510.  }  TypOfDataForBreakNode;
  2511.  
  2512.   
  2513. typedef struct StrOfBreakList
  2514.  
  2515.  {
  2516.   TypOfPtrToChar  HeadOfBreakList;
  2517.   TypOfPtrToChar  TailOfBreakList;
  2518.  
  2519.  }    TypOfBreakList;
  2520.  
  2521.  
  2522. main(ArgC,ArgV)
  2523.  
  2524.  TypOfInt     ArgC;
  2525.  TypOfPtrToChar     ArgV[];
  2526.  
  2527.  {
  2528.   TypOfSpaceDefinition    WOR;
  2529.   TypOfSpaceDefinition    WIN;
  2530.   TypOfSpaceDefinition             ARE;
  2531.   TypOfFontDefinition    CHA;
  2532.   TypOfGeographicalDefinition          GEO;
  2533.   TypOfInt     PAT;
  2534.   
  2535.   TypOfBreakList     BLIST;
  2536.  
  2537.   TypOfDouble      Mercator();
  2538.   TypOfDouble      GeoPosition();
  2539.  
  2540.   TypOfFloat      FactorX;
  2541.   TypOfFloat      FactorY;
  2542.  
  2543.   TypOfInt       DeltaX;
  2544.   TypOfInt       DeltaY;
  2545.  
  2546.   TypOfDouble      DeltaLongitude;
  2547.   TypOfDouble      DeltaLatitude;
  2548.  
  2549.   TypOfDouble      LoLong;
  2550.   TypOfDouble      HiLong;
  2551.   TypOfDouble      LoLat;
  2552.   TypOfDouble      HiLat;
  2553.  
  2554.   TypOfInt       X;
  2555.   TypOfInt       Y;
  2556.  
  2557.   TypOfSpaceDefinition S;
  2558.  
  2559.   TypOfDouble      Value;
  2560.  
  2561.   TypOfChar       InputLine[MAXTEXTLEN];
  2562.  
  2563.   TypOfChar       StrLoLat[10];
  2564.   TypOfChar       StrHiLat[10];
  2565.  
  2566.   TypOfChar       StrLoLong[10];
  2567.   TypOfChar       StrHiLong[10];
  2568.   TypOfChar       LineMode[15];
  2569.  
  2570.  
  2571.   GetArguments(ArgC,ArgV,&WOR,&WIN,&ARE,&CHA,&GEO,&PAT,&BLIST);
  2572.  
  2573.   window(ARE.MinX,ARE.MinY,ARE.MaxX,ARE.MaxY);
  2574.   LineType(PAT/10,LineMode);
  2575.   linemod(LineMode);
  2576.   color(PAT%10);
  2577.  
  2578.   DeltaX = ARE.MaxX - ARE.MinX;
  2579.   DeltaLongitude = GEO.MaxLongitude - GEO.MinLongitude;
  2580.   FactorX = DeltaX/DeltaLongitude;
  2581.  
  2582.   DeltaY = ARE.MaxY - ARE.MinY;
  2583.   DeltaLatitude = Mercator(GEO.MaxLatitude) - Mercator(GEO.MinLatitude);
  2584.   FactorY = DeltaY/DeltaLatitude;
  2585.  
  2586.   gets(InputLine);
  2587.   gets(InputLine);
  2588.   while(gets(InputLine) != NULL)
  2589.   {
  2590.    sscanf(InputLine,"%s %s",StrLoLat,StrHiLat);
  2591.  
  2592.    LoLat = GeoPosition(StrLoLat);
  2593.    HiLat = GeoPosition(StrHiLat);
  2594.  
  2595.    sscanf(InputLine,"%*s %*s %s %s",StrLoLong,StrHiLong);
  2596.  
  2597.  
  2598.    LoLong = GeoPosition(StrLoLong);
  2599.    HiLong = GeoPosition(StrHiLong);
  2600.  
  2601.    sscanf(InputLine,"%*s %*s %*s %*s %lf",&Value);
  2602.  
  2603.    S.MinX = (FactorX*(GEO.MaxLongitude-HiLong))+ARE.MinX;
  2604.    S.MaxX = (FactorX*(GEO.MaxLongitude-LoLong))+ARE.MinX;
  2605.    S.MinY = (FactorY*(Mercator(LoLat)-Mercator(GEO.MinLatitude)))+ARE.MinY;
  2606.    S.MaxY = (FactorY*(Mercator(HiLat)-Mercator(GEO.MinLatitude)))+ARE.MinY;
  2607.    ShadeArea(WOR,ARE,S,Value,BLIST);
  2608.   }
  2609.  
  2610.   fflush(stdout);
  2611.   exit(OK);
  2612.  }
  2613.  
  2614.  
  2615. TypOfInt GetArguments(ArgC,ArgV,WOR,WIN,ARE,CHA,GEO,PAT,BLIST)
  2616.  
  2617.  TypOfInt    ArgC;
  2618.  TypOfPtrToChar    ArgV[];
  2619.  
  2620.  TypOfSpaceDefinition        *WOR;
  2621.  TypOfSpaceDefinition        *WIN;
  2622.  TypOfSpaceDefinition        *ARE;
  2623.  TypOfFontDefinition        *CHA;
  2624.  TypOfGeographicalDefinition     *GEO;
  2625.  TypOfInt         *PAT;
  2626.  TypOfBreakList         *BLIST;
  2627.  
  2628.  {
  2629.   TypOfInt    Count;
  2630.   TypOfInt    Offset;
  2631.   TypOfPtrToChar    PtrToBreakNode;
  2632.  
  2633.  
  2634.   sscanf(ArgV[1],"%d",&((*WOR).MinX));
  2635.   sscanf(ArgV[2],"%d",&((*WOR).MaxX));
  2636.   sscanf(ArgV[3],"%d",&((*WOR).MinY));
  2637.   sscanf(ArgV[4],"%d",&((*WOR).MaxY));
  2638.  
  2639.   sscanf(ArgV[5],"%d",&((*WIN).MinX));
  2640.   sscanf(ArgV[6],"%d",&((*WIN).MaxX));
  2641.   sscanf(ArgV[7],"%d",&((*WIN).MinY));
  2642.   sscanf(ArgV[8],"%d",&((*WIN).MaxY));
  2643.  
  2644.   sscanf(ArgV[9],"%d",&((*ARE).MinX));
  2645.   sscanf(ArgV[10],"%d",&((*ARE).MaxX));
  2646.   sscanf(ArgV[11],"%d",&((*ARE).MinY));
  2647.   sscanf(ArgV[12],"%d",&((*ARE).MaxY));
  2648.  
  2649.   sscanf(ArgV[13],"%d",&((*CHA).CharWidth));
  2650.   sscanf(ArgV[14],"%d",&((*CHA).CharHeight));
  2651.   sscanf(ArgV[15],"%d",&((*CHA).LineHeight));
  2652.  
  2653.   sscanf(ArgV[16],"%lf",&((*GEO).MinLongitude));
  2654.   sscanf(ArgV[17],"%lf",&((*GEO).MaxLongitude));
  2655.   sscanf(ArgV[18],"%lf",&((*GEO).MinLatitude));
  2656.   sscanf(ArgV[19],"%lf",&((*GEO).MaxLatitude));
  2657.  
  2658.   sscanf(ArgV[20],"%d",&(*PAT));
  2659.  
  2660.   PtrToBreakNode = malloc(sizeof(TypOfDataForBreakNode));
  2661.   (*BLIST).HeadOfBreakList = PtrToBreakNode;
  2662.   (*BLIST).TailOfBreakList = PtrToBreakNode;
  2663.  
  2664.   (*(*BLIST).TailOfBreakList).NextBreak = NULL;
  2665.  
  2666.   sscanf(ArgV[21],"%lf",&((*(*BLIST).TailOfBreakList).BreakValue));
  2667.   sscanf(ArgV[22],"%d",&((*(*BLIST).TailOfBreakList).ShadeType));
  2668.   sscanf(ArgV[23],"%lf",&((*(*BLIST).TailOfBreakList).ShadeFactor));
  2669.  
  2670.   for(Count = 1; Count < ((ArgC-21)/3); Count++)
  2671.   {
  2672.    PtrToBreakNode = malloc(sizeof(TypOfDataForBreakNode));
  2673.    (*(*BLIST).TailOfBreakList).NextBreak = PtrToBreakNode; 
  2674.    (*BLIST).TailOfBreakList = PtrToBreakNode;
  2675.    (*(*BLIST).TailOfBreakList).NextBreak = NULL;
  2676.  
  2677.    Offset = 21+(Count*3);
  2678.    sscanf(ArgV[Offset+0],"%lf",&((*(*BLIST).TailOfBreakList).BreakValue));
  2679.    sscanf(ArgV[Offset+1],"%d",&((*(*BLIST).TailOfBreakList).ShadeType));
  2680.    sscanf(ArgV[Offset+2],"%lf",&((*(*BLIST).TailOfBreakList).ShadeFactor));
  2681.   }
  2682.    return;
  2683.  }
  2684.  
  2685.  
  2686. TypOfInt ShadeArea(WOR,ARE,Square,Value,BLIST)
  2687.  
  2688.  TypOfSpaceDefinition      WOR;
  2689.  TypOfSpaceDefinition      ARE;
  2690.  TypOfSpaceDefinition      Square;
  2691.  TypOfDouble       Value;
  2692.  TypOfBreakList       BLIST;
  2693.  
  2694.  {
  2695.   TypOfInt      Type;
  2696.   TypOfInt      Increment;
  2697.  
  2698.   TypOfDataForBreakNode    *Default;
  2699.   TypOfDataForBreakNode   *CurrentNode;
  2700.  
  2701.  
  2702.   CurrentNode = BLIST.HeadOfBreakList;
  2703.   while((CurrentNode != NULL) && ((*CurrentNode).BreakValue < Value))
  2704.   {
  2705.    CurrentNode = (*CurrentNode).NextBreak;
  2706.   }
  2707.   if(CurrentNode == NULL)
  2708.   {
  2709.    fprintf(stderr,"Error: The value %f is greater than the ",Value);
  2710.    fprintf(stderr,"highest breakpoint; it has been ignored\n");
  2711.    exit(ERROR);
  2712.   }
  2713.   else
  2714.   {
  2715.    if((*CurrentNode).BreakValue == 0.0)
  2716.    {
  2717.     return;
  2718.    }
  2719.    else
  2720.    {
  2721.     Type = (*CurrentNode).ShadeType;
  2722.     Increment = WOR.MaxY/((float ) (*CurrentNode).ShadeFactor)+0.5;
  2723.  
  2724.     box(Square.MinX,Square.MinY,Square.MaxX,Square.MaxY);
  2725.  
  2726.     if((Type/1000) == 1) Vertical(ARE,Square,Increment);
  2727.     if(((Type%1000)/100) == 1) Horizontal(ARE,Square,Increment);
  2728.     if((((Type%1000)%100)/10) == 1) Right(ARE,Square,Increment);
  2729.     if(((((Type%1000)%100)%10)/1) == 1) Left(Square,Increment);
  2730.    }
  2731.   }
  2732.   
  2733.   return;
  2734.  }
  2735.   
  2736.  
  2737. TypOfInt Vertical(ARE,Square,Increment)
  2738.  
  2739.  TypOfSpaceDefinition     ARE;
  2740.  TypOfSpaceDefinition     Square;
  2741.  TypOfInt      Increment;   
  2742.    
  2743.  
  2744.  {
  2745.   TypOfInt     Offset;
  2746.  
  2747.  
  2748.   Offset = 0;
  2749.   while(Square.MinX+Offset <= Square.MaxX)
  2750.   {
  2751.    move(Square.MinX+Offset,Square.MinY);
  2752.    cont(Square.MinX+Offset,Square.MaxY);
  2753.    Offset += Increment;
  2754.   }
  2755.  }
  2756.  
  2757.  
  2758. TypOfInt Horizontal(ARE,Square,Increment)
  2759.  
  2760.  TypOfSpaceDefinition     ARE;
  2761.  TypOfSpaceDefinition     Square;
  2762.  TypOfInt      Increment;
  2763.    
  2764.  {
  2765.   TypOfInt     Offset;
  2766.  
  2767.  
  2768.   Offset = 0;
  2769.   while(Square.MinY+Offset <= Square.MaxY)
  2770.   {
  2771.    move(Square.MinX,Square.MinY+Offset);
  2772.    cont(Square.MaxX,Square.MinY+Offset);
  2773.    Offset += Increment;
  2774.   }
  2775.  
  2776.   return;
  2777.  }
  2778.  
  2779.  
  2780. TypOfInt Right(ARE,Square,Increment)
  2781.  
  2782.  TypOfSpaceDefinition     ARE;
  2783.  TypOfSpaceDefinition    Square;
  2784.  TypOfInt     Increment;
  2785.    
  2786.  {
  2787.   TypOfInt    DeltaX;
  2788.   TypOfInt    DeltaY;
  2789.   TypOfInt    Offset;
  2790.  
  2791.   TypOfDouble    sqrt();
  2792.  
  2793.  
  2794.   Increment = Increment*sqrt((double) 2.0)+0.5;
  2795.  
  2796.   DeltaX = Square.MaxX-Square.MinX;
  2797.   DeltaY = Square.MaxY-Square.MinY;
  2798.  
  2799.   Offset = 0;
  2800.   while(((Offset-DeltaY) < DeltaX) && ((Offset-DeltaX) < DeltaY))
  2801.   {
  2802.    if(Offset > DeltaX)
  2803.    {
  2804.     move(Square.MinX,Square.MinY+(Offset-DeltaX));
  2805.    }
  2806.    else
  2807.    {
  2808.     move(Square.MaxX-Offset,Square.MinY);
  2809.    }
  2810.  
  2811.    if(Offset > DeltaY)
  2812.    {
  2813.     cont(Square.MaxX-(Offset-DeltaY),Square.MaxY);
  2814.    }
  2815.    else
  2816.    {
  2817.     cont(Square.MaxX,Square.MinY+Offset);
  2818.    }
  2819.    Offset += Increment;
  2820.   }
  2821.  
  2822.   return;
  2823.  }
  2824.  
  2825.  
  2826. TypOfInt Left(ARE,Square,Increment)
  2827.  
  2828.  TypOfSpaceDefinition     ARE;
  2829.  TypOfSpaceDefinition     Square;
  2830.  TypOfInt      Increment;
  2831.    
  2832.  {
  2833.   TypOfInt     DeltaX;
  2834.   TypOfInt     DeltaY;
  2835.   TypOfInt     Offset;
  2836.  
  2837.   TypOfDouble     sqrt();
  2838.  
  2839.  
  2840.   Increment = Increment*sqrt((double) 2.0)+0.5;
  2841.  
  2842.   DeltaX = Square.MaxX-Square.MinX;
  2843.   DeltaY = Square.MaxY-Square.MinY;
  2844.  
  2845.   Offset = 0;
  2846.   while(((Offset-DeltaY) < DeltaX) && ((Offset-DeltaX) < DeltaY))
  2847.   {
  2848.    if(Offset > DeltaX)
  2849.    {
  2850.     move(Square.MaxX,Square.MinY+(Offset-DeltaX));
  2851.    }
  2852.    else
  2853.    {
  2854.     move(Square.MinX+Offset,Square.MinY);
  2855.    }
  2856.  
  2857.    if(Offset > DeltaY)
  2858.    {
  2859.     cont(Square.MinX+(Offset-DeltaY),Square.MaxY);
  2860.    }
  2861.    else
  2862.    {
  2863.     cont(Square.MinX,Square.MinY+Offset);
  2864.    }
  2865.      Offset += Increment;
  2866.   }
  2867.  
  2868.   return;
  2869.  }
  2870. @EOF
  2871. set `wc -lwc <Map/Src/shade.c`
  2872. if test $1$2$3 != 3715358150
  2873. then
  2874.     echo ERROR: wc results of Map/Src/shade.c are $* should be 371 535 8150
  2875. fi
  2876.  
  2877. chmod 777 Map/Src/shade.c
  2878.  
  2879. echo x - Map/Src/station.c
  2880. cat >Map/Src/station.c <<'@EOF'
  2881. #include <stdio.h>
  2882. #include "types.h"
  2883.  
  2884. main(ArgC,ArgV)
  2885.  
  2886.  TypOfInt         ArgC;
  2887.  TypOfPtrToChar      ArgV[];
  2888.  
  2889.  {
  2890.   TypOfSpaceDefinition        WOR;
  2891.   TypOfSpaceDefinition        WIN;
  2892.   TypOfSpaceDefinition        ARE;
  2893.   TypOfFontDefinition         CHA;
  2894.   TypOfGeographicalDefinition     GEO;
  2895.   TypOfInt              PAT;
  2896.  
  2897.   TypOfDouble     Mercator();
  2898.  
  2899.  
  2900.   TypOfFloat     FactorX;
  2901.   TypOfFloat     FactorY;
  2902.  
  2903.   TypOfInt      DeltaX;
  2904.   TypOfInt      DeltaY;
  2905.  
  2906.   TypOfDouble     DeltaLongitude;
  2907.   TypOfDouble     DeltaLatitude;
  2908.  
  2909.   TypOfDouble     Longitude;
  2910.   TypOfDouble     Latitude;
  2911.  
  2912.   TypOfInt      X;
  2913.   TypOfInt      Y;
  2914.  
  2915.   TypOfInt      Delta;
  2916.   TypOfInt      Minimum();
  2917.  
  2918.   TypOfChar      InputLine[MAXTEXTLEN];
  2919.  
  2920.   TypOfChar      StrLatitude[10];
  2921.   TypOfChar      StrLongitude[10];
  2922.  
  2923.   TypOfDouble     GeoPosition();
  2924.  
  2925.                 TypOfInt Symbol;
  2926.                 TypOfInt Z;
  2927.                 TypOfInt y;
  2928.                 TypOfFloat dev;
  2929.        
  2930.   TypOfChar     LineMode[15];
  2931.                 
  2932.   GetArguments(ArgC,ArgV,&WOR,&WIN,&ARE,&CHA,&GEO,&PAT);
  2933.  
  2934.   window(ARE.MinX,ARE.MinY,ARE.MaxX,ARE.MaxY);
  2935.   LineType(PAT/10,LineMode);
  2936.   linemod(LineMode);
  2937.   color(PAT%10);
  2938.  
  2939.   DeltaX = ARE.MaxX - ARE.MinX;
  2940.   DeltaLongitude = GEO.MaxLongitude - GEO.MinLongitude;
  2941.   FactorX = DeltaX/DeltaLongitude;
  2942.  
  2943.   DeltaY = ARE.MaxY - ARE.MinY;
  2944.   DeltaLatitude = Mercator(GEO.MaxLatitude) - Mercator(GEO.MinLatitude);
  2945.   FactorY = DeltaY/DeltaLatitude;
  2946.  
  2947.   gets(InputLine);
  2948.   gets(InputLine); 
  2949.   if(gets(InputLine) == NULL)
  2950.   {
  2951.    fprintf(stderr,"Error: Input file for \"%s\" is empty\n",ArgV[0]);   
  2952.    exit(ERROR);
  2953.   }
  2954.   else
  2955.   {
  2956.    do
  2957.    {
  2958.     sscanf(InputLine,"%s %s %d",StrLatitude,StrLongitude,&Symbol); 
  2959.                                 
  2960.                                 Latitude = GeoPosition(StrLatitude);
  2961.     Longitude = GeoPosition(StrLongitude);
  2962.  
  2963.     X = (FactorX*(GEO.MaxLongitude-Longitude))+ARE.MinX;
  2964.     Y = (FactorY*(Mercator(Latitude)-Mercator(GEO.MinLatitude)))+ARE.MinY;
  2965.  
  2966.     Delta = SYMBOLSIZE*Minimum((ARE.MaxX-ARE.MinX),(ARE.MaxY-ARE.MinY));
  2967.                                 Z = Delta/2;
  2968.  
  2969.                                 switch(Symbol){
  2970.                                  case 1:  line(X-Z,Y-Z,X,Y+Z);     /*triangle*/
  2971.                                           line(X,Y+Z,X+Z,Y-Z);
  2972.                                           line(X+Z,Y-Z,X-Z,Y-Z);
  2973.                                           break;
  2974.                                  case 2:  dev = 0.0;               /*filled triangle*/
  2975.                                           for(y=Y-Z;y<=Y+Z;y++){
  2976.                                             line(X-Z+(int)dev,y,X+Z-(int)dev,y);
  2977.                                             dev+=0.5;
  2978.                                           }
  2979.                                           point(X,Y+Z);
  2980.                                           break;
  2981.                                  case 3:  line(X,Y-Z,X,Y+Z);       /*plus*/
  2982.               line(X-Z,Y,X+Z,Y);
  2983.                                           break;
  2984.                                  case 4:  line(X-Z,Y+Z,X-Z,Y-Z);   /*box*/ 
  2985.                                           line(X-Z,Y-Z,X+Z,Y-Z);
  2986.                                           line(X+Z,Y-Z,X+Z,Y+Z);
  2987.                                           line(X+Z,Y+Z,X-Z,Y+Z);
  2988.                                           break;
  2989.                                  case 5:  for(y=Y-Z;y<=Y+Z;y++)   /*filled box*/
  2990.                                             line(X-Z,y,X+Z,y);
  2991.                                           break;
  2992.                                  case 6:  circle(X,Y,Z);          /*circle*/
  2993.                                           break;
  2994.                                  case 7:  line(X-Z,Y,X,Y-Z);      /*diamond*/
  2995.                                           line(X,Y-Z,X+Z,Y);      
  2996.                                           line(X+Z,Y,X,Y+Z);      
  2997.                                           line(X,Y+Z,X-Z,Y);        
  2998.                                           break;                  
  2999.                                  case 8:  line(X-Z,Y-Z,X+Z,Y+Z);  /* x */
  3000.                                           line(X-Z,Y+Z,X+Z,Y-Z);
  3001.                                           break;
  3002.                                  default: line(X,Y-Z,X,Y+Z);      /*plus*/
  3003.                                           line(X-Z,Y,X+Z,Y);
  3004.                                           break;
  3005.                                 }
  3006.    } while(gets(InputLine) != NULL);
  3007.   }
  3008.   
  3009.   fflush(stdout);
  3010.   exit(OK);
  3011.  }
  3012.  
  3013.  
  3014. TypOfInt GetArguments(ArgC,ArgV,WOR,WIN,ARE,CHA,GEO,PAT)
  3015.  
  3016.  TypOfInt              ArgC;
  3017.  TypOfPtrToChar           ArgV[];
  3018.  
  3019.  TypOfSpaceDefinition        *WOR;
  3020.  TypOfSpaceDefinition        *WIN;
  3021.  TypOfSpaceDefinition        *ARE;
  3022.  TypOfFontDefinition         *CHA;
  3023.  TypOfGeographicalDefinition     *GEO;
  3024.  TypOfInt              *PAT;
  3025.  
  3026.  {
  3027.   sscanf(ArgV[1],"%d",&((*WOR).MinX));
  3028.   sscanf(ArgV[2],"%d",&((*WOR).MaxX));
  3029.   sscanf(ArgV[3],"%d",&((*WOR).MinY));
  3030.   sscanf(ArgV[4],"%d",&((*WOR).MaxY));
  3031.  
  3032.   sscanf(ArgV[5],"%d",&((*WIN).MinX));
  3033.   sscanf(ArgV[6],"%d",&((*WIN).MaxX));
  3034.   sscanf(ArgV[7],"%d",&((*WIN).MinY));
  3035.   sscanf(ArgV[8],"%d",&((*WIN).MaxY));
  3036.  
  3037.   sscanf(ArgV[9],"%d",&((*ARE).MinX));
  3038.   sscanf(ArgV[10],"%d",&((*ARE).MaxX));
  3039.   sscanf(ArgV[11],"%d",&((*ARE).MinY));
  3040.   sscanf(ArgV[12],"%d",&((*ARE).MaxY));
  3041.  
  3042.   sscanf(ArgV[13],"%d",&((*CHA).CharWidth));
  3043.   sscanf(ArgV[14],"%d",&((*CHA).CharHeight));
  3044.   sscanf(ArgV[15],"%d",&((*CHA).LineHeight));
  3045.  
  3046.   sscanf(ArgV[16],"%lf",&((*GEO).MinLongitude));
  3047.   sscanf(ArgV[17],"%lf",&((*GEO).MaxLongitude));
  3048.   sscanf(ArgV[18],"%lf",&((*GEO).MinLatitude));
  3049.   sscanf(ArgV[19],"%lf",&((*GEO).MaxLatitude));
  3050.  
  3051.   sscanf(ArgV[20],"%d",PAT);
  3052.  
  3053.   return;
  3054.  }
  3055. @EOF
  3056. set `wc -lwc <Map/Src/station.c`
  3057. if test $1$2$3 != 1742555648
  3058. then
  3059.     echo ERROR: wc results of Map/Src/station.c are $* should be 174 255 5648
  3060. fi
  3061.  
  3062. chmod 777 Map/Src/station.c
  3063.  
  3064. echo x - Map/Src/symbol.c
  3065. cat >Map/Src/symbol.c <<'@EOF'
  3066. #include <stdio.h>
  3067. #include "types.h"
  3068.  
  3069. main(ArgC,ArgV)
  3070.  
  3071.  TypOfInt         ArgC;
  3072.  TypOfPtrToChar      ArgV[];
  3073.  
  3074.  {
  3075.   TypOfSpaceDefinition        WOR;
  3076.   TypOfSpaceDefinition        WIN;
  3077.   TypOfSpaceDefinition        ARE;
  3078.   TypOfFontDefinition         CHA;
  3079.   TypOfGeographicalDefinition     GEO;
  3080.   TypOfInt              PAT;
  3081.  
  3082.  
  3083.   TypOfInt      PlotSymbol();
  3084.   TypOfDouble     Mercator();
  3085.   TypOfDouble     GeoPosition();
  3086.  
  3087.   TypOfFloat     FactorX;
  3088.   TypOfFloat     FactorY;
  3089.  
  3090.   TypOfInt      DeltaX;
  3091.   TypOfInt      DeltaY;
  3092.  
  3093.   TypOfDouble     DeltaLongitude;
  3094.   TypOfDouble     DeltaLatitude;
  3095.  
  3096.   TypOfDouble     Longitude;
  3097.   TypOfDouble     Latitude;
  3098.  
  3099.   TypOfInt      X;
  3100.   TypOfInt      Y;
  3101.   TypOfInt      StationType;
  3102.  
  3103.   TypOfChar      InputLine[MAXTEXTLEN];
  3104.   
  3105.   TypOfChar      StrLatitude[10];
  3106.   TypOfChar      StrLongitude[10];
  3107.   TypOfChar      LineMode[15];
  3108.  
  3109.  
  3110.   GetArguments(ArgC,ArgV,&WOR,&WIN,&ARE,&CHA,&GEO,&PAT);
  3111.  
  3112.   window(ARE.MinX,ARE.MinY,ARE.MaxX,ARE.MaxY);
  3113.   LineType(PAT/10,LineMode);
  3114.   linemod(LineMode);
  3115.   color(PAT%10);
  3116.  
  3117.   DeltaX = ARE.MaxX - ARE.MinX;
  3118.   DeltaLongitude = GEO.MaxLongitude - GEO.MinLongitude;
  3119.   FactorX = DeltaX/DeltaLongitude;
  3120.  
  3121.   DeltaY = ARE.MaxY - ARE.MinY;
  3122.   DeltaLatitude = Mercator(GEO.MaxLatitude) - Mercator(GEO.MinLatitude);
  3123.   FactorY = DeltaY/DeltaLatitude;
  3124.  
  3125.   gets(InputLine);
  3126.   gets(InputLine);
  3127.   while(gets(InputLine) != NULL)
  3128.   {
  3129.    sscanf(InputLine,"%s %s",StrLatitude,StrLongitude);
  3130.  
  3131.    Latitude = GeoPosition(StrLatitude);
  3132.    Longitude = GeoPosition(StrLongitude);
  3133.  
  3134.    StationType = 0; 
  3135.    sscanf(InputLine,"%*s %*s %d",&StationType);
  3136.  
  3137.    X = (FactorX*(GEO.MaxLongitude-Longitude))+ARE.MinX;
  3138.    Y = (FactorY*(Mercator(Latitude)-Mercator(GEO.MinLatitude)))+ARE.MinY;
  3139.    PlotSymbol(ARE,X,Y,StationType);
  3140.   }
  3141.  
  3142.   fflush(stdout);
  3143.   exit(OK);
  3144.  }
  3145.  
  3146.  
  3147. TypOfInt GetArguments(ArgC,ArgV,WOR,WIN,ARE,CHA,GEO,PAT)
  3148.  
  3149.  TypOfInt              ArgC;
  3150.  TypOfPtrToChar           ArgV[];
  3151.  
  3152.  TypOfSpaceDefinition        *WOR;
  3153.  TypOfSpaceDefinition        *WIN;
  3154.  TypOfSpaceDefinition        *ARE;
  3155.  TypOfFontDefinition         *CHA;
  3156.  TypOfGeographicalDefinition     *GEO;
  3157.  TypOfInt              *PAT;
  3158.  
  3159.  {
  3160.   sscanf(ArgV[1],"%d",&((*WOR).MinX));
  3161.   sscanf(ArgV[2],"%d",&((*WOR).MaxX));
  3162.   sscanf(ArgV[3],"%d",&((*WOR).MinY));
  3163.   sscanf(ArgV[4],"%d",&((*WOR).MaxY));
  3164.  
  3165.   sscanf(ArgV[5],"%d",&((*WIN).MinX));
  3166.   sscanf(ArgV[6],"%d",&((*WIN).MaxX));
  3167.   sscanf(ArgV[7],"%d",&((*WIN).MinY));
  3168.   sscanf(ArgV[8],"%d",&((*WIN).MaxY));
  3169.  
  3170.   sscanf(ArgV[9],"%d",&((*ARE).MinX));
  3171.   sscanf(ArgV[10],"%d",&((*ARE).MaxX));
  3172.   sscanf(ArgV[11],"%d",&((*ARE).MinY));
  3173.   sscanf(ArgV[12],"%d",&((*ARE).MaxY));
  3174.  
  3175.   sscanf(ArgV[13],"%d",&((*CHA).CharWidth));
  3176.   sscanf(ArgV[14],"%d",&((*CHA).CharHeight));
  3177.   sscanf(ArgV[15],"%d",&((*CHA).LineHeight));
  3178.  
  3179.   sscanf(ArgV[16],"%lf",&((*GEO).MinLongitude));
  3180.   sscanf(ArgV[17],"%lf",&((*GEO).MaxLongitude));
  3181.   sscanf(ArgV[18],"%lf",&((*GEO).MinLatitude));
  3182.   sscanf(ArgV[19],"%lf",&((*GEO).MaxLatitude));
  3183.  
  3184.   sscanf(ArgV[20],"%d",PAT);
  3185.  
  3186.   return;
  3187.  }
  3188.  
  3189.  
  3190. TypOfInt PlotSymbol(ARE,X,Y,Type)
  3191.  
  3192.  TypOfSpaceDefinition       ARE;
  3193.  TypOfInt             X;
  3194.  TypOfInt             Y;
  3195.  TypOfInt             Type;
  3196.  
  3197.  {
  3198.   TypOfInt    Minimum();
  3199.   TypOfInt    XOffset;
  3200.   TypOfInt    YOffset;
  3201.   TypOfInt    Offset;
  3202.   TypOfInt    Delta;
  3203.  
  3204.   TypOfDouble   Sinus;
  3205.   TypOfDouble   sqrt();
  3206.   TypOfDouble   asin();
  3207.   TypOfDouble   cos();
  3208.  
  3209.  
  3210.   Delta = SYMBOLSIZE*Minimum((ARE.MaxX-ARE.MinX),(ARE.MaxY-ARE.MinY));
  3211.   switch(Type)
  3212.   { 
  3213.    case 1 : Delta = Delta*sqrt((double) 2.0)+0.5;
  3214.         move(X-(Delta/2),Y);
  3215.         cont(X,Y+(Delta/2));
  3216.         cont(X+(Delta/2),Y);
  3217.         cont(X,Y-(Delta/2));
  3218.         cont(X-(Delta/2),Y);
  3219.         for(Offset = 1; Offset < (Delta/2); Offset++)
  3220.         {
  3221.          move(X-(Delta/2)+Offset,Y+Offset);
  3222.          cont(X+(Delta/2)-Offset,Y+Offset);
  3223.         }
  3224.         break;
  3225.  
  3226.    case 2 : Delta = Delta*sqrt((double) 2.0)+0.5;
  3227.         move(X-(Delta/2),Y);
  3228.         cont(X,Y+(Delta/2));
  3229.         cont(X+(Delta/2),Y);
  3230.         cont(X,Y-(Delta/2));
  3231.         cont(X-(Delta/2),Y);
  3232.         for(Offset = 1; Offset < (Delta/2); Offset++)
  3233.         {
  3234.          move(X-(Delta/2)+Offset,Y-Offset);
  3235.          cont(X+(Delta/2)-Offset,Y-Offset);
  3236.         }
  3237.         break;
  3238.  
  3239.    case 3 : line(X-(Delta/2),Y-(Delta/2),X+(Delta/2),Y+(Delta/2));
  3240.         line(X-(Delta/2),Y+(Delta/2),X+(Delta/2),Y-(Delta/2));
  3241.         break;
  3242.  
  3243.    case 4 : box(X-(Delta/2),Y-(Delta/2),X+(Delta/2),Y+(Delta/2));
  3244.         break;
  3245.  
  3246.    case 5 : box(X-(Delta/2),Y-(Delta/2),X+(Delta/2),Y+(Delta/2));
  3247.         circle(X,Y,(Delta/2));
  3248.         break;   
  3249.  
  3250.    case 6 : circle(X,Y,(Delta/2));
  3251.         break;
  3252.  
  3253.    case 7 : circle(X,Y,(Delta/2));
  3254.         YOffset = -(Delta/2)+1;
  3255.         while(YOffset < (Delta/2))
  3256.         {
  3257.          Sinus = YOffset/((double) (Delta/2));
  3258.          XOffset = (Delta/2)*cos(asin(Sinus));
  3259.          move(X-XOffset,Y+YOffset);
  3260.          cont(X+XOffset,Y+YOffset);
  3261.          YOffset++;
  3262.         }
  3263.         break;
  3264.          
  3265.    case 8 : line(X-(Delta/2),Y,X+(Delta/2),Y);
  3266.         line(X,Y-(Delta/2),X,Y+(Delta/2));
  3267.         break;
  3268.  
  3269.    default : break;
  3270.   }
  3271.  
  3272.  return(OK);
  3273.  }
  3274. @EOF
  3275. set `wc -lwc <Map/Src/symbol.c`
  3276. if test $1$2$3 != 2083005053
  3277. then
  3278.     echo ERROR: wc results of Map/Src/symbol.c are $* should be 208 300 5053
  3279. fi
  3280.  
  3281. chmod 777 Map/Src/symbol.c
  3282.  
  3283. echo x - Map/Src/test.c
  3284. cat >Map/Src/test.c <<'@EOF'
  3285.  
  3286. main()
  3287. {
  3288.     openpl();
  3289.     space(0,0,1000,1000);
  3290.     move(10,10);
  3291.     label("01234567890123456789");
  3292.     move(10,10);
  3293.     cont((int (1000/(float 640))*12) ,10);
  3294.     closepl();
  3295. }
  3296. @EOF
  3297. set `wc -lwc <Map/Src/test.c`
  3298. if test $1$2$3 != 1113158
  3299. then
  3300.     echo ERROR: wc results of Map/Src/test.c are $* should be 11 13 158
  3301. fi
  3302.  
  3303. chmod 777 Map/Src/test.c
  3304.  
  3305. echo x - Map/Src/tic.c
  3306. cat >Map/Src/tic.c <<'@EOF'
  3307. #include <stdio.h>
  3308. #include "types.h"
  3309.  
  3310. TypOfInt Tic(ARE,GEO,TP)
  3311.  
  3312.  TypOfSpaceDefinition      ARE;
  3313.  TypOfGeographicalDefinition   GEO;
  3314.  TypOfTicParameters       TP;
  3315.  
  3316.  {
  3317.   TypOfDouble          Mercator();
  3318.  
  3319.   TypOfInt           DeltaX;
  3320.   TypOfInt           DeltaY;
  3321.  
  3322.   TypOfFloat          DeltaLongitude;
  3323.   TypOfFloat          DeltaLatitude;
  3324.  
  3325.   TypOfFloat          FactorX;
  3326.   TypOfFloat           FactorY;
  3327.  
  3328.   TypOfInt           LongitudeTicNum;
  3329.   TypOfInt           LatitudeTicNum;
  3330.   
  3331.   TypOfDouble          TicLongitude;
  3332.   TypOfDouble          TicLatitude;
  3333.  
  3334.   TypOfInt           X;
  3335.   TypOfInt           Y;
  3336.   TypOfChar          LineMode[15];
  3337.  
  3338.  
  3339.   window(ARE.MinX-10,ARE.MinY-10,ARE.MaxX+10,ARE.MaxY+10);
  3340.   LineType(TP.TicPattern/10,LineMode);
  3341.   linemod(LineMode);
  3342.   color(TP.TicPattern%10);
  3343.  
  3344.   DeltaX = ARE.MaxX - ARE.MinX;
  3345.   DeltaLongitude = GEO.MaxLongitude - GEO.MinLongitude;
  3346.   FactorX = DeltaX/DeltaLongitude;
  3347.  
  3348.   DeltaY = ARE.MaxY - ARE.MinY;
  3349.   DeltaLatitude = Mercator(GEO.MaxLatitude) - Mercator(GEO.MinLatitude);
  3350.   FactorY = DeltaY/DeltaLatitude;
  3351.  
  3352.   LongitudeTicNum = (GEO.MinLongitude / TP.TicLongitudinalIncrement) + 1;
  3353.   while(LongitudeTicNum * TP.TicLongitudinalIncrement < GEO.MaxLongitude)
  3354.   {
  3355.     TicLongitude = LongitudeTicNum * TP.TicLongitudinalIncrement;
  3356.     X = FactorX * (GEO.MaxLongitude - TicLongitude); 
  3357.     move(X+ARE.MinX,ARE.MinY);
  3358.     cont(X+ARE.MinX,ARE.MinY+TICSIZE);
  3359.  
  3360.     LongitudeTicNum++;
  3361.   }
  3362.  
  3363.   LatitudeTicNum = (GEO.MinLatitude / TP.TicLatitudinalIncrement) + 1;
  3364.   while(LatitudeTicNum * TP.TicLatitudinalIncrement < GEO.MaxLatitude)
  3365.   {
  3366.     TicLatitude = LatitudeTicNum * TP.TicLatitudinalIncrement;
  3367.     Y = FactorY * (Mercator(TicLatitude) - Mercator(GEO.MinLatitude)); 
  3368.     move(ARE.MinX,Y+ARE.MinY);
  3369.     cont(ARE.MinX+TICSIZE,Y+ARE.MinY);
  3370.  
  3371.     LatitudeTicNum++;
  3372.   }
  3373.  
  3374.   LongitudeTicNum--;
  3375.   while(LongitudeTicNum * TP.TicLongitudinalIncrement > GEO.MinLongitude)
  3376.   {
  3377.     TicLongitude = LongitudeTicNum * TP.TicLongitudinalIncrement;
  3378.     X = FactorX * (GEO.MaxLongitude - TicLongitude); 
  3379.     move(X+ARE.MinX,ARE.MaxY);
  3380.     cont(X+ARE.MinX,ARE.MaxY-TICSIZE);
  3381.  
  3382.     LongitudeTicNum--;
  3383.   }
  3384.  
  3385.   LatitudeTicNum--;
  3386.   while(LatitudeTicNum * TP.TicLatitudinalIncrement > GEO.MinLatitude)
  3387.   {
  3388.     TicLatitude = LatitudeTicNum * TP.TicLatitudinalIncrement;
  3389.     Y = FactorY * (Mercator(TicLatitude) - Mercator(GEO.MinLatitude)); 
  3390.     move(ARE.MaxX,Y+ARE.MinY);
  3391.     cont(ARE.MaxX-TICSIZE,Y+ARE.MinY);
  3392.  
  3393.     LatitudeTicNum--;
  3394.   }
  3395.  
  3396.   fflush(stdout);
  3397.   return(OK);
  3398.  }
  3399. @EOF
  3400. set `wc -lwc <Map/Src/tic.c`
  3401. if test $1$2$3 != 921782481
  3402. then
  3403.     echo ERROR: wc results of Map/Src/tic.c are $* should be 92 178 2481
  3404. fi
  3405.  
  3406. chmod 777 Map/Src/tic.c
  3407.  
  3408. echo x - Map/Src/transform.c
  3409. cat >Map/Src/transform.c <<'@EOF'
  3410. #include <stdio.h>
  3411. #include "types.h"
  3412.  
  3413. TypOfDouble GeoPosition();
  3414.  
  3415.                 TypOfChar                        HeaderLine[MAXTEXTLEN];
  3416.         TypOfChar                        StrLatitude[10];
  3417.         TypOfChar                        StrLongitude[10];
  3418.                 TypOfDouble                    Longitude;
  3419.         TypOfDouble                    Latitude;
  3420.                 int                            PenPos;
  3421. void main()
  3422. {
  3423.   FILE *IN,*OUT;
  3424.   char filename1[80],filename2[80];
  3425.   
  3426.   printf("\nEnter file to transfer: ");
  3427.   scanf("%s",filename1);
  3428.  
  3429.   printf("\nEnter file to transfer to: ");
  3430.   scanf("%s",filename2);
  3431.  
  3432.   IN = fopen(filename1,"r");
  3433.   if(IN == NULL)
  3434.     {
  3435.     fprintf(stderr,"Error: Cannot open data file %s\n",filename1);
  3436.     exit(-1);
  3437.      }
  3438.  
  3439.   OUT = fopen(filename2,"w");
  3440.   if(OUT == NULL)
  3441.      {
  3442.         fprintf(stderr,"Error: Cannot open data file %s\n",filename2);
  3443.         exit(ERROR);
  3444.      }
  3445.    fgets(HeaderLine,MAXTEXTLEN,IN);
  3446.    fgets(HeaderLine,MAXTEXTLEN,IN);
  3447.    fprintf(OUT,"lat\tlong\tpen\n");
  3448.    fprintf(OUT,"---\t----\t---\n");
  3449.    while(fscanf(IN,"%s %s %d",StrLatitude,StrLongitude,&PenPos) != EOF)
  3450.     {
  3451.     Latitude = GeoPosition(StrLatitude);
  3452.     Longitude = GeoPosition(StrLongitude);
  3453.     fprintf(OUT,"%f\t%f\t%d\n",Latitude,Longitude,PenPos);
  3454.     }
  3455.   fclose(IN);
  3456.   fclose(OUT);
  3457. }
  3458.  
  3459. TypOfDouble GeoPosition(String)
  3460.  
  3461.     TypOfPtrToChar                        String;
  3462.  
  3463.     {
  3464.         TypOfInt                                Degrees;
  3465.         TypOfInt                                Minutes;
  3466.         TypOfInt                                Seconds;
  3467.  
  3468.         sscanf(String,"%2d%2d%2d",&Degrees,&Minutes,&Seconds);
  3469.  
  3470.         return(Degrees+(Minutes/60.0)+(Seconds/3600.0));
  3471.     }
  3472.  
  3473. @EOF
  3474. set `wc -lwc <Map/Src/transform.c`
  3475. if test $1$2$3 != 631031466
  3476. then
  3477.     echo ERROR: wc results of Map/Src/transform.c are $* should be 63 103 1466
  3478. fi
  3479.  
  3480. chmod 777 Map/Src/transform.c
  3481.  
  3482. echo x - Map/Src/transform.info '[non-ascii]'
  3483. $unpacker <<'@eof'
  3484. begin 777 Map/Src/transform.info
  3485. M"E1204Y31D]233H*+2TM+2TM+2TM"@H)5')A;G-F;W)M(&ES(&$@<VEM<&QE
  3486. M('!R;V=R86T@=&\@8V]P>2!D871A(&EN"@D*"6QA=" @("!L;VYG(" @<&5N
  3487. M"0D);&%T( EL;VYG"7!E;@H),3(S-#4V(#$R,S0U-B Q(" @(" @(" @(&9O
  3488. M<FUA="!I;G1O(" @(#$R+C,T-38@,3(N,S0U-B Q(" @(" @(&9O<FUA="X*
  3489. G"@ET;R!U<V4@:G5S="!T>7!E.B!T<F%N<V9O<FTN"@H*"0D)"0D)
  3490.  
  3491. end
  3492. @eof
  3493. set `wc -lwc <Map/Src/transform.info`
  3494. if test $1$2$3 != 1231219
  3495. then
  3496.     echo ERROR: wc results of Map/Src/transform.info are $* should be 12 31 219
  3497. fi
  3498.  
  3499. chmod 777 Map/Src/transform.info
  3500.  
  3501. echo x - Map/Src/transformback.c
  3502. cat >Map/Src/transformback.c <<'@EOF'
  3503. #include <stdio.h>
  3504. #include "types.h"
  3505.  
  3506. int GeoPosition();
  3507.  
  3508.                 TypOfChar                        HeaderLine[MAXTEXTLEN];
  3509.         TypOfChar                        StrLatitude[10];
  3510.         TypOfChar                        StrLongitude[10];
  3511.                 int                    Longitude;
  3512.         int                    Latitude;
  3513.                 int                            PenPos;
  3514. void main()
  3515. {
  3516.   FILE *IN,*OUT;
  3517.   char filename1[80],filename2[80];
  3518.   
  3519.   printf("\nEnter file to transfer: ");
  3520.   scanf("%s",filename1);
  3521.  
  3522.   printf("\nEnter file to transfer to: ");
  3523.   scanf("%s",filename2);
  3524.  
  3525.   IN = fopen(filename1,"r");
  3526.   if(IN == NULL)
  3527.     {
  3528.     fprintf(stderr,"Error: Cannot open data file %s\n",filename1);
  3529.     exit(-1);
  3530.      }
  3531.  
  3532.   OUT = fopen(filename2,"w");
  3533.   if(OUT == NULL)
  3534.      {
  3535.         fprintf(stderr,"Error: Cannot open data file %s\n",filename2);
  3536.         exit(ERROR);
  3537.      }
  3538.    fgets(HeaderLine,MAXTEXTLEN,IN);
  3539.    fgets(HeaderLine,MAXTEXTLEN,IN);
  3540.    fprintf(OUT,"lat\tlong\tpen\n");
  3541.    fprintf(OUT,"---\t----\t---\n");
  3542.    while(fscanf(IN,"%s %s %d",StrLatitude,StrLongitude,&PenPos) != EOF)
  3543.     {
  3544.     Latitude = GeoPosition(StrLatitude);
  3545.     Longitude = GeoPosition(StrLongitude);
  3546.     fprintf(OUT,"%d\t%d\t%d\n",Latitude,Longitude,PenPos);
  3547.     }
  3548.   fclose(IN);
  3549.   fclose(OUT);
  3550. }
  3551.  
  3552. int GeoPosition(String)
  3553.  
  3554.     TypOfPtrToChar                        String;
  3555.  
  3556.     {
  3557.         double num;
  3558.         int res,res2,res3;
  3559.  
  3560.         sscanf(String,"%lf",&num);
  3561.         
  3562.         res=(int) (num);
  3563.         num=num-res;
  3564.         res=res*10000; 
  3565.         num=num*60;
  3566.         res2=(int)(num);
  3567.         num=num-res2;
  3568.         res2=res2*100;
  3569.         num=num*60;
  3570.         res3=(int)(num+.5);
  3571.         return(res+res2+res3);
  3572.     }
  3573.  
  3574.  
  3575.  
  3576.  
  3577.  
  3578. @EOF
  3579. set `wc -lwc <Map/Src/transformback.c`
  3580. if test $1$2$3 != 751111494
  3581. then
  3582.     echo ERROR: wc results of Map/Src/transformback.c are $* should be 75 111 1494
  3583. fi
  3584.  
  3585. chmod 777 Map/Src/transformback.c
  3586.  
  3587. echo x - Map/Src/types.h
  3588. cat >Map/Src/types.h <<'@EOF'
  3589. #define        YES    1
  3590. #define        NO    0
  3591.  
  3592. #define        FALSE    0
  3593. #define        TRUE        1
  3594.  
  3595. #define        UP        0
  3596. #define        DOWN        1
  3597.  
  3598. #define        OK        0
  3599. #define        ERROR    1
  3600.  
  3601. #define        LESS        -1
  3602. #define        EQUAL    0
  3603. #define        GREATER    +1
  3604.  
  3605. #define        LINEBREAK        '^'
  3606.  
  3607. #define        TICSIZE            10
  3608. #define        SYMBOLSIZE    0.0125
  3609.  
  3610. #define        FNAMELEN        64
  3611. #define        MAXTEXTLEN    512
  3612.  
  3613. #define        XNUMCOORDINATES    1500
  3614. #define        YNUMCOORDINATES 1024
  3615.  
  3616.  
  3617. typedef        int            TypOfInt;
  3618.  
  3619. typedef        long        TypOfLong;
  3620.  
  3621. typedef        char        TypOfChar;
  3622.  
  3623. typedef        char *    TypOfPtrToChar;
  3624.  
  3625. typedef        float        TypOfFloat;
  3626.  
  3627. typedef        double    TypOfDouble;
  3628.  
  3629.  
  3630. typedef struct    StrOfGraphicsTerminalCapabilites
  3631.  
  3632.     {
  3633.         TypOfInt        ChrWidth;
  3634.         TypOfInt        ChrHeight;
  3635.         TypOfInt        LinHeight;
  3636.         TypOfInt        ScrMaxWidth;
  3637.         TypOfInt        ScrWidth;
  3638.         TypOfInt        ScrHeight;
  3639.         TypOfInt        RasterSupport;
  3640.         TypOfInt        FillSupport;
  3641.         TypOfInt        ColorSupport;
  3642.  
  3643.     }                    TypOfGraphicsTerminalCapabilities;
  3644.  
  3645.     
  3646. typedef struct    StrOfSpaceDefinition
  3647.  
  3648.     {    
  3649.         TypOfInt        MinX;
  3650.         TypOfInt        MaxX;
  3651.         TypOfInt        MinY;
  3652.         TypOfInt        MaxY;
  3653.  
  3654.     }                     TypOfSpaceDefinition;
  3655.  
  3656.  
  3657. typedef struct StrOfFontDefinition
  3658.  
  3659.     {
  3660.         TypOfInt        CharWidth;
  3661.         TypOfInt        CharHeight;
  3662.         TypOfInt        LineHeight;
  3663.  
  3664.     }                    TypOfFontDefinition;
  3665.  
  3666.  
  3667. typedef struct    StrOfGeographicalDefinition
  3668.  
  3669.     {
  3670.         TypOfDouble    MinLongitude;
  3671.         TypOfDouble    MaxLongitude;
  3672.  
  3673.         TypOfDouble    MinLatitude;
  3674.         TypOfDouble    MaxLatitude;
  3675.  
  3676.     }                    TypOfGeographicalDefinition;
  3677.  
  3678.  
  3679. typedef struct StrOfEnvironmentParameters
  3680.  
  3681.     {
  3682.         TypOfDouble        EnvMinLongitude;
  3683.         TypOfDouble        EnvMaxLongitude;
  3684.         TypOfDouble        EnvMinLatitude;
  3685.         TypOfDouble        EnvMaxLatitude;
  3686.  
  3687.         TypOfFloat        EnvMinX;
  3688.         TypOfFloat        EnvMaxX;
  3689.         TypOfFloat        EnvMinY;
  3690.         TypOfFloat        EnvMaxY;
  3691.  
  3692.     }  TypOfEnvironmentParameters;
  3693.  
  3694.  
  3695. typedef struct StrOfOptionParameters
  3696.  
  3697.     {
  3698.         TypOfPtrToChar                HeadOfOptionList;
  3699.         TypOfPtrToChar                TailOfOptionList;
  3700.         TypOfInt                            CountOfOptionList;
  3701.         TypOfInt                            DefaultOptionPattern;
  3702.  
  3703.     }                    TypOfOptionParameters;
  3704.  
  3705.  
  3706. typedef struct StrOfNodeForOptionParameters
  3707.  
  3708.     {
  3709.         TypOfChar                            OptionName[FNAMELEN];
  3710.         TypOfChar                            OptionArgumentString[MAXTEXTLEN];
  3711.         TypOfInt                            OptionPattern;
  3712.         TypOfPtrToChar                OptionNextPointer;
  3713.  
  3714.     }                    TypOfNodeForOptionParameters;
  3715.  
  3716.  
  3717. typedef struct StrOfMapParameters
  3718.  
  3719.     {
  3720.         TypOfInt        EraseSelected;
  3721.         TypOfInt        OptionSelected;
  3722.         TypOfInt        BorderSelected;
  3723.         TypOfInt        TicSelected;
  3724.         TypOfInt        LabelSelected;
  3725.         TypOfInt        CommentSelected;
  3726.         TypOfInt        FrameSelected;
  3727.  
  3728.     }                    TypOfMapParameters;
  3729.  
  3730.  
  3731. typedef struct    StrOfBorderParameters
  3732.  
  3733.     {
  3734.         TypOfChar        BorderDataFile[FNAMELEN];
  3735.  
  3736.         TypOfInt        BorderPattern;
  3737.  
  3738.     }                    TypOfBorderParameters;
  3739.  
  3740.  
  3741. typedef struct    StrOfTicParameters
  3742.  
  3743.     {
  3744.  
  3745.         TypOfInt        TicPattern;
  3746.  
  3747.         TypOfDouble    TicLongitudinalIncrement;
  3748.         TypOfDouble    TicLatitudinalIncrement;
  3749.  
  3750.     }                    TypOfTicParameters;
  3751.  
  3752.  
  3753. typedef struct    StrOfLabelParameters
  3754.  
  3755.     {
  3756.         TypOfInt        LabelPattern;
  3757.  
  3758.         TypOfDouble    LabelLongitudinalInterval;
  3759.         TypOfDouble    LabelLatitudinalInterval;
  3760.  
  3761.     }                                                                            TypOfLabelParameters;    
  3762.  
  3763.  
  3764. typedef struct StrOfCommentParameters
  3765.  
  3766.     {
  3767.         TypOfInt        CommentPattern;
  3768.         TypOfChar        CommentText[MAXTEXTLEN];
  3769.  
  3770.     }                                                                            TypOfCommentParameters;
  3771.  
  3772.  
  3773. typedef struct StrOfFrameParameters
  3774.  
  3775.     {
  3776.         TypOfInt        FramePattern;
  3777.  
  3778.     }                                                                            TypOfFrameParameters;
  3779.  
  3780.  
  3781. @EOF
  3782. set `wc -lwc <Map/Src/types.h`
  3783. if test $1$2$3 != 1922593154
  3784. then
  3785.     echo ERROR: wc results of Map/Src/types.h are $* should be 192 259 3154
  3786. fi
  3787.  
  3788. chmod 777 Map/Src/types.h
  3789.  
  3790. echo x - Map/Src/value.c
  3791. cat >Map/Src/value.c <<'@EOF'
  3792. #include <stdio.h>
  3793. #include "types.h"
  3794.  
  3795. main(ArgC,ArgV)
  3796.  
  3797.  TypOfInt         ArgC;
  3798.  TypOfPtrToChar      ArgV[];
  3799.  
  3800.  {
  3801.   TypOfSpaceDefinition        WOR;
  3802.   TypOfSpaceDefinition        WIN;
  3803.   TypOfSpaceDefinition        ARE;
  3804.   TypOfFontDefinition         CHA;
  3805.   TypOfGeographicalDefinition     GEO;
  3806.   TypOfInt              PAT;
  3807.  
  3808.   TypOfDouble     Mercator();
  3809.  
  3810.  
  3811.   TypOfFloat     FactorX;
  3812.   TypOfFloat     FactorY;
  3813.  
  3814.   TypOfInt      DeltaX;
  3815.   TypOfInt      DeltaY;
  3816.  
  3817.   TypOfDouble     DeltaLongitude;
  3818.   TypOfDouble     DeltaLatitude;
  3819.  
  3820.   TypOfDouble     Longitude;
  3821.   TypOfDouble     Latitude;
  3822.  
  3823.   TypOfInt      X;
  3824.   TypOfInt      Y;
  3825.  
  3826.   TypOfInt      Delta;
  3827.   TypOfInt      Minimum();
  3828.  
  3829.   TypOfChar      InputLine[MAXTEXTLEN];
  3830.   TypOfChar      ValueString[MAXTEXTLEN];
  3831.  
  3832.   TypOfChar      StrLatitude[10];
  3833.   TypOfChar      StrLongitude[10];
  3834.  
  3835.   TypOfDouble     GeoPosition();
  3836.   TypOfChar       LineMode[15];
  3837.  
  3838.  
  3839.   GetArguments(ArgC,ArgV,&WOR,&WIN,&ARE,&CHA,&GEO,&PAT);
  3840.  
  3841.   window(ARE.MinX,ARE.MinY,ARE.MaxX,ARE.MaxY);
  3842.   LineType(PAT/10,LineMode);
  3843.   linemod(LineMode);
  3844.   color(PAT%10);
  3845.  
  3846.   DeltaX = ARE.MaxX - ARE.MinX;
  3847.   DeltaLongitude = GEO.MaxLongitude - GEO.MinLongitude;
  3848.   FactorX = DeltaX/DeltaLongitude;
  3849.  
  3850.   DeltaY = ARE.MaxY - ARE.MinY;
  3851.   DeltaLatitude = Mercator(GEO.MaxLatitude) - Mercator(GEO.MinLatitude);
  3852.   FactorY = DeltaY/DeltaLatitude;
  3853.  
  3854.   gets(InputLine);
  3855.   gets(InputLine); 
  3856.   if(gets(InputLine) == NULL)
  3857.   {
  3858.    fprintf(stderr,"Error: Input file for \"%s\" is empty\n",ArgV[0]);   
  3859.    exit(ERROR);
  3860.   }
  3861.   else
  3862.   {
  3863.    do
  3864.    {
  3865.     sscanf(InputLine,"%s %s",StrLatitude,StrLongitude);
  3866.  
  3867.     Latitude = GeoPosition(StrLatitude);
  3868.     Longitude = GeoPosition(StrLongitude);
  3869.  
  3870.     sscanf(InputLine,"%*s %*s %[^\0]s",ValueString);
  3871.  
  3872.     X = (FactorX*(GEO.MaxLongitude-Longitude))+ARE.MinX;
  3873.     Y = (FactorY*(Mercator(Latitude)-Mercator(GEO.MinLatitude)))+ARE.MinY;
  3874.     Delta = SYMBOLSIZE*Minimum((ARE.MaxX-ARE.MinX),(ARE.MaxY-ARE.MinY));
  3875.  
  3876.     move(X,Y);
  3877.     label(ValueString);
  3878.  
  3879.    } while(gets(InputLine) != NULL);
  3880.   }
  3881.   
  3882.   fflush(stdout);
  3883.   exit(OK);
  3884.  }
  3885.  
  3886.  
  3887. TypOfInt GetArguments(ArgC,ArgV,WOR,WIN,ARE,CHA,GEO,PAT)
  3888.  
  3889.  TypOfInt              ArgC;
  3890.  TypOfPtrToChar           ArgV[];
  3891.  
  3892.  TypOfSpaceDefinition        *WOR;
  3893.  TypOfSpaceDefinition        *WIN;
  3894.  TypOfSpaceDefinition        *ARE;
  3895.  TypOfFontDefinition         *CHA;
  3896.  TypOfGeographicalDefinition     *GEO;
  3897.  TypOfInt              *PAT;
  3898.  
  3899.  {
  3900.   sscanf(ArgV[1],"%d",&((*WOR).MinX));
  3901.   sscanf(ArgV[2],"%d",&((*WOR).MaxX));
  3902.   sscanf(ArgV[3],"%d",&((*WOR).MinY));
  3903.   sscanf(ArgV[4],"%d",&((*WOR).MaxY));
  3904.  
  3905.   sscanf(ArgV[5],"%d",&((*WIN).MinX));
  3906.   sscanf(ArgV[6],"%d",&((*WIN).MaxX));
  3907.   sscanf(ArgV[7],"%d",&((*WIN).MinY));
  3908.   sscanf(ArgV[8],"%d",&((*WIN).MaxY));
  3909.  
  3910.   sscanf(ArgV[9],"%d",&((*ARE).MinX));
  3911.   sscanf(ArgV[10],"%d",&((*ARE).MaxX));
  3912.   sscanf(ArgV[11],"%d",&((*ARE).MinY));
  3913.   sscanf(ArgV[12],"%d",&((*ARE).MaxY));
  3914.  
  3915.   sscanf(ArgV[13],"%d",&((*CHA).CharWidth));
  3916.   sscanf(ArgV[14],"%d",&((*CHA).CharHeight));
  3917.   sscanf(ArgV[15],"%d",&((*CHA).LineHeight));
  3918.  
  3919.   sscanf(ArgV[16],"%lf",&((*GEO).MinLongitude));
  3920.   sscanf(ArgV[17],"%lf",&((*GEO).MaxLongitude));
  3921.   sscanf(ArgV[18],"%lf",&((*GEO).MinLatitude));
  3922.   sscanf(ArgV[19],"%lf",&((*GEO).MaxLatitude));
  3923.  
  3924.   sscanf(ArgV[20],"%d",PAT);
  3925.  
  3926.   return;
  3927.  }
  3928. @EOF
  3929. set `wc -lwc <Map/Src/value.c`
  3930. if test $1$2$3 != 1361813230
  3931. then
  3932.     echo ERROR: wc results of Map/Src/value.c are $* should be 136 181 3230
  3933. fi
  3934.  
  3935. chmod 777 Map/Src/value.c
  3936.  
  3937. echo x - Map/Src/wincol.c
  3938. cat >Map/Src/wincol.c <<'@EOF'
  3939. #include <stdio.h>
  3940. #include "types.h"
  3941.  
  3942. extern int minx,miny,maxx,maxy;
  3943. extern TypOfFloat                    scalingfactor;
  3944.  
  3945. void window(a,b,c,d)
  3946. TypOfInt a, b, c, d;
  3947. {
  3948.   fprintf(stdout,"w");
  3949.   fflush(stdout);
  3950.   putsi(a);
  3951.   putsi(b);
  3952.   putsi(c);
  3953.   putsi(d);
  3954.   return; 
  3955.  
  3956.  
  3957.  
  3958. void color(b)
  3959. TypOfInt b;
  3960. {
  3961.   fprintf(stdout,"z");
  3962.   fflush(stdout);
  3963.   putsi(b); 
  3964.   return;
  3965. }
  3966. @EOF
  3967. set `wc -lwc <Map/Src/wincol.c`
  3968. if test $1$2$3 != 2836368
  3969. then
  3970.     echo ERROR: wc results of Map/Src/wincol.c are $* should be 28 36 368
  3971. fi
  3972.  
  3973. chmod 777 Map/Src/wincol.c
  3974.  
  3975. chmod 777 Map/Src
  3976.  
  3977. rm -f /tmp/unpack$$
  3978. exit 0
  3979.  
  3980.  
  3981.  
  3982.  
  3983.