Cygwin: strptime: add release note
[newlib-cygwin.git] / winsup / cygwin / lib / libcmain.c
blobe796d3b63fccc1774685f222c9e81a6e1a63dde3
1 /* libcmain.c
3 This file is part of Cygwin.
5 This software is a copyrighted work licensed under the terms of the
6 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
7 details. */
9 #include <windows.h>
11 #define SP " \t\n"
13 /* Allow apps which don't have a main to work, as long as they define WinMain */
14 int
15 main ()
17 HMODULE x = GetModuleHandle (0);
18 char *s = GetCommandLine ();
19 STARTUPINFO si;
20 char *nexts;
22 s += strspn (s, SP);
24 if (*s != '"')
25 nexts = strpbrk (s, SP);
26 else
27 while ((nexts = strchr (s + 1, '"')) != NULL && nexts[-1] == '\\')
28 s = nexts;
30 if (!nexts)
31 nexts = strchr (s, '\0');
32 else if (*++nexts)
33 nexts += strspn (nexts, SP);
35 GetStartupInfo (&si);
37 return WinMain (x, 0, nexts,
38 ((si.dwFlags & STARTF_USESHOWWINDOW) != 0
39 ? si.wShowWindow
40 : SW_SHOWNORMAL));