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.12 by root, Sun Jan 7 23:10:43 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
164 path_attuned 169 path_attuned
165 path_denied 170 path_denied
166 path_repelled 171 path_repelled
167 perm_exp 172 perm_exp
168 pick_up 173 pick_up
174 player_sold
169 pow 175 pow
170 protected 176 protected
171 race 177 race
172 random_move 178 random_move
173 random_movement 179 random_movement
230 unaggressive 236 unaggressive
231 undead 237 undead
232 unique 238 unique
233 unpaid 239 unpaid
234 use_content_on_gen 240 use_content_on_gen
241 uuid
235 value 242 value
236 vulnerable 243 vulnerable
237 was_wiz 244 was_wiz
238 wc 245 wc
239 weapontype 246 weapontype
252 Wis 259 Wis
253 Cha 260 Cha
254 Int 261 Int
255 Pow 262 Pow
256 More 263 More
264
265 maplore
266 endmaplore
267 enter_x
268 enter_y
269 width
270 height
271 reset_timeout
272 reset_time
273 swap_time
274 difficulty
275 darkness
276 fixed_resettime
277 per_player
278 per_party
279 region
280 shopitems
281 shopgreed
282 shopmin
283 shopmax
284 shoprace
285 outdoor
286 tile_path_1
287 tile_path_2
288 tile_path_3
289 tile_path_4
290
291 file_format_version
292
293 temp
294 pressure
295 humid
296 windspeed
297 winddir
298 sky
299
300 map
301 savebed_map
302 bed_x
303 bed_y
304 password
305 shoottype
306 bowtype
307 petmode
308 gen_hp
309 gen_sp
310 gen_grace
311 listening
312 peaceful
313 digestion
314 pickup
315 outputs_sync
316 outputs_count
317 usekeys
318 unapply
319 weapon_sp
320 lev_array
321 endplst
257); 322);
258 323
259open GPERF, "|-", "gperf -m50 >kw_hash.h" 324open GPERF, "|-", "exec $ARG{GPERF} -m50 >kw_hash.h"
260 or die "gperf: $!"; 325 or die "$ARGV{GPERF}: $!";
261 326
262print GPERF <<EOF; 327print GPERF <<EOF;
263%language=C++ 328%language=C++
264%enum 329%enum
265%define class-name kw_lex 330%define class-name kw_lex
289print GPERF "};\n"; 354print GPERF "};\n";
290 355
291printf GPERF "\nextern const unsigned char keyword_len [] = { 5, 7, %s };\n\n", 356printf GPERF "\nextern const unsigned char keyword_len [] = { 5, 7, %s };\n\n",
292 join ", ", map length, @kw; 357 join ", ", map length, @kw;
293 358
359close GPERF
360 or die "$ARG{GPERF}: failed to run";
361
294open KW, ">", "keyword.h"; 362open KW, ">", "keyword.h";
295 363
296print KW <<EOF; 364print KW <<EOF;
297#ifndef KW_H__ 365#ifndef KW_H__
298#define KW_H__ 366#define KW_H__
299 367
300enum keyword { 368enum keyword {
301 KW_EOF, KW_ERROR, 369 KW_NULL = 0,
370 KW_EOF = 0,
371 KW_ERROR,
302EOF 372EOF
303 373
304for (@kw) { 374for (@kw) {
305 printf KW " %s,\n", "KW_$_", 375 printf KW " %s,\n", "KW_$_",
306} 376}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines