home *** CD-ROM | disk | FTP | other *** search
- /*
- * lemstart.c - check command line, plus some housecleaning
- *
- * copyright (c) by Alan W. Paeth, 1987. All rights reserved.
- */
-
- #include "lem.h"
-
- startup(argc, argv)
- char **argv;
- {
- int i, plotmode;
- plotmode = 0;
- /*
- * initialize based on probable .rc file
- */
- leminit();
- /*
- * set up object defaults
- */
- lastobj = 1; /* no objects */
- setattr('0'); /* default attr's (as if '0' typed) */
- gtype = LINE; /* draw lines by default */
- undo = UNDONONE; /* no operation to undo */
- /*
- * start user code and refresh the display
- */
- start();
- redraw();
- /*
- * command line prompt
- */
- msgpost("lemming ver 1 -- 'ctrl ^' for help");
- /*
- * possible file name on cmd line
- */
- changes = 0; /* no changes at present */
- /*
- * do all command line parsing
- */
- for(i=1; i<argc; i++)
- {
- if (argv[i][0] == '-')
- {
- switch(argv[i][1])
- {
- case 'p':
- case 'P': plotmode = 1; break;
- default: err("unknown command line flag"); break;
- }
- }
- else
- {
- if (!firstfile) firstfile = argv[i]; /* record first input file */
- readfileint(argv[i]);
- }
- }
- if (plotmode)
- {
- char outname[80];
- sprintf(outname, "%s.pic", firstfile);
- writepicint(outname);
- stop();
- exit(0);
- }
- }
-