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.5 by root, Mon Sep 4 15:51:24 2006 UTC vs.
Revision 1.16 by root, Tue Feb 6 13:21:29 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(
66 cursed 68 cursed
67 custom_name 69 custom_name
68 dam 70 dam
69 dam_modifier 71 dam_modifier
70 damned 72 damned
73 destroy_on_death
71 dex 74 dex
72 direction 75 direction
73 duration 76 duration
74 duration_modifier 77 duration_modifier
75 editable 78 editable
92 has_ready_rod 95 has_ready_rod
93 has_ready_scroll 96 has_ready_scroll
94 has_ready_skill 97 has_ready_skill
95 has_ready_wand 98 has_ready_wand
96 has_ready_weapon 99 has_ready_weapon
100 has_ready_range
97 hitback 101 hitback
98 hp 102 hp
99 identified 103 identified
100 immune 104 immune
101 int 105 int
103 invisible 107 invisible
104 is_animated 108 is_animated
105 is_blind 109 is_blind
106 is_buildable 110 is_buildable
107 is_cauldron 111 is_cauldron
112 is_dust
108 is_floor 113 is_floor
109 is_hilly 114 is_hilly
110 is_lightable 115 is_lightable
111 is_thrown 116 is_thrown
112 is_turnable 117 is_turnable
153 no_pick 158 no_pick
154 no_skill_ident 159 no_skill_ident
155 no_steal 160 no_steal
156 no_strength 161 no_strength
157 nrof 162 nrof
163 obj_original
158 object 164 object
159 oid 165 oid
160 one_hit 166 one_hit
161 only_attack 167 only_attack
162 other_arch 168 other_arch
164 path_attuned 170 path_attuned
165 path_denied 171 path_denied
166 path_repelled 172 path_repelled
167 perm_exp 173 perm_exp
168 pick_up 174 pick_up
175 player_sold
169 pow 176 pow
170 protected 177 protected
171 race 178 race
172 random_move 179 random_move
173 random_movement 180 random_movement
230 unaggressive 237 unaggressive
231 undead 238 undead
232 unique 239 unique
233 unpaid 240 unpaid
234 use_content_on_gen 241 use_content_on_gen
242 uuid
235 value 243 value
236 vulnerable 244 vulnerable
237 was_wiz 245 was_wiz
238 wc 246 wc
239 weapontype 247 weapontype
252 Wis 260 Wis
253 Cha 261 Cha
254 Int 262 Int
255 Pow 263 Pow
256 More 264 More
265
266 maplore
267 endmaplore
268 enter_x
269 enter_y
270 width
271 height
272 reset_timeout
273 reset_time
274 swap_time
275 difficulty
276 darkness
277 fixed_resettime
278 per_player
279 per_party
280 region
281 shopitems
282 shopgreed
283 shopmin
284 shopmax
285 shoprace
286 outdoor
287 tile_path_1
288 tile_path_2
289 tile_path_3
290 tile_path_4
291
292 file_format_version
293
294 temp
295 pressure
296 humid
297 windspeed
298 winddir
299 sky
300
301 map
302 savebed_map
303 bed_x
304 bed_y
305 password
306 shoottype
307 bowtype
308 petmode
309 gen_hp
310 gen_sp
311 gen_grace
312 listening
313 peaceful
314 digestion
315 pickup
316 outputs_sync
317 outputs_count
318 usekeys
319 unapply
320 weapon_sp
321 lev_array
322 endplst
323
324 color_fg
325 color_bg
326 visibility
327 magicmap
328
329 parent
330 longname
331 jail_map
332 jail_x
333 jail_y
334 fallback
335 nomore
336
337 chance
338 mods
339 diff
340 saves
341 description
342 density
343 damage
257); 344);
258 345
259open GPERF, "|-", "gperf -m50 >kw_hash.h" 346open GPERF, "|-", "exec $ARG{GPERF} -m50 >kw_hash.h"
260 or die "gperf: $!"; 347 or die "$ARGV{GPERF}: $!";
261 348
262print GPERF <<EOF; 349print GPERF <<EOF;
263%language=C++ 350%language=C++
264%enum 351%enum
265%define class-name kw_lex 352%define class-name kw_lex
289print GPERF "};\n"; 376print GPERF "};\n";
290 377
291printf GPERF "\nextern const unsigned char keyword_len [] = { 5, 7, %s };\n\n", 378printf GPERF "\nextern const unsigned char keyword_len [] = { 5, 7, %s };\n\n",
292 join ", ", map length, @kw; 379 join ", ", map length, @kw;
293 380
381close GPERF
382 or die "$ARG{GPERF}: failed to run";
383
294open KW, ">", "keyword.h"; 384open KW, ">", "keyword.h";
295 385
296print KW <<EOF; 386print KW <<EOF;
297#ifndef KW_H__ 387#ifndef KW_H__
298#define KW_H__ 388#define KW_H__
299 389
300enum keyword { 390enum keyword {
301 KW_EOF, KW_ERROR, 391 KW_NULL = 0,
392 KW_EOF = 0,
393 KW_ERROR,
302EOF 394EOF
303 395
304for (@kw) { 396for (@kw) {
305 printf KW " %s,\n", "KW_$_", 397 printf KW " %s,\n", "KW_$_",
306} 398}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines