home *** CD-ROM | disk | FTP | other *** search
/ Dream 45 / Amiga_Dream_45.iso / Amiga / Magazine / Dossier-LaTeX / AmiWeb2C.lha / source / web2c-6.1 / web2c / lib / texmf.ch < prev    next >
Text File  |  1995-04-11  |  33KB  |  1,146 lines

  1. Changes for TEXMF.C by Andreas Scherer, April 10, 1995.
  2.  
  3. @x l.9
  4. #ifdef TeX
  5. #include "texd.h"
  6. #define dump_default_var TEXformatdefault
  7. #define dump_default " plain.fmt"
  8. #define dump_format " %s.fmt"
  9. #define dump_ext_length 4
  10. #define dump_default_length formatdefaultlength
  11. #define virgin_program "virtex"
  12. #define main_program texbody
  13. #define edit_value tex_edit_value
  14. #define edit_var "TEXEDIT"
  15. #else /* not TeX */
  16. #include "mfd.h"
  17. #define dump_default_var MFbasedefault
  18. #define dump_default " plain.base"
  19. #define dump_format " %s.base"
  20. #define dump_ext_length 5
  21. #define dump_default_length basedefaultlength
  22. #define virgin_program "virmf"
  23. #define main_program main_body
  24. #define edit_value mf_edit_value
  25. #define edit_var "MFEDIT"
  26. #endif /* not TeX */
  27. @y
  28. #ifdef TeX
  29. #include "texd.h"
  30. #define dump_default_var TEXformatdefault
  31. #define dump_default " plain.fmt"
  32. #define dump_format " %s.fmt"
  33. #define dump_ext_length 4
  34. #define dump_default_length formatdefaultlength
  35. #define virgin_program "virtex"
  36. #define main_program texbody
  37. #define edit_value tex_edit_value
  38. #define edit_var "TEXEDIT"
  39. #elif defined (MF) /* not TeX, MetaFont or MetaPost */
  40. #include "mfd.h"
  41. #define dump_default_var MFbasedefault
  42. #define dump_default " plain.base"
  43. #define dump_format " %s.base"
  44. #define dump_ext_length 5
  45. #define dump_default_length basedefaultlength
  46. #define virgin_program "virmf"
  47. #define main_program main_body
  48. #define edit_value mf_edit_value
  49. #define edit_var "MFEDIT"
  50. #else /* not MetaFont, but MetaPost */
  51. #include "mpd.h"
  52. #define dump_default_var MPmemdefault
  53. #define dump_default " plain.mem"
  54. #define dump_format " %s.mem"
  55. #define dump_ext_length 4
  56. #define dump_default_length memdefaultlength
  57. #define virgin_program "inimp"
  58. #define main_program main_body
  59. #define edit_value mp_edit_value
  60. #define edit_var "MPEDIT"
  61. #endif /* MetaPost */
  62. @z
  63.  
  64. @x l.39
  65. extern struct tm *localtime ();
  66. @y
  67. #ifdef _AMIGA
  68. #ifdef TeX
  69. const unsigned char Version[] = "$VER: TeX 3.14159 ("__DATE__", "__TIME__")\n";
  70. #elif defined (MF)
  71. const unsigned char Version[] = "$VER: MetaFont 2.718 ("__DATE__", "__TIME__")\n";
  72. #else
  73. const unsigned char Version[] = "$VER: MetaPost 0.63 ("__DATE__", "__TIME__")\n";
  74. #endif
  75. #endif /* _AMIGA */
  76. @z
  77.  
  78. @x l.67
  79. main (ac, av)
  80.     int ac;
  81.     char *av[];
  82. @y
  83. main (
  84.     int ac,
  85.     char *av[])
  86. @z
  87.  
  88. It's jolly hard to find some of these bugs.
  89.  
  90. @x l.71
  91.   gargc = ac;
  92. @y
  93.   gargc = argc = ac;
  94. @z
  95.  
  96. I would like to do `close_all' and `as_free_memory' in `uexit', but as the
  97. respective module is used in `lib.lib' for all the other programs as well,
  98. a special Cesque trick has to be applied.  It is very important to keep the
  99. correct sequence of `atexit' calls; these entries are called LIFO, and the
  100. `amiga.c' module might do something with the allocated memory.
  101.  
  102. @x l.118
  103.   main_program ();
  104. @y
  105.  
  106. #ifdef VARMEM
  107.  
  108. #ifdef TeX
  109.   setpaths (
  110.     TEXFORMATPATHBIT +
  111.     TEXINPUTPATHBIT +
  112.     TEXPOOLPATHBIT +
  113.     TFMFILEPATHBIT +
  114.     TEXCONFIGPATHBIT);
  115. #elif defined (MF) /* Not TeX, MetaFont or MetaPost */
  116.   setpaths (
  117.     MFBASEPATHBIT +
  118.     MFINPUTPATHBIT +
  119.     MFPOOLPATHBIT +
  120.     MFCONFIGPATHBIT);
  121. #else /* Not MetaFont, but MetaPost */
  122.   setpaths (
  123.     MPMEMPATHBIT +
  124.     MPINPUTPATHBIT +
  125.     MPPOOLPATHBIT +
  126.     MPCONFIGPATHBIT +
  127.     TFMFILEPATHBIT +
  128.     MFINPUTPATHBIT);
  129. #endif /* MetaPost */
  130.  
  131.   as_getsizes();
  132.   as_alloc_memory();
  133.  
  134.   if(atexit(&as_free_memory)) { /* Can't happen. */
  135.     fprintf(stderr, "Exit trap failure! (as_free_memory)\n");
  136.     uexit(error_message_issued);
  137.     }
  138. #endif /* VARMEM */
  139.  
  140. #if defined ( MF ) && defined ( AMIWIN ) && ! defined ( TRAP)
  141.   if(atexit(&close_all)) { /* Can't happen. */
  142.     fprintf(stderr, "Exit trap failure! (close_all)\n");
  143.     uexit(error_message_issued);
  144.     }
  145. #endif /* MF and AMIWIN and !TRAP */
  146.  
  147.   main_program ();
  148. @z
  149.  
  150. @x l.169
  151. catch_interrupt (arg)
  152.     int arg;
  153. @y
  154. catch_interrupt (
  155.     int arg)
  156. @z
  157.  
  158. @x l.251
  159.       (void) fprintf (stderr, "Please ask a wizard to enlarge me.\n");
  160.       uexit (1);
  161. @y
  162. #ifdef VARMEM
  163.       (void) fprintf (stderr, "Please ask a wizard to enlarge me.\n");
  164. #else
  165.       (void) fprintf (stderr, "Please alter the configuration file.\n");
  166. #endif
  167.       uexit (error_message_issued);
  168. @z
  169.  
  170. @x l.326
  171.               uexit (1);
  172. @y
  173.               uexit (error_message_issued);
  174. @z
  175.  
  176. @x l.339
  177.           uexit (1);
  178. @y
  179.           uexit (error_message_issued);
  180. @z
  181.  
  182. @x l.369
  183.   uexit (1);
  184. @y
  185.   uexit (error_message_issued);
  186. @z
  187.  
  188. @x l.393
  189. swap_items (p, nitems, size)
  190.   char *p;
  191.   int nitems;
  192.   int size;
  193. @y
  194. swap_items (
  195.   char *p,
  196.   int nitems,
  197.   int size)
  198. @z
  199.  
  200. @x l.455
  201.       uexit (1);
  202. @y
  203.       uexit (error_message_issued);
  204. @z
  205.  
  206. @x l.479
  207.       uexit (1);
  208. @y
  209.       uexit (error_message_issued);
  210. @z
  211.  
  212. @x l.502
  213.       uexit (1);
  214. @y
  215.       uexit (error_message_issued);
  216. @z
  217.  
  218. Add window support for the AmigaOS 2.1 and up.
  219.  
  220. @x l.570
  221. #undef X11WIN
  222. @y
  223. #undef X11WIN
  224. #undef AMIWIN
  225. @z
  226.  
  227. @x l.609
  228. #ifdef X11WIN
  229. extern mf_x11_initscreen (), mf_x11_updatescreen ();
  230. extern mf_x11_blankrectangle (), mf_x11_paintrow ();
  231. #endif
  232. @y
  233. #ifdef X11WIN
  234. extern mf_x11_initscreen (), mf_x11_updatescreen ();
  235. extern mf_x11_blankrectangle (), mf_x11_paintrow ();
  236. #endif
  237.  
  238. #ifdef AMIWIN
  239. extern mf_ami_initscreen (), mf_ami_updatescreen ();
  240. extern mf_ami_blankrectangle (), mf_ami_paintrow ();
  241. #endif
  242. @z
  243.  
  244. @x l.624
  245.   int (*mfwsw_initscreen) ();
  246.   int (*mfwsw_updatescrn) ();
  247.   int (*mfwsw_blankrect) ();
  248.   int (*mfwsw_paintrow) ();
  249. @y
  250.   int (*mfwsw_initscreen)(void);
  251.   int (*mfwsw_updatescrn)(void);
  252.   int (*mfwsw_blankrect)(screencol,screencol,screenrow,screenrow);
  253.   int (*mfwsw_paintrow)(screenrow,pixelcolor,transspec,screencol);
  254. @z
  255.  
  256. @x l.665
  257. #ifdef X11WIN
  258.   { "xterm", mf_x11_initscreen, mf_x11_updatescreen, 
  259.     mf_x11_blankrectangle, mf_x11_paintrow },
  260. #endif
  261. @y
  262. #ifdef AMIWIN
  263.   { "amiterm", mf_ami_initscreen, mf_ami_updatescreen, 
  264.     mf_ami_blankrectangle, mf_ami_paintrow },
  265. #endif
  266. @z
  267.  
  268. Open the Online Display even when MFTERM isn't set.
  269.  
  270. @x l.692
  271.   /* If MFTERM is set, use it.  */
  272.   char *ttytype = getenv ("MFTERM");
  273.   
  274.   if (ttytype == NULL)
  275.     { /* If DISPLAY is set, we are X11; otherwise, who knows.  */
  276.       boolean have_display = getenv ("DISPLAY") != NULL;
  277.       ttytype = have_display ? "xterm" : getenv ("TERM");
  278.     }
  279.  
  280.   /* If we don't know kind of terminal this is, or if Metafont isn't
  281.       being run interactively, don't do any online output.  */
  282.   if (ttytype == NULL || !isatty (fileno (stdout)))
  283.     return 0;
  284. @y
  285.   /* If MFTERM is set, use it.  */
  286.   char *ttytype = getenv("MFTERM");
  287.  
  288. #ifdef _AMIGA
  289.   char dummy_tty[] = "amiterm";
  290.  
  291.   if (ttytype == NULL)
  292.     ttytype = dummy_tty;
  293. #else
  294.   if (ttytype == NULL)
  295.     { /* If DISPLAY is set, we are X11; otherwise, who knows.  */
  296.       boolean have_display = getenv ("DISPLAY") != NULL;
  297.       ttytype = have_display ? "xterm" : getenv ("TERM");
  298.     }
  299.  
  300.   /* If we don't know kind of terminal this is, or if Metafont isn't
  301.       being run interactively, don't do any online output.  */
  302.   if (ttytype == NULL || !isatty (fileno (stdout)))
  303.     return 0;
  304. #endif /* _AMIGA */
  305. @z
  306.  
  307. @x l.808
  308. #endif /* MF */
  309. @y
  310. #endif /* MF */
  311.  
  312. /*
  313.  * A runtime memory configuration is provided for all internal array sizes.
  314.  * This file is automatically included in the `extra' sources for TeX,
  315.  * MetaFont, and MetaPost.
  316.  *
  317.  * This code was written by Andreas Scherer, April 5, 1995.
  318.  */
  319.  
  320. #ifdef VARMEM
  321.  
  322. #ifdef TeX
  323.  
  324. #define configname "tex.mcf"
  325. #define CONFIGPATH TEXCONFIGPATH
  326.  
  327. as_parameter as_param[AS_NP] = {
  328.    { "memmax", 30000 },
  329.    { "bufsize", 500 },
  330.    { "errorline", 72 },
  331.    { "halferrorline", 42 },
  332.    { "maxprintline", 79 },
  333.    { "stacksize", 200 },
  334.    { "maxinopen", 6 },
  335.    { "fontmax", 75 },
  336.    { "fontmemsize", 20000 },
  337.    { "paramsize", 60 },
  338.    { "nestsize", 40 },
  339.    { "maxstrings", 3000 },
  340.    { "poolsize", 32000 },
  341.    { "savesize", 600 },
  342.    { "triesize", 8000 },
  343.    { "trieopsize", 500 },
  344.    { "maxtrieop", 500 },
  345.    { "dvibufsize", 100 },
  346.    { "memtop", 30000 },
  347.    { "hashsize", 2100 },
  348.    { "hashprime", 1777 },
  349.    { "hyphsize", 307 }
  350.    };
  351.  
  352. #elif defined (MF) /* Not TeX, MetaFont or MetaPost */
  353.  
  354. #define configname "mf.mcf"
  355. #define CONFIGPATH MFCONFIGPATH
  356.  
  357. as_parameter as_param[AS_NP] = {
  358.    { "memmax", 30000 },
  359.    { "maxinternal", 100 },
  360.    { "bufsize", 500 },
  361.    { "errorline", 72 },
  362.    { "halferrorline", 42 },
  363.    { "maxprintline", 79 },
  364.    { "screenwidth", 768 },
  365.    { "screendepth", 1024 },
  366.    { "stacksize", 30 },
  367.    { "maxstrings", 2000 },
  368.    { "poolsize", 32000 },
  369.    { "movesize", 5000 },
  370.    { "maxwiggle", 300 },
  371.    { "gfbufsize", 100 },
  372.    { "pathsize", 300 },
  373.    { "bistacksize", 785 },
  374.    { "headersize", 100 },
  375.    { "ligtablesize", 5000 },
  376.    { "maxkerns", 500 },
  377.    { "maxfontdimen", 50 },
  378.    { "memtop", 30000 },
  379.    { "hashsize", 2100 },
  380.    { "hashprime", 1777 },
  381.    { "maxinopen", 6 },
  382.    { "paramsize", 150 },
  383.    { "scalefactor", 1 }
  384.    };
  385.  
  386. #else /* Not MetaFont, but MetaPost */
  387.  
  388. #define configname "mp.mcf"
  389. #define CONFIGPATH MPCONFIGPATH
  390.  
  391. as_parameter as_param[AS_NP] = {
  392.    { "memmax", 30000 },
  393.    { "maxinternal", 100 },
  394.    { "bufsize", 500 },
  395.    { "errorline", 72 },
  396.    { "halferrorline", 42 },
  397.    { "maxprintline", 79 },
  398.    { "emergencylinelength", 255 },
  399.    { "stacksize", 30 },
  400.    { "maxreadfiles", 4 },
  401.    { "maxstrings", 2500 },
  402.    { "stringsvacant", 1000 },
  403.    { "poolsize", 32000 },
  404.    { "fontmax", 50 },
  405.    { "fontmemsize", 10000 },
  406.    { "memtop", 30000 },
  407.    { "hashsize", 2100 },
  408.    { "hashprime", 1777 },
  409.    { "maxinopen", 6 },
  410.    { "paramsize", 150 },
  411.    { "maxwritefiles", 4},
  412.    { "pathsize", 300 },
  413.    { "bistacksize", 785 },
  414.    { "headersize", 100 },
  415.    { "ligtablesize", 5000 },
  416.    { "maxkerns", 500 },
  417.    { "maxfontdimen", 50 },
  418.    };
  419.  
  420. #endif /* MetaPost */
  421.  
  422. #include "andyconfig.h"
  423.  
  424. #ifdef TeX
  425. void as_memerr(void)
  426. {
  427.   fprintf(stderr,"Insufficient memory for TeX - alter " configname "\n");
  428.   uexit(error_message_issued);
  429. }
  430. #elif defined (MF) /* Not TeX, MetaFont or MetaPost */
  431. void as_memerr(void)
  432. {
  433.   fprintf(stderr,"Insufficient memory for MetaFont - alter " configname "\n");
  434.   uexit(error_message_issued);
  435. }
  436. #else /* Not MetaFont, but MetaPost */
  437. void as_memerr(void)
  438. {
  439.   fprintf(stderr,"Insufficient memory for MetaPost - alter " configname "\n");
  440.   uexit(error_message_issued);
  441. }
  442. #endif /* MetaPost */
  443.  
  444. #define Alloc_Object(object,size,type) \
  445.   if (!(object=(type *)malloc((size)*sizeof(type)))) \
  446.     as_memerr()
  447.  
  448. #define Free_Object(A) if(A) free(A), A=NULL
  449.  
  450. void as_getsizes(void)
  451. {
  452.   FILE *configfile;
  453.   char cmd[256],parm[256];
  454.   long val,index;
  455.  
  456.   Alloc_Object ( nameoffile, PATHMAX + 1, char ) ;
  457.  
  458.   vstrcpy ( nameoffile + 1 , configname ) ;
  459.   nameoffile [ 0 ] = ' ' ;
  460.   nameoffile [ strlen ( configname ) + 1 ] = ' ' ;
  461.   namelength = strlen ( configname ) ;
  462.   if ( aopenin ( configfile , CONFIGPATH ) )
  463.   {
  464.     while ( fgets(cmd, (size_t) 255, configfile) )
  465.     {
  466.       if ( strncmp(cmd, "set ", 4) == 0 )
  467.       {
  468.         if ( sscanf(cmd+4,"%s%d",parm,&val) == 2)
  469.         {
  470.       index = 0;
  471.       while ( index < AS_NP && strcmp(parm,as_param[index].pname) ) index++;
  472.           if ( index >= AS_NP ) 
  473.       {
  474.         fprintf(stderr,"Warning: unknown config option \"%s\" ignored\n",
  475.               parm);
  476.       }
  477.       else
  478.       {
  479.         as_param[index].pval=val;
  480.       }
  481.         }
  482.       }
  483.     }
  484.   aclose (configfile);
  485.   }
  486.  
  487.   Free_Object ( nameoffile ) ;
  488.  
  489. #ifdef DEBUG  
  490.   for (index = 0 ; index < AS_NP ; index++ )
  491.     fprintf(stderr, "%d\n", as_param[index].pval); 
  492. #endif
  493. }
  494.  
  495. #ifdef TeX
  496.  
  497. void as_alloc_memory(void)
  498. {
  499.   Alloc_Object(xord, 256, ASCIIcode);
  500.   Alloc_Object(xchr, 256, ASCIIcode);
  501.   Alloc_Object(nameoffile, PATHMAX + 1, char);
  502.   Alloc_Object(buffer, bufsize + 1, ASCIIcode);
  503.   Alloc_Object(strpool, poolsize + 1, packedASCIIcode);
  504.   Alloc_Object(strstart, maxstrings + 1, poolpointer);
  505.   Alloc_Object(dig, 23, char);
  506.   Alloc_Object(trickbuf, errorline + 1, ASCIIcode);
  507.   Alloc_Object(helpline, 6, strnumber);
  508.   Alloc_Object(zzzaa, memmax - memmin + 1, memoryword);
  509. #ifdef DEBUG
  510.   Alloc_Object(zzzab, memmax - memmin + 1, boolean);
  511.   Alloc_Object(zzzac, memmax - memmin + 1, boolean);
  512. #endif /* DEBUG */
  513.   Alloc_Object(nest, nestsize + 1, liststaterecord);
  514.   Alloc_Object(zeqtb, hashsize + 4007, memoryword); /* See texmemory.ch. */
  515.   Alloc_Object(zzzad, 844, quarterword); /* Seems to be a constant relation. */
  516.   Alloc_Object(zzzae, hashsize + 267, twohalves); /* See texmemory.ch. */
  517.   Alloc_Object(savestack, savesize + 1, memoryword);
  518.   Alloc_Object(inputstack, stacksize + 1, instaterecord);
  519.   Alloc_Object(inputfile, maxinopen + 1, alphafile);
  520.   Alloc_Object(linestack, maxinopen + 1, integer);
  521.   Alloc_Object(paramstack, paramsize + 1, halfword);
  522.   Alloc_Object(curmark, 5, halfword);
  523.   Alloc_Object(pstack, 9, halfword);
  524.   Alloc_Object(readfile, 16, alphafile);
  525.   Alloc_Object(readopen, 17, char);
  526.   Alloc_Object(fontinfo, fontmemsize + 1, memoryword);
  527.   Alloc_Object(fontcheck, fontmax + 1, fourquarters);
  528.   Alloc_Object(fontsize, fontmax + 1, scaled);
  529.   Alloc_Object(fontdsize, fontmax + 1, scaled);
  530.   Alloc_Object(fontparams, fontmax + 1, halfword);
  531.   Alloc_Object(fontname, fontmax + 1, strnumber);
  532.   Alloc_Object(fontarea, fontmax + 1, strnumber);
  533.   Alloc_Object(fontbc, fontmax + 1, eightbits);
  534.   Alloc_Object(fontec, fontmax + 1, eightbits);
  535.   Alloc_Object(fontglue, fontmax + 1, halfword);
  536.   Alloc_Object(fontused, fontmax + 1, boolean);
  537.   Alloc_Object(hyphenchar, fontmax + 1, integer);
  538.   Alloc_Object(skewchar, fontmax + 1, integer);
  539.   Alloc_Object(bcharlabel, fontmax + 1, fontindex);
  540.   Alloc_Object(fontbchar, fontmax + 1, short);
  541.   Alloc_Object(fontfalsebchar, fontmax + 1, short);
  542.   Alloc_Object(charbase, fontmax + 1, integer);
  543.   Alloc_Object(widthbase, fontmax + 1, integer);
  544.   Alloc_Object(heightbase, fontmax + 1, integer);
  545.   Alloc_Object(depthbase, fontmax + 1, integer);
  546.   Alloc_Object(italicbase, fontmax + 1, integer);
  547.   Alloc_Object(ligkernbase, fontmax + 1, integer);
  548.   Alloc_Object(kernbase, fontmax + 1, integer);
  549.   Alloc_Object(extenbase, fontmax + 1, integer);
  550.   Alloc_Object(parambase, fontmax + 1, integer);
  551.   Alloc_Object(dvibuf, dvibufsize + 1, eightbits);
  552.   Alloc_Object(totalstretch, 4, scaled);
  553.   Alloc_Object(totalshrink, 4, scaled);
  554.   Alloc_Object(activewidth, 7, scaled);
  555.   Alloc_Object(curactivewidth, 7, scaled);
  556.   Alloc_Object(background, 7, scaled);
  557.   Alloc_Object(breakwidth, 7, scaled);
  558.   Alloc_Object(minimaldemerits, 4, integer);
  559.   Alloc_Object(bestplace, 4, halfword);
  560.   Alloc_Object(bestplline, 4, halfword);
  561.   Alloc_Object(hc, 66, short);
  562.   Alloc_Object(hu, 64, short);
  563.   Alloc_Object(hyf, 65, char);
  564.   Alloc_Object(trietrl, triesize + 1, halfword);
  565.   Alloc_Object(trietro, triesize + 1, halfword);
  566.   Alloc_Object(trietrc, triesize + 1, quarterword);
  567.   Alloc_Object(hyfdistance, trieopsize + 1, smallnumber);
  568.   Alloc_Object(hyfnum, trieopsize + 1, smallnumber);
  569.   Alloc_Object(hyfnext, trieopsize + 1, trieopcode);
  570.   Alloc_Object(opstart, 256, integer);
  571.   Alloc_Object(hyphword, hyphsize + 1, strnumber); /* See texmemory.ch. */
  572.   Alloc_Object(hyphlist, hyphsize + 1, halfword); /* See texmemory.ch. */
  573. #ifdef INITEX
  574.   Alloc_Object(zzzaf, trieopsize - negtrieopsize + 1, integer);
  575.   Alloc_Object(trieused, 256, trieopcode);
  576.   Alloc_Object(trieoplang, trieopsize + 1, ASCIIcode);
  577.   Alloc_Object(trieopval, trieopsize + 1, trieopcode);
  578.   Alloc_Object(triec, triesize + 1, packedASCIIcode);
  579.   Alloc_Object(trieo, triesize + 1, trieopcode);
  580.   Alloc_Object(triel, triesize + 1, triepointer);
  581.   Alloc_Object(trier, triesize + 1, triepointer);
  582.   Alloc_Object(triehash, triesize + 1, triepointer);
  583.   Alloc_Object(trietaken, triesize + 1, boolean);
  584.   Alloc_Object(triemin, 256, triepointer);
  585. #endif /* INITEX */
  586.   Alloc_Object(pagesofar, 8, scaled);
  587.   Alloc_Object(writefile, 16, alphafile);
  588.   Alloc_Object(writeopen, 18, boolean);
  589. }
  590.  
  591. void as_free_memory(void)
  592. {
  593.   Free_Object(writeopen);
  594.   Free_Object(writefile);
  595.   Free_Object(pagesofar);
  596. #ifdef INITEX
  597.   Free_Object(triemin);
  598.   Free_Object(trietaken);
  599.   Free_Object(triehash);
  600.   Free_Object(trier);
  601.   Free_Object(triel);
  602.   Free_Object(trieo);
  603.   Free_Object(triec);
  604.   Free_Object(trieopval);
  605.   Free_Object(trieoplang);
  606.   Free_Object(trieused);
  607.   Free_Object(zzzaf);
  608. #endif /* INITEX */
  609.   Free_Object(hyphlist);
  610.   Free_Object(hyphword);
  611.   Free_Object(opstart);
  612.   Free_Object(hyfnext);
  613.   Free_Object(hyfnum);
  614.   Free_Object(hyfdistance);
  615.   Free_Object(trietrc);
  616.   Free_Object(trietro);
  617.   Free_Object(trietrl);
  618.   Free_Object(hyf);
  619.   Free_Object(hu);
  620.   Free_Object(hc);
  621.   Free_Object(bestplline);
  622.   Free_Object(bestplace);
  623.   Free_Object(minimaldemerits);
  624.   Free_Object(breakwidth);
  625.   Free_Object(background);
  626.   Free_Object(curactivewidth);
  627.   Free_Object(activewidth);
  628.   Free_Object(totalshrink);
  629.   Free_Object(totalstretch);
  630.   Free_Object(dvibuf);
  631.   Free_Object(parambase);
  632.   Free_Object(extenbase);
  633.   Free_Object(kernbase);
  634.   Free_Object(ligkernbase);
  635.   Free_Object(italicbase);
  636.   Free_Object(depthbase);
  637.   Free_Object(heightbase);
  638.   Free_Object(widthbase);
  639.   Free_Object(charbase);
  640.   Free_Object(fontfalsebchar);
  641.   Free_Object(fontbchar);
  642.   Free_Object(bcharlabel);
  643.   Free_Object(skewchar);
  644.   Free_Object(hyphenchar);
  645.   Free_Object(fontused);
  646.   Free_Object(fontglue);
  647.   Free_Object(fontec);
  648.   Free_Object(fontbc);
  649.   Free_Object(fontarea);
  650.   Free_Object(fontname);
  651.   Free_Object(fontparams);
  652.   Free_Object(fontdsize);
  653.   Free_Object(fontsize);
  654.   Free_Object(fontcheck);
  655.   Free_Object(fontinfo);
  656.   Free_Object(readopen);
  657.   Free_Object(readfile);
  658.   Free_Object(pstack);
  659.   Free_Object(curmark);
  660.   Free_Object(paramstack);
  661.   Free_Object(linestack);
  662.   Free_Object(inputfile);
  663.   Free_Object(inputstack);
  664.   Free_Object(savestack);
  665.   Free_Object(zzzae);
  666.   Free_Object(zzzad);
  667.   Free_Object(zeqtb);
  668.   Free_Object(nest);
  669. #ifdef DEBUG
  670.   Free_Object(zzzac);
  671.   Free_Object(zzzab);
  672. #endif /* DEBUG */
  673.   Free_Object(zzzaa);
  674.   Free_Object(helpline);
  675.   Free_Object(trickbuf);
  676.   Free_Object(dig);
  677.   Free_Object(strstart);
  678.   Free_Object(strpool);
  679.   Free_Object(buffer);
  680.   Free_Object(nameoffile);
  681.   Free_Object(xchr);
  682.   Free_Object(xord);
  683. }
  684.  
  685. #elif defined (MF) /* Not TeX, MetaFont or MetaPost */
  686.  
  687. void as_alloc_memory(void)
  688. {
  689.   Alloc_Object(xord, 256, ASCIIcode);
  690.   Alloc_Object(xchr, 256, ASCIIcode);
  691.   Alloc_Object(nameoffile, PATHMAX + 1, char);
  692.   Alloc_Object(buffer, bufsize + 1, ASCIIcode);
  693.   Alloc_Object(strpool, poolsize + 1, packedASCIIcode);
  694.   Alloc_Object(strstart, maxstrings + 1, poolpointer);
  695.   Alloc_Object(strref, maxstrings + 1, char);
  696.   Alloc_Object(dig, 23, char);
  697.   Alloc_Object(trickbuf, errorline + 1, ASCIIcode);
  698.   Alloc_Object(helpline, 6, strnumber);
  699.   Alloc_Object(twotothe, 31, integer);
  700.   Alloc_Object(speclog, 29, integer);
  701.   Alloc_Object(specatan, 27, angle);
  702.   Alloc_Object(randoms, 55, fraction);
  703.   Alloc_Object(mem, memmax + 1, memoryword);
  704. #ifdef DEBUG
  705.   Alloc_Object(freearr, memmax + 1, boolean);
  706.   Alloc_Object(wasfree, memmax + 1, boolean);
  707. #endif /* DEBUG */
  708.   Alloc_Object(internal, maxinternal + 1, scaled);
  709.   Alloc_Object(intname, maxinternal + 1, strnumber);
  710.   Alloc_Object(charclass, 256, char);
  711.   Alloc_Object(hash, 270 + hashsize, twohalves); /* See `mfmemory.ch'. */
  712.   Alloc_Object(eqtb, 270 + hashsize, twohalves); /* See `mfmemory.ch'. */
  713.   Alloc_Object(zzzaa, 2, smallnumber);
  714.   Alloc_Object(deltax, pathsize + 1, scaled);
  715.   Alloc_Object(deltay, pathsize + 1, scaled);
  716.   Alloc_Object(delta, pathsize + 1, scaled);
  717.   Alloc_Object(psi, pathsize + 1, angle);
  718.   Alloc_Object(theta, pathsize + 1, angle);
  719.   Alloc_Object(uu, pathsize + 1, fraction);
  720.   Alloc_Object(vv, pathsize + 1, angle);
  721.   Alloc_Object(ww, pathsize + 1, fraction);
  722.   Alloc_Object(move, movesize + 1, integer);
  723.   Alloc_Object(bisectstack, bistacksize + 1, integer);
  724.   Alloc_Object(octantdir, 9, strnumber);
  725.   Alloc_Object(before, maxwiggle + 1, scaled);
  726.   Alloc_Object(after, maxwiggle + 1, scaled);
  727.   Alloc_Object(nodetoround, maxwiggle + 1, halfword);
  728.   Alloc_Object(octantnumber, 9, char);
  729.   Alloc_Object(octantcode, 9, char);
  730.   Alloc_Object(ycorr, 9, char);
  731.   Alloc_Object(xycorr, 9, char);
  732.   Alloc_Object(zcorr, 9, char);
  733.   Alloc_Object(xcorr, 9, schar);
  734.   Alloc_Object(envmove, movesize + 1, integer);
  735.   Alloc_Object(windowopen, 16, boolean);
  736.   Alloc_Object(leftcol, 16, screencol);
  737.   Alloc_Object(rightcol, 16, screencol);
  738.   Alloc_Object(toprow, 16, screenrow);
  739.   Alloc_Object(botrow, 16, screenrow);
  740.   Alloc_Object(mwindow, 16, integer);
  741.   Alloc_Object(nwindow, 16, integer);
  742.   Alloc_Object(windowtime, 16, integer);
  743.   Alloc_Object(rowtransition, screenwidth + 1, screencol);
  744.   Alloc_Object(inputstack, stacksize + 1, instaterecord);
  745.   Alloc_Object(inputfile, maxinopen + 1, alphafile);
  746.   Alloc_Object(linestack, maxinopen + 1, integer);
  747.   Alloc_Object(paramstack, paramsize + 1, halfword);
  748.   Alloc_Object(zzzab, 2, integer);
  749.   Alloc_Object(zzzac, 2, halfword);
  750.   Alloc_Object(zzzad, 2, halfword);
  751.   Alloc_Object(tfmwidth, 256, scaled);
  752.   Alloc_Object(tfmheight, 256, scaled);
  753.   Alloc_Object(tfmdepth, 256, scaled);
  754.   Alloc_Object(tfmitalcorr, 256, scaled);
  755.   Alloc_Object(charexists, 256, boolean);
  756.   Alloc_Object(chartag, 256, char);
  757.   Alloc_Object(charremainder, 256, integer);
  758.   Alloc_Object(headerbyte, headersize + 1, short);
  759.   Alloc_Object(ligkern, ligtablesize + 1, fourquarters);
  760.   Alloc_Object(kern, maxkerns + 1, scaled);
  761.   Alloc_Object(exten, 256, fourquarters);
  762.   Alloc_Object(param, maxfontdimen + 1, scaled);
  763.   Alloc_Object(skiptable, 256, integer);
  764.   Alloc_Object(labelloc, 257, integer);
  765.   Alloc_Object(labelchar, 257, eightbits);
  766.   Alloc_Object(dimenhead, 5, halfword);
  767.   Alloc_Object(charptr, 256, integer);
  768.   Alloc_Object(gfdx, 256, integer);
  769.   Alloc_Object(gfdy, 256, integer);
  770.   Alloc_Object(gfbuf, gfbufsize + 1, eightbits);
  771. }
  772.  
  773. void as_free_memory(void)
  774. {
  775.   Free_Object(gfbuf);
  776.   Free_Object(gfdy);
  777.   Free_Object(gfdx);
  778.   Free_Object(charptr);
  779.   Free_Object(dimenhead);
  780.   Free_Object(labelchar);
  781.   Free_Object(labelloc);
  782.   Free_Object(skiptable);
  783.   Free_Object(param);
  784.   Free_Object(exten);
  785.   Free_Object(kern);
  786.   Free_Object(ligkern);
  787.   Free_Object(headerbyte);
  788.   Free_Object(charremainder);
  789.   Free_Object(chartag);
  790.   Free_Object(charexists);
  791.   Free_Object(tfmitalcorr);
  792.   Free_Object(tfmdepth);
  793.   Free_Object(tfmheight);
  794.   Free_Object(tfmwidth);
  795.   Free_Object(zzzad);
  796.   Free_Object(zzzac);
  797.   Free_Object(zzzab);
  798.   Free_Object(paramstack);
  799.   Free_Object(linestack);
  800.   Free_Object(inputfile);
  801.   Free_Object(inputstack);
  802.   Free_Object(rowtransition);
  803.   Free_Object(windowtime);
  804.   Free_Object(nwindow);
  805.   Free_Object(mwindow);
  806.   Free_Object(botrow);
  807.   Free_Object(toprow);
  808.   Free_Object(rightcol);
  809.   Free_Object(leftcol);
  810.   Free_Object(windowopen);
  811.   Free_Object(envmove);
  812.   Free_Object(xcorr);
  813.   Free_Object(zcorr);
  814.   Free_Object(xycorr);
  815.   Free_Object(ycorr);
  816.   Free_Object(octantcode);
  817.   Free_Object(octantnumber);
  818.   Free_Object(nodetoround);
  819.   Free_Object(after);
  820.   Free_Object(before);
  821.   Free_Object(octantdir);
  822.   Free_Object(bisectstack);
  823.   Free_Object(move);
  824.   Free_Object(ww);
  825.   Free_Object(vv);
  826.   Free_Object(uu);
  827.   Free_Object(theta);
  828.   Free_Object(psi);
  829.   Free_Object(delta);
  830.   Free_Object(deltay);
  831.   Free_Object(deltax);
  832.   Free_Object(zzzaa);
  833.   Free_Object(eqtb);
  834.   Free_Object(hash);
  835.   Free_Object(charclass);
  836.   Free_Object(intname);
  837.   Free_Object(internal);
  838. #ifdef DEBUG
  839.   Free_Object(wasfree);
  840.   Free_Object(freearr);
  841. #endif /* DEBUG */
  842.   Free_Object(mem);
  843.   Free_Object(randoms);
  844.   Free_Object(specatan);
  845.   Free_Object(speclog);
  846.   Free_Object(twotothe);
  847.   Free_Object(helpline);
  848.   Free_Object(trickbuf);
  849.   Free_Object(dig);
  850.   Free_Object(strref);
  851.   Free_Object(strstart);
  852.   Free_Object(strpool);
  853.   Free_Object(buffer);
  854.   Free_Object(nameoffile);
  855.   Free_Object(xchr);
  856.   Free_Object(xord);
  857. }
  858.  
  859. #else /* Not MetaFont, but MetaPost */
  860.  
  861. void as_alloc_memory(void)
  862. {
  863.    Alloc_Object(xord, 256, ASCIIcode);
  864.    Alloc_Object(xchr, 256, char);
  865.    Alloc_Object(nameoffile, PATHMAX + 1, char);
  866.    Alloc_Object(buffer, bufsize + 1, ASCIIcode);
  867.    Alloc_Object(strpool, poolsize + 1, poolASCIIcode);
  868.    Alloc_Object(strstart, maxstrings + 1, poolpointer);
  869.    Alloc_Object(nextstr, maxstrings + 1, strnumber);
  870.    Alloc_Object(strref, maxstrings + 1, char);
  871.    Alloc_Object(dig, 23, char);
  872.    Alloc_Object(trickbuf, errorline + 1, ASCIIcode);
  873.    Alloc_Object(helpline, 6, strnumber);
  874.    Alloc_Object(twotothe, 31, integer);
  875.    Alloc_Object(speclog, 29, integer);
  876.    Alloc_Object(specatan, 27, angle);
  877.    Alloc_Object(randoms, 55, fraction);
  878.    Alloc_Object(mem, memmax + 1, memoryword);
  879. #ifdef DEBUG
  880.    Alloc_Object(freearr, memmax + 1, boolean);
  881.    Alloc_Object(wasfree, memmax + 1, boolean);
  882. #endif /* DEBUG */
  883.    Alloc_Object(internal, maxinternal + 1, scaled);
  884.    Alloc_Object(intname, maxinternal + 1, strnumber);
  885.    Alloc_Object(charclass, 256, char);
  886.    Alloc_Object(hash, hashsize + 272, twohalves);
  887.    Alloc_Object(eqtb, hashsize + 272, twohalves);
  888.    Alloc_Object(zzzaa, 3, smallnumber);
  889.    Alloc_Object(zzzab, 3, smallnumber);
  890.    Alloc_Object(zzzac, 9, smallnumber);
  891.    Alloc_Object(deltax, pathsize + 1, scaled);
  892.    Alloc_Object(deltay, pathsize + 1, scaled);
  893.    Alloc_Object(delta, pathsize + 1, scaled);
  894.    Alloc_Object(psi, pathsize + 1, angle);
  895.    Alloc_Object(theta, pathsize + 1, angle);
  896.    Alloc_Object(uu, pathsize + 1, fraction);
  897.    Alloc_Object(vv, pathsize + 1, angle);
  898.    Alloc_Object(ww, pathsize + 1, fraction);
  899.    Alloc_Object(bbmin, 2, scaled);
  900.    Alloc_Object(bbmax, 2, scaled);
  901.    Alloc_Object(halfcos, 8, fraction);
  902.    Alloc_Object(dcos, 8, fraction);
  903.    Alloc_Object(grobjectsize, 8, smallnumber);
  904.    Alloc_Object(bisectstack, bistacksize + 1, integer);
  905.    Alloc_Object(inputstack, stacksize + 1, instaterecord);
  906.    Alloc_Object(inputfile, maxinopen + 1, alphafile);
  907.    Alloc_Object(linestack, maxinopen + 1, integer);
  908.    Alloc_Object(inamestack, maxinopen + 1, strnumber);
  909.    Alloc_Object(iareastack, maxinopen + 1, strnumber);
  910.    Alloc_Object(mpxname, maxinopen + 1, halfword);
  911.    Alloc_Object(paramstack, paramsize + 1, halfword);
  912.    Alloc_Object(MPmemdefault, 10, char);
  913.    Alloc_Object(oldfilename, PATHMAX + 1, char);
  914.    Alloc_Object(rdfile, maxreadfiles + 1, alphafile);
  915.    Alloc_Object(rdfname, maxreadfiles + 1, strnumber);
  916.    Alloc_Object(wrfile, maxwritefiles + 1, alphafile);
  917.    Alloc_Object(wrfname, maxwritefiles + 1, strnumber);
  918.    Alloc_Object(zzzad, 2, integer);
  919.    Alloc_Object(zzzae, 2, halfword);
  920.    Alloc_Object(zzzaf, 2, halfword);
  921.    Alloc_Object(tfmwidth, 256, scaled);
  922.    Alloc_Object(tfmheight, 256, scaled);
  923.    Alloc_Object(tfmdepth, 256, scaled);
  924.    Alloc_Object(tfmitalcorr, 256, scaled);
  925.    Alloc_Object(charexists, 256, boolean);
  926.    Alloc_Object(chartag, 256, char);
  927.    Alloc_Object(charremainder, 256, integer);
  928.    Alloc_Object(headerbyte, headersize + 1, short);
  929.    Alloc_Object(ligkern, ligtablesize + 1, fourquarters);
  930.    Alloc_Object(kern, maxkerns + 1, scaled);
  931.    Alloc_Object(exten, 256, fourquarters);
  932.    Alloc_Object(param, maxfontdimen + 1, scaled);
  933.    Alloc_Object(skiptable, 256, integer);
  934.    Alloc_Object(labelloc, 257, integer);
  935.    Alloc_Object(labelchar, 257, eightbits);
  936.    Alloc_Object(dimenhead, 5, halfword);
  937.    Alloc_Object(fontinfo, fontmemsize + 1, memoryword);
  938.    Alloc_Object(fontdsize, fontmax + 1, scaled);
  939.    Alloc_Object(fontname, fontmax + 1, strnumber);
  940.    Alloc_Object(fontpsname, fontmax + 1, strnumber);
  941.    Alloc_Object(fontbc, fontmax + 1, eightbits);
  942.    Alloc_Object(fontec, fontmax + 1, eightbits);
  943.    Alloc_Object(charbase, fontmax + 1, integer);
  944.    Alloc_Object(widthbase, fontmax + 1, integer);
  945.    Alloc_Object(heightbase, fontmax + 1, integer);
  946.    Alloc_Object(depthbase, fontmax + 1, integer);
  947.    Alloc_Object(fontsizes, fontmax + 1, halfword);
  948.    Alloc_Object(curfsize, fontmax + 1, halfword);
  949. }
  950.  
  951. void as_free_memory(void)
  952. {
  953.    Free_Object(curfsize);
  954.    Free_Object(fontsizes);
  955.    Free_Object(depthbase);
  956.    Free_Object(heightbase);
  957.    Free_Object(widthbase);
  958.    Free_Object(charbase);
  959.    Free_Object(fontec);
  960.    Free_Object(fontbc);
  961.    Free_Object(fontpsname);
  962.    Free_Object(fontname);
  963.    Free_Object(fontdsize);
  964.    Free_Object(fontinfo);
  965.    Free_Object(dimenhead);
  966.    Free_Object(labelchar);
  967.    Free_Object(labelloc);
  968.    Free_Object(skiptable);
  969.    Free_Object(param);
  970.    Free_Object(exten);
  971.    Free_Object(kern);
  972.    Free_Object(ligkern);
  973.    Free_Object(headerbyte);
  974.    Free_Object(charremainder);
  975.    Free_Object(chartag);
  976.    Free_Object(charexists);
  977.    Free_Object(tfmitalcorr);
  978.    Free_Object(tfmdepth);
  979.    Free_Object(tfmheight);
  980.    Free_Object(tfmwidth);
  981.    Free_Object(zzzaf);
  982.    Free_Object(zzzae);
  983.    Free_Object(zzzad);
  984.    Free_Object(wrfname);
  985.    Free_Object(wrfile);
  986.    Free_Object(rdfname);
  987.    Free_Object(rdfile);
  988.    Free_Object(oldfilename);
  989.    Free_Object(MPmemdefault);
  990.    Free_Object(paramstack);
  991.    Free_Object(mpxname);
  992.    Free_Object(iareastack);
  993.    Free_Object(inamestack);
  994.    Free_Object(linestack);
  995.    Free_Object(inputfile);
  996.    Free_Object(inputstack);
  997.    Free_Object(bisectstack);
  998.    Free_Object(grobjectsize);
  999.    Free_Object(dcos);
  1000.    Free_Object(halfcos);
  1001.    Free_Object(bbmax);
  1002.    Free_Object(bbmin);
  1003.    Free_Object(ww);
  1004.    Free_Object(vv);
  1005.    Free_Object(uu);
  1006.    Free_Object(theta);
  1007.    Free_Object(psi);
  1008.    Free_Object(delta);
  1009.    Free_Object(deltay);
  1010.    Free_Object(deltax);
  1011.    Free_Object(zzzac);
  1012.    Free_Object(zzzab);
  1013.    Free_Object(zzzaa);
  1014.    Free_Object(eqtb);
  1015.    Free_Object(hash);
  1016.    Free_Object(charclass);
  1017.    Free_Object(intname);
  1018.    Free_Object(internal);
  1019. #ifdef DEBUG
  1020.    Free_Object(wasfree);
  1021.    Free_Object(freearr);
  1022. #endif /* DEBUG */
  1023.    Free_Object(mem);
  1024.    Free_Object(randoms);
  1025.    Free_Object(specatan);
  1026.    Free_Object(speclog);
  1027.    Free_Object(twotothe);
  1028.    Free_Object(helpline);
  1029.    Free_Object(trickbuf);
  1030.    Free_Object(dig);
  1031.    Free_Object(strref);
  1032.    Free_Object(nextstr);
  1033.    Free_Object(strstart);
  1034.    Free_Object(strpool);
  1035.    Free_Object(buffer);
  1036.    Free_Object(nameoffile);
  1037.    Free_Object(xchr);
  1038.    Free_Object(xord);
  1039. }
  1040.  
  1041. #endif /* MetaPost */
  1042.  
  1043. #endif /* VARMEM */
  1044.  
  1045. #ifdef MP
  1046.  
  1047. /****************************************************************
  1048.  * The following code is needed by MetaPost but not MetaFont.
  1049.  * It is copied from `mpext.c' and `site.h'.
  1050.  *
  1051.  * Here's the necessary legal stuff for this section:
  1052.  ****************************************************************/
  1053.  
  1054. /****************************************************************
  1055. Copyright 1990 - 1995 by AT&T Bell Laboratories.
  1056.  
  1057. Permission to use, copy, modify, and distribute this software
  1058. and its documentation for any purpose and without fee is hereby
  1059. granted, provided that the above copyright notice appear in all
  1060. copies and that both that the copyright notice and this
  1061. permission notice and warranty disclaimer appear in supporting
  1062. documentation, and that the names of AT&T Bell Laboratories or
  1063. any of its entities not be used in advertising or publicity
  1064. pertaining to distribution of the software without specific,
  1065. written prior permission.
  1066.  
  1067. AT&T disclaims all warranties with regard to this software,
  1068. including all implied warranties of merchantability and fitness.
  1069. In no event shall AT&T be liable for any special, indirect or
  1070. consequential damages or any damages whatsoever resulting from
  1071. loss of use, data or profits, whether in an action of contract,
  1072. negligence or other tortious action, arising out of or in
  1073. connection with the use or performance of this software.
  1074. ****************************************************************/
  1075.  
  1076. /*
  1077.  * Command for translating MetaPost input to an mpx file
  1078.  * (Can be overridden by an environment variable)
  1079.  */
  1080. #ifdef _AMIGA
  1081. #define MPXCOMMAND    "rx ../mpware/makempx"
  1082. #define TROFFMPX    "Sorry" /* No TROFF on Amiga */
  1083. #else
  1084. #define MPXCOMMAND    "/usr/lib/mp/bin/makempx"
  1085. #define TROFFMPX    "/usr/lib/mp/bin/troffmpx"
  1086. #endif
  1087.  
  1088. #define CMDLENGTH 300
  1089.  
  1090. /*
  1091.  * Invoke makempx to make sure there is an up-to-date .mpx file
  1092.  * for a given .mp file
  1093.  *
  1094.  * John Hobby 3/14/90
  1095.  */
  1096.  
  1097. boolean callmakempx(mpname, mpxname)
  1098. char *mpname, *mpxname;
  1099. {
  1100.     char *cmd, *p, *q, *qlimit;
  1101.     char buf[CMDLENGTH];
  1102.  
  1103.     cmd = getenv("MPXCOMMAND");
  1104.     if (cmd==NULL)
  1105.         if (troffmode) cmd=TROFFMPX; else cmd=MPXCOMMAND;
  1106.  
  1107.     q = buf;
  1108.     qlimit = buf+CMDLENGTH-1;
  1109.     for (p=cmd; *p!=0; p++)
  1110.         if (q==qlimit) return 0; else *q++ = *p;
  1111.     *q++ = ' ';
  1112.     for (p=mpname+1; *p!=0 && *p!=' '; p++)
  1113.         if (q==qlimit) return 0; else *q++ = *p;
  1114.     *q++ = ' ';
  1115.     for (p=mpxname+1; *p!=0 && *p!=' '; p++)
  1116.         if (q==qlimit) return 0; else *q++ = *p;
  1117.     *q = 0;
  1118.     return system(buf)==0;
  1119. }
  1120. /****************************************************************
  1121.  * End of MetaPost code.  Switch back to standard disclaimer.
  1122.  ****************************************************************/
  1123.  
  1124. /* Read the Nth argument from the command line and return it in BUF as a
  1125.    Pascal string, i.e., starting at index 1 and ending with a space.  If
  1126.    N is beyond the end of the command line, abort.  */
  1127. /*
  1128.  * CAVEAT UTILITOR: This `argv' implementation is DIFFERENT than
  1129.  * the routine of the same name in the `main' module.  It is a
  1130.  * special edition for use with MetaPost only.
  1131.  */
  1132. void
  1133. argv P2C(int, n,  string, buf)
  1134. {
  1135.   if (n-1 >= argc) /* <= was `n>=argc' */
  1136.     {
  1137.       fprintf (stderr, "%s: Not enough arguments.\n", gargv[0]);
  1138.       uexit (1);
  1139.     }
  1140.   strcpy (buf + 1, gargv[n-1]); /* <= was `gargv[n]' */
  1141.   strcat (buf + 1, " ");
  1142. }
  1143.  
  1144. #endif /* MP */
  1145. @z
  1146.