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.9 by root, Sat Dec 30 10:16:10 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
261); 298);
262 299
263open GPERF, "|-", "gperf -m50 >kw_hash.h" 300open GPERF, "|-", "exec $ARG{GPERF} -m50 >kw_hash.h"
264 or die "gperf: $!"; 301 or die "$ARGV{GPERF}: $!";
265 302
266print GPERF <<EOF; 303print GPERF <<EOF;
267%language=C++ 304%language=C++
268%enum 305%enum
269%define class-name kw_lex 306%define class-name kw_lex
293print GPERF "};\n"; 330print GPERF "};\n";
294 331
295printf GPERF "\nextern const unsigned char keyword_len [] = { 5, 7, %s };\n\n", 332printf GPERF "\nextern const unsigned char keyword_len [] = { 5, 7, %s };\n\n",
296 join ", ", map length, @kw; 333 join ", ", map length, @kw;
297 334
335close GPERF
336 or die "$ARG{GPERF}: failed to run";
337
298open KW, ">", "keyword.h"; 338open KW, ">", "keyword.h";
299 339
300print KW <<EOF; 340print KW <<EOF;
301#ifndef KW_H__ 341#ifndef KW_H__
302#define KW_H__ 342#define KW_H__

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines