Don't call ReadArgs() if started from WB.
[tangerine.git] / compiler / clib / stubs / genstubs.c
blobfa8ac1367f420c1e4a8560d70ae221ce0dff1960
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: stub function generator for clib functions
6 Lang: english
7 */
9 #include <stdio.h>
10 #include <string.h>
11 #include <stdlib.h>
12 #include <aros/cpu.h>
13 #include <exec/libraries.h>
15 #define SYSTEM_CALL(name, alias...) { #name , #alias },
17 struct
19 char *name;
20 char *alias;
21 } syscalls [] =
23 #include "../include/sys/syscall.def"
24 { NULL, NULL }
27 int main(int argc, char *argv[])
29 int n;
31 if (argc != 2)
33 fprintf(stderr, "Argument required: either '-list' or the name of the function\n");
34 return 1;
37 if (!strcmp(argv[1], "-list"))
39 for (n=0; syscalls[n].name; n++)
40 printf("%s\n",syscalls[n].name);
42 return 0;
45 for (n=0; syscalls[n].name != NULL; n++)
46 if (!strcmp(syscalls[n].name, argv[1]))
48 printf(STUBCODE_INIT);
49 printf(STUBCODE,
50 syscalls[n].name, "aroscbase",
51 &(__AROS_GETJUMPVEC(NULL, (n+1+LIB_RESERVED))->vec)
53 if (syscalls[n].alias[0] != '\0' )
55 printf(ALIASCODE,
56 syscalls[n].name, syscalls[n].alias
60 return 0;
63 fprintf(stderr, "Invalid function name \"%s\"\n", argv[1]);
65 return 1;