4 * Copyright 1990,1991 by the Massachusetts Institute of Technology
5 * For distribution and copying rights, see the file "mit-copyright.h"
8 #if !defined(lint) && !defined(SABER)
9 static char *rcsid = "$Id$";
10 #endif /* lint || SABER */
18 main(int argc, char *argv[])
29 static void parse_cmdline();
33 WinMain(HINSTANCE hinst, HINSTANCE hprevinstance, LPSTR cmdline, int noshow)
40 parse_cmdline(cmdline, &argv, &argc);
42 aklog(argc, argv, ¶ms);
48 * Generate agrv/argc here from command line.
49 * Note that windows doesn't pass us the executible name, so
50 * we need to fill that in manually.
54 parse_cmdline(char *cmdline, char ***pargv, int *pargc)
58 char *arg, *sep = " \t";
59 int argv_size = 10; /* to start with */
62 argv = malloc(argv_size * sizeof(char *));
65 MessageBox(NULL, "Fatal Error: Out of memory", AKLOG_DIALOG_NAME,
70 argv[argc++] = "aklog";
72 arg = strtok(cmdline, sep);
75 argv[argc] = strdup(arg);
78 MessageBox(NULL, "Fatal Error: Out of memory", AKLOG_DIALOG_NAME,
85 if (argc == argv_size) {
87 argv = realloc(argv, argv_size * sizeof(char *));
90 MessageBox(NULL, "Fatal Error: Out of memory",
97 arg = strtok(NULL, sep);