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.7 by root, Thu Sep 21 00:05:25 2006 UTC vs.
Revision 1.10 by root, Sun Dec 31 21:26:18 2006 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(
256 Wis 258 Wis
257 Cha 259 Cha
258 Int 260 Int
259 Pow 261 Pow
260 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 explore
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
261); 322);
262 323
263open GPERF, "|-", "gperf -m50 >kw_hash.h" 324open GPERF, "|-", "exec $ARG{GPERF} -m50 >kw_hash.h"
264 or die "gperf: $!"; 325 or die "$ARGV{GPERF}: $!";
265 326
266print GPERF <<EOF; 327print GPERF <<EOF;
267%language=C++ 328%language=C++
268%enum 329%enum
269%define class-name kw_lex 330%define class-name kw_lex
293print GPERF "};\n"; 354print GPERF "};\n";
294 355
295printf 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",
296 join ", ", map length, @kw; 357 join ", ", map length, @kw;
297 358
359close GPERF
360 or die "$ARG{GPERF}: failed to run";
361
298open KW, ">", "keyword.h"; 362open KW, ">", "keyword.h";
299 363
300print KW <<EOF; 364print KW <<EOF;
301#ifndef KW_H__ 365#ifndef KW_H__
302#define KW_H__ 366#define KW_H__

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines