Unlink PerlIO's tempfiles for the case of no -T, but bogus $ENV{TMPDIR}
[p5sagit/p5-mst-13.2.git] / keywords.pl
1 #!/usr/bin/perl -w
2
3 # Regenerate (overwriting only if changed):
4 #
5 #    keywords.h
6 #
7 # from information stored in the DATA section of this file.
8 #
9 # Accepts the standard regen_lib -q and -v args.
10 #
11 # This script is normally invoked from regen.pl.
12
13 use strict;
14
15 require 'regen_lib.pl';
16
17 my $kw = safer_open("keywords.h-new");
18 select $kw;
19
20 print <<EOM;
21 /* -*- buffer-read-only: t -*-
22  *
23  *    keywords.h
24  *
25  *    Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2005,
26  *    2006, 2007, by Larry Wall and others
27  *
28  *    You may distribute under the terms of either the GNU General Public
29  *    License or the Artistic License, as specified in the README file.
30  *
31  * !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
32  *  This file is built by keywords.pl from its data.  Any changes made here
33  *  will be lost!
34  */
35 EOM
36
37 # Read & print data.
38
39 my $keynum = 0;
40 while (<DATA>) {
41     chop;
42     next unless $_;
43     next if /^#/;
44     my ($keyword) = split;
45     print &tab(5, "#define KEY_$keyword"), $keynum++, "\n";
46 }
47
48 print $kw "\n/* ex: set ro: */\n";
49
50 safer_close($kw);
51
52 rename_if_different("keywords.h-new", "keywords.h");
53
54 ###########################################################################
55 sub tab {
56     my ($l, $t) = @_;
57     $t .= "\t" x ($l - (length($t) + 1) / 8);
58     $t;
59 }
60 ###########################################################################
61 __END__
62
63 NULL
64 __FILE__
65 __LINE__
66 __PACKAGE__
67 __DATA__
68 __END__
69 AUTOLOAD
70 BEGIN
71 UNITCHECK
72 CORE
73 DESTROY
74 END
75 INIT
76 CHECK
77 abs
78 accept
79 alarm
80 and
81 atan2
82 bind
83 binmode
84 bless
85 break
86 caller
87 chdir
88 chmod
89 chomp
90 chop
91 chown
92 chr
93 chroot
94 close
95 closedir
96 cmp
97 connect
98 continue
99 cos
100 crypt
101 dbmclose
102 dbmopen
103 default
104 defined
105 delete
106 die
107 do
108 dump
109 each
110 else
111 elsif
112 endgrent
113 endhostent
114 endnetent
115 endprotoent
116 endpwent
117 endservent
118 eof
119 eq
120 eval
121 exec
122 exists
123 exit
124 exp
125 fcntl
126 fileno
127 flock
128 for
129 foreach
130 fork
131 format
132 formline
133 ge
134 getc
135 getgrent
136 getgrgid
137 getgrnam
138 gethostbyaddr
139 gethostbyname
140 gethostent
141 getlogin
142 getnetbyaddr
143 getnetbyname
144 getnetent
145 getpeername
146 getpgrp
147 getppid
148 getpriority
149 getprotobyname
150 getprotobynumber
151 getprotoent
152 getpwent
153 getpwnam
154 getpwuid
155 getservbyname
156 getservbyport
157 getservent
158 getsockname
159 getsockopt
160 given
161 glob
162 gmtime
163 goto
164 grep
165 gt
166 hex
167 if
168 index
169 int
170 ioctl
171 join
172 keys
173 kill
174 last
175 lc
176 lcfirst
177 le
178 length
179 link
180 listen
181 local
182 localtime
183 lock
184 log
185 lstat
186 lt
187 m
188 map
189 mkdir
190 msgctl
191 msgget
192 msgrcv
193 msgsnd
194 my
195 ne
196 next
197 no
198 not
199 oct
200 open
201 opendir
202 or
203 ord
204 our
205 pack
206 package
207 pipe
208 pop
209 pos
210 print
211 printf
212 prototype
213 push
214 q
215 qq
216 qr
217 quotemeta
218 qw
219 qx
220 rand
221 read
222 readdir
223 readline
224 readlink
225 readpipe
226 recv
227 redo
228 ref
229 rename
230 require
231 reset
232 return
233 reverse
234 rewinddir
235 rindex
236 rmdir
237 s
238 say
239 scalar
240 seek
241 seekdir
242 select
243 semctl
244 semget
245 semop
246 send
247 setgrent
248 sethostent
249 setnetent
250 setpgrp
251 setpriority
252 setprotoent
253 setpwent
254 setservent
255 setsockopt
256 shift
257 shmctl
258 shmget
259 shmread
260 shmwrite
261 shutdown
262 sin
263 sleep
264 socket
265 socketpair
266 sort
267 splice
268 split
269 sprintf
270 sqrt
271 srand
272 stat
273 state
274 study
275 sub
276 substr
277 symlink
278 syscall
279 sysopen
280 sysread
281 sysseek
282 system
283 syswrite
284 tell
285 telldir
286 tie
287 tied
288 time
289 times
290 tr
291 truncate
292 uc
293 ucfirst
294 umask
295 undef
296 unless
297 unlink
298 unpack
299 unshift
300 untie
301 until
302 use
303 utime
304 values
305 vec
306 wait
307 waitpid
308 wantarray
309 warn
310 when
311 while
312 write
313 x
314 xor
315 y