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[])
33 static void parse_cmdline();
37 WinMain(HINSTANCE hinst, HINSTANCE hprevinstance, LPSTR cmdline, int noshow)
44 parse_cmdline(cmdline, &argv, &argc);
46 aklog_init_params(¶ms);
47 aklog(argc, argv, ¶ms);
53 * Generate agrv/argc here from command line.
54 * Note that windows doesn't pass us the executible name, so
55 * we need to fill that in manually.
59 parse_cmdline(char *cmdline, char ***pargv, int *pargc)
63 char *arg, *sep = " \t";
64 int argv_size = 10; /* to start with */
67 argv = malloc(argv_size * sizeof(char *));
70 MessageBox(NULL, "Fatal Error: Out of memory", AKLOG_DIALOG_NAME,
75 argv[argc++] = "aklog";
77 arg = strtok(cmdline, sep);
80 argv[argc] = strdup(arg);
83 MessageBox(NULL, "Fatal Error: Out of memory", AKLOG_DIALOG_NAME,
90 if (argc == argv_size) {
92 argv = realloc(argv, argv_size * sizeof(char *));
95 MessageBox(NULL, "Fatal Error: Out of memory",
102 arg = strtok(NULL, sep);