home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / source / ljinit < prev    next >
Encoding:
Text File  |  1990-06-27  |  70.6 KB  |  2,091 lines

  1.  
  2. #! /bin/sh
  3. # this is a "shar" archive - run through "/bin/sh" to extract 11 files:
  4. #   README ljinit.h patchlevel.h main.c param.c cmd.c misc.c ljconfig.dat ljparam.dat Makefile testsheet
  5. # Wrapped by bin@chinacat on Fri Jun 22 19:13:56 CDT 1990
  6. # Unpacking this archive requires:  sed test wc (possibly mkdir)
  7. # Existing files will not be clobbered unless "-c" is specified on the cmd line.
  8. if test -f README -a "$1" != "-c" ; then
  9.     echo "README: file exists - will not be overwritten"
  10. else
  11.     echo "x - README (file 1 of 11, 5389 chars)"
  12.     sed -e 's/^X//' << 'END_OF_FILE_README' > README
  13. X    ljinit - Hewlett Packard LaserJet Configuration Generator
  14. X    ======   ======= ======= ======== ============= =========
  15. X
  16. X"ljinit" provides a high level interface to the HP PCL configuration commands
  17. Xused by HP LaserJet printers.  For example, rather than hardcoding printer
  18. Xescape sequences into scripts, you can use calls to "ljinit".  Example
  19. Xusage would look something like:
  20. X
  21. X    ljinit setup=letter font_id=roman stroke=bold left_margin=20 /right_margin
  22. X
  23. X(That last argument isn't a filename.  It tells "ljinit" to suppress the
  24. X"right_margin" setting implied by the "setup=letter" specification, and
  25. Xthus allows printing to extend to the end of the logical page rather than
  26. Xclipping at the margin.)
  27. X
  28. XLjinit allows you direct control over the low-level printer configuration
  29. Xparameters (e.g. typeface, left margin, HMI, etc.).  It also provides
  30. Xthree commands ("font_id", "page_id", and "setup") which simplify the
  31. Xtask of creating configurations.
  32. X
  33. XThere are two data files to configure "ljinit":
  34. X
  35. X    - ljparam.dat - device specific parameter definitions
  36. X    - ljconfig.dat - site specific configuration definitions
  37. X
  38. XThe difference between these files is that "ljparam.dat" describes the
  39. Xcapabilities of the printer, and "ljconfig.dat" describes your site-specific
  40. Xconfiguration preferences.
  41. X
  42. XLjinit has been tested under SCO XENIX 386 with an HP LaserJet IIP.  It
  43. Xshould port easily to any System V environment.  (BSD might be tough
  44. Xbecause it uses the SysV regex routines to validate the user's values.)
  45. X
  46. X
  47. XBuilding "ljinit"
  48. X======== ========
  49. X
  50. X  1)  Edit the PARAM_FILE and CONFIG_FILE definitions in "ljinit.h".
  51. X
  52. X  2)  Run a "make".
  53. X
  54. X  3)  The distributed "ljparam.dat" file contains support for all items
  55. X      documented in HP's LaserJet Series II and LaserJet Series IIP
  56. X      manual.  If you run a different printer or if you added capabilities
  57. X      (e.g. fonts) not documented there, you might need to edit this
  58. X      file.  (Please send me your changes!)
  59. X
  60. X  4)  The distributed "ljconfig.dat" file defines my local configuration
  61. X      preferences.  You might very well want to change this file.  Note
  62. X      that the "font_id" definitions describe the internal fonts for a
  63. X      LaserJet Series IIP printer.  You might want to modify these if you
  64. X      run a different printer or if you've added cartridge fonts.  (Please
  65. X      send me your changes!)
  66. X
  67. X  5)  Install "ljparam.dat" and "ljconfig.dat" in the places you defined
  68. X      in step 1.
  69. X
  70. X  6)  To test "ljinit", you can try things like:
  71. X
  72. X    ( ljinit setup=wide ; echo "hello world" ) | lp
  73. X    ( ljinit stroke=bold ; echo "this is a test" ) | lp
  74. X
  75. X  7)  For the System V print system, you will want to integrate "ljinit"
  76. X      into your interface script.  I can send you mine if you'd like an
  77. X      example.
  78. X
  79. X
  80. XWarnings, Suggestions, and Caveats
  81. X========= ============ === =======
  82. X
  83. X  1)  When you get into programming "ljinit" remember the difference
  84. X      between configuration parameters and the three special commands
  85. X      (page_id, font_id, and setup).  The configuration parameters directly
  86. X      correspond to a single PCL configuration command, which the special
  87. X      commands are higher-level abstractions to simplify the task of
  88. X      establishing a printer configuration.
  89. X
  90. X  2)  If you want to create your own "page_id" page layout entries in the
  91. X      "ljconfig.dat" file, then forget all you know about the complexities
  92. X      about page layout with the LaserJet.  If you want a left margin of
  93. X      a half inch, say "0.50".  "ljinit" knows all the messy details about
  94. X      physical pages, logical pages, conversion to columns, etc. and does
  95. X      it for you automagically.
  96. X
  97. X  3)  The execution of a "page_id" defines a right margin at which the
  98. X      text will be clipped.  If you want to suppress the clipping and
  99. X      instead allow text to extend beyond the right margin all the way
  100. X      to the end of the (logical) page, specify "/right_margin".  You can
  101. X      do this on the command line, or in a "setup" in the "ljconfig.dat"
  102. X      file.  (The '/' slash syntax can be used to inhibit the setting of
  103. X      any parameter.)
  104. X
  105. X  4)  The "ljinit" utility is useless for proportional spaced fonts.
  106. X      This release contains no support for soft fonts, nor is such
  107. X      support anticipated.
  108. X
  109. X  5)  It's a handy program.  But in ways it's like using a sledgehammer
  110. X      to drive a nail.
  111. X      
  112. X
  113. XFine Print
  114. X==== =====
  115. X
  116. X  This program is copyright 1990, Unicom Systems Development.  All rights
  117. X  reserved.  This program is provided "as is" without any warranties,
  118. X  express or implied.  You are granted license to use and distribute this
  119. X  program, provided:  (1) all copyright notices remain intact, (2) you
  120. X  will not distribute a modified version unless it is clearly marked as
  121. X  such, (3) this program is not incorporated into a commercial product,
  122. X  (4) you may not receive payment for the distribution of this program
  123. X  beyond reimbursement of media and handling costs, and (5) you agree
  124. X  that Unicom Systems Development is to be held harmless for any damages,
  125. X  direct or incidental, for any use or application of this program.
  126. X
  127. X
  128. XComments, suggestions, and bug reports are welcomed to the address below.
  129. XEspecially if you make changes to run this with different printers,
  130. Xparticularly the LaserJet Series IID and Series III.
  131. X
  132. XChip Rosenthal
  133. X<chip@chinacat.Unicom.COM>
  134. X
  135. X@(#) README 1.1 90/06/20 23:04:22
  136. X
  137. END_OF_FILE_README
  138.     size="`wc -c < README`"
  139.     if test 5389 -ne "$size" ; then
  140.     echo "README: extraction error - got $size chars"
  141.     fi
  142. fi
  143. if test -f ljinit.h -a "$1" != "-c" ; then
  144.     echo "ljinit.h: file exists - will not be overwritten"
  145. else
  146.     echo "x - ljinit.h (file 2 of 11, 3104 chars)"
  147.     sed -e 's/^X//' << 'END_OF_FILE_ljinit.h' > ljinit.h
  148. X/* @(#) ljinit.h 1.1 90/06/20 23:04:23
  149. X *
  150. X * file:    ljinit.h
  151. X * package:    ljinit - HP LaserJet Initialization Generator
  152. X *
  153. X * Edit History:
  154. X *
  155. X * Wed Feb 28 13:53:23 1990 - Chip Rosenthal <chip@chinacat.Unicom.COM>
  156. X *    Original composition.
  157. X * Wed Jun 20 23:02:47 1990 - Chip Rosenthal <chip@chinacat.Unicom.COM>
  158. X *    Cleanup and check into SCCS.
  159. X *
  160. X * Copyright 1990, Unicom Systems Development.  All rights reserved.
  161. X * See accompanying README file for terms of distribution and use.
  162. X */
  163. X
  164. X#define PARAM_FILE    "/local/lib/ljparam.dat"
  165. X#define CONFIG_FILE    "/local/lib/ljconfig.dat"
  166. X
  167. X#define DOTS_INCH    300.0    /* number of dots printed per inch    */
  168. X#define POINTS_INCH     72.0    /* number of points per inch        */
  169. X#define VMI_SCALE     48.0    /* number of vmi increments per inch    */
  170. X#define HMI_SCALE    120.0    /* number of hmi increments per inch    */
  171. X
  172. X#define TRUE        1
  173. X#define FALSE        0
  174. X#define BUFLEN        256
  175. X
  176. X#define Dprintf(level)    if ( Debug < level ) ; else fprintf
  177. X
  178. X#ifndef LINT
  179. X#   define SCCSID(ID)        static char SccsId[] = ID;
  180. X#   define COPYRIGHT(ID)    static char Copyright[] = ID;
  181. X    typedef void * Ptr;        /* generic pointer, e.g. as malloc() returns */
  182. X#else
  183. X#   define SCCSID(ID)
  184. X#   define COPYRIGHT(ID)
  185. X    typedef char * Ptr;
  186. X#endif
  187. X
  188. X#ifdef INTERN
  189. X# define EXTERN
  190. X#else
  191. X# define EXTERN extern
  192. X#endif
  193. X
  194. X/*
  195. X * Globals.
  196. X */
  197. XEXTERN char *    Progname;        /* name of this program              */
  198. XEXTERN char *    Config_file;        /* file with site-specific info          */
  199. XEXTERN char *    Param_file;        /* file with device-specific info     */
  200. XEXTERN char    Err_buf[BUFLEN];    /* buffer for "set_param()" messages  */
  201. XEXTERN FILE    *Fp_config;        /* stream for "Config_file"          */
  202. XEXTERN FILE    *Fp_param;        /* stream for "Param_file"          */
  203. XEXTERN int    Debug;            /* debugging output level          */
  204. XEXTERN int    Inhibit_default;    /* inhibits automatic "setup=default" */
  205. X
  206. X/*
  207. X * param.c - Printer parameter processing routines.
  208. X */
  209. Xextern void    load_param();        /* load list from parameters file     */
  210. Xextern char *    get_param();        /* return configured value of a param */
  211. Xextern int    set_param();        /* set a param from a spec string     */
  212. Xextern void    exec_param();        /* generate all the setup commands    */
  213. Xextern void    dump_param();        /* print listing of available params  */
  214. X
  215. X/*
  216. X * cmd.c - Command execution procedures.
  217. X */
  218. Xextern void    (*find_cmd())();/* locate handler proc for a command          */
  219. Xextern void    cmd_setup();    /* execute a specified "setup" command          */
  220. Xextern void    cmd_font_id();    /* execute a specified "font_id" command      */
  221. Xextern void    cmd_page_id();    /* execute a specified "page_id" command      */
  222. X
  223. X/*
  224. X * misc.c - Support procedures.
  225. X */
  226. Xextern char *    fgetrec();    /* retrieve a record from a file          */
  227. Xextern char *    fgetline();    /* get the next line from a stream          */
  228. Xextern char *    strfield();    /* break line into space-delimited fields     */
  229. Xextern int    stricmp();    /* compare strings, ignore punct and case     */
  230. Xextern char *    strtrim();    /* trim comments, lead/trail white space      */
  231. Xextern Ptr    Smalloc();    /* allocate memory with error checking          */
  232. Xextern char *    Sstrdup();    /* duplicate a string with error checking     */
  233. X
  234. END_OF_FILE_ljinit.h
  235.     size="`wc -c < ljinit.h`"
  236.     if test 3104 -ne "$size" ; then
  237.     echo "ljinit.h: extraction error - got $size chars"
  238.     fi
  239. fi
  240. if test -f patchlevel.h -a "$1" != "-c" ; then
  241.     echo "patchlevel.h: file exists - will not be overwritten"
  242. else
  243.     echo "x - patchlevel.h (file 3 of 11, 194 chars)"
  244.     sed -e 's/^X//' << 'END_OF_FILE_patchlevel.h' > patchlevel.h
  245. X#define PATCHLEVEL 0
  246. X
  247. X/*
  248. X * @(#) patchlevel.h 1.1 90/06/20 23:04:26
  249. X *
  250. X * Wed Jun 20 23:02:47 1990 - Chip Rosenthal <chip@chinacat.Unicom.COM>
  251. X *    Patchlevel 0.  Cleanup and check into SCCS.
  252. X */
  253. END_OF_FILE_patchlevel.h
  254.     size="`wc -c < patchlevel.h`"
  255.     if test 194 -ne "$size" ; then
  256.     echo "patchlevel.h: extraction error - got $size chars"
  257.     fi
  258. fi
  259. if test -f main.c -a "$1" != "-c" ; then
  260.     echo "main.c: file exists - will not be overwritten"
  261. else
  262.     echo "x - main.c (file 4 of 11, 3778 chars)"
  263.     sed -e 's/^X//' << 'END_OF_FILE_main.c' > main.c
  264. X/* @(#) main.c 1.1 90/06/20 23:04:24
  265. X *
  266. X * file:    main.c - main procedure
  267. X * package:    ljinit - HP LaserJet Initialization Generator
  268. X *
  269. X * Edit History:
  270. X *
  271. X * Wed Feb 28 13:53:23 1990 - Chip Rosenthal <chip@chinacat.Unicom.COM>
  272. X *    Original composition.
  273. X * Wed Jun 20 23:02:47 1990 - Chip Rosenthal <chip@chinacat.Unicom.COM>
  274. X *    Cleanup and check into SCCS.
  275. X *
  276. X * Copyright 1990, Unicom Systems Development.  All rights reserved.
  277. X * See accompanying README file for terms of distribution and use.
  278. X */
  279. X
  280. X#include <stdio.h>
  281. X#include <string.h>
  282. X#define INTERN
  283. X#include "ljinit.h"
  284. X#include "patchlevel.h"
  285. X
  286. XSCCSID("@(#) main.c 1.1 90/06/20 23:04:24")
  287. XCOPYRIGHT("Copyright 1990, Unicom Systems Development.  All rights reserved.")
  288. X
  289. X#define USAGE "\
  290. Xusage: %s [-I] [-c config_file] [-p param_file] [arg ...]\n\
  291. X    (or specify '-h' for help message)\n"
  292. X
  293. Xvoid show_usage();
  294. X
  295. X
  296. Xmain(argc,argv)
  297. Xint argc;
  298. Xchar *argv[];
  299. X{
  300. X    int i, do_help;
  301. X    extern int optind;
  302. X    extern char *optarg;
  303. X
  304. X    /*
  305. X     * Initialize.
  306. X     */
  307. X    Config_file = CONFIG_FILE;    /* site-specific configuration defs          */
  308. X    Param_file = PARAM_FILE;    /* hardware dependent configuration defs      */
  309. X    Progname = argv[0];        /* this program name                  */
  310. X    Debug = 0;            /* debug disabled by default              */
  311. X    Inhibit_default = FALSE;    /* do "setup=default" by default          */
  312. X    do_help = FALSE;        /* no help message by default              */
  313. X
  314. X    /*
  315. X     * Process the command line options.
  316. X     */
  317. X    while ( (i=getopt(argc,argv,"D:Ic:p:h")) != EOF ) {
  318. X    switch ( i ) {
  319. X        case 'D':  Debug = atoi(optarg);        break;
  320. X        case 'I':  Inhibit_default = TRUE;        break;
  321. X        case 'c':  Config_file = Sstrdup(optarg);    break;
  322. X        case 'p':  Param_file = Sstrdup(optarg);    break;
  323. X        case 'h':  do_help = TRUE;            break;
  324. X        default:   fprintf(stderr,USAGE,Progname);    exit(1);
  325. X    }
  326. X    }
  327. X
  328. X    /*
  329. X     * Open up the data files.
  330. X     */
  331. X    if ( (Fp_param=fopen(Param_file,"r")) == NULL ) {
  332. X    perror(Param_file);
  333. X    exit(1);
  334. X    }
  335. X    if ( (Fp_config=fopen(Config_file,"r")) == NULL ) {
  336. X    perror(Config_file);
  337. X    exit(1);
  338. X    }
  339. X
  340. X    /*
  341. X     * Load in the parameters table.
  342. X     */
  343. X    load_param();
  344. X
  345. X    /*
  346. X     * See if help was requested.
  347. X     */
  348. X    if ( do_help ) {
  349. X    show_usage();
  350. X    exit(0);
  351. X    }
  352. X
  353. X    /*
  354. X     * Initialize the setup to the default conditions.
  355. X     */
  356. X    if ( !Inhibit_default && set_param("setup=default") != 0 ) {
  357. X    fprintf(stderr,"%s: error loading setup 'default' - %s\n",
  358. X        Progname, Err_buf);
  359. X    exit(1);
  360. X    }
  361. X
  362. X    /*
  363. X     * Process arguments on the command line.
  364. X     */
  365. X    for ( i = optind ; i < argc ; ++i ) {
  366. X    if ( set_param(argv[i]) != 0 ) {
  367. X        fprintf(stderr,"%s: error processing command line arg - %s\n",
  368. X        Progname, Err_buf);
  369. X        exit(1);
  370. X    }
  371. X    }
  372. X
  373. X    /*
  374. X     * Go through and execute all of parameter setups.
  375. X     */
  376. X    exec_param( Debug && isatty(1) ? (FILE *) NULL : stdout );
  377. X
  378. X    exit(0);
  379. X    /*NOTREACHED*/
  380. X}
  381. X
  382. Xstatic char *usage_text[] = {
  383. X    "",
  384. X    "The following parameters are available:",
  385. X    "@PARAMS",
  386. X    "",
  387. X    "In addition to these parameters, the 'setup', 'font_id', and 'page_id'",
  388. X    "commands may be used.  Non-alphabetic characters (e.g. '_') and letter",
  389. X    "case are ignored.  Example usage:",
  390. X    "",
  391. X    "    ljinit setup=memo stroke=BOLD left_margin=8 /RightMargin",
  392. X    "",
  393. X    "Copyright 1990, Unicom Systems Development.  All rights reserved.",
  394. X    "See accompanying README file for terms of distribution and use.",
  395. X    "",
  396. X    NULL
  397. X};
  398. X
  399. X
  400. Xvoid show_usage()
  401. X{
  402. X    int i;
  403. X    putchar('\n');
  404. X    printf("%s - version 1.1 (patchlevel %d)\n\n", Progname, PATCHLEVEL);
  405. X    printf(USAGE, Progname);
  406. X    for ( i = 0 ; usage_text[i] != NULL ; ++i ) {
  407. X    if ( strcmp(usage_text[i],"@PARAMS") == 0 )
  408. X        dump_param(stdout);
  409. X    else
  410. X        puts(usage_text[i]);
  411. X    }
  412. X}
  413. X
  414. END_OF_FILE_main.c
  415.     size="`wc -c < main.c`"
  416.     if test 3778 -ne "$size" ; then
  417.     echo "main.c: extraction error - got $size chars"
  418.     fi
  419. fi
  420. if test -f param.c -a "$1" != "-c" ; then
  421.     echo "param.c: file exists - will not be overwritten"
  422. else
  423.     echo "x - param.c (file 5 of 11, 11892 chars)"
  424.     sed -e 's/^X//' << 'END_OF_FILE_param.c' > param.c
  425. X/* @(#) param.c 1.1 90/06/20 23:04:25
  426. X *
  427. X * file:    param.c - printer parameter processing routines
  428. X * package:    ljinit - HP LaserJet Initialization Generator
  429. X *
  430. X * These routines maintain the printer configuration parameters, and provide
  431. X * a standard interface to the parameters table.
  432. X *
  433. X * Specifically, these routines build a list of the configurable printer 
  434. X * parameters based upon the "param" records in the "Param_file", place
  435. X * the user-specified values into the list, and finally produces the
  436. X * printer command strings to effect this configuration.
  437. X *
  438. X * The following procedures are provided:
  439. X *
  440. X *   void load_param() - Called once early in the program to initialize
  441. X *    the list of all the paramaters available for configuration.
  442. X *
  443. X *   char *get_param(name) - Lookup the value specified by the user for
  444. X *    the named parameter.
  445. X *
  446. X *   int set_param(spec) - Perform the parameter initialization given by
  447. X *    the specification string (e.g. "left_margin=5").
  448. X *
  449. X *   void exec_param(fp) - Called once all the definitions have been performed
  450. X *    to produce the commands to achieve the desired configuration.
  451. X *
  452. X *   void dump_param(fp) - Produce a listing of the parameters which the
  453. X *    user may set.
  454. X *
  455. X * Edit History:
  456. X *
  457. X * Wed Feb 28 13:53:23 1990 - Chip Rosenthal <chip@chinacat.Unicom.COM>
  458. X *    Original composition.
  459. X * Wed Jun 20 23:02:47 1990 - Chip Rosenthal <chip@chinacat.Unicom.COM>
  460. X *    Cleanup and check into SCCS.
  461. X *
  462. X * Copyright 1990, Unicom Systems Development.  All rights reserved.
  463. X * See accompanying README file for terms of distribution and use.
  464. X */
  465. X
  466. X#include <stdio.h>
  467. X#include <string.h>
  468. X#include "ljinit.h"
  469. X
  470. XSCCSID("@(#) param.c 1.1 90/06/20 23:04:25")
  471. XCOPYRIGHT("Copyright 1990, Unicom Systems Development.  All rights reserved.")
  472. X
  473. X/*
  474. X * (struct pvalspec) - Description of acceptable parameter value.  This
  475. X * structure matches a keyword specified in the parameters file (e.g. "INT")
  476. X * and associates a regular expression which may be used to validate the
  477. X * user-supplied value for the parameter.
  478. X */
  479. Xstruct pvalspec {
  480. X    char *name;        /* Name which appears in the "param" record.          */
  481. X    char *descrip;    /* Description of this item for error messages.       */
  482. X    char *pat;        /* Regular expression to validate against.          */
  483. X    char *re;        /* Space for the regcmp(3) compiled version of "pat". */
  484. X};
  485. X
  486. X/*
  487. X * Pvalspec_tab[] - The list of allowed parameter value types.
  488. X */
  489. Xstruct pvalspec Pvalspec_tab[] = {
  490. X    { "STRING",    "string",    ".",                NULL    },
  491. X    { "INT",    "integer",    "^[0-9]+$",            NULL    },
  492. X    { "SIGNINT","signed-int",    "^-{0,1}[0-9]+$",        NULL    },
  493. X    { "FLOAT2",    "float-2",    "^[0-9]*(\.[0-9]{0,2}){0,1}$",    NULL    },
  494. X    { "FLOAT4",    "float-4",    "^[0-9]*(\.[0-9]{0,4}){0,1}$",    NULL    },
  495. X    { NULL,    NULL,        NULL,                NULL    }
  496. X};
  497. X
  498. X/*
  499. X * (struct param_item) - Description of a printer configuration parameter.
  500. X */
  501. Xstruct param_item {
  502. X    char *name;            /* Name of this configuration parameter.      */
  503. X    char *value;        /* The user-assigned value for this param.    */
  504. X    char *cmd;            /* The PCL command to configure this param.  */
  505. X    int do_lookup;        /* Enable translation via param file lookup.  */
  506. X    struct pvalspec *val_spec;    /* Description of allowed parameter values.   */
  507. X    struct param_item *next;    /* Pointer to next param in the linked list.  */
  508. X};
  509. X
  510. X/*
  511. X * Param_list - Head of the linked list of parameters specified by user.
  512. X */
  513. Xstruct param_item Param_list = { NULL, NULL, NULL, FALSE, NULL, NULL };
  514. X
  515. X
  516. X/*
  517. X * find_param() - Scan the list of parameters looking for the named parameter.
  518. X */
  519. Xstatic struct param_item *find_param(name)
  520. Xregister char *name;
  521. X{
  522. X    register struct param_item *p;
  523. X    for ( p = Param_list.next ; p != NULL ; p = p->next ) {
  524. X    if ( stricmp(name,p->name) == 0 )
  525. X        return p;
  526. X    }
  527. X    return (struct param_item *) NULL;
  528. X}
  529. X
  530. X
  531. X/*
  532. X * load_param() - Initialize the printer parameters table.
  533. X *
  534. X * Arguments:    none
  535. X *
  536. X * Returns:    nothing
  537. X *
  538. X * Errors:    Aborts program if syntax error detected in definition tables.
  539. X *
  540. X * This routine reads all of the "param" records from the "Param_file"
  541. X * and places them into a linked list of (struct param_item).  It also
  542. X * compiles the regular expresions in the "Pvalspec_tab" which are used
  543. X * to validate the user-specified parameter values.
  544. X */
  545. Xvoid load_param()
  546. X{
  547. X    char *bufp, *s;
  548. X    int i;
  549. X    struct param_item *p;
  550. X    extern char *regcmp();
  551. X
  552. X    /*
  553. X     * Compile the regular expressions in the allowed parameter values list.
  554. X     */
  555. X    for ( i = 0 ; Pvalspec_tab[i].name != NULL ; ++i ) {
  556. X    Pvalspec_tab[i].re = regcmp(Pvalspec_tab[i].pat,(char *)NULL);
  557. X    if ( Pvalspec_tab[i].re == NULL ) {
  558. X        fprintf(stderr, "%s: internal error - bad pattern for '%s' args\n",
  559. X        Progname, Pvalspec_tab[i].name);
  560. X        exit(1);
  561. X    }
  562. X    }
  563. X
  564. X    /*
  565. X     * Go through the parameters file looking for definitions.
  566. X     */
  567. X    p = &Param_list;
  568. X    rewind(Fp_param);
  569. X    while ( (bufp=fgetline(Fp_param)) != NULL ) {
  570. X
  571. X    /*
  572. X     * Only consider "param" definitions.
  573. X     */
  574. X    if ( stricmp("param",strfield(&bufp)) != 0 )
  575. X        continue;
  576. X
  577. X    /* 
  578. X     * Allocate and initialize a new parameter.
  579. X     */
  580. X    p = p->next = (struct param_item *) Smalloc(sizeof(struct param_item));
  581. X    p->name = NULL;
  582. X    p->value = NULL;
  583. X    p->cmd = NULL;
  584. X    p->do_lookup = FALSE;
  585. X    p->val_spec = NULL;
  586. X    p->next = NULL;
  587. X
  588. X    /*
  589. X     * Field 1 - name of the configuration parameter.
  590. X     */
  591. X    if ( *bufp == 0 )
  592. X        goto err_field_count;
  593. X    p->name = Sstrdup(strfield(&bufp));
  594. X
  595. X    /*
  596. X     * Field 2 - PCL printer command to configure this parameter.
  597. X     */
  598. X    if ( *bufp == 0 )
  599. X        goto err_field_count;
  600. X    p->cmd = Sstrdup(strfield(&bufp));
  601. X
  602. X    /*
  603. X     * Field 3 - flag to enable translation of value via param file lookup.
  604. X     */
  605. X    if ( *bufp == 0 )
  606. X        goto err_field_count;
  607. X    p->do_lookup = ( stricmp(strfield(&bufp),"yes") == 0 );
  608. X
  609. X    /*
  610. X     * Field 4 - description of allowed values for this parameter.
  611. X     */
  612. X    if ( *bufp == 0 )
  613. X        goto err_field_count;
  614. X    s = strfield(&bufp);
  615. X    for ( i = 0 ; Pvalspec_tab[i].name != NULL ; ++i ) {
  616. X        if ( stricmp(Pvalspec_tab[i].name,s) == 0 ) {
  617. X        p->val_spec = &Pvalspec_tab[i];
  618. X        break;
  619. X        }
  620. X    }
  621. X    if ( Pvalspec_tab[i].name == NULL ) {
  622. X        fprintf(stderr,
  623. X        "%s(%s): unknown value type '%s' for parameter '%s'\n",
  624. X        Progname, Param_file, s, p->name);
  625. X        exit(1);
  626. X    }
  627. X
  628. X    if ( *bufp != '\0' )
  629. X        goto err_field_count;
  630. X
  631. X    }
  632. X
  633. X    return;
  634. X
  635. Xerr_field_count:
  636. X    fprintf(stderr,"%s(%s): bad field count in parameter '%s'\n",
  637. X    Progname,Param_file,p->name);
  638. X    exit(1);
  639. X}
  640. X
  641. X
  642. X/*
  643. X * get_param() - Retrieve the user-assigned value of a parameter.
  644. X *
  645. X * Arguments:    The name of the parameter to find.
  646. X *
  647. X * Returns:    Pointer to static character string containing the value,
  648. X *        or NULL if no value has been specified.
  649. X *
  650. X * Errors:    None.
  651. X *
  652. X * Punction and letter case are insignificant in the parameter name, i.e.
  653. X * "LeftMargin" will match the parameter named "left_margin".
  654. X */
  655. Xchar *get_param(name)
  656. Xregister char *name;
  657. X{
  658. X    register struct param_item *p;
  659. X    return ( (p=find_param(name)) == NULL ? (char *)NULL : p->value );
  660. X}
  661. X
  662. X
  663. X/*
  664. X * set_param() - Specify the user-assigned value of a parameter.
  665. X *
  666. X * Arguments:    An assignment specification, i.e. "orientation=port".
  667. X *
  668. X * Returns:    0 upon success, -1 upon error.  In the event of an error,
  669. X *        the global string "Err_buf" will describe the problem.
  670. X *
  671. X * Errors:    Error given upon poorly formed specifications or unknown
  672. X *        parameter names.
  673. X *
  674. X * The allowed specifications are of three forms:
  675. X *
  676. X *    /param_name        (suppress production of a configuration param)
  677. X *    param_name=value    (define a value for a configuration param)
  678. X *    cmd_name=value        (run one of the high level commands)
  679. X *
  680. X * Punction and letter case are insignificant in the parameter name, i.e.
  681. X * "LeftMargin" will match the parameter named "left_margin".
  682. X */
  683. Xint set_param(spec)
  684. Xchar *spec;
  685. X{
  686. X    struct param_item *p;
  687. X    char *name, *value;
  688. X    void (*cmdproc)();
  689. X    extern void free();
  690. X
  691. X    /*
  692. X     * Split the specification at '=' into option name and value.
  693. X     */
  694. X    if ( (value=strchr(spec,'=')) != NULL ) {
  695. X    *value++ = '\0';
  696. X    value = strtrim(value);
  697. X    }
  698. X    name = strtrim(spec);
  699. X
  700. X    /*
  701. X     * First, check for the "/param_name" form.
  702. X     */
  703. X    if ( *name == '/' ) {
  704. X    ++name;
  705. X    if ( value != NULL )
  706. X        goto err_value_not_allowed;
  707. X    if ( (p=find_param(name)) == NULL )
  708. X        goto err_unknown_param;
  709. X    if ( p->value != NULL )
  710. X        free(p->value);
  711. X    p->value = NULL;
  712. X    Dprintf(4)(stderr, "set_param> inhibited '%s'\n", p->name);
  713. X    return 0;
  714. X    }
  715. X
  716. X    /*
  717. X     * Second, check for the "param_name=value" form.
  718. X     */
  719. X    if ( (p=find_param(name)) != NULL ) {
  720. X    if ( value == NULL )
  721. X        goto err_value_missing;
  722. X    if ( p->value != NULL )
  723. X        free(p->value);
  724. X    p->value = Sstrdup(value);
  725. X    Dprintf(4)(stderr, "set_param> setting '%s' to '%s'\n", p->name, value);
  726. X    return 0;
  727. X    }
  728. X
  729. X    /*
  730. X     * Finally, check for the "cmd_name=value" form.
  731. X     */
  732. X    if ( (cmdproc=find_cmd(name)) != NULL ) {
  733. X    if ( value == NULL )
  734. X        goto err_value_missing;
  735. X    (*cmdproc)(value);
  736. X    return 0;
  737. X    }
  738. X
  739. X    /* else fall through to 'err_unknown_param' error */
  740. X
  741. Xerr_unknown_param:
  742. X    sprintf(Err_buf,"unknown parameter '%s'",name);
  743. X    return -1;
  744. X
  745. Xerr_value_not_allowed:
  746. X    sprintf(Err_buf,"value not allowed when inhibiting '%s'",name);
  747. X    return -1;
  748. X
  749. Xerr_value_missing:
  750. X    sprintf(Err_buf,"value missing on '%s'",name);
  751. X    return -1;
  752. X
  753. X}
  754. X
  755. X
  756. X
  757. X/*
  758. X * exec_param() - Emit the printer command string for the required config.
  759. X *
  760. X * Arguments:    File stream to send command string to, or NULL to suppress
  761. X *        actual output of the commands.
  762. X *
  763. X * Returns:    Nothing.
  764. X *
  765. X * Errors:    Prints diagnostic message and aborts program upon an error.
  766. X *
  767. X * This procedure goes through all of the possible parameters in the order
  768. X * loaded from the "Param_file", and emits a printer configuration command
  769. X * strong for each parameter which has been assigned a value by the user.
  770. X * This procedure will first check if the "do_lookup" flag has been defined
  771. X * for the parameter, and in which case it will translate the mnemonic name
  772. X * specified by the user to a printer code by performing a lookup in the
  773. X * "Param_file".  It will then take the value and validate it according to
  774. X * the "val_spec" for this parameter.
  775. X */
  776. Xvoid exec_param(fp)
  777. XFILE *fp;
  778. X{
  779. X    char *value;
  780. X    struct param_item *p;
  781. X    extern char *regex();
  782. X
  783. X    /*
  784. X     * Go through the linked list of all the possible printer parameters.
  785. X     */
  786. X    for ( p = Param_list.next ; p != NULL ; p = p->next ) {
  787. X
  788. X    /*
  789. X     * Only consider parameters for which a value has been assigned.
  790. X     */
  791. X    if ( p->value == NULL )
  792. X        continue;
  793. X
  794. X    /*
  795. X     * Perform definitions file lookup to translate value.
  796. X     */
  797. X    if ( p->do_lookup ) {
  798. X        value = fgetrec(Fp_param,p->name,p->value,(char *)NULL);
  799. X        if ( value == NULL ) {
  800. X        fprintf(stderr,
  801. X            "%s: bad value '%s' for %s (not found in param file)\n",
  802. X            Progname, p->value, p->name);
  803. X        exit(1);
  804. X        }
  805. X    } else {
  806. X        value = p->value;
  807. X    }
  808. X
  809. X    /*
  810. X     * Verify the parameter value.
  811. X     */
  812. X    if ( regex(p->val_spec->re,value) == NULL ) {
  813. X        fprintf(stderr,
  814. X        "%s: bad value '%s(%s)' for %s (illegal %s value)\n",
  815. X        Progname, value, p->value, p->name, p->val_spec->descrip);
  816. X        exit(1);
  817. X    }
  818. X
  819. X    /*
  820. X     * Generate the printer configuration string.
  821. X     */
  822. X    Dprintf(3)(stderr,"exec_param> initializing '%s' to '%s(%s)'\n",
  823. X        p->name, value, p->value);
  824. X    if ( fp != NULL )
  825. X        fprintf(fp, p->cmd, value);
  826. X
  827. X    }
  828. X
  829. X}
  830. X
  831. X
  832. X/*
  833. X * dump_param() - Dumps a list of the available configuration parameters.
  834. X *
  835. X * Arguments:    File stream to send listing to.
  836. X *
  837. X * Returns:    Nothing.
  838. X *
  839. X * Errors:    None.
  840. X *
  841. X * This procedure is used within the "help" to list all the available
  842. X * configuration parameters.
  843. X */
  844. Xvoid dump_param(fp)
  845. XFILE *fp;
  846. X{
  847. X    struct param_item *p;
  848. X    int col;
  849. X    fputs("    ",fp);
  850. X    for ( col = 1 , p = Param_list.next ; p != NULL ; ++col , p = p->next ) {
  851. X    if ( col == 5 ) {
  852. X        fputs("\n    ",fp);
  853. X        col = 1;
  854. X    }
  855. X    fprintf(fp,"%-16s",p->name);
  856. X    }
  857. X    putc('\n',fp);
  858. X}
  859. X
  860. END_OF_FILE_param.c
  861.     size="`wc -c < param.c`"
  862.     if test 11892 -ne "$size" ; then
  863.     echo "param.c: extraction error - got $size chars"
  864.     fi
  865. fi
  866. if test -f cmd.c -a "$1" != "-c" ; then
  867.     echo "cmd.c: file exists - will not be overwritten"
  868. else
  869.     echo "x - cmd.c (file 6 of 11, 11229 chars)"
  870.     sed -e 's/^X//' << 'END_OF_FILE_cmd.c' > cmd.c
  871. X/* @(#) cmd.c 1.1 90/06/20 23:04:22
  872. X *
  873. X * file:    cmd.c - command execution procedures
  874. X * package:    ljinit - HP LaserJet Initialization Generator
  875. X *
  876. X * These procedures handle the "setup", "font_id", and "page_id" commands.
  877. X * While most of this package is fairly generalized, the "font_id" and
  878. X * "page_id" procedures have specific knowledge of the HP LaserJet
  879. X * architecture, and furthermore, they demand that certain parameters be
  880. X * used.
  881. X *
  882. X * In particular, "font_id" makes use of the following parameters:
  883. X *
  884. X *    orientation    symbol_set    spacing    pitch    height
  885. X *    style        stroke        typeface
  886. X *
  887. X * The "page_id" command needs to access parameters named "orientation"
  888. X * and "paper_size" as well as a "page_dim" entry in the parameters file
  889. X * to calculate the page layout.  In turn, it sets the following parameters:
  890. X *
  891. X *    top_margin    text_length    vmi
  892. X *    left_margin    right_margin    hmi
  893. X *
  894. X * Edit History:
  895. X *
  896. X * Wed Feb 28 13:53:23 1990 - Chip Rosenthal <chip@chinacat.Unicom.COM>
  897. X *    Original composition.
  898. X * Wed Jun 20 23:02:47 1990 - Chip Rosenthal <chip@chinacat.Unicom.COM>
  899. X *    Cleanup and check into SCCS.
  900. X *
  901. X * Copyright 1990, Unicom Systems Development.  All rights reserved.
  902. X * See accompanying README file for terms of distribution and use.
  903. X */
  904. X
  905. X#include <stdio.h>
  906. X#include <string.h>
  907. X#include "ljinit.h"
  908. X
  909. XSCCSID("@(#) cmd.c 1.1 90/06/20 23:04:22")
  910. XCOPYRIGHT("Copyright 1990, Unicom Systems Development.  All rights reserved.")
  911. X
  912. Xstatic void get_page_dim();
  913. X
  914. X
  915. X/* 
  916. X * find_cmd() - Locate handler for a command.
  917. X *
  918. X * Arguments:    Name of the command to be executed.
  919. X *
  920. X * Returns:    Pointer to a procedure which handles this command.
  921. X *
  922. X * Errors:    NULL if an unknown command name is specified.
  923. X */
  924. Xvoid (*find_cmd(name))()
  925. Xchar *name;
  926. X{
  927. X    if ( stricmp(name,"setup") == 0 )        return cmd_setup;
  928. X    if ( stricmp(name,"font_id") == 0 )        return cmd_font_id;
  929. X    if ( stricmp(name,"page_id") == 0 )        return cmd_page_id;
  930. X    return (void (*)())NULL;
  931. X}
  932. X
  933. X
  934. X/*
  935. X * cmd_setup() - Execute the specified "setup".
  936. X *
  937. X * Arguments:    The name of a "setup".
  938. X *
  939. X * Returns:    Nothing.
  940. X *
  941. X * Errors:    Displays a diagnostic message and aborts program on error.
  942. X *
  943. X * The "Config_file" is searched for the specified "setup", and the arguments
  944. X * in this record are evaluated.
  945. X */
  946. Xvoid cmd_setup(value)
  947. Xchar *value;
  948. X{
  949. X    char *bufp, *savebuf;
  950. X    extern void free();
  951. X
  952. X    Dprintf(2)(stderr,"cmd_setup> loading setup '%s'\n", value);
  953. X
  954. X    /*
  955. X     * Locate this setup in the configuration file.
  956. X     */
  957. X    bufp = fgetrec(Fp_config,"setup",value,(char *)NULL);
  958. X    if ( bufp == NULL ) {
  959. X    fprintf(stderr, "%s(%s): setup '%s' not found in config file\n",
  960. X        Progname, Config_file, value);
  961. X    exit(1);
  962. X    }
  963. X
  964. X    /*
  965. X     * Go through all of the items in this setup.  We need to make a copy
  966. X     * of the setup in case we go recursive or cause fgetrec() to be run.
  967. X     */
  968. X    savebuf = bufp = Sstrdup(bufp);
  969. X    while ( *bufp != '\0' ) {
  970. X    if ( set_param(strfield(&bufp)) != 0 ) {
  971. X        fprintf(stderr,"%s: error processing setup '%s' - %s\n",
  972. X        Progname, value, Err_buf);
  973. X        exit(1);
  974. X    }
  975. X    }
  976. X    free(savebuf);
  977. X
  978. X}
  979. X
  980. X
  981. X/*
  982. X * cmd_font_id() - Execute the specified "font_id".
  983. X *
  984. X * Arguments:    The name of a "font_id".
  985. X *
  986. X * Returns:    Nothing.
  987. X *
  988. X * Errors:    Displays a diagnostic message and aborts program on error.
  989. X *
  990. X * The "Config_file" is searched for the specified "font_id", and the
  991. X * parameters corresponding to a font definition (listed in "font_component[]")
  992. X * are loaded from this record.
  993. X */
  994. Xvoid cmd_font_id(value)
  995. Xchar *value;
  996. X{
  997. X    char *bufp, spec[BUFLEN];
  998. X    int i;
  999. X
  1000. X    /*
  1001. X     * The "font_component" array contains the names of all the parameters
  1002. X     * in a "font_id" record, in the order in which they appear.
  1003. X     */
  1004. X    static char *font_component[] = {
  1005. X    "orientation", "symbol_set", "spacing", "pitch",
  1006. X    "height", "style", "stroke", "typeface", NULL
  1007. X    };
  1008. X
  1009. X    Dprintf(2)(stderr,"cmd_font_id> loading font_id '%s'\n", value);
  1010. X
  1011. X    /*
  1012. X     * Locate this font_id in the configuration file.
  1013. X     */
  1014. X    bufp = fgetrec(Fp_config,"font_id",value,(char *)NULL);
  1015. X    if ( bufp == NULL ) {
  1016. X    fprintf(stderr, "%s(%s): font_id '%s' not found in config file\n",
  1017. X        Progname, Config_file, value);
  1018. X    exit(1);
  1019. X    }
  1020. X
  1021. X    /*
  1022. X     * Load the components from the located record.
  1023. X     */
  1024. X    for ( i = 0 ; *bufp != '\0' && font_component[i] != NULL ; ++i ) {
  1025. X    strcat( strcat( strcpy(spec,font_component[i]), "="), strfield(&bufp) );
  1026. X    if ( set_param(spec) != 0 ) {
  1027. X        fprintf(stderr,"%s: error processing font_id '%s' - %s\n",
  1028. X        Progname, value, Err_buf);
  1029. X        exit(1);
  1030. X    }
  1031. X    }
  1032. X    if ( font_component[i] != NULL ) {
  1033. X    fprintf(stderr,"%s(%s): not enough fields in font_id '%s'\n",
  1034. X        Progname, Config_file, value);
  1035. X    exit(1);
  1036. X    }
  1037. X    if ( *bufp != '\0' ) {
  1038. X    fprintf(stderr,"%s(%s): too many fields in font_id '%s'\n",
  1039. X        Progname, Config_file, value);
  1040. X    exit(1);
  1041. X    }
  1042. X
  1043. X}
  1044. X
  1045. X
  1046. X/*
  1047. X * Items in a "page_dim" record which define the page dimensions.
  1048. X */
  1049. X#define DIM_PHYSICAL_PAGE_WID        0    /* dim A */
  1050. X#define DIM_PHYSICAL_PAGE_LEN        1    /* dim B */
  1051. X#define DIM_LOGICAL_PAGE_WID        2    /* dim C */
  1052. X#define DIM_MAX_LOGICAL_PAGE_LEN    3    /* dim D */
  1053. X#define DIM_LEFT_UNUSABLE_AREA        4    /* dim E */
  1054. X#define DIM_RIGHT_UNUSABLE_AREA        5    /* dim F */
  1055. X#define DIM_MIN_TOP_MARG        6    /* dim G */
  1056. X#define DIM_MIN_BOT_MARG        7    /* dim H */
  1057. X#define NUM_DIM_ITEMS            8
  1058. X
  1059. X/*
  1060. X * Items in a "page_id" record which define the page layout.
  1061. X */
  1062. X#define PAGE_LEFT_MARG        0    /* left margin in inches          */
  1063. X#define PAGE_RIGHT_MARG        1    /* right margin in inches          */
  1064. X#define PAGE_NUM_COLS        2    /* number of printable columns          */
  1065. X#define PAGE_TOP_MARG        3    /* top margin in inches              */
  1066. X#define PAGE_BOT_MARG        4    /* bottom margin in inches          */
  1067. X#define PAGE_NUM_LINES        5    /* number of printable lines          */
  1068. X#define NUM_PAGE_ITEMS        6
  1069. X
  1070. X/*
  1071. X * cmd_page_id() - Execute the specified "page_id".
  1072. X *
  1073. X * Arguments:    The name of a paget_id".
  1074. X *
  1075. X * Returns:    Nothing.
  1076. X *
  1077. X * Errors:    Displays a diagnostic message and aborts program on error.
  1078. X *
  1079. X * The "Config_file" is searched for the specified "page_id", and the
  1080. X * parameters associated with page layout are calculated and loaded from
  1081. X * the information in this record.  The "Param_file" will be consulted
  1082. X * for the "page_dim" record which lists the physical and logical page
  1083. X * dimensions for the selected page type and orientation.
  1084. X */
  1085. Xvoid cmd_page_id(value)
  1086. Xchar *value;
  1087. X{
  1088. X    int i;
  1089. X    char *bufp, spec[BUFLEN];
  1090. X    double printable_line_width, cols_per_inch;
  1091. X    double left_margin, right_margin;
  1092. X    double printable_line_height, lines_per_inch;
  1093. X    double page_dim[NUM_DIM_ITEMS], page_layout[NUM_PAGE_ITEMS];
  1094. X    extern double atof();
  1095. X
  1096. X    Dprintf(2)(stderr,"cmd_page_id> loading page_id '%s'\n", value);
  1097. X
  1098. X    /*
  1099. X     * Locate this page_id in the configuration file.
  1100. X     */
  1101. X    bufp = fgetrec(Fp_config,"page_id",value,(char *)NULL);
  1102. X    if ( bufp == NULL ) {
  1103. X    fprintf(stderr, "%s(%s): page_id '%s' not found in config file\n",
  1104. X        Progname, Config_file, value);
  1105. X    exit(1);
  1106. X    }
  1107. X
  1108. X    /*
  1109. X     * Convert the fields in the record to numeric values.
  1110. X     */
  1111. X    for ( i = 0 ; *bufp != '\0' && i < NUM_PAGE_ITEMS ; ++i )
  1112. X    page_layout[i] = atof(strfield(&bufp));
  1113. X    if ( i < NUM_PAGE_ITEMS ) {
  1114. X    fprintf(stderr, "%s(%s): not enough fields in page_id '%s'",
  1115. X        Progname, Config_file, value);
  1116. X    exit(1);
  1117. X    }
  1118. X    if ( *bufp != '\0' ) {
  1119. X    fprintf(stderr, "%s(%s): too many fields in page_id '%s'",
  1120. X        Progname, Config_file, value);
  1121. X    exit(1);
  1122. X    }
  1123. X
  1124. X    /*
  1125. X     * Load in the page dimensions for the given paper_size/orientation.
  1126. X     */
  1127. X    get_page_dim(page_dim,"page_id");
  1128. X
  1129. X    /*
  1130. X     * Calculate width of printable area in inches and number of cols/inch.
  1131. X     */
  1132. X    printable_line_width =
  1133. X    page_dim[DIM_PHYSICAL_PAGE_WID] -
  1134. X        (page_layout[PAGE_LEFT_MARG]+page_layout[PAGE_RIGHT_MARG]);
  1135. X    cols_per_inch = page_layout[PAGE_NUM_COLS] / printable_line_width;
  1136. X    Dprintf(5)(stderr, "cmd_page_id> printable_line_width = %f-(%f+%f) = %f\n",
  1137. X    page_dim[DIM_PHYSICAL_PAGE_WID],
  1138. X    page_layout[PAGE_LEFT_MARG], page_layout[PAGE_RIGHT_MARG],
  1139. X    printable_line_width
  1140. X    );
  1141. X    Dprintf(5)(stderr, "cmd_page_id> cols_per_inch = %f/%f = %f\n",
  1142. X    page_layout[PAGE_NUM_COLS], printable_line_width, cols_per_inch
  1143. X    );
  1144. X
  1145. X    /*
  1146. X     * Calculate the horizontal margins.
  1147. X     */
  1148. X    left_margin = cols_per_inch *
  1149. X    (page_layout[PAGE_LEFT_MARG]-page_dim[DIM_LEFT_UNUSABLE_AREA]);
  1150. X    right_margin = page_layout[PAGE_NUM_COLS] + left_margin - 1;
  1151. X
  1152. X    /*
  1153. X     * Calculate height of printable area in inches and number of lines/inch.
  1154. X     */
  1155. X    printable_line_height =
  1156. X    page_dim[DIM_PHYSICAL_PAGE_LEN] -
  1157. X        (page_layout[PAGE_TOP_MARG]+page_layout[PAGE_BOT_MARG]);
  1158. X    lines_per_inch = page_layout[PAGE_NUM_LINES] / printable_line_height;
  1159. X    Dprintf(5)(stderr, "cmd_page_id> printable_line_height = %f-(%f+%f) = %f\n",
  1160. X    page_dim[DIM_PHYSICAL_PAGE_LEN],
  1161. X    page_layout[PAGE_TOP_MARG], page_layout[PAGE_BOT_MARG],
  1162. X    printable_line_height
  1163. X    );
  1164. X    Dprintf(5)(stderr, "cmd_page_id> lines_per_inch = %f/%f = %f\n",
  1165. X    page_layout[PAGE_NUM_LINES], printable_line_height, lines_per_inch
  1166. X    );
  1167. X
  1168. X    /*
  1169. X     * Set the page layout parameters.
  1170. X     */
  1171. X    sprintf(spec, "left_margin=%.0f", left_margin);
  1172. X    if ( set_param(spec) != 0 )
  1173. X    goto err_bad_param;
  1174. X    sprintf(spec, "right_margin=%.0f", right_margin );
  1175. X    if ( set_param(spec) != 0 )
  1176. X    goto err_bad_param;
  1177. X    sprintf(spec, "hmi=%.4f", HMI_SCALE/cols_per_inch);
  1178. X    if ( set_param(spec) != 0 )
  1179. X    goto err_bad_param;
  1180. X    sprintf(spec, "top_margin=%.0f", lines_per_inch*page_layout[PAGE_TOP_MARG]);
  1181. X    if ( set_param(spec) != 0 )
  1182. X    goto err_bad_param;
  1183. X    sprintf(spec, "text_length=%.0f", page_layout[PAGE_NUM_LINES]);
  1184. X    if ( set_param(spec) != 0 )
  1185. X    goto err_bad_param;
  1186. X    sprintf(spec, "vmi=%.4f", VMI_SCALE/lines_per_inch);
  1187. X    if ( set_param(spec) != 0 )
  1188. X    goto err_bad_param;
  1189. X    return;
  1190. X
  1191. Xerr_bad_param:
  1192. X    fprintf(stderr,"%s: error processing page_id '%s' - %s\n",
  1193. X    Progname, value, Err_buf);
  1194. X    exit(1);
  1195. X}
  1196. X
  1197. X
  1198. Xstatic void get_page_dim(page_dim,cmdname)
  1199. Xdouble page_dim[];
  1200. Xchar *cmdname;
  1201. X{
  1202. X    int i;
  1203. X    char *ps, *or, *bufp;
  1204. X    double atof();
  1205. X
  1206. X    /*
  1207. X     * Get the paper size and page orientation.
  1208. X     */
  1209. X    if ( (ps=get_param("paper_size")) == NULL ) {
  1210. X    fprintf(stderr,"%s: must define an 'page_size' before doing '%s'\n",
  1211. X        Progname, cmdname);
  1212. X    exit(1);
  1213. X    }
  1214. X    if ( (or=get_param("orientation")) == NULL ) {
  1215. X    fprintf(stderr,"%s: must define an 'orientation' before doing '%s'\n",
  1216. X        Progname, cmdname);
  1217. X    exit(1);
  1218. X    }
  1219. X
  1220. X    /*
  1221. X     * Now get the paper dimensions based upon the paper_size and orientation.
  1222. X     */
  1223. X    bufp = fgetrec(Fp_param,"page_dim",ps,or,(char *)NULL);
  1224. X    if ( bufp == NULL ) {
  1225. X    fprintf(stderr,"%s(%s): page_dim for %s/%s not found",
  1226. X        Progname, Param_file, ps, or);
  1227. X    exit(1);
  1228. X    }
  1229. X
  1230. X    /*
  1231. X     * Convert the paper dimension fields to values in inches.
  1232. X     */
  1233. X    for ( i = 0 ; *bufp != '\0' && i < NUM_DIM_ITEMS ; ++i )
  1234. X    page_dim[i] = atof(strfield(&bufp)) / DOTS_INCH;
  1235. X    if ( i < NUM_DIM_ITEMS ) {
  1236. X    fprintf(stderr, "%s(%s): not enough fields in page_dim for %s/%s",
  1237. X        Progname, Param_file, ps, or);
  1238. X    exit(1);
  1239. X    }
  1240. X    if ( *bufp != '\0' ) {
  1241. X    fprintf(stderr, "%s(%s): too many fields in page_dim for %s/%s",
  1242. X        Progname, Param_file, ps, or);
  1243. X    exit(1);
  1244. X    }
  1245. X
  1246. X}
  1247. X
  1248. END_OF_FILE_cmd.c
  1249.     size="`wc -c < cmd.c`"
  1250.     if test 11229 -ne "$size" ; then
  1251.     echo "cmd.c: extraction error - got $size chars"
  1252.     fi
  1253. fi
  1254. if test -f misc.c -a "$1" != "-c" ; then
  1255.     echo "misc.c: file exists - will not be overwritten"
  1256. else
  1257.     echo "x - misc.c (file 7 of 11, 4200 chars)"
  1258.     sed -e 's/^X//' << 'END_OF_FILE_misc.c' > misc.c
  1259. X/* @(#) misc.c 1.1 90/06/20 23:04:25
  1260. X *
  1261. X * file:    misc.c - support procedures
  1262. X * package:    ljinit - HP LaserJet Initialization Generator
  1263. X *
  1264. X * Edit History:
  1265. X *
  1266. X * Wed Feb 28 13:53:23 1990 - Chip Rosenthal <chip@chinacat.Unicom.COM>
  1267. X *    Original composition.
  1268. X * Wed Jun 20 23:02:47 1990 - Chip Rosenthal <chip@chinacat.Unicom.COM>
  1269. X *    Cleanup and check into SCCS.
  1270. X *
  1271. X * Copyright 1990, Unicom Systems Development.  All rights reserved.
  1272. X * See accompanying README file for terms of distribution and use.
  1273. X */
  1274. X
  1275. X#include <stdio.h>
  1276. X#include <ctype.h>
  1277. X#include <string.h>
  1278. X#include <varargs.h>
  1279. X#include "ljinit.h"
  1280. X
  1281. XSCCSID("@(#) misc.c 1.1 90/06/20 23:04:25")
  1282. XCOPYRIGHT("Copyright 1990, Unicom Systems Development.  All rights reserved.")
  1283. X
  1284. X/*
  1285. X * fgetrec() - Retrieve a record from a file.  The first parameter is the
  1286. X * opened stream to search, followed by a list of field values to match.  A
  1287. X * pointer to the record, with the matched fields removed, is returned.  NULL
  1288. X * is returned upon lookup failure.
  1289. X */
  1290. X/*VARARGS1*/
  1291. Xchar *fgetrec(fp,va_alist)
  1292. XFILE *fp;
  1293. Xva_dcl
  1294. X{
  1295. X    va_list args;
  1296. X    int i;
  1297. X    char *bufp, *field[16];
  1298. X
  1299. X    /*
  1300. X     * Load in the list of fields.
  1301. X     */
  1302. X    va_start(args);
  1303. X    for ( i = 0 ; (field[i]=va_arg(args,char *)) != NULL ; ++i ) ;
  1304. X    va_end(args);
  1305. X
  1306. X    /*
  1307. X     * Go searching for the record which matches these fields.
  1308. X     */
  1309. X    rewind(fp);
  1310. X    while ( (bufp=fgetline(fp)) != NULL ) {
  1311. X    for ( i = 0 ; ; ++i ) {
  1312. X        if ( field[i] == NULL )
  1313. X        return bufp;
  1314. X        if ( stricmp(field[i],strfield(&bufp)) != 0 )
  1315. X        break;
  1316. X    }
  1317. X    }
  1318. X
  1319. X    return (char *) NULL;
  1320. X}
  1321. X
  1322. X
  1323. X/*
  1324. X * fgetline() - Get the next line from a stream.  Leading and trailing
  1325. X * whitespace is ignored.  Comments introduced with "#" are stripped.
  1326. X * Long lines may be continued by backslashes.  Blank lines are ignored.
  1327. X * Returns pointer to static data, or NULL on end of file.
  1328. X */
  1329. Xchar *fgetline(fp)
  1330. XFILE *fp;
  1331. X{
  1332. X    static char buf[BUFLEN];
  1333. X    int nchars;
  1334. X    char *bufp;
  1335. X
  1336. X    /*
  1337. X     * Clear out the buffer.
  1338. X     */
  1339. X    buf[0] = '\0';
  1340. X    nchars = 0;
  1341. X
  1342. X    /*
  1343. X     * Keep reading until we have a full line loaded.
  1344. X     */
  1345. X    for (;;) {
  1346. X
  1347. X    /*
  1348. X     * Read into the end of the buffer.
  1349. X     */
  1350. X    if ( fgets(buf+nchars,(int)sizeof(buf)-nchars,fp) == NULL )
  1351. X        return (char *) NULL;
  1352. X
  1353. X    /*
  1354. X     * Strip comments, leading/trailing white space.
  1355. X     */
  1356. X    bufp = strtrim(buf);
  1357. X    nchars = strlen(buf);
  1358. X
  1359. X    /*
  1360. X     * Ignore blank lines.
  1361. X     */
  1362. X    if ( nchars == 0 )
  1363. X        continue;
  1364. X
  1365. X    /*
  1366. X     * If there isn't a continued line then return what we have.
  1367. X     */
  1368. X    if ( buf[nchars-1] != '\\' )
  1369. X        return bufp;
  1370. X
  1371. X    /*
  1372. X     * Remove the continuation character.
  1373. X     */
  1374. X    buf[--nchars] = '\0';
  1375. X
  1376. X    }
  1377. X
  1378. X    /*NOTREACHED*/
  1379. X}
  1380. X
  1381. X
  1382. X/*
  1383. X * strfield() - Retrieve the first space-delimited field in a line, and
  1384. X * advance the buffer pointer to the start of the next field.
  1385. X */
  1386. Xchar *strfield(bufp)
  1387. Xchar **bufp;
  1388. X{
  1389. X    register char *w1, *w2;
  1390. X    for ( w1 = *bufp ; isspace(*w1) ; ++w1 ) ;
  1391. X    w2 = w1;
  1392. X    if ( *w2 != '\0' ) {
  1393. X    for ( ++w2 ; *w2 != '\0' && !isspace(*w2) ; ++w2 ) ;
  1394. X    if ( *w2 != '\0' )
  1395. X        for ( *w2++ = '\0' ; isspace(*w2) ; ++w2 ) ;
  1396. X    }
  1397. X    *bufp = w2;
  1398. X    return w1;
  1399. X}
  1400. X
  1401. X
  1402. X/*
  1403. X * stricmp() - Compare two strings, ignoring punctuation and letter case.
  1404. X */
  1405. Xint stricmp(s1,s2)
  1406. Xregister char *s1, *s2;
  1407. X{
  1408. X    int d;
  1409. X    do {
  1410. X    while ( *s1 != '\0' && !isalnum(*s1) )
  1411. X        ++s1;
  1412. X    while ( *s2 != '\0' && !isalnum(*s2) )
  1413. X        ++s2;
  1414. X    d = tolower(*s1) - tolower(*s2);
  1415. X    } while ( d == 0 && *s1++ != '\0' && *s2++ != '\0' );
  1416. X    return d;
  1417. X}
  1418. X
  1419. X
  1420. X/*
  1421. X * strtrim() - Trim comments and leading/trailing white space.
  1422. X */
  1423. Xchar *strtrim(buf)
  1424. Xregister char *buf;
  1425. X{
  1426. X    register char *s;
  1427. X
  1428. X    for ( ; isspace(*buf) ; ++buf ) ;
  1429. X    if ( (s=strchr(buf,'#')) != NULL )
  1430. X    *s = '\0';
  1431. X    for ( s = buf+strlen(buf)-1 ; s >= buf && isspace(*s) ; --s ) ;
  1432. X    *(++s) = '\0';
  1433. X    return buf;
  1434. X}
  1435. X
  1436. X
  1437. X/*
  1438. X * Smalloc() - Allocate memory with error checking.
  1439. X */
  1440. XPtr Smalloc(n)
  1441. Xregister unsigned n;
  1442. X{
  1443. X    extern Ptr malloc();
  1444. X    register Ptr s;
  1445. X    if ( (s=malloc(n)) == NULL ) {
  1446. X    fputs("malloc: out of space\n",stderr);
  1447. X    exit(2);
  1448. X    }
  1449. X    return s;
  1450. X}
  1451. X
  1452. X
  1453. X/*
  1454. X * Sstrdup() - Duplicate a string with error checking.
  1455. X */
  1456. Xchar *Sstrdup(s)
  1457. Xregister char *s;
  1458. X{
  1459. X    return strcpy( Smalloc((unsigned)strlen(s)+1), s );
  1460. X}
  1461. X
  1462. END_OF_FILE_misc.c
  1463.     size="`wc -c < misc.c`"
  1464.     if test 4200 -ne "$size" ; then
  1465.     echo "misc.c: extraction error - got $size chars"
  1466.     fi
  1467. fi
  1468. if test -f ljconfig.dat -a "$1" != "-c" ; then
  1469.     echo "ljconfig.dat: file exists - will not be overwritten"
  1470. else
  1471.     echo "x - ljconfig.dat (file 8 of 11, 8793 chars)"
  1472.     sed -e 's/^X//' << 'END_OF_FILE_ljconfig.dat' > ljconfig.dat
  1473. X# @(#) ljconfig.dat 1.1.1.1 90/06/22 19:13:25
  1474. X#
  1475. X# file:        ljconfig.dat - site specific configuration definitions
  1476. X# package:    ljinit - HP LaserJet Initialization Generator
  1477. X#
  1478. X# This file contains the site-specific definitions which are used to evaluate
  1479. X# the "setup", "pageid", and "fontid" commands.  The file is broken into three
  1480. X# sections, corresponding to the three commands.  Chances are good you'll want
  1481. X# to customize this file for the printer configurations you frequently use.
  1482. X#
  1483. X# Edit History:
  1484. X#
  1485. X# Wed Feb 28 13:53:23 1990 - Chip Rosenthal <chip@chinacat.Unicom.COM>
  1486. X#    Original composition.
  1487. X# Wed Jun 20 23:02:47 1990 - Chip Rosenthal <chip@chinacat.Unicom.COM>
  1488. X#     Cleanup and check into SCCS.
  1489. X#
  1490. X# Copyright 1990, Unicom Systems Development.  All rights reserved.
  1491. X# See accompanying README file for terms of distribution and use.
  1492. X#
  1493. X
  1494. X##############################################################################
  1495. X#
  1496. X# Setup Definitions
  1497. X#
  1498. X
  1499. X#
  1500. X# There must be a "default" setup defined.  It is evaluated before any of the
  1501. X# specifications on the command line, unless "-I" is specified to inhibit it.
  1502. X#
  1503. Xsetup default    setup=letter
  1504. X
  1505. X#
  1506. X# The "common" setup is a convenience to describe the things which are used
  1507. X# in most of the other setup definitions.
  1508. X#
  1509. Xsetup common                \
  1510. X        reset=yes        \
  1511. X        paper_size=letter    \
  1512. X        paper_source=internal    \
  1513. X        line_term=map_lf    \
  1514. X        line_wrap=disable    \
  1515. X        perf_skip=enable
  1516. X
  1517. X#
  1518. X# And finally, below are the setups which we use locally for 8.5x11 printing.
  1519. X#
  1520. Xsetup letter    setup=common font_id=I000  page_id=letter
  1521. Xsetup form    setup=common font_id=I002  page_id=form
  1522. Xsetup listing    setup=common font_id=I002  page_id=listing
  1523. Xsetup wide    setup=common font_id=I001  page_id=wide
  1524. Xsetup land    setup=common font_id=I001L page_id=land
  1525. X
  1526. X#
  1527. X# And the setup for envelope printing.
  1528. X#
  1529. Xsetup envelope                \
  1530. X        reset=yes        \
  1531. X        paper_size=com10    \
  1532. X        paper_source=manual_env    \
  1533. X        line_term=map_lf    \
  1534. X        line_wrap=disable    \
  1535. X        perf_skip=enable    \
  1536. X        font_id=I000L        \
  1537. X        clear_margins=yes    \
  1538. X        top_margin=10        \
  1539. X        left_margin=30
  1540. X
  1541. X
  1542. X############################################################################## 
  1543. X#
  1544. X# Page Layout Definitions
  1545. X#
  1546. X# A page layout definition specifies the desired margins (in inches) and the
  1547. X# number of chars/line and lines/page.  From this information, the following
  1548. X# parameters are automatically calculated and set:
  1549. X#
  1550. X#    left_margin    right_margin    hmi
  1551. X#    top_margin    text_length    vmi
  1552. X#
  1553. X#                   left  right    num    top    bot    num    intended use 
  1554. X#                   marg   marg   cols   marg   marg  lines    (orient/font)
  1555. X
  1556. Xpage_id  letter     0.60   0.60     72   0.50   0.50     66  # port/10cpi
  1557. Xpage_id  form       0.60   0.60     78   0.50   0.50     66  # port/12cpi
  1558. Xpage_id  listing    1.00   1.00     80   0.50   0.50     66  # port/12cpi
  1559. Xpage_id  wide       0.50   0.50    132   0.50   0.50     66  # port/teeny
  1560. Xpage_id  land       0.50   0.50    167   0.50   0.50     66  # land/teeny
  1561. X
  1562. X
  1563. X##############################################################################
  1564. X#
  1565. X# Font Definitions
  1566. X#
  1567. X# A font definition specifies all the components which comprise a font.
  1568. X# They are, in order:
  1569. X#
  1570. X#    orientation    symbol_set    spacing        pitch
  1571. X#    height        style        stroke        typeface
  1572. X#
  1573. X# The distributed definitions are for a LaserJet IIP, and the names
  1574. X# correspond to those printed on the IIP test sheet (except I append
  1575. X# "L" for landscape fonts).
  1576. X#
  1577. X
  1578. X#
  1579. X# Portrait Fonts
  1580. X#
  1581. X#               orien symbol_set space pitch ht    style   stroke typeface 
  1582. X
  1583. Xfont_id  I000   port  hp_roman8  fixed 10    12    upright medium courier
  1584. Xfont_id  I001   port  hp_roman8  fixed 16.67  8.5  upright medium line_printer
  1585. Xfont_id  I002   port  hp_roman8  fixed 12    10    upright medium courier
  1586. Xfont_id  I003   port  hp_roman8  fixed 12    10    upright bold   courier
  1587. Xfont_id  I004   port  hp_roman8  fixed 12    10    italic  bold   courier
  1588. Xfont_id  I005   port  hp_roman8  fixed 10    12    upright bold   courier
  1589. Xfont_id  I006   port  hp_roman8  fixed 10    12    upright bold   courier
  1590. Xfont_id  I007   port  iso_100    fixed 16.67  8.5  upright medium line_printer
  1591. Xfont_id  I008   port  iso_100    fixed 12    10    upright medium courier
  1592. Xfont_id  I009   port  iso_100    fixed 12    10    upright bold   courier
  1593. Xfont_id  I010   port  iso_100    fixed 12    10    italic  medium courier
  1594. Xfont_id  I011   port  iso_100    fixed 10    12    upright medium courier
  1595. Xfont_id  I012   port  iso_100    fixed 10    12    upright bold   courier
  1596. Xfont_id  I013   port  iso_100    fixed 10    12    italic  medium courier
  1597. Xfont_id  I014   port  pc_8       fixed 16.67  8.5  upright medium line_printer
  1598. Xfont_id  I015   port  pc_8       fixed 12    10    upright medium courier
  1599. Xfont_id  I016   port  pc_8       fixed 12    10    upright bold   courier
  1600. Xfont_id  I017   port  pc_8       fixed 12    10    italic  medium courier
  1601. Xfont_id  I018   port  pc_8       fixed 10    12    upright medium courier
  1602. Xfont_id  I019   port  pc_8       fixed 10    12    upright bold   courier
  1603. Xfont_id  I020   port  pc_8       fixed 10    12    italic  medium courier
  1604. Xfont_id  I021   port  pc_8dn     fixed 16.67  8.5  upright medium line_printer
  1605. Xfont_id  I022   port  pc_8dn     fixed 12    10    upright medium courier
  1606. Xfont_id  I023   port  pc_8dn     fixed 12    10    upright bold   courier
  1607. Xfont_id  I024   port  pc_8dn     fixed 12    10    italic  medium courier
  1608. Xfont_id  I025   port  pc_8dn     fixed 10    12    upright medium courier
  1609. Xfont_id  I026   port  pc_8dn     fixed 10    12    upright bold   courier
  1610. Xfont_id  I027   port  pc_8dn     fixed 10    12    italic  medium courier
  1611. Xfont_id  I028   port  pc_850     fixed 16.67  8.5  upright medium line_printer
  1612. Xfont_id  I029   port  pc_850     fixed 12    10    upright medium courier
  1613. Xfont_id  I030   port  pc_850     fixed 12    10    upright bold   courier
  1614. Xfont_id  I031   port  pc_850     fixed 12    10    italic  medium courier
  1615. Xfont_id  I032   port  pc_850     fixed 10    12    upright medium courier
  1616. Xfont_id  I033   port  pc_850     fixed 10    12    upright bold   courier
  1617. Xfont_id  I034   port  pc_850     fixed 10    12    italic  medium courier
  1618. X
  1619. X#
  1620. X# Landscape Fonts
  1621. X#
  1622. X#               orien symbol_set space pitch ht    style   stroke typeface 
  1623. X
  1624. Xfont_id  I000L  land  hp_roman8  fixed 10    12    upright medium courier
  1625. Xfont_id  I001L  land  hp_roman8  fixed 16.67  8.5  upright medium line_printer
  1626. Xfont_id  I002L  land  hp_roman8  fixed 12    10    upright medium courier
  1627. Xfont_id  I003L  land  hp_roman8  fixed 12    10    upright bold   courier
  1628. Xfont_id  I004L  land  hp_roman8  fixed 12    10    italic  bold   courier
  1629. Xfont_id  I005L  land  hp_roman8  fixed 10    12    upright bold   courier
  1630. Xfont_id  I006L  land  hp_roman8  fixed 10    12    upright bold   courier
  1631. Xfont_id  I007L  land  iso_100    fixed 16.67  8.5  upright medium line_printer
  1632. Xfont_id  I008L  land  iso_100    fixed 12    10    upright medium courier
  1633. Xfont_id  I009L  land  iso_100    fixed 12    10    upright bold   courier
  1634. Xfont_id  I010L  land  iso_100    fixed 12    10    italic  medium courier
  1635. Xfont_id  I011L  land  iso_100    fixed 10    12    upright medium courier
  1636. Xfont_id  I012L  land  iso_100    fixed 10    12    upright bold   courier
  1637. Xfont_id  I013L  land  iso_100    fixed 10    12    italic  medium courier
  1638. Xfont_id  I014L  land  pc_8       fixed 16.67  8.5  upright medium line_printer
  1639. Xfont_id  I015L  land  pc_8       fixed 12    10    upright medium courier
  1640. Xfont_id  I016L  land  pc_8       fixed 12    10    upright bold   courier
  1641. Xfont_id  I017L  land  pc_8       fixed 12    10    italic  medium courier
  1642. Xfont_id  I018L  land  pc_8       fixed 10    12    upright medium courier
  1643. Xfont_id  I019L  land  pc_8       fixed 10    12    upright bold   courier
  1644. Xfont_id  I020L  land  pc_8       fixed 10    12    italic  medium courier
  1645. Xfont_id  I021L  land  pc_8dn     fixed 16.67  8.5  upright medium line_printer
  1646. Xfont_id  I022L  land  pc_8dn     fixed 12    10    upright medium courier
  1647. Xfont_id  I023L  land  pc_8dn     fixed 12    10    upright bold   courier
  1648. Xfont_id  I024L  land  pc_8dn     fixed 12    10    italic  medium courier
  1649. Xfont_id  I025L  land  pc_8dn     fixed 10    12    upright medium courier
  1650. Xfont_id  I026L  land  pc_8dn     fixed 10    12    upright bold   courier
  1651. Xfont_id  I027L  land  pc_8dn     fixed 10    12    italic  medium courier
  1652. Xfont_id  I028L  land  pc_850     fixed 16.67  8.5  upright medium line_printer
  1653. Xfont_id  I029L  land  pc_850     fixed 12    10    upright medium courier
  1654. Xfont_id  I030L  land  pc_850     fixed 12    10    upright bold   courier
  1655. Xfont_id  I031L  land  pc_850     fixed 12    10    italic  medium courier
  1656. Xfont_id  I032L  land  pc_850     fixed 10    12    upright medium courier
  1657. Xfont_id  I033L  land  pc_850     fixed 10    12    upright bold   courier
  1658. Xfont_id  I034L  land  pc_850     fixed 10    12    italic  medium courier
  1659. X
  1660. END_OF_FILE_ljconfig.dat
  1661.     size="`wc -c < ljconfig.dat`"
  1662.     if test 8793 -ne "$size" ; then
  1663.     echo "ljconfig.dat: extraction error - got $size chars"
  1664.     fi
  1665. fi
  1666. if test -f ljparam.dat -a "$1" != "-c" ; then
  1667.     echo "ljparam.dat: file exists - will not be overwritten"
  1668. else
  1669.     echo "x - ljparam.dat (file 9 of 11, 9636 chars)"
  1670.     sed -e 's/^X//' << 'END_OF_FILE_ljparam.dat' > ljparam.dat
  1671. X# @(#) ljparam.dat 1.1 90/06/20 23:04:24
  1672. X#
  1673. X# file:        ljparam.dat - device specific definitions
  1674. X# package:    ljinit - HP LaserJet Initialization Generator
  1675. X#
  1676. X# Edit History:
  1677. X#
  1678. X# Wed Feb 28 13:53:23 1990 - Chip Rosenthal <chip@chinacat.Unicom.COM>
  1679. X#    Original composition.
  1680. X# Wed Jun 20 23:02:47 1990 - Chip Rosenthal <chip@chinacat.Unicom.COM>
  1681. X#    Cleanup and check into SCCS.
  1682. X#
  1683. X# Copyright 1990, Unicom Systems Development.  All rights reserved.
  1684. X# See accompanying README file for terms of distribution and use.
  1685. X#
  1686. X
  1687. X
  1688. X##############################################################################
  1689. X#
  1690. X# This file describes all the device-dependant parameters for the printer.
  1691. X# The distributed version has been tested with an HP LaserJet IIP printer.
  1692. X#
  1693. X# Some notes on the format of this file:
  1694. X#   - It is a sequence of records with space delimited fields.
  1695. X#   - Everything from a '#' to the end of line is ignored.
  1696. X#   - Blank lines are ignored.
  1697. X#   - Long lines may be continued with a backslash.
  1698. X#   - Punctuation and letter case are insignificant in the field values.
  1699. X#
  1700. X# There are three kinds of records in this file:
  1701. X#   - "param" records - describes a printer configuration parameter.
  1702. X#   - param value records - declares mnemonic names usable with params.
  1703. X#   - "page_dim" records - describes page dimensions.
  1704. X#
  1705. X# This file is broken into three sections, into which the three record types
  1706. X# are grouped.  Descriptions at the start of each section describes the
  1707. X# records which appear there.
  1708. X
  1709. X
  1710. X##############################################################################
  1711. X#
  1712. X# Parameter Definitions
  1713. X#
  1714. X# All of the LaserJet printer configuration parameters are defined here.
  1715. X# Each line is an entry which describes one parameter.  The order of the
  1716. X# "param" records is critical, they are emitted to the printer in the
  1717. X# order they occur in this file.  Also, be careful about changing names
  1718. X# around -- the procedures which handle the "page_id" and "font_id"
  1719. X# commands have specific knowledge of the parameter names they need to set.
  1720. X#
  1721. X# Each "param" record must have the following four fields:
  1722. X#
  1723. X# (1) The name of the printer configuration parameter.
  1724. X#
  1725. X# (2) The HP PCL code to configure this parameter.  This code will be
  1726. X#     run through a printf() command, so ensure that special characters
  1727. X#     are escaped appropriately.  A "%s" within the code will be replaced
  1728. X#     with the parameter value specified by the user.
  1729. X#
  1730. X# (3) A flag which indicates whether a lookup should be performed on this
  1731. X#     parameter.  If the value is "yes" (or "YES"), then "ljinit" will
  1732. X#     take the user-supplied value and translate it according to the
  1733. X#     definitions in section two of this file.  Any other value in this
  1734. X#     field means that the value specified by the user is what should
  1735. X#     be incorporated directly into the command sent to the printer.
  1736. X#
  1737. X# (4) A description of the allowed types for the value.  The following
  1738. X#     types may be given:
  1739. X#
  1740. X#         STRING    An arbitrary tesxt string.
  1741. X#         INT    A positive integer.
  1742. X#     SIGNINT    An integer.
  1743. X#    FLOAT2    A floating point value with up to 2 decimal digits.
  1744. X#    FLOAT4    A floating point value with up to 4 decimal digits.
  1745. X#
  1746. X#    name        code        lookup?    value_type
  1747. X#
  1748. Xparam    reset        \033E        no    STRING
  1749. Xparam    paper_source    \033&l%sH    yes    INT
  1750. Xparam    paper_size    \033&l%sA    yes    INT
  1751. Xparam    line_term    \033&k%sG    yes    INT
  1752. Xparam    line_wrap    \033&s%sC    yes    INT
  1753. Xparam    orientation    \033&l%sO    yes    INT
  1754. Xparam    symbol_set    \033(%s        yes    STRING
  1755. Xparam    spacing        \033(s%sP    yes    INT
  1756. Xparam    pitch        \033(s%sH    no    FLOAT2
  1757. Xparam    height        \033(s%sV    no    FLOAT2
  1758. Xparam    style        \033(s%sS    yes    INT
  1759. Xparam    stroke        \033(s%sB    yes    SIGNINT
  1760. Xparam    typeface    \033(s%sT    yes    INT
  1761. Xparam    long_offset    \033&l%sU    no    SIGNINT
  1762. Xparam    short_offset    \033&l%sZ    no    SIGNINT
  1763. Xparam    clear_margins    \0339        no    STRING
  1764. Xparam    hmi        \033&k%sH    no    FLOAT4
  1765. Xparam    left_margin    \033&a%sL    no    INT
  1766. Xparam    right_margin    \033&a%sM    no    INT
  1767. Xparam    vmi        \033&l%sC    no    FLOAT4
  1768. Xparam    text_length    \033&l%sF    no    INT
  1769. Xparam    top_margin    \033&l%sE    no    INT
  1770. Xparam    perf_skip    \033&l%sL    yes    INT
  1771. X
  1772. X
  1773. X##############################################################################
  1774. X#
  1775. X# Parameter Values
  1776. X#
  1777. X# When the third field in a "param" record is "yes", then the user's
  1778. X# value will be translated according to the rules in this section.
  1779. X# Each translation record has three fields:
  1780. X#
  1781. X#   - The parameter name to which this translation applies.
  1782. X#
  1783. X#   - The parameter value specified by the user.
  1784. X#
  1785. X#   - The parameter value to substitute for the user's value.
  1786. X#
  1787. X# Remember that letter case and punctuation are not significant when
  1788. X# matches upon fields 1 and 2 are performed.
  1789. X#
  1790. X
  1791. Xorientation    PORT            0    # portrait page orientation
  1792. Xorientation    LAND            1    # landscape page orientation
  1793. X
  1794. Xperf_skip    DISABLE            0    # disable perforation skip
  1795. Xperf_skip    ENABLE            1    # enable perforation skip
  1796. X
  1797. Xline_term    MAP_OFF            0    # CR=CR    LF=LF    FF=FF
  1798. Xline_term    MAP_CR            1    # CR=CR+LF LF=LF    FF=FF
  1799. Xline_term    MAP_LF            2    # CR=CR    LF=CR+LF FF=CR+FF
  1800. Xline_term    MAP_ALL            3    # CR=CR+LF LF=CR+LF FF=CR+FF
  1801. X
  1802. Xline_wrap    DISABLE            1    # disable long line wrap
  1803. Xline_wrap    ENABLE            0    # enable long line wrap
  1804. X
  1805. Xsymbol_set    HP_MATH7        0A    # HP Math-7
  1806. Xsymbol_set    HP_LINEDRAW        0B    # HP Line Draw
  1807. Xsymbol_set    ISO_60            0D    # ISO 60: Norwegian version 1
  1808. Xsymbol_set    ISO_61            1D    # ISO 61: Norwegian version 2
  1809. Xsymbol_set    HP_ROMAN        0E    # HP Roman Extension
  1810. Xsymbol_set    ISO_04            1E    # ISO 4: United Kingdom
  1811. Xsymbol_set    ISO_25            0F    # ISO 25: French
  1812. Xsymbol_set    ISO_69            1F    # ISO 69: French
  1813. Xsymbol_set    HP_GERMAN        0G    # HP German
  1814. Xsymbol_set    ISO_21            1G    # ISO 21: German
  1815. Xsymbol_set    HP_GREEK8        8G    # HP Greek-8
  1816. Xsymbol_set    ISO_15            0I    # ISO 15: Italian
  1817. Xsymbol_set    ISO_14            0K    # ISO 14: JIS ASCII
  1818. Xsymbol_set    ISO_57            2K    # ISO 57: Chinese
  1819. Xsymbol_set    TECHNICAL_7        1M    # Technical-7
  1820. Xsymbol_set    HP_MATH8        8M    # HP Math-8
  1821. Xsymbol_set    ISO_100            0N    # ISO 100: ECMA-94 (Latin 1)
  1822. Xsymbol_set    OCR_A            0O    # OCR A
  1823. Xsymbol_set    OCR_B            1O    # OCR B
  1824. Xsymbol_set    ISO_11            0S    # ISO 11: Swedish
  1825. Xsymbol_set    HP_SPANISH        1S    # HP Spanish
  1826. Xsymbol_set    ISO_17            2S    # ISO 17: Spanish
  1827. Xsymbol_set    ISO_10            3S    # ISO 10: Swedish
  1828. Xsymbol_set    ISO_16            4S    # ISO 16: Portugese
  1829. Xsymbol_set    ISO_84            5S    # ISO 84: Portugese
  1830. Xsymbol_set    ISO_85            6S    # ISO 85: Spanish
  1831. Xsymbol_set    ISO_6            0U    # ISO 6: ASCII
  1832. Xsymbol_set    HP_LEGAL        1U    # HP Legal
  1833. Xsymbol_set    ISO_2            2U    # ISO 2: Internat Ref Version
  1834. Xsymbol_set    OEM_1            7U    # OEM-1
  1835. Xsymbol_set    HP_ROMAN8        8U    # HP Roman-8
  1836. Xsymbol_set    PC_8            10U    # PC-8
  1837. Xsymbol_set    PC_8DN            11U    # PC-8 (D/N)
  1838. Xsymbol_set    HP_PIFONT        15U    # HP Pi Font
  1839. X
  1840. Xspacing        FIXED            0    # fixed font spacing
  1841. Xspacing        PROP            1    # proportional font spacing
  1842. X
  1843. Xstyle        UPRIGHT            0
  1844. Xstyle        ITALIC            1
  1845. X
  1846. Xstroke        ULTRA_THIN        -7
  1847. Xstroke        THIN            -5
  1848. Xstroke        LIGHT            -3
  1849. Xstroke        MEDIUM             0
  1850. Xstroke        BOLD             3
  1851. Xstroke        BLACK             5
  1852. Xstroke        ULTRA_BLACK         7
  1853. X
  1854. Xtypeface    LINE_PRINTER        0
  1855. Xtypeface    COURIER            3
  1856. Xtypeface    HELVETICA        4
  1857. Xtypeface    TIMES_ROMAN        5
  1858. Xtypeface    LETTER_GOTHIC        6
  1859. Xtypeface    PRESTIGE        8
  1860. Xtypeface    PRESENTATIONS        11
  1861. Xtypeface    OPTIMA            17
  1862. Xtypeface    GARAMOND        18
  1863. Xtypeface    COOPER_BLACK        19
  1864. Xtypeface    CORONET_BOLD        20
  1865. Xtypeface    BROADWAY        21
  1866. Xtypeface    BAUER_BODONI_BLACK_COND    22
  1867. Xtypeface    CENTURY_SCHOOLBOOK    23
  1868. Xtypeface    UNIVERSITY_ROMAN    24
  1869. X
  1870. Xpaper_source    CURRENT            0    # paper source unchanged
  1871. Xpaper_source    INTERNAL        1    # feed from internal tray
  1872. Xpaper_source    MANUAL            2    # paper from manual input
  1873. Xpaper_source    MANUAL_ENV        3    # envelope from manual input
  1874. Xpaper_source    LOWER            4    # lower cassette tray
  1875. X
  1876. Xpaper_size    EXECUTIVE        1    # 7.25" x 10.5" paper
  1877. Xpaper_size    LETTER            2    # 8.50" x 11.0" paper
  1878. Xpaper_size    LEGAL            3    # 8.50" x 14.0" paper
  1879. Xpaper_size    A4            26    # 210mm x 297mm paper
  1880. Xpaper_size    MONARCH            80    # letter envelope
  1881. Xpaper_size    COM10            81    # business envelope
  1882. Xpaper_size    DL            90    # 110mm x 220mm envelope
  1883. Xpaper_size    C5            91    # 162mm x 229mm envelope
  1884. X
  1885. X
  1886. X##############################################################################
  1887. X#
  1888. X# Page Dimensions (in dots)
  1889. X#
  1890. X# This section defines the dimensions of the page given particular "paper_size"
  1891. X# and "orientation" values.  This information was taken from the "LaserJet
  1892. X# Series II Technical Reference Manual".  Please don't change it.
  1893. X#
  1894. X#   A = physical page width
  1895. X#   B = physical page length
  1896. X#   C = logical page width
  1897. X#   D = max logical page length
  1898. X#   E = left physical page edge to left logical page edge
  1899. X#   F = right physical page edge to right logical page edge
  1900. X#   G = top physical page edge to top printable area edge
  1901. X#   H = bottom physical page edge to bottom printable area edge
  1902. X#
  1903. X#                             A     B     C     D     E     F     G     H
  1904. X#
  1905. Xpage_dim  letter     port  2550  3300  2400  3300    50   100    60    60
  1906. Xpage_dim  legal      port  2550  4200  2400  4200    50   100    60    60
  1907. Xpage_dim  executive  port  2175  3150  2025  3150    50   100    60    60
  1908. Xpage_dim  a4         port  2480  3507  2338  3507    50    92    60    58
  1909. Xpage_dim  com10      port  1237  2850  1087  2850    50   100    60    60
  1910. Xpage_dim  monarc     port  1162  2250  1012  2250    50   100    60    60
  1911. Xpage_dim  c5         port  1913  2704  1771  2704    50    92    60    58
  1912. Xpage_dim  dl         port  1299  2598  1157  2598    50    92    60    58
  1913. Xpage_dim  letter     land  3300  2550  3180  2550    60    60    50   100
  1914. Xpage_dim  legal      land  4200  2550  4080  2550    60    60    50   100
  1915. Xpage_dim  executive  land  3150  2175  3030  2175    60    60    50   100
  1916. Xpage_dim  a4         land  3507  2480  3389  2480    60    58    50    92
  1917. Xpage_dim  com10      land  2850  1237  2730  1237    60    60    50   100
  1918. Xpage_dim  monarc     land  2250  1162  2130  1162    60    60    50   100
  1919. Xpage_dim  c5         land  2704  1913  2586  1913    60    58    50    92
  1920. Xpage_dim  dl         land  2598  1299  2480  1299    60    58    50    92
  1921. X
  1922. END_OF_FILE_ljparam.dat
  1923.     size="`wc -c < ljparam.dat`"
  1924.     if test 9636 -ne "$size" ; then
  1925.     echo "ljparam.dat: extraction error - got $size chars"
  1926.     fi
  1927. fi
  1928. if test -f Makefile -a "$1" != "-c" ; then
  1929.     echo "Makefile: file exists - will not be overwritten"
  1930. else
  1931.     echo "x - Makefile (file 10 of 11, 1556 chars)"
  1932.     sed -e 's/^X//' << 'END_OF_FILE_Makefile' > Makefile
  1933. X
  1934. X# @(#) Makefile 1.1.1.1 90/06/22 17:40:59
  1935. X# Makefile for "ljinit" (generated by /local/bin/makemake version 1.00.09)
  1936. X# Created by bin@chinacat on Fri Jun 22 17:37:24 CDT 1990
  1937. X
  1938. XSHELL = /bin/sh
  1939. XCC = cc
  1940. XDEFS = 
  1941. XCOPTS = -O
  1942. XLOPTS = 
  1943. XLIBS = 
  1944. XDEBUG = -g -DDEBUG
  1945. XLINTFLAGS = -DLINT
  1946. X
  1947. XTARG = ljinit
  1948. XOTHERS = 
  1949. X
  1950. XSRCS = main.c param.c cmd.c misc.c
  1951. X
  1952. XOBJS = main.o param.o cmd.o misc.o
  1953. X
  1954. X# Any edits below this line will be lost if "makemake" is rerun!
  1955. X# Commands may be inserted after the '#%custom' line at the end of this file.
  1956. X
  1957. XCFLAGS = $(COPTS) $(DEFS) # $(DEBUG)
  1958. XLFLAGS = $(LOPTS) # $(DEBUG)
  1959. X
  1960. Xall:        $(TARG) $(OTHERS)
  1961. Xinstall:    all        ; inst Install
  1962. Xclean:                ; rm -f $(TARG) $(OBJS) a.out core $(TARG).lint
  1963. Xclobber:    clean        ; inst -u Install
  1964. Xlint:        $(TARG).lint
  1965. X
  1966. X$(TARG):        $(OBJS)
  1967. X        $(CC) $(LFLAGS) -o $@ $(OBJS) $(LIBS)
  1968. X
  1969. X$(TARG).lint:    $(TARG)
  1970. X        lint $(LINTFLAGS) $(DEFS) $(SRCS) $(LIBS) > $@
  1971. X
  1972. Xmain.o: ljinit.h main.c patchlevel.h
  1973. Xparam.o: ljinit.h param.c
  1974. Xcmd.o: cmd.c ljinit.h
  1975. Xmisc.o: ljinit.h misc.c
  1976. X
  1977. Xmake:        ;
  1978. X        /local/bin/makemake -i -v1.00.09 -aMakefile \
  1979. X            -DSHELL='$(SHELL)' -DCC='$(CC)' -DDEFS='$(DEFS)' \
  1980. X            -DCOPTS='$(COPTS)' -DLOPTS='$(LOPTS)' -DLIBS='$(LIBS)' \
  1981. X            -DDEBUG='$(DEBUG)' -DLINTFLAGS='$(LINTFLAGS)' \
  1982. X            -DOTHERS='$(OTHERS)' $(TARG) $(SRCS)
  1983. X
  1984. X#%custom - commands below this line will be maintained if 'makemake' is rerun
  1985. X
  1986. XSOURCES = README ljinit.h patchlevel.h main.c param.c cmd.c misc.c \
  1987. X    ljconfig.dat ljparam.dat Makefile testsheet
  1988. X
  1989. Xshar:        ljinit.shar
  1990. Xljinit.shar:    $(SOURCES)        ; shar $(SOURCES) > $@
  1991. X
  1992. Xbom:                    ; what $(SOURCES)
  1993. X
  1994. END_OF_FILE_Makefile
  1995.     size="`wc -c < Makefile`"
  1996.     if test 1556 -ne "$size" ; then
  1997.     echo "Makefile: extraction error - got $size chars"
  1998.     fi
  1999. fi
  2000. if test -f testsheet -a "$1" != "-c" ; then
  2001.     echo "testsheet: file exists - will not be overwritten"
  2002. else
  2003.     echo "x - testsheet (file 11 of 11, 5894 chars)"
  2004.     sed -e 's/^X//' << 'END_OF_FILE_testsheet' > testsheet
  2005. XLine 01    <<< the quick brown fox jumped over the lazy dog >>>  Line 01
  2006. XLine 02    <<< the quick brown fox jumped over the lazy dog >>>  Line 02
  2007. XLine 03    <<< the quick brown fox jumped over the lazy dog >>>  Line 03
  2008. XLine 04    <<< the quick brown fox jumped over the lazy dog >>>  Line 04
  2009. XLine 05    <<< the quick brown fox jumped over the lazy dog >>>  Line 05
  2010. XLine 06    <<< the quick brown fox jumped over the lazy dog >>>  Line 06
  2011. XLine 07    <<< the quick brown fox jumped over the lazy dog >>>  Line 07
  2012. XLine 08    <<< the quick brown fox jumped over the lazy dog >>>  Line 08
  2013. XLine 09    <<< the quick brown fox jumped over the lazy dog >>>  Line 09
  2014. X
  2015. X---------==========----------==========----------==========----------==========----------==========----------==========----------==========----------==========----------==========----------==========----------==========----------==========----------=
  2016. X0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111222222222222222222222222222222222222222222222222222
  2017. X0000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000111111111122222222223333333333444444444455555555556666666666777777777788888888889999999999000000000011111111112222222222333333333344444444445
  2018. X1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
  2019. X---------==========----------==========----------==========----------==========----------==========----------==========----------==========----------==========----------==========----------==========----------==========----------==========----------=
  2020. X
  2021. XLine 17    <<< the quick brown fox jumped over the lazy dog >>>  Line 17
  2022. XLine 18    <<< the quick brown fox jumped over the lazy dog >>>  Line 18
  2023. XLine 19    <<< the quick brown fox jumped over the lazy dog >>>  Line 19
  2024. XLine 20    <<< the quick brown fox jumped over the lazy dog >>>  Line 20
  2025. XLine 21    <<< the quick brown fox jumped over the lazy dog >>>  Line 21
  2026. XLine 22    <<< the quick brown fox jumped over the lazy dog >>>  Line 22
  2027. XLine 23    <<< the quick brown fox jumped over the lazy dog >>>  Line 23
  2028. XLine 24    <<< the quick brown fox jumped over the lazy dog >>>  Line 24
  2029. XLine 25    <<< the quick brown fox jumped over the lazy dog >>>  Line 25
  2030. XLine 26    <<< the quick brown fox jumped over the lazy dog >>>  Line 26
  2031. XLine 27    <<< the quick brown fox jumped over the lazy dog >>>  Line 27
  2032. XLine 28    <<< the quick brown fox jumped over the lazy dog >>>  Line 28
  2033. XLine 29    <<< the quick brown fox jumped over the lazy dog >>>  Line 29
  2034. XLine 30    <<< the quick brown fox jumped over the lazy dog >>>  Line 30
  2035. XLine 31    <<< the quick brown fox jumped over the lazy dog >>>  Line 31
  2036. XLine 32    <<< the quick brown fox jumped over the lazy dog >>>  Line 32
  2037. XLine 33    <<< the quick brown fox jumped over the lazy dog >>>  Line 33
  2038. XLine 34    <<< the quick brown fox jumped over the lazy dog >>>  Line 34
  2039. XLine 35    <<< the quick brown fox jumped over the lazy dog >>>  Line 35
  2040. XLine 36    <<< the quick brown fox jumped over the lazy dog >>>  Line 36
  2041. XLine 37    <<< the quick brown fox jumped over the lazy dog >>>  Line 37
  2042. XLine 38    <<< the quick brown fox jumped over the lazy dog >>>  Line 38
  2043. XLine 39    <<< the quick brown fox jumped over the lazy dog >>>  Line 39
  2044. XLine 40    <<< the quick brown fox jumped over the lazy dog >>>  Line 40
  2045. XLine 41    <<< the quick brown fox jumped over the lazy dog >>>  Line 41
  2046. XLine 42    <<< the quick brown fox jumped over the lazy dog >>>  Line 42
  2047. XLine 43    <<< the quick brown fox jumped over the lazy dog >>>  Line 43
  2048. XLine 44    <<< the quick brown fox jumped over the lazy dog >>>  Line 44
  2049. XLine 45    <<< the quick brown fox jumped over the lazy dog >>>  Line 45
  2050. XLine 46    <<< the quick brown fox jumped over the lazy dog >>>  Line 46
  2051. XLine 47    <<< the quick brown fox jumped over the lazy dog >>>  Line 47
  2052. XLine 48    <<< the quick brown fox jumped over the lazy dog >>>  Line 48
  2053. XLine 49    <<< the quick brown fox jumped over the lazy dog >>>  Line 49
  2054. XLine 50    <<< the quick brown fox jumped over the lazy dog >>>  Line 50
  2055. XLine 51    <<< the quick brown fox jumped over the lazy dog >>>  Line 51
  2056. XLine 52    <<< the quick brown fox jumped over the lazy dog >>>  Line 52
  2057. XLine 53    <<< the quick brown fox jumped over the lazy dog >>>  Line 53
  2058. XLine 54    <<< the quick brown fox jumped over the lazy dog >>>  Line 54
  2059. XLine 55    <<< the quick brown fox jumped over the lazy dog >>>  Line 55
  2060. XLine 56    <<< the quick brown fox jumped over the lazy dog >>>  Line 56
  2061. XLine 57    <<< the quick brown fox jumped over the lazy dog >>>  Line 57
  2062. XLine 58    <<< the quick brown fox jumped over the lazy dog >>>  Line 58
  2063. XLine 59    <<< the quick brown fox jumped over the lazy dog >>>  Line 59
  2064. XLine 60    <<< the quick brown fox jumped over the lazy dog >>>  Line 60
  2065. XLine 61    <<< the quick brown fox jumped over the lazy dog >>>  Line 61
  2066. XLine 62    <<< the quick brown fox jumped over the lazy dog >>>  Line 62
  2067. XLine 63    <<< the quick brown fox jumped over the lazy dog >>>  Line 63
  2068. XLine 64    <<< the quick brown fox jumped over the lazy dog >>>  Line 64
  2069. XLine 65    <<< the quick brown fox jumped over the lazy dog >>>  Line 65
  2070. XLine 66    <<< the quick brown fox jumped over the lazy dog >>>  Line 66
  2071. XLine 67    <<< the quick brown fox jumped over the lazy dog >>>  Line 67
  2072. XLine 68    <<< the quick brown fox jumped over the lazy dog >>>  Line 68
  2073. XLine 69    <<< the quick brown fox jumped over the lazy dog >>>  Line 69
  2074. XLine 70    <<< the quick brown fox jumped over the lazy dog >>>  Line 70
  2075. X
  2076. X@(#) testsheet 1.1 90/06/20 23:04:26
  2077. END_OF_FILE_testsheet
  2078.     size="`wc -c < testsheet`"
  2079.     if test 5894 -ne "$size" ; then
  2080.     echo "testsheet: extraction error - got $size chars"
  2081.     fi
  2082. fi
  2083. echo "done - 11 files extracted"
  2084. exit 0
  2085. -- 
  2086. Chip Rosenthal                            |  You aren't some icon carved out
  2087. chip@chinacat.Unicom.COM                  |  of soap, sent down here to clean
  2088. Unicom Systems Development, 512-482-8260  |  up my reputation.  -John Hiatt
  2089.  
  2090.  
  2091.