ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/preprocess
(Generate patch)

Comparing deliantra/server/include/preprocess (file contents):
Revision 1.4 by root, Sun Sep 3 22:45:56 2006 UTC vs.
Revision 1.30 by root, Tue May 22 10:49:59 2007 UTC

1#!/opt/bin/perl 1#!/opt/bin/perl
2
3my %ARG = @ARGV;
2 4
3use List::Util; 5use List::Util;
4 6
5# todo: gather dynamically 7# todo: gather dynamically
6my @kw = qw( 8my @kw = qw(
8 walk_on 10 walk_on
9 walk_off 11 walk_off
10 fly_on 12 fly_on
11 fly_off 13 fly_off
12 flying 14 flying
15
16 attack_skill
17 ranged_skill
13 18
14 ac 19 ac
15 activate_on_push 20 activate_on_push
16 activate_on_release 21 activate_on_release
17 alive 22 alive
37 body_shoulder 42 body_shoulder
38 body_foot 43 body_foot
39 body_hand 44 body_hand
40 body_wrist 45 body_wrist
41 body_waist 46 body_waist
47 body_shield
48 body_combat
42 can_apply 49 can_apply
43 can_cast_spell 50 can_cast_spell
44 can_roll 51 can_roll
45 can_see_in_dark 52 can_see_in_dark
46 can_use_armour 53 can_use_armour
66 cursed 73 cursed
67 custom_name 74 custom_name
68 dam 75 dam
69 dam_modifier 76 dam_modifier
70 damned 77 damned
78 destroy_on_death
71 dex 79 dex
72 direction 80 direction
73 duration 81 duration
74 duration_modifier 82 duration_modifier
75 editable 83 editable
86 gen_sp_armour 94 gen_sp_armour
87 generator 95 generator
88 glow_radius 96 glow_radius
89 grace 97 grace
90 has_ready_bow 98 has_ready_bow
91 has_ready_horn
92 has_ready_rod
93 has_ready_scroll 99 has_ready_scroll
94 has_ready_skill 100 has_ready_skill
95 has_ready_wand
96 has_ready_weapon 101 has_ready_weapon
102 has_ready_range
97 hitback 103 hitback
98 hp 104 hp
99 identified 105 identified
100 immune 106 immune
107 inherit
101 int 108 int
102 inv_locked 109 inv_locked
103 invisible 110 invisible
104 is_animated 111 is_animated
105 is_blind 112 is_blind
106 is_buildable 113 is_buildable
107 is_cauldron 114 is_cauldron
115 is_dust
108 is_floor 116 is_floor
109 is_hilly 117 is_hilly
110 is_lightable 118 is_lightable
111 is_thrown 119 is_thrown
112 is_turnable 120 is_turnable
153 no_pick 161 no_pick
154 no_skill_ident 162 no_skill_ident
155 no_steal 163 no_steal
156 no_strength 164 no_strength
157 nrof 165 nrof
166 obj_original
158 object 167 object
159 oid 168 oid
160 one_hit 169 one_hit
161 only_attack 170 only_attack
162 other_arch 171 other_arch
164 path_attuned 173 path_attuned
165 path_denied 174 path_denied
166 path_repelled 175 path_repelled
167 perm_exp 176 perm_exp
168 pick_up 177 pick_up
178 player_sold
169 pow 179 pow
180 precious
170 protected 181 protected
171 race 182 race
172 random_move 183 random_move
173 random_movement 184 random_movement
174 randomitems 185 randomitems
223 str 234 str
224 subtype 235 subtype
225 tear_down 236 tear_down
226 title 237 title
227 tooltype 238 tooltype
228 treasure 239 treasure_env
229 type 240 type
230 unaggressive 241 unaggressive
231 undead 242 undead
232 unique 243 unique
233 unpaid 244 unpaid
234 use_content_on_gen 245 use_content_on_gen
246 uuid
235 value 247 value
236 vulnerable 248 vulnerable
237 was_wiz
238 wc 249 wc
239 weapontype 250 weapontype
240 weight 251 weight
241 will_apply 252 will_apply
242 wis 253 wis
243 wiz
244 x 254 x
245 xrays 255 xrays
246 y 256 y
257
258 maplore
259 endmaplore
260 enter_x
261 enter_y
262 width
263 height
264 reset_timeout
265 reset_time
266 swap_time
267 difficulty
268 darkness
269 fixed_resettime
270 per_player
271 per_party
272 region
273 shopitems
274 shopgreed
275 shopmin
276 shopmax
277 shoprace
278 outdoor
279 tile_path_1
280 tile_path_2
281 tile_path_3
282 tile_path_4
283
284 file_format_version
285
286 temp
287 pressure
288 humid
289 windspeed
290 winddir
291 sky
292
293 map
294 savebed_map
295 bed_x
296 bed_y
297 password
298 bowtype
299 petmode
300 gen_hp
301 gen_sp
302 gen_grace
303 listening
304 peaceful
305 digestion
306 pickup
307 outputs_sync
308 outputs_count
309 usekeys
310 unapply
311 weapon_sp
312 weapon_sp_left
313 lev_array
314 endplst
315
316 visibility
317 magicmap
318
319 match
320 parent
321 longname
322 jail_map
323 jail_x
324 jail_y
325 portal_map
326 portal_x
327 portal_y
328 fallback
329 nomore
330
331 chance
332 mods
333 diff
334 saves
335 description
336 density
337 damage
338
339 anim
340 mina
341 facings
342 player
343
344 allowed
345 keycode
346 trans
347 yield
348 ingred
349 cauldron
350
351 Str
352 Dex
353 Con
354 Wis
355 Cha
356 Int
357 Pow
358
359 treasure
360 treasureone
361 list
362 change_name
363 change_title
364 change_slaying
365 yes
366 no
247); 367);
248 368
249open GPERF, "|-", "gperf -m50 >kw_hash.h" 369open GPERF, "|-", "exec $ARG{GPERF} -m50 >kw_hash.h"
250 or die "gperf: $!"; 370 or die "$ARGV{GPERF}: $!";
251 371
252print GPERF <<EOF; 372print GPERF <<EOF;
253%language=C++ 373%language=C++
254%enum 374%enum
255%define class-name kw_lex 375%define class-name kw_lex
256%define lookup-function-name match 376%define lookup-function-name match
257%struct-type 377%struct-type
258%compare-strncmp 378%compare-strncmp
259%ignore-case
260%delimiters=, 379%delimiters=,
261struct keyword_idx { const char *name; enum keyword index; }; 380struct keyword_idx { const char *name; enum keyword index; };
262%% 381%%
263EOF 382EOF
264 383
280print GPERF "};\n"; 399print GPERF "};\n";
281 400
282printf GPERF "\nextern const unsigned char keyword_len [] = { 5, 7, %s };\n\n", 401printf GPERF "\nextern const unsigned char keyword_len [] = { 5, 7, %s };\n\n",
283 join ", ", map length, @kw; 402 join ", ", map length, @kw;
284 403
404close GPERF
405 or die "$ARG{GPERF}: failed to run";
406
285open KW, ">", "keyword.h"; 407open KW, ">", "keyword.h";
286 408
287print KW <<EOF; 409print KW <<EOF;
288#ifndef KW_H__ 410#ifndef KW_H__
289#define KW_H__ 411#define KW_H__
290 412
291enum keyword { 413enum keyword {
292 KW_EOF, KW_ERROR, 414 KW_NULL = 0,
415 KW_EOF = 0,
416 KW_ERROR,
293EOF 417EOF
294 418
295for (@kw) { 419for (@kw) {
296 printf KW " %s,\n", "KW_$_", 420 printf KW " %s,\n", "KW_$_",
297} 421}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines