This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perldoc under OS/2
[perl5.git] / win32 / makedef.pl
CommitLineData
0a753a76
PP
1#!../miniperl
2
3# Written: 10 April 1996 Gary Ng (71564.1743@compuserve.com)
4
5# Create the export list for perl.
6# Needed by WIN32 for creating perl.dll
7# based on perl_exp.SH in the main perl distribution directory
8
9# This simple program relys on 'global.sym' being up to date
10# with all of the global symbols that a dynamicly link library
11# might want to access.
12
13# There is some symbol defined in global.sym and interp.sym
14# that does not present in the WIN32 port but there is no easy
15# way to find them so I just put a exeception list here
16
3e3baf6d
TB
17my $CCTYPE = shift || "MSVC";
18
0a753a76
PP
19$skip_sym=<<'!END!OF!SKIP!';
20Perl_SvIV
21Perl_SvNV
22Perl_SvTRUE
23Perl_SvUV
24Perl_block_type
25Perl_sv_pvn
26Perl_additem
27Perl_cast_ulong
28Perl_check_uni
29Perl_checkcomma
30Perl_chsize
31Perl_ck_aelem
32Perl_cryptseen
33Perl_cx_dump
34Perl_deb
35Perl_deb_growlevel
36Perl_debop
37Perl_debprofdump
38Perl_debstack
39Perl_debstackptrs
40Perl_do_ipcctl
41Perl_do_ipcget
42Perl_do_msgrcv
43Perl_do_msgsnd
44Perl_do_semop
45Perl_do_shmio
46Perl_doeval
47Perl_dofindlabel
48Perl_dopoptoeval
49Perl_dump_eval
50Perl_dump_fds
51Perl_dump_form
52Perl_dump_gv
53Perl_dump_mstats
54Perl_dump_op
55Perl_dump_packsubs
56Perl_dump_pm
57Perl_dump_sub
58Perl_expectterm
59Perl_fetch_gv
60Perl_fetch_io
61Perl_force_ident
62Perl_force_next
63Perl_force_word
64Perl_hv_stashpv
65Perl_intuit_more
66Perl_know_next
67Perl_modkids
68Perl_mstats
69Perl_my_bzero
70Perl_my_htonl
71Perl_my_ntohl
72Perl_my_swap
73Perl_my_chsize
74Perl_newXSUB
75Perl_no_fh_allowed
76Perl_no_op
77Perl_nointrp
78Perl_nomem
79Perl_pp_cswitch
80Perl_pp_entersubr
81Perl_pp_evalonce
82Perl_pp_interp
83Perl_pp_map
84Perl_pp_nswitch
85Perl_q
86Perl_reall_srchlen
87Perl_regdump
88Perl_regfold
89Perl_regmyendp
90Perl_regmyp_size
91Perl_regmystartp
92Perl_regnarrate
93Perl_regprop
94Perl_same_dirent
95Perl_saw_return
96Perl_scan_const
97Perl_scan_formline
98Perl_scan_heredoc
99Perl_scan_ident
100Perl_scan_inputsymbol
101Perl_scan_pat
102Perl_scan_prefix
103Perl_scan_str
104Perl_scan_subst
105Perl_scan_trans
106Perl_scan_word
68dc0745 107Perl_setenv_getix
0a753a76
PP
108Perl_skipspace
109Perl_sublex_done
110Perl_sublex_start
111Perl_sv_peek
112Perl_sv_ref
113Perl_sv_setptrobj
114Perl_timesbuf
115Perl_too_few_arguments
116Perl_too_many_arguments
117Perl_unlnk
118Perl_wait4pid
119Perl_watch
120Perl_yyname
121Perl_yyrule
122allgvs
123curblock
0a753a76 124curcsv
0a753a76
PP
125lastretstr
126mystack_mark
127perl_init_ext
128perl_requirepv
0a753a76 129stack
ff0cee69 130statusvalue_vms
0a753a76
PP
131Perl_safexcalloc
132Perl_safexmalloc
133Perl_safexfree
134Perl_safexrealloc
68dc0745 135Perl_my_memcmp
8b10511d 136Perl_my_memset
68dc0745
PP
137Perl_cshlen
138Perl_cshname
0a753a76
PP
139!END!OF!SKIP!
140
141# All symbols have a Perl_ prefix because that's what embed.h
142# sticks in front of them.
143
144
145print "LIBRARY Perl\n";
146print "DESCRIPTION 'Perl interpreter, export autogenerated'\n";
147print "CODE LOADONCALL\n";
148print "DATA LOADONCALL NONSHARED MULTIPLE\n";
149print "EXPORTS\n";
150
151open (GLOBAL, "<../global.sym") || die "failed to open global.sym" . $!;
152while (<GLOBAL>) {
153 my $symbol;
154 next if (!/^[A-Za-z]/);
155 next if (/_amg[ \t]*$/);
156 $symbol = "Perl_$_";
157 next if ($skip_sym =~ m/$symbol/m);
3e3baf6d
TB
158 emit_symbol($symbol);
159}
0a753a76
PP
160close(GLOBAL);
161
162# also add symbols from interp.sym
163# They are only needed if -DMULTIPLICITY is not set but it
164# doesn't hurt to include them anyway.
165# these don't have Perl prefix
166
167open (INTERP, "<../interp.sym") || die "failed to open interp.sym" . $!;
168while (<INTERP>) {
169 my $symbol;
170 next if (!/^[A-Za-z]/);
171 next if (/_amg[ \t]*$/);
172 $symbol = $_;
173 next if ($skip_sym =~ m/$symbol/m);
174 #print "\t$symbol";
3e3baf6d
TB
175 emit_symbol("Perl_" . $symbol);
176}
0a753a76
PP
177
178#close(INTERP);
179
180while (<DATA>) {
181 my $symbol;
182 next if (!/^[A-Za-z]/);
183 next if (/^#/);
184 $symbol = $_;
185 next if ($skip_sym =~ m/^$symbol/m);
3e3baf6d
TB
186 emit_symbol($symbol);
187}
188
189sub emit_symbol {
190 my $symbol = shift;
191 chomp $symbol;
192 if ($CCTYPE eq "BORLAND") {
193 # workaround Borland quirk by exporting both the straight
194 # name and a name with leading underscore
195 #print "\t$symbol = _$symbol\n";
196 print "\t_$symbol\n";
197 }
198 else {
199 print "\t$symbol\n";
200 }
201}
0a753a76
PP
202
2031;
204__DATA__
205# extra globals not included above.
206perl_init_i18nl10n
207perl_init_ext
208perl_alloc
209perl_construct
210perl_destruct
211perl_free
212perl_parse
213perl_run
214perl_get_sv
215perl_get_av
216perl_get_hv
217perl_get_cv
218perl_call_argv
219perl_call_pv
220perl_call_method
221perl_call_sv
10dd38fc
GS
222perl_require_pv
223perl_eval_pv
224perl_eval_sv
d28b3ca3 225boot_DynaLoader
68dc0745 226win32_errno
96e4d5b1 227win32_environ
68dc0745
PP
228win32_stdin
229win32_stdout
96e4d5b1 230win32_stderr
68dc0745
PP
231win32_ferror
232win32_feof
233win32_strerror
234win32_fprintf
235win32_printf
236win32_vfprintf
96e4d5b1 237win32_vprintf
68dc0745
PP
238win32_fread
239win32_fwrite
240win32_fopen
241win32_fdopen
242win32_freopen
243win32_fclose
244win32_fputs
245win32_fputc
246win32_ungetc
247win32_getc
248win32_fileno
249win32_clearerr
250win32_fflush
251win32_ftell
252win32_fseek
253win32_fgetpos
254win32_fsetpos
255win32_rewind
256win32_tmpfile
257win32_abort
258win32_fstat
96e4d5b1 259win32_stat
68dc0745
PP
260win32_pipe
261win32_popen
262win32_pclose
263win32_setmode
96e4d5b1
PP
264win32_lseek
265win32_tell
68dc0745
PP
266win32_dup
267win32_dup2
96e4d5b1
PP
268win32_open
269win32_close
270win32_eof
68dc0745
PP
271win32_read
272win32_write
3e3baf6d 273win32_spawnvp
5aabfad6
PP
274win32_mkdir
275win32_rmdir
276win32_chdir
c90c0ff4 277win32_flock
6890e559 278win32_execvp
54310121
PP
279win32_htons
280win32_ntohs
281win32_htonl
282win32_ntohl
283win32_inet_addr
284win32_inet_ntoa
285win32_socket
286win32_bind
287win32_listen
288win32_accept
289win32_connect
290win32_send
291win32_sendto
292win32_recv
293win32_recvfrom
294win32_shutdown
295win32_ioctlsocket
296win32_setsockopt
297win32_getsockopt
298win32_getpeername
299win32_getsockname
300win32_gethostname
301win32_gethostbyname
302win32_gethostbyaddr
303win32_getprotobyname
304win32_getprotobynumber
305win32_getservbyname
306win32_getservbyport
307win32_select
308win32_endhostent
309win32_endnetent
310win32_endprotoent
311win32_endservent
312win32_getnetent
313win32_getnetbyname
314win32_getnetbyaddr
315win32_getprotoent
316win32_getservent
317win32_sethostent
318win32_setnetent
319win32_setprotoent
320win32_setservent
ad2e33dc
GS
321win32_getenv
322win32_stdio
323Perl_win32_init