new.
[libfirm] / ir / tr / tpop_t.h
1
2 # ifndef _IROP_T_H_
3 # define _IROP_T_H_
4
5 # include <stddef.h>
6 # include "tpop.h"
7 /****h* libfirm/tpop_t.h
8  *
9  * NAME
10  *   file tpop_t.h
11  * COPYRIGHT
12  *   (C) 2001 by Universitaet Karlsruhe
13  * AUTHORS
14  *   Goetz Lindenmaier
15  * NOTES
16  *   This file contains the datatypes hidden in tpop.h.
17  * SEE ALSO
18  *   tpop.h
19  *****
20  */
21
22 struct tp_op {
23   tp_opcode code;
24   ident *name;
25   size_t attr_size;
26 };
27
28 /****f* tpop/new_tpop
29  *
30  * NAME
31  *   new_tpop - Returns a new type opcode.
32  * NOTE
33  *   Allocates a new tp_op struct and initializes it's fields with
34  *   the passed values.  This function is only to be used during
35  *   initialization of the library.
36  * SYNOPSIS
37  *   tp_op * new_tpop (tp_opcode code, ident *name, size_t attr_size);
38  * INPUTS
39  *   code      - the enum for this type opcode.
40  *   name      - an ident for the name of the type opcode.
41  *   attr_size - the size of the attributes necessary for a type with
42  *               this opcode
43  * RESULT
44  *   A new type opcode.
45  ***
46  */
47 tp_op * new_tpop (tp_opcode code, ident *name, size_t attr_size);
48
49 /****f* tpop/new_tpop
50  *
51  * NAME
52  *   init_tpop - Initialize the tpop module.
53  * NOTE
54  *   Must be called during the initizlization of the library. Allocates
55  *   opcodes and sets the globals that are external visible as specified
56  *   in tpop.h.
57  * SYNOPSIS
58  *   void init_tpop (void);
59  * INPUTS
60  * RESULT
61  * SIDE EFFECTS
62  *   Allocates opcodes for classes, struct, method, union, array,
63  *   enumeration, pointer and primitive and sets the according values.
64  ***
65  */
66 void init_tpop (void);
67
68 /****f* tpop/get_topo_attr_size
69  *
70  * NAME
71  *   get_topo_attr_size - Returns the size of the attribute to this kind
72  *   of type.
73  * NOTE
74  *   Internal feature.
75  * SYNOPSIS
76  *   int get_tpop_attr_size (tp_op *op)
77  * INPUTS
78  *   op - The type opcode to get the size for.
79  * RESULT
80  *   The size of the attribute of types with this opcode.
81  * SIDE EFFECTS
82  ***
83  */
84 int get_tpop_attr_size (tp_op *op);
85
86 #endif /* _IROP_T_H_ */