ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/genkeywords
Revision: 1.12
Committed: Tue Nov 3 23:44:21 2009 UTC (14 years, 6 months ago) by root
Branch: MAIN
CVS Tags: rel-2_90
Changes since 1.11: +22 -0 lines
Log Message:
tighten copyright statements for files containing no gpl code whatsoever anymore

File Contents

# User Rev Content
1 root 1.1 #!/opt/bin/perl
2    
3 root 1.12 #
4     # This file is part of Deliantra, the Roguelike Realtime MMORPG.
5     #
6     # Copyright (©) 2005,2006,2007,2008,2009 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
7     #
8     # Deliantra is free software: you can redistribute it and/or modify it under
9     # the terms of the Affero GNU General Public License as published by the
10     # Free Software Foundation, either version 3 of the License, or (at your
11     # option) any later version.
12     #
13     # This program is distributed in the hope that it will be useful,
14     # but WITHOUT ANY WARRANTY; without even the implied warranty of
15     # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16     # GNU General Public License for more details.
17     #
18     # You should have received a copy of the Affero GNU General Public License
19     # and the GNU General Public License along with this program. If not, see
20     # <http://www.gnu.org/licenses/>.
21     #
22     # The authors can be reached via e-mail to <support@deliantra.net>
23     #
24    
25 root 1.1 my %ARG = @ARGV;
26    
27     use List::Util;
28    
29     # todo: gather dynamically
30     my @kw = qw(
31     no_pass
32     walk_on
33     walk_off
34     fly_on
35     fly_off
36     flying
37    
38 root 1.3 gender
39 root 1.10 hintmode
40 root 1.1 attack_skill
41     ranged_skill
42    
43     ac
44     activate_on_push
45     activate_on_release
46     alive
47     anim_speed
48     animation
49     applied
50     arch
51     armour
52     attach
53     attack_movement
54     attacktype
55     auto_apply
56     been_applied
57     berserk
58     blocksview
59     body_range
60     body_arm
61     body_torso
62     body_head
63     body_neck
64     body_skill
65     body_finger
66     body_shoulder
67     body_foot
68     body_hand
69     body_wrist
70     body_waist
71     body_shield
72     body_combat
73     can_apply
74     can_cast_spell
75     can_roll
76     can_see_in_dark
77     can_use_armour
78     can_use_bow
79     can_use_horn
80     can_use_range
81     can_use_ring
82     can_use_rod
83     can_use_scroll
84     can_use_shield
85     can_use_skill
86     can_use_wand
87     can_use_weapon
88     carrying
89     casting_time
90     cha
91     changing
92     client_type
93     con
94     confused
95     connected
96     container
97     cursed
98     custom_name
99     dam
100     dam_modifier
101     damned
102     destroy_on_death
103     dex
104     direction
105     duration
106     duration_modifier
107     editable
108     editor_folder
109     elevation
110     end
111     endlore
112     endmsg
113     exp
114     expmul
115     face
116     food
117     friendly
118     gen_sp_armour
119     generator
120     glow_radius
121     grace
122     has_ready_bow
123     has_ready_scroll
124     has_ready_skill
125     has_ready_weapon
126     has_ready_range
127     hitback
128     hp
129     identified
130     immune
131     inherit
132     int
133     inv_locked
134     invisible
135     is_animated
136     is_blind
137     is_buildable
138     is_cauldron
139     is_dust
140     is_floor
141     is_hilly
142     is_lightable
143     is_thrown
144     is_turnable
145     is_used_up
146     is_water
147     is_wooded
148     item_power
149     known_cursed
150     known_magical
151     last_eat
152     last_grace
153     last_heal
154     last_sp
155     level
156     lifesave
157     lore
158     luck
159     magic
160     make_invisible
161     material
162     materialname
163     maxgrace
164     maxhp
165     maxsp
166     monster
167     more
168     move_allow
169     move_block
170     move_off
171     move_on
172     move_slow
173     move_slow_penalty
174     move_state
175     move_type
176     msg
177     name
178     name_pl
179     neutral
180     no_attack
181     no_damage
182     no_drop
183     no_fix_player
184     no_magic
185     no_pick
186     no_skill_ident
187     no_steal
188     no_strength
189     nrof
190     obj_original
191     object
192     oid
193     one_hit
194     only_attack
195     other_arch
196     overlay_floor
197 root 1.8 owner
198 root 1.1 path_attuned
199     path_denied
200     path_repelled
201     perm_exp
202     pick_up
203     player_sold
204     pow
205     precious
206     protected
207     race
208     random_move
209     random_movement
210     randomitems
211     range
212     range_modifier
213     reflect_missile
214     reflect_spell
215     reflecting
216     resist_acid
217     resist_blind
218     resist_cancellation
219     resist_chaos
220     resist_cold
221     resist_confusion
222     resist_counterspell
223     resist_death
224     resist_deplete
225     resist_disease
226     resist_drain
227     resist_electricity
228     resist_fear
229     resist_fire
230     resist_ghosthit
231     resist_godpower
232     resist_holyword
233     resist_internal
234     resist_life_stealing
235     resist_magic
236     resist_paralyze
237     resist_physical
238     resist_poison
239     resist_slow
240     resist_turn_undead
241     resist_weaponmagic
242     run_away
243     scared
244     see_anywhere
245     see_invisible
246     skill
247     slaying
248     sleep
249     slow_move
250 root 1.5 sound
251 root 1.7 sound_destroy
252 root 1.1 smoothlevel
253     sp
254     speed
255     speed_left
256     splitting
257     stand_still
258     startequip
259     state
260     stealth
261     str
262     subtype
263 root 1.9 tag
264 root 1.1 tear_down
265     title
266     treasure_env
267     type
268     unaggressive
269     undead
270     unique
271     unpaid
272     use_content_on_gen
273     uuid
274     value
275     vulnerable
276     wc
277     weapontype
278     weight
279     will_apply
280     wis
281     x
282     xrays
283     y
284    
285     maplore
286     endmaplore
287     enter_x
288     enter_y
289     width
290     height
291     reset_timeout
292     reset_time
293     swap_time
294     difficulty
295     darkness
296     fixed_resettime
297     per_player
298     per_party
299 root 1.2 no_reset
300 root 1.1 region
301     shopitems
302     shopgreed
303     shopmin
304     shopmax
305     shoprace
306     outdoor
307     tile_path_1
308     tile_path_2
309     tile_path_3
310     tile_path_4
311    
312     file_format_version
313    
314     temp
315     pressure
316     humid
317     windspeed
318     winddir
319     sky
320    
321     map
322     savebed_map
323     bed_x
324     bed_y
325     password
326     bowtype
327     petmode
328     gen_hp
329     gen_sp
330     gen_grace
331     listening
332     peaceful
333     digestion
334     pickup
335     outputs_sync
336     outputs_count
337     usekeys
338     unapply
339     weapon_sp
340     weapon_sp_left
341     lev_array
342     endplst
343    
344     visibility
345     magicmap
346    
347     parent
348     longname
349     jail_map
350     jail_x
351     jail_y
352     portal_map
353     portal_x
354     portal_y
355     fallback
356     nomore
357    
358     chance
359     mods
360     diff
361     saves
362     description
363     density
364     damage
365    
366     anim
367     mina
368     facings
369     player
370    
371     allowed
372     keycode
373     trans
374     yield
375     ingred
376     cauldron
377    
378     Str
379     Dex
380     Con
381     Wis
382     Cha
383     Int
384     Pow
385    
386     treasure
387     treasureone
388     list
389     change_name
390     change_title
391     change_slaying
392     yes
393     no
394     );
395    
396     open GPERF, "|-", "exec $ARG{GPERF} -m50 >kw_hash.h"
397     or die "$ARGV{GPERF}: $!";
398    
399     print GPERF <<EOF;
400     %language=C++
401     %enum
402     %define class-name kw_lex
403     %define lookup-function-name match
404     %struct-type
405     %compare-strncmp
406     %delimiters=,
407     struct keyword_idx { const char *name; enum keyword index; };
408     %%
409     EOF
410    
411     for (@kw) {
412     printf GPERF "%s,%s\n", $_, "KW_$_";
413     }
414    
415     print GPERF <<EOF;
416     %%
417     extern const char *const keyword_str [] = {
418     "<EOF>",
419     "<ERROR>",
420     EOF
421    
422     for (@kw) {
423     printf GPERF " \"%s\",\n", $_;
424     }
425    
426     print GPERF "};\n";
427    
428     printf GPERF "\nextern const unsigned char keyword_len [] = { 5, 7, %s };\n\n",
429     join ", ", map length, @kw;
430    
431     close GPERF
432     or die "$ARG{GPERF}: failed to run";
433    
434     open KW, ">", "keyword.h";
435    
436     print KW <<EOF;
437     //
438     // AUTOGENERATED: this is a generated file
439     // edit include/genkeywords instead
440     //
441    
442     #ifndef KW_H__
443     #define KW_H__
444    
445     enum keyword {
446     KW_NULL = 0,
447     KW_EOF = 0,
448     KW_ERROR,
449     EOF
450    
451     for (@kw) {
452     printf KW " %s,\n", "KW_$_",
453     }
454    
455     print KW <<EOF;
456     NUM_KEYWORD,
457     };
458    
459     extern const char *const keyword_str [];
460     extern const unsigned char keyword_len [];
461    
462     EOF
463    
464     printf KW "#define MAX_KEYWORD_LEN %d\n", List::Util::max map length, @kw;
465    
466     print KW <<EOF;
467    
468     #endif
469    
470     EOF
471