replace value with speed definition
[AROS.git] / tools / genmodule / functionhead.h
blob9b75d051502ae30fedf296d5c1e2b3bc787040ff
1 /*
2 Copyright © 1995-2005, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: global include for genmodule. Defines global variables and
6 the function prototypes.
7 */
8 #ifndef FUNCTIONHEAD_H
9 #define FUNCTIONHEAD_H
11 #include <stdio.h>
12 #include <stdlib.h>
13 #include <string.h>
14 #include <ctype.h>
16 #include "stringlist.h"
18 enum libcall { STACK, REGISTER, MIXED, REGISTERMACRO, AUTOREGISTER };
20 struct functionarg {
21 struct functionarg *next;
22 char *arg;
23 char *reg;
26 struct functionhead {
27 struct functionhead *next;
28 char *name;
29 char *type;
30 enum libcall libcall;
31 unsigned int argcount;
32 struct functionarg *arguments;
33 struct stringlist *aliases;
34 unsigned int lvo; /* Only for library functions, not methods */
35 struct stringlist *interface; /* Only for HIDD class */
36 char *method; /* Only for HIID class */
37 int novararg : 1; /* Are varargs allowed for this function ? */
38 int priv : 1; /* Is function private */
41 struct functionhead *newfunctionhead(const char *name, enum libcall libcall);
42 struct functionarg *funcaddarg
44 struct functionhead *funchead,
45 const char *arg, const char *reg
47 struct stringlist *funcaddalias(struct functionhead *funchead, const char *alias);
49 /* Write out the function prototypes for the functions in the given
50 * cfg may be NULL if the list only contains functions with STACK libcall
52 struct config;
53 void writefuncdefs(FILE *out, struct config *cfg, struct functionhead *funclist);
54 void writefuncprotos(FILE *out, struct config *cfg, struct functionhead *funclist);
55 void writefuncinlines(FILE *out, struct config *cfg, struct functionhead *funclist);
57 /* getargtype remove the variable name from a variable definition and leave return
58 * the type of the variable
59 * [] at the end will be added as * in the variable type
60 * e.g. char *var[] => type: char **, name: var
61 * This is a destructive function and will change to string pointed to by def
62 * to only contain the type afterwards.
63 * Function return 0 when it did not understand the input, 1 otherwise
65 char *getargtype(const struct functionarg *funcarg);
66 char *getargname(const struct functionarg *funcarg);
68 #endif //FUNCTIONHEAD_H