mlib update: new isnan()/isnanf() implementation
[tangerine.git] / compiler / clib / stubs / genstubs.c
blob8ee848f258a22dfc8a94dcbccc683397821a2983
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 <exec/libraries.h>
10 #undef __const
12 #include <stdio.h>
13 #include <string.h>
14 #include <stdlib.h>
15 #include <aros/cpu.h>
17 #define SYSTEM_CALL(name, alias...) { #name , #alias },
19 struct
21 char *name;
22 char *alias;
23 } syscalls [] =
25 #include "../include/sys/syscall.def"
26 { NULL, NULL }
29 int main(int argc, char *argv[])
31 int n;
33 if (argc != 2)
35 fprintf(stderr, "Argument required: either '-list' or the name of the function\n");
36 return 1;
39 if (!strcmp(argv[1], "-list"))
41 for (n=0; syscalls[n].name; n++)
42 printf("%s\n",syscalls[n].name);
44 return 0;
47 for (n=0; syscalls[n].name != NULL; n++)
48 if (!strcmp(syscalls[n].name, argv[1]))
50 printf(STUBCODE_INIT);
51 printf(STUBCODE,
52 syscalls[n].name, "aroscbase",
53 &(__AROS_GETJUMPVEC(NULL, (n+1+LIB_RESERVED))->vec)
55 if (syscalls[n].alias[0] != '\0' )
57 printf(ALIASCODE,
58 syscalls[n].name, syscalls[n].alias
62 return 0;
65 fprintf(stderr, "Invalid function name \"%s\"\n", argv[1]);
67 return 1;