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.6 by root, Wed Sep 13 02:05:19 2006 UTC vs.
Revision 1.11 by root, Sun Jan 7 02:39:14 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(
92 has_ready_rod 94 has_ready_rod
93 has_ready_scroll 95 has_ready_scroll
94 has_ready_skill 96 has_ready_skill
95 has_ready_wand 97 has_ready_wand
96 has_ready_weapon 98 has_ready_weapon
99 has_ready_range
97 hitback 100 hitback
98 hp 101 hp
99 identified 102 identified
100 immune 103 immune
101 int 104 int
103 invisible 106 invisible
104 is_animated 107 is_animated
105 is_blind 108 is_blind
106 is_buildable 109 is_buildable
107 is_cauldron 110 is_cauldron
111 is_dust
108 is_floor 112 is_floor
109 is_hilly 113 is_hilly
110 is_lightable 114 is_lightable
111 is_thrown 115 is_thrown
112 is_turnable 116 is_turnable
164 path_attuned 168 path_attuned
165 path_denied 169 path_denied
166 path_repelled 170 path_repelled
167 perm_exp 171 perm_exp
168 pick_up 172 pick_up
173 player_sold
169 pow 174 pow
170 protected 175 protected
171 race 176 race
172 random_move 177 random_move
173 random_movement 178 random_movement
253 Wis 258 Wis
254 Cha 259 Cha
255 Int 260 Int
256 Pow 261 Pow
257 More 262 More
263
264 maplore
265 endmaplore
266 enter_x
267 enter_y
268 width
269 height
270 reset_timeout
271 reset_time
272 swap_time
273 difficulty
274 darkness
275 fixed_resettime
276 per_player
277 per_party
278 region
279 shopitems
280 shopgreed
281 shopmin
282 shopmax
283 shoprace
284 outdoor
285 tile_path_1
286 tile_path_2
287 tile_path_3
288 tile_path_4
289
290 file_format_version
291
292 temp
293 pressure
294 humid
295 windspeed
296 winddir
297 sky
298
299 map
300 savebed_map
301 bed_x
302 bed_y
303 password
304 shoottype
305 bowtype
306 petmode
307 gen_hp
308 gen_sp
309 gen_grace
310 listening
311 peaceful
312 digestion
313 pickup
314 outputs_sync
315 outputs_count
316 usekeys
317 unapply
318 weapon_sp
319 lev_array
320 endplst
258); 321);
259 322
260open GPERF, "|-", "gperf -m50 >kw_hash.h" 323open GPERF, "|-", "exec $ARG{GPERF} -m50 >kw_hash.h"
261 or die "gperf: $!"; 324 or die "$ARGV{GPERF}: $!";
262 325
263print GPERF <<EOF; 326print GPERF <<EOF;
264%language=C++ 327%language=C++
265%enum 328%enum
266%define class-name kw_lex 329%define class-name kw_lex
290print GPERF "};\n"; 353print GPERF "};\n";
291 354
292printf GPERF "\nextern const unsigned char keyword_len [] = { 5, 7, %s };\n\n", 355printf GPERF "\nextern const unsigned char keyword_len [] = { 5, 7, %s };\n\n",
293 join ", ", map length, @kw; 356 join ", ", map length, @kw;
294 357
358close GPERF
359 or die "$ARG{GPERF}: failed to run";
360
295open KW, ">", "keyword.h"; 361open KW, ">", "keyword.h";
296 362
297print KW <<EOF; 363print KW <<EOF;
298#ifndef KW_H__ 364#ifndef KW_H__
299#define KW_H__ 365#define KW_H__
300 366
301enum keyword { 367enum keyword {
302 KW_EOF, KW_ERROR, 368 KW_NULL = 0,
369 KW_EOF = 0,
370 KW_ERROR,
303EOF 371EOF
304 372
305for (@kw) { 373for (@kw) {
306 printf KW " %s,\n", "KW_$_", 374 printf KW " %s,\n", "KW_$_",
307} 375}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines