home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
17 Bit Software 1: Collection A
/
17Bit_Collection_A.iso
/
files
/
1112.dms
/
1112.adf
/
ImageEd
/
Source
/
ImageBack.c
< prev
next >
Wrap
C/C++ Source or Header
|
1988-07-25
|
2KB
|
57 lines
/*
ImageBack - code for background task of ImageEd.
(c) 1990 Olaf Leimann
*/
#include <exec/types.h>
#include <workbench/startup.h>
#define MAXARG 32 /* maximum command line arguments */
#define QUOTE '"'
#define isspace(c) ((c == ' ')||(c == '\t') || (c == '\n'))
long _stack = 4000 ;
char *_procname = "Image Ed v1.0" ;
long _priority = 0 ;
long _BackGroundIO = 0 ;
int argc ;
char **targv,
*argv[MAXARG]; /* arg pointers */
extern struct WBStartup *WBenchMsg;
extern void main(int,char **);
void _main(line)
register char *line;
{
register char **pargv;
while (argc < MAXARG)
{
while (isspace(*line)) line++;
if (*line == '\0') break;
pargv = &argv[argc++];
if (*line == QUOTE)
{
*pargv = ++line; /* ptr inside quoted string */
while ((*line != '\0') && (*line != QUOTE)) line++;
if (*line == '\0') _exit(1);
else *line++ = '\0'; /* terminate arg */
}
else /* non-quoted arg */
{
*pargv = line;
while ((*line != '\0') && (!isspace(*line))) line++;
if (*line == '\0') break;
else *line++ = '\0'; /* terminate arg */
}
} /* while */
targv = (argc == 0) ? (char **)WBenchMsg : (char **)&argv[0];
main(argc,targv); /* call main function */
_exit(0);
}