1
1
############################################################# -*- c -*-
2
2
## generic include for XXX. Do not use directly.
4
## $Id: generic-table-oids.m2c,v 1.10 2004/10/08 23:39:17 rstory Exp $
4
## $Id: generic-table-oids.m2c,v 1.14 2005/09/27 15:56:08 rstory Exp $
5
5
########################################################################
6
6
@if $m2c_create_fewer_files != 1@
19
19
@end@ // m2c_create_fewer_files
20
20
########################################################################
21
21
@if $m2c_mark_boundary == 1@
22
/** START header generated by $RCSfile: generic-table-oids.m2c,v $ $Revision: 1.10 $ */
22
/** START header generated by $RCSfile: generic-table-oids.m2c,v $ $Revision: 1.14 $ */
26
26
/* column number definitions for table $context */
27
27
#define $context.uc_OID $context.commaoid
28
29
@eval $minv = 0xffffffff@
31
@eval $gto_flag_req = ""@
32
@eval $gto_flag_set = ""@
30
33
@foreach $node column@
31
#define COLUMN_$node.uc $node.subid
34
#define COLUMN_$node.uc $node.subid
32
35
@if $node.accessible == 1@
36
@if ($node.settable == 1) || ($m2c_table_sparse == 1)@
37
@ eval $m2c_tmp_gto = ($node.subid - 1)@
38
@ if "x$gto_flag_set" eq "x"@
39
@ eval $gto_flag_set = "COLUMN_$node.uc_FLAG"@
41
@ eval $gto_flag_set = "$gto_flag_set | COLUMN_$node.uc_FLAG"@
43
#define COLUMN_$node.uc_FLAG (0x1 << $m2c_tmp_gto)
45
@if ($m2c_table_row_creation == 1) && ($node.settable == 1) && ("x$node.defval" eq "x")@
46
@if "x$gto_flag_req" eq "x"@
47
@eval $gto_flag_req = "COLUMN_$node.uc_FLAG"@
49
@eval $gto_flag_req = "$gto_flag_req | COLUMN_$node.uc_FLAG"@
33
52
@if $node.subid < $minv@
34
53
@eval $minv = $node.subid@
35
54
@eval $minn = "COLUMN_$node.uc"@
39
58
@eval $maxn = "COLUMN_$node.uc"@
44
#define $context.uc_MIN_COL $minn
45
#define $context.uc_MAX_COL $maxn
64
#define $context.uc_MIN_COL $minn
65
#define $context.uc_MAX_COL $maxn
67
## column_set_flags and column_exist_flags are unsigned ints, to 32 is
68
## the limit. Could try something with a 'long long' to see if that
69
## can get us to 64, or do something like FD_SET, which would let us
70
## be pretty unlimited.
73
@ print ERROR: more than 32 columns not supported yet.@
47
78
@ if $m2c_table_settable@
79
@if "x$gto_flag_set" ne "x"@
49
* change flags for writable columns
81
* TODO:405:r: Review $context.uc_SETTABLE_COLS macro.
82
* OR together all the writable cols.
51
@eval $gto_flag_idx = 0@
52
@eval $gto_flag_req = ""@
53
@foreach $node column@
54
@if $node.settable == 1@
55
#define FLAG_$node.uc (0x1 << $gto_flag_idx)
56
@eval $gto_flag_idx = $gto_flag_idx + 1@
57
@if ($m2c_table_row_creation == 1) && ("x$node.defval" eq "x")@
58
@if "x$gto_flag_req" eq "x"@
59
@eval $gto_flag_req = "FLAG_$node.uc"@
61
@eval $gto_flag_req = "$gto_flag_req | FLAG_$node.uc"@
67
#define FLAG_MAX_$context.uc $gto_flag_idx
69
@if $m2c_table_row_creation == 1@
70
@if "x$gto_flag_req" ne "x"@
84
#define $context.uc_SETTABLE_COLS ($gto_flag_set)
86
@if $m2c_table_row_creation@
87
@if "x$gto_flag_req" ne "x"@
72
89
* TODO:405:r: Review $context.uc_REQUIRED_COLS macro.
73
90
* OR together all the required rows for row creation.
80
@if $gto_flag_idx > 31@
81
@ print ERROR: more then 32 settable columns not supported yet.@
86
98
@if $m2c_create_fewer_files != 1@
87
99
@eval $m2c_save = "$name"@
88
100
@eval $name = "${m2c_save}_oids"@
89
101
@include generic-header-bottom.m2i@
90
@eval $name = $m2c_save@
102
@eval $name = "$m2c_save"@
92
104
########################################################################
93
105
@if $m2c_mark_boundary == 1@
94
/** END header generated by $RCSfile: generic-table-oids.m2c,v $ $Revision: 1.10 $ */
106
/** END header generated by $RCSfile: generic-table-oids.m2c,v $ $Revision: 1.14 $ */