winetest: Use main instead of WinMain as entry point.

This commit is contained in:
Alexandre Julliard 2008-12-16 12:07:53 +01:00
parent 34613835a7
commit 24d3b1f622
1 changed files with 23 additions and 12 deletions

View File

@ -665,28 +665,28 @@ usage (void)
" -t TAG include TAG of characters [-.0-9a-zA-Z] in the report\n"); " -t TAG include TAG of characters [-.0-9a-zA-Z] in the report\n");
} }
int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst, int main( int argc, char *argv[] )
LPSTR cmdLine, int cmdShow)
{ {
char *logname = NULL; char *logname = NULL;
const char *cp, *submit = NULL; const char *cp, *submit = NULL;
int reset_env = 1; int reset_env = 1;
int poweroff = 0; int poweroff = 0;
int interactive = 1; int interactive = 1;
int i;
if (!LoadStringA( 0, IDS_BUILD_ID, build_id, sizeof(build_id) )) build_id[0] = 0; if (!LoadStringA( 0, IDS_BUILD_ID, build_id, sizeof(build_id) )) build_id[0] = 0;
cmdLine = strtok (cmdLine, whitespace); for (i = 1; argv[i]; i++)
while (cmdLine) { {
if (cmdLine[0] != '-' || cmdLine[2]) { if (argv[i][0] != '-' || argv[i][2]) {
if (nb_filters == sizeof(filters)/sizeof(filters[0])) if (nb_filters == sizeof(filters)/sizeof(filters[0]))
{ {
report (R_ERROR, "Too many test filters specified"); report (R_ERROR, "Too many test filters specified");
exit (2); exit (2);
} }
filters[nb_filters++] = xstrdup( cmdLine ); filters[nb_filters++] = argv[i];
} }
else switch (cmdLine[1]) { else switch (argv[i][1]) {
case 'c': case 'c':
report (R_TEXTMODE); report (R_TEXTMODE);
interactive = 0; interactive = 0;
@ -706,16 +706,28 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
interactive = 0; interactive = 0;
break; break;
case 's': case 's':
submit = strtok (NULL, whitespace); if (!(submit = argv[++i]))
{
usage();
exit( 2 );
}
if (tag) if (tag)
report (R_WARNING, "ignoring tag for submission"); report (R_WARNING, "ignoring tag for submission");
send_file (submit); send_file (submit);
break; break;
case 'o': case 'o':
logname = strtok (NULL, whitespace); if (!(logname = argv[++i]))
{
usage();
exit( 2 );
}
break; break;
case 't': case 't':
tag = strtok (NULL, whitespace); if (!(tag = argv[++i]))
{
usage();
exit( 2 );
}
if (strlen (tag) > MAXTAGLEN) if (strlen (tag) > MAXTAGLEN)
report (R_FATAL, "tag is too long (maximum %d characters)", report (R_FATAL, "tag is too long (maximum %d characters)",
MAXTAGLEN); MAXTAGLEN);
@ -727,11 +739,10 @@ int WINAPI WinMain (HINSTANCE hInst, HINSTANCE hPrevInst,
} }
break; break;
default: default:
report (R_ERROR, "invalid option: -%c", cmdLine[1]); report (R_ERROR, "invalid option: -%c", argv[i][1]);
usage (); usage ();
exit (2); exit (2);
} }
cmdLine = strtok (NULL, whitespace);
} }
if (!submit) { if (!submit) {
report (R_STATUS, "Starting up"); report (R_STATUS, "Starting up");