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.3 by root, Thu Aug 31 17:54:14 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(
9 no_pass
10 walk_on
11 walk_off
12 fly_on
13 fly_off
14 flying
15
7 ac 16 ac
8 activate_on_push 17 activate_on_push
9 activate_on_release 18 activate_on_release
10 alive 19 alive
11 anim_speed 20 anim_speed
59 cursed 68 cursed
60 custom_name 69 custom_name
61 dam 70 dam
62 dam_modifier 71 dam_modifier
63 damned 72 damned
73 destroy_on_death
64 dex 74 dex
65 direction 75 direction
66 duration 76 duration
67 duration_modifier 77 duration_modifier
68 editable 78 editable
85 has_ready_rod 95 has_ready_rod
86 has_ready_scroll 96 has_ready_scroll
87 has_ready_skill 97 has_ready_skill
88 has_ready_wand 98 has_ready_wand
89 has_ready_weapon 99 has_ready_weapon
100 has_ready_range
90 hitback 101 hitback
91 hp 102 hp
92 identified 103 identified
93 immune 104 immune
94 int 105 int
96 invisible 107 invisible
97 is_animated 108 is_animated
98 is_blind 109 is_blind
99 is_buildable 110 is_buildable
100 is_cauldron 111 is_cauldron
112 is_dust
101 is_floor 113 is_floor
102 is_hilly 114 is_hilly
103 is_lightable 115 is_lightable
104 is_thrown 116 is_thrown
105 is_turnable 117 is_turnable
157 path_attuned 169 path_attuned
158 path_denied 170 path_denied
159 path_repelled 171 path_repelled
160 perm_exp 172 perm_exp
161 pick_up 173 pick_up
174 player_sold
162 pow 175 pow
163 protected 176 protected
164 race 177 race
165 random_move 178 random_move
166 random_movement 179 random_movement
223 unaggressive 236 unaggressive
224 undead 237 undead
225 unique 238 unique
226 unpaid 239 unpaid
227 use_content_on_gen 240 use_content_on_gen
241 uuid
228 value 242 value
229 vulnerable 243 vulnerable
230 was_wiz 244 was_wiz
231 wc 245 wc
232 weapontype 246 weapontype
235 wis 249 wis
236 wiz 250 wiz
237 x 251 x
238 xrays 252 xrays
239 y 253 y
254
255 Object
256 Str
257 Dex
258 Con
259 Wis
260 Cha
261 Int
262 Pow
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
240); 322);
241 323
242open GPERF, "|-", "gperf -m50 >kw_hash.h" 324open GPERF, "|-", "exec $ARG{GPERF} -m50 >kw_hash.h"
243 or die "gperf: $!"; 325 or die "$ARGV{GPERF}: $!";
244 326
245print GPERF <<EOF; 327print GPERF <<EOF;
246%language=C++ 328%language=C++
247%enum 329%enum
248%define class-name kw_lex 330%define class-name kw_lex
272print GPERF "};\n"; 354print GPERF "};\n";
273 355
274printf 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",
275 join ", ", map length, @kw; 357 join ", ", map length, @kw;
276 358
359close GPERF
360 or die "$ARG{GPERF}: failed to run";
361
277open KW, ">", "keyword.h"; 362open KW, ">", "keyword.h";
278 363
279print KW <<EOF; 364print KW <<EOF;
280#ifndef KW_H__ 365#ifndef KW_H__
281#define KW_H__ 366#define KW_H__
282 367
283enum keyword { 368enum keyword {
284 KW_EOF, KW_ERROR, 369 KW_NULL = 0,
370 KW_EOF = 0,
371 KW_ERROR,
285EOF 372EOF
286 373
287for (@kw) { 374for (@kw) {
288 printf KW " %s,\n", "KW_$_", 375 printf KW " %s,\n", "KW_$_",
289} 376}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines