~ubuntu-branches/ubuntu/lucid/judy/lucid

« back to all changes in this revision

Viewing changes to tool/listJPtype.c

  • Committer: Bazaar Package Importer
  • Author(s): Theodore Y. Ts'o
  • Date: 2004-01-17 00:04:53 UTC
  • Revision ID: james.westby@ubuntu.com-20040117000453-d5sj6uoon2v1g4gf
Tags: upstream-0.0.4
ImportĀ upstreamĀ versionĀ 0.0.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (C) 2000 - 2002 Hewlett-Packard Company
 
2
//
 
3
// This program is free software; you can redistribute it and/or modify it
 
4
// under the term of the GNU Lesser General Public License as published by the
 
5
// Free Software Foundation; either version 2 of the License, or (at your
 
6
// option) any later version.
 
7
//
 
8
// This program is distributed in the hope that it will be useful, but WITHOUT
 
9
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 
10
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License
 
11
// for more details.
 
12
//
 
13
// You should have received a copy of the GNU Lesser General Public License
 
14
// along with this program; if not, write to the Free Software Foundation,
 
15
// Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
16
// _________________
 
17
 
 
18
// @(#) $Revision: 4.9 $ $Date: 2002/06/25 00:35:37 $
 
19
// @(#) $Source: /cvsroot/judy/tool/listJPtype.c,v $
 
20
 
 
21
// Print JP values.
 
22
//
 
23
// Compile with one of -DJUDY1 or -DJUDYL; defaults to JUDY1:
 
24
//
 
25
// IOPTS='-I ../src -I ../src/Judy1 -I ../src/JudyL -I ../src/JudyCommon'
 
26
// cc       -Ae -DJUDY1            $IOPTS listJPtype.c -o listJPtype1
 
27
// cc       -Ae -DJUDYL            $IOPTS listJPtype.c -o listJPtypeL
 
28
// cc +DD64 -Ae -DJUDY1 -DJU_64BIT $IOPTS listJPtype.c -o listJPtype1_64
 
29
// cc +DD64 -Ae -DJUDYL -DJU_64BIT $IOPTS listJPtype.c -o listJPtypeL_64
 
30
 
 
31
#ifndef JUDYL
 
32
#ifndef JUDY1
 
33
#define JUDY1 1                 // neither set => use default.
 
34
#endif
 
35
#endif
 
36
 
 
37
#ifdef JUDY1
 
38
#include "Judy1.h"
 
39
#else
 
40
#include "JudyL.h"
 
41
#endif
 
42
 
 
43
// Lists of all JP types; must agree with header files:
 
44
 
 
45
struct list {
 
46
        char *  name;
 
47
        int     value;
 
48
} *Plist, list[] = {
 
49
 
 
50
#ifdef JUDY1
 
51
 
 
52
    { "cJ1_JAPNULL",            cJ1_JAPNULL,            },
 
53
    { "cJ1_JAPLEAF",            cJ1_JAPLEAF,            },
 
54
    { "cJ1_JAPBRANCH",          cJ1_JAPBRANCH,          },
 
55
    { "cJ1_JPNULL1",            cJ1_JPNULL1,            },
 
56
    { "cJ1_JPNULL2",            cJ1_JPNULL2,            },
 
57
    { "cJ1_JPNULL3",            cJ1_JPNULL3,            },
 
58
#ifdef JU_64BIT
 
59
    { "cJ1_JPNULL4",            cJ1_JPNULL4,            },
 
60
    { "cJ1_JPNULL5",            cJ1_JPNULL5,            },
 
61
    { "cJ1_JPNULL6",            cJ1_JPNULL6,            },
 
62
    { "cJ1_JPNULL7",            cJ1_JPNULL7,            },
 
63
#endif
 
64
    { "cJ1_JPNULLMAX",          cJ1_JPNULLMAX,          },
 
65
    { "cJ1_JPBRANCH_L2",        cJ1_JPBRANCH_L2,        },
 
66
    { "cJ1_JPBRANCH_L3",        cJ1_JPBRANCH_L3,        },
 
67
#ifdef JU_64BIT
 
68
    { "cJ1_JPBRANCH_L4",        cJ1_JPBRANCH_L4,        },
 
69
    { "cJ1_JPBRANCH_L5",        cJ1_JPBRANCH_L5,        },
 
70
    { "cJ1_JPBRANCH_L6",        cJ1_JPBRANCH_L6,        },
 
71
    { "cJ1_JPBRANCH_L7",        cJ1_JPBRANCH_L7,        },
 
72
#endif
 
73
    { "cJ1_JPBRANCH_L",         cJ1_JPBRANCH_L,         },
 
74
    { "cJ1_JPBRANCH_B2",        cJ1_JPBRANCH_B2,        },
 
75
    { "cJ1_JPBRANCH_B3",        cJ1_JPBRANCH_B3,        },
 
76
#ifdef JU_64BIT
 
77
    { "cJ1_JPBRANCH_B4",        cJ1_JPBRANCH_B4,        },
 
78
    { "cJ1_JPBRANCH_B5",        cJ1_JPBRANCH_B5,        },
 
79
    { "cJ1_JPBRANCH_B6",        cJ1_JPBRANCH_B6,        },
 
80
    { "cJ1_JPBRANCH_B7",        cJ1_JPBRANCH_B7,        },
 
81
#endif
 
82
    { "cJ1_JPBRANCH_B",         cJ1_JPBRANCH_B,         },
 
83
    { "cJ1_JPBRANCH_U2",        cJ1_JPBRANCH_U2,        },
 
84
    { "cJ1_JPBRANCH_U3",        cJ1_JPBRANCH_U3,        },
 
85
#ifdef JU_64BIT
 
86
    { "cJ1_JPBRANCH_U4",        cJ1_JPBRANCH_U4,        },
 
87
    { "cJ1_JPBRANCH_U5",        cJ1_JPBRANCH_U5,        },
 
88
    { "cJ1_JPBRANCH_U6",        cJ1_JPBRANCH_U6,        },
 
89
    { "cJ1_JPBRANCH_U7",        cJ1_JPBRANCH_U7,        },
 
90
#endif
 
91
    { "cJ1_JPBRANCH_U",         cJ1_JPBRANCH_U,         },
 
92
#ifndef JU_64BIT
 
93
    { "cJ1_JPLEAF1",            cJ1_JPLEAF1,            },
 
94
#endif
 
95
    { "cJ1_JPLEAF2",            cJ1_JPLEAF2,            },
 
96
    { "cJ1_JPLEAF3",            cJ1_JPLEAF3,            },
 
97
#ifdef JU_64BIT
 
98
    { "cJ1_JPLEAF4",            cJ1_JPLEAF4,            },
 
99
    { "cJ1_JPLEAF5",            cJ1_JPLEAF5,            },
 
100
    { "cJ1_JPLEAF6",            cJ1_JPLEAF6,            },
 
101
    { "cJ1_JPLEAF7",            cJ1_JPLEAF7,            },
 
102
#endif
 
103
    { "cJ1_JPLEAF_B1",          cJ1_JPLEAF_B1,          },
 
104
    { "cJ1_JPFULLPOPU1",        cJ1_JPFULLPOPU1,        },
 
105
    { "cJ1_JPIMMED_1_01",       cJ1_JPIMMED_1_01,       },
 
106
    { "cJ1_JPIMMED_2_01",       cJ1_JPIMMED_2_01,       },
 
107
    { "cJ1_JPIMMED_3_01",       cJ1_JPIMMED_3_01,       },
 
108
#ifdef JU_64BIT
 
109
    { "cJ1_JPIMMED_4_01",       cJ1_JPIMMED_4_01,       },
 
110
    { "cJ1_JPIMMED_5_01",       cJ1_JPIMMED_5_01,       },
 
111
    { "cJ1_JPIMMED_6_01",       cJ1_JPIMMED_6_01,       },
 
112
    { "cJ1_JPIMMED_7_01",       cJ1_JPIMMED_7_01,       },
 
113
#endif
 
114
    { "cJ1_JPIMMED_1_02",       cJ1_JPIMMED_1_02,       },
 
115
    { "cJ1_JPIMMED_1_03",       cJ1_JPIMMED_1_03,       },
 
116
    { "cJ1_JPIMMED_1_04",       cJ1_JPIMMED_1_04,       },
 
117
    { "cJ1_JPIMMED_1_05",       cJ1_JPIMMED_1_05,       },
 
118
    { "cJ1_JPIMMED_1_06",       cJ1_JPIMMED_1_06,       },
 
119
    { "cJ1_JPIMMED_1_07",       cJ1_JPIMMED_1_07,       },
 
120
#ifdef JU_64BIT
 
121
    { "cJ1_JPIMMED_1_08",       cJ1_JPIMMED_1_08,       },
 
122
    { "cJ1_JPIMMED_1_09",       cJ1_JPIMMED_1_09,       },
 
123
    { "cJ1_JPIMMED_1_10",       cJ1_JPIMMED_1_10,       },
 
124
    { "cJ1_JPIMMED_1_11",       cJ1_JPIMMED_1_11,       },
 
125
    { "cJ1_JPIMMED_1_12",       cJ1_JPIMMED_1_12,       },
 
126
    { "cJ1_JPIMMED_1_13",       cJ1_JPIMMED_1_13,       },
 
127
    { "cJ1_JPIMMED_1_14",       cJ1_JPIMMED_1_14,       },
 
128
    { "cJ1_JPIMMED_1_15",       cJ1_JPIMMED_1_15,       },
 
129
#endif
 
130
    { "cJ1_JPIMMED_2_02",       cJ1_JPIMMED_2_02,       },
 
131
    { "cJ1_JPIMMED_2_03",       cJ1_JPIMMED_2_03,       },
 
132
#ifdef JU_64BIT
 
133
    { "cJ1_JPIMMED_2_04",       cJ1_JPIMMED_2_04,       },
 
134
    { "cJ1_JPIMMED_2_05",       cJ1_JPIMMED_2_05,       },
 
135
    { "cJ1_JPIMMED_2_06",       cJ1_JPIMMED_2_06,       },
 
136
    { "cJ1_JPIMMED_2_07",       cJ1_JPIMMED_2_07,       },
 
137
#endif
 
138
    { "cJ1_JPIMMED_3_02",       cJ1_JPIMMED_3_02,       },
 
139
#ifdef JU_64BIT
 
140
    { "cJ1_JPIMMED_3_03",       cJ1_JPIMMED_3_03,       },
 
141
    { "cJ1_JPIMMED_3_04",       cJ1_JPIMMED_3_04,       },
 
142
    { "cJ1_JPIMMED_3_05",       cJ1_JPIMMED_3_05,       },
 
143
    { "cJ1_JPIMMED_4_02",       cJ1_JPIMMED_4_02,       },
 
144
    { "cJ1_JPIMMED_4_03",       cJ1_JPIMMED_4_03,       },
 
145
    { "cJ1_JPIMMED_5_02",       cJ1_JPIMMED_5_02,       },
 
146
    { "cJ1_JPIMMED_5_03",       cJ1_JPIMMED_5_03,       },
 
147
    { "cJ1_JPIMMED_6_02",       cJ1_JPIMMED_6_02,       },
 
148
    { "cJ1_JPIMMED_7_02",       cJ1_JPIMMED_7_02,       },
 
149
#endif
 
150
    { "cJ1_JPIMMED_CAP",        cJ1_JPIMMED_CAP,        },
 
151
 
 
152
#else // JUDYL -------------------------------------------------------------
 
153
 
 
154
    { "cJL_JAPNULL",            cJL_JAPNULL,            },
 
155
    { "cJL_JAPLEAF",            cJL_JAPLEAF,            },
 
156
    { "cJL_JAPLEAF_POPU2",      cJL_JAPLEAF_POPU2,      },
 
157
    { "cJL_JAPBRANCH",          cJL_JAPBRANCH,          },
 
158
    { "cJL_JAPINVALID",         cJL_JAPINVALID,         },
 
159
    { "cJL_JAPLEAF_POPU1",      cJL_JAPLEAF_POPU1,      },
 
160
    { "cJL_JPNULL1",            cJL_JPNULL1,            },
 
161
    { "cJL_JPNULL2",            cJL_JPNULL2,            },
 
162
    { "cJL_JPNULL3",            cJL_JPNULL3,            },
 
163
#ifdef JU_64BIT
 
164
    { "cJL_JPNULL4",            cJL_JPNULL4,            },
 
165
    { "cJL_JPNULL5",            cJL_JPNULL5,            },
 
166
    { "cJL_JPNULL6",            cJL_JPNULL6,            },
 
167
    { "cJL_JPNULL7",            cJL_JPNULL7,            },
 
168
#endif
 
169
    { "cJL_JPNULLMAX",          cJL_JPNULLMAX,          },
 
170
    { "cJL_JPBRANCH_L2",        cJL_JPBRANCH_L2,        },
 
171
    { "cJL_JPBRANCH_L3",        cJL_JPBRANCH_L3,        },
 
172
#ifdef JU_64BIT
 
173
    { "cJL_JPBRANCH_L4",        cJL_JPBRANCH_L4,        },
 
174
    { "cJL_JPBRANCH_L5",        cJL_JPBRANCH_L5,        },
 
175
    { "cJL_JPBRANCH_L6",        cJL_JPBRANCH_L6,        },
 
176
    { "cJL_JPBRANCH_L7",        cJL_JPBRANCH_L7,        },
 
177
#endif
 
178
    { "cJL_JPBRANCH_L",         cJL_JPBRANCH_L,         },
 
179
    { "cJL_JPBRANCH_B2",        cJL_JPBRANCH_B2,        },
 
180
    { "cJL_JPBRANCH_B3",        cJL_JPBRANCH_B3,        },
 
181
#ifdef JU_64BIT
 
182
    { "cJL_JPBRANCH_B4",        cJL_JPBRANCH_B4,        },
 
183
    { "cJL_JPBRANCH_B5",        cJL_JPBRANCH_B5,        },
 
184
    { "cJL_JPBRANCH_B6",        cJL_JPBRANCH_B6,        },
 
185
    { "cJL_JPBRANCH_B7",        cJL_JPBRANCH_B7,        },
 
186
#endif
 
187
    { "cJL_JPBRANCH_B",         cJL_JPBRANCH_B,         },
 
188
    { "cJL_JPBRANCH_U2",        cJL_JPBRANCH_U2,        },
 
189
    { "cJL_JPBRANCH_U3",        cJL_JPBRANCH_U3,        },
 
190
#ifdef JU_64BIT
 
191
    { "cJL_JPBRANCH_U4",        cJL_JPBRANCH_U4,        },
 
192
    { "cJL_JPBRANCH_U5",        cJL_JPBRANCH_U5,        },
 
193
    { "cJL_JPBRANCH_U6",        cJL_JPBRANCH_U6,        },
 
194
    { "cJL_JPBRANCH_U7",        cJL_JPBRANCH_U7,        },
 
195
#endif
 
196
    { "cJL_JPBRANCH_U",         cJL_JPBRANCH_U,         },
 
197
    { "cJL_JPLEAF1",            cJL_JPLEAF1,            },
 
198
    { "cJL_JPLEAF2",            cJL_JPLEAF2,            },
 
199
    { "cJL_JPLEAF3",            cJL_JPLEAF3,            },
 
200
#ifdef JU_64BIT
 
201
    { "cJL_JPLEAF4",            cJL_JPLEAF4,            },
 
202
    { "cJL_JPLEAF5",            cJL_JPLEAF5,            },
 
203
    { "cJL_JPLEAF6",            cJL_JPLEAF6,            },
 
204
    { "cJL_JPLEAF7",            cJL_JPLEAF7,            },
 
205
#endif
 
206
    { "cJL_JPLEAF_B1",          cJL_JPLEAF_B1,          },
 
207
    { "cJL_JPIMMED_1_01",       cJL_JPIMMED_1_01,       },
 
208
    { "cJL_JPIMMED_2_01",       cJL_JPIMMED_2_01,       },
 
209
    { "cJL_JPIMMED_3_01",       cJL_JPIMMED_3_01,       },
 
210
#ifdef JU_64BIT
 
211
    { "cJL_JPIMMED_4_01",       cJL_JPIMMED_4_01,       },
 
212
    { "cJL_JPIMMED_5_01",       cJL_JPIMMED_5_01,       },
 
213
    { "cJL_JPIMMED_6_01",       cJL_JPIMMED_6_01,       },
 
214
    { "cJL_JPIMMED_7_01",       cJL_JPIMMED_7_01,       },
 
215
#endif
 
216
    { "cJL_JPIMMED_1_02",       cJL_JPIMMED_1_02,       },
 
217
    { "cJL_JPIMMED_1_03",       cJL_JPIMMED_1_03,       },
 
218
#ifdef JU_64BIT
 
219
    { "cJL_JPIMMED_1_04",       cJL_JPIMMED_1_04,       },
 
220
    { "cJL_JPIMMED_1_05",       cJL_JPIMMED_1_05,       },
 
221
    { "cJL_JPIMMED_1_06",       cJL_JPIMMED_1_06,       },
 
222
    { "cJL_JPIMMED_1_07",       cJL_JPIMMED_1_07,       },
 
223
    { "cJL_JPIMMED_2_02",       cJL_JPIMMED_2_02,       },
 
224
    { "cJL_JPIMMED_2_03",       cJL_JPIMMED_2_03,       },
 
225
    { "cJL_JPIMMED_3_02",       cJL_JPIMMED_3_02,       },
 
226
#endif
 
227
    { "cJL_JPIMMED_CAP",        cJL_JPIMMED_CAP,        },
 
228
 
 
229
#endif // JUDYL
 
230
 
 
231
    { (char *) 0,               0,                      },
 
232
};
 
233
 
 
234
FUNCTION main()
 
235
{
 
236
        for (Plist = list; (Plist -> name) != (char *) 0; ++Plist)
 
237
            (void) printf ("%-20s %2d\n", Plist -> name, Plist -> value);
 
238
 
 
239
} // main