diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2000-04-06 17:09:19 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2000-04-06 17:09:19 +0000 |
commit | 4512cea31c94e21bbf22ca99a5bb525ea7a8c84c (patch) | |
tree | 628d1180baf59ff2cf578562cdd942fc008cf06b /gnu/usr.bin/perl/win32 | |
parent | e852ed17d905386f3bbad057fda2f07926227f89 (diff) |
perl-5.6.0 + local changes
Diffstat (limited to 'gnu/usr.bin/perl/win32')
30 files changed, 9314 insertions, 8113 deletions
diff --git a/gnu/usr.bin/perl/win32/GenCAPI.pl b/gnu/usr.bin/perl/win32/GenCAPI.pl deleted file mode 100644 index c2ff67df8aa..00000000000 --- a/gnu/usr.bin/perl/win32/GenCAPI.pl +++ /dev/null @@ -1,1616 +0,0 @@ - -# creates a C API file from proto.h -# takes one argument, the path to lib/CORE directory. -# creates 2 files: "perlCAPI.cpp" and "perlCAPI.h". - -#use Config; - -my $hdrfile = "$ARGV[0]\\perlCAPI.h"; -my $infile = '..\\proto.h'; -my $embedfile = '..\\embed.h'; -my $separateObj = 0; - -my %skip_list; -my %embed; - -sub readembed(\%$) { - my ($syms, $file) = @_; - my ($line, @words); - %$syms = (); - local (*FILE, $_); - open(FILE, "< $file") - or die "$0: Can't open $file: $!\n"; - while ($line = <FILE>) { - chop($line); - if ($line =~ /^#define\s+\w+/) { - $line =~ s/^#define\s+//; - @words = split ' ', $line; -# print "$words[0]\t$words[1]\n"; - $$syms{$words[0]} = $words[1]; - } - } - close(FILE); -} - -readembed %embed, $embedfile; - -sub skip_these { - my $list = shift; - foreach my $symbol (@$list) { - $skip_list{$symbol} = 1; - } -} - -skip_these [qw( -cando -cast_ulong -my_chsize -condpair_magic -deb -deb_growlevel -debprofdump -debop -debstack -debstackptrs -dump_fds -dump_mstats -fprintf -find_threadsv -magic_mutexfree -my_memcmp -my_memset -my_pclose -my_popen -my_swap -my_htonl -my_ntohl -new_struct_thread -same_dirent -unlnk -unlock_condpair -safexmalloc -safexcalloc -safexrealloc -safexfree -Perl_GetVars -malloced_size -)]; - - - -if (!open(INFILE, "<$infile")) { - print "open of $infile failed: $!\n"; - return 1; -} - -if (!open(OUTFILE, ">perlCAPI.cpp")) { - print "open of perlCAPI.cpp failed: $!\n"; - return 1; -} - -print OUTFILE <<ENDCODE; -#include "EXTERN.h" -#include "perl.h" -#include "XSUB.h" - -#define DESTRUCTORFUNC (void (*)(void*)) - -ENDCODE - -print OUTFILE "#ifdef SetCPerlObj_defined\n" unless ($separateObj == 0); - -print OUTFILE <<ENDCODE; -EXTERN_C void SetCPerlObj(void *pP) -{ - pPerl = (CPerlObj*)pP; -} - -ENDCODE - -print OUTFILE "#endif\n" unless ($separateObj == 0); - -while () { - last unless defined ($_ = <INFILE>); - if (/^VIRTUAL\s/) { - while (!/;$/) { - chomp; - $_ .= <INFILE>; - } - $_ =~ s/^VIRTUAL\s*//; - $_ =~ s/\s*__attribute__.*$/;/; - if ( /(.*)\s([A-z_]*[0-9A-z_]+\s)_\(\((.*)\)\);/ || - /(.*)\*([A-z_]*[0-9A-z_]+\s)_\(\((.*)\)\);/ ) { - $type = $1; - $name = $2; - $args = $3; - - $name =~ s/\s*$//; - $type =~ s/\s*$//; - next if (defined $skip_list{$name}); - - if($args eq "ARGSproto") { - $args = "void"; - } - - $return = ($type eq "void" or $type eq "Free_t") ? "\t" : "\treturn"; - - if(defined $embed{$name}) { - $funcName = $embed{$name}; - } else { - $funcName = $name; - } - - @args = split(',', $args); - if ($args[$#args] =~ /\s*\.\.\.\s*/) { - if(($name eq "croak") or ($name eq "deb") or ($name eq "die") - or ($name eq "form") or ($name eq "warn")) { - print OUTFILE "\n#ifdef $name" . "_defined" unless ($separateObj == 0); - $args[0] =~ /(\w+)\W*$/; - $arg = $1; - print OUTFILE <<ENDCODE; - -#undef $name -EXTERN_C $type $funcName ($args) -{ - char *pstr; - char *pmsg; - va_list args; - va_start(args, $arg); - pmsg = pPerl->Perl_mess($arg, &args); - New(0, pstr, strlen(pmsg)+1, char); - strcpy(pstr, pmsg); -$return pPerl->Perl_$name(pstr); - va_end(args); -} -ENDCODE - print OUTFILE "#endif\n" unless ($separateObj == 0); - } - elsif($name eq "newSVpvf") { - print OUTFILE "\n#ifdef $name" . "_defined" unless ($separateObj == 0); - $args[0] =~ /(\w+)\W*$/; - $arg = $1; - print OUTFILE <<ENDCODE; - -#undef $name -EXTERN_C $type $funcName ($args) -{ - SV *sv; - va_list args; - va_start(args, $arg); - sv = pPerl->Perl_newSV(0); - pPerl->Perl_sv_vcatpvfn(sv, $arg, strlen($arg), &args, NULL, 0, NULL); - va_end(args); - return sv; -} -ENDCODE - print OUTFILE "#endif\n" unless ($separateObj == 0); - } - elsif($name eq "sv_catpvf") { - print OUTFILE "\n#ifdef $name" . "_defined" unless ($separateObj == 0); - $args[0] =~ /(\w+)\W*$/; - $arg0 = $1; - $args[1] =~ /(\w+)\W*$/; - $arg1 = $1; - print OUTFILE <<ENDCODE; - -#undef $name -EXTERN_C $type $funcName ($args) -{ - va_list args; - va_start(args, $arg1); - pPerl->Perl_sv_vcatpvfn($arg0, $arg1, strlen($arg1), &args, NULL, 0, NULL); - va_end(args); -} -ENDCODE - print OUTFILE "#endif\n" unless ($separateObj == 0); - } - elsif($name eq "sv_catpvf_mg") { - print OUTFILE "\n#ifdef $name" . "_defined" unless ($separateObj == 0); - $args[0] =~ /(\w+)\W*$/; - $arg0 = $1; - $args[1] =~ /(\w+)\W*$/; - $arg1 = $1; - print OUTFILE <<ENDCODE; - -#undef $name -#ifndef mg_set -#define mg_set pPerl->Perl_mg_set -#endif -EXTERN_C $type $funcName ($args) -{ - va_list args; - va_start(args, $arg1); - pPerl->Perl_sv_vcatpvfn($arg0, $arg1, strlen($arg1), &args, NULL, 0, NULL); - va_end(args); - SvSETMAGIC(sv); -} -ENDCODE - print OUTFILE "#endif\n" unless ($separateObj == 0); - } - elsif($name eq "sv_setpvf") { - print OUTFILE "\n#ifdef $name" . "_defined" unless ($separateObj == 0); - $args[0] =~ /(\w+)\W*$/; - $arg0 = $1; - $args[1] =~ /(\w+)\W*$/; - $arg1 = $1; - print OUTFILE <<ENDCODE; - -#undef $name -EXTERN_C $type $funcName ($args) -{ - va_list args; - va_start(args, $arg1); - pPerl->Perl_sv_vsetpvfn($arg0, $arg1, strlen($arg1), &args, NULL, 0, NULL); - va_end(args); -} -ENDCODE - print OUTFILE "#endif\n" unless ($separateObj == 0); - } - elsif($name eq "sv_setpvf_mg") { - print OUTFILE "\n#ifdef $name" . "_defined" unless ($separateObj == 0); - $args[0] =~ /(\w+)\W*$/; - $arg0 = $1; - $args[1] =~ /(\w+)\W*$/; - $arg1 = $1; - print OUTFILE <<ENDCODE; - -#undef $name -#ifndef mg_set -#define mg_set pPerl->Perl_mg_set -#endif -EXTERN_C $type $funcName ($args) -{ - va_list args; - va_start(args, $arg1); - pPerl->Perl_sv_vsetpvfn($arg0, $arg1, strlen($arg1), &args, NULL, 0, NULL); - va_end(args); - SvSETMAGIC(sv); -} -ENDCODE - print OUTFILE "#endif\n" unless ($separateObj == 0); - } - elsif($name eq "fprintf") { - print OUTFILE "\n#ifdef $name" . "_defined" unless ($separateObj == 0); - $args[0] =~ /(\w+)\W*$/; - $arg0 = $1; - $args[1] =~ /(\w+)\W*$/; - $arg1 = $1; - print OUTFILE <<ENDCODE; - -#undef $name -EXTERN_C $type $name ($args) -{ - int nRet; - va_list args; - va_start(args, $arg1); - nRet = PerlIO_vprintf($arg0, $arg1, args); - va_end(args); - return nRet; -} -ENDCODE - print OUTFILE "#endif\n" unless ($separateObj == 0); - } else { - print "Warning: can't handle varargs function '$name'\n"; - } - next; - } - - # newXS special case - if ($name eq "newXS") { - next; - } - - print OUTFILE "\n#ifdef $name" . "defined" unless ($separateObj == 0); - - # handle specical case for save_destructor - if ($name eq "save_destructor") { - next; - } - # handle specical case for sighandler - if ($name eq "sighandler") { - next; - } - # handle special case for sv_grow - if ($name eq "sv_grow" and $args eq "SV* sv, unsigned long newlen") { - next; - } - # handle special case for newSV - if ($name eq "newSV" and $args eq "I32 x, STRLEN len") { - next; - } - # handle special case for perl_parse - if ($name eq "perl_parse") { - print OUTFILE <<ENDCODE; - -#undef $name -EXTERN_C $type $name ($args) -{ - return pPerl->perl_parse(xsinit, argc, argv, env); -} -ENDCODE - print OUTFILE "#endif\n" unless ($separateObj == 0); - next; - } - # handle special case for perl_atexit - if ($name eq "perl_atexit") { - print OUTFILE <<ENDCODE; - -#undef $name -EXTERN_C $type $name ($args) -{ - pPerl->perl_atexit(fn, ptr); -} -ENDCODE - print OUTFILE "#endif\n" unless ($separateObj == 0); - next; - } - - - if($name eq "byterun" and $args eq "struct bytestream bs") { - next; - } - - # foo(void); - if ($args eq "void") { - print OUTFILE <<ENDCODE; - -#undef $name -EXTERN_C $type $funcName () -{ -$return pPerl->$funcName(); -} - -ENDCODE - print OUTFILE "#endif\n" unless ($separateObj == 0); - next; - } - - # foo(char *s, const int bar); - print OUTFILE <<ENDCODE; - -#undef $name -EXTERN_C $type $funcName ($args) -{ -ENDCODE - print OUTFILE "$return pPerl->$funcName"; - $doneone = 0; - foreach $arg (@args) { - if ($arg =~ /(\w+)\W*$/) { - if ($doneone) { - print OUTFILE ", $1"; - } - else { - print OUTFILE "($1"; - $doneone++; - } - } - } - print OUTFILE ");\n}\n"; - print OUTFILE "#endif\n" unless ($separateObj == 0); - } - else { - print "failed to match $_"; - } - } -} - -close INFILE; - -%skip_list = (); - -skip_these [qw( -strchop -filemode -lastfd -oldname -curinterp -Argv -Cmd -sortcop -sortstash -firstgv -secondgv -sortstack -signalstack -mystrk -dumplvl -oldlastpm -gensym -preambled -preambleav -Ilaststatval -Ilaststype -mess_sv -ors -opsave -eval_mutex -strtab_mutex -orslen -ofmt -modcount -generation -DBcv -archpat_auto -sortcxix -lastgotoprobe -regdummy -regcomp_parse -regxend -regcode -regnaughty -regsawback -regprecomp -regnpar -regsize -regflags -regseen -seen_zerolen -regcomp_rx -extralen -colorset -colors -reginput -regbol -regeol -regstartp -regendp -reglastparen -regtill -regprev -reg_start_tmp -reg_start_tmpl -regdata -bostr -reg_flags -reg_eval_set -regnarrate -regprogram -regindent -regcc -in_clean_objs -in_clean_all -linestart -pending_ident -statusvalue_vms -sublex_info -thrsv -threadnum -PL_piMem -PL_piENV -PL_piStdIO -PL_piLIO -PL_piDir -PL_piSock -PL_piProc -cshname -threadsv_names -thread -nthreads -thr_key -threads_mutex -malloc_mutex -svref_mutex -sv_mutex -cred_mutex -nthreads_cond -eval_cond -cryptseen -cshlen -)]; - -sub readvars(\%$$) { - my ($syms, $file, $pre) = @_; - %$syms = (); - local (*FILE, $_); - open(FILE, "< $file") - or die "$0: Can't open $file: $!\n"; - while (<FILE>) { - s/[ \t]*#.*//; # Delete comments. - if (/PERLVARI?C?\($pre(\w+),\s*([^,)]+)/) { - $$syms{$1} = $2; - } - } - close(FILE); -} - -my %intrp; -my %thread; -my %globvar; - -readvars %intrp, '..\intrpvar.h','I'; -readvars %thread, '..\thrdvar.h','T'; -readvars %globvar, '..\perlvars.h','G'; - -open(HDRFILE, ">$hdrfile") or die "$0: Can't open $hdrfile: $!\n"; -print HDRFILE <<ENDCODE; -EXTERN_C void SetCPerlObj(void* pP); -EXTERN_C CV* Perl_newXS(char* name, void (*subaddr)(CV* cv), char* filename); - -ENDCODE - -sub DoVariable($$) { - my $name = shift; - my $type = shift; - - return if (defined $skip_list{$name}); - return if ($type eq 'struct perl_thread *'); - - print OUTFILE "\n#ifdef $name" . "_defined" unless ($separateObj == 0); - print OUTFILE <<ENDCODE; -#undef PL_$name -EXTERN_C $type * _PL_$name () -{ - return (($type *)&pPerl->PL_$name); -} - -ENDCODE - - print OUTFILE "#endif\n" unless ($separateObj == 0); - - print HDRFILE <<ENDCODE; - -#undef PL_$name -EXTERN_C $type * _PL_$name (); -#define PL_$name (*_PL_$name()) - -ENDCODE - -} - -foreach $key (keys %intrp) { - DoVariable ($key, $intrp{$key}); -} - -foreach $key (keys %thread) { - DoVariable ($key, $thread{$key}); -} - -foreach $key (keys %globvar) { - DoVariable ($key, $globvar{$key}); -} - -print OUTFILE <<EOCODE; - -START_EXTERN_C - -char ** _Perl_op_desc(void) -{ - return pPerl->Perl_get_op_descs(); -} - -char ** _Perl_op_name(void) -{ - return pPerl->Perl_get_op_names(); -} - -char * _Perl_no_modify(void) -{ - return pPerl->Perl_get_no_modify(); -} - -U32 * _Perl_opargs(void) -{ - return pPerl->Perl_get_opargs(); -} - -void xs_handler(CV* cv, CPerlObj* p) -{ -#ifndef NO_XSLOCKS - XSLock localLock(p); -#endif - void(*func)(CV*); - SV* sv; - MAGIC* m = pPerl->Perl_mg_find((SV*)cv, '~'); - if(m != NULL) - { - sv = m->mg_obj; - if(SvIOK(sv)) - { - func = (void(*)(CV*))SvIVX(sv); - } - else - { - func = (void(*)(CV*))pPerl->Perl_sv_2iv(sv); - } - func(cv); - } -} - -EXTERN_C CV* Perl_newXS(char* name, void (*subaddr)(CV* cv), char* filename) -{ - CV* cv = pPerl->Perl_newXS(name, xs_handler, filename); - pPerl->Perl_sv_magic((SV*)cv, pPerl->Perl_sv_2mortal(pPerl->Perl_newSViv((IV)subaddr)), '~', "CAPI", 4); - return cv; -} - - -void Perl_deb(const char pat, ...) -{ -} - -#undef PL_piMem -#undef PL_piENV -#undef PL_piStdIO -#undef PL_piLIO -#undef PL_piDir -#undef PL_piSock -#undef PL_piProc - -int * _win32_errno(void) -{ - return &pPerl->ErrorNo(); -} - -FILE* _win32_stdin(void) -{ - return (FILE*)pPerl->PL_piStdIO->Stdin(); -} - -FILE* _win32_stdout(void) -{ - return (FILE*)pPerl->PL_piStdIO->Stdout(); -} - -FILE* _win32_stderr(void) -{ - return (FILE*)pPerl->PL_piStdIO->Stderr(); -} - -int _win32_ferror(FILE *fp) -{ - return pPerl->PL_piStdIO->Error((PerlIO*)fp, ErrorNo()); -} - -int _win32_feof(FILE *fp) -{ - return pPerl->PL_piStdIO->Eof((PerlIO*)fp, ErrorNo()); -} - -char* _win32_strerror(int e) -{ - return strerror(e); -} - -void _win32_perror(const char *str) -{ - perror(str); -} - -int _win32_vfprintf(FILE *pf, const char *format, va_list arg) -{ - return pPerl->PL_piStdIO->Vprintf((PerlIO*)pf, ErrorNo(), format, arg); -} - -int _win32_vprintf(const char *format, va_list arg) -{ - return pPerl->PL_piStdIO->Vprintf(pPerl->PL_piStdIO->Stdout(), ErrorNo(), format, arg); -} - -int _win32_fprintf(FILE *pf, const char *format, ...) -{ - int ret; - va_list args; - va_start(args, format); - ret = _win32_vfprintf(pf, format, args); - va_end(args); - return ret; -} - -int _win32_printf(const char *format, ...) -{ - int ret; - va_list args; - va_start(args, format); - ret = _win32_vprintf(format, args); - va_end(args); - return ret; -} - -size_t _win32_fread(void *buf, size_t size, size_t count, FILE *pf) -{ - return pPerl->PL_piStdIO->Read((PerlIO*)pf, buf, (size*count), ErrorNo()); -} - -size_t _win32_fwrite(const void *buf, size_t size, size_t count, FILE *pf) -{ - return pPerl->PL_piStdIO->Write((PerlIO*)pf, buf, (size*count), ErrorNo()); -} - -FILE* _win32_fopen(const char *path, const char *mode) -{ - return (FILE*)pPerl->PL_piStdIO->Open(path, mode, ErrorNo()); -} - -FILE* _win32_fdopen(int fh, const char *mode) -{ - return (FILE*)pPerl->PL_piStdIO->Fdopen(fh, mode, ErrorNo()); -} - -FILE* _win32_freopen(const char *path, const char *mode, FILE *pf) -{ - return (FILE*)pPerl->PL_piStdIO->Reopen(path, mode, (PerlIO*)pf, ErrorNo()); -} - -int _win32_fclose(FILE *pf) -{ - return pPerl->PL_piStdIO->Close((PerlIO*)pf, ErrorNo()); -} - -int _win32_fputs(const char *s,FILE *pf) -{ - return pPerl->PL_piStdIO->Puts((PerlIO*)pf, s, ErrorNo()); -} - -int _win32_fputc(int c,FILE *pf) -{ - return pPerl->PL_piStdIO->Putc((PerlIO*)pf, c, ErrorNo()); -} - -int _win32_ungetc(int c,FILE *pf) -{ - return pPerl->PL_piStdIO->Ungetc((PerlIO*)pf, c, ErrorNo()); -} - -int _win32_getc(FILE *pf) -{ - return pPerl->PL_piStdIO->Getc((PerlIO*)pf, ErrorNo()); -} - -int _win32_fileno(FILE *pf) -{ - return pPerl->PL_piStdIO->Fileno((PerlIO*)pf, ErrorNo()); -} - -void _win32_clearerr(FILE *pf) -{ - pPerl->PL_piStdIO->Clearerr((PerlIO*)pf, ErrorNo()); -} - -int _win32_fflush(FILE *pf) -{ - return pPerl->PL_piStdIO->Flush((PerlIO*)pf, ErrorNo()); -} - -long _win32_ftell(FILE *pf) -{ - return pPerl->PL_piStdIO->Tell((PerlIO*)pf, ErrorNo()); -} - -int _win32_fseek(FILE *pf,long offset,int origin) -{ - return pPerl->PL_piStdIO->Seek((PerlIO*)pf, offset, origin, ErrorNo()); -} - -int _win32_fgetpos(FILE *pf,fpos_t *p) -{ - return pPerl->PL_piStdIO->Getpos((PerlIO*)pf, p, ErrorNo()); -} - -int _win32_fsetpos(FILE *pf,const fpos_t *p) -{ - return pPerl->PL_piStdIO->Setpos((PerlIO*)pf, p, ErrorNo()); -} - -void _win32_rewind(FILE *pf) -{ - pPerl->PL_piStdIO->Rewind((PerlIO*)pf, ErrorNo()); -} - -FILE* _win32_tmpfile(void) -{ - return (FILE*)pPerl->PL_piStdIO->Tmpfile(ErrorNo()); -} - -void _win32_setbuf(FILE *pf, char *buf) -{ - pPerl->PL_piStdIO->SetBuf((PerlIO*)pf, buf, ErrorNo()); -} - -int _win32_setvbuf(FILE *pf, char *buf, int type, size_t size) -{ - return pPerl->PL_piStdIO->SetVBuf((PerlIO*)pf, buf, type, size, ErrorNo()); -} - -char* _win32_fgets(char *s, int n, FILE *pf) -{ - return pPerl->PL_piStdIO->Gets((PerlIO*)pf, s, n, ErrorNo()); -} - -char* _win32_gets(char *s) -{ - return _win32_fgets(s, 80, (FILE*)pPerl->PL_piStdIO->Stdin()); -} - -int _win32_fgetc(FILE *pf) -{ - return pPerl->PL_piStdIO->Getc((PerlIO*)pf, ErrorNo()); -} - -int _win32_putc(int c, FILE *pf) -{ - return pPerl->PL_piStdIO->Putc((PerlIO*)pf, c, ErrorNo()); -} - -int _win32_puts(const char *s) -{ - return pPerl->PL_piStdIO->Puts(pPerl->PL_piStdIO->Stdout(), s, ErrorNo()); -} - -int _win32_getchar(void) -{ - return pPerl->PL_piStdIO->Getc(pPerl->PL_piStdIO->Stdin(), ErrorNo()); -} - -int _win32_putchar(int c) -{ - return pPerl->PL_piStdIO->Putc(pPerl->PL_piStdIO->Stdout(), c, ErrorNo()); -} - -void* _win32_malloc(size_t size) -{ - return pPerl->PL_piMem->Malloc(size); -} - -void* _win32_calloc(size_t numitems, size_t size) -{ - return pPerl->PL_piMem->Malloc(numitems*size); -} - -void* _win32_realloc(void *block, size_t size) -{ - return pPerl->PL_piMem->Realloc(block, size); -} - -void _win32_free(void *block) -{ - pPerl->PL_piMem->Free(block); -} - -void _win32_abort(void) -{ - pPerl->PL_piProc->Abort(); -} - -int _win32_pipe(int *phandles, unsigned int psize, int textmode) -{ - return pPerl->PL_piProc->Pipe(phandles); -} - -FILE* _win32_popen(const char *command, const char *mode) -{ - return (FILE*)pPerl->PL_piProc->Popen(command, mode); -} - -int _win32_pclose(FILE *pf) -{ - return pPerl->PL_piProc->Pclose((PerlIO*)pf); -} - -unsigned _win32_sleep(unsigned int t) -{ - return pPerl->PL_piProc->Sleep(t); -} - -int _win32_spawnvp(int mode, const char *cmdname, const char *const *argv) -{ - return pPerl->PL_piProc->Spawnvp(mode, cmdname, argv); -} - -int _win32_mkdir(const char *dir, int mode) -{ - return pPerl->PL_piDir->Makedir(dir, mode, ErrorNo()); -} - -int _win32_rmdir(const char *dir) -{ - return pPerl->PL_piDir->Rmdir(dir, ErrorNo()); -} - -int _win32_chdir(const char *dir) -{ - return pPerl->PL_piDir->Chdir(dir, ErrorNo()); -} - -#undef stat -int _win32_fstat(int fd,struct stat *sbufptr) -{ - return pPerl->PL_piLIO->FileStat(fd, sbufptr, ErrorNo()); -} - -int _win32_stat(const char *name,struct stat *sbufptr) -{ - return pPerl->PL_piLIO->NameStat(name, sbufptr, ErrorNo()); -} - -int _win32_rename(const char *oname, const char *newname) -{ - return pPerl->PL_piLIO->Rename(oname, newname, ErrorNo()); -} - -int _win32_setmode(int fd, int mode) -{ - return pPerl->PL_piLIO->Setmode(fd, mode, ErrorNo()); -} - -long _win32_lseek(int fd, long offset, int origin) -{ - return pPerl->PL_piLIO->Lseek(fd, offset, origin, ErrorNo()); -} - -long _win32_tell(int fd) -{ - return pPerl->PL_piStdIO->Tell((PerlIO*)fd, ErrorNo()); -} - -int _win32_dup(int fd) -{ - return pPerl->PL_piLIO->Dup(fd, ErrorNo()); -} - -int _win32_dup2(int h1, int h2) -{ - return pPerl->PL_piLIO->Dup2(h1, h2, ErrorNo()); -} - -int _win32_open(const char *path, int oflag,...) -{ - return pPerl->PL_piLIO->Open(path, oflag, ErrorNo()); -} - -int _win32_close(int fd) -{ - return pPerl->PL_piLIO->Close(fd, ErrorNo()); -} - -int _win32_read(int fd, void *buf, unsigned int cnt) -{ - return pPerl->PL_piLIO->Read(fd, buf, cnt, ErrorNo()); -} - -int _win32_write(int fd, const void *buf, unsigned int cnt) -{ - return pPerl->PL_piLIO->Write(fd, buf, cnt, ErrorNo()); -} - -int _win32_times(struct tms *timebuf) -{ - return pPerl->PL_piProc->Times(timebuf); -} - -int _win32_ioctl(int i, unsigned int u, char *data) -{ - return pPerl->PL_piLIO->IOCtl(i, u, data, ErrorNo()); -} - -int _win32_utime(const char *f, struct utimbuf *t) -{ - return pPerl->PL_piLIO->Utime((char*)f, t, ErrorNo()); -} - -char* _win32_getenv(const char *name) -{ - return pPerl->PL_piENV->Getenv(name, ErrorNo()); -} - -int _win32_putenv(const char *name) -{ - return pPerl->PL_piENV->Putenv(name, ErrorNo()); -} - -int _win32_open_osfhandle(long handle, int flags) -{ - return pPerl->PL_piStdIO->OpenOSfhandle(handle, flags); -} - -long _win32_get_osfhandle(int fd) -{ - return pPerl->PL_piStdIO->GetOSfhandle(fd); -} - -u_long _win32_htonl (u_long hostlong) -{ - return pPerl->PL_piSock->Htonl(hostlong); -} - -u_short _win32_htons (u_short hostshort) -{ - return pPerl->PL_piSock->Htons(hostshort); -} - -u_long _win32_ntohl (u_long netlong) -{ - return pPerl->PL_piSock->Ntohl(netlong); -} - -u_short _win32_ntohs (u_short netshort) -{ - return pPerl->PL_piSock->Ntohs(netshort); -} - -unsigned long _win32_inet_addr (const char * cp) -{ - return pPerl->PL_piSock->InetAddr(cp, ErrorNo()); -} - -char * _win32_inet_ntoa (struct in_addr in) -{ - return pPerl->PL_piSock->InetNtoa(in, ErrorNo()); -} - -SOCKET _win32_socket (int af, int type, int protocol) -{ - return pPerl->PL_piSock->Socket(af, type, protocol, ErrorNo()); -} - -int _win32_bind (SOCKET s, const struct sockaddr *addr, int namelen) -{ - return pPerl->PL_piSock->Bind(s, addr, namelen, ErrorNo()); -} - -int _win32_listen (SOCKET s, int backlog) -{ - return pPerl->PL_piSock->Listen(s, backlog, ErrorNo()); -} - -SOCKET _win32_accept (SOCKET s, struct sockaddr *addr, int *addrlen) -{ - return pPerl->PL_piSock->Accept(s, addr, addrlen, ErrorNo()); -} - -int _win32_connect (SOCKET s, const struct sockaddr *name, int namelen) -{ - return pPerl->PL_piSock->Connect(s, name, namelen, ErrorNo()); -} - -int _win32_send (SOCKET s, const char * buf, int len, int flags) -{ - return pPerl->PL_piSock->Send(s, buf, len, flags, ErrorNo()); -} - -int _win32_sendto (SOCKET s, const char * buf, int len, int flags, - const struct sockaddr *to, int tolen) -{ - return pPerl->PL_piSock->Sendto(s, buf, len, flags, to, tolen, ErrorNo()); -} - -int _win32_recv (SOCKET s, char * buf, int len, int flags) -{ - return pPerl->PL_piSock->Recv(s, buf, len, flags, ErrorNo()); -} - -int _win32_recvfrom (SOCKET s, char * buf, int len, int flags, - struct sockaddr *from, int * fromlen) -{ - return pPerl->PL_piSock->Recvfrom(s, buf, len, flags, from, fromlen, ErrorNo()); -} - -int _win32_shutdown (SOCKET s, int how) -{ - return pPerl->PL_piSock->Shutdown(s, how, ErrorNo()); -} - -int _win32_closesocket (SOCKET s) -{ - return pPerl->PL_piSock->Closesocket(s, ErrorNo()); -} - -int _win32_ioctlsocket (SOCKET s, long cmd, u_long *argp) -{ - return pPerl->PL_piSock->Ioctlsocket(s, cmd, argp, ErrorNo()); -} - -int _win32_setsockopt (SOCKET s, int level, int optname, - const char * optval, int optlen) -{ - return pPerl->PL_piSock->Setsockopt(s, level, optname, optval, optlen, ErrorNo()); -} - -int _win32_getsockopt (SOCKET s, int level, int optname, char * optval, int *optlen) -{ - return pPerl->PL_piSock->Getsockopt(s, level, optname, optval, optlen, ErrorNo()); -} - -int _win32_getpeername (SOCKET s, struct sockaddr *name, int * namelen) -{ - return pPerl->PL_piSock->Getpeername(s, name, namelen, ErrorNo()); -} - -int _win32_getsockname (SOCKET s, struct sockaddr *name, int * namelen) -{ - return pPerl->PL_piSock->Getsockname(s, name, namelen, ErrorNo()); -} - -int _win32_gethostname (char * name, int namelen) -{ - return pPerl->PL_piSock->Gethostname(name, namelen, ErrorNo()); -} - -struct hostent * _win32_gethostbyname(const char * name) -{ - return pPerl->PL_piSock->Gethostbyname(name, ErrorNo()); -} - -struct hostent * _win32_gethostbyaddr(const char * addr, int len, int type) -{ - return pPerl->PL_piSock->Gethostbyaddr(addr, len, type, ErrorNo()); -} - -struct protoent * _win32_getprotobyname(const char * name) -{ - return pPerl->PL_piSock->Getprotobyname(name, ErrorNo()); -} - -struct protoent * _win32_getprotobynumber(int proto) -{ - return pPerl->PL_piSock->Getprotobynumber(proto, ErrorNo()); -} - -struct servent * _win32_getservbyname(const char * name, const char * proto) -{ - return pPerl->PL_piSock->Getservbyname(name, proto, ErrorNo()); -} - -struct servent * _win32_getservbyport(int port, const char * proto) -{ - return pPerl->PL_piSock->Getservbyport(port, proto, ErrorNo()); -} - -int _win32_select (int nfds, Perl_fd_set *rfds, Perl_fd_set *wfds, Perl_fd_set *xfds, - const struct timeval *timeout) -{ - return pPerl->PL_piSock->Select(nfds, (char*)rfds, (char*)wfds, (char*)xfds, timeout, ErrorNo()); -} - -void _win32_endnetent(void) -{ - pPerl->PL_piSock->Endnetent(ErrorNo()); -} - -void _win32_endhostent(void) -{ - pPerl->PL_piSock->Endhostent(ErrorNo()); -} - -void _win32_endprotoent(void) -{ - pPerl->PL_piSock->Endprotoent(ErrorNo()); -} - -void _win32_endservent(void) -{ - pPerl->PL_piSock->Endservent(ErrorNo()); -} - -struct netent * _win32_getnetent(void) -{ - return pPerl->PL_piSock->Getnetent(ErrorNo()); -} - -struct netent * _win32_getnetbyname(char *name) -{ - return pPerl->PL_piSock->Getnetbyname(name, ErrorNo()); -} - -struct netent * _win32_getnetbyaddr(long net, int type) -{ - return pPerl->PL_piSock->Getnetbyaddr(net, type, ErrorNo()); -} - -struct protoent *_win32_getprotoent(void) -{ - return pPerl->PL_piSock->Getprotoent(ErrorNo()); -} - -struct servent *_win32_getservent(void) -{ - return pPerl->PL_piSock->Getservent(ErrorNo()); -} - -void _win32_sethostent(int stayopen) -{ - pPerl->PL_piSock->Sethostent(stayopen, ErrorNo()); -} - -void _win32_setnetent(int stayopen) -{ - pPerl->PL_piSock->Setnetent(stayopen, ErrorNo()); -} - -void _win32_setprotoent(int stayopen) -{ - pPerl->PL_piSock->Setprotoent(stayopen, ErrorNo()); -} - -void _win32_setservent(int stayopen) -{ - pPerl->PL_piSock->Setservent(stayopen, ErrorNo()); -} -END_EXTERN_C -EOCODE - - -print HDRFILE <<EOCODE; - -START_EXTERN_C - -#undef Perl_op_desc -char ** _Perl_op_desc (); -#define Perl_op_desc (_Perl_op_desc()) - -#undef Perl_op_name -char ** _Perl_op_name (); -#define Perl_op_name (_Perl_op_name()) - -#undef Perl_no_modify -char * _Perl_no_modify (); -#define Perl_no_modify (_Perl_no_modify()) - -#undef Perl_opargs -U32 * _Perl_opargs (); -#define Perl_opargs (_Perl_opargs()) - - -#undef win32_errno -#undef win32_stdin -#undef win32_stdout -#undef win32_stderr -#undef win32_ferror -#undef win32_feof -#undef win32_fprintf -#undef win32_printf -#undef win32_vfprintf -#undef win32_vprintf -#undef win32_fread -#undef win32_fwrite -#undef win32_fopen -#undef win32_fdopen -#undef win32_freopen -#undef win32_fclose -#undef win32_fputs -#undef win32_fputc -#undef win32_ungetc -#undef win32_getc -#undef win32_fileno -#undef win32_clearerr -#undef win32_fflush -#undef win32_ftell -#undef win32_fseek -#undef win32_fgetpos -#undef win32_fsetpos -#undef win32_rewind -#undef win32_tmpfile -#undef win32_abort -#undef win32_fstat -#undef win32_stat -#undef win32_pipe -#undef win32_popen -#undef win32_pclose -#undef win32_rename -#undef win32_setmode -#undef win32_lseek -#undef win32_tell -#undef win32_dup -#undef win32_dup2 -#undef win32_open -#undef win32_close -#undef win32_eof -#undef win32_read -#undef win32_write -#undef win32_mkdir -#undef win32_rmdir -#undef win32_chdir -#undef win32_setbuf -#undef win32_setvbuf -#undef win32_fgetc -#undef win32_fgets -#undef win32_gets -#undef win32_putc -#undef win32_puts -#undef win32_getchar -#undef win32_putchar -#undef win32_malloc -#undef win32_calloc -#undef win32_realloc -#undef win32_free -#undef win32_sleep -#undef win32_times -#undef win32_stat -#undef win32_ioctl -#undef win32_utime -#undef win32_getenv - -#undef win32_htonl -#undef win32_htons -#undef win32_ntohl -#undef win32_ntohs -#undef win32_inet_addr -#undef win32_inet_ntoa - -#undef win32_socket -#undef win32_bind -#undef win32_listen -#undef win32_accept -#undef win32_connect -#undef win32_send -#undef win32_sendto -#undef win32_recv -#undef win32_recvfrom -#undef win32_shutdown -#undef win32_closesocket -#undef win32_ioctlsocket -#undef win32_setsockopt -#undef win32_getsockopt -#undef win32_getpeername -#undef win32_getsockname -#undef win32_gethostname -#undef win32_gethostbyname -#undef win32_gethostbyaddr -#undef win32_getprotobyname -#undef win32_getprotobynumber -#undef win32_getservbyname -#undef win32_getservbyport -#undef win32_select -#undef win32_endhostent -#undef win32_endnetent -#undef win32_endprotoent -#undef win32_endservent -#undef win32_getnetent -#undef win32_getnetbyname -#undef win32_getnetbyaddr -#undef win32_getprotoent -#undef win32_getservent -#undef win32_sethostent -#undef win32_setnetent -#undef win32_setprotoent -#undef win32_setservent - -#define win32_errno _win32_errno -#define win32_stdin _win32_stdin -#define win32_stdout _win32_stdout -#define win32_stderr _win32_stderr -#define win32_ferror _win32_ferror -#define win32_feof _win32_feof -#define win32_strerror _win32_strerror -#define win32_perror _win32_perror -#define win32_fprintf _win32_fprintf -#define win32_printf _win32_printf -#define win32_vfprintf _win32_vfprintf -#define win32_vprintf _win32_vprintf -#define win32_fread _win32_fread -#define win32_fwrite _win32_fwrite -#define win32_fopen _win32_fopen -#define win32_fdopen _win32_fdopen -#define win32_freopen _win32_freopen -#define win32_fclose _win32_fclose -#define win32_fputs _win32_fputs -#define win32_fputc _win32_fputc -#define win32_ungetc _win32_ungetc -#define win32_getc _win32_getc -#define win32_fileno _win32_fileno -#define win32_clearerr _win32_clearerr -#define win32_fflush _win32_fflush -#define win32_ftell _win32_ftell -#define win32_fseek _win32_fseek -#define win32_fgetpos _win32_fgetpos -#define win32_fsetpos _win32_fsetpos -#define win32_rewind _win32_rewind -#define win32_tmpfile _win32_tmpfile -#define win32_abort _win32_abort -#define win32_fstat _win32_fstat -#define win32_stat _win32_stat -#define win32_pipe _win32_pipe -#define win32_popen _win32_popen -#define win32_pclose _win32_pclose -#define win32_rename _win32_rename -#define win32_setmode _win32_setmode -#define win32_lseek _win32_lseek -#define win32_tell _win32_tell -#define win32_dup _win32_dup -#define win32_dup2 _win32_dup2 -#define win32_open _win32_open -#define win32_close _win32_close -#define win32_eof _win32_eof -#define win32_read _win32_read -#define win32_write _win32_write -#define win32_mkdir _win32_mkdir -#define win32_rmdir _win32_rmdir -#define win32_chdir _win32_chdir -#define win32_setbuf _win32_setbuf -#define win32_setvbuf _win32_setvbuf -#define win32_fgetc _win32_fgetc -#define win32_fgets _win32_fgets -#define win32_gets _win32_gets -#define win32_putc _win32_putc -#define win32_puts _win32_puts -#define win32_getchar _win32_getchar -#define win32_putchar _win32_putchar -#define win32_malloc _win32_malloc -#define win32_calloc _win32_calloc -#define win32_realloc _win32_realloc -#define win32_free _win32_free -#define win32_sleep _win32_sleep -#define win32_spawnvp _win32_spawnvp -#define win32_times _win32_times -#define win32_stat _win32_stat -#define win32_ioctl _win32_ioctl -#define win32_utime _win32_utime -#define win32_getenv _win32_getenv -#define win32_open_osfhandle _win32_open_osfhandle -#define win32_get_osfhandle _win32_get_osfhandle - -#define win32_htonl _win32_htonl -#define win32_htons _win32_htons -#define win32_ntohl _win32_ntohl -#define win32_ntohs _win32_ntohs -#define win32_inet_addr _win32_inet_addr -#define win32_inet_ntoa _win32_inet_ntoa - -#define win32_socket _win32_socket -#define win32_bind _win32_bind -#define win32_listen _win32_listen -#define win32_accept _win32_accept -#define win32_connect _win32_connect -#define win32_send _win32_send -#define win32_sendto _win32_sendto -#define win32_recv _win32_recv -#define win32_recvfrom _win32_recvfrom -#define win32_shutdown _win32_shutdown -#define win32_closesocket _win32_closesocket -#define win32_ioctlsocket _win32_ioctlsocket -#define win32_setsockopt _win32_setsockopt -#define win32_getsockopt _win32_getsockopt -#define win32_getpeername _win32_getpeername -#define win32_getsockname _win32_getsockname -#define win32_gethostname _win32_gethostname -#define win32_gethostbyname _win32_gethostbyname -#define win32_gethostbyaddr _win32_gethostbyaddr -#define win32_getprotobyname _win32_getprotobyname -#define win32_getprotobynumber _win32_getprotobynumber -#define win32_getservbyname _win32_getservbyname -#define win32_getservbyport _win32_getservbyport -#define win32_select _win32_select -#define win32_endhostent _win32_endhostent -#define win32_endnetent _win32_endnetent -#define win32_endprotoent _win32_endprotoent -#define win32_endservent _win32_endservent -#define win32_getnetent _win32_getnetent -#define win32_getnetbyname _win32_getnetbyname -#define win32_getnetbyaddr _win32_getnetbyaddr -#define win32_getprotoent _win32_getprotoent -#define win32_getservent _win32_getservent -#define win32_sethostent _win32_sethostent -#define win32_setnetent _win32_setnetent -#define win32_setprotoent _win32_setprotoent -#define win32_setservent _win32_setservent - -int * _win32_errno(void); -FILE* _win32_stdin(void); -FILE* _win32_stdout(void); -FILE* _win32_stderr(void); -int _win32_ferror(FILE *fp); -int _win32_feof(FILE *fp); -char* _win32_strerror(int e); -void _win32_perror(const char *str); -int _win32_fprintf(FILE *pf, const char *format, ...); -int _win32_printf(const char *format, ...); -int _win32_vfprintf(FILE *pf, const char *format, va_list arg); -int _win32_vprintf(const char *format, va_list arg); -size_t _win32_fread(void *buf, size_t size, size_t count, FILE *pf); -size_t _win32_fwrite(const void *buf, size_t size, size_t count, FILE *pf); -FILE* _win32_fopen(const char *path, const char *mode); -FILE* _win32_fdopen(int fh, const char *mode); -FILE* _win32_freopen(const char *path, const char *mode, FILE *pf); -int _win32_fclose(FILE *pf); -int _win32_fputs(const char *s,FILE *pf); -int _win32_fputc(int c,FILE *pf); -int _win32_ungetc(int c,FILE *pf); -int _win32_getc(FILE *pf); -int _win32_fileno(FILE *pf); -void _win32_clearerr(FILE *pf); -int _win32_fflush(FILE *pf); -long _win32_ftell(FILE *pf); -int _win32_fseek(FILE *pf,long offset,int origin); -int _win32_fgetpos(FILE *pf,fpos_t *p); -int _win32_fsetpos(FILE *pf,const fpos_t *p); -void _win32_rewind(FILE *pf); -FILE* _win32_tmpfile(void); -void _win32_abort(void); -int _win32_fstat(int fd,struct stat *sbufptr); -int _win32_stat(const char *name,struct stat *sbufptr); -int _win32_pipe( int *phandles, unsigned int psize, int textmode ); -FILE* _win32_popen( const char *command, const char *mode ); -int _win32_pclose( FILE *pf); -int _win32_rename( const char *oldname, const char *newname); -int _win32_setmode( int fd, int mode); -long _win32_lseek( int fd, long offset, int origin); -long _win32_tell( int fd); -int _win32_dup( int fd); -int _win32_dup2(int h1, int h2); -int _win32_open(const char *path, int oflag,...); -int _win32_close(int fd); -int _win32_eof(int fd); -int _win32_read(int fd, void *buf, unsigned int cnt); -int _win32_write(int fd, const void *buf, unsigned int cnt); -int _win32_mkdir(const char *dir, int mode); -int _win32_rmdir(const char *dir); -int _win32_chdir(const char *dir); -void _win32_setbuf(FILE *pf, char *buf); -int _win32_setvbuf(FILE *pf, char *buf, int type, size_t size); -char* _win32_fgets(char *s, int n, FILE *pf); -char* _win32_gets(char *s); -int _win32_fgetc(FILE *pf); -int _win32_putc(int c, FILE *pf); -int _win32_puts(const char *s); -int _win32_getchar(void); -int _win32_putchar(int c); -void* _win32_malloc(size_t size); -void* _win32_calloc(size_t numitems, size_t size); -void* _win32_realloc(void *block, size_t size); -void _win32_free(void *block); -unsigned _win32_sleep(unsigned int); -int _win32_spawnvp(int mode, const char *cmdname, const char *const *argv); -int _win32_times(struct tms *timebuf); -int _win32_stat(const char *path, struct stat *buf); -int _win32_ioctl(int i, unsigned int u, char *data); -int _win32_utime(const char *f, struct utimbuf *t); -char* _win32_getenv(const char *name); -int _win32_open_osfhandle(long handle, int flags); -long _win32_get_osfhandle(int fd); - -u_long _win32_htonl (u_long hostlong); -u_short _win32_htons (u_short hostshort); -u_long _win32_ntohl (u_long netlong); -u_short _win32_ntohs (u_short netshort); -unsigned long _win32_inet_addr (const char * cp); -char * _win32_inet_ntoa (struct in_addr in); - -SOCKET _win32_socket (int af, int type, int protocol); -int _win32_bind (SOCKET s, const struct sockaddr *addr, int namelen); -int _win32_listen (SOCKET s, int backlog); -SOCKET _win32_accept (SOCKET s, struct sockaddr *addr, int *addrlen); -int _win32_connect (SOCKET s, const struct sockaddr *name, int namelen); -int _win32_send (SOCKET s, const char * buf, int len, int flags); -int _win32_sendto (SOCKET s, const char * buf, int len, int flags, - const struct sockaddr *to, int tolen); -int _win32_recv (SOCKET s, char * buf, int len, int flags); -int _win32_recvfrom (SOCKET s, char * buf, int len, int flags, - struct sockaddr *from, int * fromlen); -int _win32_shutdown (SOCKET s, int how); -int _win32_closesocket (SOCKET s); -int _win32_ioctlsocket (SOCKET s, long cmd, u_long *argp); -int _win32_setsockopt (SOCKET s, int level, int optname, - const char * optval, int optlen); -int _win32_getsockopt (SOCKET s, int level, int optname, char * optval, int *optlen); -int _win32_getpeername (SOCKET s, struct sockaddr *name, int * namelen); -int _win32_getsockname (SOCKET s, struct sockaddr *name, int * namelen); -int _win32_gethostname (char * name, int namelen); -struct hostent * _win32_gethostbyname(const char * name); -struct hostent * _win32_gethostbyaddr(const char * addr, int len, int type); -struct protoent * _win32_getprotobyname(const char * name); -struct protoent * _win32_getprotobynumber(int proto); -struct servent * _win32_getservbyname(const char * name, const char * proto); -struct servent * _win32_getservbyport(int port, const char * proto); -int _win32_select (int nfds, Perl_fd_set *rfds, Perl_fd_set *wfds, Perl_fd_set *xfds, - const struct timeval *timeout); -void _win32_endnetent(void); -void _win32_endhostent(void); -void _win32_endprotoent(void); -void _win32_endservent(void); -struct netent * _win32_getnetent(void); -struct netent * _win32_getnetbyname(char *name); -struct netent * _win32_getnetbyaddr(long net, int type); -struct protoent *_win32_getprotoent(void); -struct servent *_win32_getservent(void); -void _win32_sethostent(int stayopen); -void _win32_setnetent(int stayopen); -void _win32_setprotoent(int stayopen); -void _win32_setservent(int stayopen); - -END_EXTERN_C - -#pragma warning(once : 4113) -EOCODE - - -close HDRFILE; -close OUTFILE; diff --git a/gnu/usr.bin/perl/win32/Makefile b/gnu/usr.bin/perl/win32/Makefile index 6481d735cda..1531f727f00 100644 --- a/gnu/usr.bin/perl/win32/Makefile +++ b/gnu/usr.bin/perl/win32/Makefile @@ -2,7 +2,7 @@ # Makefile to build perl on Windows NT using Microsoft NMAKE.
#
# This is set up to build a perl.exe that runs off a shared library
-# (perl.dll). Also makes individual DLLs for the XS extensions.
+# (perl56.dll). Also makes individual DLLs for the XS extensions.
#
##
@@ -29,50 +29,81 @@ INST_TOP = $(INST_DRV)\perl # versioned installation can be obtained by setting INST_TOP above to a
# path that includes an arbitrary version string.
#
-INST_VER = \5.00503
+INST_VER = \5.6.0
#
-# uncomment to enable threads-capabilities
+# Comment this out if you DON'T want your perl installation to have
+# architecture specific components. This means that architecture-
+# specific files will be installed along with the architecture-neutral
+# files. Leaving it enabled is safer and more flexible, in case you
+# want to build multiple flavors of perl and install them together in
+# the same location. Commenting it out gives you a simpler
+# installation that is easier to understand for beginners.
#
-#USE_THREADS = define
+INST_ARCH = \$(ARCHNAME)
#
-# uncomment to enable multiple interpreters
+# uncomment to enable multiple interpreters. This is need for fork()
+# emulation.
#
#USE_MULTI = define
#
-# uncomment next line if you are using Visual C++ 2.x
+# Beginnings of interpreter cloning/threads; still very incomplete.
+# This should be enabled to get the fork() emulation. This needs
+# USE_MULTI as well.
#
-#CCTYPE = MSVC20
+#USE_ITHREADS = define
#
-# uncomment next line if you want to use the perl object
-# Currently, this cannot be enabled if you ask for threads above
+# uncomment to enable the implicit "host" layer for all system calls
+# made by perl. This needs USE_MULTI above. This is also needed to
+# get fork().
#
-#OBJECT = -DPERL_OBJECT
+#USE_IMP_SYS = define
#
-# uncomment next line if you want debug version of perl (big,slow)
+# WARNING! This option is deprecated and will eventually go away (enable
+# USE_ITHREADS instead).
#
-#CFG = Debug
+# uncomment to enable threads-capabilities. This is incompatible with
+# USE_ITHREADS, and is only here for people who may have come to rely
+# on the experimental Thread support that was in 5.005.
+#
+#USE_5005THREADS= define
+
+#
+# WARNING! This option is deprecated and will eventually go away (enable
+# USE_MULTI instead).
+#
+# uncomment next line if you want to use the PERL_OBJECT build option.
+# DO NOT ENABLE unless you have legacy code that relies on the C++
+# CPerlObj class that was available in 5.005. This cannot be enabled
+# if you ask for USE_5005THREADS above.
+#
+#USE_OBJECT = define
#
-# uncomment next option if you want to use the VC++ compiler optimization.
-# Warning: This is known to produce incorrect code for compiler versions
-# earlier than VC++ 98 (Visual Studio 6.0). VC++ 98 generates code that
-# successfully passes the Perl regression test suite. It hasn't yet been
-# widely tested with real applications though.
+# uncomment one of the following lines if you are using either
+# Visual C++ 2.x or Visual C++ 6.x (aka Visual Studio 98)
#
-#CFG = Optimize
+#CCTYPE = MSVC20
+#CCTYPE = MSVC60
+
+#
+# uncomment next line if you want debug version of perl (big,slow)
+#
+#CFG = Debug
#
# uncomment to enable use of PerlCRT.DLL when using the Visual C compiler.
-# Highly recommended. It has patches that fix known bugs in MSVCRT.DLL.
-# This currently requires VC 5.0 with Service Pack 3.
+# It has patches that fix known bugs in older versions of MSVCRT.DLL.
+# This currently requires VC 5.0 with Service Pack 3 or later.
# Get it from CPAN at http://www.perl.com/CPAN/authors/id/D/DO/DOUGL/
# and follow the directions in the package to install.
#
+# Not recommended if you have VC 6.x and you're not running Windows 9x.
+#
#USE_PERLCRT = define
#
@@ -103,7 +134,7 @@ INST_VER = \5.00503 # WARNING: Turning this on/off WILL break binary compatibility with extensions
# you may have compiled with/without it. Be prepared to recompile all
# extensions if you change the default. Currently, this cannot be enabled
-# if you ask for PERL_OBJECT above.
+# if you ask for USE_IMP_SYS above.
#
#PERL_MALLOC = define
@@ -120,6 +151,31 @@ CCINCDIR = $(CCHOME)\include CCLIBDIR = $(CCHOME)\lib
#
+# Additional compiler flags can be specified here.
+#
+
+#
+# This should normally be disabled. Adding -DPERL_POLLUTE enables support
+# for old symbols by default, at the expense of extreme pollution. You most
+# probably just want to build modules that won't compile with
+# perl Makefile.PL POLLUTE=1
+# instead of enabling this. Please report such modules to the respective
+# authors.
+#
+#BUILDOPT = $(BUILDOPT) -DPERL_POLLUTE
+
+#
+# This should normally be disabled. Enabling it will disable the File::Glob
+# implementation of CORE::glob.
+#
+#BUILDOPT = $(BUILDOPT) -DPERL_EXTERNAL_GLOB
+
+#
+# This should normally be disabled. Enabling it causes perl to read scripts
+# in text mode (which is the 5.005 behavior) and will break ByteLoader.
+#BUILDOPT = $(BUILDOPT) -DPERL_TEXTMODE_SCRIPTS
+
+#
# specify semicolon-separated list of extra directories that modules will
# look for libraries (spaces in path names need not be quoted)
#
@@ -129,7 +185,7 @@ EXTRALIBDIRS = # set this to your email address (perl will guess a value from
# from your loginname and your hostname, which may not be right)
#
-#EMAIL =
+#EMAIL =
##
## Build configuration ends.
@@ -144,108 +200,179 @@ D_CRYPT = define CRYPT_FLAG = -DHAVE_DES_FCRYPT
!ENDIF
-!IF "$(OBJECT)" != ""
+!IF "$(USE_OBJECT)" == "define"
PERL_MALLOC = undef
-USE_THREADS = undef
+USE_5005THREADS = undef
USE_MULTI = undef
+USE_IMP_SYS = define
!ENDIF
!IF "$(PERL_MALLOC)" == ""
PERL_MALLOC = undef
!ENDIF
-!IF "$(USE_THREADS)" == ""
-USE_THREADS = undef
+!IF "$(USE_5005THREADS)" == ""
+USE_5005THREADS = undef
+!ENDIF
+
+!IF "$(USE_5005THREADS)" == "define"
+USE_ITHREADS = undef
+!ENDIF
+
+!IF "$(USE_IMP_SYS)" == "define"
+PERL_MALLOC = undef
!ENDIF
!IF "$(USE_MULTI)" == ""
USE_MULTI = undef
!ENDIF
-#BUILDOPT = -DPERL_GLOBAL_STRUCT
-# -DUSE_PERLIO -D__STDC__=1 -DUSE_SFIO -DI_SFIO -I\sfio97\include
+!IF "$(USE_OBJECT)" == ""
+USE_OBJECT = undef
+!ENDIF
+
+!IF "$(USE_ITHREADS)" == ""
+USE_ITHREADS = undef
+!ENDIF
+
+!IF "$(USE_IMP_SYS)" == ""
+USE_IMP_SYS = undef
+!ENDIF
+
+!IF "$(USE_PERLCRT)" == ""
+USE_PERLCRT = undef
+!ENDIF
+
+!IF "$(USE_IMP_SYS)$(USE_MULTI)$(USE_5005THREADS)$(USE_OBJECT)" == "defineundefundefundef"
+USE_MULTI = define
+!ENDIF
+
+!IF "$(USE_ITHREADS)$(USE_MULTI)$(USE_OBJECT)" == "defineundefundef"
+USE_MULTI = define
+USE_5005THREADS = undef
+!ENDIF
+
+!IF "$(USE_MULTI)$(USE_5005THREADS)$(USE_OBJECT)" != "undefundefundef"
+BUILDOPT = $(BUILDOPT) -DPERL_IMPLICIT_CONTEXT
+!ENDIF
+
+!IF "$(USE_IMP_SYS)" != "undef"
+BUILDOPT = $(BUILDOPT) -DPERL_IMPLICIT_SYS
+!ENDIF
!IF "$(PROCESSOR_ARCHITECTURE)" == ""
PROCESSOR_ARCHITECTURE = x86
!ENDIF
-!IF "$(OBJECT)" != ""
+!IF "$(USE_OBJECT)" == "define"
ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-object
!ELSE
-!IF "$(USE_THREADS)" == "define"
+!IF "$(USE_5005THREADS)" == "define"
ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-thread
!ELSE
+!IF "$(USE_MULTI)" == "define"
+ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-multi
+!ELSE
ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)
!ENDIF
!ENDIF
+!ENDIF
+
+!IF "$(USE_ITHREADS)" == "define"
+ARCHNAME = $(ARCHNAME)-thread
+!ENDIF
+
+# Visual Studio 98 specific
+!IF "$(CCTYPE)" == "MSVC60"
+
+# VC 6.0 can load the socket dll on demand. Makes the test suite
+# run in about 10% less time.
+DELAYLOAD = -DELAYLOAD:wsock32.dll -DELAYLOAD:shell32.dll delayimp.lib
+
+# VC 6.0 seems capable of compiling perl correctly with optimizations
+# enabled. Anything earlier fails tests.
+!IF "$(CFG)" == ""
+CFG = Optimize
+!ENDIF
+!ENDIF
ARCHDIR = ..\lib\$(ARCHNAME)
COREDIR = ..\lib\CORE
AUTODIR = ..\lib\auto
+LIBDIR = ..\lib
+EXTDIR = ..\ext
+PODDIR = ..\pod
+EXTUTILSDIR = $(LIBDIR)\ExtUtils
+
+#
+INST_SCRIPT = $(INST_TOP)$(INST_VER)\bin
+INST_BIN = $(INST_SCRIPT)$(INST_ARCH)
+INST_LIB = $(INST_TOP)$(INST_VER)\lib
+INST_ARCHLIB = $(INST_LIB)$(INST_ARCH)
+INST_COREDIR = $(INST_ARCHLIB)\CORE
+INST_POD = $(INST_LIB)\pod
+INST_HTML = $(INST_POD)\html
#
# Programs to compile, build .lib files and link
#
-CC = cl.exe
-LINK32 = link.exe
+CC = cl
+LINK32 = link
LIB32 = $(LINK32) -lib
+RSC = rc
#
# Options
#
-RUNTIME = -MD
INCLUDES = -I$(COREDIR) -I.\include -I. -I..
#PCHFLAGS = -Fpc:\temp\vcmoduls.pch -YX
-DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT $(BUILDOPT) $(CRYPT_FLAG)
+DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT $(CRYPT_FLAG)
LOCDEFS = -DPERLDLL -DPERL_CORE
SUBSYS = console
CXX_FLAG = -TP -GX
-!IF "$(USE_PERLCRT)" == ""
-! IF "$(CFG)" == "Debug"
-PERLCRTLIBC = msvcrtd.lib
-! ELSE
-PERLCRTLIBC = msvcrt.lib
-! ENDIF
+!IF "$(USE_PERLCRT)" != "define"
+LIBC = msvcrt.lib
!ELSE
-! IF "$(CFG)" == "Debug"
-PERLCRTLIBC = PerlCRTD.lib
-! ELSE
-PERLCRTLIBC = PerlCRT.lib
-! ENDIF
+LIBC = PerlCRT.lib
!ENDIF
-!IF "$(RUNTIME)" == "-MD"
-LIBC = $(PERLCRTLIBC)
-!ELSE
-LIBC = libcmt.lib
-!ENDIF
+PERLEXE_RES =
+PERLDLL_RES =
!IF "$(CFG)" == "Debug"
! IF "$(CCTYPE)" == "MSVC20"
-OPTIMIZE = -Od $(RUNTIME) -Z7 -D_DEBUG -DDEBUGGING
+OPTIMIZE = -Od -MD -Z7 -DDEBUGGING
! ELSE
-OPTIMIZE = -Od $(RUNTIME)d -Zi -D_DEBUG -DDEBUGGING
+OPTIMIZE = -Od -MD -Zi -DDEBUGGING
! ENDIF
LINK_DBG = -debug -pdb:none
!ELSE
! IF "$(CFG)" == "Optimize"
-OPTIMIZE = -O2 $(RUNTIME) -DNDEBUG
+# -O1 yields smaller code, which turns out to be faster than -O2
+#OPTIMIZE = -O2 -MD -DNDEBUG
+OPTIMIZE = -O1 -MD -DNDEBUG
! ELSE
-OPTIMIZE = -Od $(RUNTIME) -DNDEBUG
+OPTIMIZE = -Od -MD -DNDEBUG
! ENDIF
LINK_DBG = -release
!ENDIF
-!IF "$(OBJECT)" != ""
+!IF "$(USE_OBJECT)" == "define"
OPTIMIZE = $(OPTIMIZE) $(CXX_FLAG)
+BUILDOPT = $(BUILDOPT) -DPERL_OBJECT
!ENDIF
-LIBBASEFILES = $(CRYPT_LIB) oldnames.lib kernel32.lib user32.lib gdi32.lib \
- winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib \
- oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \
+!IF "$(USE_PERLCRT)" != "define"
+BUILDOPT = $(BUILDOPT) -DPERL_MSVCRT_READFIX
+!ENDIF
+
+LIBBASEFILES = $(CRYPT_LIB) \
+ oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
+ comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
+ netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \
version.lib odbc32.lib odbccp32.lib
# we add LIBC here, since we may be using PerlCRT.dll
@@ -253,11 +380,13 @@ LIBFILES = $(LIBBASEFILES) $(LIBC) CFLAGS = -nologo -Gf -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) \
$(PCHFLAGS) $(OPTIMIZE)
-LINK_FLAGS = -nologo -nodefaultlib $(LINK_DBG) -machine:$(PROCESSOR_ARCHITECTURE)
+LINK_FLAGS = -nologo -nodefaultlib $(LINK_DBG) \
+ -libpath:"$(INST_COREDIR)" \
+ -machine:$(PROCESSOR_ARCHITECTURE)
OBJOUT_FLAG = -Fo
EXEOUT_FLAG = -Fe
-CFLAGS_O = $(CFLAGS) $(OBJECT)
+CFLAGS_O = $(CFLAGS) $(BUILDOPT)
#################### do not edit below this line #######################
############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ##############
@@ -268,7 +397,7 @@ o = .obj # Rules
#
-.SUFFIXES : .c $(o) .dll .lib .exe
+.SUFFIXES : .c $(o) .dll .lib .exe .rc .res
.c$(o):
$(CC) -c -I$(<D) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $<
@@ -280,32 +409,18 @@ $(o).dll: $(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \
-out:$@ $(LINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
-#
-INST_BIN = $(INST_TOP)$(INST_VER)\bin\$(ARCHNAME)
-INST_SCRIPT = $(INST_TOP)$(INST_VER)\bin
-INST_LIB = $(INST_TOP)$(INST_VER)\lib
-INST_POD = $(INST_LIB)\pod
-INST_HTML = $(INST_POD)\html
-LIBDIR = ..\lib
-EXTDIR = ..\ext
-PODDIR = ..\pod
-EXTUTILSDIR = $(LIBDIR)\extutils
+.rc.res:
+ $(RSC) -i.. $<
#
# various targets
-!IF "$(OBJECT)" == "-DPERL_OBJECT"
-PERLIMPLIB = ..\perlcore.lib
-PERLDLL = ..\perlcore.dll
-CAPILIB = $(COREDIR)\perlCAPI.lib
-!ELSE
-PERLIMPLIB = ..\perl.lib
-PERLDLL = ..\perl.dll
-CAPILIB =
-!ENDIF
+PERLIMPLIB = ..\perl56.lib
+PERLDLL = ..\perl56.dll
MINIPERL = ..\miniperl.exe
MINIDIR = .\mini
PERLEXE = ..\perl.exe
+WPERLEXE = ..\wperl.exe
GLOBEXE = ..\perlglob.exe
CONFIGPM = ..\lib\Config.pm
MINIMOD = ..\lib\ExtUtils\Miniperl.pm
@@ -317,21 +432,24 @@ GLOBBAT = bin\perlglob.bat UTILS = \
..\utils\h2ph \
..\utils\splain \
+ ..\utils\dprofpp \
..\utils\perlbug \
..\utils\pl2pm \
..\utils\c2ph \
..\utils\h2xs \
..\utils\perldoc \
- ..\utils\pstruct \
..\utils\perlcc \
..\pod\checkpods \
..\pod\pod2html \
..\pod\pod2latex \
..\pod\pod2man \
..\pod\pod2text \
+ ..\pod\pod2usage \
+ ..\pod\podchecker \
+ ..\pod\podselect \
..\x2p\find2perl \
..\x2p\s2p \
- bin\www.pl \
+ bin\exetype.pl \
bin\runperl.pl \
bin\pl2bat.pl \
bin\perlglob.pl \
@@ -342,10 +460,6 @@ MAKE = nmake -nologo CFGSH_TMPL = config.vc
CFGH_TMPL = config_H.vc
-!IF "$(USE_PERLCRT)" == ""
-PERL95EXE = ..\perl95.exe
-!ENDIF
-
XCOPY = xcopy /f /r /i /d
RCOPY = xcopy /f /r /i /e /d
NOOP = @echo
@@ -359,7 +473,6 @@ XSUBPP = ..\$(MINIPERL) -I..\..\lib ..\$(EXTUTILSDIR)\xsubpp \ MICROCORE_SRC = \
..\av.c \
- ..\byterun.c \
..\deb.c \
..\doio.c \
..\doop.c \
@@ -370,6 +483,7 @@ MICROCORE_SRC = \ ..\mg.c \
..\op.c \
..\perl.c \
+ ..\perlapi.c \
..\perly.c \
..\pp.c \
..\pp_ctl.c \
@@ -383,44 +497,31 @@ MICROCORE_SRC = \ ..\taint.c \
..\toke.c \
..\universal.c \
- ..\util.c
+ ..\utf8.c \
+ ..\util.c \
+ ..\xsutils.c
+
+EXTRACORE_SRC = $(EXTRACORE_SRC) perllib.c
!IF "$(PERL_MALLOC)" == "define"
EXTRACORE_SRC = $(EXTRACORE_SRC) ..\malloc.c
!ENDIF
-!IF "$(OBJECT)" == ""
+!IF "$(USE_OBJECT)" != "define"
EXTRACORE_SRC = $(EXTRACORE_SRC) ..\perlio.c
!ENDIF
WIN32_SRC = \
.\win32.c \
- .\win32sck.c
-
-!IF "$(USE_THREADS)" == "define"
-WIN32_SRC = $(WIN32_SRC) .\win32thread.c
-!ENDIF
+ .\win32sck.c \
+ .\win32thread.c
!IF "$(CRYPT_SRC)" != ""
WIN32_SRC = $(WIN32_SRC) .\$(CRYPT_SRC)
!ENDIF
-PERL95_SRC = \
- perl95.c \
- win32mt.c \
- win32sckmt.c
-
-!IF "$(CRYPT_SRC)" != ""
-PERL95_SRC = $(PERL95_SRC) .\$(CRYPT_SRC)
-!ENDIF
-
DLL_SRC = $(DYNALOADER).c
-
-!IF "$(OBJECT)" == ""
-DLL_SRC = $(DLL_SRC) perllib.c
-!ENDIF
-
X2P_SRC = \
..\x2p\a2p.c \
..\x2p\hash.c \
@@ -430,8 +531,6 @@ X2P_SRC = \ CORE_NOCFG_H = \
..\av.h \
- ..\byterun.h \
- ..\bytecode.h \
..\cop.h \
..\cv.h \
..\dosish.h \
@@ -446,6 +545,7 @@ CORE_NOCFG_H = \ ..\op.h \
..\opcode.h \
..\perl.h \
+ ..\perlapi.h \
..\perlsdio.h \
..\perlsfio.h \
..\perly.h \
@@ -456,7 +556,9 @@ CORE_NOCFG_H = \ ..\sv.h \
..\thread.h \
..\unixish.h \
+ ..\utf8.h \
..\util.h \
+ ..\warnings.h \
..\XSUB.h \
..\EXTERN.h \
..\perlvars.h \
@@ -477,26 +579,22 @@ MINICORE_OBJ = $(MICROCORE_OBJ:..\=.\mini\) \ $(MINIDIR)\perlio$(o)
MINIWIN32_OBJ = $(WIN32_OBJ:.\=.\mini\)
MINI_OBJ = $(MINICORE_OBJ) $(MINIWIN32_OBJ)
-PERL95_OBJ = $(PERL95_SRC:.c=.obj)
DLL_OBJ = $(DLL_SRC:.c=.obj)
X2P_OBJ = $(X2P_SRC:.c=.obj)
PERLDLL_OBJ = $(CORE_OBJ)
PERLEXE_OBJ = perlmain$(o)
-!IF "$(OBJECT)" == ""
PERLDLL_OBJ = $(PERLDLL_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
-!ELSE
-PERLEXE_OBJ = $(PERLEXE_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
-PERL95_OBJ = $(PERL95_OBJ) DynaLoadmt$(o)
-!ENDIF
+#PERLEXE_OBJ = $(PERLEXE_OBJ) $(WIN32_OBJ) $(DLL_OBJ)
!IF "$(USE_SETARGV)" != ""
SETARGV_OBJ = setargv$(o)
!ENDIF
DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \
- Data/Dumper
+ Data/Dumper Devel/Peek ByteLoader Devel/DProf File/Glob \
+ Sys/Hostname
STATIC_EXT = DynaLoader
NONXS_EXT = Errno
@@ -513,6 +611,11 @@ B = $(EXTDIR)\B\B RE = $(EXTDIR)\re\re
DUMPER = $(EXTDIR)\Data\Dumper\Dumper
ERRNO = $(EXTDIR)\Errno\Errno
+PEEK = $(EXTDIR)\Devel\Peek\Peek
+BYTELOADER = $(EXTDIR)\ByteLoader\ByteLoader
+DPROF = $(EXTDIR)\Devel\DProf\DProf
+GLOB = $(EXTDIR)\File\Glob\Glob
+HOSTNAME = $(EXTDIR)\Sys\Hostname\Hostname
SOCKET_DLL = $(AUTODIR)\Socket\Socket.dll
FCNTL_DLL = $(AUTODIR)\Fcntl\Fcntl.dll
@@ -524,7 +627,12 @@ ATTRS_DLL = $(AUTODIR)\attrs\attrs.dll THREAD_DLL = $(AUTODIR)\Thread\Thread.dll
B_DLL = $(AUTODIR)\B\B.dll
DUMPER_DLL = $(AUTODIR)\Data\Dumper\Dumper.dll
+PEEK_DLL = $(AUTODIR)\Devel\Peek\Peek.dll
RE_DLL = $(AUTODIR)\re\re.dll
+BYTELOADER_DLL = $(AUTODIR)\ByteLoader\ByteLoader.dll
+DPROF_DLL = $(AUTODIR)\Devel\DProf\DProf.dll
+GLOB_DLL = $(AUTODIR)\File\Glob\Glob.dll
+HOSTNAME_DLL = $(AUTODIR)\Sys\Hostname\Hostname.dll
ERRNO_PM = $(LIBDIR)\Errno.pm
@@ -539,7 +647,12 @@ EXTENSION_C = \ $(THREAD).c \
$(RE).c \
$(DUMPER).c \
- $(B).c
+ $(PEEK).c \
+ $(B).c \
+ $(BYTELOADER).c \
+ $(DPROF).c \
+ $(GLOB).c \
+ $(HOSTNAME).c
EXTENSION_DLL = \
$(SOCKET_DLL) \
@@ -550,18 +663,18 @@ EXTENSION_DLL = \ $(POSIX_DLL) \
$(ATTRS_DLL) \
$(DUMPER_DLL) \
- $(B_DLL)
+ $(PEEK_DLL) \
+ $(B_DLL) \
+ $(RE_DLL) \
+ $(THREAD_DLL) \
+ $(BYTELOADER_DLL) \
+ $(DPROF_DLL) \
+ $(GLOB_DLL) \
+ $(HOSTNAME_DLL)
EXTENSION_PM = \
$(ERRNO_PM)
-!IF "$(OBJECT)" == ""
-EXTENSION_DLL = \
- $(EXTENSION_DLL)\
- $(THREAD_DLL) \
- $(RE_DLL)
-!ENDIF
-
POD2HTML = $(PODDIR)\pod2html
POD2MAN = $(PODDIR)\pod2man
POD2LATEX = $(PODDIR)\pod2latex
@@ -571,9 +684,10 @@ CFG_VARS = \ "INST_DRV=$(INST_DRV)" \
"INST_TOP=$(INST_TOP)" \
"INST_VER=$(INST_VER)" \
+ "INST_ARCH=$(INST_ARCH)" \
"archname=$(ARCHNAME)" \
"cc=$(CC)" \
- "ccflags=$(OPTIMIZE:"=\") $(DEFINES) $(OBJECT)" \
+ "ccflags=$(OPTIMIZE:"=\") $(DEFINES) $(BUILDOPT)" \
"cf_email=$(EMAIL)" \
"d_crypt=$(D_CRYPT)" \
"d_mymalloc=$(PERL_MALLOC)" \
@@ -586,7 +700,9 @@ CFG_VARS = \ "static_ext=$(STATIC_EXT)" \
"dynamic_ext=$(DYNAMIC_EXT)" \
"nonxs_ext=$(NONXS_EXT)" \
- "usethreads=$(USE_THREADS)" \
+ "use5005threads=$(USE_5005THREADS)" \
+ "useithreads=$(USE_ITHREADS)" \
+ "usethreads=$(USE_5005THREADS)" \
"usemultiplicity=$(USE_MULTI)" \
"LINK_FLAGS=$(LINK_FLAGS:"=\")" \
"optimize=$(OPTIMIZE:"=\")"
@@ -595,8 +711,8 @@ CFG_VARS = \ # Top targets
#
-all : .\config.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) $(PERL95EXE) \
- $(CAPILIB) $(X2P) $(EXTENSION_DLL) $(EXTENSION_PM)
+all : .\config.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) \
+ $(X2P) $(EXTENSION_DLL) $(EXTENSION_PM)
$(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
@@ -651,11 +767,18 @@ $(MINIDIR) : if not exist "$(MINIDIR)" mkdir "$(MINIDIR)"
$(MINICORE_OBJ) : $(CORE_NOCFG_H)
- $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ ..\$(*F).c
+ $(CC) -c $(CFLAGS) -DPERL_EXTERNAL_GLOB $(OBJOUT_FLAG)$@ ..\$(*F).c
$(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
$(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ $(*F).c
+# -DPERL_IMPLICIT_SYS needs C++ for perllib.c
+# This is the only file that depends on perlhost.h, vmem.h, and vdir.h
+!IF "$(USE_IMP_SYS)$(USE_OBJECT)" == "defineundef"
+perllib$(o) : perllib.c .\perlhost.h .\vdir.h .\vmem.h
+ $(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c
+!ENDIF
+
# 1. we don't want to rebuild miniperl.exe when config.h changes
# 2. we don't want to rebuild miniperl.exe with non-default config.h
$(MINI_OBJ) : $(CORE_NOCFG_H)
@@ -663,22 +786,18 @@ $(MINI_OBJ) : $(CORE_NOCFG_H) $(WIN32_OBJ) : $(CORE_H)
$(CORE_OBJ) : $(CORE_H)
$(DLL_OBJ) : $(CORE_H)
-$(PERL95_OBJ) : $(CORE_H)
$(X2P_OBJ) : $(CORE_H)
-perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym makedef.pl
- $(MINIPERL) -w makedef.pl $(OPTIMIZE) $(DEFINES) $(OBJECT) \
+perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl
+ $(MINIPERL) -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) $(BUILDOPT) \
CCTYPE=$(CCTYPE) > perldll.def
-$(PERLDLL): perldll.def $(PERLDLL_OBJ)
- $(LINK32) -dll -def:perldll.def -out:$@ @<<
- $(LINK_FLAGS) $(LIBFILES) $(PERLDLL_OBJ)
+$(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES)
+ $(LINK32) -dll -def:perldll.def -base:0x28000000 -out:$@ @<<
+ $(LINK_FLAGS) $(DELAYLOAD) $(LIBFILES) $(PERLDLL_OBJ) $(PERLDLL_RES)
<<
$(XCOPY) $(PERLIMPLIB) $(COREDIR)
-perl.def : $(MINIPERL) makeperldef.pl
- $(MINIPERL) -I..\lib makeperldef.pl $(NULL) > perl.def
-
$(MINIMOD) : $(MINIPERL) ..\minimod.pl
cd .. && miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
@@ -710,61 +829,26 @@ perlmain.c : runperl.c perlmain$(o) : perlmain.c
$(CC) $(CFLAGS_O) -UPERLDLL $(OBJOUT_FLAG)$@ -c perlmain.c
-$(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ)
- $(LINK32) -subsystem:console -out:$@ $(LINK_FLAGS) $(LIBFILES) \
- $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB)
+$(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES)
+ $(LINK32) -subsystem:console -out:$@ -stack:0x8000000 $(LINK_FLAGS) \
+ $(LIBFILES) $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES)
+ copy $(PERLEXE) $(WPERLEXE)
+ $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS
copy splittree.pl ..
$(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
-!IF "$(USE_PERLCRT)" == ""
-
-perl95.c : runperl.c
- copy runperl.c perl95.c
-
-perl95$(o) : perl95.c
- $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c perl95.c
-
-win32sckmt$(o) : win32sck.c
- $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
- $(OBJOUT_FLAG)win32sckmt$(o) win32sck.c
-
-win32mt$(o) : win32.c
- $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
- $(OBJOUT_FLAG)win32mt$(o) win32.c
-
-DynaLoadmt$(o) : $(DYNALOADER).c
- $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
- $(OBJOUT_FLAG)DynaLoadmt$(o) $(DYNALOADER).c
-
-$(PERL95EXE): $(PERLDLL) $(CONFIGPM) $(PERL95_OBJ)
- $(LINK32) -subsystem:console -nodefaultlib -out:$@ $(LINK_FLAGS) \
- $(LIBBASEFILES) $(PERL95_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) \
- libcmt.lib
-
-!ENDIF
-
$(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
if not exist $(AUTODIR) mkdir $(AUTODIR)
cd $(EXTDIR)\$(*B)
..\$(MINIPERL) -I..\..\lib $(*B)_pm.PL
+ ..\$(MINIPERL) -I..\..\lib XSLoader_pm.PL
cd ..\..\win32
$(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
+ $(XCOPY) $(EXTDIR)\$(*B)\XSLoader.pm $(LIBDIR)\$(NULL)
cd $(EXTDIR)\$(*B)
$(XSUBPP) dl_win32.xs > $(*B).c
cd ..\..\win32
-!IF "$(OBJECT)" == "-DPERL_OBJECT"
-perlCAPI.cpp : $(MINIPERL)
- $(MINIPERL) GenCAPI.pl $(COREDIR)
-
-perlCAPI$(o) : perlCAPI.cpp
- $(CC) $(CFLAGS_O) $(RUNTIME) -UPERLDLL -c \
- $(OBJOUT_FLAG)perlCAPI$(o) perlCAPI.cpp
-
-$(CAPILIB) : perlCAPI.cpp perlCAPI$(o)
- lib /OUT:$(CAPILIB) perlCAPI$(o)
-!ENDIF
-
$(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
@@ -774,6 +858,24 @@ $(DUMPER_DLL): $(PERLEXE) $(DUMPER).xs $(MAKE)
cd ..\..\..\win32
+$(DPROF_DLL): $(PERLEXE) $(DPROF).xs
+ cd $(EXTDIR)\Devel\$(*B)
+ ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\..\win32
+
+$(GLOB_DLL): $(PERLEXE) $(GLOB).xs
+ cd $(EXTDIR)\File\$(*B)
+ ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\..\win32
+
+$(PEEK_DLL): $(PERLEXE) $(PEEK).xs
+ cd $(EXTDIR)\Devel\$(*B)
+ ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\..\win32
+
$(RE_DLL): $(PERLEXE) $(RE).xs
cd $(EXTDIR)\$(*B)
..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
@@ -834,6 +936,18 @@ $(SOCKET_DLL): $(PERLEXE) $(SOCKET).xs $(MAKE)
cd ..\..\win32
+$(HOSTNAME_DLL): $(PERLEXE) $(HOSTNAME).xs
+ cd $(EXTDIR)\Sys\$(*B)
+ ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\..\win32
+
+$(BYTELOADER_DLL): $(PERLEXE) $(BYTELOADER).xs
+ cd $(EXTDIR)\$(*B)
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ $(MAKE)
+ cd ..\..\win32
+
$(ERRNO_PM): $(PERLEXE) $(ERRNO)_pm.PL
cd $(EXTDIR)\$(*B)
..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
@@ -849,24 +963,34 @@ utils: $(PERLEXE) $(X2P) cd ..\utils
$(MAKE) PERL=$(MINIPERL)
cd ..\pod
+ copy ..\README.amiga .\perlamiga.pod
+ copy ..\README.cygwin .\perlcygwin.pod
+ copy ..\README.dos .\perldos.pod
+ copy ..\README.hpux .\perlhpux.pod
+ copy ..\README.machten .\perlmachten.pod
+ copy ..\README.os2 .\perlos2.pod
+ copy ..\vms\perlvms.pod .\perlvms.pod
copy ..\README.win32 .\perlwin32.pod
$(MAKE) -f ..\win32\pod.mak converters
cd ..\win32
$(PERLEXE) $(PL2BAT) $(UTILS)
distclean: clean
- -del /f $(MINIPERL) $(PERLEXE) $(PERL95EXE) $(PERLDLL) $(GLOBEXE) \
+ -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \
$(PERLIMPLIB) ..\miniperl.lib $(MINIMOD)
-del /f *.def *.map
-del /f $(EXTENSION_DLL) $(EXTENSION_PM)
-del /f $(EXTENSION_C) $(DYNALOADER).c $(ERRNO).pm
-del /f $(EXTDIR)\DynaLoader\dl_win32.xs
-del /f $(LIBDIR)\.exists $(LIBDIR)\attrs.pm $(LIBDIR)\DynaLoader.pm
+ -del /f $(LIBDIR)\XSLoader.pm
-del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
-del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm $(LIBDIR)\Thread.pm
-del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
-del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
- -del /f $(LIBDIR)\Data\Dumper.pm
+ -del /f $(LIBDIR)\Data\Dumper.pm $(LIBDIR)\ByteLoader.pm
+ -del /f $(LIBDIR)\Devel\Peek.pm $(LIBDIR)\Devel\DProf.pm
+ -del /f $(LIBDIR)\File\Glob.pm
-rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO
-rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread
-rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B
@@ -874,7 +998,7 @@ distclean: clean -del /f $(PODDIR)\*.html
-del /f $(PODDIR)\*.bat
cd ..\utils
- -del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc pstruct
+ -del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc dprofpp
-del /f *.bat
cd ..\win32
cd ..\x2p
@@ -883,7 +1007,6 @@ distclean: clean cd ..\win32
-del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
-del /f $(CONFIGPM)
- -del /f perl95.c
-del /f bin\*.bat
cd $(EXTDIR)
-del /s *.lib *.def *.map *.pdb *.bs Makefile *$(o) pm_to_blib
@@ -895,12 +1018,9 @@ install : all installbare installhtml installbare : utils
$(PERLEXE) ..\installperl
-!IF "$(USE_PERLCRT)" == ""
- $(XCOPY) $(PERL95EXE) $(INST_BIN)\*.*
-!ENDIF
+ if exist $(WPERLEXE) $(XCOPY) $(WPERLEXE) $(INST_BIN)\*.*
$(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
$(XCOPY) bin\*.bat $(INST_SCRIPT)\*.*
- $(XCOPY) bin\network.pl $(INST_LIB)\*.*
installhtml : doc
$(RCOPY) html\*.* $(INST_HTML)\*.*
@@ -935,6 +1055,19 @@ test-notty : test-prep $(PERLEXE) -I..\lib harness
cd ..\win32
+test-wide : test-prep
+ set HARNESS_PERL_SWITCHES=-C
+ cd ..\t
+ $(PERLEXE) -I..\lib harness
+ cd ..\win32
+
+test-wide-notty : test-prep
+ set PERL_SKIP_TTY_TEST=1
+ set HARNESS_PERL_SWITCHES=-C
+ cd ..\t
+ $(PERLEXE) -I..\lib harness
+ cd ..\win32
+
clean :
-@erase miniperlmain$(o)
-@erase $(MINIPERL)
@@ -942,17 +1075,16 @@ clean : -@erase perlmain$(o)
-@erase config.w32
-@erase /f config.h
- -@erase perlCAPI.cpp
-@erase $(GLOBEXE)
-@erase $(PERLEXE)
+ -@erase $(WPERLEXE)
-@erase $(PERLDLL)
-@erase $(CORE_OBJ)
- -@erase $(CAPILIB)
-rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR)
-@erase $(WIN32_OBJ)
-@erase $(DLL_OBJ)
-@erase $(X2P_OBJ)
- -@erase ..\*$(o) ..\*.lib ..\*.exp ..\*.res *$(o) *.lib *.exp *.res
+ -@erase ..\*$(o) ..\*.lib ..\*.exp *$(o) *.lib *.exp *.res
-@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
-@erase ..\x2p\*.exe ..\x2p\*.bat
-@erase *.ilk
diff --git a/gnu/usr.bin/perl/win32/TEST b/gnu/usr.bin/perl/win32/TEST deleted file mode 100644 index 1bda4ef7930..00000000000 --- a/gnu/usr.bin/perl/win32/TEST +++ /dev/null @@ -1,149 +0,0 @@ -#!./perl - -# Last change: Fri Jan 10 09:57:03 WET 1997 - -# This is written in a peculiar style, since we're trying to avoid -# most of the constructs we'll be testing for. - -$| = 1; - -if ($ARGV[0] eq '-v') { - $verbose = 1; - shift; -} - -chdir 't' if -f 't/TEST'; - -die "You need to run \"make test\" first to set things up.\n" - unless -e 'perl' or -e 'perl.exe'; - -$ENV{EMXSHELL} = 'sh'; # For OS/2 - -if ($ARGV[0] eq '') { - push( @ARGV, `dir/s/b base` ); - push( @ARGV, `dir/s/b comp` ); - push( @ARGV, `dir/s/b cmd` ); - push( @ARGV, `dir/s/b io` ); - push( @ARGV, `dir/s/b op` ); - push( @ARGV, `dir/s/b pragma` ); - push( @ARGV, `dir/s/b lib` ); - - grep( chomp, @ARGV ); - @ARGV = grep( /\.t$/, @ARGV ); - grep( s/.*t\\//, @ARGV ); -# @ARGV = split(/[ \n]/, -# `echo base/*.t comp/*.t cmd/*.t io/*.t; echo op/*.t pragma/*.t lib/*.t`); -} else { - -@ARGV = map(glob($_),@ARGV); - -} - -if ($^O eq 'os2' || $^O eq 'MSWin32' || $^O eq 'qnx' || 1) { - $sharpbang = 0; -} -else { - open(CONFIG, "../config.sh"); - while (<CONFIG>) { - if (/sharpbang='(.*)'/) { - $sharpbang = ($1 eq '#!'); - last; - } - } - close(CONFIG); -} - -$bad = 0; -$good = 0; -$total = @ARGV; -while ($test = shift) { - if ($test =~ /^$/) { - next; - } - $te = $test; - chop($te); - print "$te" . '.' x (18 - length($te)); - if ($sharpbang) { - open(results,"./$test |") || (print "can't run.\n"); - } else { - open(script,"$test") || die "Can't run $test.\n"; - $_ = <script>; - close(script); - if (/#!..perl(.*)/) { - $switch = $1; - if ($^O eq 'VMS') { - # Must protect uppercase switches with "" on command line - $switch =~ s/-([A-Z]\S*)/"-$1"/g; - } - } else { - $switch = ''; - } - open(results,"perl$switch $test |") || (print "can't run.\n"); - } - $ok = 0; - $next = 0; - while (<results>) { - if (/^$/) { next;}; - if ($verbose) { - print $_; - } - unless (/^#/) { - if (/^1\.\.([0-9]+)/) { - $max = $1; - $totmax += $max; - $files += 1; - $next = 1; - $ok = 1; - } else { - $next = $1, $ok = 0, last if /^not ok ([0-9]*)/; - if (/^ok (.*)/ && $1 == $next) { - $next = $next + 1; - } else { - $ok = 0; - } - } - } - } - $next = $next - 1; - if ($ok && $next == $max) { - if ($max) { - print "ok\n"; - $good = $good + 1; - } else { - print "skipping test on this platform\n"; - $files -= 1; - } - } else { - $next += 1; - print "FAILED on test $next\n"; - $bad = $bad + 1; - $_ = $test; - if (/^base/) { - die "Failed a basic test--cannot continue.\n"; - } - } -} - -if ($bad == 0) { - if ($ok) { - print "All tests successful.\n"; - } else { - die "FAILED--no tests were run for some reason.\n"; - } -} else { - $pct = sprintf("%.2f", $good / $total * 100); - if ($bad == 1) { - warn "Failed 1 test script out of $total, $pct% okay.\n"; - } else { - warn "Failed $bad test scripts out of $total, $pct% okay.\n"; - } - warn <<'SHRDLU'; - ### Since not all tests were successful, you may want to run some - ### of them individually and examine any diagnostic messages they - ### produce. See the INSTALL document's section on "make test". -SHRDLU -} -($user,$sys,$cuser,$csys) = times; -print sprintf("u=%g s=%g cu=%g cs=%g scripts=%d tests=%d\n", - $user,$sys,$cuser,$csys,$files,$totmax); -exit $bad != 0; diff --git a/gnu/usr.bin/perl/win32/autosplit.pl b/gnu/usr.bin/perl/win32/autosplit.pl deleted file mode 100644 index 26ce2c358ce..00000000000 --- a/gnu/usr.bin/perl/win32/autosplit.pl +++ /dev/null @@ -1,3 +0,0 @@ -use AutoSplit; - -autosplit($ARGV[0], $ARGV[1], 0, 1, 1); diff --git a/gnu/usr.bin/perl/win32/bin/network.pl b/gnu/usr.bin/perl/win32/bin/network.pl deleted file mode 100644 index f49045333d9..00000000000 --- a/gnu/usr.bin/perl/win32/bin/network.pl +++ /dev/null @@ -1,211 +0,0 @@ -## -## Jeffrey Friedl (jfriedl@omron.co.jp) -## Copyri.... ah hell, just take it. -## -## July 1994 -## -package network; -$version = "950311.5"; - -## version 950311.5 -- turned off warnings when requiring 'socket.ph'; -## version 941028.4 -- some changes to quiet perl5 warnings. -## version 940826.3 -- added check for "socket.ph", and alternate use of -## socket STREAM value for SunOS5.x -## - -## BLURB: -## A few simple and easy-to-use routines to make internet connections. -## Similar to "chat2.pl" (but actually commented, and a bit more portable). -## Should work even on SunOS5.x. -## - -##> -## -## connect_to() -- make an internet connection to a server. -## -## Two uses: -## $error = &network'connect_to(*FILEHANDLE, $fromsockaddr, $tosockaddr) -## $error = &network'connect_to(*FILEHANDLE, $hostname, $portnum) -## -## Makes the given connection and returns an error string, or undef if -## no error. -## -## In the first form, FROMSOCKADDR and TOSOCKADDR are of the form returned -## by SOCKET'GET_ADDR and SOCKET'MY_ADDR. -## -##< -sub connect_to -{ - local(*FD, $arg1, $arg2) = @_; - local($from, $to) = ($arg1, $arg2); ## for one interpretation. - local($host, $port) = ($arg1, $arg2); ## for the other - - if (defined($to) && length($from)==16 && length($to)==16) { - ## ok just as is - } elsif (defined($host)) { - $to = &get_addr($host, $port); - return qq/unknown address "$host"/ unless defined $to; - $from = &my_addr; - } else { - return "unknown arguments to network'connect_to"; - } - - return "connect_to failed (socket: $!)" unless &my_inet_socket(*FD); - return "connect_to failed (bind: $!)" unless bind(FD, $from); - return "connect_to failed (connect: $!)" unless connect(FD, $to); - local($old) = select(FD); $| = 1; select($old); - undef; -} - - - -##> -## -## listen_at() - used by a server to indicate that it will accept requests -## at the port number given. -## -## Used as -## $error = &network'listen_at(*LISTEN, $portnumber); -## (returns undef upon success) -## -## You can then do something like -## $addr = accept(REMOTE, LISTEN); -## print "contact from ", &network'addr_to_ascii($addr), ".\n"; -## while (<REMOTE>) { -## .... process request.... -## } -## close(REMOTE); -## -##< -sub listen_at -{ - local(*FD, $port) = @_; - local($empty) = pack('S n a4 x8', 2 ,$port, "\0\0\0\0"); - return "listen_for failed (socket: $!)" unless &my_inet_socket(*FD); - return "listen_for failed (bind: $!)" unless bind(FD, $empty); - return "listen_for failed (listen: $!)" unless listen(FD, 5); - local($old) = select(FD); $| = 1; select($old); - undef; -} - - -##> -## -## Given an internal packed internet address (as returned by &connect_to -## or &get_addr), return a printable ``1.2.3.4'' version. -## -##< -sub addr_to_ascii -{ - local($addr) = @_; - return "bad arg" if length $addr != 16; - return join('.', unpack("CCCC", (unpack('S n a4 x8', $addr))[2])); -} - -## -## -## Given a host and a port name, returns the packed socket addresss. -## Mostly for internal use. -## -## -sub get_addr -{ - local($host, $port) = @_; - return $addr{$host,$port} if defined $addr{$host,$port}; - local($addr); - - if ($host =~ m/^\d+\.\d+\.\d+\.\d+$/) - { - $addr = pack("C4", split(/\./, $host)); - } - elsif ($addr = (gethostbyname($host))[4], !defined $addr) - { - local(@lookup) = `nslookup $host 2>&1`; - if (@lookup) - { - local($lookup) = join('', @lookup[2 .. $#lookup]); - if ($lookup =~ m/^Address:\s*(\d+\.\d+\.\d+\.\d+)/) { - $addr = pack("C4", split(/\./, $1)); - } - } - if (!defined $addr) { - ## warn "$host: SOL, dude\n"; - return undef; - } - } - $addr{$host,$port} = pack('S n a4 x8', 2 ,$port, $addr); -} - - -## -## my_addr() -## Returns the packed socket address of the local host (port 0) -## Mostly for internal use. -## -## -sub my_addr -{ - local(@x) = gethostbyname('localhost'); - local(@y) = gethostbyname($x[0]); -# local($name,$aliases,$addrtype,$length,@addrs) = gethostbyname($x[0]); -# local(@bytes) = unpack("C4",$addrs[0]); -# return pack('S n a4 x8', 2 ,0, $addr); - return pack('S n a4 x8', 2 ,0, $y[4]); -} - - -## -## my_inet_socket(*FD); -## -## Local routine to do socket(PF_INET, SOCK_STREAM, AF_NS). -## Takes care of figuring out the proper values for the args. Hopefully. -## -## Returns the same value as 'socket'. -## -sub my_inet_socket -{ - local(*FD) = @_; - local($socket); - - if (!defined $socket_values_queried) - { - ## try to load some "socket.ph" - if (!defined &main'_SYS_SOCKET_H_) { - eval 'package main; - local($^W) = 0; - require("sys/socket.ph")||require("socket.ph");'; - } - - ## we'll use "the regular defaults" if for PF_INET and AF_NS if unknown - $PF_INET = defined &main'PF_INET ? &main'PF_INET : 2; - $AF_NS = defined &main'AF_NS ? &main'AF_NS : 6; - $SOCK_STREAM = &main'SOCK_STREAM if defined &main'SOCK_STREAM; - - $socket_values_queried = 1; - } - - if (defined $SOCK_STREAM) { - $socket = socket(FD, $PF_INET, $SOCK_STREAM, $AF_NS); - } else { - ## - ## We'll try the "regular default" of 1. If that returns a - ## "not supported" error, we'll try 2, which SunOS5.x uses. - ## - $socket = socket(FD, $PF_INET, 1, $AF_NS); - if ($socket) { - $SOCK_STREAM = 1; ## got it. - } elsif ($! =~ m/not supported/i) { - ## we'll just assume from now on that it's 2. - $socket = socket(FD, $PF_INET, $SOCK_STREAM = 2, $AF_NS); - } - } - $socket; -} - -## This here just to quiet -w warnings. -sub dummy { - 1 || $version || &dummy; -} - -1; -__END__ diff --git a/gnu/usr.bin/perl/win32/bin/pl2bat.pl b/gnu/usr.bin/perl/win32/bin/pl2bat.pl index 2fa80885005..cdbac6f2735 100644 --- a/gnu/usr.bin/perl/win32/bin/pl2bat.pl +++ b/gnu/usr.bin/perl/win32/bin/pl2bat.pl @@ -36,7 +36,7 @@ warn($usage), exit(0) if !getopts('whun:o:a:s:',\%OPT) or $OPT{'h'}; $OPT{'n'} = '-x -S "%0" %*' unless exists $OPT{'n'}; $OPT{'o'} = '-x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9' unless exists $OPT{'o'}; $OPT{'s'} = '/\\.plx?/' unless exists $OPT{'s'}; -$OPT{'s'} = ($OPT{'s'} =~ m|^/([^/]*)| ? $1 : "\Q$OPT{'s'}\E"); +$OPT{'s'} = ($OPT{'s'} =~ m#^/([^/]*[^/\$]|)\$?/?$# ? $1 : "\Q$OPT{'s'}\E"); my $head; if( defined( $OPT{'a'} ) ) { @@ -58,13 +58,14 @@ EOT perl $OPT{'n'} if NOT "%COMSPEC%" == "%SystemRoot%\\system32\\cmd.exe" goto endofperl if %errorlevel% == 9009 echo You do not have Perl in your PATH. + if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul goto endofperl \@rem '; EOT } $head =~ s/^\t//gm; my $headlines = 2 + ($head =~ tr/\n/\n/); -my $tail = "__END__\n:endofperl\n"; +my $tail = "\n__END__\n:endofperl\n"; @ARGV = ('-') unless @ARGV; @@ -134,18 +135,170 @@ B<pl2bat> [B<-w>] S<[B<-n> I<ntargs>]> S<[B<-o> I<otherargs>]> S<[B<-s> I<strips =head1 DESCRIPTION This utility converts a perl script into a batch file that can be -executed on DOS-like operating systems. +executed on DOS-like operating systems. This is intended to allow +you to use a Perl script like regular programs and batch files where +you just enter the name of the script [probably minus the extension] +plus any command-line arguments and the script is found in your B<PATH> +and run. -Note that by default, the ".pl" suffix will be stripped before adding -a ".bat" suffix to the supplied file names. This can be controlled -with the C<-s> option. +=head2 ADVANTAGES + +There are several alternatives to this method of running a Perl script. +They each have disadvantages that help you understand the motivation +for using B<pl2bat>. + +=over + +=item 1 + + C:> perl x:/path/to/script.pl [args] + +=item 2 + + C:> perl -S script.pl [args] + +=item 3 + + C:> perl -S script [args] + +=item 4 + + C:> ftype Perl=perl.exe "%1" %* + C:> assoc .pl=Perl + then + C:> script.pl [args] + +=item 5 + + C:> ftype Perl=perl.exe "%1" %* + C:> assoc .pl=Perl + C:> set PathExt=%PathExt%;.PL + then + C:> script [args] + +=back + +B<1> and B<2> are the most basic invocation methods that should work on +any system [DOS-like or not]. They require extra typing and require +that the script user know that the script is written in Perl. This +is a pain when you have lots of scripts, some written in Perl and some +not. It can be quite difficult to keep track of which scripts need to +be run through Perl and which do not. Even worse, scripts often get +rewritten from simple batch files into more powerful Perl scripts in +which case these methods would require all existing users of the scripts +be updated. + +B<3> works on modern Win32 versions of Perl. It allows the user to +omit the ".pl" or ".bat" file extension, which is a minor improvement. + +B<4> and B<5> work on some Win32 operating systems with some command +shells. One major disadvantage with both is that you can't use them +in pipelines nor with file redirection. For example, none of the +following will work properly if you used method B<4> or B<5>: + + C:> script.pl <infile + C:> script.pl >outfile + C:> echo y | script.pl + C:> script.pl | more + +This is due to a Win32 bug which Perl has no control over. This bug +is the major motivation for B<pl2bat> [which was originally written +for DOS] being used on Win32 systems. + +Note also that B<5> works on a smaller range of combinations of Win32 +systems and command shells while B<4> requires that the user know +that the script is a Perl script [because the ".pl" extension must +be entered]. This makes it hard to standardize on either of these +methods. + +=head2 DISADVANTAGES + +There are several potential traps you should be aware of when you +use B<pl2bat>. + +The generated batch file is initially processed as a batch file each +time it is run. This means that, to use it from within another batch +file you should preceed it with C<call> or else the calling batch +file will not run any commands after the script: + + call script [args] + +Except under Windows NT, if you specify more than 9 arguments to +the generated batch file then the 10th and subsequent arguments +are silently ignored. + +Except when using F<CMD.EXE> under Windows NT, if F<perl.exe> is not +in your B<PATH>, then trying to run the script will give you a generic +"Command not found"-type of error message that will probably make you +think that the script itself is not in your B<PATH>. When using +F<CMD.EXE> under Windows NT, the generic error message is followed by +"You do not have Perl in your PATH", to make this clearer. + +On most DOS-like operating systems, the only way to exit a batch file +is to "fall off the end" of the file. B<pl2bat> implements this by +doing C<goto :endofperl> and adding C<__END__> and C<:endofperl> as +the last two lines of the generated batch file. This means: + +=over + +=item No line of your script should start with a colon. + +In particular, for this version of B<pl2bat>, C<:endofperl>, +C<:WinNT>, and C<:script_failed_so_exit_with_non_zero_val> should not +be used. + +=item Care must be taken when using C<__END__> and the C<DATA> file handle. + +One approach is: + + . #!perl + . while( <DATA> ) { + . last if /^__END__$/; + . [...] + . } + . __END__ + . lines of data + . to be processed + . __END__ + . :endofperl + +The dots in the first column are only there to prevent F<cmd.exe> to interpret +the C<:endofperl> line in this documentation. Otherwise F<pl2bat.bat> itself +wouldn't work. See the previous item. :-) + +=item The batch file always "succeeds" + +The following commands illustrate the problem: + + C:> echo exit(99); >fail.pl + C:> pl2bat fail.pl + C:> perl -e "print system('perl fail.pl')" + 99 + C:> perl -e "print system('fail.bat')" + 0 + +So F<fail.bat> always reports that it completed successfully. Actually, +under Windows NT, we have: + + C:> perl -e "print system('fail.bat')" + 1 + +So, for Windows NT, F<fail.bat> fails when the Perl script fails, but +the return code is always C<1>, not the return code from the Perl script. + +=back + +=head2 FUNCTION + +By default, the ".pl" suffix will be stripped before adding a ".bat" suffix +to the supplied file names. This can be controlled with the C<-s> option. The default behavior is to have the batch file compare the C<OS> environment variable against C<"Windows_NT">. If they match, it uses the C<%*> construct to refer to all the command line arguments that were given to it, so you'll need to make sure that works on your -variant of the command shell. It is known to work in the cmd.exe shell -under WindowsNT. 4DOS/NT users will want to put a C<ParameterChar = *> +variant of the command shell. It is known to work in the F<CMD.EXE> shell +under Windows NT. 4DOS/NT users will want to put a C<ParameterChar = *> line in their initialization file, or execute C<setdos /p*> in the shell startup file. @@ -234,9 +387,23 @@ when the generated batch file runs. If you don't like this, see runperl.bat for an alternative way to invoke perl scripts. Default behavior is to invoke Perl with the B<-S> flag, so Perl will -search the PATH to find the script. This may have undesirable +search the B<PATH> to find the script. This may have undesirable effects. +On really old versions of Win32 Perl, you can't run the script +via + + C:> script.bat [args] + +and must use + + C:> script [args] + +A loop should be used to build up the argument list when not on +Windows NT so more than 9 arguments can be processed. + +See also L</Disadvantages>. + =head1 SEE ALSO perl, perlwin32, runperl.bat diff --git a/gnu/usr.bin/perl/win32/bin/webget.pl b/gnu/usr.bin/perl/win32/bin/webget.pl deleted file mode 100644 index 3d72208cb2b..00000000000 --- a/gnu/usr.bin/perl/win32/bin/webget.pl +++ /dev/null @@ -1,1091 +0,0 @@ -#!/usr/local/bin/perl -w - -#- -#!/usr/local/bin/perl -w -$version = "951121.18"; -$comments = 'jfriedl@omron.co.jp'; - -## -## This is "webget" -## -## Jeffrey Friedl (jfriedl@omron.co.jp), July 1994. -## Copyright 19.... ah hell, just take it. -## Should work with either perl4 or perl5 -## -## BLURB: -## Given a URL on the command line (HTTP and FTP supported at the moment), -## webget fetches the named object (HTML text, images, audio, whatever the -## object happens to be). Will automatically use a proxy if one is defined -## in the environment, follow "this URL has moved" responses, and retry -## "can't find host" responses from a proxy in case host lookup was slow). -## Supports users & passwords (FTP), Basic Authorization (HTTP), update-if- -## modified (HTTP), and much more. Works with perl4 or perl5. - -## -## More-detailed instructions in the comment block below the history list. -## - -## -## To-do: -## Add gopher support. -## Fix up how error messages are passed among this and the libraries. -## - -## 951219.19 -## Lost ftp connections now die with a bit more grace. -## -## 951121.18 -## Add -nnab. -## Brought the "usage" string in line with reality. -## -## 951114.17 -## Added -head. -## Added -update/-refresh/-IfNewerThan. If any URL was not pulled -## because it was not out of date, an exit value of 2 is returned. -## -## 951031.16 -## Added -timeout. Cleaned up (a bit) the exit value. Now exits -## with 1 if all URLs had some error (timeout exits immediately with -## code 3, though. This is subject to change). Exits with 0 if any -## URL was brought over safely. -## -## 951017.15 -## Neat -pf, -postfile idea from Lorrie Cranor -## (http://www.ccrc.wustl.edu/~lorracks/) -## -## 950912.14 -## Sigh, fixed a typo. -## -## 950911.13 -## Added Basic Authorization support for http. See "PASSWORDS AND STUFF" -## in the documentation. -## -## 950911.12 -## Implemented a most-excellent suggestion by Anthony D'Atri -## (aad@nwnet.net), to be able to automatically grab to a local file of -## the same name as the URL. See the '-nab' flag. -## -## 950706.11 -## Quelled small -w warning (thanks: Lars Rasmussen <gnort@daimi.aau.dk>) -## -## 950630.10 -## Steve Campbell to the rescue again. FTP now works when supplied -## with a userid & password (eg ftp://user:pass@foo.bar.com/index.txt). -## -## 950623.9 -## Incorporated changes from Steve Campbell (steven_campbell@uk.ibm.com) -## so that the ftp will work when no password is required of a user. -## -## 950530.8 -## Minor changes: -## Eliminate read-size warning message when size unknown. -## Pseudo-debug/warning messages at the end of debug_read now go to -## stderr. Some better error handling when trying to contact systems -## that aren't really set up for ftp. Fixed a bug concerning FTP access -## to a root directory. Added proxy documentation at head of file. -## -## 950426.6,7 -## Complete Overhaul: -## Renamed from httpget. Added ftp support (very sketchy at the moment). -## Redid to work with new 'www.pl' library; chucked 'Www.pl' library. -## More or less new and/or improved in many ways, but probably introduced -## a few bugs along the way. -## -## 941227.5 -## Added follow stuff (with -nofollow, etc.) -## Added -updateme. Cool! -## Some general tidying up. -## -## 941107.4 -## Allowed for ^M ending a header line... PCs give those kind of headers. -## -## 940820.3 -## First sorta'clean net release. -## -## - -## -##> -## -## Fetch http and/or ftp URL(s) given on the command line and spit to -## STDOUT. -## -## Options include: -## -V, -version -## Print version information; exit. -## -## -p, -post -## If the URL looks like a reply to a form (i.e. has a '?' in it), -## the request is POST'ed instead of GET'ed. -## -## -head -## Gets the header only (for HTTP). This might include such useful -## things as 'Last-modified' and 'Content-length' fields -## (a lack of a 'Last-modified' might be a good indication that it's -## a CGI). -## -## The "-head" option implies "-nostrip", but does *not* imply, -## for example "-nofollow". -## -## -## -pf, -postfile -## The item after the '?' is taken as a local filename, and the contents -## are POST'ed as with -post -## -## -nab, -f, -file -## Rather than spit the URL(s) to standard output, unconditionally -## dump to a file (or files) whose name is that as used in the URL, -## sans path. I like '-nab', but supply '-file' as well since that's -## what was originally suggested. Also see '-update' below for the -## only-if-changed version. -## -## -nnab -## Like -nab, but in addtion to dumping to a file, dump to stdout as well. -## Sort of like the 'tee' command. -## -## -update, -refresh -## Do the same thing as -nab, etc., but does not bother pulling the -## URL if it older than the localfile. Only applies to HTTP. -## Uses the HTTP "If-Modified-Since" field. If the URL was not modified -## (and hence not changed), the return value is '2'. -## -## -IfNewerThan FILE -## -int FILE -## Only pulls URLs if they are newer than the date the local FILE was -## last written. -## -## -q, -quiet -## Suppresses all non-essential informational messages. -## -## -nf, -nofollow -## Normally, a "this URL has moved" HTTP response is automatically -## followed. Not done with -nofollow. -## -## -nr, -noretry -## Normally, an HTTP proxy response of "can't find host" is retried -## up to three times, to give the remote hostname lookup time to -## come back with an answer. This suppresses the retries. This is the -## same as '-retry 0'. -## -## -r#, -retry#, -r #, -retry # -## Sets the number of times to retry. Default 3. -## -## -ns, -nostrip -## For HTTP items (including other items going through an HTTP proxy), -## the HTTP response header is printed rather than stripped as default. -## -## -np, -noproxy -## A proxy is not used, even if defined for the protocol. -## -## -h, -help -## Show a usage message and exit. -## -## -d, -debug -## Show some debugging messages. -## -## -updateme -## The special and rather cool flag "-updateme" will see if webget has -## been updated since you got your version, and prepare a local -## version of the new version for you to use. Keep updated! (although -## you can always ask to be put on the ping list to be notified when -## there's a new version -- see the author's perl web page). -## -## -timeout TIMESPAN -## -to TIMESPAN -## Time out if a connection can not be made within the specified time -## period. TIMESPAN is normally in seconds, although a 'm' or 'h' may -## be appended to indicate minutes and hours. "-to 1.5m" would timeout -## after 90 seconds. -## -## (At least for now), a timeout causes immediate program death (with -## exit value 3). For some reason, the alarm doesn't always cause a -## waiting read or connect to abort, so I just die immediately.. /-: -## -## I might consider adding an "entire fetch" timeout, if someone -## wants it. -## -## PASSWORDS AND SUCH -## -## You can use webget to do FTP fetches from non-Anonymous systems and -## accounts. Just put the required username and password into the URL, -## as with -## webget 'ftp:/user:password@ftp.somesite.com/pub/pix/babe.gif -## ^^^^^^^^^^^^^ -## Note the user:password is separated from the hostname by a '@'. -## -## You can use the same kind of thing with HTTP, and if so it will provide -## what's know as Basic Authorization. This is >weak< authorization. It -## also provides >zero< security -- I wouldn't be sending any credit-card -## numbers this way (unless you send them 'round my way :-). It seems to -## be used most by providers of free stuff where they want to make some -## attempt to limit access to "known users". -## -## PROXY STUFF -## -## If you need to go through a gateway to get out to the whole internet, -## you can use a proxy if one's been set up on the gateway. This is done -## by setting the "http_proxy" environmental variable to point to the -## proxy server. Other variables are used for other target protocols.... -## "gopher_proxy", "ftp_proxy", "wais_proxy", etc. -## -## For example, I have the following in my ".login" file (for use with csh): -## -## setenv http_proxy http://local.gateway.machine:8080/ -## -## This is to indicate that any http URL should go to local.gateway.machine -## (port 8080) via HTTP. Additionally, I have -## -## setenv gopher_proxy "$http_proxy" -## setenv wais_proxy "$http_proxy" -## setenv ftp_proxy "$http_proxy" -## -## This means that any gopher, wais, or ftp URL should also go to the -## same place, also via HTTP. This allows webget to get, for example, -## GOPHER URLs even though it doesn't support GOPHER itself. It uses HTTP -## to talk to the proxy, which then uses GOPHER to talk to the destination. -## -## Finally, if there are sites inside your gateway that you would like to -## connect to, you can list them in the "no_proxy" variable. This will allow -## you to connect to them directly and skip going through the proxy: -## -## setenv no_proxy "www.this,www.that,www.other" -## -## I (jfriedl@omron.co.jp) have little personal experience with proxies -## except what I deal with here at Omron, so if this is not representative -## of your situation, please let me know. -## -## RETURN VALUE -## The value returned to the system by webget is rather screwed up because -## I didn't think about dealing with it until things were already -## complicated. Since there can be more than one URL on the command line, -## it's hard to decide what to return when one times out, another is fetched, -## another doesn't need to be fetched, and a fourth isn't found. -## -## So, here's the current status: -## -## Upon any timeout (via the -timeout arg), webget immediately -## returns 3. End of story. Otherwise.... -## -## If any URL was fetched with a date limit (i.e. via -## '-update/-refresh/-IfNewerThan' and was found to not have changed, -## 2 is returned. Otherwise.... -## -## If any URL was successfully fetched, 0 is returned. Otherwise... -## -## If there were any errors, 1 is returned. Otherwise... -## -## Must have been an info-only or do-nothing instance. 0 is returned. -## -## Phew. Hopefully useful to someone. -##< -## - -## Where latest version should be. -$WEB_normal = 'http://www.wg.omron.co.jp/~jfriedl/perl/webget'; -$WEB_inlined = 'http://www.wg.omron.co.jp/~jfriedl/perl/inlined/webget'; - - -require 'network.pl'; ## inline if possible (directive to a tool of mine) -require 'www.pl'; ## inline if possible (directive to a tool of mine) -$inlined=0; ## this might be changed by a the inline thing. - -## -## Exit values. All screwed up. -## -$EXIT_ok = 0; -$EXIT_error = 1; -$EXIT_notmodified = 2; -$EXIT_timeout = 3; - -## -## - -warn qq/WARNING:\n$0: need a newer version of "network.pl"\n/ if - !defined($network'version) || $network'version < "950311.5"; -warn qq/WARNING:\n$0: need a newer version of "www.pl"\n/ if - !defined($www'version) || $www'version < "951114.8"; - -$WEB = $inlined ? $WEB_inlined : $WEB_normal; - -$debug = 0; -$strip = 1; ## default is to strip -$quiet = 0; ## also normally off. -$follow = 1; ## normally, we follow "Found (302)" links -$retry = 3; ## normally, retry proxy hostname lookups up to 3 times. -$nab = 0; ## If true, grab to a local file of the same name. -$refresh = 0; ## If true, use 'If-Modified-Since' with -nab get. -$postfile = 0; ## If true, filename is given after the '?' -$defaultdelta2print = 2048; -$TimeoutSpan = 0; ## seconds after which we should time out. - -while (@ARGV && $ARGV[0] =~ m/^-/) -{ - $arg = shift(@ARGV); - - $nab = 1, next if $arg =~ m/^-f(ile)?$/; - $nab = 1, next if $arg =~ m/^-nab$/; - $nab = 2, next if $arg =~ m/^-nnab$/; - $post = 1, next if $arg =~ m/^-p(ost)?$/i; - $post = $postfile = 1, next if $arg =~ m/^-p(ost)?f(ile)?$/i; - $quiet=1, next if $arg =~ m/^-q(uiet)?$/; - $follow = 0, next if $arg =~ m/^-no?f(ollow)?$/; - $strip = 0, next if $arg =~ m/^-no?s(trip)?$/; - $debug=1, next if $arg =~ m/^-d(ebug)?$/; - $noproxy=1, next if $arg =~ m/^-no?p(roxy)?$/; - $retry=0, next if $arg =~ m/^-no?r(etry)?$/; - $retry=$2, next if $arg =~ m/^-r(etry)?(\d+)$/; - &updateme if $arg eq '-updateme'; - $strip = 0, $head = 1, next if $arg =~ m/^-head(er)?/; - $nab = $refresh = 1, next if $arg =~ m/^-(refresh|update)/; - - &usage($EXIT_ok) if $arg =~ m/^-h(elp)?$/; - &show_version, exit($EXIT_ok) if $arg eq '-version' || $arg eq '-V'; - - if ($arg =~ m/^-t(ime)?o(ut)?$/i) { - local($num) = shift(@ARGV); - &usage($EXIT_error, "expecting timespan argument to $arg\n") unless - $num =~ m/^\d+(\d*)?[hms]?$/; - &timeout_arg($num); - next; - } - - if ($arg =~ m/^-if?n(ewer)?t(han)?$/i) { - $reference_file = shift(@ARGV); - &usage($EXIT_error, "expecting filename arg to $arg") - if !defined $reference_file; - if (!-f $reference_file) { - warn qq/$0: ${arg}'s "$reference_file" not found.\n/; - exit($EXIT_error); - } - next; - } - - if ($arg eq '-r' || $arg eq '-retry') { - local($num) = shift(@ARGV); - &usage($EXIT_error, "expecting numerical arg to $arg\n") unless - defined($num) && $num =~ m/^\d+$/; - $retry = $num; - next; - } - &usage($EXIT_error, qq/$0: unknown option "$arg"\n/); -} - -if ($head && $post) { - warn "$0: combining -head and -post makes no sense, ignoring -post.\n"; - $post = 0; - undef $postfile; -} - -if ($refresh && defined($reference_file)) { - warn "$0: combining -update and -IfNewerThan make no sense, ignoring -IfNewerThan.\n"; - undef $reference_file; -} - -if (@ARGV == 0) { - warn "$0: nothing to do. Use -help for info.\n"; - exit($EXIT_ok); -} - - -## -## Now run through the remaining arguments (mostly URLs) and do a quick -## check to see if they look well-formed. We won't *do* anything -- just -## want to catch quick errors before really starting the work. -## -@tmp = @ARGV; -$errors = 0; -while (@tmp) { - $arg = shift(@tmp); - if ($arg =~ m/^-t(ime)?o(ut)?$/) { - local($num) = shift(@tmp); - if ($num !~ m/^\d+(\d*)?[hms]?$/) { - &warn("expecting timespan argument to $arg\n"); - $errors++; - } - } else { - local($protocol) = &www'grok_URL($arg, $noproxy); - - if (!defined $protocol) { - warn qq/can't grok "$arg"/; - $errors++; - } elsif (!$quiet && ($protocol eq 'ftp')) { - warn qq/warning: -head ignored for ftp URLs\n/ if $head; - warn qq/warning: -refresh ignored for ftp URLs\n/if $refresh; - warn qq/warning: -IfNewerThan ignored for ftp URLs\n/if defined($reference_file); - - } - } -} - -exit($EXIT_error) if $errors; - - -$SuccessfulCount = 0; -$NotModifiedCount = 0; - -## -## Now do the real thing. -## -while (@ARGV) { - $arg = shift(@ARGV); - if ($arg =~ m/^-t(ime)?o(ut)?$/) { - &timeout_arg(shift(@ARGV)); - } else { - &fetch_url($arg); - } -} - -if ($NotModifiedCount) { - exit($EXIT_notmodified); -} elsif ($SuccessfulCount) { - exit($EXIT_ok); -} else { - exit($EXIT_error); -} - -########################################################################### -########################################################################### - -sub timeout_arg -{ - ($TimeoutSpan) = @_; - $TimeoutSpan =~ s/s//; - $TimeoutSpan *= 60 if $TimeoutSpan =~ m/m/; - $TimeoutSpan *= 3600 if $TimeoutSpan =~ m/h/; - -} - -## -## As a byproduct, returns the basename of $0. -## -sub show_version -{ - local($base) = $0; - $base =~ s,.*/,,; - print STDERR "This is $base version $version\n"; - $base; -} - -## -## &usage(exitval, message); -## -## Prints a usage message to STDERR. -## If MESSAGE is defined, prints that first. -## If exitval is defined, exits with that value. Otherwise, returns. -## -sub usage -{ - local($exit, $message) = @_; - - print STDERR $message if defined $message; - local($base) = &show_version; - print STDERR <<INLINE_LITERAL_TEXT; -usage: $0 [options] URL ... - Fetches and displays the named URL(s). Supports http and ftp. - (if no protocol is given, a leading "http://" is normally used). - -Options are from among: - -V, -version Print version information; exit. - -p, -post If URL looks like a form reply, does POST instead of GET. - -pf, -postfile Like -post, but takes everything after ? to be a filename. - -q, -quiet All non-essential informational messages are suppressed. - -nf, -nofollow Don't follow "this document has moved" replies. - -nr, -noretry Doesn't retry a failed hostname lookup (same as -retry 0) - -r #, -retry # Sets failed-hostname-lookup-retry to # (default $retry) - -np, -noproxy Uses no proxy, even if one defined for the protocol. - -ns, -nostrip The HTTP header, normally elided, is printed. - -head gets item header only (implies -ns) - -nab, -file Dumps output to file whose name taken from URL, minus path - -nnab Like -nab, but *also* dumps to stdout. - -update HTTP only. Like -nab, but only if the page has been modified. - -h, -help Prints this message. - -IfNewerThan F HTTP only. Only brings page if it is newer than named file. - -timeout T Fail if a connection can't be made in the specified time. - - -updateme Pull the latest version of $base from - $WEB - and reports if it is newer than your current version. - -Comments to $comments. -INLINE_LITERAL_TEXT - - exit($exit) if defined $exit; -} - -## -## Pull the latest version of this program to a local file. -## Clip the first couple lines from this executing file so that we -## preserve the local invocation style. -## -sub updateme -{ - ## - ## Open a temp file to hold the new version, - ## redirecting STDOUT to it. - ## - open(STDOUT, '>'.($tempFile="/tmp/webget.new")) || - open(STDOUT, '>'.($tempFile="/usr/tmp/webget.new")) || - open(STDOUT, '>'.($tempFile="/webget.new")) || - open(STDOUT, '>'.($tempFile="webget.new")) || - die "$0: can't open a temp file.\n"; - - ## - ## See if we can figure out how we were called. - ## The seek will rewind not to the start of the data, but to the - ## start of the whole program script. - ## - ## Keep the first line if it begins with #!, and the next two if they - ## look like the trick mentioned in the perl man page for getting - ## around the lack of #!-support. - ## - if (seek(DATA, 0, 0)) { ## - $_ = <DATA>; if (m/^#!/) { print STDOUT; - $_ = <DATA>; if (m/^\s*eval/) { print STDOUT; - $_ = <DATA>; if (m/^\s*if/) { print STDOUT; } - } - } - print STDOUT "\n#-\n"; - } - - ## Go get the latest one... - local(@options); - push(@options, 'head') if $head; - push(@options, 'nofollow') unless $follow; - push(@options, ('retry') x $retry) if $retry; - push(@options, 'quiet') if $quiet; - push(@options, 'debug') if $debug; - local($status, $memo, %info) = &www'open_http_url(*IN, $WEB, @options); - die "fetching $WEB:\n $memo\n" unless $status eq 'ok'; - - $size = $info{'content-length'}; - while (<IN>) - { - $size -= length; - print STDOUT; - if (!defined $fetched_version && m/version\s*=\s*"([^"]+)"/) { - $fetched_version = $1; - &general_read(*IN, $size); - last; - } - } - - $fetched_version = "<unknown>" unless defined $fetched_version; - - ## - ## Try to update the mode of the temp file with the mode of this file. - ## Don't worry if it fails. - ## - chmod($mode, $tempFile) if $mode = (stat($0))[2]; - - $as_well = ''; - if ($fetched_version eq $version) - { - print STDERR "You already have the most-recent version ($version).\n", - qq/FWIW, the newly fetched one has been left in "$tempFile".\n/; - } - elsif ($fetched_version <= $version) - { - print STDERR - "Mmm, your current version seems newer (?!):\n", - qq/ your version: "$version"\n/, - qq/ new version: "$fetched_version"\n/, - qq/FWIW, fetched one left in "$tempFile".\n/; - } - else - { - print STDERR - "Indeed, your current version was old:\n", - qq/ your version: "$version"\n/, - qq/ new version: "$fetched_version"\n/, - qq/The file "$tempFile" is ready to replace the old one.\n/; - print STDERR qq/Just do:\n % mv $tempFile $0\n/ if -f $0; - $as_well = ' as well'; - } - print STDERR "Note that the libraries it uses may (or may not) need updating$as_well.\n" - unless $inlined; - exit($EXIT_ok); -} - -## -## Given a list of URLs, fetch'em. -## Parses the URL and calls the routine for the appropriate protocol -## -sub fetch_url -{ - local(@todo) = @_; - local(%circref, %hold_circref); - - URL_LOOP: while (@todo) - { - $URL = shift(@todo); - %hold_circref = %circref; undef %circref; - - local($protocol, @args) = &www'grok_URL($URL, $noproxy); - - if (!defined $protocol) { - &www'message(1, qq/can't grok "$URL"/); - next URL_LOOP; - } - - ## call protocol-specific handler - $func = "fetch_via_" . $protocol; - $error = &$func(@args, $TimeoutSpan); - if (defined $error) { - &www'message(1, "$URL: $error"); - } else { - $SuccessfulCount++; - } - } -} - -sub filedate -{ - local($filename) = @_; - local($filetime) = (stat($filename))[9]; - return 0 if !defined $filetime; - local($sec, $min, $hour, $mday, $mon, $year, $wday) = gmtime($filetime); - return 0 if !defined $wday; - sprintf(qq/"%s, %02d-%s-%02d %02d:%02d:%02d GMT"/, - ("Sunday", "Monday", "Tuesdsy", "Wednesday", - "Thursday", "Friday", "Saturday")[$wday], - $mday, - ("Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec")[$mon], - $year, - $hour, - $min, - $sec); -} - -sub local_filename -{ - local($filename) = @_; - $filename =~ s,/+$,,; ## remove any trailing slashes - $filename =~ s,.*/,,; ## remove any leading path - if ($filename eq '') { - ## empty -- pick a random name - $filename = "file0000"; - ## look for a free random name. - $filename++ while -f $filename; - } - $filename; -} - -sub set_output_file -{ - local($filename) = @_; - if (!open(OUT, ">$filename")) { - &www'message(1, "$0: can't open [$filename] for output"); - } else { - open(SAVEOUT, ">>&STDOUT") || die "$!";; - open(STDOUT, ">>&OUT"); - } -} - -sub close_output_file -{ - local($filename) = @_; - unless ($quiet) - { - local($note) = qq/"$filename" written/; - if (defined $error) { - $note .= " (possibly corrupt due to error above)"; - } - &www'message(1, "$note."); - } - close(STDOUT); - open(STDOUT, ">&SAVEOUT"); -} - -sub http_alarm -{ - &www'message(1, "ERROR: $AlarmNote."); - exit($EXIT_timeout); ## the alarm doesn't seem to cause a waiting syscall to break? -# $HaveAlarm = 1; -} - -## -## Given the host, port, and path, and (for info only) real target, -## fetch via HTTP. -## -## If there is a user and/or password, use that for Basic Authorization. -## -## If $timeout is nonzero, time out after that many seconds. -## -sub fetch_via_http -{ - local($host, $port, $path, $target, $user, $password, $timeout) = @_; - local(@options); - local($local_filename); - - ## - ## If we're posting, but -postfile was given, we need to interpret - ## the item in $path after '?' as a filename, and replace it with - ## the contents of the file. - ## - if ($postfile && $path =~ s/\?([\d\D]*)//) { - local($filename) = $1; - return("can't open [$filename] to POST") if !open(IN, "<$filename"); - local($/) = ''; ## want to suck up the whole file. - $path .= '?' . <IN>; - close(IN); - } - - $local_filename = &local_filename($path) - if $refresh || $nab || defined($reference_file); - $refresh = &filedate($local_filename) if $refresh; - $refresh = &filedate($reference_file) if defined($reference_file); - - push(@options, 'head') if $head; - push(@options, 'post') if $post; - push(@options, 'nofollow') unless $follow; - push(@options, ('retry') x 3); - push(@options, 'quiet') if $quiet; - push(@options, 'debug') if $debug; - push(@options, "ifmodifiedsince=$refresh") if $refresh; - - if (defined $password || defined $user) { - local($auth) = join(':', ($user || ''), ($password || '')); - push(@options, "authorization=$auth"); - } - - local($old_alarm); - if ($timeout) { - $old_alarm = $SIG{'ALRM'} || 'DEFAULT'; - $SIG{'ALRM'} = "main'http_alarm"; -# $HaveAlarm = 0; - $AlarmNote = "host $host"; - $AlarmNote .= ":$port" if $port != $www'default_port{'http'}; - $AlarmNote .= " timed out after $timeout second"; - $AlarmNote .= 's' if $timeout > 1; - alarm($timeout); - } - local($result, $memo, %info) = - &www'open_http_connection(*HTTP, $host,$port,$path,$target,@options); - - if ($timeout) { - alarm(0); - $SIG{'ALRM'} = $old_alarm; - } - -# if ($HaveAlarm) { -# close(HTTP); -# $error = "timeout after $timeout second"; -# $error .= "s" if $timeout > 1; -# return $error; -# } - - if ($follow && ($result eq 'follow')) { - %circref = %hold_circref; - $circref{$memo} = 1; - unshift(@todo, $memo); - return undef; - } - - - return $memo if $result eq 'error'; - if (!$quiet && $result eq 'status' && ! -t STDOUT) { - #&www'message(1, "Warning: $memo"); - $error = "Warning: $memo"; - } - - if ($info{'CODE'} == 304) { ## 304 is magic for "Not Modified" - close(HTTP); - &www'message(1, "$URL: Not Modified") unless $quiet; - $NotModifiedCount++; - return undef; ## no error - } - - - &set_output_file($local_filename) if $nab; - - unless($strip) { - print $info{'STATUS'}, "\n", $info{'HEADER'}, "\n"; - - print SAVEOUT $info{'STATUS'}, "\n", $info{'HEADER'}, "\n" if $nab==2; - } - - if (defined $info{'BODY'}) { - print $info{'BODY'}; - print SAVEOUT $info{'BODY'} if $nab==2; - } - - if (!$head) { - &general_read(*HTTP, $info{'content-length'}); - } - close(HTTP); - &close_output_file($local_filename) if $nab; - - $error; ## will be 'undef' if no error; -} - -sub fetch_via_ftp -{ - local($host, $port, $path, $target, $user, $password, $timeout) = @_; - local($local_filename) = &local_filename($path); - local($ftp_debug) = $debug; - local(@password) = ($password); - $path =~ s,^/,,; ## remove a leading / from the path. - $path = '.' if $path eq ''; ## make sure we have something - - if (!defined $user) { - $user = 'anonymous'; - $password = $ENV{'USER'} || 'WWWuser'; - @password = ($password.'@'. &network'addr_to_ascii(&network'my_addr), - $password.'@'); - } elsif (!defined $password) { - @password = (""); - } - - local($_last_ftp_reply, $_passive_host, $_passive_port); - local($size); - - sub _ftp_get_reply - { - local($text) = scalar(<FTP_CONTROL>); - die "lost connection to $host\n" if !defined $text; - local($_, $tmp); - print STDERR "READ: $text" if $ftp_debug; - die "internal error: expected reply code in response from ". - "ftp server [$text]" unless $text =~ s/^(\d+)([- ])//; - local($code) = $1; - if ($2 eq '-') { - while (<FTP_CONTROL>) { - ($tmp = $_) =~ s/^\d+[- ]//; - $text .= $tmp; - last if m/^$code /; - } - } - $text =~ s/^\d+ ?/<foo>/g; - ($code, $text); - } - - sub _ftp_expect - { - local($code, $text) = &_ftp_get_reply; - $_last_ftp_reply = $text; - foreach $expect (@_) { - return ($code, $text) if $code == $expect; - } - die "internal error: expected return code ". - join('|',@_).", got [$text]"; - } - - sub _ftp_send - { - print STDERR "SEND: ", @_ if $ftp_debug; - print FTP_CONTROL @_; - } - - sub _ftp_do_passive - { - local(@commands) = @_; - - &_ftp_send("PASV\r\n"); - local($code) = &_ftp_expect(227, 125); - - if ($code == 227) - { - die "internal error: can't grok passive reply [$_last_ftp_reply]" - unless $_last_ftp_reply =~ m/\(([\d,]+)\)/; - local($a,$b,$c,$d, $p1, $p2) = split(/,/, $1); - ($_passive_host, $_passive_port) = - ("$a.$b.$c.$d", $p1*256 + $p2); - } - - foreach(@commands) { - &_ftp_send($_); - } - - local($error)= - &network'connect_to(*PASSIVE, $_passive_host, $_passive_port); - die "internal error: passive ftp connect [$error]" if $error; - } - - ## make the connection to the host - &www'message($debug, "connecting to $host...") unless $quiet; - - local($old_alarm); - if ($timeout) { - $old_alarm = $SIG{'ALRM'} || 'DEFAULT'; - $SIG{'ALRM'} = "main'http_alarm"; ## can use this for now -# $HaveAlarm = 0; - $AlarmNote = "host $host"; - $AlarmNote .= ":$port" if $port != $www'default_port{'ftp'}; - $AlarmNote .= " timed out after $timeout second"; - $AlarmNote .= 's' if $timeout > 1; - alarm($timeout); - } - - local($error) = &network'connect_to(*FTP_CONTROL, $host, $port); - - if ($timeout) { - alarm(0); - $SIG{'ALRM'} = $old_alarm; - } - - return $error if $error; - - local ($code, $text) = &_ftp_get_reply(*FTP_CONTROL); - close(FTP_CONTROL), return "internal ftp error: [$text]" unless $code==220; - - ## log in - &www'message($debug, "logging in as $user...") unless $quiet; - foreach $password (@password) - { - &_ftp_send("USER $user\r\n"); - ($code, $text) = &_ftp_expect(230,331,530); - close(FTP_CONTROL), return $text if ($code == 530); - last if $code == 230; ## hey, already logged in, cool. - - &_ftp_send("PASS $password\r\n"); - ($code, $text) = &_ftp_expect(220,230,530,550,332); - last if $code != 550; - last if $text =~ m/can't change directory/; - } - - if ($code == 550) - { - $text =~ s/\n+$//; - &www'message(1, "Can't log in $host: $text") unless $quiet; - exit($EXIT_error); - } - - if ($code == 332) - { - &_ftp_send("ACCT noaccount\r\n"); - ($code, $text) = &_ftp_expect(230, 202, 530, 500,501,503, 421) - } - close(FTP_CONTROL), return $text if $code >= 300; - - &_ftp_send("TYPE I\r\n"); - &_ftp_expect(200); - - unless ($quiet) { - local($name) = $path; - $name =~ s,.*/([^/]),$1,; - &www'message($debug, "requesting $name..."); - } - ## get file - &_ftp_do_passive("RETR $path\r\n"); - ($code,$text) = &_ftp_expect(125, 150, 550, 530); - close(FTP_CONTROL), return $text if $code == 530; - - if ($code == 550) - { - close(PASSIVE); - if ($text =~ /directory/i) { - ## probably from "no such file or directory", so just return now. - close(FTP_CONTROL); - return $text; - } - - ## do like Mosaic and try getting a directory listing. - &_ftp_send("CWD $path\r\n"); - ($code) = &_ftp_expect(250,550); - if ($code == 550) { - close(FTP_CONTROL); - return $text; - } - &_ftp_do_passive("LIST\r\n"); - &_ftp_expect(125, 150); - } - - $size = $1 if $text =~ m/(\d+)\s+bytes/; - binmode(PASSIVE); ## just in case. - &www'message($debug, "waiting for data...") unless $quiet; - &set_output_file($local_filename) if $nab; - &general_read(*PASSIVE, $size); - &close_output_file($local_filename) if $nab; - - close(PASSIVE); - close(FTP_CONTROL); - undef; -} - -sub general_read -{ - local(*INPUT, $size) = @_; - local($lastcount, $bytes) = (0,0); - local($need_to_clear) = 0; - local($start_time) = time; - local($last_time, $time) = $start_time; - ## Figure out how often to print the "bytes read" message - local($delta2print) = - (defined $size) ? int($size/50) : $defaultdelta2print; - - &www'message(0, "read 0 bytes") unless $quiet; - - ## so $! below is set only if a real error happens from now - eval 'local($^W) = 0; undef $!'; - - - while (defined($_ = <INPUT>)) - { - ## shove it out. - &www'clear_message if $need_to_clear; - print; - print SAVEOUT if $nab==2; - - ## if we know the content-size, keep track of what we're reading. - $bytes += length; - - last if eof || (defined $size && $bytes >= $size); - - if (!$quiet && $bytes > ($lastcount + $delta2print)) - { - if ($time = time, $last_time == $time) { - $delta2print *= 1.5; - } else { - $last_time = $time; - $lastcount = $bytes; - local($time_delta) = $time - $start_time; - local($text); - - $delta2print /= $time_delta; - if (defined $size) { - $text = sprintf("read $bytes bytes (%.0f%%)", - $bytes*100/$size); - } else { - $text = "read $bytes bytes"; - } - - if ($time_delta > 5 || ($time_delta && $bytes > 10240)) - { - local($rate) = int($bytes / $time_delta); - if ($rate < 5000) { - $text .= " ($rate bytes/sec)"; - } elsif ($rate < 1024 * 10) { - $text .= sprintf(" (%.1f k/sec)", $rate/1024); - } else { - $text .= sprintf(" (%.0f k/sec)", $rate/1024); - } - } - &www'message(0, "$text..."); - $need_to_clear = -t STDOUT; - } - } - } - - if (!$quiet) - { - if ($size && ($size != $bytes)) { - &www'message("WARNING: Expected $size bytes, read $bytes bytes.\n"); - } -# if ($!) { -# print STDERR "\$! is [$!]\n"; -# } -# if ($@) { -# print STDERR "\$\@ is [$@]\n"; -# } - } - &www'clear_message($text) unless $quiet; -} - -sub dummy { - 1 || &dummy || &fetch_via_ftp || &fetch_via_http || &http_alarm; - 1 || close(OUT); - 1 || close(SAVEOUT); -} - -__END__ diff --git a/gnu/usr.bin/perl/win32/bin/www.pl b/gnu/usr.bin/perl/win32/bin/www.pl deleted file mode 100644 index 8022597454b..00000000000 --- a/gnu/usr.bin/perl/win32/bin/www.pl +++ /dev/null @@ -1,901 +0,0 @@ -## -## Jeffrey Friedl (jfriedl@omron.co.jp) -## Copyri.... ah hell, just take it. -## -## This is "www.pl". -## Include (require) to use, execute ("perl www.pl") to print a man page. -## Requires my 'network.pl' library. -package www; -$version = "951219.9"; - -## -## 951219.9 -## -- oops, stopped sending garbage Authorization line when no -## authorization was requested. -## -## 951114.8 -## -- added support for HEAD, If-Modified-Since -## -## 951017.7 -## -- Change to allow a POST'ed HTTP text to have newlines in it. -## Added 'NewURL to the open_http_connection %info. Idea courtesy -## of Bryan Schmersal (http://www.transarc.com/~bryans/Home.html). -## -## -## 950921.6 -## -- added more robust HTTP error reporting -## (due to steven_campbell@uk.ibm.com) -## -## 950911.5 -## -- added Authorization support -## - -## -## HTTP return status codes. -## -%http_return_code = - (200,"OK", - 201,"Created", - 202,"Accepted", - 203,"Partial Information", - 204,"No Response", - 301,"Moved", - 302,"Found", - 303,"Method", - 304,"Not modified", - 400,"Bad request", - 401,"Unauthorized", - 402,"Payment required", - 403,"Forbidden", - 404,"Not found", - 500,"Internal error", - 501,"Not implemented", - 502,"Service temporarily overloaded", - 503,"Gateway timeout"); - -## -## If executed directly as a program, print as a man page. -## -if (length($0) >= 6 && substr($0, -6) eq 'www.pl') -{ - seek(DATA, 0, 0) || die "$0: can't reset internal pointer.\n"; - print "www.pl version $version\n", '=' x 60, "\n"; - while (<DATA>) { - next unless /^##>/../^##</; ## select lines to print - s/^##[<> ]?//; ## clean up - print; - } - exit(0); -} - -## -## History: -## version 950425.4 -## added require for "network.pl" -## -## version 950425.3 -## re-did from "Www.pl" which was a POS. -## -## -## BLURB: -## A group of routines for dealing with URLs, HTTP sessions, proxies, etc. -## Requires my 'network.pl' package. The library file can be executed -## directly to produce a man page. - -##> -## A motley group of routines for dealing with URLs, HTTP sessions, proxies, -## etc. Requires my 'network.pl' package. -## -## Latest version, as well as other stuff (including network.pl) available -## at http://www.wg.omron.co.jp/~jfriedl/perl/ -## -## Simpleton complete program to dump a URL given on the command-line: -## -## require 'network.pl'; ## required for www.pl -## require 'www.pl'; ## main routines -## $URL = shift; ## get URL -## ($status, $memo) = &www'open_http_url(*IN, $URL); ## connect -## die "$memo\n" if $status ne 'ok'; ## report any error -## print while <IN>; ## dump contents -## -## There are various options available for open_http_url. -## For example, adding 'quiet' to the call, i.e. vvvvvvv-----added -## ($status, $memo) = &www'open_http_url(*IN, $URL, 'quiet'); -## suppresses the normal informational messages such as "waiting for data...". -## -## The options, as well as the various other public routines in the package, -## are discussed below. -## -##< - -## -## Default port for the protocols whose URL we'll at least try to recognize. -## -%default_port = ('http', 80, - 'ftp', 21, - 'gopher', 70, - 'telnet', 23, - 'wais', 210, - ); - -## -## A "URL" to "ftp.blah.com" without a protocol specified is probably -## best reached via ftp. If the hostname begins with a protocol name, it's -## easy. But something like "www." maps to "http", so that mapping is below: -## -%name2protocol = ( - 'www', 'http', - 'wwwcgi','http', -); - -$last_message_length = 0; -$useragent = "www.pl/$version"; - -## -##> -############################################################################## -## routine: open_http_url -## -## Used as -## ($status, $memo, %info) = &www'open_http_url(*FILEHANDLE, $URL, options..) -## -## Given an unused filehandle, a URL, and a list of options, opens a socket -## to the URL and returns with the filehandle ready to read the data of the -## URL. The HTTP header, as well as other information, is returned in %info. -## -## OPTIONS are from among: -## -## "post" -## If PATH appears to be a query (i.e. has a ? in it), contact -## via a POST rather than a GET. -## -## "nofollow" -## Normally, if the initial contact indicates that the URL has moved -## to a different location, the new location is automatically contacted. -## "nofollow" inhibits this. -## -## "noproxy" -## Normally, a proxy will be used if 'http_proxy' is defined in the -## environment. This option inhibits the use of a proxy. -## -## "retry" -## If a host's address can't be found, it may well be because the -## nslookup just didn't return in time and that retrying the lookup -## after a few seconds will succeed. If this option is given, will -## wait five seconds and try again. May be given multiple times to -## retry multiple times. -## -## "quiet" -## Informational messages will be suppressed. -## -## "debug" -## Additional messages will be printed. -## -## "head" -## Requests only the file header to be sent -## -## -## -## -## The return array is ($STATUS, $MEMO, %INFO). -## -## STATUS is 'ok', 'error', 'status', or 'follow' -## -## If 'error', the MEMO will indicate why (URL was not http, can't -## connect, etc.). INFO is probably empty, but may have some data. -## See below. -## -## If 'status', the connnection was made but the reply was not a normal -## "OK" successful reply (i.e. "Not found", etc.). MEMO is a note. -## INFO is filled as noted below. Filehandle is ready to read (unless -## $info{'BODY'} is filled -- see below), but probably most useful -## to treat this as an 'error' response. -## -## If 'follow', MEMO is the new URL (for when 'nofollow' was used to -## turn off automatic following) and INFO is filled as described -## below. Unless you wish to give special treatment to these types of -## responses, you can just treat 'follow' responses like 'ok' -## responses. -## -## If 'ok', the connection went well and the filehandle is ready to -## read. -## -## INFO contains data as described at the read_http_header() function (in -## short, the HTTP response header) and additional informational fields. -## In addition, the following fields are filled in which describe the raw -## connection made or attempted: -## -## PROTOCOL, HOST, PORT, PATH -## -## Note that if a proxy is being used, these will describe the proxy. -## The field TARGET will describe the host or host:port ultimately being -## contacted. When no proxy is being used, this will be the same info as -## in the raw connection fields above. However, if a proxy is being used, -## it will refer to the final target. -## -## In some cases, the additional entry $info{'BODY'} exists as well. If -## the result-code indicates an error, the body of the message may be -## parsed for internal reasons (i.e. to support 'repeat'), and if so, it -## will be saved in $info{'BODY}. -## -## If the URL has moved, $info{'NewURL'} will exist and contain the new -## URL. This will be true even if the 'nofollow' option is specified. -## -##< -## -sub open_http_url -{ - local(*HTTP, $URL, @options) = @_; - return &open_http_connection(*HTTP, $URL, undef, undef, undef, @options); -} - - -## -##> -############################################################################## -## routine: read_http_header -## -## Given a filehandle to a just-opened HTTP socket connection (such as one -## created via &network'connect_to which has had the HTTP request sent), -## reads the HTTP header and and returns the parsed info. -## -## ($replycode, %info) = &read_http_header(*FILEHANDLE); -## -## $replycode will be the HTTP reply code as described below, or -## zero on header-read error. -## -## %info contains two types of fields: -## -## Upper-case fields are informational from the function. -## Lower-case fields are the header field/value pairs. -## -## Upper-case fields: -## -## $info{'STATUS'} will be the first line read (HTTP status line) -## -## $info{'CODE'} will be the numeric HTTP reply code from that line. -## This is also returned as $replycode. -## -## $info{'TYPE'} is the text from the status line that follows CODE. -## -## $info{'HEADER'} will be the raw text of the header (sans status line), -## newlines and all. -## -## $info{'UNKNOWN'}, if defined, will be any header lines not in the -## field/value format used to fill the lower-case fields of %info. -## -## Lower-case fields are reply-dependent, but in general are described -## in http://info.cern.ch/hypertext/WWW/Protocols/HTTP/Object_Headers.html -## -## A header line such as -## Content-type: Text/Plain -## will appear as $info{'content-type'} = 'Text/Plain'; -## -## (*) Note that while the field names are are lower-cased, the field -## values are left as-is. -## -## -## When $replycode is zero, there are two possibilities: -## $info{'TYPE'} is 'empty' -## No response was received from the filehandle before it was closed. -## No other %info fields present. -## $info{'TYPE'} is 'unknown' -## First line of the response doesn't seem to be proper HTTP. -## $info{'STATUS'} holds that line. No other %info fields present. -## -## The $replycode, when not zero, is as described at -## http://info.cern.ch/hypertext/WWW/Protocols/HTTP/HTRESP.html -## -## Some of the codes: -## -## success 2xx -## ok 200 -## created 201 -## accepted 202 -## partial information 203 -## no response 204 -## redirection 3xx -## moved 301 -## found 302 -## method 303 -## not modified 304 -## error 4xx, 5xx -## bad request 400 -## unauthorized 401 -## paymentrequired 402 -## forbidden 403 -## not found 404 -## internal error 500 -## not implemented 501 -## service temporarily overloaded 502 -## gateway timeout 503 -## -##< -## -sub read_http_header -{ - local(*HTTP) = @_; - local(%info, $_); - - ## - ## The first line of the response will be the status (OK, error, etc.) - ## - unless (defined($info{'STATUS'} = <HTTP>)) { - $info{'TYPE'} = "empty"; - return (0, %info); - } - chop $info{'STATUS'}; - - ## - ## Check the status line. If it doesn't match and we don't know the - ## format, we'll just let it pass and hope for the best. - ## - unless ($info{'STATUS'} =~ m/^HTTP\S+\s+(\d\d\d)\s+(.*\S)/i) { - $info{'TYPE'} = 'unknown'; - return (0, %info); - } - - $info{'CODE'} = $1; - $info{'TYPE'} = $2; - $info{'HEADER'} = ''; - - ## read the rest of the header. - while (<HTTP>) { - last if m/^\s*$/; - $info{'HEADER'} .= $_; ## save whole text of header. - - if (m/^([^\n:]+):[ \t]*(.*\S)/) { - local($field, $value) = ("\L$1", $2); - if (defined $info{$field}) { - $info{$field} .= "\n" . $value; - } else { - $info{$field} = $value; - } - } elsif (defined $info{'UNKNOWN'}) { - $info{'UNKNOWN'} .= $_; - } else { - $info{'UNKNOWN'} = $_; - } - } - - return ($info{'CODE'}, %info); -} - -## -##> -## -############################################################################## -## routine: grok_URL(URL, noproxy, defaultprotocol) -## -## Given a URL, returns access information. Deals with -## http, wais, gopher, ftp, and telnet -## URLs. -## -## Information returned is -## (PROTOCOL, HOST, PORT, PATH, TARGET, USER, PASSWORD) -## -## If noproxy is not given (or false) and there is a proxy defined -## for the given protocol (via the "*_proxy" environmental variable), -## the returned access information will be for the proxy and will -## reference the given URL. In this case, 'TARGET' will be the -## HOST:PORT of the original URL (PORT elided if it's the default port). -## -## Access information returned: -## PROTOCOL: "http", "ftp", etc. (guaranteed to be lowercase). -## HOST: hostname or address as given. -## PORT: port to access -## PATH: path of resource on HOST:PORT. -## TARGET: (see above) -## USER and PASSWORD: for 'ftp' and 'telnet' URLs, if supplied by the -## URL these will be defined, undefined otherwise. -## -## If no protocol is defined via the URL, the defaultprotocol will be used -## if given. Otherwise, the URL's address will be checked for a leading -## protocol name (as with a leading "www.") and if found will be used. -## Otherwise, the protocol defaults to http. -## -## Fills in the appropriate default port for the protocol if need be. -## -## A proxy is defined by a per-protocol environmental variable such -## as http_proxy. For example, you might have -## setenv http_proxy http://firewall:8080/ -## setenv ftp_proxy $http_proxy -## to set it up. -## -## A URL seems to be officially described at -## http://www.w3.org/hypertext/WWW/Addressing/URL/5_BNF.html -## although that document is a joke of errors. -## -##< -## -sub grok_URL -{ - local($_, $noproxy, $defaultprotocol) = @_; - $noproxy = defined($noproxy) && $noproxy; - - ## Items to be filled in and returned. - local($protocol, $address, $port, $path, $target, $user, $password); - - return undef unless m%^(([a-zA-Z]+)://|/*)([^/]+)(/.*)?$%; - - ## - ## Due to a bug in some versions of perl5, $2 might not be empty - ## even if $1 is. Therefore, we must check $1 for a : to see if the - ## protocol stuff matched or not. If not, the protocol is undefined. - ## - ($protocol, $address, $path) = ((index($1,":") >= 0 ? $2 : undef), $3, $4); - - if (!defined $protocol) - { - ## - ## Choose a default protocol if none given. If address begins with - ## a protocol name (one that we know via %name2protocol or - ## %default_port), choose it. Otherwise, choose http. - ## - if (defined $defaultprotocol) { - $protocol = $defaultprotocol; - } - else - { - $address =~ m/^[a-zA-Z]+/; - if (defined($name2protocol{"\L$&"})) { - $protocol = $name2protocol{"\L$&"}; - } else { - $protocol = defined($default_port{"\L$&"}) ? $& : 'http'; - } - } - } - $protocol =~ tr/A-Z/a-z/; ## ensure lower-case. - - ## - ## Http support here probably not kosher, but fits in nice for basic - ## authorization. - ## - if ($protocol eq 'ftp' || $protocol eq 'telnet' || $protocol eq 'http') - { - ## Glean a username and password from address, if there. - ## There if address starts with USER[:PASSWORD]@ - if ($address =~ s/^(([^\@:]+)(:([^@]+))?\@)//) { - ($user, $password) = ($2, $4); - } - } - - ## - ## address left is (HOSTNAME|HOSTNUM)[:PORTNUM] - ## - if ($address =~ s/:(\d+)$//) { - $port = $1; - } else { - $port = $default_port{$protocol}; - } - - ## default path is '/'; - $path = '/' if !defined $path; - - ## - ## If there's a proxy and we're to proxy this request, do so. - ## - local($proxy) = $ENV{$protocol."_proxy"}; - if (!$noproxy && defined($proxy) && !&no_proxy($protocol,$address)) - { - local($dummy); - local($old_pass, $old_user); - - ## - ## Since we're going through a proxy, we want to send the - ## proxy the entire URL that we want. However, when we're - ## doing Authenticated HTTP, we need to take out the user:password - ## that webget has encoded in the URL (this is a bit sleazy on - ## the part of webget, but the alternative is to have flags, and - ## having them part of the URL like with FTP, etc., seems a bit - ## cleaner to me in the context of how webget is used). - ## - ## So, if we're doing this slezy thing, we need to construct - ## the new URL from the compnents we have now (leaving out password - ## and user), decode the proxy URL, then return the info for - ## that host, a "filename" of the entire URL we really want, and - ## the user/password from the original URL. - ## - ## For all other things, we can just take the original URL, - ## ensure it has a protocol on it, and pass it as the "filename" - ## we want to the proxy host. The difference between reconstructing - ## the URL (as for HTTP Authentication) and just ensuring the - ## protocol is there is, except for the user/password stuff, - ## nothing. In theory, at least. - ## - if ($protocol eq 'http' && (defined($password) || defined($user))) - { - $path = "http://$address$path"; - $old_pass = $password; - $old_user = $user; - } else { - ## Re-get original URL and ensure protocol// actually there. - ## This will become our new path. - ($path = $_) =~ s,^($protocol:)?/*,$protocol://,i; - } - - ## note what the target will be - $target = ($port==$default_port{$protocol})?$address:"$address:$port"; - - ## get proxy info, discarding - ($protocol, $address, $port, $dummy, $dummy, $user, $password) - = &grok_URL($proxy, 1); - $password = $old_pass if defined $old_pass; - $user = $old_user if defined $old_user; - } - ($protocol, $address, $port, $path, $target, $user, $password); -} - - - -## -## &no_proxy($protocol, $host) -## -## Returns true if the specified host is identified in the no_proxy -## environmental variable, or identify the proxy server itself. -## -sub no_proxy -{ - local($protocol, $targethost) = @_; - local(@dests, $dest, $host, @hosts, $aliases); - local($proxy) = $ENV{$protocol."_proxy"}; - return 0 if !defined $proxy; - $targethost =~ tr/A-Z/a-z/; ## ensure all lowercase; - - @dests = ($proxy); - push(@dests,split(/\s*,\s*/,$ENV{'no_proxy'})) if defined $ENV{'no_proxy'}; - - foreach $dest (@dests) - { - ## just get the hostname - $host = (&grok_URL($dest, 1), 'http')[1]; - - if (!defined $host) { - warn "can't grok [$dest] from no_proxy env.var.\n"; - next; - } - @hosts = ($host); ## throw in original name just to make sure - ($host, $aliases) = (gethostbyname($host))[0, 1]; - - if (defined $aliases) { - push(@hosts, ($host, split(/\s+/, $aliases))); - } else { - push(@hosts, $host); - } - foreach $host (@hosts) { - next if !defined $host; - return 1 if "\L$host" eq $targethost; - } - } - return 0; -} - -sub ensure_proper_network_library -{ - require 'network.pl' if !defined $network'version; - warn "WARNING:\n". __FILE__ . - qq/ needs a newer version of "network.pl"\n/ if - !defined($network'version) || $network'version < "950311.5"; -} - - - -## -##> -############################################################################## -## open_http_connection(*FILEHANDLE, HOST, PORT, PATH, TARGET, OPTIONS...) -## -## Opens an HTTP connection to HOST:PORT and requests PATH. -## TARGET is used only for informational messages to the user. -## -## If PORT and PATH are undefined, HOST is taken as an http URL and TARGET -## is filled in as needed. -## -## Otherwise, it's the same as open_http_url (including return value, etc.). -##< -## -sub open_http_connection -{ - local(*HTTP, $host, $port, $path, $target, @options) = @_; - local($post_text, @error, %seen); - local(%info); - - &ensure_proper_network_library; - - ## options allowed: - local($post, $retry, $authorization, $nofollow, $noproxy, - $head, $debug, $ifmodifiedsince, $quiet, ) = (0) x 10; - ## parse options: - foreach $opt (@options) - { - next unless defined($opt) && $opt ne ''; - local($var, $val); - if ($opt =~ m/^(\w+)=(.*)/) { - ($var, $val) = ($1, $2); - } else { - $var = $opt; - $val = 1; - } - $var =~ tr/A-Z/a-z/; ## ensure variable is lowercase. - local(@error); - - eval "if (defined \$$var) { \$$var = \$val; } else { \@error = - ('error', 'bad open_http_connection option [$opt]'); }"; - return ('error', "open_http_connection eval: $@") if $@; - return @error if defined @error; - } - $quiet = 0 if $debug; ## debug overrides quiet - - local($protocol, $error, $code, $URL, %info, $tmp, $aite); - - ## - ## if both PORT and PATH are undefined, treat HOST as a URL. - ## - unless (defined($port) && defined($path)) - { - ($protocol,$host,$port,$path,$target)=&grok_URL($host,$noproxy,'http'); - if ($protocol ne "http") { - return ('error',"open_http_connection doesn't grok [$protocol]"); - } - unless (defined($host)) { - return ('error', "can't grok [$URL]"); - } - } - - return ('error', "no port in URL [$URL]") unless defined $port; - return ('error', "no path in URL [$URL]") unless defined $path; - - RETRY: while(1) - { - ## we'll want $URL around for error messages and such. - if ($port == $default_port{'http'}) { - $URL = "http://$host"; - } else { - $URL = "http://$host:$default_port{'http'}"; - } - $URL .= ord($path) eq ord('/') ? $path : "/$path"; - - $aite = defined($target) ? "$target via $host" : $host; - - &message($debug, "connecting to $aite ...") unless $quiet; - - ## - ## note some info that might be of use to the caller. - ## - local(%preinfo) = ( - 'PROTOCOL', 'http', - 'HOST', $host, - 'PORT', $port, - 'PATH', $path, - ); - if (defined $target) { - $preinfo{'TARGET'} = $target; - } elsif ($default_port{'http'} == $port) { - $preinfo{'TARGET'} = $host; - } else { - $preinfo{'TARGET'} = "$host:$port"; - } - - ## connect to the site - $error = &network'connect_to(*HTTP, $host, $port); - if (defined $error) { - return('error', "can't connect to $aite: $error", %preinfo); - } - - ## If we're asked to POST and it looks like a POST, note post text. - if ($post && $path =~ m/\?/) { - $post_text = $'; ## everything after the '?' - $path = $`; ## everything before the '?' - } - - ## send the POST or GET request - $tmp = $head ? 'HEAD' : (defined $post_text ? 'POST' : 'GET'); - - &message($debug, "sending request to $aite ...") if !$quiet; - print HTTP $tmp, " $path HTTP/1.0\n"; - - ## send the If-Modified-Since field if needed. - if ($ifmodifiedsince) { - print HTTP "If-Modified-Since: $ifmodifiedsince\n"; - } - - ## oh, let's sputter a few platitudes..... - print HTTP "Accept: */*\n"; - print HTTP "User-Agent: $useragent\n" if defined $useragent; - - ## If doing Authorization, do so now. - if ($authorization) { - print HTTP "Authorization: Basic ", - &htuu_encode($authorization), "\n"; - } - - ## If it's a post, send it. - if (defined $post_text) - { - print HTTP "Content-type: application/x-www-form-urlencoded\n"; - print HTTP "Content-length: ", length $post_text, "\n\n"; - print HTTP $post_text, "\n"; - } - print HTTP "\n"; - &message($debug, "waiting for data from $aite ...") unless $quiet; - - ## we can now read the response (header, then body) via HTTP. - binmode(HTTP); ## just in case. - - ($code, %info) = &read_http_header(*HTTP); - &message(1, "header returns code $code ($info{'TYPE'})") if $debug; - - ## fill in info from %preinfo - local($val, $key); - while (($val, $key) = each %preinfo) { - $info{$val} = $key; - } - - if ($code == 0) - { - return('error',"empty response for $URL") - if $info{'TYPE'} eq 'empty'; - return('error', "non-HTTP response for $URL", %info) - if $info{'TYPE'} eq 'unknown'; - return('error', "unknown zero-code for $URL", %info); - } - - if ($code == 302) ## 302 is magic for "Found" - { - if (!defined $info{'location'}) { - return('error', "No location info for Found URL $URL", %info); - } - local($newURL) = $info{'location'}; - - ## Remove :80 from hostname, if there. Looks ugly. - $newURL =~ s,^(http:/+[^/:]+):80/,$1/,i; - $info{"NewURL"} = $newURL; - - ## if we're not following links or if it's not to HTTP, return. - return('follow', $newURL, %info) if - $nofollow || $newURL!~m/^http:/i; - - ## note that we've seen this current URL. - $seen{$host, $port, $path} = 1; - - &message(1, qq/[note: now moved to "$newURL"]/) unless $quiet; - - - ## get the new one and return an error if it's been seen. - ($protocol, $host, $port, $path, $target) = - &www'grok_URL($newURL, $noproxy); - &message(1, "[$protocol][$host][$port][$path]") if $debug; - - if (defined $seen{$host, $port, $path}) - { - return('error', "circular reference among:\n ". - join("\n ", sort grep(/^http/i, keys %seen)), %seen); - } - next RETRY; - } - elsif ($code == 500) ## 500 is magic for "internal error" - { - ## - ## A proxy will often return this with text saying "can't find - ## host" when in reality it's just because the nslookup returned - ## null at the time. Such a thing should be retied again after a - ## few seconds. - ## - if ($retry) - { - local($_) = $info{'BODY'} = join('', <HTTP>); - if (/Can't locate remote host:\s*(\S+)/i) { - local($times) = ($retry == 1) ? - "once more" : "up to $retry more times"; - &message(0, "can't locate $1, will try $times ...") - unless $quiet; - sleep(5); - $retry--; - next RETRY; - } - } - } - - if ($code != 200) ## 200 is magic for "OK"; - { - ## I'll deal with these as I see them..... - &clear_message; - if ($info{'TYPE'} eq '') - { - if (defined $http_return_code{$code}) { - $info{'TYPE'} = $http_return_code{$code}; - } else { - $info{'TYPE'} = "(unknown status code $code)"; - } - } - return ('status', $info{'TYPE'}, %info); - } - - &clear_message; - return ('ok', 'ok', %info); - } -} - - -## -## Hyper Text UUencode. Somewhat different from regular uuencode. -## -## Logic taken from Mosaic for X code by Mark Riordan and Ari Luotonen. -## -sub htuu_encode -{ - local(@in) = unpack("C*", $_[0]); - local(@out); - - push(@in, 0, 0); ## in case we need to round off an odd byte or two - while (@in >= 3) { - ## - ## From the next three input bytes, - ## construct four encoded output bytes. - ## - push(@out, $in[0] >> 2); - push(@out, (($in[0] << 4) & 060) | (($in[1] >> 4) & 017)); - push(@out, (($in[1] << 2) & 074) | (($in[2] >> 6) & 003)); - push(@out, $in[2] & 077); - splice(@in, 0, 3); ## remove these three - } - - ## - ## @out elements are now indices to the string below. Convert to - ## the appropriate actual text. - ## - foreach $new (@out) { - $new = substr( - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", - $new, 1); - } - - if (@in == 2) { - ## the two left over are the two extra nulls, so we encoded the proper - ## amount as-is. - } elsif (@in == 1) { - ## We encoded one extra null too many. Undo it. - $out[$#out] = '='; - } else { - ## We must have encoded two nulls... Undo both. - $out[$#out ] = '='; - $out[$#out -1] = '='; - } - - join('', @out); -} - -## -## This message stuff really shouldn't be here, but in some seperate library. -## Sorry. -## -## Called as &message(SAVE, TEXT ....), it shoves the text to the screen. -## If SAVE is true, bumps the text out as a printed line. Otherwise, -## will shove out without a newline so that the next message overwrites it, -## or it is clearded via &clear_message(). -## -sub message -{ - local($nl) = shift; - die "oops $nl." unless $nl =~ m/^\d+$/; - local($text) = join('', @_); - local($NL) = $nl ? "\n" : "\r"; - $thislength = length($text); - if ($thislength >= $last_message_length) { - print STDERR $text, $NL; - } else { - print STDERR $text, ' 'x ($last_message_length-$thislength), $NL; - } - $last_message_length = $nl ? 0 : $thislength; -} - -sub clear_message -{ - if ($last_message_length) { - print STDERR ' ' x $last_message_length, "\r"; - $last_message_length = 0; - } -} - -1; -__END__ diff --git a/gnu/usr.bin/perl/win32/config.bc b/gnu/usr.bin/perl/win32/config.bc index eef2440d482..1b984bb08d8 100644 --- a/gnu/usr.bin/perl/win32/config.bc +++ b/gnu/usr.bin/perl/win32/config.bc @@ -1,17 +1,15 @@ ## Configured by: ~cf_email~ ## Target system: WIN32 Author='' -CONFIG='true' +CONFIGDOTSH='true' Date='$Date' Header='' Id='$Id' Locker='' Log='$Log' Mcc='Mcc' -PATCHLEVEL='~PATCHLEVEL~' RCSfile='$RCSfile' Revision='$Revision' -SUBVERSION='~SUBVERSION~' Source='' State='' _a='.lib' @@ -21,17 +19,22 @@ afs='false' alignbytes='8' ansi2knr='' aphostname='' -apiversion='5.005' +api_revision='~PERL_API_REVISION~' +api_subversion='~PERL_API_SUBVERSION~' +api_version='~PERL_API_VERSION~' +api_versionstring='~PERL_API_REVISION~.~PERL_API_VERSION~.~PERL_API_SUBVERSION~' ar='tlib /P128' -archlib='~INST_TOP~~INST_VER~\lib\~archname~' -archlibexp='~INST_TOP~~INST_VER~\lib\~archname~' +archlib='~INST_TOP~~INST_VER~\lib~INST_ARCH~' +archlibexp='~INST_TOP~~INST_VER~\lib~INST_ARCH~' +archname64='' archname='MSWin32' archobjs='' awk='awk' -baserev='5.0' +baserev='5' bash='' -bin='~INST_TOP~~INST_VER~\bin\~archname~' -binexp='~INST_TOP~~INST_VER~\bin\~archname~' +bin='~INST_TOP~~INST_VER~\bin~INST_ARCH~' +bincompat5005='undef' +binexp='~INST_TOP~~INST_VER~\bin~INST_ARCH~' bison='' byacc='byacc' byteorder='1234' @@ -42,9 +45,11 @@ cc='bcc32' cccdlflags=' ' ccdlflags='-tWD' ccflags='-DWIN32' +ccsymbols='' cf_by='nobody' cf_email='nobody@no.where.net' cf_time='' +charsize='1' chgrp='' chmod='' chown='' @@ -56,20 +61,39 @@ cp='copy' cpio='' cpp='cpp32 -oCON' cpp_stuff='42' +cppccsymbols='' cppflags='-DWIN32' cpplast='' cppminus='' cpprun='cpp32 -oCON' cppstdin='cpp32 -oCON' +cppsymbols='' +crosscompile='undef' cryptlib='' csh='undef' d_Gconvert='gcvt((x),(n),(b))' +d_PRIEldbl='undef' +d_PRIFldbl='undef' +d_PRIGldbl='undef' +d_PRIX64='undef' +d_PRId64='undef' +d_PRIeldbl='undef' +d_PRIfldbl='undef' +d_PRIgldbl='undef' +d_PRIi64='undef' +d_PRIo64='undef' +d_PRIu64='undef' +d_PRIx64='undef' d_access='define' +d_accessx='undef' d_alarm='undef' d_archlib='define' +d_atolf='undef' +d_atoll='undef' d_attribut='undef' d_bcmp='undef' d_bcopy='undef' +d_bincompat5005='undef' d_bsd='define' d_bsdgetpgrp='undef' d_bsdsetpgrp='undef' @@ -92,13 +116,16 @@ d_dlerror='define' d_dlopen='define' d_dlsymun='undef' d_dosuid='undef' +d_drand48proto='undef' d_dup2='define' +d_eaccess='undef' d_endgrent='undef' d_endhent='undef' d_endnent='undef' d_endpent='undef' d_endpwent='undef' d_endsent='undef' +d_endspent='undef' d_eofnblk='define' d_eunice='undef' d_fchmod='undef' @@ -112,8 +139,16 @@ d_flexfnam='define' d_flock='define' d_fork='undef' d_fpathconf='undef' +d_fpos64_t='undef' +d_fs_data_s='undef' +d_fseeko='undef' d_fsetpos='define' +d_fstatfs='undef' +d_fstatvfs='undef' +d_ftello='undef' d_ftime='define' +d_getcwd='undef' +d_getfsstat='undef' d_getgrent='undef' d_getgrps='undef' d_gethbyaddr='define' @@ -122,6 +157,8 @@ d_gethent='undef' d_gethname='define' d_gethostprotos='define' d_getlogin='define' +d_getmnt='undef' +d_getmntent='undef' d_getnbyaddr='undef' d_getnbyname='undef' d_getnent='undef' @@ -129,49 +166,73 @@ d_getnetprotos='undef' d_getpbyname='define' d_getpbynumber='define' d_getpent='undef' -d_getpwent='undef' d_getpgid='undef' d_getpgrp2='undef' d_getpgrp='undef' d_getppid='undef' d_getprior='undef' d_getprotoprotos='define' +d_getpwent='undef' d_getsbyname='define' d_getsbyport='define' d_getsent='undef' d_getservprotos='define' +d_getspent='undef' +d_getspnam='undef' d_gettimeod='undef' -d_grpasswd='undef' d_gnulibc='undef' +d_grpasswd='undef' +d_hasmntopt='undef' d_htonl='define' +d_iconv='undef' d_index='undef' d_inetaton='undef' +d_int64_t='undef' d_isascii='define' d_killpg='undef' d_lchown='undef' -d_link='undef' +d_ldbl_dig='define' +d_link='define' d_locconv='define' d_lockf='undef' d_longdbl='define' d_longlong='undef' +d_lseekproto='define' d_lstat='undef' +d_madvise='undef' d_mblen='define' d_mbstowcs='define' d_mbtowc='define' +d_memchr='define' d_memcmp='define' d_memcpy='define' d_memmove='define' d_memset='define' d_mkdir='define' +d_mkdtemp='undef' d_mkfifo='undef' +d_mkstemp='undef' +d_mkstemps='undef' d_mktime='define' +d_mmap='undef' +d_mprotect='undef' d_msg='undef' +d_msg_ctrunc='undef' +d_msg_dontroute='undef' +d_msg_oob='undef' +d_msg_peek='undef' +d_msg_proxy='undef' d_msgctl='undef' d_msgget='undef' d_msgrcv='undef' d_msgsnd='undef' +d_msync='undef' +d_munmap='undef' d_mymalloc='undef' d_nice='undef' +d_nv_preserves_uv='define' +d_off64_t='undef' +d_old_pthread_create_joinable='undef' d_oldpthreads='undef' d_oldsock='undef' d_open3='undef' @@ -182,15 +243,16 @@ d_pipe='define' d_poll='undef' d_portable='define' d_pthread_yield='undef' -d_pthreads_created_joinable='undef' d_pwage='undef' d_pwchange='undef' d_pwclass='undef' d_pwcomment='undef' d_pwexpire='undef' d_pwgecos='undef' -d_pwquota='undef' d_pwpasswd='undef' +d_pwquota='undef' +d_qgcvt='undef' +d_quad='undef' d_readdir='define' d_readlink='undef' d_rename='define' @@ -200,6 +262,7 @@ d_safebcpy='undef' d_safemcpy='undef' d_sanemcmp='define' d_sched_yield='undef' +d_scm_rights='undef' d_seekdir='define' d_select='define' d_sem='undef' @@ -213,7 +276,6 @@ d_seteuid='undef' d_setgrent='undef' d_setgrps='undef' d_sethent='undef' -d_setpwent='undef' d_setlinebuf='undef' d_setlocale='define' d_setnent='undef' @@ -222,6 +284,7 @@ d_setpgid='undef' d_setpgrp2='undef' d_setpgrp='undef' d_setprior='undef' +d_setpwent='undef' d_setregid='undef' d_setresgid='undef' d_setresuid='undef' @@ -230,6 +293,7 @@ d_setrgid='undef' d_setruid='undef' d_setsent='undef' d_setsid='undef' +d_setspent='undef' d_setvbuf='define' d_sfio='undef' d_shm='undef' @@ -241,10 +305,16 @@ d_shmget='undef' d_sigaction='undef' d_sigsetjmp='undef' d_socket='define' +d_socklen_t='undef' d_sockpair='undef' +d_sqrtl='undef' d_statblks='undef' +d_statfs_f_flags='undef' +d_statfs_s='undef' +d_statvfs='undef' d_stdio_cnt_lval='define' d_stdio_ptr_lval='define' +d_stdio_stream_array='undef' d_stdiobase='define' d_stdstdio='define' d_strchr='define' @@ -254,7 +324,11 @@ d_strerrm='strerror(e)' d_strerror='define' d_strtod='define' d_strtol='define' +d_strtold='undef' +d_strtoll='undef' d_strtoul='define' +d_strtoull='undef' +d_strtouq='undef' d_strxfrm='define' d_suidsafe='undef' d_symlink='undef' @@ -266,13 +340,18 @@ d_system='define' d_tcgetpgrp='undef' d_tcsetpgrp='undef' d_telldir='define' +d_telldirproto='define' d_time='define' d_times='define' d_truncate='undef' d_tzname='define' d_umask='define' -d_uname='undef' +d_uname='define' d_union_semun='define' +d_ustat='undef' +d_vendorarch='undef' +d_vendorbin='undef' +d_vendorlib='undef' d_vfork='undef' d_void_closedir='undef' d_voidsig='define' @@ -292,6 +371,7 @@ direntrytype='struct direct' dlext='dll' dlsrc='dl_win32.xs' doublesize='8' +drand01='(rand()/(double)((unsigned)1<<RANDBITS))' dynamic_ext='Socket IO Fcntl Opcode SDBM_File attrs Thread' eagain='EAGAIN' ebcdic='undef' @@ -302,14 +382,21 @@ eunicefix=':' exe_ext='.exe' expr='expr' extensions='~static_ext~ ~dynamic_ext~ ~nonxs_ext~' +fflushNULL='define' +fflushall='undef' find='find' firstmakefile='makefile' flex='' +fpossize='4' fpostype='fpos_t' freetype='void' +full_ar='' full_csh='' full_sed='' gccversion='' +gidformat='"d"' +gidsign='-1' +gidsize='4' gidtype='gid_t' glibpth='/usr/shlib /lib/pa1.1 /usr/lib/large /lib /usr/lib /usr/lib/386 /lib/386 /lib/large /usr/lib/small /lib/small /usr/ccs/lib /usr/ucblib /usr/shlib ' grep='grep' @@ -321,6 +408,14 @@ h_sysfile='true' hint='recommended' hostcat='ypcat hosts' huge='' +i16size='2' +i16type='short' +i32size='4' +i32type='long' +i64size='8' +i64type='__int64' +i8size='1' +i8type='char' i_arpainet='define' i_bsdioctl='' i_db='undef' @@ -332,74 +427,116 @@ i_fcntl='define' i_float='define' i_gdbm='undef' i_grp='undef' +i_iconv='undef' +i_ieeefp='undef' +i_inttypes='undef' i_limits='define' i_locale='define' +i_machcthr='undef' i_malloc='define' i_math='define' i_memory='undef' +i_mntent='undef' i_ndbm='undef' i_netdb='undef' i_neterrno='undef' +i_netinettcp='undef' i_niin='undef' +i_poll='undef' +i_pthread='undef' i_pwd='undef' i_rpcsvcdbm='define' i_sfio='undef' i_sgtty='undef' +i_shadow='undef' +i_socks='undef' i_stdarg='define' i_stddef='define' i_stdlib='define' i_string='define' +i_sunmath='undef' +i_sysaccess='undef' i_sysdir='undef' i_sysfile='undef' i_sysfilio='define' i_sysin='undef' i_sysioctl='undef' +i_syslog='undef' +i_sysmman='undef' +i_sysmode='undef' +i_sysmount='undef' i_sysndir='undef' i_sysparam='undef' i_sysresrc='undef' +i_syssecrt='undef' i_sysselct='undef' i_syssockio='' +i_sysstatfs='undef' +i_sysstatvfs='undef' i_sysstat='define' i_systime='undef' i_systimek='undef' i_systimes='undef' i_systypes='define' +i_sysuio='undef' i_sysun='undef' +i_sysutsname='undef' +i_sysvfs='undef' i_syswait='undef' i_termio='undef' i_termios='undef' i_time='define' i_unistd='undef' +i_ustat='undef' i_utime='define' i_values='undef' i_varargs='undef' i_varhdr='varargs.h' i_vfork='undef' +ignore_versioned_solibs='' +inc_version_list='' +inc_version_list_init='0' incpath='' inews='' -installarchlib='~INST_TOP~~INST_VER~\lib\~archname~' -installbin='~INST_TOP~~INST_VER~\bin\~archname~' +installarchlib='~INST_TOP~~INST_VER~\lib~INST_ARCH~' +installbin='~INST_TOP~~INST_VER~\bin~INST_ARCH~' installman1dir='~INST_TOP~~INST_VER~\man\man1' installman3dir='~INST_TOP~~INST_VER~\man\man3' +installprefix='~INST_TOP~~INST_VER~' +installprefixexp='~INST_TOP~~INST_VER~' installhtmldir='~INST_TOP~~INST_VER~\html' installhtmlhelpdir='~INST_TOP~~INST_VER~\htmlhelp' installprivlib='~INST_TOP~~INST_VER~\lib' installscript='~INST_TOP~~INST_VER~\bin' -installsitearch='~INST_TOP~\site~INST_VER~\lib\~archname~' +installsitearch='~INST_TOP~\site~INST_VER~\lib~INST_ARCH~' +installsitebin='~INST_TOP~~INST_VER~\bin~INST_ARCH~' installsitelib='~INST_TOP~\site~INST_VER~\lib' +installstyle='lib' +installusrbinperl='undef' +installvendorarch='' +installvendorbin='' +installvendorlib='' intsize='4' -known_extensions='DB_File Fcntl GDBM_File NDBM_File ODBM_File Opcode POSIX SDBM_File Socket IO attrs Thread' +ivdformat='"ld"' +ivsize='4' +ivtype='long' +known_extensions='~static_ext~ ~dynamic_ext~ ~nonxs_ext~' ksh='' large='' ld='tlink32' lddlflags='-Tpd ~LINK_FLAGS~' ldflags='~LINK_FLAGS~' +ldlibpthname='' less='less' lib_ext='.lib' libc='cw32mti.lib' libperl='perl.lib' libpth='' libs='' +libsdirs='' +libsfiles='' +libsfound='' +libspath='' libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' line='line' lint='' @@ -414,6 +551,7 @@ longsize='4' lp='' lpr='' ls='dir' +lseeksize='4' lseektype='off_t' mail='' mailx='' @@ -429,12 +567,13 @@ man3dir='~INST_TOP~~INST_VER~\man\man3' man3direxp='~INST_TOP~~INST_VER~\man\man3' man3ext='3' medium='' -mips='' mips_type='' mkdir='mkdir' +mmaptype='void *' models='none' modetype='mode_t' more='more /e' +multiarch='undef' mv='' myarchname='MSWin32' mydomain='' @@ -450,8 +589,11 @@ nm_opt='' nm_so_opt='' nonxs_ext='Errno' nroff='' +nvsize='8' +nvtype='double' o_nonblock='O_NONBLOCK' obj_ext='.obj' +old_pthread_create_joinable='' optimize='-O2' orderlib='false' osname='MSWin32' @@ -461,13 +603,15 @@ pager='more /e' passcat='' patchlevel='~PATCHLEVEL~' path_sep=';' +perl5='' perl='perl' perladmin='' -perlpath='~INST_TOP~~INST_VER~\bin\~archname~\perl.exe' +perlpath='~INST_TOP~~INST_VER~\bin~INST_ARCH~\perl.exe' pg='' phostname='hostname' pidtype='int' plibpth='' +pm_apiversion='5.005' pmake='' pr='' prefix='~INST_TOP~' @@ -476,15 +620,35 @@ privlib='~INST_TOP~~INST_VER~\lib' privlibexp='~INST_TOP~~INST_VER~\lib' prototype='define' ptrsize='4' +quadkind='5' +quadtype='__int64' randbits='15' +randfunc='rand' +randseedtype='unsigned' ranlib='rem' rd_nodata='-1' +revision='5' rm='del' rmail='' runnm='true' +sPRIEldbl='"E"' +sPRIFldbl='"F"' +sPRIGldbl='"G"' +sPRIX64='"lX"' +sPRId64='"ld"' +sPRIeldbl='"e"' +sPRIfldbl='"f"' +sPRIgldbl='"g"' +sPRIi64='"li"' +sPRIo64='"lo"' +sPRIu64='"lu"' +sPRIx64='"lx"' +sched_yield='' scriptdir='~INST_TOP~~INST_VER~\bin' scriptdirexp='~INST_TOP~~INST_VER~\bin' sed='sed' +seedfunc='srand' +selectminbits='32' selecttype='Perl_fd_set *' sendmail='blat' sh='cmd /x /c' @@ -494,15 +658,22 @@ shmattype='void *' shortsize='2' shrpenv='' shsharp='true' +sig_count='26' sig_name='ZERO NUM01 INT QUIT ILL NUM05 NUM06 NUM07 FPE KILL NUM10 SEGV NUM12 PIPE ALRM TERM USR1 USR2 CHLD NUM19 USR3 BREAK ABRT STOP NUM24 CONT CLD' sig_name_init='"ZERO", "NUM01", "INT", "QUIT", "ILL", "NUM05", "NUM06", "NUM07", "FPE", "KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM", "TERM", "USR1", "USR2", "CHLD", "NUM19", "USR3", "BREAK", "ABRT", "STOP", "NUM24", "CONT", "CLD", 0' sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 18 0' sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 18, 0' signal_t='void' -sitearch='~INST_TOP~\site~INST_VER~\lib\~archname~' -sitearchexp='~INST_TOP~\site~INST_VER~\lib\~archname~' +sitearch='~INST_TOP~\site~INST_VER~\lib~INST_ARCH~' +sitearchexp='~INST_TOP~\site~INST_VER~\lib~INST_ARCH~' +sitebin='~INST_TOP~\site~INST_VER~\bin~INST_ARCH~' +sitebinexp='~INST_TOP~\site~INST_VER~\bin~INST_ARCH~' sitelib='~INST_TOP~\site~INST_VER~\lib' +sitelib_stem='' sitelibexp='~INST_TOP~\site~INST_VER~\lib' +siteprefix='~INST_TOP~\site~INST_VER~' +siteprefixexp='~INST_TOP~\site~INST_VER~' +sizesize='4' sizetype='size_t' sleep='' smail='' @@ -510,6 +681,7 @@ small='' so='dll' sockethdr='' socketlib='' +socksizetype='int' sort='sort' spackage='Perl5' spitshell='' @@ -525,6 +697,7 @@ stdio_bufsiz='((fp)->level + (fp)->curp - (fp)->buffer)' stdio_cnt='((fp)->level)' stdio_filbuf='' stdio_ptr='((fp)->curp)' +stdio_stream_array='' strings='/usr/include/string.h' submit='' subversion='~SUBVERSION~' @@ -540,10 +713,30 @@ touch='touch' tr='' trnl='\012' troff='' +u16size='2' +u16type='unsigned short' +u32size='4' +u32type='unsigned long' +u64size='8' +u64type='unsigned __int64' +u8size='1' +u8type='unsigned char' +uidformat='"d"' +uidsign='-1' +uidsize='4' uidtype='uid_t' uname='uname' uniq='uniq' +uquadtype='unsigned __int64' +use5005threads='undef' +use64bitall='undef' +use64bitint='undef' usedl='define' +useithreads='undef' +uselargefiles='undef' +uselongdouble='undef' +usemorebits='undef' +usemultiplicity='undef' usemymalloc='n' usenm='false' useopcode='true' @@ -551,13 +744,38 @@ useperlio='undef' useposix='true' usesfio='false' useshrplib='yes' +usesocks='undef' usethreads='undef' +usevendorprefix='undef' usevfork='false' usrinc='/usr/include' uuname='' +uvoformat='"lo"' +uvsize='4' +uvtype='unsigned long' +uvuformat='"lu"' +uvxformat='"lx"' +vendorarch='' +vendorarchexp='' +vendorbin='' +vendorbinexp='' +vendorlib='' +vendorlib_stem='' +vendorlibexp='' +vendorprefix='' +vendorprefixexp='' version='~VERSION~' vi='' voidflags='15' xlibpth='/usr/lib/386 /lib/386' +xs_apiversion='5.6.0' zcat='' zip='zip' +PERL_REVISION='~PERL_REVISION~' +PERL_SUBVERSION='~PERL_SUBVERSION~' +PERL_VERSION='~PERL_VERSION~' +PERL_API_REVISION='~PERL_API_REVISION~' +PERL_API_SUBVERSION='~PERL_API_SUBVERSION~' +PERL_API_VERSION='~PERL_API_VERSION~' +PATCHLEVEL='~PERL_VERSION~' +SUBVERSION='~PERL_SUBVERSION~' diff --git a/gnu/usr.bin/perl/win32/config.vc b/gnu/usr.bin/perl/win32/config.vc index df6e0e02a22..f3dff460ca0 100644 --- a/gnu/usr.bin/perl/win32/config.vc +++ b/gnu/usr.bin/perl/win32/config.vc @@ -1,17 +1,15 @@ ## Configured by: ~cf_email~ ## Target system: WIN32 Author='' -CONFIG='true' +CONFIGDOTSH='true' Date='$Date' Header='' Id='$Id' Locker='' Log='$Log' Mcc='Mcc' -PATCHLEVEL='~PATCHLEVEL~' RCSfile='$RCSfile' Revision='$Revision' -SUBVERSION='~SUBVERSION~' Source='' State='' _a='.lib' @@ -21,17 +19,22 @@ afs='false' alignbytes='8' ansi2knr='' aphostname='' -apiversion='5.005' +api_revision='~PERL_API_REVISION~' +api_subversion='~PERL_API_SUBVERSION~' +api_version='~PERL_API_VERSION~' +api_versionstring='~PERL_API_REVISION~.~PERL_API_VERSION~.~PERL_API_SUBVERSION~' ar='lib' -archlib='~INST_TOP~~INST_VER~\lib\~archname~' -archlibexp='~INST_TOP~~INST_VER~\lib\~archname~' +archlib='~INST_TOP~~INST_VER~\lib~INST_ARCH~' +archlibexp='~INST_TOP~~INST_VER~\lib~INST_ARCH~' +archname64='' archname='MSWin32' archobjs='' awk='awk' -baserev='5.0' +baserev='5' bash='' -bin='~INST_TOP~~INST_VER~\bin\~archname~' -binexp='~INST_TOP~~INST_VER~\bin\~archname~' +bin='~INST_TOP~~INST_VER~\bin~INST_ARCH~' +bincompat5005='undef' +binexp='~INST_TOP~~INST_VER~\bin~INST_ARCH~' bison='' byacc='byacc' byteorder='1234' @@ -42,9 +45,11 @@ cc='cl' cccdlflags=' ' ccdlflags=' ' ccflags='-MD -DWIN32' +ccsymbols='' cf_by='nobody' cf_email='nobody@no.where.net' cf_time='' +charsize='1' chgrp='' chmod='' chown='' @@ -56,25 +61,44 @@ cp='copy' cpio='' cpp='cl -nologo -E' cpp_stuff='42' +cppccsymbols='' cppflags='-DWIN32' cpplast='' cppminus='' cpprun='cl -nologo -E' cppstdin='cl -nologo -E' +cppsymbols='' +crosscompile='undef' cryptlib='' csh='undef' d_Gconvert='sprintf((b),"%.*g",(n),(x))' +d_PRIEldbl='undef' +d_PRIFldbl='undef' +d_PRIGldbl='undef' +d_PRIX64='undef' +d_PRId64='undef' +d_PRIeldbl='undef' +d_PRIfldbl='undef' +d_PRIgldbl='undef' +d_PRIi64='undef' +d_PRIo64='undef' +d_PRIu64='undef' +d_PRIx64='undef' d_access='define' +d_accessx='undef' d_alarm='undef' d_archlib='define' +d_atolf='undef' +d_atoll='undef' d_attribut='undef' d_bcmp='undef' d_bcopy='undef' +d_bincompat5005='undef' d_bsd='define' d_bsdgetpgrp='undef' d_bsdsetpgrp='undef' d_bzero='undef' -d_casti32='define' +d_casti32='undef' d_castneg='define' d_charvspr='undef' d_chown='undef' @@ -92,13 +116,16 @@ d_dlerror='define' d_dlopen='define' d_dlsymun='undef' d_dosuid='undef' +d_drand48proto='undef' d_dup2='define' +d_eaccess='undef' d_endgrent='undef' d_endhent='undef' d_endnent='undef' d_endpent='undef' d_endpwent='undef' d_endsent='undef' +d_endspent='undef' d_eofnblk='define' d_eunice='undef' d_fchmod='undef' @@ -112,8 +139,16 @@ d_flexfnam='define' d_flock='define' d_fork='undef' d_fpathconf='undef' +d_fpos64_t='undef' +d_fs_data_s='undef' +d_fseeko='undef' d_fsetpos='define' +d_fstatfs='undef' +d_fstatvfs='undef' +d_ftello='undef' d_ftime='define' +d_getcwd='undef' +d_getfsstat='undef' d_getgrent='undef' d_getgrps='undef' d_gethbyaddr='define' @@ -122,6 +157,8 @@ d_gethent='undef' d_gethname='define' d_gethostprotos='define' d_getlogin='define' +d_getmnt='undef' +d_getmntent='undef' d_getnbyaddr='undef' d_getnbyname='undef' d_getnent='undef' @@ -129,49 +166,73 @@ d_getnetprotos='undef' d_getpbyname='define' d_getpbynumber='define' d_getpent='undef' -d_getpwent='undef' d_getpgid='undef' d_getpgrp2='undef' d_getpgrp='undef' d_getppid='undef' d_getprior='undef' d_getprotoprotos='define' +d_getpwent='undef' d_getsbyname='define' d_getsbyport='define' d_getsent='undef' d_getservprotos='define' +d_getspent='undef' +d_getspnam='undef' d_gettimeod='undef' -d_grpasswd='undef' d_gnulibc='undef' +d_grpasswd='undef' +d_hasmntopt='undef' d_htonl='define' +d_iconv='undef' d_index='undef' d_inetaton='undef' +d_int64_t='undef' d_isascii='define' d_killpg='undef' d_lchown='undef' -d_link='undef' +d_ldbl_dig='define' +d_link='define' d_locconv='define' d_lockf='undef' d_longdbl='define' d_longlong='undef' +d_lseekproto='define' d_lstat='undef' +d_madvise='undef' d_mblen='define' d_mbstowcs='define' d_mbtowc='define' +d_memchr='define' d_memcmp='define' d_memcpy='define' d_memmove='define' d_memset='define' d_mkdir='define' +d_mkdtemp='undef' d_mkfifo='undef' +d_mkstemp='undef' +d_mkstemps='undef' d_mktime='define' +d_mmap='undef' +d_mprotect='undef' d_msg='undef' +d_msg_ctrunc='undef' +d_msg_dontroute='undef' +d_msg_oob='undef' +d_msg_peek='undef' +d_msg_proxy='undef' d_msgctl='undef' d_msgget='undef' d_msgrcv='undef' d_msgsnd='undef' +d_msync='undef' +d_munmap='undef' d_mymalloc='undef' d_nice='undef' +d_nv_preserves_uv='define' +d_off64_t='undef' +d_old_pthread_create_joinable='undef' d_oldpthreads='undef' d_oldsock='undef' d_open3='undef' @@ -182,15 +243,16 @@ d_pipe='define' d_poll='undef' d_portable='define' d_pthread_yield='undef' -d_pthreads_created_joinable='undef' d_pwage='undef' d_pwchange='undef' d_pwclass='undef' d_pwcomment='undef' d_pwexpire='undef' d_pwgecos='undef' -d_pwquota='undef' d_pwpasswd='undef' +d_pwquota='undef' +d_qgcvt='undef' +d_quad='undef' d_readdir='define' d_readlink='undef' d_rename='define' @@ -200,6 +262,7 @@ d_safebcpy='undef' d_safemcpy='undef' d_sanemcmp='define' d_sched_yield='undef' +d_scm_rights='undef' d_seekdir='define' d_select='define' d_sem='undef' @@ -213,7 +276,6 @@ d_seteuid='undef' d_setgrent='undef' d_setgrps='undef' d_sethent='undef' -d_setpwent='undef' d_setlinebuf='undef' d_setlocale='define' d_setnent='undef' @@ -222,6 +284,7 @@ d_setpgid='undef' d_setpgrp2='undef' d_setpgrp='undef' d_setprior='undef' +d_setpwent='undef' d_setregid='undef' d_setresgid='undef' d_setresuid='undef' @@ -230,6 +293,7 @@ d_setrgid='undef' d_setruid='undef' d_setsent='undef' d_setsid='undef' +d_setspent='undef' d_setvbuf='define' d_sfio='undef' d_shm='undef' @@ -241,10 +305,16 @@ d_shmget='undef' d_sigaction='undef' d_sigsetjmp='undef' d_socket='define' +d_socklen_t='undef' d_sockpair='undef' +d_sqrtl='undef' d_statblks='undef' +d_statfs_f_flags='undef' +d_statfs_s='undef' +d_statvfs='undef' d_stdio_cnt_lval='define' d_stdio_ptr_lval='define' +d_stdio_stream_array='undef' d_stdiobase='define' d_stdstdio='define' d_strchr='define' @@ -254,7 +324,11 @@ d_strerrm='strerror(e)' d_strerror='define' d_strtod='define' d_strtol='define' +d_strtold='undef' +d_strtoll='undef' d_strtoul='define' +d_strtoull='undef' +d_strtouq='undef' d_strxfrm='define' d_suidsafe='undef' d_symlink='undef' @@ -266,13 +340,18 @@ d_system='define' d_tcgetpgrp='undef' d_tcsetpgrp='undef' d_telldir='define' +d_telldirproto='define' d_time='define' d_times='define' d_truncate='undef' d_tzname='define' d_umask='define' -d_uname='undef' +d_uname='define' d_union_semun='define' +d_ustat='undef' +d_vendorarch='undef' +d_vendorbin='undef' +d_vendorlib='undef' d_vfork='undef' d_void_closedir='undef' d_voidsig='define' @@ -292,6 +371,7 @@ direntrytype='struct direct' dlext='dll' dlsrc='dl_win32.xs' doublesize='8' +drand01='(rand()/(double)((unsigned)1<<RANDBITS))' dynamic_ext='Socket IO Fcntl Opcode SDBM_File attrs Thread' eagain='EAGAIN' ebcdic='undef' @@ -302,14 +382,21 @@ eunicefix=':' exe_ext='.exe' expr='expr' extensions='~static_ext~ ~dynamic_ext~ ~nonxs_ext~' +fflushNULL='define' +fflushall='undef' find='find' firstmakefile='makefile' flex='' +fpossize='4' fpostype='fpos_t' freetype='void' +full_ar='' full_csh='' full_sed='' gccversion='' +gidformat='"ld"' +gidsign='-1' +gidsize='4' gidtype='gid_t' glibpth='/usr/shlib /lib/pa1.1 /usr/lib/large /lib /usr/lib /usr/lib/386 /lib/386 /lib/large /usr/lib/small /lib/small /usr/ccs/lib /usr/ucblib /usr/shlib ' grep='grep' @@ -321,6 +408,14 @@ h_sysfile='true' hint='recommended' hostcat='ypcat hosts' huge='' +i16size='2' +i16type='short' +i32size='4' +i32type='long' +i64size='8' +i64type='__int64' +i8size='1' +i8type='char' i_arpainet='define' i_bsdioctl='' i_db='undef' @@ -332,74 +427,116 @@ i_fcntl='define' i_float='define' i_gdbm='undef' i_grp='undef' +i_iconv='undef' +i_ieeefp='undef' +i_inttypes='undef' i_limits='define' i_locale='define' +i_machcthr='undef' i_malloc='define' i_math='define' i_memory='undef' +i_mntent='undef' i_ndbm='undef' i_netdb='undef' i_neterrno='undef' +i_netinettcp='undef' i_niin='undef' +i_poll='undef' +i_pthread='undef' i_pwd='undef' i_rpcsvcdbm='define' i_sfio='undef' i_sgtty='undef' +i_shadow='undef' +i_socks='undef' i_stdarg='define' i_stddef='define' i_stdlib='define' i_string='define' +i_sunmath='undef' +i_sysaccess='undef' i_sysdir='undef' i_sysfile='undef' i_sysfilio='define' i_sysin='undef' i_sysioctl='undef' +i_syslog='undef' +i_sysmman='undef' +i_sysmode='undef' +i_sysmount='undef' i_sysndir='undef' i_sysparam='undef' i_sysresrc='undef' +i_syssecrt='undef' i_sysselct='undef' i_syssockio='' +i_sysstatfs='undef' +i_sysstatvfs='undef' i_sysstat='define' i_systime='undef' i_systimek='undef' i_systimes='undef' i_systypes='define' +i_sysuio='undef' i_sysun='undef' +i_sysutsname='undef' +i_sysvfs='undef' i_syswait='undef' i_termio='undef' i_termios='undef' i_time='define' i_unistd='undef' +i_ustat='undef' i_utime='define' i_values='undef' i_varargs='undef' i_varhdr='varargs.h' i_vfork='undef' +ignore_versioned_solibs='' +inc_version_list='' +inc_version_list_init='0' incpath='' inews='' -installarchlib='~INST_TOP~~INST_VER~\lib\~archname~' -installbin='~INST_TOP~~INST_VER~\bin\~archname~' +installarchlib='~INST_TOP~~INST_VER~\lib~INST_ARCH~' +installbin='~INST_TOP~~INST_VER~\bin~INST_ARCH~' installman1dir='~INST_TOP~~INST_VER~\man\man1' installman3dir='~INST_TOP~~INST_VER~\man\man3' +installprefix='~INST_TOP~~INST_VER~' +installprefixexp='~INST_TOP~~INST_VER~' installhtmldir='~INST_TOP~~INST_VER~\html' installhtmlhelpdir='~INST_TOP~~INST_VER~\htmlhelp' installprivlib='~INST_TOP~~INST_VER~\lib' installscript='~INST_TOP~~INST_VER~\bin' -installsitearch='~INST_TOP~\site~INST_VER~\lib\~archname~' +installsitearch='~INST_TOP~\site~INST_VER~\lib~INST_ARCH~' +installsitebin='~INST_TOP~~INST_VER~\bin~INST_ARCH~' installsitelib='~INST_TOP~\site~INST_VER~\lib' +installstyle='lib' +installusrbinperl='undef' +installvendorarch='' +installvendorbin='' +installvendorlib='' intsize='4' -known_extensions='DB_File Fcntl GDBM_File NDBM_File ODBM_File Opcode POSIX SDBM_File Socket IO attrs Thread' +ivdformat='"ld"' +ivsize='4' +ivtype='long' +known_extensions='~static_ext~ ~dynamic_ext~ ~nonxs_ext~' ksh='' large='' ld='link' lddlflags='-dll ~LINK_FLAGS~' ldflags='~LINK_FLAGS~' +ldlibpthname='' less='less' lib_ext='.lib' libc='msvcrt.lib' libperl='perl.lib' libpth='' libs='' +libsdirs='' +libsfiles='' +libsfound='' +libspath='' libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun m c cposix posix ndir dir crypt ucb bsd BSD PW x' line='line' lint='' @@ -414,6 +551,7 @@ longsize='4' lp='' lpr='' ls='dir' +lseeksize='4' lseektype='off_t' mail='' mailx='' @@ -429,12 +567,13 @@ man3dir='~INST_TOP~~INST_VER~\man\man3' man3direxp='~INST_TOP~~INST_VER~\man\man3' man3ext='3' medium='' -mips='' mips_type='' mkdir='mkdir' +mmaptype='void *' models='none' modetype='mode_t' more='more /e' +multiarch='undef' mv='' myarchname='MSWin32' mydomain='' @@ -450,8 +589,11 @@ nm_opt='' nm_so_opt='' nonxs_ext='Errno' nroff='' +nvsize='8' +nvtype='double' o_nonblock='O_NONBLOCK' obj_ext='.obj' +old_pthread_create_joinable='' optimize='-O' orderlib='false' osname='MSWin32' @@ -461,13 +603,15 @@ pager='more /e' passcat='' patchlevel='~PATCHLEVEL~' path_sep=';' +perl5='' perl='perl' perladmin='' -perlpath='~INST_TOP~~INST_VER~\bin\~archname~\perl.exe' +perlpath='~INST_TOP~~INST_VER~\bin~INST_ARCH~\perl.exe' pg='' phostname='hostname' pidtype='int' plibpth='' +pm_apiversion='5.005' pmake='' pr='' prefix='~INST_TOP~' @@ -476,15 +620,35 @@ privlib='~INST_TOP~~INST_VER~\lib' privlibexp='~INST_TOP~~INST_VER~\lib' prototype='define' ptrsize='4' +quadkind='5' +quadtype='__int64' randbits='15' +randfunc='rand' +randseedtype='unsigned' ranlib='rem' rd_nodata='-1' +revision='5' rm='del' rmail='' runnm='true' +sPRIEldbl='"E"' +sPRIFldbl='"F"' +sPRIGldbl='"G"' +sPRIX64='"lX"' +sPRId64='"ld"' +sPRIeldbl='"e"' +sPRIfldbl='"f"' +sPRIgldbl='"g"' +sPRIi64='"li"' +sPRIo64='"lo"' +sPRIu64='"lu"' +sPRIx64='"lx"' +sched_yield='' scriptdir='~INST_TOP~~INST_VER~\bin' scriptdirexp='~INST_TOP~~INST_VER~\bin' sed='sed' +seedfunc='srand' +selectminbits='32' selecttype='Perl_fd_set *' sendmail='blat' sh='cmd /x /c' @@ -494,15 +658,22 @@ shmattype='void *' shortsize='2' shrpenv='' shsharp='true' +sig_count='26' sig_name='ZERO NUM01 INT QUIT ILL NUM05 NUM06 NUM07 FPE KILL NUM10 SEGV NUM12 PIPE ALRM TERM NUM16 NUM17 NUM18 NUM19 CHLD BREAK ABRT STOP NUM24 CONT CLD' sig_name_init='"ZERO", "NUM01", "INT", "QUIT", "ILL", "NUM05", "NUM06", "NUM07", "FPE", "KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM", "TERM", "NUM16", "NUM17", "NUM18", "NUM19", "CHLD", "BREAK", "ABRT", "STOP", "NUM24", "CONT", "CLD", 0' sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 20 0' sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 20, 0' signal_t='void' -sitearch='~INST_TOP~\site~INST_VER~\lib\~archname~' -sitearchexp='~INST_TOP~\site~INST_VER~\lib\~archname~' +sitearch='~INST_TOP~\site~INST_VER~\lib~INST_ARCH~' +sitearchexp='~INST_TOP~\site~INST_VER~\lib~INST_ARCH~' +sitebin='~INST_TOP~\site~INST_VER~\bin~INST_ARCH~' +sitebinexp='~INST_TOP~\site~INST_VER~\bin~INST_ARCH~' sitelib='~INST_TOP~\site~INST_VER~\lib' +sitelib_stem='' sitelibexp='~INST_TOP~\site~INST_VER~\lib' +siteprefix='~INST_TOP~\site~INST_VER~' +siteprefixexp='~INST_TOP~\site~INST_VER~' +sizesize='4' sizetype='size_t' sleep='' smail='' @@ -510,6 +681,7 @@ small='' so='dll' sockethdr='' socketlib='' +socksizetype='int' sort='sort' spackage='Perl5' spitshell='' @@ -525,6 +697,7 @@ stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)' stdio_cnt='((fp)->_cnt)' stdio_filbuf='' stdio_ptr='((fp)->_ptr)' +stdio_stream_array='' strings='/usr/include/string.h' submit='' subversion='~SUBVERSION~' @@ -540,10 +713,30 @@ touch='touch' tr='' trnl='\012' troff='' +u16size='2' +u16type='unsigned short' +u32size='4' +u32type='unsigned long' +u64size='8' +u64type='unsigned __int64' +u8size='1' +u8type='unsigned char' +uidformat='"ld"' +uidsign='-1' +uidsize='4' uidtype='uid_t' uname='uname' uniq='uniq' +uquadtype='unsigned __int64' +use5005threads='undef' +use64bitall='undef' +use64bitint='undef' usedl='define' +useithreads='undef' +uselargefiles='undef' +uselongdouble='undef' +usemorebits='undef' +usemultiplicity='undef' usemymalloc='n' usenm='false' useopcode='true' @@ -551,13 +744,38 @@ useperlio='undef' useposix='true' usesfio='false' useshrplib='yes' +usesocks='undef' usethreads='undef' +usevendorprefix='undef' usevfork='false' usrinc='/usr/include' uuname='' +uvoformat='"lo"' +uvsize='4' +uvtype='unsigned long' +uvuformat='"lu"' +uvxformat='"lx"' +vendorarch='' +vendorarchexp='' +vendorbin='' +vendorbinexp='' +vendorlib='' +vendorlib_stem='' +vendorlibexp='' +vendorprefix='' +vendorprefixexp='' version='~VERSION~' vi='' voidflags='15' xlibpth='/usr/lib/386 /lib/386' +xs_apiversion='5.6.0' zcat='' zip='zip' +PERL_REVISION='~PERL_REVISION~' +PERL_SUBVERSION='~PERL_SUBVERSION~' +PERL_VERSION='~PERL_VERSION~' +PERL_API_REVISION='~PERL_API_REVISION~' +PERL_API_SUBVERSION='~PERL_API_SUBVERSION~' +PERL_API_VERSION='~PERL_API_VERSION~' +PATCHLEVEL='~PERL_VERSION~' +SUBVERSION='~PERL_SUBVERSION~' diff --git a/gnu/usr.bin/perl/win32/config_H.bc b/gnu/usr.bin/perl/win32/config_H.bc index 1d895dd188a..7e04ed184f5 100644 --- a/gnu/usr.bin/perl/win32/config_H.bc +++ b/gnu/usr.bin/perl/win32/config_H.bc @@ -13,7 +13,7 @@ /* * Package name : perl5 * Source directory : - * Configuration time: undef + * Configuration time: Tue Mar 21 01:26:35 2000 * Configured by : gsar * Target system : */ @@ -26,32 +26,6 @@ */ #define LOC_SED "" /**/ -/* BIN: - * This symbol holds the path of the bin directory where the package will - * be installed. Program must be prepared to deal with ~name substitution. - */ -/* BIN_EXP: - * This symbol is the filename expanded version of the BIN symbol, for - * programs that do not want to deal with that at run-time. - */ -#define BIN "c:\\perl\\5.00503\\bin\\MSWin32-x86" /**/ -#define BIN_EXP "c:\\perl\\5.00503\\bin\\MSWin32-x86" /**/ - -/* CPPSTDIN: - * This symbol contains the first part of the string which will invoke - * the C preprocessor on the standard input and produce to standard - * output. Typical value of "cc -E" or "/lib/cpp", but it can also - * call a wrapper. See CPPRUN. - */ -/* CPPMINUS: - * This symbol contains the second part of the string which will invoke - * the C preprocessor on the standard input and produce to standard - * output. This symbol will have the value "-" if CPPSTDIN needs a minus - * to specify standard input, otherwise the value is "". - */ -#define CPPSTDIN "cpp32 -oCON" -#define CPPMINUS "" - /* HAS_ALARM: * This symbol, if defined, indicates that the alarm routine is * available. @@ -197,12 +171,6 @@ */ #define HAS_FGETPOS /**/ -/* FLEXFILENAMES: - * This symbol, if defined, indicates that the system supports filenames - * longer than 14 characters. - */ -#define FLEXFILENAMES /**/ - /* HAS_FLOCK: * This symbol, if defined, indicates that the flock routine is * available to do file locking. @@ -239,13 +207,6 @@ */ /*#define HAS_GETGROUPS /**/ -/* HAS_UNAME: - * This symbol, if defined, indicates that the C program may use the - * uname() routine to derive the host name. See also HAS_GETHOSTNAME - * and PHOSTNAME. - */ -/*#define HAS_UNAME /**/ - /* HAS_GETLOGIN: * This symbol, if defined, indicates that the getlogin routine is * available to get the login name. @@ -288,31 +249,6 @@ */ /*#define HAS_GETPRIORITY /**/ -/* HAS_HTONL: - * This symbol, if defined, indicates that the htonl() routine (and - * friends htons() ntohl() ntohs()) are available to do network - * order byte swapping. - */ -/* HAS_HTONS: - * This symbol, if defined, indicates that the htons() routine (and - * friends htonl() ntohl() ntohs()) are available to do network - * order byte swapping. - */ -/* HAS_NTOHL: - * This symbol, if defined, indicates that the ntohl() routine (and - * friends htonl() htons() ntohs()) are available to do network - * order byte swapping. - */ -/* HAS_NTOHS: - * This symbol, if defined, indicates that the ntohs() routine (and - * friends htonl() htons() ntohl()) are available to do network - * order byte swapping. - */ -#define HAS_HTONL /**/ -#define HAS_HTONS /**/ -#define HAS_NTOHL /**/ -#define HAS_NTOHS /**/ - /* HAS_INET_ATON: * This symbol, if defined, indicates to the C program that the * inet_aton() function is available to parse IP address "dotted-quad" @@ -331,7 +267,7 @@ * This symbol, if defined, indicates that the link routine is * available to create hard links. */ -/*#define HAS_LINK /**/ +#define HAS_LINK /**/ /* HAS_LOCALECONV: * This symbol, if defined, indicates that the localeconv routine is @@ -416,11 +352,17 @@ */ #define HAS_MKTIME /**/ -/* HAS_MSG: - * This symbol, if defined, indicates that the entire msg*(2) library is - * supported (IPC mechanism based on message queues). +/* HAS_MSYNC: + * This symbol, if defined, indicates that the msync system call is + * available to synchronize a mapped file. */ -/*#define HAS_MSG /**/ +/*#define HAS_MSYNC /**/ + +/* HAS_MUNMAP: + * This symbol, if defined, indicates that the munmap system call is + * available to unmap a region, usually mapped by mmap(). + */ +/*#define HAS_MUNMAP /**/ /* HAS_NICE: * This symbol, if defined, indicates that the nice routine is @@ -512,12 +454,6 @@ */ #define HAS_SELECT /**/ -/* HAS_SEM: - * This symbol, if defined, indicates that the entire sem*(2) library is - * supported. - */ -/*#define HAS_SEM /**/ - /* HAS_SETEGID: * This symbol, if defined, indicates that the setegid routine is available * to change the effective gid of the current program. @@ -617,12 +553,6 @@ */ /*#define HAS_SETSID /**/ -/* HAS_SHM: - * This symbol, if defined, indicates that the entire shm*(2) library is - * supported. - */ -/*#define HAS_SHM /**/ - /* Shmat_t: * This symbol holds the return type of the shmat() system call. * Usually set to 'void *' or 'char *'. @@ -637,12 +567,6 @@ #define Shmat_t void * /**/ /*#define HAS_SHMAT_PROTOTYPE /**/ -/* USE_STAT_BLOCKS: - * This symbol is defined if this system has a stat structure declaring - * st_blksize and st_blocks. - */ -/*#define USE_STAT_BLOCKS /**/ - /* HAS_STRCHR: * This symbol is defined to indicate that the strchr()/strrchr() * functions are available for string searching. If not, try the @@ -668,25 +592,6 @@ */ #define USE_STRUCT_COPY /**/ -/* HAS_STRERROR: - * This symbol, if defined, indicates that the strerror routine is - * available to translate error numbers to strings. See the writeup - * of Strerror() in this file before you try to define your own. - */ -/* HAS_SYS_ERRLIST: - * This symbol, if defined, indicates that the sys_errlist array is - * available to translate error numbers to strings. The extern int - * sys_nerr gives the size of that table. - */ -/* Strerror: - * This preprocessor symbol is defined as a macro if strerror() is - * not available to translate error numbers to strings but sys_errlist[] - * array is there. - */ -#define HAS_STRERROR /**/ -#define HAS_SYS_ERRLIST /**/ -#define Strerror(e) strerror(e) - /* HAS_STRTOD: * This symbol, if defined, indicates that the strtod routine is * available to provide better numeric string conversion than atof(). @@ -765,11 +670,6 @@ */ #define HAS_UMASK /**/ -/* HAS_VFORK: - * This symbol, if defined, indicates that vfork() exists. - */ -/*#define HAS_VFORK /**/ - /* HASVOLATILE: * This symbol, if defined, indicates that this C compiler knows about * the volatile declaration. @@ -803,10 +703,10 @@ #define HAS_WCTOMB /**/ /* I_ARPA_INET: - * This symbol, if defined, indicates that <arpa/inet.h> exists and should - * be included. + * This symbol, if defined, indicates to the C program that it should + * include <arpa/inet.h> to get inet_addr and friends declarations. */ -/*#define I_ARPA_INET /**/ +#define I_ARPA_INET /**/ /* I_DBM: * This symbol, if defined, indicates that <dbm.h> exists and should @@ -857,32 +757,6 @@ */ #define I_FLOAT /**/ -/* I_GRP: - * This symbol, if defined, indicates to the C program that it should - * include <grp.h>. - */ -/* GRPASSWD: - * This symbol, if defined, indicates to the C program that struct group - * contains gr_passwd. - */ -/* HAS_SETGRENT: - * This symbol, if defined, indicates that the getgrent routine is - * available for initializing sequential access of the group database. - */ -/* HAS_GETGRENT: - * This symbol, if defined, indicates that the getgrent routine is - * available for sequential access of the group database. - */ -/* HAS_ENDGRENT: - * This symbol, if defined, indicates that the getgrent routine is - * available for finalizing sequential access of the group database. - */ -/*#define I_GRP /**/ -/*#define GRPASSWD /**/ -/*#define HAS_SETGRENT /**/ -/*#define HAS_GETGRENT /**/ -/*#define HAS_ENDGRENT /**/ - /* I_LIMITS: * This symbol, if defined, indicates to the C program that it should * include <limits.h> to get definition of symbols like WORD_BIT or @@ -1112,20 +986,156 @@ */ #define STDCHAR unsigned char /**/ +/* CROSSCOMPILE: + * This symbol, if defined, signifies that we our + * build process is a cross-compilation. + */ +/*#define CROSSCOMPILE /**/ + +/* INTSIZE: + * This symbol contains the value of sizeof(int) so that the C + * preprocessor can make decisions based on it. + */ +/* LONGSIZE: + * This symbol contains the value of sizeof(long) so that the C + * preprocessor can make decisions based on it. + */ +/* SHORTSIZE: + * This symbol contains the value of sizeof(short) so that the C + * preprocessor can make decisions based on it. + */ +#define INTSIZE 4 /**/ +#define LONGSIZE 4 /**/ +#define SHORTSIZE 2 /**/ + +/* MULTIARCH: + * This symbol, if defined, signifies that the build + * process will produce some binary files that are going to be + * used in a cross-platform environment. This is the case for + * example with the NeXT "fat" binaries that contain executables + * for several CPUs. + */ +/*#define MULTIARCH /**/ + +/* HAS_QUAD: + * This symbol, if defined, tells that there's a 64-bit integer type, + * Quad_t, and its unsigned counterpar, Uquad_t. QUADKIND will be one + * of QUAD_IS_INT, QUAD_IS_LONG, QUAD_IS_LONG_LONG, or QUAD_IS_INT64_T. + */ +/*#define HAS_QUAD /**/ +#ifdef HAS_QUAD +# define Quad_t __int64 /**/ +# define Uquad_t unsigned __int64 /**/ +# define QUADKIND 5 /**/ +# define QUAD_IS_INT 1 +# define QUAD_IS_LONG 2 +# define QUAD_IS_LONG_LONG 3 +# define QUAD_IS_INT64_T 4 +#endif + +/* HAS_ACCESSX: + * This symbol, if defined, indicates that the accessx routine is + * available to do extended access checks. + */ +/*#define HAS_ACCESSX /**/ + +/* HAS_EACCESS: + * This symbol, if defined, indicates that the eaccess routine is + * available to do extended access checks. + */ +/*#define HAS_EACCESS /**/ + +/* I_SYS_ACCESS: + * This symbol, if defined, indicates to the C program that it should + * include <sys/access.h>. + */ +/*#define I_SYS_ACCESS /**/ + +/* I_SYS_SECURITY: + * This symbol, if defined, indicates to the C program that it should + * include <sys/security.h>. + */ +/*#define I_SYS_SECURITY /**/ + +/* OSNAME: + * This symbol contains the name of the operating system, as determined + * by Configure. You shouldn't rely on it too much; the specific + * feature tests from Configure are generally more reliable. + */ +#define OSNAME "MSWin32" /**/ + /* MEM_ALIGNBYTES: - * This symbol contains the number of bytes required to align a - * double. Usual values are 2, 4 and 8. - * On NeXT starting with 3.2, you can build "Fat" Multiple Architecture - * Binaries (MAB) for targets with varying alignment. This only matters - * for perl, where the config.h can be generated and installed on one - * system, and used by a different architecture to build an extension. - * The default is eight, for safety. + * This symbol contains the number of bytes required to align a + * double, or a long double when applicable. Usual values are 2, + * 4 and 8. The default is eight, for safety. + */ +#if defined(CROSSCOMPILE) || defined(MULTIARCH) +# define MEM_ALIGNBYTES 8 +#else +#define MEM_ALIGNBYTES 8 +#endif + +/* ARCHLIB: + * This variable, if defined, holds the name of the directory in + * which the user wants to put architecture-dependent public + * library files for perl5. It is most often a local directory + * such as /usr/local/lib. Programs using this variable must be + * prepared to deal with filename expansion. If ARCHLIB is the + * same as PRIVLIB, it is not defined, since presumably the + * program already searches PRIVLIB. + */ +/* ARCHLIB_EXP: + * This symbol contains the ~name expanded version of ARCHLIB, to be used + * in programs that are not prepared to deal with ~ expansion at run-time. + */ +#define ARCHLIB "c:\\perl\\5.6.0\\lib\\MSWin32-x86" /**/ +/*#define ARCHLIB_EXP "" /**/ + +/* ARCHNAME: + * This symbol holds a string representing the architecture name. + * It may be used to construct an architecture-dependant pathname + * where library files may be held under a private library, for + * instance. + */ +#define ARCHNAME "MSWin32-x86" /**/ + +/* HAS_ATOLF: + * This symbol, if defined, indicates that the atolf routine is + * available to convert strings into long doubles. + */ +/*#define HAS_ATOLF /**/ + +/* HAS_ATOLL: + * This symbol, if defined, indicates that the atoll routine is + * available to convert strings into long longs. + */ +/*#define HAS_ATOLL /**/ + +/* BIN: + * This symbol holds the path of the bin directory where the package will + * be installed. Program must be prepared to deal with ~name substitution. + */ +/* BIN_EXP: + * This symbol is the filename expanded version of the BIN symbol, for + * programs that do not want to deal with that at run-time. */ -#define MEM_ALIGNBYTES 8 /**/ +#define BIN "c:\\perl\\5.6.0\\bin\\MSWin32-x86" /**/ +#define BIN_EXP "c:\\perl\\5.6.0\\bin\\MSWin32-x86" /**/ + +/* PERL_BINCOMPAT_5005: + * This symbol, if defined, indicates that this version of Perl should be + * binary-compatible with Perl 5.005. This is impossible for builds + * that use features like threads and multiplicity it is always undef + * for those versions. + */ +/*#define PERL_BINCOMPAT_5005 /**/ /* BYTEORDER: * This symbol holds the hexadecimal constant defined in byteorder, * i.e. 0x1234 or 0x4321, etc... + * If the compiler supports cross-compiling or multiple-architecture + * binaries (eg. on NeXT systems), use compiler-defined macros to + * determine the byte order. * On NeXT 3.2 (and greater), you can build "Fat" Multiple Architecture * Binaries (MAB) on either big endian or little endian machines. * The endian-ness is available at compile-time. This only matters @@ -1136,16 +1146,94 @@ * so the default case (for NeXT) is big endian to catch them. * This might matter for NeXT 3.0. */ -#ifndef NeXT +#if defined(CROSSCOMPILE) || defined(MULTIARCH) +# ifdef __LITTLE_ENDIAN__ +# if LONGSIZE == 4 +# define BYTEORDER 0x1234 +# else +# if LONGSIZE == 8 +# define BYTEORDER 0x12345678 +# endif +# endif +# else +# ifdef __BIG_ENDIAN__ +# if LONGSIZE == 4 +# define BYTEORDER 0x4321 +# else +# if LONGSIZE == 8 +# define BYTEORDER 0x87654321 +# endif +# endif +# endif +# endif +# if !defined(BYTEORDER) && (defined(NeXT) || defined(__NeXT__)) +# define BYTEORDER 0x4321 +# endif +#else #define BYTEORDER 0x1234 /* large digits for MSB */ -#else /* NeXT */ -#ifdef __LITTLE_ENDIAN__ -#define BYTEORDER 0x1234 -#else /* __BIG_ENDIAN__ */ -#define BYTEORDER 0x4321 -#endif /* ENDIAN CHECK */ #endif /* NeXT */ +/* CAT2: + * This macro catenates 2 tokens together. + */ +/* STRINGIFY: + * This macro surrounds its token with double quotes. + */ +#if 42 == 1 +# define CAT2(a,b) a/**/b +# define STRINGIFY(a) "a" + /* If you can get stringification with catify, tell me how! */ +#endif +#if 42 == 42 +# define PeRl_CaTiFy(a, b) a ## b +# define PeRl_StGiFy(a) #a +/* the additional level of indirection enables these macros to be + * used as arguments to other macros. See K&R 2nd ed., page 231. */ +# define CAT2(a,b) PeRl_CaTiFy(a,b) +# define StGiFy(a) PeRl_StGiFy(a) +# define STRINGIFY(a) PeRl_StGiFy(a) +#endif +#if 42 != 1 && 42 != 42 +#include "Bletch: How does this C preprocessor catenate tokens?" +#endif + +/* CPPSTDIN: + * This symbol contains the first part of the string which will invoke + * the C preprocessor on the standard input and produce to standard + * output. Typical value of "cc -E" or "/lib/cpp", but it can also + * call a wrapper. See CPPRUN. + */ +/* CPPMINUS: + * This symbol contains the second part of the string which will invoke + * the C preprocessor on the standard input and produce to standard + * output. This symbol will have the value "-" if CPPSTDIN needs a minus + * to specify standard input, otherwise the value is "". + */ +/* CPPRUN: + * This symbol contains the string which will invoke a C preprocessor on + * the standard input and produce to standard output. It needs to end + * with CPPLAST, after all other preprocessor flags have been specified. + * The main difference with CPPSTDIN is that this program will never be a + * pointer to a shell wrapper, i.e. it will be empty if no preprocessor is + * available directly to the user. Note that it may well be different from + * the preprocessor used to compile the C program. + */ +/* CPPLAST: + * This symbol is intended to be used along with CPPRUN in the same manner + * symbol CPPMINUS is used with CPPSTDIN. It contains either "-" or "". + */ +#define CPPSTDIN "cpp32 -oCON" +#define CPPMINUS "" +#define CPPRUN "cpp32 -oCON" +#define CPPLAST "" + +/* HAS_ACCESS: + * This manifest constant lets the C program know that the access() + * system call is available to check for accessibility using real UID/GID. + * (always present on UNIX.) + */ +#define HAS_ACCESS /**/ + /* CASTI32: * This symbol is defined if the C compiler can cast negative * or large floating point numbers to 32-bit ints. @@ -1173,320 +1261,144 @@ */ /*#define VOID_CLOSEDIR /**/ -/* Gconvert: - * This preprocessor macro is defined to convert a floating point - * number to a string without a trailing decimal point. This - * emulates the behavior of sprintf("%g"), but is sometimes much more - * efficient. If gconvert() is not available, but gcvt() drops the - * trailing decimal point, then gcvt() is used. If all else fails, - * a macro using sprintf("%g") is used. Arguments for the Gconvert - * macro are: value, number of digits, whether trailing zeros should - * be retained, and the output buffer. - * Possible values are: - * d_Gconvert='gconvert((x),(n),(t),(b))' - * d_Gconvert='gcvt((x),(n),(b))' - * d_Gconvert='sprintf((b),"%.*g",(n),(x))' - * The last two assume trailing zeros should not be kept. - */ -#define Gconvert(x,n,t,b) gcvt((x),(n),(b)) - -/* HAS_GNULIBC: - * This symbol, if defined, indicates to the C program that - * the GNU C library is being used. - */ -/*#define HAS_GNULIBC /**/ -/* HAS_ISASCII: - * This manifest constant lets the C program know that isascii - * is available. - */ -#define HAS_ISASCII /**/ - -/* HAS_LCHOWN: - * This symbol, if defined, indicates that the lchown routine is - * available to operate on a symbolic link (instead of following the - * link). - */ -/*#define HAS_LCHOWN /**/ - -/* HAS_OPEN3: - * This manifest constant lets the C program know that the three - * argument form of open(2) is available. - */ -/*#define HAS_OPEN3 /**/ - -/* HAS_SAFE_BCOPY: - * This symbol, if defined, indicates that the bcopy routine is available - * to copy potentially overlapping memory blocks. Otherwise you should - * probably use memmove() or memcpy(). If neither is defined, roll your - * own version. - */ -/*#define HAS_SAFE_BCOPY /**/ - -/* HAS_SAFE_MEMCPY: - * This symbol, if defined, indicates that the memcpy routine is available - * to copy potentially overlapping memory blocks. Otherwise you should - * probably use memmove() or memcpy(). If neither is defined, roll your - * own version. +/* HAS_CSH: + * This symbol, if defined, indicates that the C-shell exists. */ -/*#define HAS_SAFE_MEMCPY /**/ - -/* HAS_SANE_MEMCMP: - * This symbol, if defined, indicates that the memcmp routine is available - * and can be used to compare relative magnitudes of chars with their high - * bits set. If it is not defined, roll your own version. +/* CSH: + * This symbol, if defined, contains the full pathname of csh. */ -#define HAS_SANE_MEMCMP /**/ +/*#define HAS_CSH /**/ +#ifdef HAS_CSH +#define CSH "" /**/ +#endif -/* HAS_SIGACTION: - * This symbol, if defined, indicates that Vr4's sigaction() routine - * is available. +/* DLSYM_NEEDS_UNDERSCORE: + * This symbol, if defined, indicates that we need to prepend an + * underscore to the symbol name before calling dlsym(). This only + * makes sense if you *have* dlsym, which we will presume is the + * case if you're using dl_dlopen.xs. */ -/*#define HAS_SIGACTION /**/ +/*#define DLSYM_NEEDS_UNDERSCORE /**/ -/* Sigjmp_buf: - * This is the buffer type to be used with Sigsetjmp and Siglongjmp. - */ -/* Sigsetjmp: - * This macro is used in the same way as sigsetjmp(), but will invoke - * traditional setjmp() if sigsetjmp isn't available. - * See HAS_SIGSETJMP. - */ -/* Siglongjmp: - * This macro is used in the same way as siglongjmp(), but will invoke - * traditional longjmp() if siglongjmp isn't available. - * See HAS_SIGSETJMP. +/* HAS_DRAND48_PROTO: + * This symbol, if defined, indicates that the system provides + * a prototype for the drand48() function. Otherwise, it is up + * to the program to supply one. A good guess is + * extern double drand48 _((void)); */ -/*#define HAS_SIGSETJMP /**/ -#ifdef HAS_SIGSETJMP -#define Sigjmp_buf sigjmp_buf -#define Sigsetjmp(buf,save_mask) sigsetjmp((buf),(save_mask)) -#define Siglongjmp(buf,retval) siglongjmp((buf),(retval)) -#else -#define Sigjmp_buf jmp_buf -#define Sigsetjmp(buf,save_mask) setjmp((buf)) -#define Siglongjmp(buf,retval) longjmp((buf),(retval)) -#endif +/*#define HAS_DRAND48_PROTO /**/ -/* USE_STDIO_PTR: - * This symbol is defined if the _ptr and _cnt fields (or similar) - * of the stdio FILE structure can be used to access the stdio buffer - * for a file handle. If this is defined, then the FILE_ptr(fp) - * and FILE_cnt(fp) macros will also be defined and should be used - * to access these fields. - */ -/* FILE_ptr: - * This macro is used to access the _ptr field (or equivalent) of the - * FILE structure pointed to by its argument. This macro will always be - * defined if USE_STDIO_PTR is defined. - */ -/* STDIO_PTR_LVALUE: - * This symbol is defined if the FILE_ptr macro can be used as an - * lvalue. - */ -/* FILE_cnt: - * This macro is used to access the _cnt field (or equivalent) of the - * FILE structure pointed to by its argument. This macro will always be - * defined if USE_STDIO_PTR is defined. - */ -/* STDIO_CNT_LVALUE: - * This symbol is defined if the FILE_cnt macro can be used as an - * lvalue. +/* HAS_ENDGRENT: + * This symbol, if defined, indicates that the getgrent routine is + * available for finalizing sequential access of the group database. */ -#define USE_STDIO_PTR /**/ -#ifdef USE_STDIO_PTR -#define FILE_ptr(fp) ((fp)->curp) -#define STDIO_PTR_LVALUE /**/ -#define FILE_cnt(fp) ((fp)->level) -#define STDIO_CNT_LVALUE /**/ -#endif +/*#define HAS_ENDGRENT /**/ -/* USE_STDIO_BASE: - * This symbol is defined if the _base field (or similar) of the - * stdio FILE structure can be used to access the stdio buffer for - * a file handle. If this is defined, then the FILE_base(fp) macro - * will also be defined and should be used to access this field. - * Also, the FILE_bufsiz(fp) macro will be defined and should be used - * to determine the number of bytes in the buffer. USE_STDIO_BASE - * will never be defined unless USE_STDIO_PTR is. - */ -/* FILE_base: - * This macro is used to access the _base field (or equivalent) of the - * FILE structure pointed to by its argument. This macro will always be - * defined if USE_STDIO_BASE is defined. - */ -/* FILE_bufsiz: - * This macro is used to determine the number of bytes in the I/O - * buffer pointed to by _base field (or equivalent) of the FILE - * structure pointed to its argument. This macro will always be defined - * if USE_STDIO_BASE is defined. +/* HAS_ENDHOSTENT: + * This symbol, if defined, indicates that the endhostent() routine is + * available to close whatever was being used for host queries. */ -#define USE_STDIO_BASE /**/ -#ifdef USE_STDIO_BASE -#define FILE_base(fp) ((fp)->buffer) -#define FILE_bufsiz(fp) ((fp)->level + (fp)->curp - (fp)->buffer) -#endif +/*#define HAS_ENDHOSTENT /**/ -/* HAS_VPRINTF: - * This symbol, if defined, indicates that the vprintf routine is available - * to printf with a pointer to an argument list. If unavailable, you - * may need to write your own, probably in terms of _doprnt(). - */ -/* USE_CHAR_VSPRINTF: - * This symbol is defined if this system has vsprintf() returning type - * (char*). The trend seems to be to declare it as "int vsprintf()". It - * is up to the package author to declare vsprintf correctly based on the - * symbol. +/* HAS_ENDNETENT: + * This symbol, if defined, indicates that the endnetent() routine is + * available to close whatever was being used for network queries. */ -#define HAS_VPRINTF /**/ -/*#define USE_CHAR_VSPRINTF /**/ +/*#define HAS_ENDNETENT /**/ -/* DOUBLESIZE: - * This symbol contains the size of a double, so that the C preprocessor - * can make decisions based on it. +/* HAS_ENDPROTOENT: + * This symbol, if defined, indicates that the endprotoent() routine is + * available to close whatever was being used for protocol queries. */ -#define DOUBLESIZE 8 /**/ +/*#define HAS_ENDPROTOENT /**/ -/* I_TIME: - * This symbol, if defined, indicates to the C program that it should - * include <time.h>. - */ -/* I_SYS_TIME: - * This symbol, if defined, indicates to the C program that it should - * include <sys/time.h>. - */ -/* I_SYS_TIME_KERNEL: - * This symbol, if defined, indicates to the C program that it should - * include <sys/time.h> with KERNEL defined. +/* HAS_ENDPWENT: + * This symbol, if defined, indicates that the getgrent routine is + * available for finalizing sequential access of the passwd database. */ -#define I_TIME /**/ -/*#define I_SYS_TIME /**/ -/*#define I_SYS_TIME_KERNEL /**/ +/*#define HAS_ENDPWENT /**/ -/* INTSIZE: - * This symbol contains the value of sizeof(int) so that the C - * preprocessor can make decisions based on it. - */ -/* LONGSIZE: - * This symbol contains the value of sizeof(long) so that the C - * preprocessor can make decisions based on it. - */ -/* SHORTSIZE: - * This symbol contains the value of sizeof(short) so that the C - * preprocessor can make decisions based on it. +/* HAS_ENDSERVENT: + * This symbol, if defined, indicates that the endservent() routine is + * available to close whatever was being used for service queries. */ -#define INTSIZE 4 /**/ -#define LONGSIZE 4 /**/ -#define SHORTSIZE 2 /**/ +/*#define HAS_ENDSERVENT /**/ -/* VAL_O_NONBLOCK: - * This symbol is to be used during open() or fcntl(F_SETFL) to turn on - * non-blocking I/O for the file descriptor. Note that there is no way - * back, i.e. you cannot turn it blocking again this way. If you wish to - * alternatively switch between blocking and non-blocking, use the - * ioctl(FIOSNBIO) call instead, but that is not supported by all devices. - */ -/* VAL_EAGAIN: - * This symbol holds the errno error code set by read() when no data was - * present on the non-blocking file descriptor. - */ -/* RD_NODATA: - * This symbol holds the return code from read() when no data is present - * on the non-blocking file descriptor. Be careful! If EOF_NONBLOCK is - * not defined, then you can't distinguish between no data and EOF by - * issuing a read(). You'll have to find another way to tell for sure! - */ -/* EOF_NONBLOCK: - * This symbol, if defined, indicates to the C program that a read() on - * a non-blocking file descriptor will return 0 on EOF, and not the value - * held in RD_NODATA (-1 usually, in that case!). +/* HAS_ENDSPENT: + * This symbol, if defined, indicates that the endspent system call is + * available to finalize the scan of SysV shadow password entries. */ -#define VAL_O_NONBLOCK O_NONBLOCK -#define VAL_EAGAIN EAGAIN -#define RD_NODATA -1 -#define EOF_NONBLOCK +/*#define HAS_ENDSPENT /**/ -/* PTRSIZE: - * This symbol contains the size of a pointer, so that the C preprocessor - * can make decisions based on it. It will be sizeof(void *) if - * the compiler supports (void *); otherwise it will be - * sizeof(char *). +/* HAS_FD_SET: + * This symbol, when defined, indicates presence of the fd_set typedef + * in <sys/types.h> */ -#define PTRSIZE 4 /**/ +#define HAS_FD_SET /**/ -/* RANDBITS: - * This symbol contains the number of bits of random number the rand() - * function produces. Usual values are 15, 16, and 31. +/* HAS_FPOS64_T: + * This symbol will be defined if the C compiler supports fpos64_t. */ -#define RANDBITS 15 /**/ +/*#define HAS_FPOS64_T /**/ -/* SSize_t: - * This symbol holds the type used by functions that return - * a count of bytes or an error condition. It must be a signed type. - * It is usually ssize_t, but may be long or int, etc. - * It may be necessary to include <sys/types.h> or <unistd.h> - * to get any typedef'ed information. - * We will pick a type such that sizeof(SSize_t) == sizeof(Size_t). +/* HAS_STRUCT_FS_DATA: + * This symbol, if defined, indicates that the struct fs_data + * to do statfs() is supported. */ -#define SSize_t int /* signed count of bytes */ +/*#define HAS_STRUCT_FS_DATA /**/ -/* OSNAME: - * This symbol contains the name of the operating system, as determined - * by Configure. You shouldn't rely on it too much; the specific - * feature tests from Configure are generally more reliable. +/* HAS_FSEEKO: + * This symbol, if defined, indicates that the fseeko routine is + * available to fseek beyond 32 bits (useful for ILP32 hosts). */ -#define OSNAME "MSWin32" /**/ +/*#define HAS_FSEEKO /**/ -/* CAT2: - * This macro catenates 2 tokens together. +/* HAS_FSTATFS: + * This symbol, if defined, indicates that the fstatfs routine is + * available to stat filesystems by file descriptors. */ -/* STRINGIFY: - * This macro surrounds its token with double quotes. - */ -#if 42 == 1 -#define CAT2(a,b)a/**/b -#define STRINGIFY(a)"a" - /* If you can get stringification with catify, tell me how! */ -#endif -#if 42 == 42 -#define CAT2(a,b)a ## b -#define StGiFy(a)# a -#define STRINGIFY(a)StGiFy(a) -#endif -#if 42 != 1 && 42 != 42 -#include "Bletch: How does this C preprocessor catenate tokens?" -#endif +/*#define HAS_FSTATFS /**/ -/* CSH: - * This symbol, if defined, contains the full pathname of csh. +/* HAS_FTELLO: + * This symbol, if defined, indicates that the ftello routine is + * available to ftell beyond 32 bits (useful for ILP32 hosts). */ -/*#define HAS_CSH /**/ -#ifdef HAS_CSH -#define CSH "" /**/ -#endif +/*#define HAS_FTELLO /**/ -/* HAS_ENDHOSTENT: - * This symbol, if defined, indicates that the endhostent() routine is - * available to close whatever was being used for host queries. +/* Gconvert: + * This preprocessor macro is defined to convert a floating point + * number to a string without a trailing decimal point. This + * emulates the behavior of sprintf("%g"), but is sometimes much more + * efficient. If gconvert() is not available, but gcvt() drops the + * trailing decimal point, then gcvt() is used. If all else fails, + * a macro using sprintf("%g") is used. Arguments for the Gconvert + * macro are: value, number of digits, whether trailing zeros should + * be retained, and the output buffer. + * Possible values are: + * d_Gconvert='gconvert((x),(n),(t),(b))' + * d_Gconvert='gcvt((x),(n),(b))' + * d_Gconvert='sprintf((b),"%.*g",(n),(x))' + * The last two assume trailing zeros should not be kept. */ -/*#define HAS_ENDHOSTENT /**/ +#define Gconvert(x,n,t,b) gcvt((x),(n),(b)) -/* HAS_ENDNETENT: - * This symbol, if defined, indicates that the endnetent() routine is - * available to close whatever was being used for network queries. +/* HAS_GETCWD: + * This symbol, if defined, indicates that the getcwd routine is + * available to get the current working directory. */ -/*#define HAS_ENDNETENT /**/ +/*#define HAS_GETCWD /**/ -/* HAS_ENDPROTOENT: - * This symbol, if defined, indicates that the endprotoent() routine is - * available to close whatever was being used for protocol queries. +/* HAS_GETFSSTAT: + * This symbol, if defined, indicates that the getfsstat routine is + * available to stat filesystems in bulk. */ -/*#define HAS_ENDPROTOENT /**/ +/*#define HAS_GETFSSTAT /**/ -/* HAS_ENDSERVENT: - * This symbol, if defined, indicates that the endservent() routine is - * available to close whatever was being used for service queries. +/* HAS_GETGRENT: + * This symbol, if defined, indicates that the getgrent routine is + * available for sequential access of the group database. */ -/*#define HAS_ENDSERVENT /**/ +/*#define HAS_GETGRENT /**/ /* HAS_GETHOSTBYADDR: * This symbol, if defined, indicates that the gethostbyaddr() routine is @@ -1506,6 +1418,55 @@ */ /*#define HAS_GETHOSTENT /**/ +/* HAS_GETHOSTNAME: + * This symbol, if defined, indicates that the C program may use the + * gethostname() routine to derive the host name. See also HAS_UNAME + * and PHOSTNAME. + */ +/* HAS_UNAME: + * This symbol, if defined, indicates that the C program may use the + * uname() routine to derive the host name. See also HAS_GETHOSTNAME + * and PHOSTNAME. + */ +/* PHOSTNAME: + * This symbol, if defined, indicates the command to feed to the + * popen() routine to derive the host name. See also HAS_GETHOSTNAME + * and HAS_UNAME. Note that the command uses a fully qualified path, + * so that it is safe even if used by a process with super-user + * privileges. + */ +/* HAS_PHOSTNAME: + * This symbol, if defined, indicates that the C program may use the + * contents of PHOSTNAME as a command to feed to the popen() routine + * to derive the host name. + */ +#define HAS_GETHOSTNAME /**/ +#define HAS_UNAME /**/ +/*#define HAS_PHOSTNAME /**/ +#ifdef HAS_PHOSTNAME +#define PHOSTNAME "" /* How to get the host name */ +#endif + +/* HAS_GETHOST_PROTOS: + * This symbol, if defined, indicates that <netdb.h> includes + * prototypes for gethostent(), gethostbyname(), and + * gethostbyaddr(). Otherwise, it is up to the program to guess + * them. See netdbtype.U for probing for various Netdb_xxx_t types. + */ +#define HAS_GETHOST_PROTOS /**/ + +/* HAS_GETMNT: + * This symbol, if defined, indicates that the getmnt routine is + * available to get filesystem mount info by filename. + */ +/*#define HAS_GETMNT /**/ + +/* HAS_GETMNTENT: + * This symbol, if defined, indicates that the getmntent routine is + * available to iterate through mounted file systems to get their info. + */ +/*#define HAS_GETMNTENT /**/ + /* HAS_GETNETBYADDR: * This symbol, if defined, indicates that the getnetbyaddr() routine is * available to look up networks by their IP addresses. @@ -1524,6 +1485,14 @@ */ /*#define HAS_GETNETENT /**/ +/* HAS_GETNET_PROTOS: + * This symbol, if defined, indicates that <netdb.h> includes + * prototypes for getnetent(), getnetbyname(), and + * getnetbyaddr(). Otherwise, it is up to the program to guess + * them. See netdbtype.U for probing for various Netdb_xxx_t types. + */ +/*#define HAS_GETNET_PROTOS /**/ + /* HAS_GETPROTOENT: * This symbol, if defined, indicates that the getprotoent() routine is * available to look up protocols in some data base or another. @@ -1541,12 +1510,47 @@ #define HAS_GETPROTOBYNAME /**/ #define HAS_GETPROTOBYNUMBER /**/ +/* HAS_GETPROTO_PROTOS: + * This symbol, if defined, indicates that <netdb.h> includes + * prototypes for getprotoent(), getprotobyname(), and + * getprotobyaddr(). Otherwise, it is up to the program to guess + * them. See netdbtype.U for probing for various Netdb_xxx_t types. + */ +#define HAS_GETPROTO_PROTOS /**/ + +/* HAS_GETPWENT: + * This symbol, if defined, indicates that the getpwent routine is + * available for sequential access of the passwd database. + * If this is not available, the older getpw() function may be available. + */ +/*#define HAS_GETPWENT /**/ + /* HAS_GETSERVENT: * This symbol, if defined, indicates that the getservent() routine is * available to look up network services in some data base or another. */ /*#define HAS_GETSERVENT /**/ +/* HAS_GETSERV_PROTOS: + * This symbol, if defined, indicates that <netdb.h> includes + * prototypes for getservent(), getservbyname(), and + * getservbyaddr(). Otherwise, it is up to the program to guess + * them. See netdbtype.U for probing for various Netdb_xxx_t types. + */ +#define HAS_GETSERV_PROTOS /**/ + +/* HAS_GETSPENT: + * This symbol, if defined, indicates that the getspent system call is + * available to retrieve SysV shadow password entries sequentially. + */ +/*#define HAS_GETSPENT /**/ + +/* HAS_GETSPNAM: + * This symbol, if defined, indicates that the getspnam system call is + * available to retrieve SysV shadow password entries by name. + */ +/*#define HAS_GETSPNAM /**/ + /* HAS_GETSERVBYNAME: * This symbol, if defined, indicates that the getservbyname() * routine is available to look up services by their name. @@ -1558,6 +1562,72 @@ #define HAS_GETSERVBYNAME /**/ #define HAS_GETSERVBYPORT /**/ +/* HAS_GNULIBC: + * This symbol, if defined, indicates to the C program that + * the GNU C library is being used. + */ +/*#define HAS_GNULIBC /**/ +#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE) +# define _GNU_SOURCE +#endif +/* HAS_HASMNTOPT: + * This symbol, if defined, indicates that the hasmntopt routine is + * available to query the mount options of file systems. + */ +/*#define HAS_HASMNTOPT /**/ + +/* HAS_HTONL: + * This symbol, if defined, indicates that the htonl() routine (and + * friends htons() ntohl() ntohs()) are available to do network + * order byte swapping. + */ +/* HAS_HTONS: + * This symbol, if defined, indicates that the htons() routine (and + * friends htonl() ntohl() ntohs()) are available to do network + * order byte swapping. + */ +/* HAS_NTOHL: + * This symbol, if defined, indicates that the ntohl() routine (and + * friends htonl() htons() ntohs()) are available to do network + * order byte swapping. + */ +/* HAS_NTOHS: + * This symbol, if defined, indicates that the ntohs() routine (and + * friends htonl() htons() ntohl()) are available to do network + * order byte swapping. + */ +#define HAS_HTONL /**/ +#define HAS_HTONS /**/ +#define HAS_NTOHL /**/ +#define HAS_NTOHS /**/ + +/* HAS_ICONV: + * This symbol, if defined, indicates that the iconv routine is + * available to do character set conversions. + */ +/*#define HAS_ICONV /**/ + +/* HAS_INT64_T: + * This symbol will defined if the C compiler supports int64_t. + * Usually the <inttypes.h> needs to be included, but sometimes + * <sys/types.h> is enough. + */ +/*#define HAS_INT64_T /**/ + +/* HAS_ISASCII: + * This manifest constant lets the C program know that isascii + * is available. + */ +#define HAS_ISASCII /**/ + +/* HAS_LDBL_DIG: + * This symbol, if defined, indicates that this system's <float.h> + * or <limits.h> defines the symbol LDBL_DIG, which is the number + * of significant digits in a long double precision number. Unlike + * for DBL_DIG, there's no good guess for LDBL_DIG if it is undefined. + */ +#define HAS_LDBL_DIG /**/ + /* HAS_LONG_DOUBLE: * This symbol will be defined if the C compiler supports long * doubles. @@ -1573,8 +1643,7 @@ #endif /* HAS_LONG_LONG: - * This symbol will be defined if the C compiler supports - * long long. + * This symbol will be defined if the C compiler supports long long. */ /* LONGLONGSIZE: * This symbol contains the size of a long long, so that the @@ -1586,6 +1655,145 @@ #define LONGLONGSIZE 8 /**/ #endif +/* HAS_LSEEK_PROTO: + * This symbol, if defined, indicates that the system provides + * a prototype for the lseek() function. Otherwise, it is up + * to the program to supply one. A good guess is + * extern off_t lseek(int, off_t, int); + */ +#define HAS_LSEEK_PROTO /**/ + +/* HAS_MADVISE: + * This symbol, if defined, indicates that the madvise system call is + * available to map a file into memory. + */ +/*#define HAS_MADVISE /**/ + +/* HAS_MEMCHR: + * This symbol, if defined, indicates that the memchr routine is available + * to locate characters within a C string. + */ +#define HAS_MEMCHR /**/ + +/* HAS_MKDTEMP: + * This symbol, if defined, indicates that the mkdtemp routine is + * available to exclusively create a uniquely named temporary directory. + */ +/*#define HAS_MKDTEMP /**/ + +/* HAS_MKSTEMP: + * This symbol, if defined, indicates that the mkstemp routine is + * available to exclusively create and open a uniquely named + * temporary file. + */ +/*#define HAS_MKSTEMP /**/ + +/* HAS_MKSTEMPS: + * This symbol, if defined, indicates that the mkstemps routine is + * available to excluslvely create and open a uniquely named + * (with a suffix) temporary file. + */ +/*#define HAS_MKSTEMPS /**/ + +/* HAS_MMAP: + * This symbol, if defined, indicates that the mmap system call is + * available to map a file into memory. + */ +/* Mmap_t: + * This symbol holds the return type of the mmap() system call + * (and simultaneously the type of the first argument). + * Usually set to 'void *' or 'cadd_t'. + */ +/*#define HAS_MMAP /**/ +#define Mmap_t void * /**/ + +/* HAS_MPROTECT: + * This symbol, if defined, indicates that the mprotect system call is + * available to modify the access protection of a memory mapped file. + */ +/*#define HAS_MPROTECT /**/ + +/* HAS_MSG: + * This symbol, if defined, indicates that the entire msg*(2) library is + * supported (IPC mechanism based on message queues). + */ +/*#define HAS_MSG /**/ + +/* HAS_OFF64_T: + * This symbol will be defined if the C compiler supports off64_t. + */ +/*#define HAS_OFF64_T /**/ + +/* HAS_OPEN3: + * This manifest constant lets the C program know that the three + * argument form of open(2) is available. + */ +/*#define HAS_OPEN3 /**/ + +/* OLD_PTHREAD_CREATE_JOINABLE: + * This symbol, if defined, indicates how to create pthread + * in joinable (aka undetached) state. NOTE: not defined + * if pthread.h already has defined PTHREAD_CREATE_JOINABLE + * (the new version of the constant). + * If defined, known values are PTHREAD_CREATE_UNDETACHED + * and __UNDETACHED. + */ +/*#define OLD_PTHREAD_CREATE_JOINABLE /**/ + +/* HAS_PTHREAD_YIELD: + * This symbol, if defined, indicates that the pthread_yield + * routine is available to yield the execution of the current + * thread. sched_yield is preferable to pthread_yield. + */ +/* SCHED_YIELD: + * This symbol defines the way to yield the execution of + * the current thread. Known ways are sched_yield, + * pthread_yield, and pthread_yield with NULL. + */ +/* HAS_SCHED_YIELD: + * This symbol, if defined, indicates that the sched_yield + * routine is available to yield the execution of the current + * thread. sched_yield is preferable to pthread_yield. + */ +/*#define HAS_PTHREAD_YIELD /**/ +#define SCHED_YIELD /**/ +/*#define HAS_SCHED_YIELD /**/ + +/* HAS_SAFE_BCOPY: + * This symbol, if defined, indicates that the bcopy routine is available + * to copy potentially overlapping memory blocks. Otherwise you should + * probably use memmove() or memcpy(). If neither is defined, roll your + * own version. + */ +/*#define HAS_SAFE_BCOPY /**/ + +/* HAS_SAFE_MEMCPY: + * This symbol, if defined, indicates that the memcpy routine is available + * to copy potentially overlapping memory blocks. Otherwise you should + * probably use memmove() or memcpy(). If neither is defined, roll your + * own version. + */ +/*#define HAS_SAFE_MEMCPY /**/ + +/* HAS_SANE_MEMCMP: + * This symbol, if defined, indicates that the memcmp routine is available + * and can be used to compare relative magnitudes of chars with their high + * bits set. If it is not defined, roll your own version. + */ +#define HAS_SANE_MEMCMP /**/ + +/* HAS_SEM: + * This symbol, if defined, indicates that the entire sem*(2) library is + * supported. + */ +/*#define HAS_SEM /**/ + +/* HAS_SETGRENT: + * This symbol, if defined, indicates that the setgrent routine is + * available for initializing sequential access of the group database. + */ +/*#define HAS_SETGRENT /**/ + /* HAS_SETGROUPS: * This symbol, if defined, indicates that the setgroups() routine is * available to set the list of process groups. If unavailable, multiple @@ -1611,12 +1819,24 @@ */ /*#define HAS_SETPROTOENT /**/ +/* HAS_SETPWENT: + * This symbol, if defined, indicates that the setpwent routine is + * available for initializing sequential access of the passwd database. + */ +/*#define HAS_SETPWENT /**/ + /* HAS_SETSERVENT: * This symbol, if defined, indicates that the setservent() routine is * available. */ /*#define HAS_SETSERVENT /**/ +/* HAS_SETSPENT: + * This symbol, if defined, indicates that the setspent system call is + * available to initialize the scan of SysV shadow password entries. + */ +/*#define HAS_SETSPENT /**/ + /* HAS_SETVBUF: * This symbol, if defined, indicates that the setvbuf routine is * available to change buffering on an open stdio stream. @@ -1624,6 +1844,55 @@ */ #define HAS_SETVBUF /**/ +/* USE_SFIO: + * This symbol, if defined, indicates that sfio should + * be used. + */ +/*#define USE_SFIO /**/ + +/* HAS_SHM: + * This symbol, if defined, indicates that the entire shm*(2) library is + * supported. + */ +/*#define HAS_SHM /**/ + +/* HAS_SIGACTION: + * This symbol, if defined, indicates that Vr4's sigaction() routine + * is available. + */ +/*#define HAS_SIGACTION /**/ + +/* HAS_SIGSETJMP: + * This variable indicates to the C program that the sigsetjmp() + * routine is available to save the calling process's registers + * and stack environment for later use by siglongjmp(), and + * to optionally save the process's signal mask. See + * Sigjmp_buf, Sigsetjmp, and Siglongjmp. + */ +/* Sigjmp_buf: + * This is the buffer type to be used with Sigsetjmp and Siglongjmp. + */ +/* Sigsetjmp: + * This macro is used in the same way as sigsetjmp(), but will invoke + * traditional setjmp() if sigsetjmp isn't available. + * See HAS_SIGSETJMP. + */ +/* Siglongjmp: + * This macro is used in the same way as siglongjmp(), but will invoke + * traditional longjmp() if siglongjmp isn't available. + * See HAS_SIGSETJMP. + */ +/*#define HAS_SIGSETJMP /**/ +#ifdef HAS_SIGSETJMP +#define Sigjmp_buf sigjmp_buf +#define Sigsetjmp(buf,save_mask) sigsetjmp((buf),(save_mask)) +#define Siglongjmp(buf,retval) siglongjmp((buf),(retval)) +#else +#define Sigjmp_buf jmp_buf +#define Sigsetjmp(buf,save_mask) setjmp((buf)) +#define Siglongjmp(buf,retval) longjmp((buf),(retval)) +#endif + /* HAS_SOCKET: * This symbol, if defined, indicates that the BSD socket interface is * supported. @@ -1632,8 +1901,205 @@ * This symbol, if defined, indicates that the BSD socketpair() call is * supported. */ -#define HAS_SOCKET /**/ -/*#define HAS_SOCKETPAIR /**/ +/* HAS_MSG_CTRUNC: + * This symbol, if defined, indicates that the MSG_CTRUNC is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +/* HAS_MSG_DONTROUTE: + * This symbol, if defined, indicates that the MSG_DONTROUTE is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +/* HAS_MSG_OOB: + * This symbol, if defined, indicates that the MSG_OOB is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +/* HAS_MSG_PEEK: + * This symbol, if defined, indicates that the MSG_PEEK is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +/* HAS_MSG_PROXY: + * This symbol, if defined, indicates that the MSG_PROXY is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +/* HAS_SCM_RIGHTS: + * This symbol, if defined, indicates that the SCM_RIGHTS is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +#define HAS_SOCKET /**/ +/*#define HAS_SOCKETPAIR /**/ +/*#define HAS_MSG_CTRUNC /**/ +/*#define HAS_MSG_DONTROUTE /**/ +/*#define HAS_MSG_OOB /**/ +/*#define HAS_MSG_PEEK /**/ +/*#define HAS_MSG_PROXY /**/ +/*#define HAS_SCM_RIGHTS /**/ + +/* HAS_SQRTL: + * This symbol, if defined, indicates that the sqrtl routine is + * available to do long double square roots. + */ +/*#define HAS_SQRTL /**/ + +/* USE_STAT_BLOCKS: + * This symbol is defined if this system has a stat structure declaring + * st_blksize and st_blocks. + */ +#ifndef USE_STAT_BLOCKS +/*#define USE_STAT_BLOCKS /**/ +#endif + +/* HAS_STRUCT_STATFS_F_FLAGS: + * This symbol, if defined, indicates that the struct statfs + * does have the f_flags member containing the mount flags of + * the filesystem containing the file. + * This kind of struct statfs is coming from <sys/mount.h> (BSD 4.3), + * not from <sys/statfs.h> (SYSV). Older BSDs (like Ultrix) do not + * have statfs() and struct statfs, they have ustat() and getmnt() + * with struct ustat and struct fs_data. + */ +/*#define HAS_STRUCT_STATFS_F_FLAGS /**/ + +/* HAS_STRUCT_STATFS: + * This symbol, if defined, indicates that the struct statfs + * to do statfs() is supported. + */ +/*#define HAS_STRUCT_STATFS /**/ + +/* HAS_FSTATVFS: + * This symbol, if defined, indicates that the fstatvfs routine is + * available to stat filesystems by file descriptors. + */ +/*#define HAS_FSTATVFS /**/ + +/* USE_STDIO_PTR: + * This symbol is defined if the _ptr and _cnt fields (or similar) + * of the stdio FILE structure can be used to access the stdio buffer + * for a file handle. If this is defined, then the FILE_ptr(fp) + * and FILE_cnt(fp) macros will also be defined and should be used + * to access these fields. + */ +/* FILE_ptr: + * This macro is used to access the _ptr field (or equivalent) of the + * FILE structure pointed to by its argument. This macro will always be + * defined if USE_STDIO_PTR is defined. + */ +/* STDIO_PTR_LVALUE: + * This symbol is defined if the FILE_ptr macro can be used as an + * lvalue. + */ +/* FILE_cnt: + * This macro is used to access the _cnt field (or equivalent) of the + * FILE structure pointed to by its argument. This macro will always be + * defined if USE_STDIO_PTR is defined. + */ +/* STDIO_CNT_LVALUE: + * This symbol is defined if the FILE_cnt macro can be used as an + * lvalue. + */ +#define USE_STDIO_PTR /**/ +#ifdef USE_STDIO_PTR +#define FILE_ptr(fp) ((fp)->curp) +#define STDIO_PTR_LVALUE /**/ +#define FILE_cnt(fp) ((fp)->level) +#define STDIO_CNT_LVALUE /**/ +#endif + +/* USE_STDIO_BASE: + * This symbol is defined if the _base field (or similar) of the + * stdio FILE structure can be used to access the stdio buffer for + * a file handle. If this is defined, then the FILE_base(fp) macro + * will also be defined and should be used to access this field. + * Also, the FILE_bufsiz(fp) macro will be defined and should be used + * to determine the number of bytes in the buffer. USE_STDIO_BASE + * will never be defined unless USE_STDIO_PTR is. + */ +/* FILE_base: + * This macro is used to access the _base field (or equivalent) of the + * FILE structure pointed to by its argument. This macro will always be + * defined if USE_STDIO_BASE is defined. + */ +/* FILE_bufsiz: + * This macro is used to determine the number of bytes in the I/O + * buffer pointed to by _base field (or equivalent) of the FILE + * structure pointed to its argument. This macro will always be defined + * if USE_STDIO_BASE is defined. + */ +#define USE_STDIO_BASE /**/ +#ifdef USE_STDIO_BASE +#define FILE_base(fp) ((fp)->buffer) +#define FILE_bufsiz(fp) ((fp)->level + (fp)->curp - (fp)->buffer) +#endif + +/* HAS_STRERROR: + * This symbol, if defined, indicates that the strerror routine is + * available to translate error numbers to strings. See the writeup + * of Strerror() in this file before you try to define your own. + */ +/* HAS_SYS_ERRLIST: + * This symbol, if defined, indicates that the sys_errlist array is + * available to translate error numbers to strings. The extern int + * sys_nerr gives the size of that table. + */ +/* Strerror: + * This preprocessor symbol is defined as a macro if strerror() is + * not available to translate error numbers to strings but sys_errlist[] + * array is there. + */ +#define HAS_STRERROR /**/ +#define HAS_SYS_ERRLIST /**/ +#define Strerror(e) strerror(e) + +/* HAS_STRTOLD: + * This symbol, if defined, indicates that the strtold routine is + * available to convert strings to long doubles. + */ +/*#define HAS_STRTOLD /**/ + +/* HAS_STRTOLL: + * This symbol, if defined, indicates that the strtoll routine is + * available to convert strings to long longs. + */ +/*#define HAS_STRTOLL /**/ + +/* HAS_STRTOULL: + * This symbol, if defined, indicates that the strtoull routine is + * available to convert strings to unsigned long longs. + */ +/*#define HAS_STRTOULL /**/ + +/* HAS_STRTOUQ: + * This symbol, if defined, indicates that the strtouq routine is + * available to convert strings to unsigned long longs (quads). + */ +/*#define HAS_STRTOUQ /**/ + +/* HAS_TELLDIR_PROTO: + * This symbol, if defined, indicates that the system provides + * a prototype for the telldir() function. Otherwise, it is up + * to the program to supply one. A good guess is + * extern long telldir _((DIR*)); + */ +#define HAS_TELLDIR_PROTO /**/ + +/* Time_t: + * This symbol holds the type returned by time(). It can be long, + * or time_t on BSD sites (in which case <sys/types.h> should be + * included). + */ +#define Time_t time_t /* Time type */ + +/* HAS_TIMES: + * This symbol, if defined, indicates that the times() routine exists. + * Note that this became obsolete on some systems (SUNOS), which now + * use getrusage(). It may be necessary to include <sys/times.h>. + */ +#define HAS_TIMES /**/ /* HAS_UNION_SEMUN: * This symbol, if defined, indicates that the union semun is @@ -1657,6 +2123,17 @@ /*#define USE_SEMCTL_SEMUN /**/ /*#define USE_SEMCTL_SEMID_DS /**/ +/* HAS_USTAT: + * This symbol, if defined, indicates that the ustat system call is + * available to query file system statistics by dev_t. + */ +/*#define HAS_USTAT /**/ + +/* HAS_VFORK: + * This symbol, if defined, indicates that vfork() exists. + */ +/*#define HAS_VFORK /**/ + /* Signal_t: * This symbol's value is either "void" or "int", corresponding to the * appropriate return type of a signal handler. Thus, you can declare @@ -1665,25 +2142,175 @@ */ #define Signal_t void /* Signal handler's return type */ +/* HAS_VPRINTF: + * This symbol, if defined, indicates that the vprintf routine is available + * to printf with a pointer to an argument list. If unavailable, you + * may need to write your own, probably in terms of _doprnt(). + */ +/* USE_CHAR_VSPRINTF: + * This symbol is defined if this system has vsprintf() returning type + * (char*). The trend seems to be to declare it as "int vsprintf()". It + * is up to the package author to declare vsprintf correctly based on the + * symbol. + */ +#define HAS_VPRINTF /**/ +/*#define USE_CHAR_VSPRINTF /**/ + +/* USE_DYNAMIC_LOADING: + * This symbol, if defined, indicates that dynamic loading of + * some sort is available. + */ +#define USE_DYNAMIC_LOADING /**/ + +/* DOUBLESIZE: + * This symbol contains the size of a double, so that the C preprocessor + * can make decisions based on it. + */ +#define DOUBLESIZE 8 /**/ + +/* EBCDIC: + * This symbol, if defined, indicates that this system uses + * EBCDIC encoding. + */ +/*#define EBCDIC /**/ + +/* FFLUSH_NULL: + * This symbol, if defined, tells that fflush(NULL) does flush + * all pending stdio output. + */ +/* FFLUSH_ALL: + * This symbol, if defined, tells that to flush + * all pending stdio output one must loop through all + * the stdio file handles stored in an array and fflush them. + * Note that if fflushNULL is defined, fflushall will not + * even be probed for and will be left undefined. + */ +#define FFLUSH_NULL /**/ +/*#define FFLUSH_ALL /**/ + +/* Fpos_t: + * This symbol holds the type used to declare file positions in libc. + * It can be fpos_t, long, uint, etc... It may be necessary to include + * <sys/types.h> to get any typedef'ed information. + */ +#define Fpos_t fpos_t /* File position type */ + +/* Gid_t_f: + * This symbol defines the format string used for printing a Gid_t. + */ +#define Gid_t_f "d" /**/ + +/* Gid_t_sign: + * This symbol holds the signedess of a Gid_t. + * 1 for unsigned, -1 for signed. + */ +#define Gid_t_sign -1 /* GID sign */ + +/* Gid_t_size: + * This symbol holds the size of a Gid_t in bytes. + */ +#define Gid_t_size 4 /* GID size */ + +/* Gid_t: + * This symbol holds the return type of getgid() and the type of + * argument to setrgid() and related functions. Typically, + * it is the type of group ids in the kernel. It can be int, ushort, + * gid_t, etc... It may be necessary to include <sys/types.h> to get + * any typedef'ed information. + */ +#define Gid_t gid_t /* Type for getgid(), etc... */ + /* Groups_t: * This symbol holds the type used for the second argument to - * getgroups() and setgropus(). Usually, this is the same as + * getgroups() and setgroups(). Usually, this is the same as * gidtype (gid_t) , but sometimes it isn't. - * It can be int, ushort, uid_t, etc... + * It can be int, ushort, gid_t, etc... * It may be necessary to include <sys/types.h> to get any * typedef'ed information. This is only required if you have - * getgroups() or setgropus().. + * getgroups() or setgroups().. */ #if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS) #define Groups_t gid_t /* Type for 2nd arg to [sg]etgroups() */ #endif +/* DB_Prefix_t: + * This symbol contains the type of the prefix structure element + * in the <db.h> header file. In older versions of DB, it was + * int, while in newer ones it is u_int32_t. + */ +/* DB_Hash_t: + * This symbol contains the type of the prefix structure element + * in the <db.h> header file. In older versions of DB, it was + * int, while in newer ones it is size_t. + */ +#define DB_Hash_t int /**/ +#define DB_Prefix_t int /**/ + +/* I_GRP: + * This symbol, if defined, indicates to the C program that it should + * include <grp.h>. + */ +/* GRPASSWD: + * This symbol, if defined, indicates to the C program that struct group + * in <grp.h> contains gr_passwd. + */ +/*#define I_GRP /**/ +/*#define GRPASSWD /**/ + +/* I_ICONV: + * This symbol, if defined, indicates that <iconv.h> exists and + * should be included. + */ +/*#define I_ICONV /**/ + +/* I_IEEEFP: + * This symbol, if defined, indicates that <ieeefp.h> exists and + * should be included. + */ +/*#define I_IEEEFP /**/ + +/* I_INTTYPES: + * This symbol, if defined, indicates to the C program that it should + * include <inttypes.h>. + */ +/*#define I_INTTYPES /**/ + +/* I_MACH_CTHREADS: + * This symbol, if defined, indicates to the C program that it should + * include <mach/cthreads.h>. + */ +/*#define I_MACH_CTHREADS /**/ + +/* I_MNTENT: + * This symbol, if defined, indicates that <mntent.h> exists and + * should be included. + */ +/*#define I_MNTENT /**/ + /* I_NETDB: * This symbol, if defined, indicates that <netdb.h> exists and * should be included. */ /*#define I_NETDB /**/ +/* I_NETINET_TCP: + * This symbol, if defined, indicates to the C program that it should + * include <netinet/tcp.h>. + */ +/*#define I_NETINET_TCP /**/ + +/* I_POLL: + * This symbol, if defined, indicates that <poll.h> exists and + * should be included. + */ +/*#define I_POLL /**/ + +/* I_PTHREAD: + * This symbol, if defined, indicates to the C program that it should + * include <pthread.h>. + */ +/*#define I_PTHREAD /**/ + /* I_PWD: * This symbol, if defined, indicates to the C program that it should * include <pwd.h>. @@ -1720,18 +2347,6 @@ * This symbol, if defined, indicates to the C program that struct passwd * contains pw_passwd. */ -/* HAS_SETPWENT: - * This symbol, if defined, indicates that the getpwrent routine is - * available for initializing sequential access of the passwd database. - */ -/* HAS_GETPWENT: - * This symbol, if defined, indicates that the getpwent routine is - * available for sequential access of the password database. - */ -/* HAS_ENDPWENT: - * This symbol, if defined, indicates that the getpwent routine is - * available for finalizing sequential access of the passwd database. - */ /*#define I_PWD /**/ /*#define PWQUOTA /**/ /*#define PWAGE /**/ @@ -1741,9 +2356,134 @@ /*#define PWCOMMENT /**/ /*#define PWGECOS /**/ /*#define PWPASSWD /**/ -/*#define HAS_SETPWENT /**/ -/*#define HAS_GETPWENT /**/ -/*#define HAS_ENDPWENT /**/ + +/* I_SHADOW: + * This symbol, if defined, indicates that <shadow.h> exists and + * should be included. + */ +/*#define I_SHADOW /**/ + +/* I_SOCKS: + * This symbol, if defined, indicates that <socks.h> exists and + * should be included. + */ +/*#define I_SOCKS /**/ + +/* I_SUNMATH: + * This symbol, if defined, indicates that <sunmath.h> exists and + * should be included. + */ +/*#define I_SUNMATH /**/ + +/* I_SYSLOG: + * This symbol, if defined, indicates that <syslog.h> exists and + * should be included. + */ +/*#define I_SYSLOG /**/ + +/* I_SYSMODE: + * This symbol, if defined, indicates that <sys/mode.h> exists and + * should be included. + */ +/*#define I_SYSMODE /**/ + +/* I_SYS_MOUNT: + * This symbol, if defined, indicates that <sys/mount.h> exists and + * should be included. + */ +/*#define I_SYS_MOUNT /**/ + +/* I_SYS_STATFS: + * This symbol, if defined, indicates that <sys/statfs.h> exists. + */ +/*#define I_SYS_STATFS /**/ + +/* I_SYS_STATVFS: + * This symbol, if defined, indicates that <sys/statvfs.h> exists and + * should be included. + */ +/*#define I_SYS_STATVFS /**/ + +/* I_SYSUIO: + * This symbol, if defined, indicates that <sys/uio.h> exists and + * should be included. + */ +/*#define I_SYSUIO /**/ + +/* I_SYSUTSNAME: + * This symbol, if defined, indicates that <sys/utsname.h> exists and + * should be included. + */ +/*#define I_SYSUTSNAME /**/ + +/* I_SYS_VFS: + * This symbol, if defined, indicates that <sys/vfs.h> exists and + * should be included. + */ +/*#define I_SYS_VFS /**/ + +/* I_TIME: + * This symbol, if defined, indicates to the C program that it should + * include <time.h>. + */ +/* I_SYS_TIME: + * This symbol, if defined, indicates to the C program that it should + * include <sys/time.h>. + */ +/* I_SYS_TIME_KERNEL: + * This symbol, if defined, indicates to the C program that it should + * include <sys/time.h> with KERNEL defined. + */ +#define I_TIME /**/ +/*#define I_SYS_TIME /**/ +/*#define I_SYS_TIME_KERNEL /**/ + +/* I_USTAT: + * This symbol, if defined, indicates that <ustat.h> exists and + * should be included. + */ +/*#define I_USTAT /**/ + +/* PERL_INC_VERSION_LIST: + * This variable specifies the list of subdirectories in over + * which perl.c:incpush() and lib/lib.pm will automatically + * search when adding directories to @INC, in a format suitable + * for a C initialization string. See the inc_version_list entry + * in Porting/Glossary for more details. + */ +#define PERL_INC_VERSION_LIST 0 /**/ + +/* INSTALL_USR_BIN_PERL: + * This symbol, if defined, indicates that Perl is to be installed + * also as /usr/bin/perl. + */ +/*#define INSTALL_USR_BIN_PERL /**/ + +/* PERL_PRIfldbl: + * This symbol, if defined, contains the string used by stdio to + * format long doubles (format 'f') for output. + */ +/* PERL_PRIgldbl: + * This symbol, if defined, contains the string used by stdio to + * format long doubles (format 'g') for output. + */ +/*#define PERL_PRIfldbl "f" /**/ +/*#define PERL_PRIgldbl "g" /**/ + +/* Off_t: + * This symbol holds the type used to declare offsets in the kernel. + * It can be int, long, off_t, etc... It may be necessary to include + * <sys/types.h> to get any typedef'ed information. + */ +/* LSEEKSIZE: + * This symbol holds the number of bytes used by the Off_t. + */ +/* Off_t_size: + * This symbol holds the number of bytes used by the Off_t. + */ +#define Off_t off_t /* <offset> type */ +#define LSEEKSIZE 4 /* <offset> size */ +#define Off_t_size 4 /* <offset> size */ /* Free_t: * This variable contains the return type of free(). It is usually @@ -1760,6 +2500,247 @@ */ /*#define MYMALLOC /**/ +/* Mode_t: + * This symbol holds the type used to declare file modes + * for systems calls. It is usually mode_t, but may be + * int or unsigned short. It may be necessary to include <sys/types.h> + * to get any typedef'ed information. + */ +#define Mode_t mode_t /* file mode parameter for system calls */ + +/* VAL_O_NONBLOCK: + * This symbol is to be used during open() or fcntl(F_SETFL) to turn on + * non-blocking I/O for the file descriptor. Note that there is no way + * back, i.e. you cannot turn it blocking again this way. If you wish to + * alternatively switch between blocking and non-blocking, use the + * ioctl(FIOSNBIO) call instead, but that is not supported by all devices. + */ +/* VAL_EAGAIN: + * This symbol holds the errno error code set by read() when no data was + * present on the non-blocking file descriptor. + */ +/* RD_NODATA: + * This symbol holds the return code from read() when no data is present + * on the non-blocking file descriptor. Be careful! If EOF_NONBLOCK is + * not defined, then you can't distinguish between no data and EOF by + * issuing a read(). You'll have to find another way to tell for sure! + */ +/* EOF_NONBLOCK: + * This symbol, if defined, indicates to the C program that a read() on + * a non-blocking file descriptor will return 0 on EOF, and not the value + * held in RD_NODATA (-1 usually, in that case!). + */ +#define VAL_O_NONBLOCK O_NONBLOCK +#define VAL_EAGAIN EAGAIN +#define RD_NODATA -1 +#define EOF_NONBLOCK + +/* Netdb_host_t: + * This symbol holds the type used for the 1st argument + * to gethostbyaddr(). + */ +/* Netdb_hlen_t: + * This symbol holds the type used for the 2nd argument + * to gethostbyaddr(). + */ +/* Netdb_name_t: + * This symbol holds the type used for the argument to + * gethostbyname(). + */ +/* Netdb_net_t: + * This symbol holds the type used for the 1st argument to + * getnetbyaddr(). + */ +#define Netdb_host_t char * /**/ +#define Netdb_hlen_t int /**/ +#define Netdb_name_t char * /**/ +#define Netdb_net_t long /**/ + +/* IVTYPE: + * This symbol defines the C type used for Perl's IV. + */ +/* UVTYPE: + * This symbol defines the C type used for Perl's UV. + */ +/* I8TYPE: + * This symbol defines the C type used for Perl's I8. + */ +/* U8TYPE: + * This symbol defines the C type used for Perl's U8. + */ +/* I16TYPE: + * This symbol defines the C type used for Perl's I16. + */ +/* U16TYPE: + * This symbol defines the C type used for Perl's U16. + */ +/* I32TYPE: + * This symbol defines the C type used for Perl's I32. + */ +/* U32TYPE: + * This symbol defines the C type used for Perl's U32. + */ +/* I64TYPE: + * This symbol defines the C type used for Perl's I64. + */ +/* U64TYPE: + * This symbol defines the C type used for Perl's U64. + */ +/* NVTYPE: + * This symbol defines the C type used for Perl's NV. + */ +/* IVSIZE: + * This symbol contains the sizeof(IV). + */ +/* UVSIZE: + * This symbol contains the sizeof(UV). + */ +/* I8SIZE: + * This symbol contains the sizeof(I8). + */ +/* U8SIZE: + * This symbol contains the sizeof(U8). + */ +/* I16SIZE: + * This symbol contains the sizeof(I16). + */ +/* U16SIZE: + * This symbol contains the sizeof(U16). + */ +/* I32SIZE: + * This symbol contains the sizeof(I32). + */ +/* U32SIZE: + * This symbol contains the sizeof(U32). + */ +/* I64SIZE: + * This symbol contains the sizeof(I64). + */ +/* U64SIZE: + * This symbol contains the sizeof(U64). + */ +/* NV_PRESERVES_UV: + * This symbol, if defined, indicates that a variable of type NVTYPE + * can preserve all the bit of a variable of type UVSIZE. + */ +#define IVTYPE long /**/ +#define UVTYPE unsigned long /**/ +#define I8TYPE char /**/ +#define U8TYPE unsigned char /**/ +#define I16TYPE short /**/ +#define U16TYPE unsigned short /**/ +#define I32TYPE long /**/ +#define U32TYPE unsigned long /**/ +#ifdef HAS_QUAD +#define I64TYPE __int64 /**/ +#define U64TYPE unsigned __int64 /**/ +#endif +#define NVTYPE double /**/ +#define IVSIZE 4 /**/ +#define UVSIZE 4 /**/ +#define I8SIZE 1 /**/ +#define U8SIZE 1 /**/ +#define I16SIZE 2 /**/ +#define U16SIZE 2 /**/ +#define I32SIZE 4 /**/ +#define U32SIZE 4 /**/ +#ifdef HAS_QUAD +#define I64SIZE 8 /**/ +#define U64SIZE 8 /**/ +#endif +#define NV_PRESERVES_UV + +/* IVdf: + * This symbol defines the format string used for printing a Perl IV + * as a signed decimal integer. + */ +/* UVuf: + * This symbol defines the format string used for printing a Perl UV + * as an unsigned decimal integer. + */ +/* UVof: + * This symbol defines the format string used for printing a Perl UV + * as an unsigned octal integer. + */ +/* UVxf: + * This symbol defines the format string used for printing a Perl UV + * as an unsigned hexadecimal integer. + */ +#define IVdf "ld" /**/ +#define UVuf "lu" /**/ +#define UVof "lo" /**/ +#define UVxf "lx" /**/ + +/* Pid_t: + * This symbol holds the type used to declare process ids in the kernel. + * It can be int, uint, pid_t, etc... It may be necessary to include + * <sys/types.h> to get any typedef'ed information. + */ +#define Pid_t int /* PID type */ + +/* PRIVLIB: + * This symbol contains the name of the private library for this package. + * The library is private in the sense that it needn't be in anyone's + * execution path, but it should be accessible by the world. The program + * should be prepared to do ~ expansion. + */ +/* PRIVLIB_EXP: + * This symbol contains the ~name expanded version of PRIVLIB, to be used + * in programs that are not prepared to deal with ~ expansion at run-time. + */ +#define PRIVLIB "c:\\perl\\5.6.0\\lib" /**/ +#define PRIVLIB_EXP (win32_get_privlib("5.6.0")) /**/ + +/* PTRSIZE: + * This symbol contains the size of a pointer, so that the C preprocessor + * can make decisions based on it. It will be sizeof(void *) if + * the compiler supports (void *); otherwise it will be + * sizeof(char *). + */ +#define PTRSIZE 4 /**/ + +/* Drand01: + * This macro is to be used to generate uniformly distributed + * random numbers over the range [0., 1.[. You may have to supply + * an 'extern double drand48();' in your program since SunOS 4.1.3 + * doesn't provide you with anything relevant in it's headers. + * See HAS_DRAND48_PROTO. + */ +/* Rand_seed_t: + * This symbol defines the type of the argument of the + * random seed function. + */ +/* seedDrand01: + * This symbol defines the macro to be used in seeding the + * random number generator (see Drand01). + */ +/* RANDBITS: + * This symbol indicates how many bits are produced by the + * function used to generate normalized random numbers. + * Values include 15, 16, 31, and 48. + */ +#define Drand01() (rand()/(double)((unsigned)1<<RANDBITS)) /**/ +#define Rand_seed_t unsigned /**/ +#define seedDrand01(x) srand((Rand_seed_t)x) /**/ +#define RANDBITS 15 /**/ + +/* SELECT_MIN_BITS: + * This symbol holds the minimum number of bits operated by select. + * That is, if you do select(n, ...), how many bits at least will be + * cleared in the masks if some activity is detected. Usually this + * is either n or 32*ceil(n/32), especially many little-endians do + * the latter. This is only useful if you have select(), naturally. + */ +#define SELECT_MIN_BITS 32 /**/ + +/* Select_fd_set_t: + * This symbol holds the type used for the 2nd, 3rd, and 4th + * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET + * is defined, and 'int *' otherwise. This is only useful if you + * have select(), of course. + */ +#define Select_fd_set_t Perl_fd_set * /**/ + /* SIG_NAME: * This symbol contains a list of signal names in order of * signal number. This is intended @@ -1788,95 +2769,8 @@ * The last element is 0, corresponding to the 0 at the end of * the sig_name list. */ -#define SIG_NAME "ZERO", "INT", "QUIT", "ILL", "FPE", "KILL", "SEGV", "PIPE", "ALRM", "TERM", "USR1", "USR2", "CHLD", "USR3", "BREAK", "ABRT", "STOP", "CONT", "CLD", 0 /**/ -#define SIG_NUM 0, 2, 3, 4, 8, 9, 11, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 25, 18, 0 /**/ - -/* VOIDFLAGS: - * This symbol indicates how much support of the void type is given by this - * compiler. What various bits mean: - * - * 1 = supports declaration of void - * 2 = supports arrays of pointers to functions returning void - * 4 = supports comparisons between pointers to void functions and - * addresses of void functions - * 8 = suports declaration of generic void pointers - * - * The package designer should define VOIDUSED to indicate the requirements - * of the package. This can be done either by #defining VOIDUSED before - * including config.h, or by defining defvoidused in Myinit.U. If the - * latter approach is taken, only those flags will be tested. If the - * level of void support necessary is not present, defines void to int. - */ -#ifndef VOIDUSED -#define VOIDUSED 15 -#endif -#define VOIDFLAGS 15 -#if (VOIDFLAGS & VOIDUSED) != VOIDUSED -#define void int /* is void to be avoided? */ -#define M_VOID /* Xenix strikes again */ -#endif - -/* ARCHLIB: - * This variable, if defined, holds the name of the directory in - * which the user wants to put architecture-dependent public - * library files for perl5. It is most often a local directory - * such as /usr/local/lib. Programs using this variable must be - * prepared to deal with filename expansion. If ARCHLIB is the - * same as PRIVLIB, it is not defined, since presumably the - * program already searches PRIVLIB. - */ -/* ARCHLIB_EXP: - * This symbol contains the ~name expanded version of ARCHLIB, to be used - * in programs that are not prepared to deal with ~ expansion at run-time. - */ -#define ARCHLIB "c:\\perl\\5.00503\\lib\\MSWin32-x86" /**/ -/*#define ARCHLIB_EXP "" /**/ - -/* DLSYM_NEEDS_UNDERSCORE: - * This symbol, if defined, indicates that we need to prepend an - * underscore to the symbol name before calling dlsym(). This only - * makes sense if you *have* dlsym, which we will presume is the - * case if you're using dl_dlopen.xs. - */ -/*#define DLSYM_NEEDS_UNDERSCORE /**/ - -/* USE_SFIO: - * This symbol, if defined, indicates that sfio should - * be used. - */ -/*#define USE_SFIO /**/ - -/* USE_DYNAMIC_LOADING: - * This symbol, if defined, indicates that dynamic loading of - * some sort is available. - */ -#define USE_DYNAMIC_LOADING /**/ - -/* DB_Prefix_t: - * This symbol contains the type of the prefix structure element - * in the <db.h> header file. In older versions of DB, it was - * int, while in newer ones it is u_int32_t. - */ -/* DB_Hash_t: - * This symbol contains the type of the prefix structure element - * in the <db.h> header file. In older versions of DB, it was - * int, while in newer ones it is size_t. - */ -#define DB_Hash_t int /**/ -#define DB_Prefix_t int /**/ - -/* PRIVLIB: - * This symbol contains the name of the private library for this package. - * The library is private in the sense that it needn't be in anyone's - * execution path, but it should be accessible by the world. The program - * should be prepared to do ~ expansion. - */ -/* PRIVLIB_EXP: - * This symbol contains the ~name expanded version of PRIVLIB, to be used - * in programs that are not prepared to deal with ~ expansion at run-time. - */ -#define PRIVLIB "c:\\perl\\5.00503\\lib" /**/ -#define PRIVLIB_EXP (win32_get_privlib("5.00503")) /**/ +#define SIG_NAME "ZERO", "NUM01", "INT", "QUIT", "ILL", "NUM05", "NUM06", "NUM07", "FPE", "KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM", "TERM", "USR1", "USR2", "CHLD", "NUM19", "USR3", "BREAK", "ABRT", "STOP", "NUM24", "CONT", "CLD", 0 /**/ +#define SIG_NUM 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 18, 0 /**/ /* SITEARCH: * This symbol contains the name of the private library for this package. @@ -1884,14 +2778,16 @@ * execution path, but it should be accessible by the world. The program * should be prepared to do ~ expansion. * The standard distribution will put nothing in this directory. - * Individual sites may place their own extensions and modules in - * this directory. + * After perl has been installed, users may install their own local + * architecture-dependent modules in this directory with + * MakeMaker Makefile.PL + * or equivalent. See INSTALL for details. */ /* SITEARCH_EXP: * This symbol contains the ~name expanded version of SITEARCH, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITEARCH "c:\\perl\\site\\5.00503\\lib\\MSWin32-x86" /**/ +#define SITEARCH "c:\\perl\\site\\5.6.0\\lib\\MSWin32-x86" /**/ /*#define SITEARCH_EXP "" /**/ /* SITELIB: @@ -1900,15 +2796,52 @@ * execution path, but it should be accessible by the world. The program * should be prepared to do ~ expansion. * The standard distribution will put nothing in this directory. - * Individual sites may place their own extensions and modules in - * this directory. + * After perl has been installed, users may install their own local + * architecture-independent modules in this directory with + * MakeMaker Makefile.PL + * or equivalent. See INSTALL for details. */ /* SITELIB_EXP: * This symbol contains the ~name expanded version of SITELIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITELIB "c:\\perl\\site\\5.00503\\lib" /**/ -#define SITELIB_EXP (win32_get_sitelib("5.00503")) /**/ +/* SITELIB_STEM: + * This define is SITELIB_EXP with any trailing version-specific component + * removed. The elements in inc_version_list (inc_version_list.U) can + * be tacked onto this variable to generate a list of directories to search. + */ +#define SITELIB "c:\\perl\\site\\5.6.0\\lib" /**/ +#define SITELIB_EXP (win32_get_sitelib("5.6.0")) /**/ +#define SITELIB_STEM "" /**/ + +/* Size_t_size: + * This symbol holds the size of a Size_t in bytes. + */ +#define Size_t_size 4 /**/ + +/* Size_t: + * This symbol holds the type used to declare length parameters + * for string functions. It is usually size_t, but may be + * unsigned long, int, etc. It may be necessary to include + * <sys/types.h> to get any typedef'ed information. + */ +#define Size_t size_t /* length paramater for string functions */ + +/* Sock_size_t: + * This symbol holds the type used for the size argument of + * various socket calls (just the base type, not the pointer-to). + */ +#define Sock_size_t int /**/ + +/* SSize_t: + * This symbol holds the type used by functions that return + * a count of bytes or an error condition. It must be a signed type. + * It is usually ssize_t, but may be long or int, etc. + * It may be necessary to include <sys/types.h> or <unistd.h> + * to get any typedef'ed information. + * We will pick a type such that sizeof(SSize_t) == sizeof(Size_t). + */ +#define SSize_t int /* signed count of bytes */ /* STARTPERL: * This variable contains the string to put in front of a perl @@ -1917,178 +2850,235 @@ */ #define STARTPERL "#!perl" /**/ -/* USE_PERLIO: - * This symbol, if defined, indicates that the PerlIO abstraction should - * be used throughout. If not defined, stdio should be - * used in a fully backward compatible manner. +/* HAS_STDIO_STREAM_ARRAY: + * This symbol, if defined, tells that there is an array + * holding the stdio streams. */ -/*#define USE_PERLIO /**/ - -/* HAS_GETHOST_PROTOS: - * This symbol, if defined, indicates that <netdb.h> includes - * prototypes for gethostent(), gethostbyname(), and - * gethostbyaddr(). Otherwise, it is up to the program to guess - * them. See netdbtype.U for probing for various Netdb_xxx_t types. +/* STDIO_STREAM_ARRAY: + * This symbol tells the name of the array holding the stdio streams. + * Usual values include _iob, __iob, and __sF. */ -#define HAS_GETHOST_PROTOS /**/ +/*#define HAS_STDIO_STREAM_ARRAY /**/ +#define STDIO_STREAM_ARRAY -/* HAS_GETNET_PROTOS: - * This symbol, if defined, indicates that <netdb.h> includes - * prototypes for getnetent(), getnetbyname(), and - * getnetbyaddr(). Otherwise, it is up to the program to guess - * them. See netdbtype.U for probing for various Netdb_xxx_t types. +/* Uid_t_f: + * This symbol defines the format string used for printing a Uid_t. */ -/*#define HAS_GETNET_PROTOS /**/ +#define Uid_t_f "d" /**/ -/* HAS_GETPROTO_PROTOS: - * This symbol, if defined, indicates that <netdb.h> includes - * prototypes for getprotoent(), getprotobyname(), and - * getprotobyaddr(). Otherwise, it is up to the program to guess - * them. See netdbtype.U for probing for various Netdb_xxx_t types. +/* Uid_t_sign: + * This symbol holds the signedess of a Uid_t. + * 1 for unsigned, -1 for signed. */ -#define HAS_GETPROTO_PROTOS /**/ +#define Uid_t_sign -1 /* UID sign */ -/* HAS_GETSERV_PROTOS: - * This symbol, if defined, indicates that <netdb.h> includes - * prototypes for getservent(), getservbyname(), and - * getservbyaddr(). Otherwise, it is up to the program to guess - * them. See netdbtype.U for probing for various Netdb_xxx_t types. +/* Uid_t_size: + * This symbol holds the size of a Uid_t in bytes. */ -#define HAS_GETSERV_PROTOS /**/ +#define Uid_t_size 4 /* UID size */ -/* Netdb_host_t: - * This symbol holds the type used for the 1st argument - * to gethostbyaddr(). - */ -/* Netdb_hlen_t: - * This symbol holds the type used for the 2nd argument - * to gethostbyaddr(). - */ -/* Netdb_name_t: - * This symbol holds the type used for the argument to - * gethostbyname(). - */ -/* Netdb_net_t: - * This symbol holds the type used for the 1st argument to - * getnetbyaddr(). +/* Uid_t: + * This symbol holds the type used to declare user ids in the kernel. + * It can be int, ushort, uid_t, etc... It may be necessary to include + * <sys/types.h> to get any typedef'ed information. */ -#define Netdb_host_t char * /**/ -#define Netdb_hlen_t int /**/ -#define Netdb_name_t char * /**/ -#define Netdb_net_t long /**/ +#define Uid_t uid_t /* UID type */ -/* Select_fd_set_t: - * This symbol holds the type used for the 2nd, 3rd, and 4th - * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET - * is defined, and 'int *' otherwise. This is only useful if you - * have select(), of course. +/* USE_64_BIT_INT: + * This symbol, if defined, indicates that 64-bit integers should + * be used when available. If not defined, the native integers + * will be employed (be they 32 or 64 bits). The minimal possible + * 64-bitness is used, just enough to get 64-bit integers into Perl. + * This may mean using for example "long longs", while your memory + * may still be limited to 2 gigabytes. + */ +/* USE_64_BIT_ALL: + * This symbol, if defined, indicates that 64-bit integers should + * be used when available. If not defined, the native integers + * will be used (be they 32 or 64 bits). The maximal possible + * 64-bitness is employed: LP64 or ILP64, meaning that you will + * be able to use more than 2 gigabytes of memory. This mode is + * even more binary incompatible than USE_64_BIT_INT. You may not + * be able to run the resulting executable in a 32-bit CPU at all or + * you may need at least to reboot your OS to 64-bit mode. + */ +#ifndef USE_64_BIT_INT +/*#define USE_64_BIT_INT /**/ +#endif + +#ifndef USE_64_BIT_ALL +/*#define USE_64_BIT_ALL /**/ +#endif + +/* USE_LARGE_FILES: + * This symbol, if defined, indicates that large file support + * should be used when available. */ -#define Select_fd_set_t Perl_fd_set * /**/ +#ifndef USE_LARGE_FILES +/*#define USE_LARGE_FILES /**/ +#endif -/* ARCHNAME: - * This symbol holds a string representing the architecture name. - * It may be used to construct an architecture-dependant pathname - * where library files may be held under a private library, for - * instance. +/* USE_LONG_DOUBLE: + * This symbol, if defined, indicates that long doubles should + * be used when available. */ -#define ARCHNAME "MSWin32-x86" /**/ +#ifndef USE_LONG_DOUBLE +/*#define USE_LONG_DOUBLE /**/ +#endif -/* HAS_PTHREAD_YIELD: - * This symbol, if defined, indicates that the pthread_yield - * routine is available to yield the execution of the current - * thread. +/* USE_MORE_BITS: + * This symbol, if defined, indicates that 64-bit interfaces and + * long doubles should be used when available. */ -/* HAS_SCHED_YIELD: - * This symbol, if defined, indicates that the sched_yield - * routine is available to yield the execution of the current - * thread. +#ifndef USE_MORE_BITS +/*#define USE_MORE_BITS /**/ +#endif + +/* MULTIPLICITY: + * This symbol, if defined, indicates that Perl should + * be built to use multiplicity. */ -/*#define HAS_PTHREAD_YIELD /**/ -/*#define HAS_SCHED_YIELD /**/ +#ifndef MULTIPLICITY +/*#define MULTIPLICITY /**/ +#endif -/* PTHREADS_CREATED_JOINABLE: - * This symbol, if defined, indicates that pthreads are created - * in the joinable (aka undetached) state. +/* USE_PERLIO: + * This symbol, if defined, indicates that the PerlIO abstraction should + * be used throughout. If not defined, stdio should be + * used in a fully backward compatible manner. */ -/*#define PTHREADS_CREATED_JOINABLE /**/ +#ifndef USE_PERLIO +/*#define USE_PERLIO /**/ +#endif -/* USE_THREADS: +/* USE_SOCKS: * This symbol, if defined, indicates that Perl should - * be built to use threads. + * be built to use socks. + */ +#ifndef USE_SOCKS +/*#define USE_SOCKS /**/ +#endif + +/* USE_ITHREADS: + * This symbol, if defined, indicates that Perl should be built to + * use the interpreter-based threading implementation. + */ +/* USE_5005THREADS: + * This symbol, if defined, indicates that Perl should be built to + * use the 5.005-based threading implementation. */ /* OLD_PTHREADS_API: * This symbol, if defined, indicates that Perl should * be built to use the old draft POSIX threads API. */ -/*#define USE_THREADS /**/ +/*#define USE_5005THREADS /**/ +/*#define USE_ITHREADS /**/ +#if defined(USE_5005THREADS) && !defined(USE_ITHREADS) +#define USE_THREADS /* until src is revised*/ +#endif /*#define OLD_PTHREADS_API /**/ -/* Time_t: - * This symbol holds the type returned by time(). It can be long, - * or time_t on BSD sites (in which case <sys/types.h> should be - * included). +/* PERL_VENDORARCH: + * If defined, this symbol contains the name of a private library. + * The library is private in the sense that it needn't be in anyone's + * execution path, but it should be accessible by the world. + * It may have a ~ on the front. + * The standard distribution will put nothing in this directory. + * Vendors who distribute perl may wish to place their own + * architecture-dependent modules and extensions in this directory with + * MakeMaker Makefile.PL INSTALLDIRS=vendor + * or equivalent. See INSTALL for details. */ -#define Time_t time_t /* Time type */ - -/* HAS_TIMES: - * This symbol, if defined, indicates that the times() routine exists. - * Note that this became obsolete on some systems (SUNOS), which now - * use getrusage(). It may be necessary to include <sys/times.h>. +/* PERL_VENDORARCH_EXP: + * This symbol contains the ~name expanded version of PERL_VENDORARCH, to be used + * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define HAS_TIMES /**/ +/*#define PERL_VENDORARCH "" /**/ +/*#define PERL_VENDORARCH_EXP "" /**/ -/* Fpos_t: - * This symbol holds the type used to declare file positions in libc. - * It can be fpos_t, long, uint, etc... It may be necessary to include - * <sys/types.h> to get any typedef'ed information. - */ -#define Fpos_t fpos_t /* File position type */ - -/* Gid_t: - * This symbol holds the return type of getgid() and the type of - * argument to setrgid() and related functions. Typically, - * it is the type of group ids in the kernel. It can be int, ushort, - * uid_t, etc... It may be necessary to include <sys/types.h> to get - * any typedef'ed information. +/* PERL_VENDORLIB_EXP: + * This symbol contains the ~name expanded version of VENDORLIB, to be used + * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define Gid_t gid_t /* Type for getgid(), etc... */ - -/* Off_t: - * This symbol holds the type used to declare offsets in the kernel. - * It can be int, long, off_t, etc... It may be necessary to include - * <sys/types.h> to get any typedef'ed information. +/* PERL_VENDORLIB_STEM: + * This define is PERL_VENDORLIB_EXP with any trailing version-specific component + * removed. The elements in inc_version_list (inc_version_list.U) can + * be tacked onto this variable to generate a list of directories to search. */ -#define Off_t off_t /* <offset> type */ +/*#define PERL_VENDORLIB_EXP "" /**/ +/*#define PERL_VENDORLIB_STEM "" /**/ -/* Mode_t: - * This symbol holds the type used to declare file modes - * for systems calls. It is usually mode_t, but may be - * int or unsigned short. It may be necessary to include <sys/types.h> - * to get any typedef'ed information. +/* VOIDFLAGS: + * This symbol indicates how much support of the void type is given by this + * compiler. What various bits mean: + * + * 1 = supports declaration of void + * 2 = supports arrays of pointers to functions returning void + * 4 = supports comparisons between pointers to void functions and + * addresses of void functions + * 8 = suports declaration of generic void pointers + * + * The package designer should define VOIDUSED to indicate the requirements + * of the package. This can be done either by #defining VOIDUSED before + * including config.h, or by defining defvoidused in Myinit.U. If the + * latter approach is taken, only those flags will be tested. If the + * level of void support necessary is not present, defines void to int. */ -#define Mode_t mode_t /* file mode parameter for system calls */ +#ifndef VOIDUSED +#define VOIDUSED 15 +#endif +#define VOIDFLAGS 15 +#if (VOIDFLAGS & VOIDUSED) != VOIDUSED +#define void int /* is void to be avoided? */ +#define M_VOID /* Xenix strikes again */ +#endif -/* Pid_t: - * This symbol holds the type used to declare process ids in the kernel. - * It can be int, uint, pid_t, etc... It may be necessary to include - * <sys/types.h> to get any typedef'ed information. - */ -#define Pid_t int /* PID type */ +/* PERL_XS_APIVERSION: + * This variable contains the version of the oldest perl binary + * compatible with the present perl. perl.c:incpush() and + * lib/lib.pm will automatically search in c:\\perl\\site\\5.6.0\\lib\\MSWin32-x86 for older + * directories across major versions back to xs_apiversion. + * This is only useful if you have a perl library directory tree + * structured like the default one. + * See INSTALL for how this works. + * The versioned site_perl directory was introduced in 5.005, + * so that is the lowest possible value. + * Since this can depend on compile time options (such as + * bincompat) it is set by Configure. Other non-default sources + * of potential incompatibility, such as multiplicity, threads, + * debugging, 64bits, sfio, etc., are not checked for currently, + * though in principle we could go snooping around in old + * Config.pm files. + */ +/* PERL_PM_APIVERSION: + * This variable contains the version of the oldest perl + * compatible with the present perl. (That is, pure perl modules + * written for pm_apiversion will still work for the current + * version). perl.c:incpush() and lib/lib.pm will automatically + * search in c:\\perl\\site\\5.6.0\\lib for older directories across major versions + * back to pm_apiversion. This is only useful if you have a perl + * library directory tree structured like the default one. The + * versioned site_perl library was introduced in 5.005, so that's + * the default setting for this variable. It's hard to imagine + * it changing before Perl6. It is included here for symmetry + * with xs_apiveprsion -- the searching algorithms will + * (presumably) be similar. + * See the INSTALL file for how this works. + */ +#define PERL_XS_APIVERSION "5.6.0" +#define PERL_PM_APIVERSION "5.005" -/* Size_t: - * This symbol holds the type used to declare length parameters - * for string functions. It is usually size_t, but may be - * unsigned long, int, etc. It may be necessary to include - * <sys/types.h> to get any typedef'ed information. +/* HAS_LCHOWN: + * This symbol, if defined, indicates that the lchown routine is + * available to operate on a symbolic link (instead of following the + * link). */ -#define Size_t size_t /* length paramater for string functions */ +/*#define HAS_LCHOWN /**/ -/* Uid_t: - * This symbol holds the type used to declare user ids in the kernel. - * It can be int, ushort, uid_t, etc... It may be necessary to include - * <sys/types.h> to get any typedef'ed information. +/* FLEXFILENAMES: + * This symbol, if defined, indicates that the system supports filenames + * longer than 14 characters. */ -#define Uid_t uid_t /* UID type */ +#define FLEXFILENAMES /**/ #endif -#include <win32.h> diff --git a/gnu/usr.bin/perl/win32/config_H.gc b/gnu/usr.bin/perl/win32/config_H.gc index 0cb45e45841..07e89dadb57 100644 --- a/gnu/usr.bin/perl/win32/config_H.gc +++ b/gnu/usr.bin/perl/win32/config_H.gc @@ -13,7 +13,7 @@ /* * Package name : perl5 * Source directory : - * Configuration time: undef + * Configuration time: Tue Mar 21 01:26:44 2000 * Configured by : gsar * Target system : */ @@ -26,32 +26,6 @@ */ #define LOC_SED "" /**/ -/* BIN: - * This symbol holds the path of the bin directory where the package will - * be installed. Program must be prepared to deal with ~name substitution. - */ -/* BIN_EXP: - * This symbol is the filename expanded version of the BIN symbol, for - * programs that do not want to deal with that at run-time. - */ -#define BIN "c:\\perl\\5.00503\\bin\\MSWin32-x86" /**/ -#define BIN_EXP "c:\\perl\\5.00503\\bin\\MSWin32-x86" /**/ - -/* CPPSTDIN: - * This symbol contains the first part of the string which will invoke - * the C preprocessor on the standard input and produce to standard - * output. Typical value of "cc -E" or "/lib/cpp", but it can also - * call a wrapper. See CPPRUN. - */ -/* CPPMINUS: - * This symbol contains the second part of the string which will invoke - * the C preprocessor on the standard input and produce to standard - * output. This symbol will have the value "-" if CPPSTDIN needs a minus - * to specify standard input, otherwise the value is "". - */ -#define CPPSTDIN "gcc -E" -#define CPPMINUS "-" - /* HAS_ALARM: * This symbol, if defined, indicates that the alarm routine is * available. @@ -197,12 +171,6 @@ */ #define HAS_FGETPOS /**/ -/* FLEXFILENAMES: - * This symbol, if defined, indicates that the system supports filenames - * longer than 14 characters. - */ -#define FLEXFILENAMES /**/ - /* HAS_FLOCK: * This symbol, if defined, indicates that the flock routine is * available to do file locking. @@ -239,13 +207,6 @@ */ /*#define HAS_GETGROUPS /**/ -/* HAS_UNAME: - * This symbol, if defined, indicates that the C program may use the - * uname() routine to derive the host name. See also HAS_GETHOSTNAME - * and PHOSTNAME. - */ -/*#define HAS_UNAME /**/ - /* HAS_GETLOGIN: * This symbol, if defined, indicates that the getlogin routine is * available to get the login name. @@ -288,31 +249,6 @@ */ /*#define HAS_GETPRIORITY /**/ -/* HAS_HTONL: - * This symbol, if defined, indicates that the htonl() routine (and - * friends htons() ntohl() ntohs()) are available to do network - * order byte swapping. - */ -/* HAS_HTONS: - * This symbol, if defined, indicates that the htons() routine (and - * friends htonl() ntohl() ntohs()) are available to do network - * order byte swapping. - */ -/* HAS_NTOHL: - * This symbol, if defined, indicates that the ntohl() routine (and - * friends htonl() htons() ntohs()) are available to do network - * order byte swapping. - */ -/* HAS_NTOHS: - * This symbol, if defined, indicates that the ntohs() routine (and - * friends htonl() htons() ntohl()) are available to do network - * order byte swapping. - */ -#define HAS_HTONL /**/ -#define HAS_HTONS /**/ -#define HAS_NTOHL /**/ -#define HAS_NTOHS /**/ - /* HAS_INET_ATON: * This symbol, if defined, indicates to the C program that the * inet_aton() function is available to parse IP address "dotted-quad" @@ -331,7 +267,7 @@ * This symbol, if defined, indicates that the link routine is * available to create hard links. */ -/*#define HAS_LINK /**/ +#define HAS_LINK /**/ /* HAS_LOCALECONV: * This symbol, if defined, indicates that the localeconv routine is @@ -416,11 +352,17 @@ */ #define HAS_MKTIME /**/ -/* HAS_MSG: - * This symbol, if defined, indicates that the entire msg*(2) library is - * supported (IPC mechanism based on message queues). +/* HAS_MSYNC: + * This symbol, if defined, indicates that the msync system call is + * available to synchronize a mapped file. */ -/*#define HAS_MSG /**/ +/*#define HAS_MSYNC /**/ + +/* HAS_MUNMAP: + * This symbol, if defined, indicates that the munmap system call is + * available to unmap a region, usually mapped by mmap(). + */ +/*#define HAS_MUNMAP /**/ /* HAS_NICE: * This symbol, if defined, indicates that the nice routine is @@ -512,12 +454,6 @@ */ #define HAS_SELECT /**/ -/* HAS_SEM: - * This symbol, if defined, indicates that the entire sem*(2) library is - * supported. - */ -/*#define HAS_SEM /**/ - /* HAS_SETEGID: * This symbol, if defined, indicates that the setegid routine is available * to change the effective gid of the current program. @@ -617,12 +553,6 @@ */ /*#define HAS_SETSID /**/ -/* HAS_SHM: - * This symbol, if defined, indicates that the entire shm*(2) library is - * supported. - */ -/*#define HAS_SHM /**/ - /* Shmat_t: * This symbol holds the return type of the shmat() system call. * Usually set to 'void *' or 'char *'. @@ -637,12 +567,6 @@ #define Shmat_t void * /**/ /*#define HAS_SHMAT_PROTOTYPE /**/ -/* USE_STAT_BLOCKS: - * This symbol is defined if this system has a stat structure declaring - * st_blksize and st_blocks. - */ -/*#define USE_STAT_BLOCKS /**/ - /* HAS_STRCHR: * This symbol is defined to indicate that the strchr()/strrchr() * functions are available for string searching. If not, try the @@ -668,25 +592,6 @@ */ #define USE_STRUCT_COPY /**/ -/* HAS_STRERROR: - * This symbol, if defined, indicates that the strerror routine is - * available to translate error numbers to strings. See the writeup - * of Strerror() in this file before you try to define your own. - */ -/* HAS_SYS_ERRLIST: - * This symbol, if defined, indicates that the sys_errlist array is - * available to translate error numbers to strings. The extern int - * sys_nerr gives the size of that table. - */ -/* Strerror: - * This preprocessor symbol is defined as a macro if strerror() is - * not available to translate error numbers to strings but sys_errlist[] - * array is there. - */ -#define HAS_STRERROR /**/ -#define HAS_SYS_ERRLIST /**/ -#define Strerror(e) strerror(e) - /* HAS_STRTOD: * This symbol, if defined, indicates that the strtod routine is * available to provide better numeric string conversion than atof(). @@ -757,7 +662,7 @@ * This symbol, if defined, indicates that the tzname[] array is * available to access timezone names. */ -/*#define HAS_TZNAME /**/ +#define HAS_TZNAME /**/ /* HAS_UMASK: * This symbol, if defined, indicates that the umask routine is @@ -765,11 +670,6 @@ */ #define HAS_UMASK /**/ -/* HAS_VFORK: - * This symbol, if defined, indicates that vfork() exists. - */ -/*#define HAS_VFORK /**/ - /* HASVOLATILE: * This symbol, if defined, indicates that this C compiler knows about * the volatile declaration. @@ -803,10 +703,10 @@ #define HAS_WCTOMB /**/ /* I_ARPA_INET: - * This symbol, if defined, indicates that <arpa/inet.h> exists and should - * be included. + * This symbol, if defined, indicates to the C program that it should + * include <arpa/inet.h> to get inet_addr and friends declarations. */ -/*#define I_ARPA_INET /**/ +#define I_ARPA_INET /**/ /* I_DBM: * This symbol, if defined, indicates that <dbm.h> exists and should @@ -857,32 +757,6 @@ */ #define I_FLOAT /**/ -/* I_GRP: - * This symbol, if defined, indicates to the C program that it should - * include <grp.h>. - */ -/* GRPASSWD: - * This symbol, if defined, indicates to the C program that struct group - * contains gr_passwd. - */ -/* HAS_SETGRENT: - * This symbol, if defined, indicates that the getgrent routine is - * available for initializing sequential access of the group database. - */ -/* HAS_GETGRENT: - * This symbol, if defined, indicates that the getgrent routine is - * available for sequential access of the group database. - */ -/* HAS_ENDGRENT: - * This symbol, if defined, indicates that the getgrent routine is - * available for finalizing sequential access of the group database. - */ -/*#define I_GRP /**/ -/*#define GRPASSWD /**/ -/*#define HAS_SETGRENT /**/ -/*#define HAS_GETGRENT /**/ -/*#define HAS_ENDGRENT /**/ - /* I_LIMITS: * This symbol, if defined, indicates to the C program that it should * include <limits.h> to get definition of symbols like WORD_BIT or @@ -1112,20 +986,156 @@ */ #define STDCHAR char /**/ +/* CROSSCOMPILE: + * This symbol, if defined, signifies that we our + * build process is a cross-compilation. + */ +/*#define CROSSCOMPILE /**/ + +/* INTSIZE: + * This symbol contains the value of sizeof(int) so that the C + * preprocessor can make decisions based on it. + */ +/* LONGSIZE: + * This symbol contains the value of sizeof(long) so that the C + * preprocessor can make decisions based on it. + */ +/* SHORTSIZE: + * This symbol contains the value of sizeof(short) so that the C + * preprocessor can make decisions based on it. + */ +#define INTSIZE 4 /**/ +#define LONGSIZE 4 /**/ +#define SHORTSIZE 2 /**/ + +/* MULTIARCH: + * This symbol, if defined, signifies that the build + * process will produce some binary files that are going to be + * used in a cross-platform environment. This is the case for + * example with the NeXT "fat" binaries that contain executables + * for several CPUs. + */ +/*#define MULTIARCH /**/ + +/* HAS_QUAD: + * This symbol, if defined, tells that there's a 64-bit integer type, + * Quad_t, and its unsigned counterpar, Uquad_t. QUADKIND will be one + * of QUAD_IS_INT, QUAD_IS_LONG, QUAD_IS_LONG_LONG, or QUAD_IS_INT64_T. + */ +/*#define HAS_QUAD /**/ +#ifdef HAS_QUAD +# define Quad_t long long /**/ +# define Uquad_t unsigned long long /**/ +# define QUADKIND 5 /**/ +# define QUAD_IS_INT 1 +# define QUAD_IS_LONG 2 +# define QUAD_IS_LONG_LONG 3 +# define QUAD_IS_INT64_T 4 +#endif + +/* HAS_ACCESSX: + * This symbol, if defined, indicates that the accessx routine is + * available to do extended access checks. + */ +/*#define HAS_ACCESSX /**/ + +/* HAS_EACCESS: + * This symbol, if defined, indicates that the eaccess routine is + * available to do extended access checks. + */ +/*#define HAS_EACCESS /**/ + +/* I_SYS_ACCESS: + * This symbol, if defined, indicates to the C program that it should + * include <sys/access.h>. + */ +/*#define I_SYS_ACCESS /**/ + +/* I_SYS_SECURITY: + * This symbol, if defined, indicates to the C program that it should + * include <sys/security.h>. + */ +/*#define I_SYS_SECURITY /**/ + +/* OSNAME: + * This symbol contains the name of the operating system, as determined + * by Configure. You shouldn't rely on it too much; the specific + * feature tests from Configure are generally more reliable. + */ +#define OSNAME "MSWin32" /**/ + /* MEM_ALIGNBYTES: - * This symbol contains the number of bytes required to align a - * double. Usual values are 2, 4 and 8. - * On NeXT starting with 3.2, you can build "Fat" Multiple Architecture - * Binaries (MAB) for targets with varying alignment. This only matters - * for perl, where the config.h can be generated and installed on one - * system, and used by a different architecture to build an extension. - * The default is eight, for safety. + * This symbol contains the number of bytes required to align a + * double, or a long double when applicable. Usual values are 2, + * 4 and 8. The default is eight, for safety. */ -#define MEM_ALIGNBYTES 8 /**/ +#if defined(CROSSCOMPILE) || defined(MULTIARCH) +# define MEM_ALIGNBYTES 8 +#else +#define MEM_ALIGNBYTES 8 +#endif + +/* ARCHLIB: + * This variable, if defined, holds the name of the directory in + * which the user wants to put architecture-dependent public + * library files for perl5. It is most often a local directory + * such as /usr/local/lib. Programs using this variable must be + * prepared to deal with filename expansion. If ARCHLIB is the + * same as PRIVLIB, it is not defined, since presumably the + * program already searches PRIVLIB. + */ +/* ARCHLIB_EXP: + * This symbol contains the ~name expanded version of ARCHLIB, to be used + * in programs that are not prepared to deal with ~ expansion at run-time. + */ +#define ARCHLIB "c:\\perl\\5.6.0\\lib\\MSWin32-x86" /**/ +/*#define ARCHLIB_EXP "" /**/ + +/* ARCHNAME: + * This symbol holds a string representing the architecture name. + * It may be used to construct an architecture-dependant pathname + * where library files may be held under a private library, for + * instance. + */ +#define ARCHNAME "MSWin32-x86" /**/ + +/* HAS_ATOLF: + * This symbol, if defined, indicates that the atolf routine is + * available to convert strings into long doubles. + */ +/*#define HAS_ATOLF /**/ + +/* HAS_ATOLL: + * This symbol, if defined, indicates that the atoll routine is + * available to convert strings into long longs. + */ +/*#define HAS_ATOLL /**/ + +/* BIN: + * This symbol holds the path of the bin directory where the package will + * be installed. Program must be prepared to deal with ~name substitution. + */ +/* BIN_EXP: + * This symbol is the filename expanded version of the BIN symbol, for + * programs that do not want to deal with that at run-time. + */ +#define BIN "c:\\perl\\5.6.0\\bin\\MSWin32-x86" /**/ +#define BIN_EXP "c:\\perl\\5.6.0\\bin\\MSWin32-x86" /**/ + +/* PERL_BINCOMPAT_5005: + * This symbol, if defined, indicates that this version of Perl should be + * binary-compatible with Perl 5.005. This is impossible for builds + * that use features like threads and multiplicity it is always undef + * for those versions. + */ +/*#define PERL_BINCOMPAT_5005 /**/ /* BYTEORDER: * This symbol holds the hexadecimal constant defined in byteorder, * i.e. 0x1234 or 0x4321, etc... + * If the compiler supports cross-compiling or multiple-architecture + * binaries (eg. on NeXT systems), use compiler-defined macros to + * determine the byte order. * On NeXT 3.2 (and greater), you can build "Fat" Multiple Architecture * Binaries (MAB) on either big endian or little endian machines. * The endian-ness is available at compile-time. This only matters @@ -1136,16 +1146,94 @@ * so the default case (for NeXT) is big endian to catch them. * This might matter for NeXT 3.0. */ -#ifndef NeXT +#if defined(CROSSCOMPILE) || defined(MULTIARCH) +# ifdef __LITTLE_ENDIAN__ +# if LONGSIZE == 4 +# define BYTEORDER 0x1234 +# else +# if LONGSIZE == 8 +# define BYTEORDER 0x12345678 +# endif +# endif +# else +# ifdef __BIG_ENDIAN__ +# if LONGSIZE == 4 +# define BYTEORDER 0x4321 +# else +# if LONGSIZE == 8 +# define BYTEORDER 0x87654321 +# endif +# endif +# endif +# endif +# if !defined(BYTEORDER) && (defined(NeXT) || defined(__NeXT__)) +# define BYTEORDER 0x4321 +# endif +#else #define BYTEORDER 0x1234 /* large digits for MSB */ -#else /* NeXT */ -#ifdef __LITTLE_ENDIAN__ -#define BYTEORDER 0x1234 -#else /* __BIG_ENDIAN__ */ -#define BYTEORDER 0x4321 -#endif /* ENDIAN CHECK */ #endif /* NeXT */ +/* CAT2: + * This macro catenates 2 tokens together. + */ +/* STRINGIFY: + * This macro surrounds its token with double quotes. + */ +#if 42 == 1 +# define CAT2(a,b) a/**/b +# define STRINGIFY(a) "a" + /* If you can get stringification with catify, tell me how! */ +#endif +#if 42 == 42 +# define PeRl_CaTiFy(a, b) a ## b +# define PeRl_StGiFy(a) #a +/* the additional level of indirection enables these macros to be + * used as arguments to other macros. See K&R 2nd ed., page 231. */ +# define CAT2(a,b) PeRl_CaTiFy(a,b) +# define StGiFy(a) PeRl_StGiFy(a) +# define STRINGIFY(a) PeRl_StGiFy(a) +#endif +#if 42 != 1 && 42 != 42 +#include "Bletch: How does this C preprocessor catenate tokens?" +#endif + +/* CPPSTDIN: + * This symbol contains the first part of the string which will invoke + * the C preprocessor on the standard input and produce to standard + * output. Typical value of "cc -E" or "/lib/cpp", but it can also + * call a wrapper. See CPPRUN. + */ +/* CPPMINUS: + * This symbol contains the second part of the string which will invoke + * the C preprocessor on the standard input and produce to standard + * output. This symbol will have the value "-" if CPPSTDIN needs a minus + * to specify standard input, otherwise the value is "". + */ +/* CPPRUN: + * This symbol contains the string which will invoke a C preprocessor on + * the standard input and produce to standard output. It needs to end + * with CPPLAST, after all other preprocessor flags have been specified. + * The main difference with CPPSTDIN is that this program will never be a + * pointer to a shell wrapper, i.e. it will be empty if no preprocessor is + * available directly to the user. Note that it may well be different from + * the preprocessor used to compile the C program. + */ +/* CPPLAST: + * This symbol is intended to be used along with CPPRUN in the same manner + * symbol CPPMINUS is used with CPPSTDIN. It contains either "-" or "". + */ +#define CPPSTDIN "gcc -E" +#define CPPMINUS "-" +#define CPPRUN "gcc -E" +#define CPPLAST "" + +/* HAS_ACCESS: + * This manifest constant lets the C program know that the access() + * system call is available to check for accessibility using real UID/GID. + * (always present on UNIX.) + */ +#define HAS_ACCESS /**/ + /* CASTI32: * This symbol is defined if the C compiler can cast negative * or large floating point numbers to 32-bit ints. @@ -1173,320 +1261,144 @@ */ /*#define VOID_CLOSEDIR /**/ -/* Gconvert: - * This preprocessor macro is defined to convert a floating point - * number to a string without a trailing decimal point. This - * emulates the behavior of sprintf("%g"), but is sometimes much more - * efficient. If gconvert() is not available, but gcvt() drops the - * trailing decimal point, then gcvt() is used. If all else fails, - * a macro using sprintf("%g") is used. Arguments for the Gconvert - * macro are: value, number of digits, whether trailing zeros should - * be retained, and the output buffer. - * Possible values are: - * d_Gconvert='gconvert((x),(n),(t),(b))' - * d_Gconvert='gcvt((x),(n),(b))' - * d_Gconvert='sprintf((b),"%.*g",(n),(x))' - * The last two assume trailing zeros should not be kept. +/* HAS_CSH: + * This symbol, if defined, indicates that the C-shell exists. */ -#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x)) - -/* HAS_GNULIBC: - * This symbol, if defined, indicates to the C program that - * the GNU C library is being used. - */ -/*#define HAS_GNULIBC /**/ -/* HAS_ISASCII: - * This manifest constant lets the C program know that isascii - * is available. - */ -#define HAS_ISASCII /**/ - -/* HAS_LCHOWN: - * This symbol, if defined, indicates that the lchown routine is - * available to operate on a symbolic link (instead of following the - * link). - */ -/*#define HAS_LCHOWN /**/ - -/* HAS_OPEN3: - * This manifest constant lets the C program know that the three - * argument form of open(2) is available. - */ -/*#define HAS_OPEN3 /**/ - -/* HAS_SAFE_BCOPY: - * This symbol, if defined, indicates that the bcopy routine is available - * to copy potentially overlapping memory blocks. Otherwise you should - * probably use memmove() or memcpy(). If neither is defined, roll your - * own version. - */ -/*#define HAS_SAFE_BCOPY /**/ - -/* HAS_SAFE_MEMCPY: - * This symbol, if defined, indicates that the memcpy routine is available - * to copy potentially overlapping memory blocks. Otherwise you should - * probably use memmove() or memcpy(). If neither is defined, roll your - * own version. +/* CSH: + * This symbol, if defined, contains the full pathname of csh. */ -/*#define HAS_SAFE_MEMCPY /**/ +/*#define HAS_CSH /**/ +#ifdef HAS_CSH +#define CSH "" /**/ +#endif -/* HAS_SANE_MEMCMP: - * This symbol, if defined, indicates that the memcmp routine is available - * and can be used to compare relative magnitudes of chars with their high - * bits set. If it is not defined, roll your own version. +/* DLSYM_NEEDS_UNDERSCORE: + * This symbol, if defined, indicates that we need to prepend an + * underscore to the symbol name before calling dlsym(). This only + * makes sense if you *have* dlsym, which we will presume is the + * case if you're using dl_dlopen.xs. */ -#define HAS_SANE_MEMCMP /**/ +/*#define DLSYM_NEEDS_UNDERSCORE /**/ -/* HAS_SIGACTION: - * This symbol, if defined, indicates that Vr4's sigaction() routine - * is available. +/* HAS_DRAND48_PROTO: + * This symbol, if defined, indicates that the system provides + * a prototype for the drand48() function. Otherwise, it is up + * to the program to supply one. A good guess is + * extern double drand48 _((void)); */ -/*#define HAS_SIGACTION /**/ +/*#define HAS_DRAND48_PROTO /**/ -/* Sigjmp_buf: - * This is the buffer type to be used with Sigsetjmp and Siglongjmp. - */ -/* Sigsetjmp: - * This macro is used in the same way as sigsetjmp(), but will invoke - * traditional setjmp() if sigsetjmp isn't available. - * See HAS_SIGSETJMP. - */ -/* Siglongjmp: - * This macro is used in the same way as siglongjmp(), but will invoke - * traditional longjmp() if siglongjmp isn't available. - * See HAS_SIGSETJMP. - */ -/*#define HAS_SIGSETJMP /**/ -#ifdef HAS_SIGSETJMP -#define Sigjmp_buf sigjmp_buf -#define Sigsetjmp(buf,save_mask) sigsetjmp((buf),(save_mask)) -#define Siglongjmp(buf,retval) siglongjmp((buf),(retval)) -#else -#define Sigjmp_buf jmp_buf -#define Sigsetjmp(buf,save_mask) setjmp((buf)) -#define Siglongjmp(buf,retval) longjmp((buf),(retval)) -#endif - -/* USE_STDIO_PTR: - * This symbol is defined if the _ptr and _cnt fields (or similar) - * of the stdio FILE structure can be used to access the stdio buffer - * for a file handle. If this is defined, then the FILE_ptr(fp) - * and FILE_cnt(fp) macros will also be defined and should be used - * to access these fields. - */ -/* FILE_ptr: - * This macro is used to access the _ptr field (or equivalent) of the - * FILE structure pointed to by its argument. This macro will always be - * defined if USE_STDIO_PTR is defined. - */ -/* STDIO_PTR_LVALUE: - * This symbol is defined if the FILE_ptr macro can be used as an - * lvalue. - */ -/* FILE_cnt: - * This macro is used to access the _cnt field (or equivalent) of the - * FILE structure pointed to by its argument. This macro will always be - * defined if USE_STDIO_PTR is defined. - */ -/* STDIO_CNT_LVALUE: - * This symbol is defined if the FILE_cnt macro can be used as an - * lvalue. +/* HAS_ENDGRENT: + * This symbol, if defined, indicates that the getgrent routine is + * available for finalizing sequential access of the group database. */ -/*#define USE_STDIO_PTR /**/ -#ifdef USE_STDIO_PTR -#define FILE_ptr(fp) ((fp)->_ptr) -#define STDIO_PTR_LVALUE /**/ -#define FILE_cnt(fp) ((fp)->_cnt) -#define STDIO_CNT_LVALUE /**/ -#endif +/*#define HAS_ENDGRENT /**/ -/* USE_STDIO_BASE: - * This symbol is defined if the _base field (or similar) of the - * stdio FILE structure can be used to access the stdio buffer for - * a file handle. If this is defined, then the FILE_base(fp) macro - * will also be defined and should be used to access this field. - * Also, the FILE_bufsiz(fp) macro will be defined and should be used - * to determine the number of bytes in the buffer. USE_STDIO_BASE - * will never be defined unless USE_STDIO_PTR is. - */ -/* FILE_base: - * This macro is used to access the _base field (or equivalent) of the - * FILE structure pointed to by its argument. This macro will always be - * defined if USE_STDIO_BASE is defined. - */ -/* FILE_bufsiz: - * This macro is used to determine the number of bytes in the I/O - * buffer pointed to by _base field (or equivalent) of the FILE - * structure pointed to its argument. This macro will always be defined - * if USE_STDIO_BASE is defined. +/* HAS_ENDHOSTENT: + * This symbol, if defined, indicates that the endhostent() routine is + * available to close whatever was being used for host queries. */ -/*#define USE_STDIO_BASE /**/ -#ifdef USE_STDIO_BASE -#define FILE_base(fp) ((fp)->_base) -#define FILE_bufsiz(fp) ((fp)->_cnt + (fp)->_ptr - (fp)->_base) -#endif +/*#define HAS_ENDHOSTENT /**/ -/* HAS_VPRINTF: - * This symbol, if defined, indicates that the vprintf routine is available - * to printf with a pointer to an argument list. If unavailable, you - * may need to write your own, probably in terms of _doprnt(). - */ -/* USE_CHAR_VSPRINTF: - * This symbol is defined if this system has vsprintf() returning type - * (char*). The trend seems to be to declare it as "int vsprintf()". It - * is up to the package author to declare vsprintf correctly based on the - * symbol. +/* HAS_ENDNETENT: + * This symbol, if defined, indicates that the endnetent() routine is + * available to close whatever was being used for network queries. */ -#define HAS_VPRINTF /**/ -/*#define USE_CHAR_VSPRINTF /**/ +/*#define HAS_ENDNETENT /**/ -/* DOUBLESIZE: - * This symbol contains the size of a double, so that the C preprocessor - * can make decisions based on it. +/* HAS_ENDPROTOENT: + * This symbol, if defined, indicates that the endprotoent() routine is + * available to close whatever was being used for protocol queries. */ -#define DOUBLESIZE 8 /**/ +/*#define HAS_ENDPROTOENT /**/ -/* I_TIME: - * This symbol, if defined, indicates to the C program that it should - * include <time.h>. - */ -/* I_SYS_TIME: - * This symbol, if defined, indicates to the C program that it should - * include <sys/time.h>. - */ -/* I_SYS_TIME_KERNEL: - * This symbol, if defined, indicates to the C program that it should - * include <sys/time.h> with KERNEL defined. +/* HAS_ENDPWENT: + * This symbol, if defined, indicates that the getgrent routine is + * available for finalizing sequential access of the passwd database. */ -#define I_TIME /**/ -/*#define I_SYS_TIME /**/ -/*#define I_SYS_TIME_KERNEL /**/ +/*#define HAS_ENDPWENT /**/ -/* INTSIZE: - * This symbol contains the value of sizeof(int) so that the C - * preprocessor can make decisions based on it. - */ -/* LONGSIZE: - * This symbol contains the value of sizeof(long) so that the C - * preprocessor can make decisions based on it. - */ -/* SHORTSIZE: - * This symbol contains the value of sizeof(short) so that the C - * preprocessor can make decisions based on it. +/* HAS_ENDSERVENT: + * This symbol, if defined, indicates that the endservent() routine is + * available to close whatever was being used for service queries. */ -#define INTSIZE 4 /**/ -#define LONGSIZE 4 /**/ -#define SHORTSIZE 2 /**/ +/*#define HAS_ENDSERVENT /**/ -/* VAL_O_NONBLOCK: - * This symbol is to be used during open() or fcntl(F_SETFL) to turn on - * non-blocking I/O for the file descriptor. Note that there is no way - * back, i.e. you cannot turn it blocking again this way. If you wish to - * alternatively switch between blocking and non-blocking, use the - * ioctl(FIOSNBIO) call instead, but that is not supported by all devices. - */ -/* VAL_EAGAIN: - * This symbol holds the errno error code set by read() when no data was - * present on the non-blocking file descriptor. - */ -/* RD_NODATA: - * This symbol holds the return code from read() when no data is present - * on the non-blocking file descriptor. Be careful! If EOF_NONBLOCK is - * not defined, then you can't distinguish between no data and EOF by - * issuing a read(). You'll have to find another way to tell for sure! - */ -/* EOF_NONBLOCK: - * This symbol, if defined, indicates to the C program that a read() on - * a non-blocking file descriptor will return 0 on EOF, and not the value - * held in RD_NODATA (-1 usually, in that case!). +/* HAS_ENDSPENT: + * This symbol, if defined, indicates that the endspent system call is + * available to finalize the scan of SysV shadow password entries. */ -#define VAL_O_NONBLOCK O_NONBLOCK -#define VAL_EAGAIN EAGAIN -#define RD_NODATA -1 -#define EOF_NONBLOCK +/*#define HAS_ENDSPENT /**/ -/* PTRSIZE: - * This symbol contains the size of a pointer, so that the C preprocessor - * can make decisions based on it. It will be sizeof(void *) if - * the compiler supports (void *); otherwise it will be - * sizeof(char *). +/* HAS_FD_SET: + * This symbol, when defined, indicates presence of the fd_set typedef + * in <sys/types.h> */ -#define PTRSIZE 4 /**/ +#define HAS_FD_SET /**/ -/* RANDBITS: - * This symbol contains the number of bits of random number the rand() - * function produces. Usual values are 15, 16, and 31. +/* HAS_FPOS64_T: + * This symbol will be defined if the C compiler supports fpos64_t. */ -#define RANDBITS 15 /**/ +/*#define HAS_FPOS64_T /**/ -/* SSize_t: - * This symbol holds the type used by functions that return - * a count of bytes or an error condition. It must be a signed type. - * It is usually ssize_t, but may be long or int, etc. - * It may be necessary to include <sys/types.h> or <unistd.h> - * to get any typedef'ed information. - * We will pick a type such that sizeof(SSize_t) == sizeof(Size_t). +/* HAS_STRUCT_FS_DATA: + * This symbol, if defined, indicates that the struct fs_data + * to do statfs() is supported. */ -#define SSize_t int /* signed count of bytes */ +/*#define HAS_STRUCT_FS_DATA /**/ -/* OSNAME: - * This symbol contains the name of the operating system, as determined - * by Configure. You shouldn't rely on it too much; the specific - * feature tests from Configure are generally more reliable. +/* HAS_FSEEKO: + * This symbol, if defined, indicates that the fseeko routine is + * available to fseek beyond 32 bits (useful for ILP32 hosts). */ -#define OSNAME "MSWin32" /**/ +/*#define HAS_FSEEKO /**/ -/* CAT2: - * This macro catenates 2 tokens together. - */ -/* STRINGIFY: - * This macro surrounds its token with double quotes. +/* HAS_FSTATFS: + * This symbol, if defined, indicates that the fstatfs routine is + * available to stat filesystems by file descriptors. */ -#if 42 == 1 -#define CAT2(a,b)a/**/b -#define STRINGIFY(a)"a" - /* If you can get stringification with catify, tell me how! */ -#endif -#if 42 == 42 -#define CAT2(a,b)a ## b -#define StGiFy(a)# a -#define STRINGIFY(a)StGiFy(a) -#endif -#if 42 != 1 && 42 != 42 -#include "Bletch: How does this C preprocessor catenate tokens?" -#endif +/*#define HAS_FSTATFS /**/ -/* CSH: - * This symbol, if defined, contains the full pathname of csh. +/* HAS_FTELLO: + * This symbol, if defined, indicates that the ftello routine is + * available to ftell beyond 32 bits (useful for ILP32 hosts). */ -/*#define HAS_CSH /**/ -#ifdef HAS_CSH -#define CSH "" /**/ -#endif +/*#define HAS_FTELLO /**/ -/* HAS_ENDHOSTENT: - * This symbol, if defined, indicates that the endhostent() routine is - * available to close whatever was being used for host queries. +/* Gconvert: + * This preprocessor macro is defined to convert a floating point + * number to a string without a trailing decimal point. This + * emulates the behavior of sprintf("%g"), but is sometimes much more + * efficient. If gconvert() is not available, but gcvt() drops the + * trailing decimal point, then gcvt() is used. If all else fails, + * a macro using sprintf("%g") is used. Arguments for the Gconvert + * macro are: value, number of digits, whether trailing zeros should + * be retained, and the output buffer. + * Possible values are: + * d_Gconvert='gconvert((x),(n),(t),(b))' + * d_Gconvert='gcvt((x),(n),(b))' + * d_Gconvert='sprintf((b),"%.*g",(n),(x))' + * The last two assume trailing zeros should not be kept. */ -/*#define HAS_ENDHOSTENT /**/ +#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x)) -/* HAS_ENDNETENT: - * This symbol, if defined, indicates that the endnetent() routine is - * available to close whatever was being used for network queries. +/* HAS_GETCWD: + * This symbol, if defined, indicates that the getcwd routine is + * available to get the current working directory. */ -/*#define HAS_ENDNETENT /**/ +/*#define HAS_GETCWD /**/ -/* HAS_ENDPROTOENT: - * This symbol, if defined, indicates that the endprotoent() routine is - * available to close whatever was being used for protocol queries. +/* HAS_GETFSSTAT: + * This symbol, if defined, indicates that the getfsstat routine is + * available to stat filesystems in bulk. */ -/*#define HAS_ENDPROTOENT /**/ +/*#define HAS_GETFSSTAT /**/ -/* HAS_ENDSERVENT: - * This symbol, if defined, indicates that the endservent() routine is - * available to close whatever was being used for service queries. +/* HAS_GETGRENT: + * This symbol, if defined, indicates that the getgrent routine is + * available for sequential access of the group database. */ -/*#define HAS_ENDSERVENT /**/ +/*#define HAS_GETGRENT /**/ /* HAS_GETHOSTBYADDR: * This symbol, if defined, indicates that the gethostbyaddr() routine is @@ -1506,6 +1418,55 @@ */ /*#define HAS_GETHOSTENT /**/ +/* HAS_GETHOSTNAME: + * This symbol, if defined, indicates that the C program may use the + * gethostname() routine to derive the host name. See also HAS_UNAME + * and PHOSTNAME. + */ +/* HAS_UNAME: + * This symbol, if defined, indicates that the C program may use the + * uname() routine to derive the host name. See also HAS_GETHOSTNAME + * and PHOSTNAME. + */ +/* PHOSTNAME: + * This symbol, if defined, indicates the command to feed to the + * popen() routine to derive the host name. See also HAS_GETHOSTNAME + * and HAS_UNAME. Note that the command uses a fully qualified path, + * so that it is safe even if used by a process with super-user + * privileges. + */ +/* HAS_PHOSTNAME: + * This symbol, if defined, indicates that the C program may use the + * contents of PHOSTNAME as a command to feed to the popen() routine + * to derive the host name. + */ +#define HAS_GETHOSTNAME /**/ +#define HAS_UNAME /**/ +/*#define HAS_PHOSTNAME /**/ +#ifdef HAS_PHOSTNAME +#define PHOSTNAME "" /* How to get the host name */ +#endif + +/* HAS_GETHOST_PROTOS: + * This symbol, if defined, indicates that <netdb.h> includes + * prototypes for gethostent(), gethostbyname(), and + * gethostbyaddr(). Otherwise, it is up to the program to guess + * them. See netdbtype.U for probing for various Netdb_xxx_t types. + */ +#define HAS_GETHOST_PROTOS /**/ + +/* HAS_GETMNT: + * This symbol, if defined, indicates that the getmnt routine is + * available to get filesystem mount info by filename. + */ +/*#define HAS_GETMNT /**/ + +/* HAS_GETMNTENT: + * This symbol, if defined, indicates that the getmntent routine is + * available to iterate through mounted file systems to get their info. + */ +/*#define HAS_GETMNTENT /**/ + /* HAS_GETNETBYADDR: * This symbol, if defined, indicates that the getnetbyaddr() routine is * available to look up networks by their IP addresses. @@ -1524,6 +1485,14 @@ */ /*#define HAS_GETNETENT /**/ +/* HAS_GETNET_PROTOS: + * This symbol, if defined, indicates that <netdb.h> includes + * prototypes for getnetent(), getnetbyname(), and + * getnetbyaddr(). Otherwise, it is up to the program to guess + * them. See netdbtype.U for probing for various Netdb_xxx_t types. + */ +/*#define HAS_GETNET_PROTOS /**/ + /* HAS_GETPROTOENT: * This symbol, if defined, indicates that the getprotoent() routine is * available to look up protocols in some data base or another. @@ -1541,12 +1510,47 @@ #define HAS_GETPROTOBYNAME /**/ #define HAS_GETPROTOBYNUMBER /**/ +/* HAS_GETPROTO_PROTOS: + * This symbol, if defined, indicates that <netdb.h> includes + * prototypes for getprotoent(), getprotobyname(), and + * getprotobyaddr(). Otherwise, it is up to the program to guess + * them. See netdbtype.U for probing for various Netdb_xxx_t types. + */ +#define HAS_GETPROTO_PROTOS /**/ + +/* HAS_GETPWENT: + * This symbol, if defined, indicates that the getpwent routine is + * available for sequential access of the passwd database. + * If this is not available, the older getpw() function may be available. + */ +/*#define HAS_GETPWENT /**/ + /* HAS_GETSERVENT: * This symbol, if defined, indicates that the getservent() routine is * available to look up network services in some data base or another. */ /*#define HAS_GETSERVENT /**/ +/* HAS_GETSERV_PROTOS: + * This symbol, if defined, indicates that <netdb.h> includes + * prototypes for getservent(), getservbyname(), and + * getservbyaddr(). Otherwise, it is up to the program to guess + * them. See netdbtype.U for probing for various Netdb_xxx_t types. + */ +#define HAS_GETSERV_PROTOS /**/ + +/* HAS_GETSPENT: + * This symbol, if defined, indicates that the getspent system call is + * available to retrieve SysV shadow password entries sequentially. + */ +/*#define HAS_GETSPENT /**/ + +/* HAS_GETSPNAM: + * This symbol, if defined, indicates that the getspnam system call is + * available to retrieve SysV shadow password entries by name. + */ +/*#define HAS_GETSPNAM /**/ + /* HAS_GETSERVBYNAME: * This symbol, if defined, indicates that the getservbyname() * routine is available to look up services by their name. @@ -1558,6 +1562,72 @@ #define HAS_GETSERVBYNAME /**/ #define HAS_GETSERVBYPORT /**/ +/* HAS_GNULIBC: + * This symbol, if defined, indicates to the C program that + * the GNU C library is being used. + */ +/*#define HAS_GNULIBC /**/ +#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE) +# define _GNU_SOURCE +#endif +/* HAS_HASMNTOPT: + * This symbol, if defined, indicates that the hasmntopt routine is + * available to query the mount options of file systems. + */ +/*#define HAS_HASMNTOPT /**/ + +/* HAS_HTONL: + * This symbol, if defined, indicates that the htonl() routine (and + * friends htons() ntohl() ntohs()) are available to do network + * order byte swapping. + */ +/* HAS_HTONS: + * This symbol, if defined, indicates that the htons() routine (and + * friends htonl() ntohl() ntohs()) are available to do network + * order byte swapping. + */ +/* HAS_NTOHL: + * This symbol, if defined, indicates that the ntohl() routine (and + * friends htonl() htons() ntohs()) are available to do network + * order byte swapping. + */ +/* HAS_NTOHS: + * This symbol, if defined, indicates that the ntohs() routine (and + * friends htonl() htons() ntohl()) are available to do network + * order byte swapping. + */ +#define HAS_HTONL /**/ +#define HAS_HTONS /**/ +#define HAS_NTOHL /**/ +#define HAS_NTOHS /**/ + +/* HAS_ICONV: + * This symbol, if defined, indicates that the iconv routine is + * available to do character set conversions. + */ +/*#define HAS_ICONV /**/ + +/* HAS_INT64_T: + * This symbol will defined if the C compiler supports int64_t. + * Usually the <inttypes.h> needs to be included, but sometimes + * <sys/types.h> is enough. + */ +/*#define HAS_INT64_T /**/ + +/* HAS_ISASCII: + * This manifest constant lets the C program know that isascii + * is available. + */ +#define HAS_ISASCII /**/ + +/* HAS_LDBL_DIG: + * This symbol, if defined, indicates that this system's <float.h> + * or <limits.h> defines the symbol LDBL_DIG, which is the number + * of significant digits in a long double precision number. Unlike + * for DBL_DIG, there's no good guess for LDBL_DIG if it is undefined. + */ +#define HAS_LDBL_DIG /**/ + /* HAS_LONG_DOUBLE: * This symbol will be defined if the C compiler supports long * doubles. @@ -1573,8 +1643,7 @@ #endif /* HAS_LONG_LONG: - * This symbol will be defined if the C compiler supports - * long long. + * This symbol will be defined if the C compiler supports long long. */ /* LONGLONGSIZE: * This symbol contains the size of a long long, so that the @@ -1586,6 +1655,145 @@ #define LONGLONGSIZE 8 /**/ #endif +/* HAS_LSEEK_PROTO: + * This symbol, if defined, indicates that the system provides + * a prototype for the lseek() function. Otherwise, it is up + * to the program to supply one. A good guess is + * extern off_t lseek(int, off_t, int); + */ +#define HAS_LSEEK_PROTO /**/ + +/* HAS_MADVISE: + * This symbol, if defined, indicates that the madvise system call is + * available to map a file into memory. + */ +/*#define HAS_MADVISE /**/ + +/* HAS_MEMCHR: + * This symbol, if defined, indicates that the memchr routine is available + * to locate characters within a C string. + */ +#define HAS_MEMCHR /**/ + +/* HAS_MKDTEMP: + * This symbol, if defined, indicates that the mkdtemp routine is + * available to exclusively create a uniquely named temporary directory. + */ +/*#define HAS_MKDTEMP /**/ + +/* HAS_MKSTEMP: + * This symbol, if defined, indicates that the mkstemp routine is + * available to exclusively create and open a uniquely named + * temporary file. + */ +/*#define HAS_MKSTEMP /**/ + +/* HAS_MKSTEMPS: + * This symbol, if defined, indicates that the mkstemps routine is + * available to excluslvely create and open a uniquely named + * (with a suffix) temporary file. + */ +/*#define HAS_MKSTEMPS /**/ + +/* HAS_MMAP: + * This symbol, if defined, indicates that the mmap system call is + * available to map a file into memory. + */ +/* Mmap_t: + * This symbol holds the return type of the mmap() system call + * (and simultaneously the type of the first argument). + * Usually set to 'void *' or 'cadd_t'. + */ +/*#define HAS_MMAP /**/ +#define Mmap_t void * /**/ + +/* HAS_MPROTECT: + * This symbol, if defined, indicates that the mprotect system call is + * available to modify the access protection of a memory mapped file. + */ +/*#define HAS_MPROTECT /**/ + +/* HAS_MSG: + * This symbol, if defined, indicates that the entire msg*(2) library is + * supported (IPC mechanism based on message queues). + */ +/*#define HAS_MSG /**/ + +/* HAS_OFF64_T: + * This symbol will be defined if the C compiler supports off64_t. + */ +/*#define HAS_OFF64_T /**/ + +/* HAS_OPEN3: + * This manifest constant lets the C program know that the three + * argument form of open(2) is available. + */ +/*#define HAS_OPEN3 /**/ + +/* OLD_PTHREAD_CREATE_JOINABLE: + * This symbol, if defined, indicates how to create pthread + * in joinable (aka undetached) state. NOTE: not defined + * if pthread.h already has defined PTHREAD_CREATE_JOINABLE + * (the new version of the constant). + * If defined, known values are PTHREAD_CREATE_UNDETACHED + * and __UNDETACHED. + */ +/*#define OLD_PTHREAD_CREATE_JOINABLE /**/ + +/* HAS_PTHREAD_YIELD: + * This symbol, if defined, indicates that the pthread_yield + * routine is available to yield the execution of the current + * thread. sched_yield is preferable to pthread_yield. + */ +/* SCHED_YIELD: + * This symbol defines the way to yield the execution of + * the current thread. Known ways are sched_yield, + * pthread_yield, and pthread_yield with NULL. + */ +/* HAS_SCHED_YIELD: + * This symbol, if defined, indicates that the sched_yield + * routine is available to yield the execution of the current + * thread. sched_yield is preferable to pthread_yield. + */ +/*#define HAS_PTHREAD_YIELD /**/ +#define SCHED_YIELD /**/ +/*#define HAS_SCHED_YIELD /**/ + +/* HAS_SAFE_BCOPY: + * This symbol, if defined, indicates that the bcopy routine is available + * to copy potentially overlapping memory blocks. Otherwise you should + * probably use memmove() or memcpy(). If neither is defined, roll your + * own version. + */ +/*#define HAS_SAFE_BCOPY /**/ + +/* HAS_SAFE_MEMCPY: + * This symbol, if defined, indicates that the memcpy routine is available + * to copy potentially overlapping memory blocks. Otherwise you should + * probably use memmove() or memcpy(). If neither is defined, roll your + * own version. + */ +/*#define HAS_SAFE_MEMCPY /**/ + +/* HAS_SANE_MEMCMP: + * This symbol, if defined, indicates that the memcmp routine is available + * and can be used to compare relative magnitudes of chars with their high + * bits set. If it is not defined, roll your own version. + */ +#define HAS_SANE_MEMCMP /**/ + +/* HAS_SEM: + * This symbol, if defined, indicates that the entire sem*(2) library is + * supported. + */ +/*#define HAS_SEM /**/ + +/* HAS_SETGRENT: + * This symbol, if defined, indicates that the setgrent routine is + * available for initializing sequential access of the group database. + */ +/*#define HAS_SETGRENT /**/ + /* HAS_SETGROUPS: * This symbol, if defined, indicates that the setgroups() routine is * available to set the list of process groups. If unavailable, multiple @@ -1611,12 +1819,24 @@ */ /*#define HAS_SETPROTOENT /**/ +/* HAS_SETPWENT: + * This symbol, if defined, indicates that the setpwent routine is + * available for initializing sequential access of the passwd database. + */ +/*#define HAS_SETPWENT /**/ + /* HAS_SETSERVENT: * This symbol, if defined, indicates that the setservent() routine is * available. */ /*#define HAS_SETSERVENT /**/ +/* HAS_SETSPENT: + * This symbol, if defined, indicates that the setspent system call is + * available to initialize the scan of SysV shadow password entries. + */ +/*#define HAS_SETSPENT /**/ + /* HAS_SETVBUF: * This symbol, if defined, indicates that the setvbuf routine is * available to change buffering on an open stdio stream. @@ -1624,6 +1844,55 @@ */ #define HAS_SETVBUF /**/ +/* USE_SFIO: + * This symbol, if defined, indicates that sfio should + * be used. + */ +/*#define USE_SFIO /**/ + +/* HAS_SHM: + * This symbol, if defined, indicates that the entire shm*(2) library is + * supported. + */ +/*#define HAS_SHM /**/ + +/* HAS_SIGACTION: + * This symbol, if defined, indicates that Vr4's sigaction() routine + * is available. + */ +/*#define HAS_SIGACTION /**/ + +/* HAS_SIGSETJMP: + * This variable indicates to the C program that the sigsetjmp() + * routine is available to save the calling process's registers + * and stack environment for later use by siglongjmp(), and + * to optionally save the process's signal mask. See + * Sigjmp_buf, Sigsetjmp, and Siglongjmp. + */ +/* Sigjmp_buf: + * This is the buffer type to be used with Sigsetjmp and Siglongjmp. + */ +/* Sigsetjmp: + * This macro is used in the same way as sigsetjmp(), but will invoke + * traditional setjmp() if sigsetjmp isn't available. + * See HAS_SIGSETJMP. + */ +/* Siglongjmp: + * This macro is used in the same way as siglongjmp(), but will invoke + * traditional longjmp() if siglongjmp isn't available. + * See HAS_SIGSETJMP. + */ +/*#define HAS_SIGSETJMP /**/ +#ifdef HAS_SIGSETJMP +#define Sigjmp_buf sigjmp_buf +#define Sigsetjmp(buf,save_mask) sigsetjmp((buf),(save_mask)) +#define Siglongjmp(buf,retval) siglongjmp((buf),(retval)) +#else +#define Sigjmp_buf jmp_buf +#define Sigsetjmp(buf,save_mask) setjmp((buf)) +#define Siglongjmp(buf,retval) longjmp((buf),(retval)) +#endif + /* HAS_SOCKET: * This symbol, if defined, indicates that the BSD socket interface is * supported. @@ -1632,8 +1901,205 @@ * This symbol, if defined, indicates that the BSD socketpair() call is * supported. */ -#define HAS_SOCKET /**/ -/*#define HAS_SOCKETPAIR /**/ +/* HAS_MSG_CTRUNC: + * This symbol, if defined, indicates that the MSG_CTRUNC is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +/* HAS_MSG_DONTROUTE: + * This symbol, if defined, indicates that the MSG_DONTROUTE is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +/* HAS_MSG_OOB: + * This symbol, if defined, indicates that the MSG_OOB is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +/* HAS_MSG_PEEK: + * This symbol, if defined, indicates that the MSG_PEEK is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +/* HAS_MSG_PROXY: + * This symbol, if defined, indicates that the MSG_PROXY is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +/* HAS_SCM_RIGHTS: + * This symbol, if defined, indicates that the SCM_RIGHTS is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +#define HAS_SOCKET /**/ +/*#define HAS_SOCKETPAIR /**/ +/*#define HAS_MSG_CTRUNC /**/ +/*#define HAS_MSG_DONTROUTE /**/ +/*#define HAS_MSG_OOB /**/ +/*#define HAS_MSG_PEEK /**/ +/*#define HAS_MSG_PROXY /**/ +/*#define HAS_SCM_RIGHTS /**/ + +/* HAS_SQRTL: + * This symbol, if defined, indicates that the sqrtl routine is + * available to do long double square roots. + */ +/*#define HAS_SQRTL /**/ + +/* USE_STAT_BLOCKS: + * This symbol is defined if this system has a stat structure declaring + * st_blksize and st_blocks. + */ +#ifndef USE_STAT_BLOCKS +/*#define USE_STAT_BLOCKS /**/ +#endif + +/* HAS_STRUCT_STATFS_F_FLAGS: + * This symbol, if defined, indicates that the struct statfs + * does have the f_flags member containing the mount flags of + * the filesystem containing the file. + * This kind of struct statfs is coming from <sys/mount.h> (BSD 4.3), + * not from <sys/statfs.h> (SYSV). Older BSDs (like Ultrix) do not + * have statfs() and struct statfs, they have ustat() and getmnt() + * with struct ustat and struct fs_data. + */ +/*#define HAS_STRUCT_STATFS_F_FLAGS /**/ + +/* HAS_STRUCT_STATFS: + * This symbol, if defined, indicates that the struct statfs + * to do statfs() is supported. + */ +/*#define HAS_STRUCT_STATFS /**/ + +/* HAS_FSTATVFS: + * This symbol, if defined, indicates that the fstatvfs routine is + * available to stat filesystems by file descriptors. + */ +/*#define HAS_FSTATVFS /**/ + +/* USE_STDIO_PTR: + * This symbol is defined if the _ptr and _cnt fields (or similar) + * of the stdio FILE structure can be used to access the stdio buffer + * for a file handle. If this is defined, then the FILE_ptr(fp) + * and FILE_cnt(fp) macros will also be defined and should be used + * to access these fields. + */ +/* FILE_ptr: + * This macro is used to access the _ptr field (or equivalent) of the + * FILE structure pointed to by its argument. This macro will always be + * defined if USE_STDIO_PTR is defined. + */ +/* STDIO_PTR_LVALUE: + * This symbol is defined if the FILE_ptr macro can be used as an + * lvalue. + */ +/* FILE_cnt: + * This macro is used to access the _cnt field (or equivalent) of the + * FILE structure pointed to by its argument. This macro will always be + * defined if USE_STDIO_PTR is defined. + */ +/* STDIO_CNT_LVALUE: + * This symbol is defined if the FILE_cnt macro can be used as an + * lvalue. + */ +#define USE_STDIO_PTR /**/ +#ifdef USE_STDIO_PTR +#define FILE_ptr(fp) ((fp)->_ptr) +#define STDIO_PTR_LVALUE /**/ +#define FILE_cnt(fp) ((fp)->_cnt) +#define STDIO_CNT_LVALUE /**/ +#endif + +/* USE_STDIO_BASE: + * This symbol is defined if the _base field (or similar) of the + * stdio FILE structure can be used to access the stdio buffer for + * a file handle. If this is defined, then the FILE_base(fp) macro + * will also be defined and should be used to access this field. + * Also, the FILE_bufsiz(fp) macro will be defined and should be used + * to determine the number of bytes in the buffer. USE_STDIO_BASE + * will never be defined unless USE_STDIO_PTR is. + */ +/* FILE_base: + * This macro is used to access the _base field (or equivalent) of the + * FILE structure pointed to by its argument. This macro will always be + * defined if USE_STDIO_BASE is defined. + */ +/* FILE_bufsiz: + * This macro is used to determine the number of bytes in the I/O + * buffer pointed to by _base field (or equivalent) of the FILE + * structure pointed to its argument. This macro will always be defined + * if USE_STDIO_BASE is defined. + */ +#define USE_STDIO_BASE /**/ +#ifdef USE_STDIO_BASE +#define FILE_base(fp) ((fp)->_base) +#define FILE_bufsiz(fp) ((fp)->_cnt + (fp)->_ptr - (fp)->_base) +#endif + +/* HAS_STRERROR: + * This symbol, if defined, indicates that the strerror routine is + * available to translate error numbers to strings. See the writeup + * of Strerror() in this file before you try to define your own. + */ +/* HAS_SYS_ERRLIST: + * This symbol, if defined, indicates that the sys_errlist array is + * available to translate error numbers to strings. The extern int + * sys_nerr gives the size of that table. + */ +/* Strerror: + * This preprocessor symbol is defined as a macro if strerror() is + * not available to translate error numbers to strings but sys_errlist[] + * array is there. + */ +#define HAS_STRERROR /**/ +#define HAS_SYS_ERRLIST /**/ +#define Strerror(e) strerror(e) + +/* HAS_STRTOLD: + * This symbol, if defined, indicates that the strtold routine is + * available to convert strings to long doubles. + */ +/*#define HAS_STRTOLD /**/ + +/* HAS_STRTOLL: + * This symbol, if defined, indicates that the strtoll routine is + * available to convert strings to long longs. + */ +/*#define HAS_STRTOLL /**/ + +/* HAS_STRTOULL: + * This symbol, if defined, indicates that the strtoull routine is + * available to convert strings to unsigned long longs. + */ +/*#define HAS_STRTOULL /**/ + +/* HAS_STRTOUQ: + * This symbol, if defined, indicates that the strtouq routine is + * available to convert strings to unsigned long longs (quads). + */ +/*#define HAS_STRTOUQ /**/ + +/* HAS_TELLDIR_PROTO: + * This symbol, if defined, indicates that the system provides + * a prototype for the telldir() function. Otherwise, it is up + * to the program to supply one. A good guess is + * extern long telldir _((DIR*)); + */ +#define HAS_TELLDIR_PROTO /**/ + +/* Time_t: + * This symbol holds the type returned by time(). It can be long, + * or time_t on BSD sites (in which case <sys/types.h> should be + * included). + */ +#define Time_t time_t /* Time type */ + +/* HAS_TIMES: + * This symbol, if defined, indicates that the times() routine exists. + * Note that this became obsolete on some systems (SUNOS), which now + * use getrusage(). It may be necessary to include <sys/times.h>. + */ +#define HAS_TIMES /**/ /* HAS_UNION_SEMUN: * This symbol, if defined, indicates that the union semun is @@ -1657,6 +2123,17 @@ /*#define USE_SEMCTL_SEMUN /**/ /*#define USE_SEMCTL_SEMID_DS /**/ +/* HAS_USTAT: + * This symbol, if defined, indicates that the ustat system call is + * available to query file system statistics by dev_t. + */ +/*#define HAS_USTAT /**/ + +/* HAS_VFORK: + * This symbol, if defined, indicates that vfork() exists. + */ +/*#define HAS_VFORK /**/ + /* Signal_t: * This symbol's value is either "void" or "int", corresponding to the * appropriate return type of a signal handler. Thus, you can declare @@ -1665,25 +2142,175 @@ */ #define Signal_t void /* Signal handler's return type */ +/* HAS_VPRINTF: + * This symbol, if defined, indicates that the vprintf routine is available + * to printf with a pointer to an argument list. If unavailable, you + * may need to write your own, probably in terms of _doprnt(). + */ +/* USE_CHAR_VSPRINTF: + * This symbol is defined if this system has vsprintf() returning type + * (char*). The trend seems to be to declare it as "int vsprintf()". It + * is up to the package author to declare vsprintf correctly based on the + * symbol. + */ +#define HAS_VPRINTF /**/ +/*#define USE_CHAR_VSPRINTF /**/ + +/* USE_DYNAMIC_LOADING: + * This symbol, if defined, indicates that dynamic loading of + * some sort is available. + */ +#define USE_DYNAMIC_LOADING /**/ + +/* DOUBLESIZE: + * This symbol contains the size of a double, so that the C preprocessor + * can make decisions based on it. + */ +#define DOUBLESIZE 8 /**/ + +/* EBCDIC: + * This symbol, if defined, indicates that this system uses + * EBCDIC encoding. + */ +/*#define EBCDIC /**/ + +/* FFLUSH_NULL: + * This symbol, if defined, tells that fflush(NULL) does flush + * all pending stdio output. + */ +/* FFLUSH_ALL: + * This symbol, if defined, tells that to flush + * all pending stdio output one must loop through all + * the stdio file handles stored in an array and fflush them. + * Note that if fflushNULL is defined, fflushall will not + * even be probed for and will be left undefined. + */ +#define FFLUSH_NULL /**/ +/*#define FFLUSH_ALL /**/ + +/* Fpos_t: + * This symbol holds the type used to declare file positions in libc. + * It can be fpos_t, long, uint, etc... It may be necessary to include + * <sys/types.h> to get any typedef'ed information. + */ +#define Fpos_t fpos_t /* File position type */ + +/* Gid_t_f: + * This symbol defines the format string used for printing a Gid_t. + */ +#define Gid_t_f "ld" /**/ + +/* Gid_t_sign: + * This symbol holds the signedess of a Gid_t. + * 1 for unsigned, -1 for signed. + */ +#define Gid_t_sign -1 /* GID sign */ + +/* Gid_t_size: + * This symbol holds the size of a Gid_t in bytes. + */ +#define Gid_t_size 4 /* GID size */ + +/* Gid_t: + * This symbol holds the return type of getgid() and the type of + * argument to setrgid() and related functions. Typically, + * it is the type of group ids in the kernel. It can be int, ushort, + * gid_t, etc... It may be necessary to include <sys/types.h> to get + * any typedef'ed information. + */ +#define Gid_t gid_t /* Type for getgid(), etc... */ + /* Groups_t: * This symbol holds the type used for the second argument to - * getgroups() and setgropus(). Usually, this is the same as + * getgroups() and setgroups(). Usually, this is the same as * gidtype (gid_t) , but sometimes it isn't. - * It can be int, ushort, uid_t, etc... + * It can be int, ushort, gid_t, etc... * It may be necessary to include <sys/types.h> to get any * typedef'ed information. This is only required if you have - * getgroups() or setgropus().. + * getgroups() or setgroups().. */ #if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS) #define Groups_t gid_t /* Type for 2nd arg to [sg]etgroups() */ #endif +/* DB_Prefix_t: + * This symbol contains the type of the prefix structure element + * in the <db.h> header file. In older versions of DB, it was + * int, while in newer ones it is u_int32_t. + */ +/* DB_Hash_t: + * This symbol contains the type of the prefix structure element + * in the <db.h> header file. In older versions of DB, it was + * int, while in newer ones it is size_t. + */ +#define DB_Hash_t int /**/ +#define DB_Prefix_t int /**/ + +/* I_GRP: + * This symbol, if defined, indicates to the C program that it should + * include <grp.h>. + */ +/* GRPASSWD: + * This symbol, if defined, indicates to the C program that struct group + * in <grp.h> contains gr_passwd. + */ +/*#define I_GRP /**/ +/*#define GRPASSWD /**/ + +/* I_ICONV: + * This symbol, if defined, indicates that <iconv.h> exists and + * should be included. + */ +/*#define I_ICONV /**/ + +/* I_IEEEFP: + * This symbol, if defined, indicates that <ieeefp.h> exists and + * should be included. + */ +/*#define I_IEEEFP /**/ + +/* I_INTTYPES: + * This symbol, if defined, indicates to the C program that it should + * include <inttypes.h>. + */ +/*#define I_INTTYPES /**/ + +/* I_MACH_CTHREADS: + * This symbol, if defined, indicates to the C program that it should + * include <mach/cthreads.h>. + */ +/*#define I_MACH_CTHREADS /**/ + +/* I_MNTENT: + * This symbol, if defined, indicates that <mntent.h> exists and + * should be included. + */ +/*#define I_MNTENT /**/ + /* I_NETDB: * This symbol, if defined, indicates that <netdb.h> exists and * should be included. */ /*#define I_NETDB /**/ +/* I_NETINET_TCP: + * This symbol, if defined, indicates to the C program that it should + * include <netinet/tcp.h>. + */ +/*#define I_NETINET_TCP /**/ + +/* I_POLL: + * This symbol, if defined, indicates that <poll.h> exists and + * should be included. + */ +/*#define I_POLL /**/ + +/* I_PTHREAD: + * This symbol, if defined, indicates to the C program that it should + * include <pthread.h>. + */ +/*#define I_PTHREAD /**/ + /* I_PWD: * This symbol, if defined, indicates to the C program that it should * include <pwd.h>. @@ -1720,18 +2347,6 @@ * This symbol, if defined, indicates to the C program that struct passwd * contains pw_passwd. */ -/* HAS_SETPWENT: - * This symbol, if defined, indicates that the getpwrent routine is - * available for initializing sequential access of the passwd database. - */ -/* HAS_GETPWENT: - * This symbol, if defined, indicates that the getpwent routine is - * available for sequential access of the password database. - */ -/* HAS_ENDPWENT: - * This symbol, if defined, indicates that the getpwent routine is - * available for finalizing sequential access of the passwd database. - */ /*#define I_PWD /**/ /*#define PWQUOTA /**/ /*#define PWAGE /**/ @@ -1741,9 +2356,134 @@ /*#define PWCOMMENT /**/ /*#define PWGECOS /**/ /*#define PWPASSWD /**/ -/*#define HAS_SETPWENT /**/ -/*#define HAS_GETPWENT /**/ -/*#define HAS_ENDPWENT /**/ + +/* I_SHADOW: + * This symbol, if defined, indicates that <shadow.h> exists and + * should be included. + */ +/*#define I_SHADOW /**/ + +/* I_SOCKS: + * This symbol, if defined, indicates that <socks.h> exists and + * should be included. + */ +/*#define I_SOCKS /**/ + +/* I_SUNMATH: + * This symbol, if defined, indicates that <sunmath.h> exists and + * should be included. + */ +/*#define I_SUNMATH /**/ + +/* I_SYSLOG: + * This symbol, if defined, indicates that <syslog.h> exists and + * should be included. + */ +/*#define I_SYSLOG /**/ + +/* I_SYSMODE: + * This symbol, if defined, indicates that <sys/mode.h> exists and + * should be included. + */ +/*#define I_SYSMODE /**/ + +/* I_SYS_MOUNT: + * This symbol, if defined, indicates that <sys/mount.h> exists and + * should be included. + */ +/*#define I_SYS_MOUNT /**/ + +/* I_SYS_STATFS: + * This symbol, if defined, indicates that <sys/statfs.h> exists. + */ +/*#define I_SYS_STATFS /**/ + +/* I_SYS_STATVFS: + * This symbol, if defined, indicates that <sys/statvfs.h> exists and + * should be included. + */ +/*#define I_SYS_STATVFS /**/ + +/* I_SYSUIO: + * This symbol, if defined, indicates that <sys/uio.h> exists and + * should be included. + */ +/*#define I_SYSUIO /**/ + +/* I_SYSUTSNAME: + * This symbol, if defined, indicates that <sys/utsname.h> exists and + * should be included. + */ +/*#define I_SYSUTSNAME /**/ + +/* I_SYS_VFS: + * This symbol, if defined, indicates that <sys/vfs.h> exists and + * should be included. + */ +/*#define I_SYS_VFS /**/ + +/* I_TIME: + * This symbol, if defined, indicates to the C program that it should + * include <time.h>. + */ +/* I_SYS_TIME: + * This symbol, if defined, indicates to the C program that it should + * include <sys/time.h>. + */ +/* I_SYS_TIME_KERNEL: + * This symbol, if defined, indicates to the C program that it should + * include <sys/time.h> with KERNEL defined. + */ +#define I_TIME /**/ +/*#define I_SYS_TIME /**/ +/*#define I_SYS_TIME_KERNEL /**/ + +/* I_USTAT: + * This symbol, if defined, indicates that <ustat.h> exists and + * should be included. + */ +/*#define I_USTAT /**/ + +/* PERL_INC_VERSION_LIST: + * This variable specifies the list of subdirectories in over + * which perl.c:incpush() and lib/lib.pm will automatically + * search when adding directories to @INC, in a format suitable + * for a C initialization string. See the inc_version_list entry + * in Porting/Glossary for more details. + */ +#define PERL_INC_VERSION_LIST 0 /**/ + +/* INSTALL_USR_BIN_PERL: + * This symbol, if defined, indicates that Perl is to be installed + * also as /usr/bin/perl. + */ +/*#define INSTALL_USR_BIN_PERL /**/ + +/* PERL_PRIfldbl: + * This symbol, if defined, contains the string used by stdio to + * format long doubles (format 'f') for output. + */ +/* PERL_PRIgldbl: + * This symbol, if defined, contains the string used by stdio to + * format long doubles (format 'g') for output. + */ +/*#define PERL_PRIfldbl "f" /**/ +/*#define PERL_PRIgldbl "g" /**/ + +/* Off_t: + * This symbol holds the type used to declare offsets in the kernel. + * It can be int, long, off_t, etc... It may be necessary to include + * <sys/types.h> to get any typedef'ed information. + */ +/* LSEEKSIZE: + * This symbol holds the number of bytes used by the Off_t. + */ +/* Off_t_size: + * This symbol holds the number of bytes used by the Off_t. + */ +#define Off_t off_t /* <offset> type */ +#define LSEEKSIZE 4 /* <offset> size */ +#define Off_t_size 4 /* <offset> size */ /* Free_t: * This variable contains the return type of free(). It is usually @@ -1760,6 +2500,247 @@ */ /*#define MYMALLOC /**/ +/* Mode_t: + * This symbol holds the type used to declare file modes + * for systems calls. It is usually mode_t, but may be + * int or unsigned short. It may be necessary to include <sys/types.h> + * to get any typedef'ed information. + */ +#define Mode_t mode_t /* file mode parameter for system calls */ + +/* VAL_O_NONBLOCK: + * This symbol is to be used during open() or fcntl(F_SETFL) to turn on + * non-blocking I/O for the file descriptor. Note that there is no way + * back, i.e. you cannot turn it blocking again this way. If you wish to + * alternatively switch between blocking and non-blocking, use the + * ioctl(FIOSNBIO) call instead, but that is not supported by all devices. + */ +/* VAL_EAGAIN: + * This symbol holds the errno error code set by read() when no data was + * present on the non-blocking file descriptor. + */ +/* RD_NODATA: + * This symbol holds the return code from read() when no data is present + * on the non-blocking file descriptor. Be careful! If EOF_NONBLOCK is + * not defined, then you can't distinguish between no data and EOF by + * issuing a read(). You'll have to find another way to tell for sure! + */ +/* EOF_NONBLOCK: + * This symbol, if defined, indicates to the C program that a read() on + * a non-blocking file descriptor will return 0 on EOF, and not the value + * held in RD_NODATA (-1 usually, in that case!). + */ +#define VAL_O_NONBLOCK O_NONBLOCK +#define VAL_EAGAIN EAGAIN +#define RD_NODATA -1 +#define EOF_NONBLOCK + +/* Netdb_host_t: + * This symbol holds the type used for the 1st argument + * to gethostbyaddr(). + */ +/* Netdb_hlen_t: + * This symbol holds the type used for the 2nd argument + * to gethostbyaddr(). + */ +/* Netdb_name_t: + * This symbol holds the type used for the argument to + * gethostbyname(). + */ +/* Netdb_net_t: + * This symbol holds the type used for the 1st argument to + * getnetbyaddr(). + */ +#define Netdb_host_t char * /**/ +#define Netdb_hlen_t int /**/ +#define Netdb_name_t char * /**/ +#define Netdb_net_t long /**/ + +/* IVTYPE: + * This symbol defines the C type used for Perl's IV. + */ +/* UVTYPE: + * This symbol defines the C type used for Perl's UV. + */ +/* I8TYPE: + * This symbol defines the C type used for Perl's I8. + */ +/* U8TYPE: + * This symbol defines the C type used for Perl's U8. + */ +/* I16TYPE: + * This symbol defines the C type used for Perl's I16. + */ +/* U16TYPE: + * This symbol defines the C type used for Perl's U16. + */ +/* I32TYPE: + * This symbol defines the C type used for Perl's I32. + */ +/* U32TYPE: + * This symbol defines the C type used for Perl's U32. + */ +/* I64TYPE: + * This symbol defines the C type used for Perl's I64. + */ +/* U64TYPE: + * This symbol defines the C type used for Perl's U64. + */ +/* NVTYPE: + * This symbol defines the C type used for Perl's NV. + */ +/* IVSIZE: + * This symbol contains the sizeof(IV). + */ +/* UVSIZE: + * This symbol contains the sizeof(UV). + */ +/* I8SIZE: + * This symbol contains the sizeof(I8). + */ +/* U8SIZE: + * This symbol contains the sizeof(U8). + */ +/* I16SIZE: + * This symbol contains the sizeof(I16). + */ +/* U16SIZE: + * This symbol contains the sizeof(U16). + */ +/* I32SIZE: + * This symbol contains the sizeof(I32). + */ +/* U32SIZE: + * This symbol contains the sizeof(U32). + */ +/* I64SIZE: + * This symbol contains the sizeof(I64). + */ +/* U64SIZE: + * This symbol contains the sizeof(U64). + */ +/* NV_PRESERVES_UV: + * This symbol, if defined, indicates that a variable of type NVTYPE + * can preserve all the bit of a variable of type UVSIZE. + */ +#define IVTYPE long /**/ +#define UVTYPE unsigned long /**/ +#define I8TYPE char /**/ +#define U8TYPE unsigned char /**/ +#define I16TYPE short /**/ +#define U16TYPE unsigned short /**/ +#define I32TYPE long /**/ +#define U32TYPE unsigned long /**/ +#ifdef HAS_QUAD +#define I64TYPE long long /**/ +#define U64TYPE unsigned long long /**/ +#endif +#define NVTYPE double /**/ +#define IVSIZE 4 /**/ +#define UVSIZE 4 /**/ +#define I8SIZE 1 /**/ +#define U8SIZE 1 /**/ +#define I16SIZE 2 /**/ +#define U16SIZE 2 /**/ +#define I32SIZE 4 /**/ +#define U32SIZE 4 /**/ +#ifdef HAS_QUAD +#define I64SIZE 8 /**/ +#define U64SIZE 8 /**/ +#endif +#define NV_PRESERVES_UV + +/* IVdf: + * This symbol defines the format string used for printing a Perl IV + * as a signed decimal integer. + */ +/* UVuf: + * This symbol defines the format string used for printing a Perl UV + * as an unsigned decimal integer. + */ +/* UVof: + * This symbol defines the format string used for printing a Perl UV + * as an unsigned octal integer. + */ +/* UVxf: + * This symbol defines the format string used for printing a Perl UV + * as an unsigned hexadecimal integer. + */ +#define IVdf "ld" /**/ +#define UVuf "lu" /**/ +#define UVof "lo" /**/ +#define UVxf "lx" /**/ + +/* Pid_t: + * This symbol holds the type used to declare process ids in the kernel. + * It can be int, uint, pid_t, etc... It may be necessary to include + * <sys/types.h> to get any typedef'ed information. + */ +#define Pid_t int /* PID type */ + +/* PRIVLIB: + * This symbol contains the name of the private library for this package. + * The library is private in the sense that it needn't be in anyone's + * execution path, but it should be accessible by the world. The program + * should be prepared to do ~ expansion. + */ +/* PRIVLIB_EXP: + * This symbol contains the ~name expanded version of PRIVLIB, to be used + * in programs that are not prepared to deal with ~ expansion at run-time. + */ +#define PRIVLIB "c:\\perl\\5.6.0\\lib" /**/ +#define PRIVLIB_EXP (win32_get_privlib("5.6.0")) /**/ + +/* PTRSIZE: + * This symbol contains the size of a pointer, so that the C preprocessor + * can make decisions based on it. It will be sizeof(void *) if + * the compiler supports (void *); otherwise it will be + * sizeof(char *). + */ +#define PTRSIZE 4 /**/ + +/* Drand01: + * This macro is to be used to generate uniformly distributed + * random numbers over the range [0., 1.[. You may have to supply + * an 'extern double drand48();' in your program since SunOS 4.1.3 + * doesn't provide you with anything relevant in it's headers. + * See HAS_DRAND48_PROTO. + */ +/* Rand_seed_t: + * This symbol defines the type of the argument of the + * random seed function. + */ +/* seedDrand01: + * This symbol defines the macro to be used in seeding the + * random number generator (see Drand01). + */ +/* RANDBITS: + * This symbol indicates how many bits are produced by the + * function used to generate normalized random numbers. + * Values include 15, 16, 31, and 48. + */ +#define Drand01() (rand()/(double)((unsigned)1<<RANDBITS)) /**/ +#define Rand_seed_t unsigned /**/ +#define seedDrand01(x) srand((Rand_seed_t)x) /**/ +#define RANDBITS 15 /**/ + +/* SELECT_MIN_BITS: + * This symbol holds the minimum number of bits operated by select. + * That is, if you do select(n, ...), how many bits at least will be + * cleared in the masks if some activity is detected. Usually this + * is either n or 32*ceil(n/32), especially many little-endians do + * the latter. This is only useful if you have select(), naturally. + */ +#define SELECT_MIN_BITS 32 /**/ + +/* Select_fd_set_t: + * This symbol holds the type used for the 2nd, 3rd, and 4th + * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET + * is defined, and 'int *' otherwise. This is only useful if you + * have select(), of course. + */ +#define Select_fd_set_t Perl_fd_set * /**/ + /* SIG_NAME: * This symbol contains a list of signal names in order of * signal number. This is intended @@ -1788,95 +2769,8 @@ * The last element is 0, corresponding to the 0 at the end of * the sig_name list. */ -#define SIG_NAME "ZERO", "INT", "QUIT", "ILL", "FPE", "KILL", "SEGV", "PIPE", "ALRM", "TERM", "CHLD", "BREAK", "ABRT", "STOP", "CONT", "CLD", 0 /**/ -#define SIG_NUM 0, 2, 3, 4, 8, 9, 11, 13, 14, 15, 20, 21, 22, 23, 25, 20, 0 /**/ - -/* VOIDFLAGS: - * This symbol indicates how much support of the void type is given by this - * compiler. What various bits mean: - * - * 1 = supports declaration of void - * 2 = supports arrays of pointers to functions returning void - * 4 = supports comparisons between pointers to void functions and - * addresses of void functions - * 8 = suports declaration of generic void pointers - * - * The package designer should define VOIDUSED to indicate the requirements - * of the package. This can be done either by #defining VOIDUSED before - * including config.h, or by defining defvoidused in Myinit.U. If the - * latter approach is taken, only those flags will be tested. If the - * level of void support necessary is not present, defines void to int. - */ -#ifndef VOIDUSED -#define VOIDUSED 15 -#endif -#define VOIDFLAGS 15 -#if (VOIDFLAGS & VOIDUSED) != VOIDUSED -#define void int /* is void to be avoided? */ -#define M_VOID /* Xenix strikes again */ -#endif - -/* ARCHLIB: - * This variable, if defined, holds the name of the directory in - * which the user wants to put architecture-dependent public - * library files for perl5. It is most often a local directory - * such as /usr/local/lib. Programs using this variable must be - * prepared to deal with filename expansion. If ARCHLIB is the - * same as PRIVLIB, it is not defined, since presumably the - * program already searches PRIVLIB. - */ -/* ARCHLIB_EXP: - * This symbol contains the ~name expanded version of ARCHLIB, to be used - * in programs that are not prepared to deal with ~ expansion at run-time. - */ -#define ARCHLIB "c:\\perl\\5.00503\\lib\\MSWin32-x86" /**/ -/*#define ARCHLIB_EXP "" /**/ - -/* DLSYM_NEEDS_UNDERSCORE: - * This symbol, if defined, indicates that we need to prepend an - * underscore to the symbol name before calling dlsym(). This only - * makes sense if you *have* dlsym, which we will presume is the - * case if you're using dl_dlopen.xs. - */ -/*#define DLSYM_NEEDS_UNDERSCORE /**/ - -/* USE_SFIO: - * This symbol, if defined, indicates that sfio should - * be used. - */ -/*#define USE_SFIO /**/ - -/* USE_DYNAMIC_LOADING: - * This symbol, if defined, indicates that dynamic loading of - * some sort is available. - */ -#define USE_DYNAMIC_LOADING /**/ - -/* DB_Prefix_t: - * This symbol contains the type of the prefix structure element - * in the <db.h> header file. In older versions of DB, it was - * int, while in newer ones it is u_int32_t. - */ -/* DB_Hash_t: - * This symbol contains the type of the prefix structure element - * in the <db.h> header file. In older versions of DB, it was - * int, while in newer ones it is size_t. - */ -#define DB_Hash_t int /**/ -#define DB_Prefix_t int /**/ - -/* PRIVLIB: - * This symbol contains the name of the private library for this package. - * The library is private in the sense that it needn't be in anyone's - * execution path, but it should be accessible by the world. The program - * should be prepared to do ~ expansion. - */ -/* PRIVLIB_EXP: - * This symbol contains the ~name expanded version of PRIVLIB, to be used - * in programs that are not prepared to deal with ~ expansion at run-time. - */ -#define PRIVLIB "c:\\perl\\5.00503\\lib" /**/ -#define PRIVLIB_EXP (win32_get_privlib("5.00503")) /**/ +#define SIG_NAME "ZERO", "NUM01", "INT", "QUIT", "ILL", "NUM05", "NUM06", "NUM07", "FPE", "KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM", "TERM", "NUM16", "NUM17", "NUM18", "NUM19", "CHLD", "BREAK", "ABRT", "STOP", "NUM24", "CONT", "CLD", 0 /**/ +#define SIG_NUM 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 20, 0 /**/ /* SITEARCH: * This symbol contains the name of the private library for this package. @@ -1884,14 +2778,16 @@ * execution path, but it should be accessible by the world. The program * should be prepared to do ~ expansion. * The standard distribution will put nothing in this directory. - * Individual sites may place their own extensions and modules in - * this directory. + * After perl has been installed, users may install their own local + * architecture-dependent modules in this directory with + * MakeMaker Makefile.PL + * or equivalent. See INSTALL for details. */ /* SITEARCH_EXP: * This symbol contains the ~name expanded version of SITEARCH, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITEARCH "c:\\perl\\site\\5.00503\\lib\\MSWin32-x86" /**/ +#define SITEARCH "c:\\perl\\site\\5.6.0\\lib\\MSWin32-x86" /**/ /*#define SITEARCH_EXP "" /**/ /* SITELIB: @@ -1900,15 +2796,52 @@ * execution path, but it should be accessible by the world. The program * should be prepared to do ~ expansion. * The standard distribution will put nothing in this directory. - * Individual sites may place their own extensions and modules in - * this directory. + * After perl has been installed, users may install their own local + * architecture-independent modules in this directory with + * MakeMaker Makefile.PL + * or equivalent. See INSTALL for details. */ /* SITELIB_EXP: * This symbol contains the ~name expanded version of SITELIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITELIB "c:\\perl\\site\\5.00503\\lib" /**/ -#define SITELIB_EXP (win32_get_sitelib("5.00503")) /**/ +/* SITELIB_STEM: + * This define is SITELIB_EXP with any trailing version-specific component + * removed. The elements in inc_version_list (inc_version_list.U) can + * be tacked onto this variable to generate a list of directories to search. + */ +#define SITELIB "c:\\perl\\site\\5.6.0\\lib" /**/ +#define SITELIB_EXP (win32_get_sitelib("5.6.0")) /**/ +#define SITELIB_STEM "" /**/ + +/* Size_t_size: + * This symbol holds the size of a Size_t in bytes. + */ +#define Size_t_size 4 /**/ + +/* Size_t: + * This symbol holds the type used to declare length parameters + * for string functions. It is usually size_t, but may be + * unsigned long, int, etc. It may be necessary to include + * <sys/types.h> to get any typedef'ed information. + */ +#define Size_t size_t /* length paramater for string functions */ + +/* Sock_size_t: + * This symbol holds the type used for the size argument of + * various socket calls (just the base type, not the pointer-to). + */ +#define Sock_size_t int /**/ + +/* SSize_t: + * This symbol holds the type used by functions that return + * a count of bytes or an error condition. It must be a signed type. + * It is usually ssize_t, but may be long or int, etc. + * It may be necessary to include <sys/types.h> or <unistd.h> + * to get any typedef'ed information. + * We will pick a type such that sizeof(SSize_t) == sizeof(Size_t). + */ +#define SSize_t int /* signed count of bytes */ /* STARTPERL: * This variable contains the string to put in front of a perl @@ -1917,178 +2850,235 @@ */ #define STARTPERL "#!perl" /**/ -/* USE_PERLIO: - * This symbol, if defined, indicates that the PerlIO abstraction should - * be used throughout. If not defined, stdio should be - * used in a fully backward compatible manner. +/* HAS_STDIO_STREAM_ARRAY: + * This symbol, if defined, tells that there is an array + * holding the stdio streams. */ -/*#define USE_PERLIO /**/ - -/* HAS_GETHOST_PROTOS: - * This symbol, if defined, indicates that <netdb.h> includes - * prototypes for gethostent(), gethostbyname(), and - * gethostbyaddr(). Otherwise, it is up to the program to guess - * them. See netdbtype.U for probing for various Netdb_xxx_t types. +/* STDIO_STREAM_ARRAY: + * This symbol tells the name of the array holding the stdio streams. + * Usual values include _iob, __iob, and __sF. */ -#define HAS_GETHOST_PROTOS /**/ +/*#define HAS_STDIO_STREAM_ARRAY /**/ +#define STDIO_STREAM_ARRAY -/* HAS_GETNET_PROTOS: - * This symbol, if defined, indicates that <netdb.h> includes - * prototypes for getnetent(), getnetbyname(), and - * getnetbyaddr(). Otherwise, it is up to the program to guess - * them. See netdbtype.U for probing for various Netdb_xxx_t types. +/* Uid_t_f: + * This symbol defines the format string used for printing a Uid_t. */ -/*#define HAS_GETNET_PROTOS /**/ +#define Uid_t_f "ld" /**/ -/* HAS_GETPROTO_PROTOS: - * This symbol, if defined, indicates that <netdb.h> includes - * prototypes for getprotoent(), getprotobyname(), and - * getprotobyaddr(). Otherwise, it is up to the program to guess - * them. See netdbtype.U for probing for various Netdb_xxx_t types. +/* Uid_t_sign: + * This symbol holds the signedess of a Uid_t. + * 1 for unsigned, -1 for signed. */ -#define HAS_GETPROTO_PROTOS /**/ +#define Uid_t_sign -1 /* UID sign */ -/* HAS_GETSERV_PROTOS: - * This symbol, if defined, indicates that <netdb.h> includes - * prototypes for getservent(), getservbyname(), and - * getservbyaddr(). Otherwise, it is up to the program to guess - * them. See netdbtype.U for probing for various Netdb_xxx_t types. +/* Uid_t_size: + * This symbol holds the size of a Uid_t in bytes. */ -#define HAS_GETSERV_PROTOS /**/ +#define Uid_t_size 4 /* UID size */ -/* Netdb_host_t: - * This symbol holds the type used for the 1st argument - * to gethostbyaddr(). - */ -/* Netdb_hlen_t: - * This symbol holds the type used for the 2nd argument - * to gethostbyaddr(). - */ -/* Netdb_name_t: - * This symbol holds the type used for the argument to - * gethostbyname(). - */ -/* Netdb_net_t: - * This symbol holds the type used for the 1st argument to - * getnetbyaddr(). +/* Uid_t: + * This symbol holds the type used to declare user ids in the kernel. + * It can be int, ushort, uid_t, etc... It may be necessary to include + * <sys/types.h> to get any typedef'ed information. */ -#define Netdb_host_t char * /**/ -#define Netdb_hlen_t int /**/ -#define Netdb_name_t char * /**/ -#define Netdb_net_t long /**/ +#define Uid_t uid_t /* UID type */ -/* Select_fd_set_t: - * This symbol holds the type used for the 2nd, 3rd, and 4th - * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET - * is defined, and 'int *' otherwise. This is only useful if you - * have select(), of course. +/* USE_64_BIT_INT: + * This symbol, if defined, indicates that 64-bit integers should + * be used when available. If not defined, the native integers + * will be employed (be they 32 or 64 bits). The minimal possible + * 64-bitness is used, just enough to get 64-bit integers into Perl. + * This may mean using for example "long longs", while your memory + * may still be limited to 2 gigabytes. + */ +/* USE_64_BIT_ALL: + * This symbol, if defined, indicates that 64-bit integers should + * be used when available. If not defined, the native integers + * will be used (be they 32 or 64 bits). The maximal possible + * 64-bitness is employed: LP64 or ILP64, meaning that you will + * be able to use more than 2 gigabytes of memory. This mode is + * even more binary incompatible than USE_64_BIT_INT. You may not + * be able to run the resulting executable in a 32-bit CPU at all or + * you may need at least to reboot your OS to 64-bit mode. + */ +#ifndef USE_64_BIT_INT +/*#define USE_64_BIT_INT /**/ +#endif + +#ifndef USE_64_BIT_ALL +/*#define USE_64_BIT_ALL /**/ +#endif + +/* USE_LARGE_FILES: + * This symbol, if defined, indicates that large file support + * should be used when available. */ -#define Select_fd_set_t Perl_fd_set * /**/ +#ifndef USE_LARGE_FILES +/*#define USE_LARGE_FILES /**/ +#endif -/* ARCHNAME: - * This symbol holds a string representing the architecture name. - * It may be used to construct an architecture-dependant pathname - * where library files may be held under a private library, for - * instance. +/* USE_LONG_DOUBLE: + * This symbol, if defined, indicates that long doubles should + * be used when available. */ -#define ARCHNAME "MSWin32-x86" /**/ +#ifndef USE_LONG_DOUBLE +/*#define USE_LONG_DOUBLE /**/ +#endif -/* HAS_PTHREAD_YIELD: - * This symbol, if defined, indicates that the pthread_yield - * routine is available to yield the execution of the current - * thread. +/* USE_MORE_BITS: + * This symbol, if defined, indicates that 64-bit interfaces and + * long doubles should be used when available. */ -/* HAS_SCHED_YIELD: - * This symbol, if defined, indicates that the sched_yield - * routine is available to yield the execution of the current - * thread. +#ifndef USE_MORE_BITS +/*#define USE_MORE_BITS /**/ +#endif + +/* MULTIPLICITY: + * This symbol, if defined, indicates that Perl should + * be built to use multiplicity. */ -/*#define HAS_PTHREAD_YIELD /**/ -/*#define HAS_SCHED_YIELD /**/ +#ifndef MULTIPLICITY +/*#define MULTIPLICITY /**/ +#endif -/* PTHREADS_CREATED_JOINABLE: - * This symbol, if defined, indicates that pthreads are created - * in the joinable (aka undetached) state. +/* USE_PERLIO: + * This symbol, if defined, indicates that the PerlIO abstraction should + * be used throughout. If not defined, stdio should be + * used in a fully backward compatible manner. */ -/*#define PTHREADS_CREATED_JOINABLE /**/ +#ifndef USE_PERLIO +/*#define USE_PERLIO /**/ +#endif -/* USE_THREADS: +/* USE_SOCKS: * This symbol, if defined, indicates that Perl should - * be built to use threads. + * be built to use socks. + */ +#ifndef USE_SOCKS +/*#define USE_SOCKS /**/ +#endif + +/* USE_ITHREADS: + * This symbol, if defined, indicates that Perl should be built to + * use the interpreter-based threading implementation. + */ +/* USE_5005THREADS: + * This symbol, if defined, indicates that Perl should be built to + * use the 5.005-based threading implementation. */ /* OLD_PTHREADS_API: * This symbol, if defined, indicates that Perl should * be built to use the old draft POSIX threads API. */ -/*#define USE_THREADS /**/ +/*#define USE_5005THREADS /**/ +/*#define USE_ITHREADS /**/ +#if defined(USE_5005THREADS) && !defined(USE_ITHREADS) +#define USE_THREADS /* until src is revised*/ +#endif /*#define OLD_PTHREADS_API /**/ -/* Time_t: - * This symbol holds the type returned by time(). It can be long, - * or time_t on BSD sites (in which case <sys/types.h> should be - * included). +/* PERL_VENDORARCH: + * If defined, this symbol contains the name of a private library. + * The library is private in the sense that it needn't be in anyone's + * execution path, but it should be accessible by the world. + * It may have a ~ on the front. + * The standard distribution will put nothing in this directory. + * Vendors who distribute perl may wish to place their own + * architecture-dependent modules and extensions in this directory with + * MakeMaker Makefile.PL INSTALLDIRS=vendor + * or equivalent. See INSTALL for details. */ -#define Time_t time_t /* Time type */ - -/* HAS_TIMES: - * This symbol, if defined, indicates that the times() routine exists. - * Note that this became obsolete on some systems (SUNOS), which now - * use getrusage(). It may be necessary to include <sys/times.h>. +/* PERL_VENDORARCH_EXP: + * This symbol contains the ~name expanded version of PERL_VENDORARCH, to be used + * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define HAS_TIMES /**/ +/*#define PERL_VENDORARCH "" /**/ +/*#define PERL_VENDORARCH_EXP "" /**/ -/* Fpos_t: - * This symbol holds the type used to declare file positions in libc. - * It can be fpos_t, long, uint, etc... It may be necessary to include - * <sys/types.h> to get any typedef'ed information. - */ -#define Fpos_t fpos_t /* File position type */ - -/* Gid_t: - * This symbol holds the return type of getgid() and the type of - * argument to setrgid() and related functions. Typically, - * it is the type of group ids in the kernel. It can be int, ushort, - * uid_t, etc... It may be necessary to include <sys/types.h> to get - * any typedef'ed information. +/* PERL_VENDORLIB_EXP: + * This symbol contains the ~name expanded version of VENDORLIB, to be used + * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define Gid_t gid_t /* Type for getgid(), etc... */ - -/* Off_t: - * This symbol holds the type used to declare offsets in the kernel. - * It can be int, long, off_t, etc... It may be necessary to include - * <sys/types.h> to get any typedef'ed information. +/* PERL_VENDORLIB_STEM: + * This define is PERL_VENDORLIB_EXP with any trailing version-specific component + * removed. The elements in inc_version_list (inc_version_list.U) can + * be tacked onto this variable to generate a list of directories to search. */ -#define Off_t off_t /* <offset> type */ +/*#define PERL_VENDORLIB_EXP "" /**/ +/*#define PERL_VENDORLIB_STEM "" /**/ -/* Mode_t: - * This symbol holds the type used to declare file modes - * for systems calls. It is usually mode_t, but may be - * int or unsigned short. It may be necessary to include <sys/types.h> - * to get any typedef'ed information. +/* VOIDFLAGS: + * This symbol indicates how much support of the void type is given by this + * compiler. What various bits mean: + * + * 1 = supports declaration of void + * 2 = supports arrays of pointers to functions returning void + * 4 = supports comparisons between pointers to void functions and + * addresses of void functions + * 8 = suports declaration of generic void pointers + * + * The package designer should define VOIDUSED to indicate the requirements + * of the package. This can be done either by #defining VOIDUSED before + * including config.h, or by defining defvoidused in Myinit.U. If the + * latter approach is taken, only those flags will be tested. If the + * level of void support necessary is not present, defines void to int. */ -#define Mode_t mode_t /* file mode parameter for system calls */ +#ifndef VOIDUSED +#define VOIDUSED 15 +#endif +#define VOIDFLAGS 15 +#if (VOIDFLAGS & VOIDUSED) != VOIDUSED +#define void int /* is void to be avoided? */ +#define M_VOID /* Xenix strikes again */ +#endif -/* Pid_t: - * This symbol holds the type used to declare process ids in the kernel. - * It can be int, uint, pid_t, etc... It may be necessary to include - * <sys/types.h> to get any typedef'ed information. - */ -#define Pid_t int /* PID type */ +/* PERL_XS_APIVERSION: + * This variable contains the version of the oldest perl binary + * compatible with the present perl. perl.c:incpush() and + * lib/lib.pm will automatically search in c:\\perl\\site\\5.6.0\\lib\\MSWin32-x86 for older + * directories across major versions back to xs_apiversion. + * This is only useful if you have a perl library directory tree + * structured like the default one. + * See INSTALL for how this works. + * The versioned site_perl directory was introduced in 5.005, + * so that is the lowest possible value. + * Since this can depend on compile time options (such as + * bincompat) it is set by Configure. Other non-default sources + * of potential incompatibility, such as multiplicity, threads, + * debugging, 64bits, sfio, etc., are not checked for currently, + * though in principle we could go snooping around in old + * Config.pm files. + */ +/* PERL_PM_APIVERSION: + * This variable contains the version of the oldest perl + * compatible with the present perl. (That is, pure perl modules + * written for pm_apiversion will still work for the current + * version). perl.c:incpush() and lib/lib.pm will automatically + * search in c:\\perl\\site\\5.6.0\\lib for older directories across major versions + * back to pm_apiversion. This is only useful if you have a perl + * library directory tree structured like the default one. The + * versioned site_perl library was introduced in 5.005, so that's + * the default setting for this variable. It's hard to imagine + * it changing before Perl6. It is included here for symmetry + * with xs_apiveprsion -- the searching algorithms will + * (presumably) be similar. + * See the INSTALL file for how this works. + */ +#define PERL_XS_APIVERSION "5.6.0" +#define PERL_PM_APIVERSION "5.005" -/* Size_t: - * This symbol holds the type used to declare length parameters - * for string functions. It is usually size_t, but may be - * unsigned long, int, etc. It may be necessary to include - * <sys/types.h> to get any typedef'ed information. +/* HAS_LCHOWN: + * This symbol, if defined, indicates that the lchown routine is + * available to operate on a symbolic link (instead of following the + * link). */ -#define Size_t size_t /* length paramater for string functions */ +/*#define HAS_LCHOWN /**/ -/* Uid_t: - * This symbol holds the type used to declare user ids in the kernel. - * It can be int, ushort, uid_t, etc... It may be necessary to include - * <sys/types.h> to get any typedef'ed information. +/* FLEXFILENAMES: + * This symbol, if defined, indicates that the system supports filenames + * longer than 14 characters. */ -#define Uid_t uid_t /* UID type */ +#define FLEXFILENAMES /**/ #endif -#include <win32.h> diff --git a/gnu/usr.bin/perl/win32/config_H.vc b/gnu/usr.bin/perl/win32/config_H.vc index d239d246ba6..5d77c7b0329 100644 --- a/gnu/usr.bin/perl/win32/config_H.vc +++ b/gnu/usr.bin/perl/win32/config_H.vc @@ -13,7 +13,7 @@ /* * Package name : perl5 * Source directory : - * Configuration time: undef + * Configuration time: Tue Mar 21 01:26:24 2000 * Configured by : gsar * Target system : */ @@ -26,32 +26,6 @@ */ #define LOC_SED "" /**/ -/* BIN: - * This symbol holds the path of the bin directory where the package will - * be installed. Program must be prepared to deal with ~name substitution. - */ -/* BIN_EXP: - * This symbol is the filename expanded version of the BIN symbol, for - * programs that do not want to deal with that at run-time. - */ -#define BIN "c:\\perl\\5.00503\\bin\\MSWin32-x86" /**/ -#define BIN_EXP "c:\\perl\\5.00503\\bin\\MSWin32-x86" /**/ - -/* CPPSTDIN: - * This symbol contains the first part of the string which will invoke - * the C preprocessor on the standard input and produce to standard - * output. Typical value of "cc -E" or "/lib/cpp", but it can also - * call a wrapper. See CPPRUN. - */ -/* CPPMINUS: - * This symbol contains the second part of the string which will invoke - * the C preprocessor on the standard input and produce to standard - * output. This symbol will have the value "-" if CPPSTDIN needs a minus - * to specify standard input, otherwise the value is "". - */ -#define CPPSTDIN "cl -nologo -E" -#define CPPMINUS "" - /* HAS_ALARM: * This symbol, if defined, indicates that the alarm routine is * available. @@ -197,12 +171,6 @@ */ #define HAS_FGETPOS /**/ -/* FLEXFILENAMES: - * This symbol, if defined, indicates that the system supports filenames - * longer than 14 characters. - */ -#define FLEXFILENAMES /**/ - /* HAS_FLOCK: * This symbol, if defined, indicates that the flock routine is * available to do file locking. @@ -239,13 +207,6 @@ */ /*#define HAS_GETGROUPS /**/ -/* HAS_UNAME: - * This symbol, if defined, indicates that the C program may use the - * uname() routine to derive the host name. See also HAS_GETHOSTNAME - * and PHOSTNAME. - */ -/*#define HAS_UNAME /**/ - /* HAS_GETLOGIN: * This symbol, if defined, indicates that the getlogin routine is * available to get the login name. @@ -288,31 +249,6 @@ */ /*#define HAS_GETPRIORITY /**/ -/* HAS_HTONL: - * This symbol, if defined, indicates that the htonl() routine (and - * friends htons() ntohl() ntohs()) are available to do network - * order byte swapping. - */ -/* HAS_HTONS: - * This symbol, if defined, indicates that the htons() routine (and - * friends htonl() ntohl() ntohs()) are available to do network - * order byte swapping. - */ -/* HAS_NTOHL: - * This symbol, if defined, indicates that the ntohl() routine (and - * friends htonl() htons() ntohs()) are available to do network - * order byte swapping. - */ -/* HAS_NTOHS: - * This symbol, if defined, indicates that the ntohs() routine (and - * friends htonl() htons() ntohl()) are available to do network - * order byte swapping. - */ -#define HAS_HTONL /**/ -#define HAS_HTONS /**/ -#define HAS_NTOHL /**/ -#define HAS_NTOHS /**/ - /* HAS_INET_ATON: * This symbol, if defined, indicates to the C program that the * inet_aton() function is available to parse IP address "dotted-quad" @@ -331,7 +267,7 @@ * This symbol, if defined, indicates that the link routine is * available to create hard links. */ -/*#define HAS_LINK /**/ +#define HAS_LINK /**/ /* HAS_LOCALECONV: * This symbol, if defined, indicates that the localeconv routine is @@ -416,11 +352,17 @@ */ #define HAS_MKTIME /**/ -/* HAS_MSG: - * This symbol, if defined, indicates that the entire msg*(2) library is - * supported (IPC mechanism based on message queues). +/* HAS_MSYNC: + * This symbol, if defined, indicates that the msync system call is + * available to synchronize a mapped file. */ -/*#define HAS_MSG /**/ +/*#define HAS_MSYNC /**/ + +/* HAS_MUNMAP: + * This symbol, if defined, indicates that the munmap system call is + * available to unmap a region, usually mapped by mmap(). + */ +/*#define HAS_MUNMAP /**/ /* HAS_NICE: * This symbol, if defined, indicates that the nice routine is @@ -512,12 +454,6 @@ */ #define HAS_SELECT /**/ -/* HAS_SEM: - * This symbol, if defined, indicates that the entire sem*(2) library is - * supported. - */ -/*#define HAS_SEM /**/ - /* HAS_SETEGID: * This symbol, if defined, indicates that the setegid routine is available * to change the effective gid of the current program. @@ -617,12 +553,6 @@ */ /*#define HAS_SETSID /**/ -/* HAS_SHM: - * This symbol, if defined, indicates that the entire shm*(2) library is - * supported. - */ -/*#define HAS_SHM /**/ - /* Shmat_t: * This symbol holds the return type of the shmat() system call. * Usually set to 'void *' or 'char *'. @@ -637,12 +567,6 @@ #define Shmat_t void * /**/ /*#define HAS_SHMAT_PROTOTYPE /**/ -/* USE_STAT_BLOCKS: - * This symbol is defined if this system has a stat structure declaring - * st_blksize and st_blocks. - */ -/*#define USE_STAT_BLOCKS /**/ - /* HAS_STRCHR: * This symbol is defined to indicate that the strchr()/strrchr() * functions are available for string searching. If not, try the @@ -668,25 +592,6 @@ */ #define USE_STRUCT_COPY /**/ -/* HAS_STRERROR: - * This symbol, if defined, indicates that the strerror routine is - * available to translate error numbers to strings. See the writeup - * of Strerror() in this file before you try to define your own. - */ -/* HAS_SYS_ERRLIST: - * This symbol, if defined, indicates that the sys_errlist array is - * available to translate error numbers to strings. The extern int - * sys_nerr gives the size of that table. - */ -/* Strerror: - * This preprocessor symbol is defined as a macro if strerror() is - * not available to translate error numbers to strings but sys_errlist[] - * array is there. - */ -#define HAS_STRERROR /**/ -#define HAS_SYS_ERRLIST /**/ -#define Strerror(e) strerror(e) - /* HAS_STRTOD: * This symbol, if defined, indicates that the strtod routine is * available to provide better numeric string conversion than atof(). @@ -765,11 +670,6 @@ */ #define HAS_UMASK /**/ -/* HAS_VFORK: - * This symbol, if defined, indicates that vfork() exists. - */ -/*#define HAS_VFORK /**/ - /* HASVOLATILE: * This symbol, if defined, indicates that this C compiler knows about * the volatile declaration. @@ -803,10 +703,10 @@ #define HAS_WCTOMB /**/ /* I_ARPA_INET: - * This symbol, if defined, indicates that <arpa/inet.h> exists and should - * be included. + * This symbol, if defined, indicates to the C program that it should + * include <arpa/inet.h> to get inet_addr and friends declarations. */ -/*#define I_ARPA_INET /**/ +#define I_ARPA_INET /**/ /* I_DBM: * This symbol, if defined, indicates that <dbm.h> exists and should @@ -857,32 +757,6 @@ */ #define I_FLOAT /**/ -/* I_GRP: - * This symbol, if defined, indicates to the C program that it should - * include <grp.h>. - */ -/* GRPASSWD: - * This symbol, if defined, indicates to the C program that struct group - * contains gr_passwd. - */ -/* HAS_SETGRENT: - * This symbol, if defined, indicates that the getgrent routine is - * available for initializing sequential access of the group database. - */ -/* HAS_GETGRENT: - * This symbol, if defined, indicates that the getgrent routine is - * available for sequential access of the group database. - */ -/* HAS_ENDGRENT: - * This symbol, if defined, indicates that the getgrent routine is - * available for finalizing sequential access of the group database. - */ -/*#define I_GRP /**/ -/*#define GRPASSWD /**/ -/*#define HAS_SETGRENT /**/ -/*#define HAS_GETGRENT /**/ -/*#define HAS_ENDGRENT /**/ - /* I_LIMITS: * This symbol, if defined, indicates to the C program that it should * include <limits.h> to get definition of symbols like WORD_BIT or @@ -1112,20 +986,156 @@ */ #define STDCHAR char /**/ +/* CROSSCOMPILE: + * This symbol, if defined, signifies that we our + * build process is a cross-compilation. + */ +/*#define CROSSCOMPILE /**/ + +/* INTSIZE: + * This symbol contains the value of sizeof(int) so that the C + * preprocessor can make decisions based on it. + */ +/* LONGSIZE: + * This symbol contains the value of sizeof(long) so that the C + * preprocessor can make decisions based on it. + */ +/* SHORTSIZE: + * This symbol contains the value of sizeof(short) so that the C + * preprocessor can make decisions based on it. + */ +#define INTSIZE 4 /**/ +#define LONGSIZE 4 /**/ +#define SHORTSIZE 2 /**/ + +/* MULTIARCH: + * This symbol, if defined, signifies that the build + * process will produce some binary files that are going to be + * used in a cross-platform environment. This is the case for + * example with the NeXT "fat" binaries that contain executables + * for several CPUs. + */ +/*#define MULTIARCH /**/ + +/* HAS_QUAD: + * This symbol, if defined, tells that there's a 64-bit integer type, + * Quad_t, and its unsigned counterpar, Uquad_t. QUADKIND will be one + * of QUAD_IS_INT, QUAD_IS_LONG, QUAD_IS_LONG_LONG, or QUAD_IS_INT64_T. + */ +/*#define HAS_QUAD /**/ +#ifdef HAS_QUAD +# define Quad_t __int64 /**/ +# define Uquad_t unsigned __int64 /**/ +# define QUADKIND 5 /**/ +# define QUAD_IS_INT 1 +# define QUAD_IS_LONG 2 +# define QUAD_IS_LONG_LONG 3 +# define QUAD_IS_INT64_T 4 +#endif + +/* HAS_ACCESSX: + * This symbol, if defined, indicates that the accessx routine is + * available to do extended access checks. + */ +/*#define HAS_ACCESSX /**/ + +/* HAS_EACCESS: + * This symbol, if defined, indicates that the eaccess routine is + * available to do extended access checks. + */ +/*#define HAS_EACCESS /**/ + +/* I_SYS_ACCESS: + * This symbol, if defined, indicates to the C program that it should + * include <sys/access.h>. + */ +/*#define I_SYS_ACCESS /**/ + +/* I_SYS_SECURITY: + * This symbol, if defined, indicates to the C program that it should + * include <sys/security.h>. + */ +/*#define I_SYS_SECURITY /**/ + +/* OSNAME: + * This symbol contains the name of the operating system, as determined + * by Configure. You shouldn't rely on it too much; the specific + * feature tests from Configure are generally more reliable. + */ +#define OSNAME "MSWin32" /**/ + /* MEM_ALIGNBYTES: - * This symbol contains the number of bytes required to align a - * double. Usual values are 2, 4 and 8. - * On NeXT starting with 3.2, you can build "Fat" Multiple Architecture - * Binaries (MAB) for targets with varying alignment. This only matters - * for perl, where the config.h can be generated and installed on one - * system, and used by a different architecture to build an extension. - * The default is eight, for safety. + * This symbol contains the number of bytes required to align a + * double, or a long double when applicable. Usual values are 2, + * 4 and 8. The default is eight, for safety. + */ +#if defined(CROSSCOMPILE) || defined(MULTIARCH) +# define MEM_ALIGNBYTES 8 +#else +#define MEM_ALIGNBYTES 8 +#endif + +/* ARCHLIB: + * This variable, if defined, holds the name of the directory in + * which the user wants to put architecture-dependent public + * library files for perl5. It is most often a local directory + * such as /usr/local/lib. Programs using this variable must be + * prepared to deal with filename expansion. If ARCHLIB is the + * same as PRIVLIB, it is not defined, since presumably the + * program already searches PRIVLIB. + */ +/* ARCHLIB_EXP: + * This symbol contains the ~name expanded version of ARCHLIB, to be used + * in programs that are not prepared to deal with ~ expansion at run-time. + */ +#define ARCHLIB "c:\\perl\\5.6.0\\lib\\MSWin32-x86" /**/ +/*#define ARCHLIB_EXP "" /**/ + +/* ARCHNAME: + * This symbol holds a string representing the architecture name. + * It may be used to construct an architecture-dependant pathname + * where library files may be held under a private library, for + * instance. + */ +#define ARCHNAME "MSWin32-x86" /**/ + +/* HAS_ATOLF: + * This symbol, if defined, indicates that the atolf routine is + * available to convert strings into long doubles. + */ +/*#define HAS_ATOLF /**/ + +/* HAS_ATOLL: + * This symbol, if defined, indicates that the atoll routine is + * available to convert strings into long longs. + */ +/*#define HAS_ATOLL /**/ + +/* BIN: + * This symbol holds the path of the bin directory where the package will + * be installed. Program must be prepared to deal with ~name substitution. + */ +/* BIN_EXP: + * This symbol is the filename expanded version of the BIN symbol, for + * programs that do not want to deal with that at run-time. */ -#define MEM_ALIGNBYTES 8 /**/ +#define BIN "c:\\perl\\5.6.0\\bin\\MSWin32-x86" /**/ +#define BIN_EXP "c:\\perl\\5.6.0\\bin\\MSWin32-x86" /**/ + +/* PERL_BINCOMPAT_5005: + * This symbol, if defined, indicates that this version of Perl should be + * binary-compatible with Perl 5.005. This is impossible for builds + * that use features like threads and multiplicity it is always undef + * for those versions. + */ +/*#define PERL_BINCOMPAT_5005 /**/ /* BYTEORDER: * This symbol holds the hexadecimal constant defined in byteorder, * i.e. 0x1234 or 0x4321, etc... + * If the compiler supports cross-compiling or multiple-architecture + * binaries (eg. on NeXT systems), use compiler-defined macros to + * determine the byte order. * On NeXT 3.2 (and greater), you can build "Fat" Multiple Architecture * Binaries (MAB) on either big endian or little endian machines. * The endian-ness is available at compile-time. This only matters @@ -1136,21 +1146,99 @@ * so the default case (for NeXT) is big endian to catch them. * This might matter for NeXT 3.0. */ -#ifndef NeXT +#if defined(CROSSCOMPILE) || defined(MULTIARCH) +# ifdef __LITTLE_ENDIAN__ +# if LONGSIZE == 4 +# define BYTEORDER 0x1234 +# else +# if LONGSIZE == 8 +# define BYTEORDER 0x12345678 +# endif +# endif +# else +# ifdef __BIG_ENDIAN__ +# if LONGSIZE == 4 +# define BYTEORDER 0x4321 +# else +# if LONGSIZE == 8 +# define BYTEORDER 0x87654321 +# endif +# endif +# endif +# endif +# if !defined(BYTEORDER) && (defined(NeXT) || defined(__NeXT__)) +# define BYTEORDER 0x4321 +# endif +#else #define BYTEORDER 0x1234 /* large digits for MSB */ -#else /* NeXT */ -#ifdef __LITTLE_ENDIAN__ -#define BYTEORDER 0x1234 -#else /* __BIG_ENDIAN__ */ -#define BYTEORDER 0x4321 -#endif /* ENDIAN CHECK */ #endif /* NeXT */ +/* CAT2: + * This macro catenates 2 tokens together. + */ +/* STRINGIFY: + * This macro surrounds its token with double quotes. + */ +#if 42 == 1 +# define CAT2(a,b) a/**/b +# define STRINGIFY(a) "a" + /* If you can get stringification with catify, tell me how! */ +#endif +#if 42 == 42 +# define PeRl_CaTiFy(a, b) a ## b +# define PeRl_StGiFy(a) #a +/* the additional level of indirection enables these macros to be + * used as arguments to other macros. See K&R 2nd ed., page 231. */ +# define CAT2(a,b) PeRl_CaTiFy(a,b) +# define StGiFy(a) PeRl_StGiFy(a) +# define STRINGIFY(a) PeRl_StGiFy(a) +#endif +#if 42 != 1 && 42 != 42 +#include "Bletch: How does this C preprocessor catenate tokens?" +#endif + +/* CPPSTDIN: + * This symbol contains the first part of the string which will invoke + * the C preprocessor on the standard input and produce to standard + * output. Typical value of "cc -E" or "/lib/cpp", but it can also + * call a wrapper. See CPPRUN. + */ +/* CPPMINUS: + * This symbol contains the second part of the string which will invoke + * the C preprocessor on the standard input and produce to standard + * output. This symbol will have the value "-" if CPPSTDIN needs a minus + * to specify standard input, otherwise the value is "". + */ +/* CPPRUN: + * This symbol contains the string which will invoke a C preprocessor on + * the standard input and produce to standard output. It needs to end + * with CPPLAST, after all other preprocessor flags have been specified. + * The main difference with CPPSTDIN is that this program will never be a + * pointer to a shell wrapper, i.e. it will be empty if no preprocessor is + * available directly to the user. Note that it may well be different from + * the preprocessor used to compile the C program. + */ +/* CPPLAST: + * This symbol is intended to be used along with CPPRUN in the same manner + * symbol CPPMINUS is used with CPPSTDIN. It contains either "-" or "". + */ +#define CPPSTDIN "cl -nologo -E" +#define CPPMINUS "" +#define CPPRUN "cl -nologo -E" +#define CPPLAST "" + +/* HAS_ACCESS: + * This manifest constant lets the C program know that the access() + * system call is available to check for accessibility using real UID/GID. + * (always present on UNIX.) + */ +#define HAS_ACCESS /**/ + /* CASTI32: * This symbol is defined if the C compiler can cast negative * or large floating point numbers to 32-bit ints. */ -#define CASTI32 /**/ +/*#define CASTI32 /**/ /* CASTNEGFLOAT: * This symbol is defined if the C compiler can cast negative @@ -1173,320 +1261,144 @@ */ /*#define VOID_CLOSEDIR /**/ -/* Gconvert: - * This preprocessor macro is defined to convert a floating point - * number to a string without a trailing decimal point. This - * emulates the behavior of sprintf("%g"), but is sometimes much more - * efficient. If gconvert() is not available, but gcvt() drops the - * trailing decimal point, then gcvt() is used. If all else fails, - * a macro using sprintf("%g") is used. Arguments for the Gconvert - * macro are: value, number of digits, whether trailing zeros should - * be retained, and the output buffer. - * Possible values are: - * d_Gconvert='gconvert((x),(n),(t),(b))' - * d_Gconvert='gcvt((x),(n),(b))' - * d_Gconvert='sprintf((b),"%.*g",(n),(x))' - * The last two assume trailing zeros should not be kept. - */ -#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x)) - -/* HAS_GNULIBC: - * This symbol, if defined, indicates to the C program that - * the GNU C library is being used. - */ -/*#define HAS_GNULIBC /**/ -/* HAS_ISASCII: - * This manifest constant lets the C program know that isascii - * is available. - */ -#define HAS_ISASCII /**/ - -/* HAS_LCHOWN: - * This symbol, if defined, indicates that the lchown routine is - * available to operate on a symbolic link (instead of following the - * link). - */ -/*#define HAS_LCHOWN /**/ - -/* HAS_OPEN3: - * This manifest constant lets the C program know that the three - * argument form of open(2) is available. - */ -/*#define HAS_OPEN3 /**/ - -/* HAS_SAFE_BCOPY: - * This symbol, if defined, indicates that the bcopy routine is available - * to copy potentially overlapping memory blocks. Otherwise you should - * probably use memmove() or memcpy(). If neither is defined, roll your - * own version. - */ -/*#define HAS_SAFE_BCOPY /**/ - -/* HAS_SAFE_MEMCPY: - * This symbol, if defined, indicates that the memcpy routine is available - * to copy potentially overlapping memory blocks. Otherwise you should - * probably use memmove() or memcpy(). If neither is defined, roll your - * own version. +/* HAS_CSH: + * This symbol, if defined, indicates that the C-shell exists. */ -/*#define HAS_SAFE_MEMCPY /**/ - -/* HAS_SANE_MEMCMP: - * This symbol, if defined, indicates that the memcmp routine is available - * and can be used to compare relative magnitudes of chars with their high - * bits set. If it is not defined, roll your own version. +/* CSH: + * This symbol, if defined, contains the full pathname of csh. */ -#define HAS_SANE_MEMCMP /**/ +/*#define HAS_CSH /**/ +#ifdef HAS_CSH +#define CSH "" /**/ +#endif -/* HAS_SIGACTION: - * This symbol, if defined, indicates that Vr4's sigaction() routine - * is available. +/* DLSYM_NEEDS_UNDERSCORE: + * This symbol, if defined, indicates that we need to prepend an + * underscore to the symbol name before calling dlsym(). This only + * makes sense if you *have* dlsym, which we will presume is the + * case if you're using dl_dlopen.xs. */ -/*#define HAS_SIGACTION /**/ +/*#define DLSYM_NEEDS_UNDERSCORE /**/ -/* Sigjmp_buf: - * This is the buffer type to be used with Sigsetjmp and Siglongjmp. - */ -/* Sigsetjmp: - * This macro is used in the same way as sigsetjmp(), but will invoke - * traditional setjmp() if sigsetjmp isn't available. - * See HAS_SIGSETJMP. - */ -/* Siglongjmp: - * This macro is used in the same way as siglongjmp(), but will invoke - * traditional longjmp() if siglongjmp isn't available. - * See HAS_SIGSETJMP. +/* HAS_DRAND48_PROTO: + * This symbol, if defined, indicates that the system provides + * a prototype for the drand48() function. Otherwise, it is up + * to the program to supply one. A good guess is + * extern double drand48 _((void)); */ -/*#define HAS_SIGSETJMP /**/ -#ifdef HAS_SIGSETJMP -#define Sigjmp_buf sigjmp_buf -#define Sigsetjmp(buf,save_mask) sigsetjmp((buf),(save_mask)) -#define Siglongjmp(buf,retval) siglongjmp((buf),(retval)) -#else -#define Sigjmp_buf jmp_buf -#define Sigsetjmp(buf,save_mask) setjmp((buf)) -#define Siglongjmp(buf,retval) longjmp((buf),(retval)) -#endif +/*#define HAS_DRAND48_PROTO /**/ -/* USE_STDIO_PTR: - * This symbol is defined if the _ptr and _cnt fields (or similar) - * of the stdio FILE structure can be used to access the stdio buffer - * for a file handle. If this is defined, then the FILE_ptr(fp) - * and FILE_cnt(fp) macros will also be defined and should be used - * to access these fields. - */ -/* FILE_ptr: - * This macro is used to access the _ptr field (or equivalent) of the - * FILE structure pointed to by its argument. This macro will always be - * defined if USE_STDIO_PTR is defined. - */ -/* STDIO_PTR_LVALUE: - * This symbol is defined if the FILE_ptr macro can be used as an - * lvalue. - */ -/* FILE_cnt: - * This macro is used to access the _cnt field (or equivalent) of the - * FILE structure pointed to by its argument. This macro will always be - * defined if USE_STDIO_PTR is defined. - */ -/* STDIO_CNT_LVALUE: - * This symbol is defined if the FILE_cnt macro can be used as an - * lvalue. +/* HAS_ENDGRENT: + * This symbol, if defined, indicates that the getgrent routine is + * available for finalizing sequential access of the group database. */ -#define USE_STDIO_PTR /**/ -#ifdef USE_STDIO_PTR -#define FILE_ptr(fp) ((fp)->_ptr) -#define STDIO_PTR_LVALUE /**/ -#define FILE_cnt(fp) ((fp)->_cnt) -#define STDIO_CNT_LVALUE /**/ -#endif +/*#define HAS_ENDGRENT /**/ -/* USE_STDIO_BASE: - * This symbol is defined if the _base field (or similar) of the - * stdio FILE structure can be used to access the stdio buffer for - * a file handle. If this is defined, then the FILE_base(fp) macro - * will also be defined and should be used to access this field. - * Also, the FILE_bufsiz(fp) macro will be defined and should be used - * to determine the number of bytes in the buffer. USE_STDIO_BASE - * will never be defined unless USE_STDIO_PTR is. - */ -/* FILE_base: - * This macro is used to access the _base field (or equivalent) of the - * FILE structure pointed to by its argument. This macro will always be - * defined if USE_STDIO_BASE is defined. - */ -/* FILE_bufsiz: - * This macro is used to determine the number of bytes in the I/O - * buffer pointed to by _base field (or equivalent) of the FILE - * structure pointed to its argument. This macro will always be defined - * if USE_STDIO_BASE is defined. +/* HAS_ENDHOSTENT: + * This symbol, if defined, indicates that the endhostent() routine is + * available to close whatever was being used for host queries. */ -#define USE_STDIO_BASE /**/ -#ifdef USE_STDIO_BASE -#define FILE_base(fp) ((fp)->_base) -#define FILE_bufsiz(fp) ((fp)->_cnt + (fp)->_ptr - (fp)->_base) -#endif +/*#define HAS_ENDHOSTENT /**/ -/* HAS_VPRINTF: - * This symbol, if defined, indicates that the vprintf routine is available - * to printf with a pointer to an argument list. If unavailable, you - * may need to write your own, probably in terms of _doprnt(). - */ -/* USE_CHAR_VSPRINTF: - * This symbol is defined if this system has vsprintf() returning type - * (char*). The trend seems to be to declare it as "int vsprintf()". It - * is up to the package author to declare vsprintf correctly based on the - * symbol. +/* HAS_ENDNETENT: + * This symbol, if defined, indicates that the endnetent() routine is + * available to close whatever was being used for network queries. */ -#define HAS_VPRINTF /**/ -/*#define USE_CHAR_VSPRINTF /**/ +/*#define HAS_ENDNETENT /**/ -/* DOUBLESIZE: - * This symbol contains the size of a double, so that the C preprocessor - * can make decisions based on it. +/* HAS_ENDPROTOENT: + * This symbol, if defined, indicates that the endprotoent() routine is + * available to close whatever was being used for protocol queries. */ -#define DOUBLESIZE 8 /**/ +/*#define HAS_ENDPROTOENT /**/ -/* I_TIME: - * This symbol, if defined, indicates to the C program that it should - * include <time.h>. - */ -/* I_SYS_TIME: - * This symbol, if defined, indicates to the C program that it should - * include <sys/time.h>. - */ -/* I_SYS_TIME_KERNEL: - * This symbol, if defined, indicates to the C program that it should - * include <sys/time.h> with KERNEL defined. +/* HAS_ENDPWENT: + * This symbol, if defined, indicates that the getgrent routine is + * available for finalizing sequential access of the passwd database. */ -#define I_TIME /**/ -/*#define I_SYS_TIME /**/ -/*#define I_SYS_TIME_KERNEL /**/ +/*#define HAS_ENDPWENT /**/ -/* INTSIZE: - * This symbol contains the value of sizeof(int) so that the C - * preprocessor can make decisions based on it. - */ -/* LONGSIZE: - * This symbol contains the value of sizeof(long) so that the C - * preprocessor can make decisions based on it. - */ -/* SHORTSIZE: - * This symbol contains the value of sizeof(short) so that the C - * preprocessor can make decisions based on it. +/* HAS_ENDSERVENT: + * This symbol, if defined, indicates that the endservent() routine is + * available to close whatever was being used for service queries. */ -#define INTSIZE 4 /**/ -#define LONGSIZE 4 /**/ -#define SHORTSIZE 2 /**/ +/*#define HAS_ENDSERVENT /**/ -/* VAL_O_NONBLOCK: - * This symbol is to be used during open() or fcntl(F_SETFL) to turn on - * non-blocking I/O for the file descriptor. Note that there is no way - * back, i.e. you cannot turn it blocking again this way. If you wish to - * alternatively switch between blocking and non-blocking, use the - * ioctl(FIOSNBIO) call instead, but that is not supported by all devices. - */ -/* VAL_EAGAIN: - * This symbol holds the errno error code set by read() when no data was - * present on the non-blocking file descriptor. - */ -/* RD_NODATA: - * This symbol holds the return code from read() when no data is present - * on the non-blocking file descriptor. Be careful! If EOF_NONBLOCK is - * not defined, then you can't distinguish between no data and EOF by - * issuing a read(). You'll have to find another way to tell for sure! - */ -/* EOF_NONBLOCK: - * This symbol, if defined, indicates to the C program that a read() on - * a non-blocking file descriptor will return 0 on EOF, and not the value - * held in RD_NODATA (-1 usually, in that case!). +/* HAS_ENDSPENT: + * This symbol, if defined, indicates that the endspent system call is + * available to finalize the scan of SysV shadow password entries. */ -#define VAL_O_NONBLOCK O_NONBLOCK -#define VAL_EAGAIN EAGAIN -#define RD_NODATA -1 -#define EOF_NONBLOCK +/*#define HAS_ENDSPENT /**/ -/* PTRSIZE: - * This symbol contains the size of a pointer, so that the C preprocessor - * can make decisions based on it. It will be sizeof(void *) if - * the compiler supports (void *); otherwise it will be - * sizeof(char *). +/* HAS_FD_SET: + * This symbol, when defined, indicates presence of the fd_set typedef + * in <sys/types.h> */ -#define PTRSIZE 4 /**/ +#define HAS_FD_SET /**/ -/* RANDBITS: - * This symbol contains the number of bits of random number the rand() - * function produces. Usual values are 15, 16, and 31. +/* HAS_FPOS64_T: + * This symbol will be defined if the C compiler supports fpos64_t. */ -#define RANDBITS 15 /**/ +/*#define HAS_FPOS64_T /**/ -/* SSize_t: - * This symbol holds the type used by functions that return - * a count of bytes or an error condition. It must be a signed type. - * It is usually ssize_t, but may be long or int, etc. - * It may be necessary to include <sys/types.h> or <unistd.h> - * to get any typedef'ed information. - * We will pick a type such that sizeof(SSize_t) == sizeof(Size_t). +/* HAS_STRUCT_FS_DATA: + * This symbol, if defined, indicates that the struct fs_data + * to do statfs() is supported. */ -#define SSize_t int /* signed count of bytes */ +/*#define HAS_STRUCT_FS_DATA /**/ -/* OSNAME: - * This symbol contains the name of the operating system, as determined - * by Configure. You shouldn't rely on it too much; the specific - * feature tests from Configure are generally more reliable. +/* HAS_FSEEKO: + * This symbol, if defined, indicates that the fseeko routine is + * available to fseek beyond 32 bits (useful for ILP32 hosts). */ -#define OSNAME "MSWin32" /**/ +/*#define HAS_FSEEKO /**/ -/* CAT2: - * This macro catenates 2 tokens together. +/* HAS_FSTATFS: + * This symbol, if defined, indicates that the fstatfs routine is + * available to stat filesystems by file descriptors. */ -/* STRINGIFY: - * This macro surrounds its token with double quotes. - */ -#if 42 == 1 -#define CAT2(a,b)a/**/b -#define STRINGIFY(a)"a" - /* If you can get stringification with catify, tell me how! */ -#endif -#if 42 == 42 -#define CAT2(a,b)a ## b -#define StGiFy(a)# a -#define STRINGIFY(a)StGiFy(a) -#endif -#if 42 != 1 && 42 != 42 -#include "Bletch: How does this C preprocessor catenate tokens?" -#endif +/*#define HAS_FSTATFS /**/ -/* CSH: - * This symbol, if defined, contains the full pathname of csh. +/* HAS_FTELLO: + * This symbol, if defined, indicates that the ftello routine is + * available to ftell beyond 32 bits (useful for ILP32 hosts). */ -/*#define HAS_CSH /**/ -#ifdef HAS_CSH -#define CSH "" /**/ -#endif +/*#define HAS_FTELLO /**/ -/* HAS_ENDHOSTENT: - * This symbol, if defined, indicates that the endhostent() routine is - * available to close whatever was being used for host queries. +/* Gconvert: + * This preprocessor macro is defined to convert a floating point + * number to a string without a trailing decimal point. This + * emulates the behavior of sprintf("%g"), but is sometimes much more + * efficient. If gconvert() is not available, but gcvt() drops the + * trailing decimal point, then gcvt() is used. If all else fails, + * a macro using sprintf("%g") is used. Arguments for the Gconvert + * macro are: value, number of digits, whether trailing zeros should + * be retained, and the output buffer. + * Possible values are: + * d_Gconvert='gconvert((x),(n),(t),(b))' + * d_Gconvert='gcvt((x),(n),(b))' + * d_Gconvert='sprintf((b),"%.*g",(n),(x))' + * The last two assume trailing zeros should not be kept. */ -/*#define HAS_ENDHOSTENT /**/ +#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x)) -/* HAS_ENDNETENT: - * This symbol, if defined, indicates that the endnetent() routine is - * available to close whatever was being used for network queries. +/* HAS_GETCWD: + * This symbol, if defined, indicates that the getcwd routine is + * available to get the current working directory. */ -/*#define HAS_ENDNETENT /**/ +/*#define HAS_GETCWD /**/ -/* HAS_ENDPROTOENT: - * This symbol, if defined, indicates that the endprotoent() routine is - * available to close whatever was being used for protocol queries. +/* HAS_GETFSSTAT: + * This symbol, if defined, indicates that the getfsstat routine is + * available to stat filesystems in bulk. */ -/*#define HAS_ENDPROTOENT /**/ +/*#define HAS_GETFSSTAT /**/ -/* HAS_ENDSERVENT: - * This symbol, if defined, indicates that the endservent() routine is - * available to close whatever was being used for service queries. +/* HAS_GETGRENT: + * This symbol, if defined, indicates that the getgrent routine is + * available for sequential access of the group database. */ -/*#define HAS_ENDSERVENT /**/ +/*#define HAS_GETGRENT /**/ /* HAS_GETHOSTBYADDR: * This symbol, if defined, indicates that the gethostbyaddr() routine is @@ -1506,6 +1418,55 @@ */ /*#define HAS_GETHOSTENT /**/ +/* HAS_GETHOSTNAME: + * This symbol, if defined, indicates that the C program may use the + * gethostname() routine to derive the host name. See also HAS_UNAME + * and PHOSTNAME. + */ +/* HAS_UNAME: + * This symbol, if defined, indicates that the C program may use the + * uname() routine to derive the host name. See also HAS_GETHOSTNAME + * and PHOSTNAME. + */ +/* PHOSTNAME: + * This symbol, if defined, indicates the command to feed to the + * popen() routine to derive the host name. See also HAS_GETHOSTNAME + * and HAS_UNAME. Note that the command uses a fully qualified path, + * so that it is safe even if used by a process with super-user + * privileges. + */ +/* HAS_PHOSTNAME: + * This symbol, if defined, indicates that the C program may use the + * contents of PHOSTNAME as a command to feed to the popen() routine + * to derive the host name. + */ +#define HAS_GETHOSTNAME /**/ +#define HAS_UNAME /**/ +/*#define HAS_PHOSTNAME /**/ +#ifdef HAS_PHOSTNAME +#define PHOSTNAME "" /* How to get the host name */ +#endif + +/* HAS_GETHOST_PROTOS: + * This symbol, if defined, indicates that <netdb.h> includes + * prototypes for gethostent(), gethostbyname(), and + * gethostbyaddr(). Otherwise, it is up to the program to guess + * them. See netdbtype.U for probing for various Netdb_xxx_t types. + */ +#define HAS_GETHOST_PROTOS /**/ + +/* HAS_GETMNT: + * This symbol, if defined, indicates that the getmnt routine is + * available to get filesystem mount info by filename. + */ +/*#define HAS_GETMNT /**/ + +/* HAS_GETMNTENT: + * This symbol, if defined, indicates that the getmntent routine is + * available to iterate through mounted file systems to get their info. + */ +/*#define HAS_GETMNTENT /**/ + /* HAS_GETNETBYADDR: * This symbol, if defined, indicates that the getnetbyaddr() routine is * available to look up networks by their IP addresses. @@ -1524,6 +1485,14 @@ */ /*#define HAS_GETNETENT /**/ +/* HAS_GETNET_PROTOS: + * This symbol, if defined, indicates that <netdb.h> includes + * prototypes for getnetent(), getnetbyname(), and + * getnetbyaddr(). Otherwise, it is up to the program to guess + * them. See netdbtype.U for probing for various Netdb_xxx_t types. + */ +/*#define HAS_GETNET_PROTOS /**/ + /* HAS_GETPROTOENT: * This symbol, if defined, indicates that the getprotoent() routine is * available to look up protocols in some data base or another. @@ -1541,12 +1510,47 @@ #define HAS_GETPROTOBYNAME /**/ #define HAS_GETPROTOBYNUMBER /**/ +/* HAS_GETPROTO_PROTOS: + * This symbol, if defined, indicates that <netdb.h> includes + * prototypes for getprotoent(), getprotobyname(), and + * getprotobyaddr(). Otherwise, it is up to the program to guess + * them. See netdbtype.U for probing for various Netdb_xxx_t types. + */ +#define HAS_GETPROTO_PROTOS /**/ + +/* HAS_GETPWENT: + * This symbol, if defined, indicates that the getpwent routine is + * available for sequential access of the passwd database. + * If this is not available, the older getpw() function may be available. + */ +/*#define HAS_GETPWENT /**/ + /* HAS_GETSERVENT: * This symbol, if defined, indicates that the getservent() routine is * available to look up network services in some data base or another. */ /*#define HAS_GETSERVENT /**/ +/* HAS_GETSERV_PROTOS: + * This symbol, if defined, indicates that <netdb.h> includes + * prototypes for getservent(), getservbyname(), and + * getservbyaddr(). Otherwise, it is up to the program to guess + * them. See netdbtype.U for probing for various Netdb_xxx_t types. + */ +#define HAS_GETSERV_PROTOS /**/ + +/* HAS_GETSPENT: + * This symbol, if defined, indicates that the getspent system call is + * available to retrieve SysV shadow password entries sequentially. + */ +/*#define HAS_GETSPENT /**/ + +/* HAS_GETSPNAM: + * This symbol, if defined, indicates that the getspnam system call is + * available to retrieve SysV shadow password entries by name. + */ +/*#define HAS_GETSPNAM /**/ + /* HAS_GETSERVBYNAME: * This symbol, if defined, indicates that the getservbyname() * routine is available to look up services by their name. @@ -1558,6 +1562,72 @@ #define HAS_GETSERVBYNAME /**/ #define HAS_GETSERVBYPORT /**/ +/* HAS_GNULIBC: + * This symbol, if defined, indicates to the C program that + * the GNU C library is being used. + */ +/*#define HAS_GNULIBC /**/ +#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE) +# define _GNU_SOURCE +#endif +/* HAS_HASMNTOPT: + * This symbol, if defined, indicates that the hasmntopt routine is + * available to query the mount options of file systems. + */ +/*#define HAS_HASMNTOPT /**/ + +/* HAS_HTONL: + * This symbol, if defined, indicates that the htonl() routine (and + * friends htons() ntohl() ntohs()) are available to do network + * order byte swapping. + */ +/* HAS_HTONS: + * This symbol, if defined, indicates that the htons() routine (and + * friends htonl() ntohl() ntohs()) are available to do network + * order byte swapping. + */ +/* HAS_NTOHL: + * This symbol, if defined, indicates that the ntohl() routine (and + * friends htonl() htons() ntohs()) are available to do network + * order byte swapping. + */ +/* HAS_NTOHS: + * This symbol, if defined, indicates that the ntohs() routine (and + * friends htonl() htons() ntohl()) are available to do network + * order byte swapping. + */ +#define HAS_HTONL /**/ +#define HAS_HTONS /**/ +#define HAS_NTOHL /**/ +#define HAS_NTOHS /**/ + +/* HAS_ICONV: + * This symbol, if defined, indicates that the iconv routine is + * available to do character set conversions. + */ +/*#define HAS_ICONV /**/ + +/* HAS_INT64_T: + * This symbol will defined if the C compiler supports int64_t. + * Usually the <inttypes.h> needs to be included, but sometimes + * <sys/types.h> is enough. + */ +/*#define HAS_INT64_T /**/ + +/* HAS_ISASCII: + * This manifest constant lets the C program know that isascii + * is available. + */ +#define HAS_ISASCII /**/ + +/* HAS_LDBL_DIG: + * This symbol, if defined, indicates that this system's <float.h> + * or <limits.h> defines the symbol LDBL_DIG, which is the number + * of significant digits in a long double precision number. Unlike + * for DBL_DIG, there's no good guess for LDBL_DIG if it is undefined. + */ +#define HAS_LDBL_DIG /**/ + /* HAS_LONG_DOUBLE: * This symbol will be defined if the C compiler supports long * doubles. @@ -1573,8 +1643,7 @@ #endif /* HAS_LONG_LONG: - * This symbol will be defined if the C compiler supports - * long long. + * This symbol will be defined if the C compiler supports long long. */ /* LONGLONGSIZE: * This symbol contains the size of a long long, so that the @@ -1586,6 +1655,145 @@ #define LONGLONGSIZE 8 /**/ #endif +/* HAS_LSEEK_PROTO: + * This symbol, if defined, indicates that the system provides + * a prototype for the lseek() function. Otherwise, it is up + * to the program to supply one. A good guess is + * extern off_t lseek(int, off_t, int); + */ +#define HAS_LSEEK_PROTO /**/ + +/* HAS_MADVISE: + * This symbol, if defined, indicates that the madvise system call is + * available to map a file into memory. + */ +/*#define HAS_MADVISE /**/ + +/* HAS_MEMCHR: + * This symbol, if defined, indicates that the memchr routine is available + * to locate characters within a C string. + */ +#define HAS_MEMCHR /**/ + +/* HAS_MKDTEMP: + * This symbol, if defined, indicates that the mkdtemp routine is + * available to exclusively create a uniquely named temporary directory. + */ +/*#define HAS_MKDTEMP /**/ + +/* HAS_MKSTEMP: + * This symbol, if defined, indicates that the mkstemp routine is + * available to exclusively create and open a uniquely named + * temporary file. + */ +/*#define HAS_MKSTEMP /**/ + +/* HAS_MKSTEMPS: + * This symbol, if defined, indicates that the mkstemps routine is + * available to excluslvely create and open a uniquely named + * (with a suffix) temporary file. + */ +/*#define HAS_MKSTEMPS /**/ + +/* HAS_MMAP: + * This symbol, if defined, indicates that the mmap system call is + * available to map a file into memory. + */ +/* Mmap_t: + * This symbol holds the return type of the mmap() system call + * (and simultaneously the type of the first argument). + * Usually set to 'void *' or 'cadd_t'. + */ +/*#define HAS_MMAP /**/ +#define Mmap_t void * /**/ + +/* HAS_MPROTECT: + * This symbol, if defined, indicates that the mprotect system call is + * available to modify the access protection of a memory mapped file. + */ +/*#define HAS_MPROTECT /**/ + +/* HAS_MSG: + * This symbol, if defined, indicates that the entire msg*(2) library is + * supported (IPC mechanism based on message queues). + */ +/*#define HAS_MSG /**/ + +/* HAS_OFF64_T: + * This symbol will be defined if the C compiler supports off64_t. + */ +/*#define HAS_OFF64_T /**/ + +/* HAS_OPEN3: + * This manifest constant lets the C program know that the three + * argument form of open(2) is available. + */ +/*#define HAS_OPEN3 /**/ + +/* OLD_PTHREAD_CREATE_JOINABLE: + * This symbol, if defined, indicates how to create pthread + * in joinable (aka undetached) state. NOTE: not defined + * if pthread.h already has defined PTHREAD_CREATE_JOINABLE + * (the new version of the constant). + * If defined, known values are PTHREAD_CREATE_UNDETACHED + * and __UNDETACHED. + */ +/*#define OLD_PTHREAD_CREATE_JOINABLE /**/ + +/* HAS_PTHREAD_YIELD: + * This symbol, if defined, indicates that the pthread_yield + * routine is available to yield the execution of the current + * thread. sched_yield is preferable to pthread_yield. + */ +/* SCHED_YIELD: + * This symbol defines the way to yield the execution of + * the current thread. Known ways are sched_yield, + * pthread_yield, and pthread_yield with NULL. + */ +/* HAS_SCHED_YIELD: + * This symbol, if defined, indicates that the sched_yield + * routine is available to yield the execution of the current + * thread. sched_yield is preferable to pthread_yield. + */ +/*#define HAS_PTHREAD_YIELD /**/ +#define SCHED_YIELD /**/ +/*#define HAS_SCHED_YIELD /**/ + +/* HAS_SAFE_BCOPY: + * This symbol, if defined, indicates that the bcopy routine is available + * to copy potentially overlapping memory blocks. Otherwise you should + * probably use memmove() or memcpy(). If neither is defined, roll your + * own version. + */ +/*#define HAS_SAFE_BCOPY /**/ + +/* HAS_SAFE_MEMCPY: + * This symbol, if defined, indicates that the memcpy routine is available + * to copy potentially overlapping memory blocks. Otherwise you should + * probably use memmove() or memcpy(). If neither is defined, roll your + * own version. + */ +/*#define HAS_SAFE_MEMCPY /**/ + +/* HAS_SANE_MEMCMP: + * This symbol, if defined, indicates that the memcmp routine is available + * and can be used to compare relative magnitudes of chars with their high + * bits set. If it is not defined, roll your own version. + */ +#define HAS_SANE_MEMCMP /**/ + +/* HAS_SEM: + * This symbol, if defined, indicates that the entire sem*(2) library is + * supported. + */ +/*#define HAS_SEM /**/ + +/* HAS_SETGRENT: + * This symbol, if defined, indicates that the setgrent routine is + * available for initializing sequential access of the group database. + */ +/*#define HAS_SETGRENT /**/ + /* HAS_SETGROUPS: * This symbol, if defined, indicates that the setgroups() routine is * available to set the list of process groups. If unavailable, multiple @@ -1611,12 +1819,24 @@ */ /*#define HAS_SETPROTOENT /**/ +/* HAS_SETPWENT: + * This symbol, if defined, indicates that the setpwent routine is + * available for initializing sequential access of the passwd database. + */ +/*#define HAS_SETPWENT /**/ + /* HAS_SETSERVENT: * This symbol, if defined, indicates that the setservent() routine is * available. */ /*#define HAS_SETSERVENT /**/ +/* HAS_SETSPENT: + * This symbol, if defined, indicates that the setspent system call is + * available to initialize the scan of SysV shadow password entries. + */ +/*#define HAS_SETSPENT /**/ + /* HAS_SETVBUF: * This symbol, if defined, indicates that the setvbuf routine is * available to change buffering on an open stdio stream. @@ -1624,6 +1844,55 @@ */ #define HAS_SETVBUF /**/ +/* USE_SFIO: + * This symbol, if defined, indicates that sfio should + * be used. + */ +/*#define USE_SFIO /**/ + +/* HAS_SHM: + * This symbol, if defined, indicates that the entire shm*(2) library is + * supported. + */ +/*#define HAS_SHM /**/ + +/* HAS_SIGACTION: + * This symbol, if defined, indicates that Vr4's sigaction() routine + * is available. + */ +/*#define HAS_SIGACTION /**/ + +/* HAS_SIGSETJMP: + * This variable indicates to the C program that the sigsetjmp() + * routine is available to save the calling process's registers + * and stack environment for later use by siglongjmp(), and + * to optionally save the process's signal mask. See + * Sigjmp_buf, Sigsetjmp, and Siglongjmp. + */ +/* Sigjmp_buf: + * This is the buffer type to be used with Sigsetjmp and Siglongjmp. + */ +/* Sigsetjmp: + * This macro is used in the same way as sigsetjmp(), but will invoke + * traditional setjmp() if sigsetjmp isn't available. + * See HAS_SIGSETJMP. + */ +/* Siglongjmp: + * This macro is used in the same way as siglongjmp(), but will invoke + * traditional longjmp() if siglongjmp isn't available. + * See HAS_SIGSETJMP. + */ +/*#define HAS_SIGSETJMP /**/ +#ifdef HAS_SIGSETJMP +#define Sigjmp_buf sigjmp_buf +#define Sigsetjmp(buf,save_mask) sigsetjmp((buf),(save_mask)) +#define Siglongjmp(buf,retval) siglongjmp((buf),(retval)) +#else +#define Sigjmp_buf jmp_buf +#define Sigsetjmp(buf,save_mask) setjmp((buf)) +#define Siglongjmp(buf,retval) longjmp((buf),(retval)) +#endif + /* HAS_SOCKET: * This symbol, if defined, indicates that the BSD socket interface is * supported. @@ -1632,8 +1901,205 @@ * This symbol, if defined, indicates that the BSD socketpair() call is * supported. */ -#define HAS_SOCKET /**/ -/*#define HAS_SOCKETPAIR /**/ +/* HAS_MSG_CTRUNC: + * This symbol, if defined, indicates that the MSG_CTRUNC is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +/* HAS_MSG_DONTROUTE: + * This symbol, if defined, indicates that the MSG_DONTROUTE is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +/* HAS_MSG_OOB: + * This symbol, if defined, indicates that the MSG_OOB is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +/* HAS_MSG_PEEK: + * This symbol, if defined, indicates that the MSG_PEEK is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +/* HAS_MSG_PROXY: + * This symbol, if defined, indicates that the MSG_PROXY is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +/* HAS_SCM_RIGHTS: + * This symbol, if defined, indicates that the SCM_RIGHTS is supported. + * Checking just with #ifdef might not be enough because this symbol + * has been known to be an enum. + */ +#define HAS_SOCKET /**/ +/*#define HAS_SOCKETPAIR /**/ +/*#define HAS_MSG_CTRUNC /**/ +/*#define HAS_MSG_DONTROUTE /**/ +/*#define HAS_MSG_OOB /**/ +/*#define HAS_MSG_PEEK /**/ +/*#define HAS_MSG_PROXY /**/ +/*#define HAS_SCM_RIGHTS /**/ + +/* HAS_SQRTL: + * This symbol, if defined, indicates that the sqrtl routine is + * available to do long double square roots. + */ +/*#define HAS_SQRTL /**/ + +/* USE_STAT_BLOCKS: + * This symbol is defined if this system has a stat structure declaring + * st_blksize and st_blocks. + */ +#ifndef USE_STAT_BLOCKS +/*#define USE_STAT_BLOCKS /**/ +#endif + +/* HAS_STRUCT_STATFS_F_FLAGS: + * This symbol, if defined, indicates that the struct statfs + * does have the f_flags member containing the mount flags of + * the filesystem containing the file. + * This kind of struct statfs is coming from <sys/mount.h> (BSD 4.3), + * not from <sys/statfs.h> (SYSV). Older BSDs (like Ultrix) do not + * have statfs() and struct statfs, they have ustat() and getmnt() + * with struct ustat and struct fs_data. + */ +/*#define HAS_STRUCT_STATFS_F_FLAGS /**/ + +/* HAS_STRUCT_STATFS: + * This symbol, if defined, indicates that the struct statfs + * to do statfs() is supported. + */ +/*#define HAS_STRUCT_STATFS /**/ + +/* HAS_FSTATVFS: + * This symbol, if defined, indicates that the fstatvfs routine is + * available to stat filesystems by file descriptors. + */ +/*#define HAS_FSTATVFS /**/ + +/* USE_STDIO_PTR: + * This symbol is defined if the _ptr and _cnt fields (or similar) + * of the stdio FILE structure can be used to access the stdio buffer + * for a file handle. If this is defined, then the FILE_ptr(fp) + * and FILE_cnt(fp) macros will also be defined and should be used + * to access these fields. + */ +/* FILE_ptr: + * This macro is used to access the _ptr field (or equivalent) of the + * FILE structure pointed to by its argument. This macro will always be + * defined if USE_STDIO_PTR is defined. + */ +/* STDIO_PTR_LVALUE: + * This symbol is defined if the FILE_ptr macro can be used as an + * lvalue. + */ +/* FILE_cnt: + * This macro is used to access the _cnt field (or equivalent) of the + * FILE structure pointed to by its argument. This macro will always be + * defined if USE_STDIO_PTR is defined. + */ +/* STDIO_CNT_LVALUE: + * This symbol is defined if the FILE_cnt macro can be used as an + * lvalue. + */ +#define USE_STDIO_PTR /**/ +#ifdef USE_STDIO_PTR +#define FILE_ptr(fp) ((fp)->_ptr) +#define STDIO_PTR_LVALUE /**/ +#define FILE_cnt(fp) ((fp)->_cnt) +#define STDIO_CNT_LVALUE /**/ +#endif + +/* USE_STDIO_BASE: + * This symbol is defined if the _base field (or similar) of the + * stdio FILE structure can be used to access the stdio buffer for + * a file handle. If this is defined, then the FILE_base(fp) macro + * will also be defined and should be used to access this field. + * Also, the FILE_bufsiz(fp) macro will be defined and should be used + * to determine the number of bytes in the buffer. USE_STDIO_BASE + * will never be defined unless USE_STDIO_PTR is. + */ +/* FILE_base: + * This macro is used to access the _base field (or equivalent) of the + * FILE structure pointed to by its argument. This macro will always be + * defined if USE_STDIO_BASE is defined. + */ +/* FILE_bufsiz: + * This macro is used to determine the number of bytes in the I/O + * buffer pointed to by _base field (or equivalent) of the FILE + * structure pointed to its argument. This macro will always be defined + * if USE_STDIO_BASE is defined. + */ +#define USE_STDIO_BASE /**/ +#ifdef USE_STDIO_BASE +#define FILE_base(fp) ((fp)->_base) +#define FILE_bufsiz(fp) ((fp)->_cnt + (fp)->_ptr - (fp)->_base) +#endif + +/* HAS_STRERROR: + * This symbol, if defined, indicates that the strerror routine is + * available to translate error numbers to strings. See the writeup + * of Strerror() in this file before you try to define your own. + */ +/* HAS_SYS_ERRLIST: + * This symbol, if defined, indicates that the sys_errlist array is + * available to translate error numbers to strings. The extern int + * sys_nerr gives the size of that table. + */ +/* Strerror: + * This preprocessor symbol is defined as a macro if strerror() is + * not available to translate error numbers to strings but sys_errlist[] + * array is there. + */ +#define HAS_STRERROR /**/ +#define HAS_SYS_ERRLIST /**/ +#define Strerror(e) strerror(e) + +/* HAS_STRTOLD: + * This symbol, if defined, indicates that the strtold routine is + * available to convert strings to long doubles. + */ +/*#define HAS_STRTOLD /**/ + +/* HAS_STRTOLL: + * This symbol, if defined, indicates that the strtoll routine is + * available to convert strings to long longs. + */ +/*#define HAS_STRTOLL /**/ + +/* HAS_STRTOULL: + * This symbol, if defined, indicates that the strtoull routine is + * available to convert strings to unsigned long longs. + */ +/*#define HAS_STRTOULL /**/ + +/* HAS_STRTOUQ: + * This symbol, if defined, indicates that the strtouq routine is + * available to convert strings to unsigned long longs (quads). + */ +/*#define HAS_STRTOUQ /**/ + +/* HAS_TELLDIR_PROTO: + * This symbol, if defined, indicates that the system provides + * a prototype for the telldir() function. Otherwise, it is up + * to the program to supply one. A good guess is + * extern long telldir _((DIR*)); + */ +#define HAS_TELLDIR_PROTO /**/ + +/* Time_t: + * This symbol holds the type returned by time(). It can be long, + * or time_t on BSD sites (in which case <sys/types.h> should be + * included). + */ +#define Time_t time_t /* Time type */ + +/* HAS_TIMES: + * This symbol, if defined, indicates that the times() routine exists. + * Note that this became obsolete on some systems (SUNOS), which now + * use getrusage(). It may be necessary to include <sys/times.h>. + */ +#define HAS_TIMES /**/ /* HAS_UNION_SEMUN: * This symbol, if defined, indicates that the union semun is @@ -1657,6 +2123,17 @@ /*#define USE_SEMCTL_SEMUN /**/ /*#define USE_SEMCTL_SEMID_DS /**/ +/* HAS_USTAT: + * This symbol, if defined, indicates that the ustat system call is + * available to query file system statistics by dev_t. + */ +/*#define HAS_USTAT /**/ + +/* HAS_VFORK: + * This symbol, if defined, indicates that vfork() exists. + */ +/*#define HAS_VFORK /**/ + /* Signal_t: * This symbol's value is either "void" or "int", corresponding to the * appropriate return type of a signal handler. Thus, you can declare @@ -1665,25 +2142,175 @@ */ #define Signal_t void /* Signal handler's return type */ +/* HAS_VPRINTF: + * This symbol, if defined, indicates that the vprintf routine is available + * to printf with a pointer to an argument list. If unavailable, you + * may need to write your own, probably in terms of _doprnt(). + */ +/* USE_CHAR_VSPRINTF: + * This symbol is defined if this system has vsprintf() returning type + * (char*). The trend seems to be to declare it as "int vsprintf()". It + * is up to the package author to declare vsprintf correctly based on the + * symbol. + */ +#define HAS_VPRINTF /**/ +/*#define USE_CHAR_VSPRINTF /**/ + +/* USE_DYNAMIC_LOADING: + * This symbol, if defined, indicates that dynamic loading of + * some sort is available. + */ +#define USE_DYNAMIC_LOADING /**/ + +/* DOUBLESIZE: + * This symbol contains the size of a double, so that the C preprocessor + * can make decisions based on it. + */ +#define DOUBLESIZE 8 /**/ + +/* EBCDIC: + * This symbol, if defined, indicates that this system uses + * EBCDIC encoding. + */ +/*#define EBCDIC /**/ + +/* FFLUSH_NULL: + * This symbol, if defined, tells that fflush(NULL) does flush + * all pending stdio output. + */ +/* FFLUSH_ALL: + * This symbol, if defined, tells that to flush + * all pending stdio output one must loop through all + * the stdio file handles stored in an array and fflush them. + * Note that if fflushNULL is defined, fflushall will not + * even be probed for and will be left undefined. + */ +#define FFLUSH_NULL /**/ +/*#define FFLUSH_ALL /**/ + +/* Fpos_t: + * This symbol holds the type used to declare file positions in libc. + * It can be fpos_t, long, uint, etc... It may be necessary to include + * <sys/types.h> to get any typedef'ed information. + */ +#define Fpos_t fpos_t /* File position type */ + +/* Gid_t_f: + * This symbol defines the format string used for printing a Gid_t. + */ +#define Gid_t_f "ld" /**/ + +/* Gid_t_sign: + * This symbol holds the signedess of a Gid_t. + * 1 for unsigned, -1 for signed. + */ +#define Gid_t_sign -1 /* GID sign */ + +/* Gid_t_size: + * This symbol holds the size of a Gid_t in bytes. + */ +#define Gid_t_size 4 /* GID size */ + +/* Gid_t: + * This symbol holds the return type of getgid() and the type of + * argument to setrgid() and related functions. Typically, + * it is the type of group ids in the kernel. It can be int, ushort, + * gid_t, etc... It may be necessary to include <sys/types.h> to get + * any typedef'ed information. + */ +#define Gid_t gid_t /* Type for getgid(), etc... */ + /* Groups_t: * This symbol holds the type used for the second argument to - * getgroups() and setgropus(). Usually, this is the same as + * getgroups() and setgroups(). Usually, this is the same as * gidtype (gid_t) , but sometimes it isn't. - * It can be int, ushort, uid_t, etc... + * It can be int, ushort, gid_t, etc... * It may be necessary to include <sys/types.h> to get any * typedef'ed information. This is only required if you have - * getgroups() or setgropus().. + * getgroups() or setgroups().. */ #if defined(HAS_GETGROUPS) || defined(HAS_SETGROUPS) #define Groups_t gid_t /* Type for 2nd arg to [sg]etgroups() */ #endif +/* DB_Prefix_t: + * This symbol contains the type of the prefix structure element + * in the <db.h> header file. In older versions of DB, it was + * int, while in newer ones it is u_int32_t. + */ +/* DB_Hash_t: + * This symbol contains the type of the prefix structure element + * in the <db.h> header file. In older versions of DB, it was + * int, while in newer ones it is size_t. + */ +#define DB_Hash_t int /**/ +#define DB_Prefix_t int /**/ + +/* I_GRP: + * This symbol, if defined, indicates to the C program that it should + * include <grp.h>. + */ +/* GRPASSWD: + * This symbol, if defined, indicates to the C program that struct group + * in <grp.h> contains gr_passwd. + */ +/*#define I_GRP /**/ +/*#define GRPASSWD /**/ + +/* I_ICONV: + * This symbol, if defined, indicates that <iconv.h> exists and + * should be included. + */ +/*#define I_ICONV /**/ + +/* I_IEEEFP: + * This symbol, if defined, indicates that <ieeefp.h> exists and + * should be included. + */ +/*#define I_IEEEFP /**/ + +/* I_INTTYPES: + * This symbol, if defined, indicates to the C program that it should + * include <inttypes.h>. + */ +/*#define I_INTTYPES /**/ + +/* I_MACH_CTHREADS: + * This symbol, if defined, indicates to the C program that it should + * include <mach/cthreads.h>. + */ +/*#define I_MACH_CTHREADS /**/ + +/* I_MNTENT: + * This symbol, if defined, indicates that <mntent.h> exists and + * should be included. + */ +/*#define I_MNTENT /**/ + /* I_NETDB: * This symbol, if defined, indicates that <netdb.h> exists and * should be included. */ /*#define I_NETDB /**/ +/* I_NETINET_TCP: + * This symbol, if defined, indicates to the C program that it should + * include <netinet/tcp.h>. + */ +/*#define I_NETINET_TCP /**/ + +/* I_POLL: + * This symbol, if defined, indicates that <poll.h> exists and + * should be included. + */ +/*#define I_POLL /**/ + +/* I_PTHREAD: + * This symbol, if defined, indicates to the C program that it should + * include <pthread.h>. + */ +/*#define I_PTHREAD /**/ + /* I_PWD: * This symbol, if defined, indicates to the C program that it should * include <pwd.h>. @@ -1720,18 +2347,6 @@ * This symbol, if defined, indicates to the C program that struct passwd * contains pw_passwd. */ -/* HAS_SETPWENT: - * This symbol, if defined, indicates that the getpwrent routine is - * available for initializing sequential access of the passwd database. - */ -/* HAS_GETPWENT: - * This symbol, if defined, indicates that the getpwent routine is - * available for sequential access of the password database. - */ -/* HAS_ENDPWENT: - * This symbol, if defined, indicates that the getpwent routine is - * available for finalizing sequential access of the passwd database. - */ /*#define I_PWD /**/ /*#define PWQUOTA /**/ /*#define PWAGE /**/ @@ -1741,9 +2356,134 @@ /*#define PWCOMMENT /**/ /*#define PWGECOS /**/ /*#define PWPASSWD /**/ -/*#define HAS_SETPWENT /**/ -/*#define HAS_GETPWENT /**/ -/*#define HAS_ENDPWENT /**/ + +/* I_SHADOW: + * This symbol, if defined, indicates that <shadow.h> exists and + * should be included. + */ +/*#define I_SHADOW /**/ + +/* I_SOCKS: + * This symbol, if defined, indicates that <socks.h> exists and + * should be included. + */ +/*#define I_SOCKS /**/ + +/* I_SUNMATH: + * This symbol, if defined, indicates that <sunmath.h> exists and + * should be included. + */ +/*#define I_SUNMATH /**/ + +/* I_SYSLOG: + * This symbol, if defined, indicates that <syslog.h> exists and + * should be included. + */ +/*#define I_SYSLOG /**/ + +/* I_SYSMODE: + * This symbol, if defined, indicates that <sys/mode.h> exists and + * should be included. + */ +/*#define I_SYSMODE /**/ + +/* I_SYS_MOUNT: + * This symbol, if defined, indicates that <sys/mount.h> exists and + * should be included. + */ +/*#define I_SYS_MOUNT /**/ + +/* I_SYS_STATFS: + * This symbol, if defined, indicates that <sys/statfs.h> exists. + */ +/*#define I_SYS_STATFS /**/ + +/* I_SYS_STATVFS: + * This symbol, if defined, indicates that <sys/statvfs.h> exists and + * should be included. + */ +/*#define I_SYS_STATVFS /**/ + +/* I_SYSUIO: + * This symbol, if defined, indicates that <sys/uio.h> exists and + * should be included. + */ +/*#define I_SYSUIO /**/ + +/* I_SYSUTSNAME: + * This symbol, if defined, indicates that <sys/utsname.h> exists and + * should be included. + */ +/*#define I_SYSUTSNAME /**/ + +/* I_SYS_VFS: + * This symbol, if defined, indicates that <sys/vfs.h> exists and + * should be included. + */ +/*#define I_SYS_VFS /**/ + +/* I_TIME: + * This symbol, if defined, indicates to the C program that it should + * include <time.h>. + */ +/* I_SYS_TIME: + * This symbol, if defined, indicates to the C program that it should + * include <sys/time.h>. + */ +/* I_SYS_TIME_KERNEL: + * This symbol, if defined, indicates to the C program that it should + * include <sys/time.h> with KERNEL defined. + */ +#define I_TIME /**/ +/*#define I_SYS_TIME /**/ +/*#define I_SYS_TIME_KERNEL /**/ + +/* I_USTAT: + * This symbol, if defined, indicates that <ustat.h> exists and + * should be included. + */ +/*#define I_USTAT /**/ + +/* PERL_INC_VERSION_LIST: + * This variable specifies the list of subdirectories in over + * which perl.c:incpush() and lib/lib.pm will automatically + * search when adding directories to @INC, in a format suitable + * for a C initialization string. See the inc_version_list entry + * in Porting/Glossary for more details. + */ +#define PERL_INC_VERSION_LIST 0 /**/ + +/* INSTALL_USR_BIN_PERL: + * This symbol, if defined, indicates that Perl is to be installed + * also as /usr/bin/perl. + */ +/*#define INSTALL_USR_BIN_PERL /**/ + +/* PERL_PRIfldbl: + * This symbol, if defined, contains the string used by stdio to + * format long doubles (format 'f') for output. + */ +/* PERL_PRIgldbl: + * This symbol, if defined, contains the string used by stdio to + * format long doubles (format 'g') for output. + */ +/*#define PERL_PRIfldbl "f" /**/ +/*#define PERL_PRIgldbl "g" /**/ + +/* Off_t: + * This symbol holds the type used to declare offsets in the kernel. + * It can be int, long, off_t, etc... It may be necessary to include + * <sys/types.h> to get any typedef'ed information. + */ +/* LSEEKSIZE: + * This symbol holds the number of bytes used by the Off_t. + */ +/* Off_t_size: + * This symbol holds the number of bytes used by the Off_t. + */ +#define Off_t off_t /* <offset> type */ +#define LSEEKSIZE 4 /* <offset> size */ +#define Off_t_size 4 /* <offset> size */ /* Free_t: * This variable contains the return type of free(). It is usually @@ -1760,6 +2500,247 @@ */ /*#define MYMALLOC /**/ +/* Mode_t: + * This symbol holds the type used to declare file modes + * for systems calls. It is usually mode_t, but may be + * int or unsigned short. It may be necessary to include <sys/types.h> + * to get any typedef'ed information. + */ +#define Mode_t mode_t /* file mode parameter for system calls */ + +/* VAL_O_NONBLOCK: + * This symbol is to be used during open() or fcntl(F_SETFL) to turn on + * non-blocking I/O for the file descriptor. Note that there is no way + * back, i.e. you cannot turn it blocking again this way. If you wish to + * alternatively switch between blocking and non-blocking, use the + * ioctl(FIOSNBIO) call instead, but that is not supported by all devices. + */ +/* VAL_EAGAIN: + * This symbol holds the errno error code set by read() when no data was + * present on the non-blocking file descriptor. + */ +/* RD_NODATA: + * This symbol holds the return code from read() when no data is present + * on the non-blocking file descriptor. Be careful! If EOF_NONBLOCK is + * not defined, then you can't distinguish between no data and EOF by + * issuing a read(). You'll have to find another way to tell for sure! + */ +/* EOF_NONBLOCK: + * This symbol, if defined, indicates to the C program that a read() on + * a non-blocking file descriptor will return 0 on EOF, and not the value + * held in RD_NODATA (-1 usually, in that case!). + */ +#define VAL_O_NONBLOCK O_NONBLOCK +#define VAL_EAGAIN EAGAIN +#define RD_NODATA -1 +#define EOF_NONBLOCK + +/* Netdb_host_t: + * This symbol holds the type used for the 1st argument + * to gethostbyaddr(). + */ +/* Netdb_hlen_t: + * This symbol holds the type used for the 2nd argument + * to gethostbyaddr(). + */ +/* Netdb_name_t: + * This symbol holds the type used for the argument to + * gethostbyname(). + */ +/* Netdb_net_t: + * This symbol holds the type used for the 1st argument to + * getnetbyaddr(). + */ +#define Netdb_host_t char * /**/ +#define Netdb_hlen_t int /**/ +#define Netdb_name_t char * /**/ +#define Netdb_net_t long /**/ + +/* IVTYPE: + * This symbol defines the C type used for Perl's IV. + */ +/* UVTYPE: + * This symbol defines the C type used for Perl's UV. + */ +/* I8TYPE: + * This symbol defines the C type used for Perl's I8. + */ +/* U8TYPE: + * This symbol defines the C type used for Perl's U8. + */ +/* I16TYPE: + * This symbol defines the C type used for Perl's I16. + */ +/* U16TYPE: + * This symbol defines the C type used for Perl's U16. + */ +/* I32TYPE: + * This symbol defines the C type used for Perl's I32. + */ +/* U32TYPE: + * This symbol defines the C type used for Perl's U32. + */ +/* I64TYPE: + * This symbol defines the C type used for Perl's I64. + */ +/* U64TYPE: + * This symbol defines the C type used for Perl's U64. + */ +/* NVTYPE: + * This symbol defines the C type used for Perl's NV. + */ +/* IVSIZE: + * This symbol contains the sizeof(IV). + */ +/* UVSIZE: + * This symbol contains the sizeof(UV). + */ +/* I8SIZE: + * This symbol contains the sizeof(I8). + */ +/* U8SIZE: + * This symbol contains the sizeof(U8). + */ +/* I16SIZE: + * This symbol contains the sizeof(I16). + */ +/* U16SIZE: + * This symbol contains the sizeof(U16). + */ +/* I32SIZE: + * This symbol contains the sizeof(I32). + */ +/* U32SIZE: + * This symbol contains the sizeof(U32). + */ +/* I64SIZE: + * This symbol contains the sizeof(I64). + */ +/* U64SIZE: + * This symbol contains the sizeof(U64). + */ +/* NV_PRESERVES_UV: + * This symbol, if defined, indicates that a variable of type NVTYPE + * can preserve all the bit of a variable of type UVSIZE. + */ +#define IVTYPE long /**/ +#define UVTYPE unsigned long /**/ +#define I8TYPE char /**/ +#define U8TYPE unsigned char /**/ +#define I16TYPE short /**/ +#define U16TYPE unsigned short /**/ +#define I32TYPE long /**/ +#define U32TYPE unsigned long /**/ +#ifdef HAS_QUAD +#define I64TYPE __int64 /**/ +#define U64TYPE unsigned __int64 /**/ +#endif +#define NVTYPE double /**/ +#define IVSIZE 4 /**/ +#define UVSIZE 4 /**/ +#define I8SIZE 1 /**/ +#define U8SIZE 1 /**/ +#define I16SIZE 2 /**/ +#define U16SIZE 2 /**/ +#define I32SIZE 4 /**/ +#define U32SIZE 4 /**/ +#ifdef HAS_QUAD +#define I64SIZE 8 /**/ +#define U64SIZE 8 /**/ +#endif +#define NV_PRESERVES_UV + +/* IVdf: + * This symbol defines the format string used for printing a Perl IV + * as a signed decimal integer. + */ +/* UVuf: + * This symbol defines the format string used for printing a Perl UV + * as an unsigned decimal integer. + */ +/* UVof: + * This symbol defines the format string used for printing a Perl UV + * as an unsigned octal integer. + */ +/* UVxf: + * This symbol defines the format string used for printing a Perl UV + * as an unsigned hexadecimal integer. + */ +#define IVdf "ld" /**/ +#define UVuf "lu" /**/ +#define UVof "lo" /**/ +#define UVxf "lx" /**/ + +/* Pid_t: + * This symbol holds the type used to declare process ids in the kernel. + * It can be int, uint, pid_t, etc... It may be necessary to include + * <sys/types.h> to get any typedef'ed information. + */ +#define Pid_t int /* PID type */ + +/* PRIVLIB: + * This symbol contains the name of the private library for this package. + * The library is private in the sense that it needn't be in anyone's + * execution path, but it should be accessible by the world. The program + * should be prepared to do ~ expansion. + */ +/* PRIVLIB_EXP: + * This symbol contains the ~name expanded version of PRIVLIB, to be used + * in programs that are not prepared to deal with ~ expansion at run-time. + */ +#define PRIVLIB "c:\\perl\\5.6.0\\lib" /**/ +#define PRIVLIB_EXP (win32_get_privlib("5.6.0")) /**/ + +/* PTRSIZE: + * This symbol contains the size of a pointer, so that the C preprocessor + * can make decisions based on it. It will be sizeof(void *) if + * the compiler supports (void *); otherwise it will be + * sizeof(char *). + */ +#define PTRSIZE 4 /**/ + +/* Drand01: + * This macro is to be used to generate uniformly distributed + * random numbers over the range [0., 1.[. You may have to supply + * an 'extern double drand48();' in your program since SunOS 4.1.3 + * doesn't provide you with anything relevant in it's headers. + * See HAS_DRAND48_PROTO. + */ +/* Rand_seed_t: + * This symbol defines the type of the argument of the + * random seed function. + */ +/* seedDrand01: + * This symbol defines the macro to be used in seeding the + * random number generator (see Drand01). + */ +/* RANDBITS: + * This symbol indicates how many bits are produced by the + * function used to generate normalized random numbers. + * Values include 15, 16, 31, and 48. + */ +#define Drand01() (rand()/(double)((unsigned)1<<RANDBITS)) /**/ +#define Rand_seed_t unsigned /**/ +#define seedDrand01(x) srand((Rand_seed_t)x) /**/ +#define RANDBITS 15 /**/ + +/* SELECT_MIN_BITS: + * This symbol holds the minimum number of bits operated by select. + * That is, if you do select(n, ...), how many bits at least will be + * cleared in the masks if some activity is detected. Usually this + * is either n or 32*ceil(n/32), especially many little-endians do + * the latter. This is only useful if you have select(), naturally. + */ +#define SELECT_MIN_BITS 32 /**/ + +/* Select_fd_set_t: + * This symbol holds the type used for the 2nd, 3rd, and 4th + * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET + * is defined, and 'int *' otherwise. This is only useful if you + * have select(), of course. + */ +#define Select_fd_set_t Perl_fd_set * /**/ + /* SIG_NAME: * This symbol contains a list of signal names in order of * signal number. This is intended @@ -1788,95 +2769,8 @@ * The last element is 0, corresponding to the 0 at the end of * the sig_name list. */ -#define SIG_NAME "ZERO", "INT", "QUIT", "ILL", "FPE", "KILL", "SEGV", "PIPE", "ALRM", "TERM", "CHLD", "BREAK", "ABRT", "STOP", "CONT", "CLD", 0 /**/ -#define SIG_NUM 0, 2, 3, 4, 8, 9, 11, 13, 14, 15, 20, 21, 22, 23, 25, 20, 0 /**/ - -/* VOIDFLAGS: - * This symbol indicates how much support of the void type is given by this - * compiler. What various bits mean: - * - * 1 = supports declaration of void - * 2 = supports arrays of pointers to functions returning void - * 4 = supports comparisons between pointers to void functions and - * addresses of void functions - * 8 = suports declaration of generic void pointers - * - * The package designer should define VOIDUSED to indicate the requirements - * of the package. This can be done either by #defining VOIDUSED before - * including config.h, or by defining defvoidused in Myinit.U. If the - * latter approach is taken, only those flags will be tested. If the - * level of void support necessary is not present, defines void to int. - */ -#ifndef VOIDUSED -#define VOIDUSED 15 -#endif -#define VOIDFLAGS 15 -#if (VOIDFLAGS & VOIDUSED) != VOIDUSED -#define void int /* is void to be avoided? */ -#define M_VOID /* Xenix strikes again */ -#endif - -/* ARCHLIB: - * This variable, if defined, holds the name of the directory in - * which the user wants to put architecture-dependent public - * library files for perl5. It is most often a local directory - * such as /usr/local/lib. Programs using this variable must be - * prepared to deal with filename expansion. If ARCHLIB is the - * same as PRIVLIB, it is not defined, since presumably the - * program already searches PRIVLIB. - */ -/* ARCHLIB_EXP: - * This symbol contains the ~name expanded version of ARCHLIB, to be used - * in programs that are not prepared to deal with ~ expansion at run-time. - */ -#define ARCHLIB "c:\\perl\\5.00503\\lib\\MSWin32-x86" /**/ -/*#define ARCHLIB_EXP "" /**/ - -/* DLSYM_NEEDS_UNDERSCORE: - * This symbol, if defined, indicates that we need to prepend an - * underscore to the symbol name before calling dlsym(). This only - * makes sense if you *have* dlsym, which we will presume is the - * case if you're using dl_dlopen.xs. - */ -/*#define DLSYM_NEEDS_UNDERSCORE /**/ - -/* USE_SFIO: - * This symbol, if defined, indicates that sfio should - * be used. - */ -/*#define USE_SFIO /**/ - -/* USE_DYNAMIC_LOADING: - * This symbol, if defined, indicates that dynamic loading of - * some sort is available. - */ -#define USE_DYNAMIC_LOADING /**/ - -/* DB_Prefix_t: - * This symbol contains the type of the prefix structure element - * in the <db.h> header file. In older versions of DB, it was - * int, while in newer ones it is u_int32_t. - */ -/* DB_Hash_t: - * This symbol contains the type of the prefix structure element - * in the <db.h> header file. In older versions of DB, it was - * int, while in newer ones it is size_t. - */ -#define DB_Hash_t int /**/ -#define DB_Prefix_t int /**/ - -/* PRIVLIB: - * This symbol contains the name of the private library for this package. - * The library is private in the sense that it needn't be in anyone's - * execution path, but it should be accessible by the world. The program - * should be prepared to do ~ expansion. - */ -/* PRIVLIB_EXP: - * This symbol contains the ~name expanded version of PRIVLIB, to be used - * in programs that are not prepared to deal with ~ expansion at run-time. - */ -#define PRIVLIB "c:\\perl\\5.00503\\lib" /**/ -#define PRIVLIB_EXP (win32_get_privlib("5.00503")) /**/ +#define SIG_NAME "ZERO", "NUM01", "INT", "QUIT", "ILL", "NUM05", "NUM06", "NUM07", "FPE", "KILL", "NUM10", "SEGV", "NUM12", "PIPE", "ALRM", "TERM", "NUM16", "NUM17", "NUM18", "NUM19", "CHLD", "BREAK", "ABRT", "STOP", "NUM24", "CONT", "CLD", 0 /**/ +#define SIG_NUM 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 20, 0 /**/ /* SITEARCH: * This symbol contains the name of the private library for this package. @@ -1884,14 +2778,16 @@ * execution path, but it should be accessible by the world. The program * should be prepared to do ~ expansion. * The standard distribution will put nothing in this directory. - * Individual sites may place their own extensions and modules in - * this directory. + * After perl has been installed, users may install their own local + * architecture-dependent modules in this directory with + * MakeMaker Makefile.PL + * or equivalent. See INSTALL for details. */ /* SITEARCH_EXP: * This symbol contains the ~name expanded version of SITEARCH, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITEARCH "c:\\perl\\site\\5.00503\\lib\\MSWin32-x86" /**/ +#define SITEARCH "c:\\perl\\site\\5.6.0\\lib\\MSWin32-x86" /**/ /*#define SITEARCH_EXP "" /**/ /* SITELIB: @@ -1900,15 +2796,52 @@ * execution path, but it should be accessible by the world. The program * should be prepared to do ~ expansion. * The standard distribution will put nothing in this directory. - * Individual sites may place their own extensions and modules in - * this directory. + * After perl has been installed, users may install their own local + * architecture-independent modules in this directory with + * MakeMaker Makefile.PL + * or equivalent. See INSTALL for details. */ /* SITELIB_EXP: * This symbol contains the ~name expanded version of SITELIB, to be used * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define SITELIB "c:\\perl\\site\\5.00503\\lib" /**/ -#define SITELIB_EXP (win32_get_sitelib("5.00503")) /**/ +/* SITELIB_STEM: + * This define is SITELIB_EXP with any trailing version-specific component + * removed. The elements in inc_version_list (inc_version_list.U) can + * be tacked onto this variable to generate a list of directories to search. + */ +#define SITELIB "c:\\perl\\site\\5.6.0\\lib" /**/ +#define SITELIB_EXP (win32_get_sitelib("5.6.0")) /**/ +#define SITELIB_STEM "" /**/ + +/* Size_t_size: + * This symbol holds the size of a Size_t in bytes. + */ +#define Size_t_size 4 /**/ + +/* Size_t: + * This symbol holds the type used to declare length parameters + * for string functions. It is usually size_t, but may be + * unsigned long, int, etc. It may be necessary to include + * <sys/types.h> to get any typedef'ed information. + */ +#define Size_t size_t /* length paramater for string functions */ + +/* Sock_size_t: + * This symbol holds the type used for the size argument of + * various socket calls (just the base type, not the pointer-to). + */ +#define Sock_size_t int /**/ + +/* SSize_t: + * This symbol holds the type used by functions that return + * a count of bytes or an error condition. It must be a signed type. + * It is usually ssize_t, but may be long or int, etc. + * It may be necessary to include <sys/types.h> or <unistd.h> + * to get any typedef'ed information. + * We will pick a type such that sizeof(SSize_t) == sizeof(Size_t). + */ +#define SSize_t int /* signed count of bytes */ /* STARTPERL: * This variable contains the string to put in front of a perl @@ -1917,178 +2850,235 @@ */ #define STARTPERL "#!perl" /**/ -/* USE_PERLIO: - * This symbol, if defined, indicates that the PerlIO abstraction should - * be used throughout. If not defined, stdio should be - * used in a fully backward compatible manner. +/* HAS_STDIO_STREAM_ARRAY: + * This symbol, if defined, tells that there is an array + * holding the stdio streams. */ -/*#define USE_PERLIO /**/ - -/* HAS_GETHOST_PROTOS: - * This symbol, if defined, indicates that <netdb.h> includes - * prototypes for gethostent(), gethostbyname(), and - * gethostbyaddr(). Otherwise, it is up to the program to guess - * them. See netdbtype.U for probing for various Netdb_xxx_t types. +/* STDIO_STREAM_ARRAY: + * This symbol tells the name of the array holding the stdio streams. + * Usual values include _iob, __iob, and __sF. */ -#define HAS_GETHOST_PROTOS /**/ +/*#define HAS_STDIO_STREAM_ARRAY /**/ +#define STDIO_STREAM_ARRAY -/* HAS_GETNET_PROTOS: - * This symbol, if defined, indicates that <netdb.h> includes - * prototypes for getnetent(), getnetbyname(), and - * getnetbyaddr(). Otherwise, it is up to the program to guess - * them. See netdbtype.U for probing for various Netdb_xxx_t types. +/* Uid_t_f: + * This symbol defines the format string used for printing a Uid_t. */ -/*#define HAS_GETNET_PROTOS /**/ +#define Uid_t_f "ld" /**/ -/* HAS_GETPROTO_PROTOS: - * This symbol, if defined, indicates that <netdb.h> includes - * prototypes for getprotoent(), getprotobyname(), and - * getprotobyaddr(). Otherwise, it is up to the program to guess - * them. See netdbtype.U for probing for various Netdb_xxx_t types. +/* Uid_t_sign: + * This symbol holds the signedess of a Uid_t. + * 1 for unsigned, -1 for signed. */ -#define HAS_GETPROTO_PROTOS /**/ +#define Uid_t_sign -1 /* UID sign */ -/* HAS_GETSERV_PROTOS: - * This symbol, if defined, indicates that <netdb.h> includes - * prototypes for getservent(), getservbyname(), and - * getservbyaddr(). Otherwise, it is up to the program to guess - * them. See netdbtype.U for probing for various Netdb_xxx_t types. +/* Uid_t_size: + * This symbol holds the size of a Uid_t in bytes. */ -#define HAS_GETSERV_PROTOS /**/ +#define Uid_t_size 4 /* UID size */ -/* Netdb_host_t: - * This symbol holds the type used for the 1st argument - * to gethostbyaddr(). - */ -/* Netdb_hlen_t: - * This symbol holds the type used for the 2nd argument - * to gethostbyaddr(). - */ -/* Netdb_name_t: - * This symbol holds the type used for the argument to - * gethostbyname(). - */ -/* Netdb_net_t: - * This symbol holds the type used for the 1st argument to - * getnetbyaddr(). +/* Uid_t: + * This symbol holds the type used to declare user ids in the kernel. + * It can be int, ushort, uid_t, etc... It may be necessary to include + * <sys/types.h> to get any typedef'ed information. */ -#define Netdb_host_t char * /**/ -#define Netdb_hlen_t int /**/ -#define Netdb_name_t char * /**/ -#define Netdb_net_t long /**/ +#define Uid_t uid_t /* UID type */ -/* Select_fd_set_t: - * This symbol holds the type used for the 2nd, 3rd, and 4th - * arguments to select. Usually, this is 'fd_set *', if HAS_FD_SET - * is defined, and 'int *' otherwise. This is only useful if you - * have select(), of course. +/* USE_64_BIT_INT: + * This symbol, if defined, indicates that 64-bit integers should + * be used when available. If not defined, the native integers + * will be employed (be they 32 or 64 bits). The minimal possible + * 64-bitness is used, just enough to get 64-bit integers into Perl. + * This may mean using for example "long longs", while your memory + * may still be limited to 2 gigabytes. + */ +/* USE_64_BIT_ALL: + * This symbol, if defined, indicates that 64-bit integers should + * be used when available. If not defined, the native integers + * will be used (be they 32 or 64 bits). The maximal possible + * 64-bitness is employed: LP64 or ILP64, meaning that you will + * be able to use more than 2 gigabytes of memory. This mode is + * even more binary incompatible than USE_64_BIT_INT. You may not + * be able to run the resulting executable in a 32-bit CPU at all or + * you may need at least to reboot your OS to 64-bit mode. + */ +#ifndef USE_64_BIT_INT +/*#define USE_64_BIT_INT /**/ +#endif + +#ifndef USE_64_BIT_ALL +/*#define USE_64_BIT_ALL /**/ +#endif + +/* USE_LARGE_FILES: + * This symbol, if defined, indicates that large file support + * should be used when available. */ -#define Select_fd_set_t Perl_fd_set * /**/ +#ifndef USE_LARGE_FILES +/*#define USE_LARGE_FILES /**/ +#endif -/* ARCHNAME: - * This symbol holds a string representing the architecture name. - * It may be used to construct an architecture-dependant pathname - * where library files may be held under a private library, for - * instance. +/* USE_LONG_DOUBLE: + * This symbol, if defined, indicates that long doubles should + * be used when available. */ -#define ARCHNAME "MSWin32-x86" /**/ +#ifndef USE_LONG_DOUBLE +/*#define USE_LONG_DOUBLE /**/ +#endif -/* HAS_PTHREAD_YIELD: - * This symbol, if defined, indicates that the pthread_yield - * routine is available to yield the execution of the current - * thread. +/* USE_MORE_BITS: + * This symbol, if defined, indicates that 64-bit interfaces and + * long doubles should be used when available. */ -/* HAS_SCHED_YIELD: - * This symbol, if defined, indicates that the sched_yield - * routine is available to yield the execution of the current - * thread. +#ifndef USE_MORE_BITS +/*#define USE_MORE_BITS /**/ +#endif + +/* MULTIPLICITY: + * This symbol, if defined, indicates that Perl should + * be built to use multiplicity. */ -/*#define HAS_PTHREAD_YIELD /**/ -/*#define HAS_SCHED_YIELD /**/ +#ifndef MULTIPLICITY +/*#define MULTIPLICITY /**/ +#endif -/* PTHREADS_CREATED_JOINABLE: - * This symbol, if defined, indicates that pthreads are created - * in the joinable (aka undetached) state. +/* USE_PERLIO: + * This symbol, if defined, indicates that the PerlIO abstraction should + * be used throughout. If not defined, stdio should be + * used in a fully backward compatible manner. */ -/*#define PTHREADS_CREATED_JOINABLE /**/ +#ifndef USE_PERLIO +/*#define USE_PERLIO /**/ +#endif -/* USE_THREADS: +/* USE_SOCKS: * This symbol, if defined, indicates that Perl should - * be built to use threads. + * be built to use socks. + */ +#ifndef USE_SOCKS +/*#define USE_SOCKS /**/ +#endif + +/* USE_ITHREADS: + * This symbol, if defined, indicates that Perl should be built to + * use the interpreter-based threading implementation. + */ +/* USE_5005THREADS: + * This symbol, if defined, indicates that Perl should be built to + * use the 5.005-based threading implementation. */ /* OLD_PTHREADS_API: * This symbol, if defined, indicates that Perl should * be built to use the old draft POSIX threads API. */ -/*#define USE_THREADS /**/ +/*#define USE_5005THREADS /**/ +/*#define USE_ITHREADS /**/ +#if defined(USE_5005THREADS) && !defined(USE_ITHREADS) +#define USE_THREADS /* until src is revised*/ +#endif /*#define OLD_PTHREADS_API /**/ -/* Time_t: - * This symbol holds the type returned by time(). It can be long, - * or time_t on BSD sites (in which case <sys/types.h> should be - * included). +/* PERL_VENDORARCH: + * If defined, this symbol contains the name of a private library. + * The library is private in the sense that it needn't be in anyone's + * execution path, but it should be accessible by the world. + * It may have a ~ on the front. + * The standard distribution will put nothing in this directory. + * Vendors who distribute perl may wish to place their own + * architecture-dependent modules and extensions in this directory with + * MakeMaker Makefile.PL INSTALLDIRS=vendor + * or equivalent. See INSTALL for details. */ -#define Time_t time_t /* Time type */ - -/* HAS_TIMES: - * This symbol, if defined, indicates that the times() routine exists. - * Note that this became obsolete on some systems (SUNOS), which now - * use getrusage(). It may be necessary to include <sys/times.h>. +/* PERL_VENDORARCH_EXP: + * This symbol contains the ~name expanded version of PERL_VENDORARCH, to be used + * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define HAS_TIMES /**/ +/*#define PERL_VENDORARCH "" /**/ +/*#define PERL_VENDORARCH_EXP "" /**/ -/* Fpos_t: - * This symbol holds the type used to declare file positions in libc. - * It can be fpos_t, long, uint, etc... It may be necessary to include - * <sys/types.h> to get any typedef'ed information. - */ -#define Fpos_t fpos_t /* File position type */ - -/* Gid_t: - * This symbol holds the return type of getgid() and the type of - * argument to setrgid() and related functions. Typically, - * it is the type of group ids in the kernel. It can be int, ushort, - * uid_t, etc... It may be necessary to include <sys/types.h> to get - * any typedef'ed information. +/* PERL_VENDORLIB_EXP: + * This symbol contains the ~name expanded version of VENDORLIB, to be used + * in programs that are not prepared to deal with ~ expansion at run-time. */ -#define Gid_t gid_t /* Type for getgid(), etc... */ - -/* Off_t: - * This symbol holds the type used to declare offsets in the kernel. - * It can be int, long, off_t, etc... It may be necessary to include - * <sys/types.h> to get any typedef'ed information. +/* PERL_VENDORLIB_STEM: + * This define is PERL_VENDORLIB_EXP with any trailing version-specific component + * removed. The elements in inc_version_list (inc_version_list.U) can + * be tacked onto this variable to generate a list of directories to search. */ -#define Off_t off_t /* <offset> type */ +/*#define PERL_VENDORLIB_EXP "" /**/ +/*#define PERL_VENDORLIB_STEM "" /**/ -/* Mode_t: - * This symbol holds the type used to declare file modes - * for systems calls. It is usually mode_t, but may be - * int or unsigned short. It may be necessary to include <sys/types.h> - * to get any typedef'ed information. +/* VOIDFLAGS: + * This symbol indicates how much support of the void type is given by this + * compiler. What various bits mean: + * + * 1 = supports declaration of void + * 2 = supports arrays of pointers to functions returning void + * 4 = supports comparisons between pointers to void functions and + * addresses of void functions + * 8 = suports declaration of generic void pointers + * + * The package designer should define VOIDUSED to indicate the requirements + * of the package. This can be done either by #defining VOIDUSED before + * including config.h, or by defining defvoidused in Myinit.U. If the + * latter approach is taken, only those flags will be tested. If the + * level of void support necessary is not present, defines void to int. */ -#define Mode_t mode_t /* file mode parameter for system calls */ +#ifndef VOIDUSED +#define VOIDUSED 15 +#endif +#define VOIDFLAGS 15 +#if (VOIDFLAGS & VOIDUSED) != VOIDUSED +#define void int /* is void to be avoided? */ +#define M_VOID /* Xenix strikes again */ +#endif -/* Pid_t: - * This symbol holds the type used to declare process ids in the kernel. - * It can be int, uint, pid_t, etc... It may be necessary to include - * <sys/types.h> to get any typedef'ed information. - */ -#define Pid_t int /* PID type */ +/* PERL_XS_APIVERSION: + * This variable contains the version of the oldest perl binary + * compatible with the present perl. perl.c:incpush() and + * lib/lib.pm will automatically search in c:\\perl\\site\\5.6.0\\lib\\MSWin32-x86 for older + * directories across major versions back to xs_apiversion. + * This is only useful if you have a perl library directory tree + * structured like the default one. + * See INSTALL for how this works. + * The versioned site_perl directory was introduced in 5.005, + * so that is the lowest possible value. + * Since this can depend on compile time options (such as + * bincompat) it is set by Configure. Other non-default sources + * of potential incompatibility, such as multiplicity, threads, + * debugging, 64bits, sfio, etc., are not checked for currently, + * though in principle we could go snooping around in old + * Config.pm files. + */ +/* PERL_PM_APIVERSION: + * This variable contains the version of the oldest perl + * compatible with the present perl. (That is, pure perl modules + * written for pm_apiversion will still work for the current + * version). perl.c:incpush() and lib/lib.pm will automatically + * search in c:\\perl\\site\\5.6.0\\lib for older directories across major versions + * back to pm_apiversion. This is only useful if you have a perl + * library directory tree structured like the default one. The + * versioned site_perl library was introduced in 5.005, so that's + * the default setting for this variable. It's hard to imagine + * it changing before Perl6. It is included here for symmetry + * with xs_apiveprsion -- the searching algorithms will + * (presumably) be similar. + * See the INSTALL file for how this works. + */ +#define PERL_XS_APIVERSION "5.6.0" +#define PERL_PM_APIVERSION "5.005" -/* Size_t: - * This symbol holds the type used to declare length parameters - * for string functions. It is usually size_t, but may be - * unsigned long, int, etc. It may be necessary to include - * <sys/types.h> to get any typedef'ed information. +/* HAS_LCHOWN: + * This symbol, if defined, indicates that the lchown routine is + * available to operate on a symbolic link (instead of following the + * link). */ -#define Size_t size_t /* length paramater for string functions */ +/*#define HAS_LCHOWN /**/ -/* Uid_t: - * This symbol holds the type used to declare user ids in the kernel. - * It can be int, ushort, uid_t, etc... It may be necessary to include - * <sys/types.h> to get any typedef'ed information. +/* FLEXFILENAMES: + * This symbol, if defined, indicates that the system supports filenames + * longer than 14 characters. */ -#define Uid_t uid_t /* UID type */ +#define FLEXFILENAMES /**/ #endif -#include <win32.h> diff --git a/gnu/usr.bin/perl/win32/config_h.PL b/gnu/usr.bin/perl/win32/config_h.PL index 617b996cdb1..5b0450609ff 100644 --- a/gnu/usr.bin/perl/win32/config_h.PL +++ b/gnu/usr.bin/perl/win32/config_h.PL @@ -13,8 +13,8 @@ while (@ARGV && $ARGV[0] =~ /^([\w_]+)=(.*)$/) } my $patchlevel = $opt{INST_VER}; $patchlevel =~ s|^[\\/]||; -$patchlevel =~ s|~VERSION~|$]|g; -$patchlevel ||= $]; +$patchlevel =~ s|~VERSION~|$Config{version}|g; +$patchlevel ||= $Config{version}; $patchlevel = qq["$patchlevel"]; open(SH,"<$name") || die "Cannot open $name:$!"; @@ -49,18 +49,17 @@ while (<SH>) munge(); s/\\\$/\$/g; s#/[ *\*]*\*/#/**/#; - if (/^\s*#define\s+(PRIVLIB|SITELIB)_EXP/) + if (/^\s*#define\s+(PRIVLIB|SITELIB|VENDORLIB)_EXP/) { $_ = "#define ". $1 . "_EXP (win32_get_". lc($1) . "($patchlevel))\t/**/\n"; } # incpush() handles archlibs, so disable them - elsif (/^\s*#define\s+(ARCHLIB|SITEARCH)_EXP/) + elsif (/^\s*#define\s+(ARCHLIB|SITEARCH|VENDORARCH)_EXP/) { $_ = "/*#define ". $1 . "_EXP \"\"\t/**/\n"; } print H; } -print H "#include <win32.h>\n"; close(H); close(SH); diff --git a/gnu/usr.bin/perl/win32/config_sh.PL b/gnu/usr.bin/perl/win32/config_sh.PL index 1d4b2fb5c35..0e1d351c1a8 100644 --- a/gnu/usr.bin/perl/win32/config_sh.PL +++ b/gnu/usr.bin/perl/win32/config_sh.PL @@ -10,20 +10,53 @@ sub mungepath { return join(' ', @p); } +# generate an array of option strings from command-line args +# or an option file +# -- added by BKS, 10-17-1999 to fix command-line overflow problems +sub loadopts { + if ($ARGV[0] =~ /--cfgsh-option-file/) { + shift @ARGV; + my $optfile = shift @ARGV; + local (*F); + open OPTF, $optfile or die "Can't open $optfile: $!\n"; + my @opts; + chomp(my $line = <OPTF>); + my @vars = split(/\t+~\t+/, $line); + for (@vars) { + push(@opts, $_) unless (/^\s*$/); + } + close OPTF; + return \@opts; + } + else { + return \@ARGV; + } +} + my %opt; -while (@ARGV && $ARGV[0] =~ /^([\w_]+)=(.*)$/) - { - $opt{$1}=$2; - shift(@ARGV); - } - -$opt{VERSION} = $]; -$opt{INST_VER} =~ s|~VERSION~|$]|g; -if ($] =~ /\.(\d\d\d)?(\d\d)?$/) { # should always be true - $opt{PATCHLEVEL} = int($1 || 0); - $opt{SUBVERSION} = $2 || '00'; +my $optref = loadopts(); +while (@{$optref} && $optref->[0] =~ /^([\w_]+)=(.*)$/) { + $opt{$1}=$2; + shift(@{$optref}); } +my $pl_h = '../patchlevel.h'; + +if (-e $pl_h) { + open PL, "<$pl_h" or die "Can't open $pl_h: $!"; + while (<PL>) { + if (/^#\s*define\s+(PERL_\w+)\s+([\d.]+)/) { + $opt{$1} = $2; + } + } + close PL; +} +else { + die "Can't find $pl_h: $!"; +} +$opt{VERSION} = "$opt{PERL_REVISION}.$opt{PERL_VERSION}.$opt{PERL_SUBVERSION}"; +$opt{INST_VER} =~ s|~VERSION~|$opt{VERSION}|g; + $opt{'cf_by'} = $ENV{USERNAME} unless $opt{'cf_by'}; $opt{'cf_email'} = $opt{'cf_by'} . '@' . (gethostbyname('localhost'))[0] unless $opt{'cf_email'}; @@ -32,18 +65,19 @@ $opt{'usemymalloc'} = 'y' if $opt{'d_mymalloc'} eq 'define'; $opt{libpth} = mungepath($opt{libpth}) if exists $opt{libpth}; $opt{incpath} = mungepath($opt{incpath}) if exists $opt{incpath}; -while (<>) - { - s/~([\w_]+)~/$opt{$1}/g; - if (/^([\w_]+)=(.*)$/) { - # this depends on cf_time being empty in the template (or we'll get a loop) - if ($1 eq 'cf_time') { - $_ = "$1='" . localtime(time) . "'\n" if $2 =~ /^\s*'\s*'/; +while (<>) { + s/~([\w_]+)~/$opt{$1}/g; + if (/^([\w_]+)=(.*)$/) { + my($k,$v) = ($1,$2); + # this depends on cf_time being empty in the template (or we'll + # get a loop) + if ($k eq 'cf_time') { + $_ = "$k='" . localtime(time) . "'\n" if $v =~ /^\s*'\s*'/; + } + elsif (exists $opt{$k}) { + $_ = "$k='$opt{$k}'\n"; + } } - elsif (exists $opt{$1}) { - $_ = "$1='$opt{$1}'\n"; - } - } - print; - } + print; +} diff --git a/gnu/usr.bin/perl/win32/dl_win32.xs b/gnu/usr.bin/perl/win32/dl_win32.xs index c650acffb73..d959fbdae6d 100644 --- a/gnu/usr.bin/perl/win32/dl_win32.xs +++ b/gnu/usr.bin/perl/win32/dl_win32.xs @@ -24,6 +24,8 @@ calls. #include <windows.h> #include <string.h> +#define PERL_NO_GET_CONTEXT + #include "EXTERN.h" #include "perl.h" #include "win32.h" @@ -37,22 +39,22 @@ calls. static SV *error_sv; static char * -OS_Error_String(CPERLarg) +OS_Error_String(pTHXo) { DWORD err = GetLastError(); STRLEN len; if (!error_sv) - error_sv = newSVpv("",0); - win32_str_os_error(error_sv,err); + error_sv = newSVpvn("",0); + PerlProc_GetOSError(error_sv,err); return SvPV(error_sv,len); } #include "dlutils.c" /* SaveError() etc */ static void -dl_private_init(CPERLarg) +dl_private_init(pTHXo) { - (void)dl_generic_private_init(PERL_OBJECT_THIS); + (void)dl_generic_private_init(aTHXo); } /* @@ -94,7 +96,7 @@ dl_static_linked(char *filename) MODULE = DynaLoader PACKAGE = DynaLoader BOOT: - (void)dl_private_init(PERL_OBJECT_THIS); + (void)dl_private_init(aTHXo); void * dl_load_file(filename,flags=0) @@ -102,33 +104,35 @@ dl_load_file(filename,flags=0) int flags PREINIT: CODE: - DLDEBUG(1,PerlIO_printf(PerlIO_stderr(),"dl_load_file(%s):\n", filename)); - if (dl_static_linked(filename) == 0) - RETVAL = (void*) LoadLibraryEx(filename, NULL, LOAD_WITH_ALTERED_SEARCH_PATH ) ; + { + DLDEBUG(1,PerlIO_printf(Perl_debug_log,"dl_load_file(%s):\n", filename)); + if (dl_static_linked(filename) == 0) { + RETVAL = PerlProc_DynaLoad(filename); + } else RETVAL = (void*) GetModuleHandle(NULL); - DLDEBUG(2,PerlIO_printf(PerlIO_stderr()," libref=%x\n", RETVAL)); + DLDEBUG(2,PerlIO_printf(Perl_debug_log," libref=%x\n", RETVAL)); ST(0) = sv_newmortal() ; if (RETVAL == NULL) - SaveError(PERL_OBJECT_THIS_ "load_file:%s", - OS_Error_String(PERL_OBJECT_THIS)) ; + SaveError(aTHXo_ "load_file:%s", + OS_Error_String(aTHXo)) ; else sv_setiv( ST(0), (IV)RETVAL); - + } void * dl_find_symbol(libhandle, symbolname) void * libhandle char * symbolname CODE: - DLDEBUG(2,PerlIO_printf(PerlIO_stderr(),"dl_find_symbol(handle=%x, symbol=%s)\n", + DLDEBUG(2,PerlIO_printf(Perl_debug_log,"dl_find_symbol(handle=%x, symbol=%s)\n", libhandle, symbolname)); RETVAL = (void*) GetProcAddress((HINSTANCE) libhandle, symbolname); - DLDEBUG(2,PerlIO_printf(PerlIO_stderr()," symbolref = %x\n", RETVAL)); + DLDEBUG(2,PerlIO_printf(Perl_debug_log," symbolref = %x\n", RETVAL)); ST(0) = sv_newmortal() ; if (RETVAL == NULL) - SaveError(PERL_OBJECT_THIS_ "find_symbol:%s", - OS_Error_String(PERL_OBJECT_THIS)) ; + SaveError(aTHXo_ "find_symbol:%s", + OS_Error_String(aTHXo)) ; else sv_setiv( ST(0), (IV)RETVAL); @@ -147,9 +151,11 @@ dl_install_xsub(perl_name, symref, filename="$Package") void * symref char * filename CODE: - DLDEBUG(2,PerlIO_printf(PerlIO_stderr(),"dl_install_xsub(name=%s, symref=%x)\n", + DLDEBUG(2,PerlIO_printf(Perl_debug_log,"dl_install_xsub(name=%s, symref=%x)\n", perl_name, symref)); - ST(0)=sv_2mortal(newRV((SV*)newXS(perl_name, (void(*)(CV* _CPERLarg))symref, filename))); + ST(0) = sv_2mortal(newRV((SV*)newXS(perl_name, + (void(*)(pTHXo_ CV *))symref, + filename))); char * diff --git a/gnu/usr.bin/perl/win32/genxsdef.pl b/gnu/usr.bin/perl/win32/genxsdef.pl deleted file mode 100644 index b00a57e7787..00000000000 --- a/gnu/usr.bin/perl/win32/genxsdef.pl +++ /dev/null @@ -1,5 +0,0 @@ -print "LIBRARY $ARGV[0]\n"; -print "CODE LOADONCALL\n"; -print "DATA LOADONCALL NONSHARED MULTIPLE\n"; -print "EXPORTS\n"; -print "\tboot_$ARGV[0]\n" diff --git a/gnu/usr.bin/perl/win32/include/dirent.h b/gnu/usr.bin/perl/win32/include/dirent.h index be363ce8044..a66901234fe 100644 --- a/gnu/usr.bin/perl/win32/include/dirent.h +++ b/gnu/usr.bin/perl/win32/include/dirent.h @@ -1,49 +1,53 @@ -// dirent.h +/* dirent.h */ -// djl -// Provide UNIX compatibility +/* djl + * Provide UNIX compatibility + */ #ifndef _INC_DIRENT #define _INC_DIRENT -// -// NT versions of readdir(), etc -// From the MSDOS implementation -// +/* + * NT versions of readdir(), etc + * From the MSDOS implementation + */ -// Directory entry size +/* Directory entry size */ #ifdef DIRSIZ #undef DIRSIZ #endif #define DIRSIZ(rp) (sizeof(struct direct)) -// needed to compile directory stuff +/* needed to compile directory stuff */ #define DIRENT direct -// structure of a directory entry +/* structure of a directory entry */ typedef struct direct { - long d_ino; // inode number (not used by MS-DOS) - int d_namlen; // Name length - char d_name[257]; // file name + long d_ino; /* inode number (not used by MS-DOS) */ + long d_namlen; /* name length */ + char d_name[257]; /* file name */ } _DIRECT; -// structure for dir operations +/* structure for dir operations */ typedef struct _dir_struc { - char *start; // Starting position - char *curr; // Current position - long size; // Size of string table - long nfiles; // number if filenames in table - struct direct dirstr; // Directory structure to return + char *start; /* starting position */ + char *curr; /* current position */ + long size; /* allocated size of string table */ + long nfiles; /* number of filenames in table */ + struct direct dirstr; /* directory structure to return */ + void* handle; /* system handle */ + char *end; /* position after last filename */ } DIR; +#if 0 /* these have moved to win32iop.h */ DIR * win32_opendir(char *filename); struct direct * win32_readdir(DIR *dirp); long win32_telldir(DIR *dirp); void win32_seekdir(DIR *dirp,long loc); void win32_rewinddir(DIR *dirp); int win32_closedir(DIR *dirp); +#endif - -#endif //_INC_DIRENT +#endif /* _INC_DIRENT */ diff --git a/gnu/usr.bin/perl/win32/include/sys/socket.h b/gnu/usr.bin/perl/win32/include/sys/socket.h index 6ffb0ac269e..194de9581f8 100644 --- a/gnu/usr.bin/perl/win32/include/sys/socket.h +++ b/gnu/usr.bin/perl/win32/include/sys/socket.h @@ -47,9 +47,9 @@ typedef struct _OVERLAPPED { #endif #endif //_WINDOWS_ -#ifndef __GNUC__ +// #ifndef __GNUC__ #include <winsock.h> -#endif +// #endif #define ENOTSOCK WSAENOTSOCK #undef HOST_NOT_FOUND @@ -142,7 +142,6 @@ void win32_endprotoent(void); void win32_endservent(void); #ifndef WIN32SCK_IS_STDSCK -#ifndef PERL_OBJECT // // direct to our version // @@ -204,7 +203,6 @@ void win32_endservent(void); #define FD_ZERO(p) PERL_FD_ZERO(p) #endif /* USE_SOCKETS_AS_HANDLES */ -#endif /* PERL_OBJECT */ #endif /* WIN32SCK_IS_STDSCK */ #ifdef __cplusplus diff --git a/gnu/usr.bin/perl/win32/makedef.pl b/gnu/usr.bin/perl/win32/makedef.pl deleted file mode 100644 index a637ca1d46c..00000000000 --- a/gnu/usr.bin/perl/win32/makedef.pl +++ /dev/null @@ -1,559 +0,0 @@ -#!../miniperl - -# Written: 10 April 1996 Gary Ng (71564.1743@compuserve.com) - -# Create the export list for perl. -# Needed by WIN32 for creating perl.dll -# based on perl_exp.SH in the main perl distribution directory - -# This simple program relys on 'global.sym' being up to date -# with all of the global symbols that a dynamicly link library -# might want to access. - -# There is some symbol defined in global.sym and interp.sym -# that does not present in the WIN32 port but there is no easy -# way to find them so I just put a exception list here - -my $CCTYPE = "MSVC"; # default - -while (@ARGV) - { - my $flag = shift; - $define{$1} = 1 if ($flag =~ /^-D(\w+)$/); - $CCTYPE = $1 if ($flag =~ /^CCTYPE=(\w+)$/); - } - -open(CFG,'config.h') || die "Cannot open config.h:$!"; -while (<CFG>) - { - $define{$1} = 1 if /^\s*#\s*define\s+(MYMALLOC)\b/; - $define{$1} = 1 if /^\s*#\s*define\s+(USE_THREADS)\b/; - } -close(CFG); - -warn join(' ',keys %define)."\n"; - -if ($define{PERL_OBJECT}) { - print "LIBRARY PerlCore\n"; - print "DESCRIPTION 'Perl interpreter'\n"; - print "EXPORTS\n"; - output_symbol("perl_alloc"); - exit(0); -} - -if ($CCTYPE ne 'GCC') - { - print "LIBRARY Perl\n"; - print "DESCRIPTION 'Perl interpreter, export autogenerated'\n"; - } -else - { - $define{'PERL_GLOBAL_STRUCT'} = 1; - $define{'MULTIPLICITY'} = 1; - } - -print "EXPORTS\n"; - -my %skip; -my %export; - -sub skip_symbols -{ - my $list = shift; - foreach my $symbol (@$list) - { - $skip{$symbol} = 1; - } -} - -sub emit_symbols -{ - my $list = shift; - foreach my $symbol (@$list) - { - emit_symbol($symbol) unless exists $skip{$symbol}; - } -} - -skip_symbols [qw( -PL_statusvalue_vms -PL_archpat_auto -PL_cryptseen -PL_DBcv -PL_generation -PL_in_clean_all -PL_in_clean_objs -PL_lastgotoprobe -PL_linestart -PL_modcount -PL_pending_ident -PL_sortcxix -PL_sublex_info -PL_timesbuf -Perl_block_type -Perl_additem -Perl_cast_ulong -Perl_check_uni -Perl_checkcomma -Perl_chsize -Perl_ck_aelem -Perl_cx_dump -Perl_do_ipcctl -Perl_do_ipcget -Perl_do_msgrcv -Perl_do_msgsnd -Perl_do_semop -Perl_do_shmio -Perl_doeval -Perl_dofindlabel -Perl_dopoptoeval -Perl_dump_eval -Perl_dump_fds -Perl_dump_form -Perl_dump_gv -Perl_dump_mstats -Perl_dump_op -Perl_dump_packsubs -Perl_dump_pm -Perl_dump_sub -Perl_expectterm -Perl_fetch_gv -Perl_fetch_io -Perl_force_ident -Perl_force_next -Perl_force_word -Perl_hv_stashpv -Perl_intuit_more -Perl_init_thread_intern -Perl_know_next -Perl_modkids -Perl_mstats -Perl_my_bzero -Perl_my_htonl -Perl_my_ntohl -Perl_my_swap -Perl_my_chsize -Perl_newXSUB -Perl_no_fh_allowed -Perl_no_op -Perl_nointrp -Perl_nomem -Perl_pp_cswitch -Perl_pp_entersubr -Perl_pp_evalonce -Perl_pp_interp -Perl_pp_map -Perl_pp_nswitch -Perl_q -Perl_reall_srchlen -Perl_same_dirent -Perl_saw_return -Perl_scan_const -Perl_scan_formline -Perl_scan_heredoc -Perl_scan_ident -Perl_scan_inputsymbol -Perl_scan_pat -Perl_scan_prefix -Perl_scan_str -Perl_scan_subst -Perl_scan_trans -Perl_scan_word -Perl_setenv_getix -Perl_skipspace -Perl_sort_mutex -Perl_sublex_done -Perl_sublex_start -Perl_sv_ref -Perl_sv_setptrobj -Perl_too_few_arguments -Perl_too_many_arguments -Perl_unlnk -Perl_watch -Perl_yyname -Perl_yyrule -allgvs -curblock -curcsv -lastretstr -mystack_mark -perl_init_ext -perl_requirepv -stack -Perl_safexcalloc -Perl_safexmalloc -Perl_safexfree -Perl_safexrealloc -Perl_my_memcmp -Perl_my_memset -PL_cshlen -PL_cshname -PL_opsave -)]; - - -if ($define{'MYMALLOC'}) - { - skip_symbols [qw( - Perl_safefree - Perl_safemalloc - Perl_saferealloc - Perl_safecalloc)]; - emit_symbols [qw( - Perl_malloc - Perl_free - Perl_realloc - Perl_calloc)]; - } -else - { - skip_symbols [qw( - Perl_malloced_size)]; - } - -unless ($define{'USE_THREADS'}) - { - skip_symbols [qw( -PL_thr_key -PL_sv_mutex -PL_cred_mutex -PL_strtab_mutex -PL_svref_mutex -PL_malloc_mutex -PL_eval_mutex -PL_eval_cond -PL_eval_owner -PL_threads_mutex -PL_nthreads -PL_nthreads_cond -PL_threadnum -PL_threadsv_names -PL_thrsv -Perl_vtbl_mutex -Perl_getTHR -Perl_setTHR -Perl_condpair_magic -Perl_new_struct_thread -Perl_per_thread_magicals -Perl_thread_create -Perl_find_threadsv -Perl_unlock_condpair -Perl_magic_mutexfree -Perl_sv_iv -Perl_sv_nv -Perl_sv_true -Perl_sv_uv -Perl_sv_pvn -)]; - } - -unless ($define{'FAKE_THREADS'}) - { - skip_symbols [qw(PL_curthr)]; - } - -sub readvar -{ - my $file = shift; - open(VARS,$file) || die "Cannot open $file:$!"; - my @syms; - while (<VARS>) - { - # All symbols have a Perl_ prefix because that's what embed.h - # sticks in front of them. - push(@syms,"PL_".$1) if (/\bPERLVARI?C?\([IGT](\w+)/); - } - close(VARS); - return \@syms; -} - -if ($define{'USE_THREADS'} || $define{'MULTIPLICITY'}) - { - my $thrd = readvar("../thrdvar.h"); - skip_symbols $thrd; - } - -if ($define{'MULTIPLICITY'}) - { - my $interp = readvar("../intrpvar.h"); - skip_symbols $interp; - } - -if ($define{'PERL_GLOBAL_STRUCT'}) - { - my $global = readvar("../perlvars.h"); - skip_symbols $global; - emit_symbols [qw(Perl_GetVars)]; - emit_symbols [qw(PL_Vars PL_VarsPtr)] unless $CCTYPE eq 'GCC'; - } - -unless ($define{'DEBUGGING'}) - { - skip_symbols [qw( - Perl_deb - Perl_deb_growlevel - Perl_debop - Perl_debprofdump - Perl_debstack - Perl_debstackptrs - Perl_runops_debug - Perl_sv_peek - Perl_watchaddr - Perl_watchok)]; - } - -if ($define{'HAVE_DES_FCRYPT'}) - { - emit_symbols [qw(win32_crypt)]; - } - -open (GLOBAL, "<../global.sym") || die "failed to open global.sym" . $!; -while (<GLOBAL>) - { - next if (!/^[A-Za-z]/); - next if (/_amg[ \t]*$/); - # All symbols have a Perl_ prefix because that's what embed.h - # sticks in front of them. - chomp($_); - my $symbol = "Perl_$_"; - emit_symbol($symbol) unless exists $skip{$symbol}; - } -close(GLOBAL); - -# also add symbols from interp.sym -# They are only needed if -DMULTIPLICITY is not set but it -# doesn't hurt to include them anyway. -# these don't have Perl prefix - -unless ($define{'PERL_GLOBAL_STRUCT'}) - { - my $glob = readvar("../perlvars.h"); - emit_symbols $glob; - } - -unless ($define{'MULTIPLICITY'}) - { - my $glob = readvar("../intrpvar.h"); - emit_symbols $glob; - } - -unless ($define{'MULTIPLICITY'} || $define{'USE_THREADS'}) - { - my $glob = readvar("../thrdvar.h"); - emit_symbols $glob; - } - -while (<DATA>) { - my $symbol; - next if (!/^[A-Za-z]/); - next if (/^#/); - s/\r//g; - chomp($_); - $symbol = $_; - next if exists $skip{$symbol}; - emit_symbol($symbol); -} - -foreach my $symbol (sort keys %export) - { - output_symbol($symbol); - } - -sub emit_symbol { - my $symbol = shift; - chomp($symbol); - $export{$symbol} = 1; -} - -sub output_symbol { - my $symbol = shift; - if ($CCTYPE eq "BORLAND") { - # workaround Borland quirk by exporting both the straight - # name and a name with leading underscore. Note the - # alias *must* come after the symbol itself, if both - # are to be exported. (Linker bug?) - print "\t_$symbol\n"; - print "\t$symbol = _$symbol\n"; - } - elsif ($CCTYPE eq 'GCC') { - # Symbols have leading _ whole process is $%£"% slow - # so skip aliases for now - print "\t$symbol\n"; - } - else { - # for binary coexistence, export both the symbol and - # alias with leading underscore - print "\t$symbol\n"; - print "\t_$symbol = $symbol\n"; - } -} - -1; -__DATA__ -# extra globals not included above. -perl_init_i18nl10n -perl_init_ext -perl_alloc -perl_atexit -perl_construct -perl_destruct -perl_free -perl_parse -perl_run -perl_get_sv -perl_get_av -perl_get_hv -perl_get_cv -perl_call_argv -perl_call_pv -perl_call_method -perl_call_sv -perl_require_pv -perl_eval_pv -perl_eval_sv -perl_new_ctype -perl_new_collate -perl_new_numeric -perl_set_numeric_standard -perl_set_numeric_local -boot_DynaLoader -Perl_thread_create -win32_errno -win32_environ -win32_stdin -win32_stdout -win32_stderr -win32_ferror -win32_feof -win32_strerror -win32_fprintf -win32_printf -win32_vfprintf -win32_vprintf -win32_fread -win32_fwrite -win32_fopen -win32_fdopen -win32_freopen -win32_fclose -win32_fputs -win32_fputc -win32_ungetc -win32_getc -win32_fileno -win32_clearerr -win32_fflush -win32_ftell -win32_fseek -win32_fgetpos -win32_fsetpos -win32_rewind -win32_tmpfile -win32_abort -win32_fstat -win32_stat -win32_pipe -win32_popen -win32_pclose -win32_rename -win32_setmode -win32_lseek -win32_tell -win32_dup -win32_dup2 -win32_open -win32_close -win32_eof -win32_read -win32_write -win32_spawnvp -win32_mkdir -win32_rmdir -win32_chdir -win32_flock -win32_execv -win32_execvp -win32_htons -win32_ntohs -win32_htonl -win32_ntohl -win32_inet_addr -win32_inet_ntoa -win32_socket -win32_bind -win32_listen -win32_accept -win32_connect -win32_send -win32_sendto -win32_recv -win32_recvfrom -win32_shutdown -win32_closesocket -win32_ioctlsocket -win32_setsockopt -win32_getsockopt -win32_getpeername -win32_getsockname -win32_gethostname -win32_gethostbyname -win32_gethostbyaddr -win32_getprotobyname -win32_getprotobynumber -win32_getservbyname -win32_getservbyport -win32_select -win32_endhostent -win32_endnetent -win32_endprotoent -win32_endservent -win32_getnetent -win32_getnetbyname -win32_getnetbyaddr -win32_getprotoent -win32_getservent -win32_sethostent -win32_setnetent -win32_setprotoent -win32_setservent -win32_getenv -win32_putenv -win32_perror -win32_setbuf -win32_setvbuf -win32_flushall -win32_fcloseall -win32_fgets -win32_gets -win32_fgetc -win32_putc -win32_puts -win32_getchar -win32_putchar -win32_malloc -win32_calloc -win32_realloc -win32_free -win32_sleep -win32_times -win32_alarm -win32_open_osfhandle -win32_get_osfhandle -win32_ioctl -win32_utime -win32_wait -win32_waitpid -win32_kill -win32_str_os_error -win32_opendir -win32_readdir -win32_telldir -win32_seekdir -win32_rewinddir -win32_closedir -Perl_win32_init -Perl_init_os_extras -Perl_getTHR -Perl_setTHR -RunPerl - diff --git a/gnu/usr.bin/perl/win32/makefile.mk b/gnu/usr.bin/perl/win32/makefile.mk index 0c613d38cea..7ed23dd3be1 100644 --- a/gnu/usr.bin/perl/win32/makefile.mk +++ b/gnu/usr.bin/perl/win32/makefile.mk @@ -1,12 +1,12 @@ #
# Makefile to build perl on Windows NT using DMAKE.
# Supported compilers:
-# Visual C++ 2.0 thro 5.0
+# Visual C++ 2.0 thro 6.0
# Borland C++ 5.02
-# Mingw32 with gcc-2.8.1 or egcs-1.0.2 **experimental**
+# Mingw32 with gcc-2.95.2 or better **experimental**
#
# This is set up to build a perl.exe that runs off a shared library
-# (perl.dll). Also makes individual DLLs for the XS extensions.
+# (perl56.dll). Also makes individual DLLs for the XS extensions.
#
##
@@ -18,7 +18,7 @@ ##
#
-# Set these to wherever you want "nmake install" to put your
+# Set these to wherever you want "dmake install" to put your
# newly built perl.
#
INST_DRV *= c:
@@ -33,57 +33,95 @@ INST_TOP *= $(INST_DRV)\perl # versioned installation can be obtained by setting INST_TOP above to a
# path that includes an arbitrary version string.
#
-INST_VER *= \5.00503
+INST_VER *= \5.6.0
#
-# uncomment to enable threads-capabilities
+# Comment this out if you DON'T want your perl installation to have
+# architecture specific components. This means that architecture-
+# specific files will be installed along with the architecture-neutral
+# files. Leaving it enabled is safer and more flexible, in case you
+# want to build multiple flavors of perl and install them together in
+# the same location. Commenting it out gives you a simpler
+# installation that is easier to understand for beginners.
#
-#USE_THREADS *= define
+INST_ARCH *= \$(ARCHNAME)
#
-# uncomment to enable multiple interpreters
+# uncomment to enable multiple interpreters. This is need for fork()
+# emulation.
#
#USE_MULTI *= define
#
-# uncomment one
+# Beginnings of interpreter cloning/threads; still very incomplete.
+# This should be enabled to get the fork() emulation. This needs
+# USE_MULTI as well.
#
-#CCTYPE *= MSVC20
-#CCTYPE *= MSVC
-CCTYPE *= BORLAND
-#CCTYPE *= GCC
+#USE_ITHREADS *= define
#
-# uncomment next line if you want to use the perl object
-# Currently, this cannot be enabled if you ask for threads above, or
-# if you are using GCC or EGCS.
+# uncomment to enable the implicit "host" layer for all system calls
+# made by perl. This needs USE_MULTI above. This is also needed to
+# get fork().
#
-#OBJECT *= -DPERL_OBJECT
+#USE_IMP_SYS *= define
#
-# uncomment next line if you want debug version of perl (big,slow)
+# WARNING! This option is deprecated and will eventually go away (enable
+# USE_ITHREADS instead).
#
-#CFG *= Debug
+# uncomment to enable threads-capabilities. This is incompatible with
+# USE_ITHREADS, and is only here for people who may have come to rely
+# on the experimental Thread support that was in 5.005.
+#
+#USE_5005THREADS *= define
+
+#
+# WARNING! This option is deprecated and will eventually go away (enable
+# USE_MULTI instead).
+#
+# uncomment next line if you want to use the PERL_OBJECT build option.
+# DO NOT ENABLE unless you have legacy code that relies on the C++
+# CPerlObj class that was available in 5.005. This cannot be enabled
+# if you ask for USE_5005THREADS above.
+#
+#USE_OBJECT *= define
+
+#
+# uncomment exactly one of the following
+#
+# Visual C++ 2.x
+#CCTYPE *= MSVC20
+# Visual C++ > 2.x and < 6.x
+#CCTYPE *= MSVC
+# Visual C++ >= 6.x
+#CCTYPE *= MSVC60
+# Borland 5.02 or later
+#CCTYPE *= BORLAND
+# mingw32+gcc-2.95.2 or better
+CCTYPE *= GCC
#
-# uncomment next option if you want to use the VC++ compiler optimization.
-# This option is only relevant for the Microsoft compiler; we automatically
-# use maximum optimization with the other compilers (unless you specify a
-# DEBUGGING build).
-# Warning: This is known to produce incorrect code for compiler versions
-# earlier than VC++ 98 (Visual Studio 6.0). VC++ 98 generates code that
-# successfully passes the Perl regression test suite. It hasn't yet been
-# widely tested with real applications though.
+# uncomment this if you are compiling under Windows 95/98 and command.com
+# (not needed if you're running under 4DOS/NT 6.01 or later)
+#IS_WIN95 *= define
+
+#
+# uncomment next line if you want debug version of perl (big,slow)
+# If not enabled, we automatically try to use maximum optimization
+# with all compilers that are known to have a working optimizer.
#
-#CFG *= Optimize
+#CFG *= Debug
#
# uncomment to enable use of PerlCRT.DLL when using the Visual C compiler.
-# Highly recommended. It has patches that fix known bugs in MSVCRT.DLL.
-# This currently requires VC 5.0 with Service Pack 3.
+# It has patches that fix known bugs in older versions of MSVCRT.DLL.
+# This currently requires VC 5.0 with Service Pack 3 or later.
# Get it from CPAN at http://www.perl.com/CPAN/authors/id/D/DO/DOUGL/
# and follow the directions in the package to install.
#
+# Not recommended if you have VC 6.x and you're not running Windows 9x.
+#
#USE_PERLCRT *= define
#
@@ -114,7 +152,7 @@ CCTYPE *= BORLAND # WARNING: Turning this on/off WILL break binary compatibility with extensions
# you may have compiled with/without it. Be prepared to recompile all
# extensions if you change the default. Currently, this cannot be enabled
-# if you ask for PERL_OBJECT above.
+# if you ask for USE_IMP_SYS above.
#
#PERL_MALLOC *= define
@@ -125,13 +163,38 @@ CCTYPE *= BORLAND # so you may have to set CCHOME explicitly (spaces in the path name should
# not be quoted)
#
-#CCHOME *= f:\msdev\vc
-CCHOME *= C:\bc5
-#CCHOME *= D:\packages\mingw32
+#CCHOME *= c:\bc5
+#CCHOME *= $(MSVCDIR)
+CCHOME *= c:\gcc-2.95.2-msvcrt
CCINCDIR *= $(CCHOME)\include
CCLIBDIR *= $(CCHOME)\lib
#
+# Additional compiler flags can be specified here.
+#
+
+#
+# This should normally be disabled. Adding -DPERL_POLLUTE enables support
+# for old symbols by default, at the expense of extreme pollution. You most
+# probably just want to build modules that won't compile with
+# perl Makefile.PL POLLUTE=1
+# instead of enabling this. Please report such modules to the respective
+# authors.
+#
+#BUILDOPT += -DPERL_POLLUTE
+
+#
+# This should normally be disabled. Enabling it will disable the File::Glob
+# implementation of CORE::glob.
+#
+#BUILDOPT += -DPERL_EXTERNAL_GLOB
+
+#
+# This should normally be disabled. Enabling it causes perl to read scripts
+# in text mode (which is the 5.005 behavior) and will break ByteLoader.
+#BUILDOPT += -DPERL_TEXTMODE_SCRIPTS
+
+#
# specify semicolon-separated list of extra directories that modules will
# look for libraries (spaces in path names need not be quoted)
#
@@ -147,7 +210,7 @@ EXTRALIBDIRS *= # set this to your email address (perl will guess a value from
# from your loginname and your hostname, which may not be right)
#
-#EMAIL *=
+#EMAIL *=
##
## Build configuration ends.
@@ -162,35 +225,94 @@ D_CRYPT = define CRYPT_FLAG = -DHAVE_DES_FCRYPT
.ENDIF
-.IF "$(OBJECT)" != ""
+.IF "$(USE_OBJECT)" == "define"
PERL_MALLOC != undef
-USE_THREADS != undef
+USE_5005THREADS != undef
USE_MULTI != undef
+USE_IMP_SYS != define
.ENDIF
PERL_MALLOC *= undef
-USE_THREADS *= undef
+USE_5005THREADS *= undef
+
+.IF "$(USE_5005THREADS)" == "define"
+USE_ITHREADS != undef
+.ENDIF
+
+.IF "$(USE_IMP_SYS)" == "define"
+PERL_MALLOC != undef
+.ENDIF
+
USE_MULTI *= undef
+USE_OBJECT *= undef
+USE_ITHREADS *= undef
+USE_IMP_SYS *= undef
+USE_PERLCRT *= undef
-#BUILDOPT *= -DPERL_GLOBAL_STRUCT
-# -DUSE_PERLIO -D__STDC__=1 -DUSE_SFIO -DI_SFIO -I\sfio97\include
+.IF "$(USE_IMP_SYS)$(USE_MULTI)$(USE_5005THREADS)$(USE_OBJECT)" == "defineundefundefundef"
+USE_MULTI != define
+.ENDIF
+
+.IF "$(USE_ITHREADS)$(USE_MULTI)$(USE_OBJECT)" == "defineundefundef"
+USE_MULTI != define
+USE_5005THREADS != undef
+.ENDIF
+
+.IF "$(USE_MULTI)$(USE_5005THREADS)$(USE_OBJECT)" != "undefundefundef"
+BUILDOPT += -DPERL_IMPLICIT_CONTEXT
+.ENDIF
+
+.IF "$(USE_IMP_SYS)" != "undef"
+BUILDOPT += -DPERL_IMPLICIT_SYS
+.ENDIF
.IMPORT .IGNORE : PROCESSOR_ARCHITECTURE
PROCESSOR_ARCHITECTURE *= x86
-.IF "$(OBJECT)" != ""
+.IF "$(USE_OBJECT)" == "define"
ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-object
-.ELIF "$(USE_THREADS)" == "define"
+.ELIF "$(USE_5005THREADS)" == "define"
ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-thread
+.ELIF "$(USE_MULTI)" == "define"
+ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)-multi
.ELSE
ARCHNAME = MSWin32-$(PROCESSOR_ARCHITECTURE)
.ENDIF
+.IF "$(USE_ITHREADS)" == "define"
+ARCHNAME !:= $(ARCHNAME)-thread
+.ENDIF
+
+# Visual Studio 98 specific
+.IF "$(CCTYPE)" == "MSVC60"
+
+# VC 6.0 can load the socket dll on demand. Makes the test suite
+# run in about 10% less time.
+DELAYLOAD *= -DELAYLOAD:wsock32.dll -DELAYLOAD:shell32.dll delayimp.lib
+
+# VC 6.0 seems capable of compiling perl correctly with optimizations
+# enabled. Anything earlier fails tests.
+CFG *= Optimize
+.ENDIF
+
ARCHDIR = ..\lib\$(ARCHNAME)
COREDIR = ..\lib\CORE
AUTODIR = ..\lib\auto
+LIBDIR = ..\lib
+EXTDIR = ..\ext
+PODDIR = ..\pod
+EXTUTILSDIR = $(LIBDIR)\ExtUtils
+
+#
+INST_SCRIPT = $(INST_TOP)$(INST_VER)\bin
+INST_BIN = $(INST_SCRIPT)$(INST_ARCH)
+INST_LIB = $(INST_TOP)$(INST_VER)\lib
+INST_ARCHLIB = $(INST_LIB)$(INST_ARCH)
+INST_COREDIR = $(INST_ARCHLIB)\CORE
+INST_POD = $(INST_LIB)\pod
+INST_HTML = $(INST_POD)\html
#
# Programs to compile, build .lib files and link
@@ -204,14 +326,14 @@ CC = bcc32 LINK32 = tlink32
LIB32 = tlib /P128
IMPLIB = implib -c
+RSC = rc
#
# Options
#
-RUNTIME = -D_RTLDLL
INCLUDES = -I$(COREDIR) -I.\include -I. -I.. -I"$(CCINCDIR)"
#PCHFLAGS = -H -Hc -H=c:\temp\bcmoduls.pch
-DEFINES = -DWIN32 $(BUILDOPT) $(CRYPT_FLAG)
+DEFINES = -DWIN32 $(CRYPT_FLAG)
LOCDEFS = -DPERLDLL -DPERL_CORE
SUBSYS = console
CXX_FLAG = -P
@@ -220,16 +342,16 @@ LIBC = cw32mti.lib LIBFILES = $(CRYPT_LIB) import32.lib $(LIBC) odbc32.lib odbccp32.lib
.IF "$(CFG)" == "Debug"
-OPTIMIZE = -v $(RUNTIME) -DDEBUGGING
+OPTIMIZE = -v -D_RTLDLL -DDEBUGGING
LINK_DBG = -v
.ELSE
-OPTIMIZE = -O2 $(RUNTIME)
+OPTIMIZE = -O2 -D_RTLDLL
LINK_DBG =
.ENDIF
CFLAGS = -w -g0 -tWM -tWD $(INCLUDES) $(DEFINES) $(LOCDEFS) \
$(PCHFLAGS) $(OPTIMIZE)
-LINK_FLAGS = $(LINK_DBG) -L"$(CCLIBDIR)"
+LINK_FLAGS = $(LINK_DBG) -L"$(INST_COREDIR)" -L"$(CCLIBDIR)"
OBJOUT_FLAG = -o
EXEOUT_FLAG = -e
LIBOUT_FLAG =
@@ -240,6 +362,7 @@ CC = gcc LINK32 = gcc
LIB32 = ar rc
IMPLIB = dlltool
+RSC = rc
o = .o
a = .a
@@ -247,88 +370,88 @@ a = .a #
# Options
#
-RUNTIME =
+
INCLUDES = -I$(COREDIR) -I.\include -I. -I..
-DEFINES = -DWIN32 $(BUILDOPT) $(CRYPT_FLAG)
+DEFINES = -DWIN32 $(CRYPT_FLAG)
LOCDEFS = -DPERLDLL -DPERL_CORE
SUBSYS = console
CXX_FLAG = -xc++
-LIBC = -lcrtdll
-LIBFILES = $(CRYPT_LIB) -ladvapi32 -luser32 -lnetapi32 -lwsock32 \
- -lmingw32 -lgcc -lmoldname $(LIBC) -lkernel32
+LIBC = -lmsvcrt
+
+# same libs as MSVC
+LIBFILES = $(CRYPT_LIB) $(LIBC) \
+ -lmoldname -lkernel32 -luser32 -lgdi32 \
+ -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 \
+ -loleaut32 -lnetapi32 -luuid -lwsock32 -lmpr \
+ -lwinmm -lversion -lodbc32
.IF "$(CFG)" == "Debug"
-OPTIMIZE = -g -O2 $(RUNTIME) -DDEBUGGING
+OPTIMIZE = -g -DDEBUGGING
LINK_DBG = -g
.ELSE
-OPTIMIZE = -g -O2 $(RUNTIME)
+OPTIMIZE = -g -O2
LINK_DBG =
.ENDIF
CFLAGS = $(INCLUDES) $(DEFINES) $(LOCDEFS) $(OPTIMIZE)
-LINK_FLAGS = $(LINK_DBG) -L"$(CCLIBDIR)"
+LINK_FLAGS = $(LINK_DBG) -L"$(INST_COREDIR)" -L"$(CCLIBDIR)"
OBJOUT_FLAG = -o
EXEOUT_FLAG = -o
LIBOUT_FLAG =
+# NOTE: we assume that GCC uses MSVCRT.DLL
+BUILDOPT += -fno-strict-aliasing -DPERL_MSVCRT_READFIX
+
.ELSE
-CC = cl.exe
-LINK32 = link.exe
+CC = cl
+LINK32 = link
LIB32 = $(LINK32) -lib
+RSC = rc
#
# Options
#
-RUNTIME = -MD
INCLUDES = -I$(COREDIR) -I.\include -I. -I..
#PCHFLAGS = -Fpc:\temp\vcmoduls.pch -YX
-DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT $(BUILDOPT) $(CRYPT_FLAG)
+DEFINES = -DWIN32 -D_CONSOLE -DNO_STRICT $(CRYPT_FLAG)
LOCDEFS = -DPERLDLL -DPERL_CORE
SUBSYS = console
CXX_FLAG = -TP -GX
-.IF "$(USE_PERLCRT)" == ""
-.IF "$(CFG)" == "Debug"
-PERLCRTLIBC = msvcrtd.lib
-.ELSE
-PERLCRTLIBC = msvcrt.lib
-.ENDIF
-.ELSE
-.IF "$(CFG)" == "Debug"
-PERLCRTLIBC = PerlCRTD.lib
+.IF "$(USE_PERLCRT)" != "define"
+LIBC = msvcrt.lib
.ELSE
-PERLCRTLIBC = PerlCRT.lib
-.ENDIF
+LIBC = PerlCRT.lib
.ENDIF
-.IF "$(RUNTIME)" == "-MD"
-LIBC = $(PERLCRTLIBC)
-.ELSE
-LIBC = libcmt.lib
-.ENDIF
+PERLEXE_RES =
+PERLDLL_RES =
.IF "$(CFG)" == "Debug"
.IF "$(CCTYPE)" == "MSVC20"
-OPTIMIZE = -Od $(RUNTIME) -Z7 -D_DEBUG -DDEBUGGING
+OPTIMIZE = -Od -MD -Z7 -DDEBUGGING
.ELSE
-OPTIMIZE = -Od $(RUNTIME)d -Zi -D_DEBUG -DDEBUGGING
+OPTIMIZE = -Od -MD -Zi -DDEBUGGING
.ENDIF
LINK_DBG = -debug -pdb:none
.ELSE
.IF "$(CFG)" == "Optimize"
-OPTIMIZE = -O2 $(RUNTIME) -DNDEBUG
+# -O1 yields smaller code, which turns out to be faster than -O2
+#OPTIMIZE = -O2 -MD -DNDEBUG
+OPTIMIZE = -O1 -MD -DNDEBUG
.ELSE
-OPTIMIZE = -Od $(RUNTIME) -DNDEBUG
+OPTIMIZE = -Od -MD -DNDEBUG
.ENDIF
LINK_DBG = -release
.ENDIF
-LIBBASEFILES = $(CRYPT_LIB) oldnames.lib kernel32.lib user32.lib gdi32.lib \
- winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib \
- oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \
+LIBBASEFILES = $(CRYPT_LIB) \
+ oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib \
+ comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib \
+ netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \
version.lib odbc32.lib odbccp32.lib
# we add LIBC here, since we may be using PerlCRT.dll
@@ -336,18 +459,31 @@ LIBFILES = $(LIBBASEFILES) $(LIBC) CFLAGS = -nologo -Gf -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) \
$(PCHFLAGS) $(OPTIMIZE)
-LINK_FLAGS = -nologo -nodefaultlib $(LINK_DBG) -machine:$(PROCESSOR_ARCHITECTURE)
+LINK_FLAGS = -nologo -nodefaultlib $(LINK_DBG) \
+ -libpath:"$(INST_COREDIR)" \
+ -machine:$(PROCESSOR_ARCHITECTURE)
OBJOUT_FLAG = -Fo
EXEOUT_FLAG = -Fe
LIBOUT_FLAG = /out:
+.IF "$(USE_PERLCRT)" != "define"
+BUILDOPT += -DPERL_MSVCRT_READFIX
.ENDIF
-.IF "$(OBJECT)" != ""
+.ENDIF
+
+.IF "$(USE_OBJECT)" == "define"
OPTIMIZE += $(CXX_FLAG)
+BUILDOPT += -DPERL_OBJECT
.ENDIF
-CFLAGS_O = $(CFLAGS) $(OBJECT)
+CFLAGS_O = $(CFLAGS) $(BUILDOPT)
+
+# used to allow local linking flags that are not propogated into Config.pm,
+# currently unused
+# -- BKS, 12-12-1999
+PRIV_LINK_FLAGS *=
+BLINK_FLAGS = $(PRIV_LINK_FLAGS) $(LINK_FLAGS)
#################### do not edit below this line #######################
############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ##############
@@ -362,7 +498,7 @@ LKPOST = ) # Rules
#
-.SUFFIXES : .c $(o) .dll $(a) .exe
+.SUFFIXES : .c $(o) .dll $(a) .exe .rc .res
.c$(o):
$(CC) -c $(null,$(<:d) $(NULL) -I$(<:d)) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $<
@@ -372,32 +508,25 @@ LKPOST = ) $(o).dll:
.IF "$(CCTYPE)" == "BORLAND"
- $(LINK32) -Tpd -ap $(LINK_FLAGS) c0d32$(o) $<,$@,,$(LIBFILES),$(*B).def
+ $(LINK32) -Tpd -ap $(BLINK_FLAGS) c0d32$(o) $<,$@,,$(LIBFILES),$(*B).def
$(IMPLIB) $(*B).lib $@
.ELIF "$(CCTYPE)" == "GCC"
- $(LINK32) -o $@ $(LINK_FLAGS) $< $(LIBFILES)
- $(IMPLIB) -def $(*B).def $(*B).a $@
+ $(LINK32) -o $@ $(BLINK_FLAGS) $< $(LIBFILES)
+ $(IMPLIB) --input-def $(*B).def --output-lib $(*B).a $@
.ELSE
$(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \
- -out:$@ $(LINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
+ -out:$@ $(BLINK_FLAGS) $(LIBFILES) $< $(LIBPERL)
.ENDIF
-#
-INST_BIN = $(INST_TOP)$(INST_VER)\bin\$(ARCHNAME)
-INST_SCRIPT = $(INST_TOP)$(INST_VER)\bin
-INST_LIB = $(INST_TOP)$(INST_VER)\lib
-INST_POD = $(INST_LIB)\pod
-INST_HTML = $(INST_POD)\html
-LIBDIR = ..\lib
-EXTDIR = ..\ext
-PODDIR = ..\pod
-EXTUTILSDIR = $(LIBDIR)\extutils
+.rc.res:
+ $(RSC) -i.. $<
#
# various targets
MINIPERL = ..\miniperl.exe
MINIDIR = .\mini
PERLEXE = ..\perl.exe
+WPERLEXE = ..\wperl.exe
GLOBEXE = ..\perlglob.exe
CONFIGPM = ..\lib\Config.pm
MINIMOD = ..\lib\ExtUtils\Miniperl.pm
@@ -409,21 +538,24 @@ GLOBBAT = bin\perlglob.bat UTILS = \
..\utils\h2ph \
..\utils\splain \
+ ..\utils\dprofpp \
..\utils\perlbug \
..\utils\pl2pm \
..\utils\c2ph \
..\utils\h2xs \
..\utils\perldoc \
- ..\utils\pstruct \
..\utils\perlcc \
..\pod\checkpods \
..\pod\pod2html \
..\pod\pod2latex \
..\pod\pod2man \
..\pod\pod2text \
+ ..\pod\pod2usage \
+ ..\pod\podchecker \
+ ..\pod\podselect \
..\x2p\find2perl \
..\x2p\s2p \
- bin\www.pl \
+ bin\exetype.pl \
bin\runperl.pl \
bin\pl2bat.pl \
bin\perlglob.pl \
@@ -438,31 +570,17 @@ CFGH_TMPL = config_H.bc CFGSH_TMPL = config.gc
CFGH_TMPL = config_H.gc
-.IF "$(OBJECT)" == "-DPERL_OBJECT"
-PERLIMPLIB = ..\libperlcore$(a)
-.ELSE
-PERLIMPLIB = ..\libperl$(a)
-.ENDIF
+PERLIMPLIB = ..\libperl56$(a)
.ELSE
CFGSH_TMPL = config.vc
CFGH_TMPL = config_H.vc
-.IF "$(USE_PERLCRT)" == ""
-PERL95EXE = ..\perl95.exe
-.ENDIF
.ENDIF
-.IF "$(OBJECT)" == "-DPERL_OBJECT"
-PERLIMPLIB *= ..\perlcore$(a)
-PERLDLL = ..\perlcore.dll
-CAPILIB = $(COREDIR)\perlCAPI$(a)
-.ELSE
-PERLIMPLIB *= ..\perl$(a)
-PERLDLL = ..\perl.dll
-CAPILIB =
-.ENDIF
+PERLIMPLIB *= ..\perl56$(a)
+PERLDLL = ..\perl56.dll
XCOPY = xcopy /f /r /i /d
RCOPY = xcopy /f /r /i /e /d
@@ -476,7 +594,6 @@ XSUBPP = ..\$(MINIPERL) -I..\..\lib ..\$(EXTUTILSDIR)\xsubpp \ MICROCORE_SRC = \
..\av.c \
- ..\byterun.c \
..\deb.c \
..\doio.c \
..\doop.c \
@@ -487,6 +604,7 @@ MICROCORE_SRC = \ ..\mg.c \
..\op.c \
..\perl.c \
+ ..\perlapi.c \
..\perly.c \
..\pp.c \
..\pp_ctl.c \
@@ -500,44 +618,31 @@ MICROCORE_SRC = \ ..\taint.c \
..\toke.c \
..\universal.c \
- ..\util.c
+ ..\utf8.c \
+ ..\util.c \
+ ..\xsutils.c
+
+EXTRACORE_SRC += perllib.c
.IF "$(PERL_MALLOC)" == "define"
EXTRACORE_SRC += ..\malloc.c
.ENDIF
-.IF "$(OBJECT)" == ""
+.IF "$(USE_OBJECT)" != "define"
EXTRACORE_SRC += ..\perlio.c
.ENDIF
WIN32_SRC = \
.\win32.c \
- .\win32sck.c
-
-.IF "$(USE_THREADS)" == "define"
-WIN32_SRC += .\win32thread.c
-.ENDIF
+ .\win32sck.c \
+ .\win32thread.c
.IF "$(CRYPT_SRC)" != ""
WIN32_SRC += .\$(CRYPT_SRC)
.ENDIF
-PERL95_SRC = \
- perl95.c \
- win32mt.c \
- win32sckmt.c
-
-.IF "$(CRYPT_SRC)" != ""
-PERL95_SRC += .\$(CRYPT_SRC)
-.ENDIF
-
DLL_SRC = $(DYNALOADER).c
-
-.IF "$(OBJECT)" == ""
-DLL_SRC += perllib.c
-.ENDIF
-
X2P_SRC = \
..\x2p\a2p.c \
..\x2p\hash.c \
@@ -547,8 +652,6 @@ X2P_SRC = \ CORE_NOCFG_H = \
..\av.h \
- ..\byterun.h \
- ..\bytecode.h \
..\cop.h \
..\cv.h \
..\dosish.h \
@@ -563,6 +666,7 @@ CORE_NOCFG_H = \ ..\op.h \
..\opcode.h \
..\perl.h \
+ ..\perlapi.h \
..\perlsdio.h \
..\perlsfio.h \
..\perly.h \
@@ -573,7 +677,9 @@ CORE_NOCFG_H = \ ..\sv.h \
..\thread.h \
..\unixish.h \
+ ..\utf8.h \
..\util.h \
+ ..\warnings.h \
..\XSUB.h \
..\EXTERN.h \
..\perlvars.h \
@@ -592,26 +698,21 @@ WIN32_OBJ = $(WIN32_SRC:db:+$(o)) MINICORE_OBJ = $(MINIDIR)\{$(MICROCORE_OBJ:f) miniperlmain$(o) perlio$(o)}
MINIWIN32_OBJ = $(MINIDIR)\{$(WIN32_OBJ:f)}
MINI_OBJ = $(MINICORE_OBJ) $(MINIWIN32_OBJ)
-PERL95_OBJ = $(PERL95_SRC:db:+$(o))
DLL_OBJ = $(DLL_SRC:db:+$(o))
X2P_OBJ = $(X2P_SRC:db:+$(o))
PERLDLL_OBJ = $(CORE_OBJ)
PERLEXE_OBJ = perlmain$(o)
-.IF "$(OBJECT)" == ""
PERLDLL_OBJ += $(WIN32_OBJ) $(DLL_OBJ)
-.ELSE
-PERLEXE_OBJ += $(WIN32_OBJ) $(DLL_OBJ)
-PERL95_OBJ += DynaLoadmt$(o)
-.ENDIF
.IF "$(USE_SETARGV)" != ""
SETARGV_OBJ = setargv$(o)
.ENDIF
DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re \
- Data/Dumper
+ Data/Dumper Devel/Peek ByteLoader Devel/DProf File/Glob \
+ Sys/Hostname
STATIC_EXT = DynaLoader
NONXS_EXT = Errno
@@ -628,6 +729,11 @@ B = $(EXTDIR)\B\B RE = $(EXTDIR)\re\re
DUMPER = $(EXTDIR)\Data\Dumper\Dumper
ERRNO = $(EXTDIR)\Errno\Errno
+PEEK = $(EXTDIR)\Devel\Peek\Peek
+BYTELOADER = $(EXTDIR)\ByteLoader\ByteLoader
+DPROF = $(EXTDIR)\Devel\DProf\DProf
+GLOB = $(EXTDIR)\File\Glob\Glob
+HOSTNAME = $(EXTDIR)\Sys\Hostname\Hostname
SOCKET_DLL = $(AUTODIR)\Socket\Socket.dll
FCNTL_DLL = $(AUTODIR)\Fcntl\Fcntl.dll
@@ -639,7 +745,12 @@ ATTRS_DLL = $(AUTODIR)\attrs\attrs.dll THREAD_DLL = $(AUTODIR)\Thread\Thread.dll
B_DLL = $(AUTODIR)\B\B.dll
DUMPER_DLL = $(AUTODIR)\Data\Dumper\Dumper.dll
+PEEK_DLL = $(AUTODIR)\Devel\Peek\Peek.dll
RE_DLL = $(AUTODIR)\re\re.dll
+BYTELOADER_DLL = $(AUTODIR)\ByteLoader\ByteLoader.dll
+DPROF_DLL = $(AUTODIR)\Devel\DProf\DProf.dll
+GLOB_DLL = $(AUTODIR)\File\Glob\Glob.dll
+HOSTNAME_DLL = $(AUTODIR)\Sys\Hostname\Hostname.dll
ERRNO_PM = $(LIBDIR)\Errno.pm
@@ -654,7 +765,12 @@ EXTENSION_C = \ $(THREAD).c \
$(RE).c \
$(DUMPER).c \
- $(B).c
+ $(PEEK).c \
+ $(B).c \
+ $(BYTELOADER).c \
+ $(DPROF).c \
+ $(GLOB).c \
+ $(HOSTNAME).c
EXTENSION_DLL = \
$(SOCKET_DLL) \
@@ -665,69 +781,136 @@ EXTENSION_DLL = \ $(POSIX_DLL) \
$(ATTRS_DLL) \
$(DUMPER_DLL) \
- $(B_DLL)
+ $(PEEK_DLL) \
+ $(B_DLL) \
+ $(RE_DLL) \
+ $(THREAD_DLL) \
+ $(BYTELOADER_DLL) \
+ $(DPROF_DLL) \
+ $(GLOB_DLL) \
+ $(HOSTNAME_DLL)
EXTENSION_PM = \
$(ERRNO_PM)
-# re.dll doesn't build with PERL_OBJECT yet
-.IF "$(OBJECT)" == ""
-EXTENSION_DLL += \
- $(THREAD_DLL) \
- $(RE_DLL)
-.ENDIF
-
POD2HTML = $(PODDIR)\pod2html
POD2MAN = $(PODDIR)\pod2man
POD2LATEX = $(PODDIR)\pod2latex
POD2TEXT = $(PODDIR)\pod2text
+# vars must be separated by "\t+~\t+", since we're using the tempfile
+# version of config_sh.pl (we were overflowing someone's buffer by
+# trying to fit them all on the command line)
+# -- BKS 10-17-1999
CFG_VARS = \
- "INST_DRV=$(INST_DRV)" \
- "INST_TOP=$(INST_TOP)" \
- "INST_VER=$(INST_VER)" \
- "archname=$(ARCHNAME)" \
- "cc=$(CC)" \
- "ccflags=$(OPTIMIZE:s/"/\"/) $(DEFINES) $(OBJECT)" \
- "cf_email=$(EMAIL)" \
- "d_crypt=$(D_CRYPT)" \
- "d_mymalloc=$(PERL_MALLOC)" \
- "libs=$(LIBFILES:f)" \
- "incpath=$(CCINCDIR:s/"/\"/)" \
- "libperl=$(PERLIMPLIB:f)" \
- "libpth=$(CCLIBDIR:s/"/\"/);$(EXTRALIBDIRS:s/"/\"/)" \
- "libc=$(LIBC)" \
- "make=dmake" \
- "_o=$(o)" "obj_ext=$(o)" \
- "_a=$(a)" "lib_ext=$(a)" \
- "static_ext=$(STATIC_EXT)" \
- "dynamic_ext=$(DYNAMIC_EXT)" \
- "nonxs_ext=$(NONXS_EXT)" \
- "usethreads=$(USE_THREADS)" \
- "usemultiplicity=$(USE_MULTI)" \
- "LINK_FLAGS=$(LINK_FLAGS:s/"/\"/)" \
- "optimize=$(OPTIMIZE:s/"/\"/)"
+ INST_DRV=$(INST_DRV) ~ \
+ INST_TOP=$(INST_TOP:s/\/\\/) ~ \
+ INST_VER=$(INST_VER:s/\/\\/) ~ \
+ INST_ARCH=$(INST_ARCH) ~ \
+ archname=$(ARCHNAME) ~ \
+ cc=$(CC) ~ \
+ ccflags=$(OPTIMIZE) $(DEFINES) $(BUILDOPT) ~ \
+ cf_email=$(EMAIL) ~ \
+ d_crypt=$(D_CRYPT) ~ \
+ d_mymalloc=$(PERL_MALLOC) ~ \
+ libs=$(LIBFILES:f) ~ \
+ incpath=$(CCINCDIR:s/\/\\/) ~ \
+ libperl=$(PERLIMPLIB:f) ~ \
+ libpth=$(CCLIBDIR:s/\/\\/);$(EXTRALIBDIRS:s/\/\\/) ~ \
+ libc=$(LIBC) ~ \
+ make=dmake ~ \
+ _o=$(o) obj_ext=$(o) ~ \
+ _a=$(a) lib_ext=$(a) ~ \
+ static_ext=$(STATIC_EXT) ~ \
+ dynamic_ext=$(DYNAMIC_EXT) ~ \
+ nonxs_ext=$(NONXS_EXT) ~ \
+ use5005threads=$(USE_5005THREADS) ~ \
+ useithreads=$(USE_ITHREADS) ~ \
+ usethreads=$(USE_5005THREADS) ~ \
+ usemultiplicity=$(USE_MULTI) ~ \
+ LINK_FLAGS=$(LINK_FLAGS:s/\/\\/) ~ \
+ optimize=$(OPTIMIZE)
+
+#
+# set up targets varying between Win95 and WinNT builds
+#
+
+.IF "$(IS_WIN95)" == "define"
+MK2 = .\makefile.95
+RIGHTMAKE = __switch_makefiles
+NOOP = @rem
+.ELSE
+MK2 = __not_needed
+RIGHTMAKE = __not_needed
+.ENDIF
#
# Top targets
#
-all : .\config.h $(GLOBEXE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) $(PERL95EXE) \
- $(CAPILIB) $(X2P) $(EXTENSION_DLL) $(EXTENSION_PM)
+all : .\config.h $(GLOBEXE) $(MINIPERL) $(MK2) \
+ $(RIGHTMAKE) $(MINIMOD) $(CONFIGPM) $(PERLEXE) \
+ $(X2P) $(EXTENSION_DLL) $(EXTENSION_PM)
$(DYNALOADER)$(o) : $(DYNALOADER).c $(CORE_H) $(EXTDIR)\DynaLoader\dlutils.c
-#------------------------------------------------------------
+#----------------------------------------------------------------
+
+#-------------------- BEGIN Win95 SPECIFIC ----------------------
+
+# this target is a jump-off point for Win95
+# 1. it switches to the Win95-specific makefile if it exists
+# (__do_switch_makefiles)
+# 2. it prints a message when the Win95-specific one finishes (__done)
+# 3. it then kills this makefile by trying to make __no_such_target
+
+__switch_makefiles: __do_switch_makefiles __done __no_such_target
+
+__do_switch_makefiles:
+.IF "$(NOTFIRST)" != "true"
+ if exist $(MK2) $(MAKE:s/-S//) -f $(MK2) $(MAKETARGETS) NOTFIRST=true
+.ELSE
+ $(NOOP)
+.ENDIF
+
+.IF "$(NOTFIRST)" != "true"
+__done:
+ @echo Build process complete. Ignore any errors after this message.
+ @echo Run "dmake test" to test and "dmake install" to install
+
+.ELSE
+# dummy targets for Win95-specific makefile
+
+__done:
+ $(NOOP)
+
+__no_such_target:
+ $(NOOP)
+
+.ENDIF
+
+# This target is used to generate the new makefile (.\makefile.95) for Win95
+
+.\makefile.95: .\makefile.mk
+ $(MINIPERL) genmk95.pl makefile.mk $(MK2)
+
+#--------------------- END Win95 SPECIFIC ---------------------
+
+# a blank target for when builds don't need to do certain things
+# this target added for Win95 port but used to keep the WinNT port able to
+# use this file
+__not_needed:
+ $(NOOP)
$(GLOBEXE) : perlglob$(o)
.IF "$(CCTYPE)" == "BORLAND"
$(CC) -c -w -v -tWM -I"$(CCINCDIR)" perlglob.c
- $(LINK32) -Tpe -ap $(LINK_FLAGS) c0x32$(o) perlglob$(o) \
+ $(LINK32) -Tpe -ap $(BLINK_FLAGS) c0x32$(o) perlglob$(o) \
"$(CCLIBDIR)\32BIT\wildargs$(o)",$@,,import32.lib cw32mt.lib,
.ELIF "$(CCTYPE)" == "GCC"
- $(LINK32) $(LINK_FLAGS) -o $@ perlglob$(o) $(LIBFILES)
+ $(LINK32) $(BLINK_FLAGS) -mconsole -o $@ perlglob$(o) $(LIBFILES)
.ELSE
- $(LINK32) $(LINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \
+ $(LINK32) $(BLINK_FLAGS) $(LIBFILES) -out:$@ -subsystem:$(SUBSYS) \
perlglob$(o) setargv$(o)
.ENDIF
@@ -741,13 +924,15 @@ config.w32 : $(CFGSH_TMPL) copy $(CFGH_TMPL) config.h
..\config.sh : config.w32 $(MINIPERL) config_sh.PL
- $(MINIPERL) -I..\lib config_sh.PL $(CFG_VARS) config.w32 > ..\config.sh
+ $(MINIPERL) -I..\lib config_sh.PL --cfgsh-option-file \
+ $(mktmp $(CFG_VARS)) config.w32 > ..\config.sh
# this target is for when changes to the main config.sh happen
# edit config.{b,v,g}c and make this target once for each supported
# compiler (e.g. `dmake CCTYPE=BORLAND regen_config_h`)
regen_config_h:
- perl config_sh.PL $(CFG_VARS) $(CFGSH_TMPL) > ..\config.sh
+ perl config_sh.PL --cfgsh-option-file $(mktmp $(CFG_VARS)) \
+ $(CFGSH_TMPL) > ..\config.sh
-cd .. && del /f perl.exe
cd .. && perl configpm
-del /f $(CFGH_TMPL)
@@ -763,29 +948,41 @@ $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl $(XCOPY) ..\ext\re\re.pm $(LIBDIR)\*.*
$(RCOPY) include $(COREDIR)\*.*
$(MINIPERL) -I..\lib config_h.PL "INST_VER=$(INST_VER)" \
- || $(MAKE) $(MAKEMACROS) $(CONFIGPM)
+ || $(MAKE) $(MAKEMACROS) $(CONFIGPM) $(MAKEFILE)
-$(MINIPERL) : $(MINIDIR) $(MINI_OBJ)
+$(MINIPERL) : $(MINIDIR) $(MINI_OBJ) $(CRTIPMLIBS)
.IF "$(CCTYPE)" == "BORLAND"
- $(LINK32) -Tpe -ap $(LINK_FLAGS) \
+ $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
@$(mktmp c0x32$(o) $(MINI_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
.ELIF "$(CCTYPE)" == "GCC"
- $(LINK32) -v -o $@ $(LINK_FLAGS) \
- $(mktmp $(LKPRE) $(MINI_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
+ $(LINK32) -v -mconsole -o $@ $(BLINK_FLAGS) \
+ $(mktmp $(LKPRE) $(MINI_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
.ELSE
$(LINK32) -subsystem:console -out:$@ \
- @$(mktmp $(LINK_FLAGS) $(LIBFILES) $(MINI_OBJ:s,\,\\))
+ @$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(MINI_OBJ:s,\,\\))
.ENDIF
$(MINIDIR) :
if not exist "$(MINIDIR)" mkdir "$(MINIDIR)"
$(MINICORE_OBJ) : $(CORE_NOCFG_H)
- $(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ ..\$(*B).c
+ $(CC) -c $(CFLAGS) -DPERL_EXTERNAL_GLOB $(OBJOUT_FLAG)$@ ..\$(*B).c
$(MINIWIN32_OBJ) : $(CORE_NOCFG_H)
$(CC) -c $(CFLAGS) $(OBJOUT_FLAG)$@ $(*B).c
+# -DPERL_IMPLICIT_SYS needs C++ for perllib.c
+# rules wrapped in .IFs break Win9X build (we end up with unbalanced []s unless
+# unless the .IF is true), so instead we use a .ELSE with the default.
+# This is the only file that depends on perlhost.h, vmem.h, and vdir.h
+
+perllib$(o) : perllib.c .\perlhost.h .\vdir.h .\vmem.h
+.IF "$(USE_IMP_SYS)$(USE_OBJECT)" == "defineundef"
+ $(CC) -c -I. $(CFLAGS_O) $(CXX_FLAG) $(OBJOUT_FLAG)$@ perllib.c
+.ELSE
+ $(CC) -c -I. $(CFLAGS_O) $(OBJOUT_FLAG)$@ perllib.c
+.ENDIF
+
# 1. we don't want to rebuild miniperl.exe when config.h changes
# 2. we don't want to rebuild miniperl.exe with non-default config.h
$(MINI_OBJ) : $(CORE_NOCFG_H)
@@ -793,41 +990,38 @@ $(MINI_OBJ) : $(CORE_NOCFG_H) $(WIN32_OBJ) : $(CORE_H)
$(CORE_OBJ) : $(CORE_H)
$(DLL_OBJ) : $(CORE_H)
-$(PERL95_OBJ) : $(CORE_H)
$(X2P_OBJ) : $(CORE_H)
-perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym makedef.pl
- $(MINIPERL) -w makedef.pl $(OPTIMIZE) $(DEFINES) $(OBJECT) \
- CCTYPE=$(CCTYPE) > perldll.def
+perldll.def : $(MINIPERL) $(CONFIGPM) ..\global.sym ..\pp.sym ..\makedef.pl
+ $(MINIPERL) -w ..\makedef.pl PLATFORM=win32 $(OPTIMIZE) $(DEFINES) \
+ $(BUILDOPT) CCTYPE=$(CCTYPE) > perldll.def
-$(PERLDLL): perldll.def $(PERLDLL_OBJ)
+$(PERLDLL): perldll.def $(PERLDLL_OBJ) $(PERLDLL_RES)
.IF "$(CCTYPE)" == "BORLAND"
- $(LINK32) -Tpd -ap $(LINK_FLAGS) \
+ $(LINK32) -Tpd -ap $(BLINK_FLAGS) \
@$(mktmp c0d32$(o) $(PERLDLL_OBJ:s,\,\\)\n \
$@,\n \
$(LIBFILES)\n \
perldll.def\n)
$(IMPLIB) $*.lib $@
.ELIF "$(CCTYPE)" == "GCC"
- $(LINK32) -mdll -o $@ -Wl,--base-file -Wl,perl.base $(LINK_FLAGS) \
+ $(LINK32) -mdll -o $@ -Wl,--base-file -Wl,perl.base $(BLINK_FLAGS) \
$(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
dlltool --output-lib $(PERLIMPLIB) \
- --dllname perl.dll \
- --def perldll.def \
- --base-file perl.base \
- --output-exp perl.exp
- $(LINK32) -mdll -o $@ $(LINK_FLAGS) \
+ --dllname $(PERLDLL:b).dll \
+ --def perldll.def \
+ --base-file perl.base \
+ --output-exp perl.exp
+ $(LINK32) -mdll -o $@ $(BLINK_FLAGS) \
$(mktmp $(LKPRE) $(PERLDLL_OBJ:s,\,\\) $(LIBFILES) \
perl.exp $(LKPOST))
.ELSE
$(LINK32) -dll -def:perldll.def -out:$@ \
- @$(mktmp $(LINK_FLAGS) $(LIBFILES) $(PERLDLL_OBJ:s,\,\\))
+ @$(mktmp -base:0x28000000 $(BLINK_FLAGS) $(DELAYLOAD) $(LIBFILES) \
+ $(PERLDLL_RES) $(PERLDLL_OBJ:s,\,\\))
.ENDIF
$(XCOPY) $(PERLIMPLIB) $(COREDIR)
-perl.def : $(MINIPERL) makeperldef.pl
- $(MINIPERL) -I..\lib makeperldef.pl $(NULL) > perl.def
-
$(MINIMOD) : $(MINIPERL) ..\minimod.pl
cd .. && miniperl minimod.pl > lib\ExtUtils\Miniperl.pm
@@ -850,14 +1044,14 @@ $(X2P) : $(MINIPERL) $(X2P_OBJ) $(MINIPERL) ..\x2p\find2perl.PL
$(MINIPERL) ..\x2p\s2p.PL
.IF "$(CCTYPE)" == "BORLAND"
- $(LINK32) -Tpe -ap $(LINK_FLAGS) \
+ $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
@$(mktmp c0x32$(o) $(X2P_OBJ:s,\,\\),$(@:s,\,\\),,$(LIBFILES),)
.ELIF "$(CCTYPE)" == "GCC"
- $(LINK32) -v -o $@ $(LINK_FLAGS) \
+ $(LINK32) -v -o $@ $(BLINK_FLAGS) \
$(mktmp $(LKPRE) $(X2P_OBJ:s,\,\\) $(LIBFILES) $(LKPOST))
.ELSE
$(LINK32) -subsystem:console -out:$@ \
- @$(mktmp $(LINK_FLAGS) $(LIBFILES) $(X2P_OBJ:s,\,\\))
+ @$(mktmp $(BLINK_FLAGS) $(LIBFILES) $(X2P_OBJ:s,\,\\))
.ENDIF
perlmain.c : runperl.c
@@ -866,84 +1060,33 @@ perlmain.c : runperl.c perlmain$(o) : perlmain.c
$(CC) $(CFLAGS_O) -UPERLDLL $(OBJOUT_FLAG)$@ -c perlmain.c
-$(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ)
+$(PERLEXE): $(PERLDLL) $(CONFIGPM) $(PERLEXE_OBJ) $(PERLEXE_RES)
.IF "$(CCTYPE)" == "BORLAND"
- $(LINK32) -Tpe -ap $(LINK_FLAGS) \
+ $(LINK32) -Tpe -ap $(BLINK_FLAGS) \
@$(mktmp c0x32$(o) $(PERLEXE_OBJ:s,\,\\)\n \
$(@:s,\,\\),\n \
$(PERLIMPLIB) $(LIBFILES)\n)
.ELIF "$(CCTYPE)" == "GCC"
- $(LINK32) -o $@ $(LINK_FLAGS) \
+ $(LINK32) -mconsole -o $@ $(BLINK_FLAGS) \
$(PERLEXE_OBJ) $(PERLIMPLIB) $(LIBFILES)
.ELSE
- $(LINK32) -subsystem:console -out:$@ $(LINK_FLAGS) $(LIBFILES) \
- $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB)
+ $(LINK32) -subsystem:console -out:$@ -stack:0x8000000 $(BLINK_FLAGS) \
+ $(LIBFILES) $(PERLEXE_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) $(PERLEXE_RES)
.ENDIF
+ copy $(PERLEXE) $(WPERLEXE)
+ $(MINIPERL) -I..\lib bin\exetype.pl $(WPERLEXE) WINDOWS
copy splittree.pl ..
$(MINIPERL) -I..\lib ..\splittree.pl "../LIB" $(AUTODIR)
-.IF "$(CCTYPE)" != "BORLAND"
-.IF "$(CCTYPE)" != "GCC"
-.IF "$(USE_PERLCRT)" == ""
-
-perl95.c : runperl.c
- copy runperl.c perl95.c
-
-perl95$(o) : perl95.c
- $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c perl95.c
-
-win32sckmt$(o) : win32sck.c
- $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
- $(OBJOUT_FLAG)win32sckmt$(o) win32sck.c
-
-win32mt$(o) : win32.c
- $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
- $(OBJOUT_FLAG)win32mt$(o) win32.c
-
-DynaLoadmt$(o) : $(DYNALOADER).c
- $(CC) $(CFLAGS_O) -MT -UPERLDLL -DWIN95FIX -c \
- $(OBJOUT_FLAG)DynaLoadmt$(o) $(DYNALOADER).c
-
-$(PERL95EXE): $(PERLDLL) $(CONFIGPM) $(PERL95_OBJ)
- $(LINK32) -subsystem:console -nodefaultlib -out:$@ $(LINK_FLAGS) \
- $(LIBBASEFILES) $(PERL95_OBJ) $(SETARGV_OBJ) $(PERLIMPLIB) \
- libcmt.lib
-
-.ENDIF
-.ENDIF
-.ENDIF
-
$(DYNALOADER).c: $(MINIPERL) $(EXTDIR)\DynaLoader\dl_win32.xs $(CONFIGPM)
if not exist $(AUTODIR) mkdir $(AUTODIR)
cd $(EXTDIR)\$(*B) && ..\$(MINIPERL) -I..\..\lib $(*B)_pm.PL
+ cd $(EXTDIR)\$(*B) && ..\$(MINIPERL) -I..\..\lib XSLoader_pm.PL
$(XCOPY) $(EXTDIR)\$(*B)\$(*B).pm $(LIBDIR)\$(NULL)
+ $(XCOPY) $(EXTDIR)\$(*B)\XSLoader.pm $(LIBDIR)\$(NULL)
cd $(EXTDIR)\$(*B) && $(XSUBPP) dl_win32.xs > $(*B).c
$(XCOPY) $(EXTDIR)\$(*B)\dlutils.c .
-.IF "$(OBJECT)" == "-DPERL_OBJECT"
-
-perlCAPI.cpp : $(MINIPERL)
- $(MINIPERL) GenCAPI.pl $(COREDIR)
-
-perlCAPI$(o) : perlCAPI.cpp
-.IF "$(CCTYPE)" == "BORLAND"
- $(CC) $(CFLAGS_O) -c $(OBJOUT_FLAG)perlCAPI$(o) perlCAPI.cpp
-.ELIF "$(CCTYPE)" == "GCC"
- $(CC) $(CFLAGS_O) -c $(OBJOUT_FLAG)perlCAPI$(o) perlCAPI.cpp
-.ELSE
- $(CC) $(CFLAGS_O) $(RUNTIME) -UPERLDLL -c \
- $(OBJOUT_FLAG)perlCAPI$(o) perlCAPI.cpp
-.ENDIF
-
-$(CAPILIB) : perlCAPI.cpp perlCAPI$(o)
-.IF "$(CCTYPE)" == "BORLAND"
- $(LIB32) $(LIBOUT_FLAG)$(CAPILIB) +perlCAPI$(o)
-.ELSE
- $(LIB32) $(LIBOUT_FLAG)$(CAPILIB) perlCAPI$(o)
-.ENDIF
-
-.ENDIF
-
$(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs
copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs
@@ -952,6 +1095,21 @@ $(DUMPER_DLL): $(PERLEXE) $(DUMPER).xs ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
cd $(EXTDIR)\Data\$(*B) && $(MAKE)
+$(DPROF_DLL): $(PERLEXE) $(DPROF).xs
+ cd $(EXTDIR)\Devel\$(*B) && \
+ ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
+ cd $(EXTDIR)\Devel\$(*B) && $(MAKE)
+
+$(GLOB_DLL): $(PERLEXE) $(GLOB).xs
+ cd $(EXTDIR)\File\$(*B) && \
+ ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
+ cd $(EXTDIR)\File\$(*B) && $(MAKE)
+
+$(PEEK_DLL): $(PERLEXE) $(PEEK).xs
+ cd $(EXTDIR)\Devel\$(*B) && \
+ ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
+ cd $(EXTDIR)\Devel\$(*B) && $(MAKE)
+
$(RE_DLL): $(PERLEXE) $(RE).xs
cd $(EXTDIR)\$(*B) && \
..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
@@ -1002,6 +1160,16 @@ $(SOCKET_DLL): $(PERLEXE) $(SOCKET).xs ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
cd $(EXTDIR)\$(*B) && $(MAKE)
+$(HOSTNAME_DLL): $(PERLEXE) $(HOSTNAME).xs
+ cd $(EXTDIR)\Sys\$(*B) && \
+ ..\..\..\miniperl -I..\..\..\lib Makefile.PL INSTALLDIRS=perl
+ cd $(EXTDIR)\Sys\$(*B) && $(MAKE)
+
+$(BYTELOADER_DLL): $(PERLEXE) $(BYTELOADER).xs
+ cd $(EXTDIR)\$(*B) && \
+ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
+ cd $(EXTDIR)\$(*B) && $(MAKE)
+
$(ERRNO_PM): $(PERLEXE) $(ERRNO)_pm.PL
cd $(EXTDIR)\$(*B) && \
..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl
@@ -1014,23 +1182,33 @@ doc: $(PERLEXE) utils: $(PERLEXE) $(X2P)
cd ..\utils && $(MAKE) PERL=$(MINIPERL)
- copy ..\README.win32 ..\pod\perlwin32.pod
+ copy ..\README.amiga ..\pod\perlamiga.pod
+ copy ..\README.cygwin ..\pod\perlcygwin.pod
+ copy ..\README.dos ..\pod\perldos.pod
+ copy ..\README.hpux ..\pod\perlhpux.pod
+ copy ..\README.machten ..\pod\perlmachten.pod
+ copy ..\README.os2 ..\pod\perlos2.pod
+ copy ..\README.os2 ..\pod\perlos2.pod
+ copy ..\vms\perlvms.pod ..\pod\perlvms.pod
cd ..\pod && $(MAKE) -f ..\win32\pod.mak converters
$(PERLEXE) $(PL2BAT) $(UTILS)
distclean: clean
- -del /f $(MINIPERL) $(PERLEXE) $(PERL95EXE) $(PERLDLL) $(GLOBEXE) \
+ -del /f $(MINIPERL) $(PERLEXE) $(PERLDLL) $(GLOBEXE) \
$(PERLIMPLIB) ..\miniperl$(a) $(MINIMOD)
-del /f *.def *.map
-del /f $(EXTENSION_DLL) $(EXTENSION_PM)
-del /f $(EXTENSION_C) $(DYNALOADER).c $(ERRNO).pm
-del /f $(EXTDIR)\DynaLoader\dl_win32.xs
-del /f $(LIBDIR)\.exists $(LIBDIR)\attrs.pm $(LIBDIR)\DynaLoader.pm
+ -del /f $(LIBDIR)\XSLoader.pm
-del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm
-del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm $(LIBDIR)\Thread.pm
-del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm
-del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm
- -del /f $(LIBDIR)\Data\Dumper.pm
+ -del /f $(LIBDIR)\Data\Dumper.pm $(LIBDIR)\ByteLoader.pm
+ -del /f $(LIBDIR)\Devel\Peek.pm $(LIBDIR)\Devel\DProf.pm
+ -del /f $(LIBDIR)\File\Glob.pm
-rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO
-rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread
-rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B
@@ -1038,13 +1216,10 @@ distclean: clean -del /f $(PODDIR)\*.html
-del /f $(PODDIR)\*.bat
-cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc \
- pstruct *.bat
+ dprofpp *.bat
-cd ..\x2p && del /f find2perl s2p *.bat
-del /f ..\config.sh ..\splittree.pl perlmain.c dlutils.c config.h.new
-del /f $(CONFIGPM)
-.IF "$(PERL95EXE)" != ""
- -del /f perl95.c
-.ENDIF
-del /f bin\*.bat
-cd $(EXTDIR) && del /s *$(a) *.def *.map *.pdb *.bs Makefile *$(o) \
pm_to_blib
@@ -1053,14 +1228,11 @@ distclean: clean install : all installbare installhtml
-installbare : utils
+installbare : $(RIGHTMAKE) utils
$(PERLEXE) ..\installperl
-.IF "$(PERL95EXE)" != ""
- $(XCOPY) $(PERL95EXE) $(INST_BIN)\*.*
-.ENDIF
+ if exist $(WPERLEXE) $(XCOPY) $(WPERLEXE) $(INST_BIN)\*.*
$(XCOPY) $(GLOBEXE) $(INST_BIN)\*.*
$(XCOPY) bin\*.bat $(INST_SCRIPT)\*.*
- $(XCOPY) bin\network.pl $(INST_LIB)\*.*
installhtml : doc
$(RCOPY) html\*.* $(INST_HTML)\*.*
@@ -1091,30 +1263,39 @@ test-prep : all utils $(XCOPY) $(GLOBEXE) ..\t\$(NULL)
.ENDIF
-test : test-prep
+test : $(RIGHTMAKE) test-prep
cd ..\t && $(PERLEXE) -I..\lib harness
test-notty : test-prep
set PERL_SKIP_TTY_TEST=1 && \
- cd ..\t && $(PERLEXE) -I.\lib harness
+ cd ..\t && $(PERLEXE) -I.\lib harness
+
+test-wide : test-prep
+ set HARNESS_PERL_SWITCHES=-C && \
+ cd ..\t && $(PERLEXE) -I..\lib harness
+
+test-wide-notty : test-prep
+ set PERL_SKIP_TTY_TEST=1 && \
+ set HARNESS_PERL_SWITCHES=-C && \
+ cd ..\t && $(PERLEXE) -I..\lib harness
clean :
-@erase miniperlmain$(o)
-@erase $(MINIPERL)
-@erase perlglob$(o)
-@erase perlmain$(o)
- -@erase perlCAPI.cpp
-@erase config.w32
-@erase /f config.h
-@erase $(GLOBEXE)
-@erase $(PERLEXE)
+ -@erase $(WPERLEXE)
-@erase $(PERLDLL)
-@erase $(CORE_OBJ)
-rmdir /s /q $(MINIDIR) || rmdir /s $(MINIDIR)
-@erase $(WIN32_OBJ)
-@erase $(DLL_OBJ)
-@erase $(X2P_OBJ)
- -@erase ..\*$(o) ..\*$(a) ..\*.exp ..\*.res *$(o) *$(a) *.exp *.res
+ -@erase ..\*$(o) ..\*$(a) ..\*.exp *$(o) *$(a) *.exp *.res
-@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat
-@erase ..\x2p\*.exe ..\x2p\*.bat
-@erase *.ilk
diff --git a/gnu/usr.bin/perl/win32/makemain.pl b/gnu/usr.bin/perl/win32/makemain.pl deleted file mode 100644 index 740b6a212a0..00000000000 --- a/gnu/usr.bin/perl/win32/makemain.pl +++ /dev/null @@ -1,45 +0,0 @@ -open (MINIMAIN, "<../miniperlmain.c") || die "failed to open miniperlmain.c" . $!; - -while (<MINIMAIN>) { - if (/Do not delete this line--writemain depends on it/) { - last; - } - else { - print $_; - } - }; - -close(MINIMAIN); - -print "char *staticlinkmodules[]={\n"; -foreach (@ARGV) { - print "\t\"".$_."\",\n"; - } -print "\tNULL,\n"; -print "\t};\n"; -print "\n"; -foreach (@ARGV) { - print "EXTERN_C void boot_$_ _((CV* cv));\n" - } - -print <<EOP; - -static void -xs_init() -{ - dXSUB_SYS; - char *file = __FILE__; -EOP - -foreach (@ARGV) { - if (/DynaLoader/) { - print "\tnewXS(\"$_\:\:boot_$_\", boot_$_, file);\n"; - } - else { - print "\tnewXS(\"$_\:\:bootstrap\", boot_$_, file);\n"; - }; - } - -print <<EOP; -} -EOP diff --git a/gnu/usr.bin/perl/win32/makeperldef.pl b/gnu/usr.bin/perl/win32/makeperldef.pl deleted file mode 100644 index 620d2ebab30..00000000000 --- a/gnu/usr.bin/perl/win32/makeperldef.pl +++ /dev/null @@ -1,23 +0,0 @@ -my $CCTYPE = ""; -print "EXPORTS\n"; -foreach (@ARGV) { - if (/CCTYPE=(.*)$/) { - $CCTYPE = $1; - next; - } - emit_symbol("boot_$_"); -} - -sub emit_symbol { - my $symbol = shift; - if ($CCTYPE eq "BORLAND") { - # workaround Borland quirk by export both the straight - # name and a name with leading underscore - print "\t$symbol=_$symbol\n"; - print "\t_$symbol\n"; - } - else { - print "\t$symbol\n"; - } -} - diff --git a/gnu/usr.bin/perl/win32/perllib.c b/gnu/usr.bin/perl/win32/perllib.c index d1d942c4956..857aada2471 100644 --- a/gnu/usr.bin/perl/win32/perllib.c +++ b/gnu/usr.bin/perl/win32/perllib.c @@ -5,50 +5,342 @@ #include "EXTERN.h" #include "perl.h" + +#ifdef PERL_OBJECT +#define NO_XSLOCKS +#endif + #include "XSUB.h" -static void xs_init _((void)); +#ifdef PERL_IMPLICIT_SYS +#include "win32iop.h" +#include <fcntl.h> +#endif /* PERL_IMPLICIT_SYS */ + + +/* Register any extra external extensions */ +char *staticlinkmodules[] = { + "DynaLoader", + NULL, +}; + +EXTERN_C void boot_DynaLoader (pTHXo_ CV* cv); + +static void +xs_init(pTHXo) +{ + char *file = __FILE__; + dXSUB_SYS; + newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); +} + +#ifdef PERL_IMPLICIT_SYS + +#include "perlhost.h" + +EXTERN_C void +perl_get_host_info(struct IPerlMemInfo* perlMemInfo, + struct IPerlMemInfo* perlMemSharedInfo, + struct IPerlMemInfo* perlMemParseInfo, + struct IPerlEnvInfo* perlEnvInfo, + struct IPerlStdIOInfo* perlStdIOInfo, + struct IPerlLIOInfo* perlLIOInfo, + struct IPerlDirInfo* perlDirInfo, + struct IPerlSockInfo* perlSockInfo, + struct IPerlProcInfo* perlProcInfo) +{ + if (perlMemInfo) { + Copy(&perlMem, &perlMemInfo->perlMemList, perlMemInfo->nCount, void*); + perlMemInfo->nCount = (sizeof(struct IPerlMem)/sizeof(void*)); + } + if (perlMemSharedInfo) { + Copy(&perlMem, &perlMemSharedInfo->perlMemList, perlMemSharedInfo->nCount, void*); + perlMemSharedInfo->nCount = (sizeof(struct IPerlMem)/sizeof(void*)); + } + if (perlMemParseInfo) { + Copy(&perlMem, &perlMemParseInfo->perlMemList, perlMemParseInfo->nCount, void*); + perlMemParseInfo->nCount = (sizeof(struct IPerlMem)/sizeof(void*)); + } + if (perlEnvInfo) { + Copy(&perlEnv, &perlEnvInfo->perlEnvList, perlEnvInfo->nCount, void*); + perlEnvInfo->nCount = (sizeof(struct IPerlEnv)/sizeof(void*)); + } + if (perlStdIOInfo) { + Copy(&perlStdIO, &perlStdIOInfo->perlStdIOList, perlStdIOInfo->nCount, void*); + perlStdIOInfo->nCount = (sizeof(struct IPerlStdIO)/sizeof(void*)); + } + if (perlLIOInfo) { + Copy(&perlLIO, &perlLIOInfo->perlLIOList, perlLIOInfo->nCount, void*); + perlLIOInfo->nCount = (sizeof(struct IPerlLIO)/sizeof(void*)); + } + if (perlDirInfo) { + Copy(&perlDir, &perlDirInfo->perlDirList, perlDirInfo->nCount, void*); + perlDirInfo->nCount = (sizeof(struct IPerlDir)/sizeof(void*)); + } + if (perlSockInfo) { + Copy(&perlSock, &perlSockInfo->perlSockList, perlSockInfo->nCount, void*); + perlSockInfo->nCount = (sizeof(struct IPerlSock)/sizeof(void*)); + } + if (perlProcInfo) { + Copy(&perlProc, &perlProcInfo->perlProcList, perlProcInfo->nCount, void*); + perlProcInfo->nCount = (sizeof(struct IPerlProc)/sizeof(void*)); + } +} + +EXTERN_C PerlInterpreter* +perl_alloc_override(struct IPerlMem** ppMem, struct IPerlMem** ppMemShared, + struct IPerlMem** ppMemParse, struct IPerlEnv** ppEnv, + struct IPerlStdIO** ppStdIO, struct IPerlLIO** ppLIO, + struct IPerlDir** ppDir, struct IPerlSock** ppSock, + struct IPerlProc** ppProc) +{ + PerlInterpreter *my_perl = NULL; + CPerlHost* pHost = new CPerlHost(ppMem, ppMemShared, ppMemParse, ppEnv, + ppStdIO, ppLIO, ppDir, ppSock, ppProc); + + if (pHost) { + my_perl = perl_alloc_using(pHost->m_pHostperlMem, + pHost->m_pHostperlMemShared, + pHost->m_pHostperlMemParse, + pHost->m_pHostperlEnv, + pHost->m_pHostperlStdIO, + pHost->m_pHostperlLIO, + pHost->m_pHostperlDir, + pHost->m_pHostperlSock, + pHost->m_pHostperlProc); + if (my_perl) { +#ifdef PERL_OBJECT + CPerlObj* pPerl = (CPerlObj*)my_perl; +#endif + w32_internal_host = pHost; + } + } + return my_perl; +} + +EXTERN_C PerlInterpreter* +perl_alloc(void) +{ + PerlInterpreter* my_perl = NULL; + CPerlHost* pHost = new CPerlHost(); + if (pHost) { + my_perl = perl_alloc_using(pHost->m_pHostperlMem, + pHost->m_pHostperlMemShared, + pHost->m_pHostperlMemParse, + pHost->m_pHostperlEnv, + pHost->m_pHostperlStdIO, + pHost->m_pHostperlLIO, + pHost->m_pHostperlDir, + pHost->m_pHostperlSock, + pHost->m_pHostperlProc); + if (my_perl) { +#ifdef PERL_OBJECT + CPerlObj* pPerl = (CPerlObj*)my_perl; +#endif + w32_internal_host = pHost; + } + } + return my_perl; +} + +EXTERN_C void +win32_delete_internal_host(void *h) +{ + CPerlHost *host = (CPerlHost*)h; + delete host; +} + +#ifdef PERL_OBJECT + +EXTERN_C void +perl_construct(PerlInterpreter* my_perl) +{ + CPerlObj* pPerl = (CPerlObj*)my_perl; + try + { + Perl_construct(); + } + catch(...) + { + win32_fprintf(stderr, "%s\n", + "Error: Unable to construct data structures"); + perl_free(my_perl); + } +} -DllExport int -RunPerl(int argc, char **argv, char **env, void *iosubsystem) +EXTERN_C void +perl_destruct(PerlInterpreter* my_perl) +{ + CPerlObj* pPerl = (CPerlObj*)my_perl; +#ifdef DEBUGGING + Perl_destruct(); +#else + try + { + Perl_destruct(); + } + catch(...) + { + } +#endif +} + +EXTERN_C void +perl_free(PerlInterpreter* my_perl) +{ + CPerlObj* pPerl = (CPerlObj*)my_perl; + void *host = w32_internal_host; +#ifdef DEBUGGING + Perl_free(); +#else + try + { + Perl_free(); + } + catch(...) + { + } +#endif + win32_delete_internal_host(host); + PERL_SET_THX(NULL); +} + +EXTERN_C int +perl_run(PerlInterpreter* my_perl) +{ + CPerlObj* pPerl = (CPerlObj*)my_perl; + int retVal; +#ifdef DEBUGGING + retVal = Perl_run(); +#else + try + { + retVal = Perl_run(); + } + catch(...) + { + win32_fprintf(stderr, "Error: Runtime exception\n"); + retVal = -1; + } +#endif + return retVal; +} + +EXTERN_C int +perl_parse(PerlInterpreter* my_perl, void (*xsinit)(CPerlObj*), int argc, char** argv, char** env) +{ + int retVal; + CPerlObj* pPerl = (CPerlObj*)my_perl; +#ifdef DEBUGGING + retVal = Perl_parse(xsinit, argc, argv, env); +#else + try + { + retVal = Perl_parse(xsinit, argc, argv, env); + } + catch(...) + { + win32_fprintf(stderr, "Error: Parse exception\n"); + retVal = -1; + } +#endif + *win32_errno() = 0; + return retVal; +} + +#undef PL_perl_destruct_level +#define PL_perl_destruct_level int dummy + +#endif /* PERL_OBJECT */ +#endif /* PERL_IMPLICIT_SYS */ + +EXTERN_C HANDLE w32_perldll_handle; + +EXTERN_C DllExport int +RunPerl(int argc, char **argv, char **env) { int exitstatus; - PerlInterpreter *my_perl; + PerlInterpreter *my_perl, *new_perl = NULL; + +#ifndef __BORLANDC__ + /* XXX this _may_ be a problem on some compilers (e.g. Borland) that + * want to free() argv after main() returns. As luck would have it, + * Borland's CRT does the right thing to argv[0] already. */ + char szModuleName[MAX_PATH]; + char *ptr; + + GetModuleFileName(NULL, szModuleName, sizeof(szModuleName)); + (void)win32_longpath(szModuleName); + argv[0] = szModuleName; +#endif #ifdef PERL_GLOBAL_STRUCT #define PERLVAR(var,type) /**/ +#define PERLVARA(var,type) /**/ #define PERLVARI(var,type,init) PL_Vars.var = init; #define PERLVARIC(var,type,init) PL_Vars.var = init; #include "perlvars.h" #undef PERLVAR +#undef PERLVARA #undef PERLVARI #undef PERLVARIC #endif PERL_SYS_INIT(&argc,&argv); - perl_init_i18nl10n(1); - if (!(my_perl = perl_alloc())) return (1); - perl_construct( my_perl ); + perl_construct(my_perl); PL_perl_destruct_level = 0; - exitstatus = perl_parse( my_perl, xs_init, argc, argv, env); + exitstatus = perl_parse(my_perl, xs_init, argc, argv, env); if (!exitstatus) { - exitstatus = perl_run( my_perl ); +#if defined(TOP_CLONE) && defined(USE_ITHREADS) /* XXXXXX testing */ +# ifdef PERL_OBJECT + CPerlHost *h = new CPerlHost(); + new_perl = perl_clone_using(my_perl, 1, + h->m_pHostperlMem, + h->m_pHostperlMemShared, + h->m_pHostperlMemParse, + h->m_pHostperlEnv, + h->m_pHostperlStdIO, + h->m_pHostperlLIO, + h->m_pHostperlDir, + h->m_pHostperlSock, + h->m_pHostperlProc + ); + CPerlObj *pPerl = (CPerlObj*)new_perl; +# else + new_perl = perl_clone(my_perl, 1); +# endif + exitstatus = perl_run(new_perl); + PERL_SET_THX(my_perl); +#else + exitstatus = perl_run(my_perl); +#endif } - perl_destruct( my_perl ); - perl_free( my_perl ); + perl_destruct(my_perl); + perl_free(my_perl); +#ifdef USE_ITHREADS + if (new_perl) { + PERL_SET_THX(new_perl); + perl_destruct(new_perl); + perl_free(new_perl); + } +#endif PERL_SYS_TERM(); return (exitstatus); } -extern HANDLE w32_perldll_handle; +EXTERN_C void +set_w32_module_name(void); +#ifdef __MINGW32__ +EXTERN_C /* GCC in C++ mode mangles the name, otherwise */ +#endif BOOL APIENTRY DllMain(HANDLE hModule, /* DLL module handle */ DWORD fdwReason, /* reason called */ @@ -66,7 +358,9 @@ DllMain(HANDLE hModule, /* DLL module handle */ setmode( fileno( stderr ), O_BINARY ); _fmode = O_BINARY; #endif + DisableThreadLibraryCalls((HMODULE)hModule); w32_perldll_handle = hModule; + set_w32_module_name(); break; /* The DLL is detaching from a process due to @@ -88,21 +382,3 @@ DllMain(HANDLE hModule, /* DLL module handle */ } return TRUE; } - -/* Register any extra external extensions */ - -char *staticlinkmodules[] = { - "DynaLoader", - NULL, -}; - -EXTERN_C void boot_DynaLoader _((CV* cv)); - -static void -xs_init() -{ - char *file = __FILE__; - dXSUB_SYS; - newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); -} - diff --git a/gnu/usr.bin/perl/win32/pod.mak b/gnu/usr.bin/perl/win32/pod.mak index c9569a3b5aa..b1a1b9c56ae 100644 --- a/gnu/usr.bin/perl/win32/pod.mak +++ b/gnu/usr.bin/perl/win32/pod.mak @@ -1,4 +1,5 @@ -CONVERTERS = pod2html pod2latex pod2man pod2text checkpods +CONVERTERS = pod2html pod2latex pod2man pod2text checkpods \ + pod2usage podchecker podselect HTMLROOT = / # Change this to fix cross-references in HTML POD2HTML = pod2html \ @@ -16,6 +17,8 @@ REALPERL = ..\perl.exe POD = \ perl.pod \ perldelta.pod \ + perl5004delta.pod \ + perl5005delta.pod \ perldata.pod \ perlsyn.pod \ perlop.pod \ @@ -31,6 +34,7 @@ POD = \ perlform.pod \ perllocale.pod \ perlref.pod \ + perlreftut.pod \ perldsc.pod \ perllol.pod \ perltoot.pod \ @@ -54,6 +58,8 @@ POD = \ perlxstut.pod \ perlguts.pod \ perlcall.pod \ + perltodo.pod \ + perlhist.pod \ perlfaq.pod \ perlfaq1.pod \ perlfaq2.pod \ @@ -69,6 +75,8 @@ POD = \ MAN = \ perl.man \ perldelta.man \ + perl5004delta.man \ + perl5005delta.man \ perldata.man \ perlsyn.man \ perlop.man \ @@ -108,6 +116,8 @@ MAN = \ perlxstut.man \ perlguts.man \ perlcall.man \ + perltodo.man \ + perlhist.man \ perlfaq.man \ perlfaq1.man \ perlfaq2.man \ @@ -123,6 +133,8 @@ MAN = \ HTML = \ perl.html \ perldelta.html \ + perl5004delta.html \ + perl5005delta.html \ perldata.html \ perlsyn.html \ perlop.html \ @@ -162,6 +174,8 @@ HTML = \ perlxstut.html \ perlguts.html \ perlcall.html \ + perltodo.html \ + perlhist.html \ perlfaq.html \ perlfaq1.html \ perlfaq2.html \ @@ -177,6 +191,8 @@ HTML = \ TEX = \ perl.tex \ perldelta.tex \ + perl5004delta.tex \ + perl5005delta.tex \ perldata.tex \ perlsyn.tex \ perlop.tex \ @@ -216,6 +232,8 @@ TEX = \ perlxstut.tex \ perlguts.tex \ perlcall.tex \ + perltodo.tex \ + perlhist.tex \ perlfaq.tex \ perlfaq1.tex \ perlfaq2.tex \ @@ -295,6 +313,15 @@ pod2text: pod2text.PL ../lib/Config.pm checkpods: checkpods.PL ../lib/Config.pm $(PERL) -I ../lib checkpods.PL +pod2usage: pod2usage.PL ../lib/Config.pm + $(PERL) -I ../lib pod2usage.PL + +podchecker: podchecker.PL ../lib/Config.pm + $(PERL) -I ../lib podchecker.PL + +podselect: podselect.PL ../lib/Config.pm + $(PERL) -I ../lib podselect.PL + compile: all $(REALPERL) -I../lib ../utils/perlcc -regex 's/$$/.exe/' pod2latex pod2man pod2text checkpods -prog -verbose dcf -log ../compilelog; diff --git a/gnu/usr.bin/perl/win32/runperl.c b/gnu/usr.bin/perl/win32/runperl.c index 8cf521d4ea5..85fd8317593 100644 --- a/gnu/usr.bin/perl/win32/runperl.c +++ b/gnu/usr.bin/perl/win32/runperl.c @@ -1,71 +1,7 @@ #include "EXTERN.h" #include "perl.h" -#ifdef PERL_OBJECT - -#define NO_XSLOCKS -#include "XSUB.H" -#include "win32iop.h" - -#include <fcntl.h> -#include "perlhost.h" - - -char *staticlinkmodules[] = { - "DynaLoader", - NULL, -}; - -EXTERN_C void boot_DynaLoader _((CV* cv _CPERLarg)); - -static void -xs_init(CPERLarg) -{ - char *file = __FILE__; - dXSUB_SYS; - newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); -} - -CPerlObj *pPerl; - -#undef PERL_SYS_INIT -#define PERL_SYS_INIT(a, c) - -int -main(int argc, char **argv, char **env) -{ - CPerlHost host; - int exitstatus = 1; -#ifndef __BORLANDC__ - /* XXX this _may_ be a problem on some compilers (e.g. Borland) that - * want to free() argv after main() returns. As luck would have it, - * Borland's CRT does the right thing to argv[0] already. */ - char szModuleName[MAX_PATH]; - - GetModuleFileName(NULL, szModuleName, sizeof(szModuleName)); - argv[0] = szModuleName; -#endif - - if (!host.PerlCreate()) - exit(exitstatus); - - exitstatus = host.PerlParse(xs_init, argc, argv, NULL); - - if (!exitstatus) - exitstatus = host.PerlRun(); - - host.PerlDestroy(); - - return exitstatus; -} - -#else /* PERL_OBJECT */ - #ifdef __GNUC__ -/* - * GNU C does not do __declspec() - */ -#define __declspec(foo) /* Mingw32 defaults to globing command line * This is inconsistent with other Win32 ports and @@ -76,21 +12,10 @@ int _CRT_glob = 0; #endif - -__declspec(dllimport) int RunPerl(int argc, char **argv, char **env, void *ios); - int main(int argc, char **argv, char **env) { -#ifndef __BORLANDC__ - /* XXX this _may_ be a problem on some compilers (e.g. Borland) that - * want to free() argv after main() returns. As luck would have it, - * Borland's CRT does the right thing to argv[0] already. */ - char szModuleName[MAX_PATH]; - GetModuleFileName(NULL, szModuleName, sizeof(szModuleName)); - argv[0] = szModuleName; -#endif - return RunPerl(argc, argv, env, (void*)0); + return RunPerl(argc, argv, env); } -#endif /* PERL_OBJECT */ + diff --git a/gnu/usr.bin/perl/win32/win32.c b/gnu/usr.bin/perl/win32/win32.c index 7b9acd4a8f1..840274beab5 100644 --- a/gnu/usr.bin/perl/win32/win32.c +++ b/gnu/usr.bin/perl/win32/win32.c @@ -15,18 +15,13 @@ #define Win32_Winsock #endif #include <windows.h> - -#ifndef __MINGW32__ -#include <lmcons.h> -#include <lmerr.h> -/* ugliness to work around a buggy struct definition in lmwksta.h */ -#undef LPTSTR -#define LPTSTR LPWSTR -#include <lmwksta.h> -#undef LPTSTR -#define LPTSTR LPSTR -#include <lmapibuf.h> -#endif /* __MINGW32__ */ +#ifndef __MINGW32__ /* GCC/Mingw32-2.95.2 forgot the WINAPI on CommandLineToArgvW() */ +# include <shellapi.h> +#else + LPWSTR* WINAPI CommandLineToArgvW(LPCWSTR lpCommandLine, int * pNumArgs); +#endif +#include <winnt.h> +#include <io.h> /* #include "config.h" */ @@ -35,20 +30,16 @@ #define PerlIO FILE #endif +#include <sys/stat.h> #include "EXTERN.h" #include "perl.h" -#include "patchlevel.h" - #define NO_XSLOCKS -#ifdef PERL_OBJECT -extern CPerlObj* pPerl; -#endif +#define PERL_NO_GET_CONTEXT #include "XSUB.h" #include "Win32iop.h" #include <fcntl.h> -#include <sys/stat.h> #ifndef __GNUC__ /* assert.h conflicts with #define of assert in perl.h */ #include <assert.h> @@ -70,113 +61,152 @@ extern CPerlObj* pPerl; int _CRT_glob = 0; #endif +#if defined(__MINGW32__) +/* Mingw32 is missing some prototypes */ +FILE * _wfopen(LPCWSTR wszFileName, LPCWSTR wszMode); +FILE * _wfdopen(int nFd, LPCWSTR wszMode); +FILE * _freopen(LPCWSTR wszFileName, LPCWSTR wszMode, FILE * pOldStream); +int _flushall(); +int _fcloseall(); +#endif + +#if defined(__BORLANDC__) +# define _stat stat +# define _utimbuf utimbuf +#endif + #define EXECF_EXEC 1 #define EXECF_SPAWN 2 #define EXECF_SPAWN_NOWAIT 3 +#if defined(PERL_IMPLICIT_SYS) +# undef win32_get_privlib +# define win32_get_privlib g_win32_get_privlib +# undef win32_get_sitelib +# define win32_get_sitelib g_win32_get_sitelib +# undef win32_get_vendorlib +# define win32_get_vendorlib g_win32_get_vendorlib +# undef do_spawn +# define do_spawn g_do_spawn +# undef getlogin +# define getlogin g_getlogin +#endif + #if defined(PERL_OBJECT) -#undef win32_get_privlib -#define win32_get_privlib g_win32_get_privlib -#undef win32_get_sitelib -#define win32_get_sitelib g_win32_get_sitelib -#undef do_aspawn -#define do_aspawn g_do_aspawn -#undef do_spawn -#define do_spawn g_do_spawn -#undef do_exec -#define do_exec g_do_exec -#undef getlogin -#define getlogin g_getlogin +# undef do_aspawn +# define do_aspawn g_do_aspawn +# undef Perl_do_exec +# define Perl_do_exec g_do_exec #endif -static DWORD os_id(void); static void get_shell(void); -static long tokenize(char *str, char **dest, char ***destv); +static long tokenize(const char *str, char **dest, char ***destv); int do_spawn2(char *cmd, int exectype); static BOOL has_shell_metachars(char *ptr); static long filetime_to_clock(PFILETIME ft); static BOOL filetime_from_time(PFILETIME ft, time_t t); -static char * get_emd_part(char *leading, char *trailing, ...); -static void remove_dead_process(HANDLE deceased); +static char * get_emd_part(SV **leading, char *trailing, ...); +static void remove_dead_process(long deceased); +static long find_pid(int pid); +static char * qualified_path(const char *cmd); +static char * win32_get_xlib(const char *pl, const char *xlib, + const char *libname); + +#ifdef USE_ITHREADS +static void remove_dead_pseudo_process(long child); +static long find_pseudo_pid(int pid); +#endif +START_EXTERN_C HANDLE w32_perldll_handle = INVALID_HANDLE_VALUE; +char w32_module_name[MAX_PATH+1]; +END_EXTERN_C + static DWORD w32_platform = (DWORD)-1; -#ifdef USE_THREADS -# ifdef USE_DECLSPEC_THREAD -__declspec(thread) char strerror_buffer[512]; -__declspec(thread) char getlogin_buffer[128]; -__declspec(thread) char w32_perllib_root[MAX_PATH+1]; -# ifdef HAVE_DES_FCRYPT -__declspec(thread) char crypt_buffer[30]; -# endif -# else -# define strerror_buffer (thr->i.Wstrerror_buffer) -# define getlogin_buffer (thr->i.Wgetlogin_buffer) -# define w32_perllib_root (thr->i.Ww32_perllib_root) -# define crypt_buffer (thr->i.Wcrypt_buffer) -# endif -#else -static char strerror_buffer[512]; -static char getlogin_buffer[128]; -static char w32_perllib_root[MAX_PATH+1]; -# ifdef HAVE_DES_FCRYPT -static char crypt_buffer[30]; -# endif -#endif +#define ONE_K_BUFSIZE 1024 int -IsWin95(void) { - return (os_id() == VER_PLATFORM_WIN32_WINDOWS); +IsWin95(void) +{ + return (win32_os_id() == VER_PLATFORM_WIN32_WINDOWS); } int -IsWinNT(void) { - return (os_id() == VER_PLATFORM_WIN32_NT); +IsWinNT(void) +{ + return (win32_os_id() == VER_PLATFORM_WIN32_NT); } -char* -GetRegStrFromKey(HKEY hkey, const char *lpszValueName, char** ptr, DWORD* lpDataLen) -{ /* Retrieve a REG_SZ or REG_EXPAND_SZ from the registry */ +EXTERN_C void +set_w32_module_name(void) +{ + char* ptr; + GetModuleFileName((HMODULE)((w32_perldll_handle == INVALID_HANDLE_VALUE) + ? GetModuleHandle(NULL) + : w32_perldll_handle), + w32_module_name, sizeof(w32_module_name)); + + /* try to get full path to binary (which may be mangled when perl is + * run from a 16-bit app) */ + /*PerlIO_printf(Perl_debug_log, "Before %s\n", w32_module_name);*/ + (void)win32_longpath(w32_module_name); + /*PerlIO_printf(Perl_debug_log, "After %s\n", w32_module_name);*/ + + /* normalize to forward slashes */ + ptr = w32_module_name; + while (*ptr) { + if (*ptr == '\\') + *ptr = '/'; + ++ptr; + } +} + +/* *svp (if non-NULL) is expected to be POK (valid allocated SvPVX(*svp)) */ +static char* +get_regstr_from(HKEY hkey, const char *valuename, SV **svp) +{ + /* Retrieve a REG_SZ or REG_EXPAND_SZ from the registry */ HKEY handle; DWORD type; const char *subkey = "Software\\Perl"; + char *str = Nullch; long retval; retval = RegOpenKeyEx(hkey, subkey, 0, KEY_READ, &handle); - if (retval == ERROR_SUCCESS){ - retval = RegQueryValueEx(handle, lpszValueName, 0, &type, NULL, lpDataLen); + if (retval == ERROR_SUCCESS) { + DWORD datalen; + retval = RegQueryValueEx(handle, valuename, 0, &type, NULL, &datalen); if (retval == ERROR_SUCCESS && type == REG_SZ) { - if (*ptr) { - Renew(*ptr, *lpDataLen, char); - } - else { - New(1312, *ptr, *lpDataLen, char); - } - retval = RegQueryValueEx(handle, lpszValueName, 0, NULL, (PBYTE)*ptr, lpDataLen); - if (retval != ERROR_SUCCESS) { - Safefree(*ptr); - *ptr = Nullch; + dTHXo; + if (!*svp) + *svp = sv_2mortal(newSVpvn("",0)); + SvGROW(*svp, datalen); + retval = RegQueryValueEx(handle, valuename, 0, NULL, + (PBYTE)SvPVX(*svp), &datalen); + if (retval == ERROR_SUCCESS) { + str = SvPVX(*svp); + SvCUR_set(*svp,datalen-1); } } RegCloseKey(handle); } - return *ptr; + return str; } -char* -GetRegStr(const char *lpszValueName, char** ptr, DWORD* lpDataLen) +/* *svp (if non-NULL) is expected to be POK (valid allocated SvPVX(*svp)) */ +static char* +get_regstr(const char *valuename, SV **svp) { - *ptr = GetRegStrFromKey(HKEY_CURRENT_USER, lpszValueName, ptr, lpDataLen); - if (*ptr == Nullch) - { - *ptr = GetRegStrFromKey(HKEY_LOCAL_MACHINE, lpszValueName, ptr, lpDataLen); - } - return *ptr; + char *str = get_regstr_from(HKEY_CURRENT_USER, valuename, svp); + if (!str) + str = get_regstr_from(HKEY_LOCAL_MACHINE, valuename, svp); + return str; } +/* *prev_pathp (if non-NULL) is expected to be POK (valid allocated SvPVX(sv)) */ static char * -get_emd_part(char *prev_path, char *trailing_path, ...) +get_emd_part(SV **prev_pathp, char *trailing_path, ...) { char base[10]; va_list ap; @@ -185,25 +215,33 @@ get_emd_part(char *prev_path, char *trailing_path, ...) char *optr; char *strip; int oldsize, newsize; + STRLEN baselen; va_start(ap, trailing_path); strip = va_arg(ap, char *); - sprintf(base, "%5.3f", (double) 5 + ((double) PATCHLEVEL / (double) 1000)); + sprintf(base, "%d.%d", (int)PERL_REVISION, (int)PERL_VERSION); + baselen = strlen(base); - GetModuleFileName((HMODULE)((w32_perldll_handle == INVALID_HANDLE_VALUE) - ? GetModuleHandle(NULL) : w32_perldll_handle), - mod_name, sizeof(mod_name)); - ptr = strrchr(mod_name, '\\'); + if (!*w32_module_name) { + set_w32_module_name(); + } + strcpy(mod_name, w32_module_name); + ptr = strrchr(mod_name, '/'); while (ptr && strip) { /* look for directories to skip back */ optr = ptr; *ptr = '\0'; - ptr = strrchr(mod_name, '\\'); + ptr = strrchr(mod_name, '/'); + /* avoid stripping component if there is no slash, + * or it doesn't match ... */ if (!ptr || stricmp(ptr+1, strip) != 0) { - if(!(*strip == '5' && *(ptr+1) == '5' && strncmp(strip, base, 5) == 0 - && strncmp(ptr+1, base, 5) == 0)) { - *optr = '\\'; + /* ... but not if component matches m|5\.$patchlevel.*| */ + if (!ptr || !(*strip == '5' && *(ptr+1) == '5' + && strncmp(strip, base, baselen) == 0 + && strncmp(ptr+1, base, baselen) == 0)) + { + *optr = '/'; ptr = optr; } } @@ -212,93 +250,98 @@ get_emd_part(char *prev_path, char *trailing_path, ...) if (!ptr) { ptr = mod_name; *ptr++ = '.'; - *ptr = '\\'; + *ptr = '/'; } va_end(ap); strcpy(++ptr, trailing_path); /* only add directory if it exists */ - if(GetFileAttributes(mod_name) != (DWORD) -1) { + if (GetFileAttributes(mod_name) != (DWORD) -1) { /* directory exists */ - newsize = strlen(mod_name) + 1; - if (prev_path) { - oldsize = strlen(prev_path) + 1; - newsize += oldsize; /* includes plus 1 for ';' */ - Renew(prev_path, newsize, char); - prev_path[oldsize-1] = ';'; - strcpy(&prev_path[oldsize], mod_name); - } - else { - New(1311, prev_path, newsize, char); - strcpy(prev_path, mod_name); - } + dTHXo; + if (!*prev_pathp) + *prev_pathp = sv_2mortal(newSVpvn("",0)); + sv_catpvn(*prev_pathp, ";", 1); + sv_catpv(*prev_pathp, mod_name); + return SvPVX(*prev_pathp); } - return prev_path; + return Nullch; } char * -win32_get_privlib(char *pl) +win32_get_privlib(const char *pl) { + dTHXo; char *stdlib = "lib"; char buffer[MAX_PATH+1]; - char *path = Nullch; - DWORD datalen; + SV *sv = Nullsv; /* $stdlib = $HKCU{"lib-$]"} || $HKLM{"lib-$]"} || $HKCU{"lib"} || $HKLM{"lib"} || ""; */ sprintf(buffer, "%s-%s", stdlib, pl); - path = GetRegStr(buffer, &path, &datalen); - if (!path) - path = GetRegStr(stdlib, &path, &datalen); + if (!get_regstr(buffer, &sv)) + (void)get_regstr(stdlib, &sv); /* $stdlib .= ";$EMD/../../lib" */ - return get_emd_part(path, stdlib, ARCHNAME, "bin", Nullch); + return get_emd_part(&sv, stdlib, ARCHNAME, "bin", Nullch); } -char * -win32_get_sitelib(char *pl) +static char * +win32_get_xlib(const char *pl, const char *xlib, const char *libname) { - char *sitelib = "sitelib"; + dTHXo; char regstr[40]; char pathstr[MAX_PATH+1]; DWORD datalen; - char *path1 = Nullch; - char *path2 = Nullch; int len, newsize; + SV *sv1 = Nullsv; + SV *sv2 = Nullsv; - /* $HKCU{"sitelib-$]"} || $HKLM{"sitelib-$]"} . ---; */ - sprintf(regstr, "%s-%s", sitelib, pl); - path1 = GetRegStr(regstr, &path1, &datalen); - - /* $sitelib .= - * ";$EMD/" . ((-d $EMD/../../../$]) ? "../../.." : "../.."). "/site/$]/lib"; */ - sprintf(pathstr, "site\\%s\\lib", pl); - path1 = get_emd_part(path1, pathstr, ARCHNAME, "bin", pl, Nullch); + /* $HKCU{"$xlib-$]"} || $HKLM{"$xlib-$]"} . ---; */ + sprintf(regstr, "%s-%s", xlib, pl); + (void)get_regstr(regstr, &sv1); - /* $HKCU{'sitelib'} || $HKLM{'sitelib'} . ---; */ - path2 = GetRegStr(sitelib, &path2, &datalen); + /* $xlib .= + * ";$EMD/" . ((-d $EMD/../../../$]) ? "../../.." : "../.."). "/$libname/$]/lib"; */ + sprintf(pathstr, "%s/%s/lib", libname, pl); + (void)get_emd_part(&sv1, pathstr, ARCHNAME, "bin", pl, Nullch); - /* $sitelib .= - * ";$EMD/" . ((-d $EMD/../../../$]) ? "../../.." : "../.."). "/site/lib"; */ - path2 = get_emd_part(path2, "site\\lib", ARCHNAME, "bin", pl, Nullch); + /* $HKCU{$xlib} || $HKLM{$xlib} . ---; */ + (void)get_regstr(xlib, &sv2); - if (!path1) - return path2; + /* $xlib .= + * ";$EMD/" . ((-d $EMD/../../../$]) ? "../../.." : "../.."). "/$libname/lib"; */ + sprintf(pathstr, "%s/lib", libname); + (void)get_emd_part(&sv2, pathstr, ARCHNAME, "bin", pl, Nullch); - if (!path2) - return path1; + if (!sv1 && !sv2) + return Nullch; + if (!sv1) + return SvPVX(sv2); + if (!sv2) + return SvPVX(sv1); - len = strlen(path1); - newsize = len + strlen(path2) + 2; /* plus one for ';' */ + sv_catpvn(sv1, ";", 1); + sv_catsv(sv1, sv2); - Renew(path1, newsize, char); - path1[len++] = ';'; - strcpy(&path1[len], path2); + return SvPVX(sv1); +} - Safefree(path2); - return path1; +char * +win32_get_sitelib(const char *pl) +{ + return win32_get_xlib(pl, "sitelib", "site"); } +#ifndef PERL_VENDORLIB_NAME +# define PERL_VENDORLIB_NAME "vendor" +#endif + +char * +win32_get_vendorlib(const char *pl) +{ + return win32_get_xlib(pl, "vendorlib", PERL_VENDORLIB_NAME); +} static BOOL has_shell_metachars(char *ptr) @@ -341,43 +384,42 @@ has_shell_metachars(char *ptr) return FALSE; } -#if !defined(PERL_OBJECT) +#if !defined(PERL_IMPLICIT_SYS) /* since the current process environment is being updated in util.c * the library functions will get the correct environment */ PerlIO * -my_popen(char *cmd, char *mode) +Perl_my_popen(pTHX_ char *cmd, char *mode) { #ifdef FIXCMD -#define fixcmd(x) { \ - char *pspace = strchr((x),' '); \ - if (pspace) { \ - char *p = (x); \ - while (p < pspace) { \ - if (*p == '/') \ - *p = '\\'; \ - p++; \ - } \ - } \ - } +#define fixcmd(x) { \ + char *pspace = strchr((x),' '); \ + if (pspace) { \ + char *p = (x); \ + while (p < pspace) { \ + if (*p == '/') \ + *p = '\\'; \ + p++; \ + } \ + } \ + } #else #define fixcmd(x) #endif fixcmd(cmd); - win32_fflush(stdout); - win32_fflush(stderr); + PERL_FLUSHALL_FOR_CHILD; return win32_popen(cmd, mode); } long -my_pclose(PerlIO *fp) +Perl_my_pclose(pTHX_ PerlIO *fp) { return win32_pclose(fp); } #endif -static DWORD -os_id(void) +DllExport unsigned long +win32_os_id(void) { static OSVERSIONINFO osver; @@ -387,7 +429,18 @@ os_id(void) GetVersionEx(&osver); w32_platform = osver.dwPlatformId; } - return (w32_platform); + return (unsigned long)w32_platform; +} + +DllExport int +win32_getpid(void) +{ +#ifdef USE_ITHREADS + dTHXo; + if (w32_pseudo_id) + return -((int)w32_pseudo_id); +#endif + return _getpid(); } /* Tokenize a string. Words are null-separated, and the list @@ -397,12 +450,13 @@ os_id(void) * Returns number of words in result buffer. */ static long -tokenize(char *str, char **dest, char ***destv) +tokenize(const char *str, char **dest, char ***destv) { char *retstart = Nullch; char **retvstart = 0; int items = -1; if (str) { + dTHXo; int slen = strlen(str); register char *ret; register char **retv; @@ -445,6 +499,7 @@ tokenize(char *str, char **dest, char ***destv) static void get_shell(void) { + dTHXo; if (!w32_perlshell_tokens) { /* we don't use COMSPEC here for two reasons: * 1. the same reason perl on UNIX doesn't use SHELL--rampant and @@ -453,8 +508,9 @@ get_shell(void) * interactive use (which is what most programs look in COMSPEC * for). */ - char* defaultshell = (IsWinNT() ? "cmd.exe /x/c" : "command.com /c"); - char *usershell = getenv("PERL5SHELL"); + const char* defaultshell = (IsWinNT() + ? "cmd.exe /x/c" : "command.com /c"); + const char *usershell = getenv("PERL5SHELL"); w32_perlshell_items = tokenize(usershell ? usershell : defaultshell, &w32_perlshell_tokens, &w32_perlshell_vec); @@ -464,6 +520,7 @@ get_shell(void) int do_aspawn(void *vreally, void **vmark, void **vsp) { + dTHXo; SV *really = (SV*)vreally; SV **mark = (SV**)vmark; SV **sp = (SV**)vsp; @@ -472,7 +529,6 @@ do_aspawn(void *vreally, void **vmark, void **vsp) int status; int flag = P_WAIT; int index = 0; - STRLEN n_a; if (sp <= mark) return -1; @@ -486,7 +542,7 @@ do_aspawn(void *vreally, void **vmark, void **vsp) } while (++mark <= sp) { - if (*mark && (str = SvPV(*mark, n_a))) + if (*mark && (str = SvPV_nolen(*mark))) argv[index++] = str; else argv[index++] = ""; @@ -494,7 +550,7 @@ do_aspawn(void *vreally, void **vmark, void **vsp) argv[index++] = 0; status = win32_spawnvp(flag, - (const char*)(really ? SvPV(really,n_a) : argv[0]), + (const char*)(really ? SvPV_nolen(really) : argv[0]), (const char* const*)argv); if (status < 0 && (errno == ENOEXEC || errno == ENOENT)) { @@ -507,14 +563,15 @@ do_aspawn(void *vreally, void **vmark, void **vsp) argv[sh_items] = w32_perlshell_vec[sh_items]; status = win32_spawnvp(flag, - (const char*)(really ? SvPV(really,n_a) : argv[0]), + (const char*)(really ? SvPV_nolen(really) : argv[0]), (const char* const*)argv); } if (flag != P_NOWAIT) { if (status < 0) { - if (PL_dowarn) - warn("Can't spawn \"%s\": %s", argv[0], strerror(errno)); + dTHR; + if (ckWARN(WARN_EXEC)) + Perl_warner(aTHX_ WARN_EXEC, "Can't spawn \"%s\": %s", argv[0], strerror(errno)); status = 255 * 256; } else @@ -528,6 +585,7 @@ do_aspawn(void *vreally, void **vmark, void **vsp) int do_spawn2(char *cmd, int exectype) { + dTHXo; char **a; char *s; char **argv; @@ -543,11 +601,11 @@ do_spawn2(char *cmd, int exectype) strcpy(cmd2, cmd); a = argv; for (s = cmd2; *s;) { - while (*s && isspace(*s)) + while (*s && isSPACE(*s)) s++; if (*s) *(a++) = s; - while (*s && !isspace(*s)) + while (*s && !isSPACE(*s)) s++; if (*s) *s++ = '\0'; @@ -600,8 +658,9 @@ do_spawn2(char *cmd, int exectype) } if (exectype != EXECF_SPAWN_NOWAIT) { if (status < 0) { - if (PL_dowarn) - warn("Can't %s \"%s\": %s", + dTHR; + if (ckWARN(WARN_EXEC)) + Perl_warner(aTHX_ WARN_EXEC, "Can't %s \"%s\": %s", (exectype == EXECF_EXEC ? "exec" : "spawn"), cmd, strerror(errno)); status = 255 * 256; @@ -626,7 +685,7 @@ do_spawn_nowait(char *cmd) } bool -do_exec(char *cmd) +Perl_do_exec(pTHX_ char *cmd) { do_spawn2(cmd, EXECF_EXEC); return FALSE; @@ -636,16 +695,21 @@ do_exec(char *cmd) * (separated by nulls) and when one of the other dir functions is called * return the pointer to the current file name. */ -DIR * +DllExport DIR * win32_opendir(char *filename) { - DIR *p; + dTHXo; + DIR *dirp; long len; long idx; char scanname[MAX_PATH+3]; struct stat sbuf; - WIN32_FIND_DATA FindData; + WIN32_FIND_DATAA aFindData; + WIN32_FIND_DATAW wFindData; HANDLE fh; + char buffer[MAX_PATH*2]; + WCHAR wbuffer[MAX_PATH+1]; + char* ptr; len = strlen(filename); if (len > MAX_PATH) @@ -656,69 +720,83 @@ win32_opendir(char *filename) return NULL; /* Get us a DIR structure */ - Newz(1303, p, 1, DIR); - if (p == NULL) - return NULL; + Newz(1303, dirp, 1, DIR); /* Create the search pattern */ strcpy(scanname, filename); - if (scanname[len-1] != '/' && scanname[len-1] != '\\') + + /* bare drive name means look in cwd for drive */ + if (len == 2 && isALPHA(scanname[0]) && scanname[1] == ':') { + scanname[len++] = '.'; scanname[len++] = '/'; + } + else if (scanname[len-1] != '/' && scanname[len-1] != '\\') { + scanname[len++] = '/'; + } scanname[len++] = '*'; scanname[len] = '\0'; /* do the FindFirstFile call */ - fh = FindFirstFile(scanname, &FindData); + if (USING_WIDE()) { + A2WHELPER(scanname, wbuffer, sizeof(wbuffer)); + fh = FindFirstFileW(PerlDir_mapW(wbuffer), &wFindData); + } + else { + fh = FindFirstFileA(PerlDir_mapA(scanname), &aFindData); + } + dirp->handle = fh; if (fh == INVALID_HANDLE_VALUE) { + DWORD err = GetLastError(); /* FindFirstFile() fails on empty drives! */ - if (GetLastError() == ERROR_FILE_NOT_FOUND) - return p; - Safefree( p); + switch (err) { + case ERROR_FILE_NOT_FOUND: + return dirp; + case ERROR_NO_MORE_FILES: + case ERROR_PATH_NOT_FOUND: + errno = ENOENT; + break; + case ERROR_NOT_ENOUGH_MEMORY: + errno = ENOMEM; + break; + default: + errno = EINVAL; + break; + } + Safefree(dirp); return NULL; } /* now allocate the first part of the string table for * the filenames that we find. */ - idx = strlen(FindData.cFileName)+1; - New(1304, p->start, idx, char); - if (p->start == NULL) - croak("opendir: malloc failed!\n"); - strcpy(p->start, FindData.cFileName); - p->nfiles++; - - /* loop finding all the files that match the wildcard - * (which should be all of them in this directory!). - * the variable idx should point one past the null terminator - * of the previous string found. - */ - while (FindNextFile(fh, &FindData)) { - len = strlen(FindData.cFileName); - /* bump the string table size by enough for the - * new name and it's null terminator - */ - Renew(p->start, idx+len+1, char); - if (p->start == NULL) - croak("opendir: malloc failed!\n"); - strcpy(&p->start[idx], FindData.cFileName); - p->nfiles++; - idx += len+1; + if (USING_WIDE()) { + W2AHELPER(wFindData.cFileName, buffer, sizeof(buffer)); + ptr = buffer; } - FindClose(fh); - p->size = idx; - p->curr = p->start; - return p; + else { + ptr = aFindData.cFileName; + } + idx = strlen(ptr)+1; + if (idx < 256) + dirp->size = 128; + else + dirp->size = idx; + New(1304, dirp->start, dirp->size, char); + strcpy(dirp->start, ptr); + dirp->nfiles++; + dirp->end = dirp->curr = dirp->start; + dirp->end += idx; + return dirp; } /* Readdir just returns the current string pointer and bumps the * string pointer to the nDllExport entry. */ -struct direct * +DllExport struct direct * win32_readdir(DIR *dirp) { - int len; - static int dummy = 0; + long len; if (dirp->curr) { /* first set up the structure to return */ @@ -727,14 +805,51 @@ win32_readdir(DIR *dirp) dirp->dirstr.d_namlen = len; /* Fake an inode */ - dirp->dirstr.d_ino = dummy++; + dirp->dirstr.d_ino = dirp->curr - dirp->start; - /* Now set up for the nDllExport call to readdir */ + /* Now set up for the next call to readdir */ dirp->curr += len + 1; - if (dirp->curr >= (dirp->start + dirp->size)) { - dirp->curr = NULL; + if (dirp->curr >= dirp->end) { + dTHXo; + char* ptr; + BOOL res; + WIN32_FIND_DATAW wFindData; + WIN32_FIND_DATAA aFindData; + char buffer[MAX_PATH*2]; + + /* finding the next file that matches the wildcard + * (which should be all of them in this directory!). + */ + if (USING_WIDE()) { + res = FindNextFileW(dirp->handle, &wFindData); + if (res) { + W2AHELPER(wFindData.cFileName, buffer, sizeof(buffer)); + ptr = buffer; + } + } + else { + res = FindNextFileA(dirp->handle, &aFindData); + if (res) + ptr = aFindData.cFileName; + } + if (res) { + long endpos = dirp->end - dirp->start; + long newsize = endpos + strlen(ptr) + 1; + /* bump the string table size by enough for the + * new name and it's null terminator */ + while (newsize > dirp->size) { + long curpos = dirp->curr - dirp->start; + dirp->size *= 2; + Renew(dirp->start, dirp->size, char); + dirp->curr = dirp->start + curpos; + } + strcpy(dirp->start + endpos, ptr); + dirp->end = dirp->start + newsize; + dirp->nfiles++; + } + else + dirp->curr = NULL; } - return &(dirp->dirstr); } else @@ -742,33 +857,36 @@ win32_readdir(DIR *dirp) } /* Telldir returns the current string pointer position */ -long +DllExport long win32_telldir(DIR *dirp) { - return (long) dirp->curr; + return (dirp->curr - dirp->start); } /* Seekdir moves the string pointer to a previously saved position - *(Saved by telldir). + * (returned by telldir). */ -void +DllExport void win32_seekdir(DIR *dirp, long loc) { - dirp->curr = (char *)loc; + dirp->curr = dirp->start + loc; } /* Rewinddir resets the string pointer to the start */ -void +DllExport void win32_rewinddir(DIR *dirp) { dirp->curr = dirp->start; } /* free the memory allocated by opendir */ -int +DllExport int win32_closedir(DIR *dirp) { + dTHXo; + if (dirp->handle != INVALID_HANDLE_VALUE) + FindClose(dirp->handle); Safefree(dirp->start); Safefree(dirp); return 1; @@ -828,9 +946,9 @@ setgid(gid_t agid) char * getlogin(void) { - dTHR; - char *buf = getlogin_buffer; - DWORD size = sizeof(getlogin_buffer); + dTHXo; + char *buf = w32_getlogin_buffer; + DWORD size = sizeof(w32_getlogin_buffer); if (GetUserName(buf,&size)) return buf; return (char*)NULL; @@ -843,44 +961,106 @@ chown(const char *path, uid_t owner, gid_t group) return 0; } +static long +find_pid(int pid) +{ + dTHXo; + long child = w32_num_children; + while (--child >= 0) { + if (w32_child_pids[child] == pid) + return child; + } + return -1; +} + static void -remove_dead_process(HANDLE deceased) -{ -#ifndef USE_RTL_WAIT - int child; - for (child = 0 ; child < w32_num_children ; ++child) { - if (w32_child_pids[child] == deceased) { - Copy(&w32_child_pids[child+1], &w32_child_pids[child], - (w32_num_children-child-1), HANDLE); - w32_num_children--; - break; - } +remove_dead_process(long child) +{ + if (child >= 0) { + dTHXo; + CloseHandle(w32_child_handles[child]); + Move(&w32_child_handles[child+1], &w32_child_handles[child], + (w32_num_children-child-1), HANDLE); + Move(&w32_child_pids[child+1], &w32_child_pids[child], + (w32_num_children-child-1), DWORD); + w32_num_children--; } -#endif } -DllExport int -win32_kill(int pid, int sig) +#ifdef USE_ITHREADS +static long +find_pseudo_pid(int pid) { -#ifdef USE_RTL_WAIT - HANDLE hProcess= OpenProcess(PROCESS_ALL_ACCESS, TRUE, pid); -#else - HANDLE hProcess = (HANDLE) pid; -#endif + dTHXo; + long child = w32_num_pseudo_children; + while (--child >= 0) { + if (w32_pseudo_child_pids[child] == pid) + return child; + } + return -1; +} - if (hProcess == NULL) { - croak("kill process failed!\n"); +static void +remove_dead_pseudo_process(long child) +{ + if (child >= 0) { + dTHXo; + CloseHandle(w32_pseudo_child_handles[child]); + Move(&w32_pseudo_child_handles[child+1], &w32_pseudo_child_handles[child], + (w32_num_pseudo_children-child-1), HANDLE); + Move(&w32_pseudo_child_pids[child+1], &w32_pseudo_child_pids[child], + (w32_num_pseudo_children-child-1), DWORD); + w32_num_pseudo_children--; } - else { - if (!TerminateProcess(hProcess, sig)) - croak("kill process failed!\n"); - CloseHandle(hProcess); +} +#endif - /* WaitForMultipleObjects() on a pid that was killed returns error - * so if we know the pid is gone we remove it from process list */ - remove_dead_process(hProcess); +DllExport int +win32_kill(int pid, int sig) +{ + dTHXo; + HANDLE hProcess; +#ifdef USE_ITHREADS + if (pid < 0) { + /* it is a pseudo-forked child */ + long child = find_pseudo_pid(-pid); + if (child >= 0) { + if (!sig) + return 0; + hProcess = w32_pseudo_child_handles[child]; + if (TerminateThread(hProcess, sig)) { + remove_dead_pseudo_process(child); + return 0; + } + } } - return 0; + else +#endif + { + long child = find_pid(pid); + if (child >= 0) { + if (!sig) + return 0; + hProcess = w32_child_handles[child]; + if (TerminateProcess(hProcess, sig)) { + remove_dead_process(child); + return 0; + } + } + else { + hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE, pid); + if (hProcess) { + if (!sig) + return 0; + if (TerminateProcess(hProcess, sig)) { + CloseHandle(hProcess); + return 0; + } + } + } + } + errno = EINVAL; + return -1; } /* @@ -895,143 +1075,306 @@ win32_sleep(unsigned int t) } DllExport int -win32_stat(const char *path, struct stat *buffer) +win32_stat(const char *path, struct stat *sbuf) { - char t[MAX_PATH+1]; - const char *p = path; + dTHXo; + char buffer[MAX_PATH+1]; int l = strlen(path); int res; + WCHAR wbuffer[MAX_PATH+1]; + WCHAR* pwbuffer; + HANDLE handle; + int nlink = 1; if (l > 1) { switch(path[l - 1]) { + /* FindFirstFile() and stat() are buggy with a trailing + * backslash, so change it to a forward slash :-( */ case '\\': - case '/': - if (path[l - 2] != ':') { - strncpy(t, path, l - 1); - t[l - 1] = 0; - p = t; - }; + strncpy(buffer, path, l-1); + buffer[l - 1] = '/'; + buffer[l] = '\0'; + path = buffer; + break; + /* FindFirstFile() is buggy with "x:", so add a dot :-( */ + case ':': + if (l == 2 && isALPHA(path[0])) { + buffer[0] = path[0]; + buffer[1] = ':'; + buffer[2] = '.'; + buffer[3] = '\0'; + l = 3; + path = buffer; + } + break; } } - res = stat(p,buffer); + + /* We *must* open & close the file once; otherwise file attribute changes */ + /* might not yet have propagated to "other" hard links of the same file. */ + /* This also gives us an opportunity to determine the number of links. */ + if (USING_WIDE()) { + A2WHELPER(path, wbuffer, sizeof(wbuffer)); + pwbuffer = PerlDir_mapW(wbuffer); + handle = CreateFileW(pwbuffer, 0, 0, NULL, OPEN_EXISTING, 0, NULL); + } + else { + path = PerlDir_mapA(path); + l = strlen(path); + handle = CreateFileA(path, 0, 0, NULL, OPEN_EXISTING, 0, NULL); + } + if (handle != INVALID_HANDLE_VALUE) { + BY_HANDLE_FILE_INFORMATION bhi; + if (GetFileInformationByHandle(handle, &bhi)) + nlink = bhi.nNumberOfLinks; + CloseHandle(handle); + } + + /* pwbuffer or path will be mapped correctly above */ + if (USING_WIDE()) { + res = _wstat(pwbuffer, (struct _stat *)sbuf); + } + else { + res = stat(path, sbuf); + } + sbuf->st_nlink = nlink; + if (res < 0) { /* CRT is buggy on sharenames, so make sure it really isn't. * XXX using GetFileAttributesEx() will enable us to set - * buffer->st_*time (but note that's not available on the + * sbuf->st_*time (but note that's not available on the * Windows of 1995) */ - DWORD r = GetFileAttributes(p); + DWORD r; + if (USING_WIDE()) { + r = GetFileAttributesW(pwbuffer); + } + else { + r = GetFileAttributesA(path); + } if (r != 0xffffffff && (r & FILE_ATTRIBUTE_DIRECTORY)) { - buffer->st_mode |= S_IFDIR | S_IREAD; + /* sbuf may still contain old garbage since stat() failed */ + Zero(sbuf, 1, struct stat); + sbuf->st_mode = S_IFDIR | S_IREAD; errno = 0; if (!(r & FILE_ATTRIBUTE_READONLY)) - buffer->st_mode |= S_IWRITE | S_IEXEC; + sbuf->st_mode |= S_IWRITE | S_IEXEC; return 0; } } else { - if (l == 3 && path[l-2] == ':' - && (path[l-1] == '\\' || path[l-1] == '/')) + if (l == 3 && isALPHA(path[0]) && path[1] == ':' + && (path[2] == '\\' || path[2] == '/')) { /* The drive can be inaccessible, some _stat()s are buggy */ - if (!GetVolumeInformation(path,NULL,0,NULL,NULL,NULL,NULL,0)) { + if (USING_WIDE() + ? !GetVolumeInformationW(pwbuffer,NULL,0,NULL,NULL,NULL,NULL,0) + : !GetVolumeInformationA(path,NULL,0,NULL,NULL,NULL,NULL,0)) { errno = ENOENT; return -1; } } #ifdef __BORLANDC__ - if (S_ISDIR(buffer->st_mode)) - buffer->st_mode |= S_IWRITE | S_IEXEC; - else if (S_ISREG(buffer->st_mode)) { + if (S_ISDIR(sbuf->st_mode)) + sbuf->st_mode |= S_IWRITE | S_IEXEC; + else if (S_ISREG(sbuf->st_mode)) { + int perms; if (l >= 4 && path[l-4] == '.') { const char *e = path + l - 3; if (strnicmp(e,"exe",3) && strnicmp(e,"bat",3) && strnicmp(e,"com",3) && (IsWin95() || strnicmp(e,"cmd",3))) - buffer->st_mode &= ~S_IEXEC; + sbuf->st_mode &= ~S_IEXEC; else - buffer->st_mode |= S_IEXEC; + sbuf->st_mode |= S_IEXEC; } else - buffer->st_mode &= ~S_IEXEC; + sbuf->st_mode &= ~S_IEXEC; + /* Propagate permissions to _group_ and _others_ */ + perms = sbuf->st_mode & (S_IREAD|S_IWRITE|S_IEXEC); + sbuf->st_mode |= (perms>>3) | (perms>>6); } #endif } return res; } +/* Find the longname of a given path. path is destructively modified. + * It should have space for at least MAX_PATH characters. */ +DllExport char * +win32_longpath(char *path) +{ + WIN32_FIND_DATA fdata; + HANDLE fhand; + char tmpbuf[MAX_PATH+1]; + char *tmpstart = tmpbuf; + char *start = path; + char sep; + if (!path) + return Nullch; + + /* drive prefix */ + if (isALPHA(path[0]) && path[1] == ':' && + (path[2] == '/' || path[2] == '\\')) + { + start = path + 2; + *tmpstart++ = path[0]; + *tmpstart++ = ':'; + } + /* UNC prefix */ + else if ((path[0] == '/' || path[0] == '\\') && + (path[1] == '/' || path[1] == '\\')) + { + start = path + 2; + *tmpstart++ = path[0]; + *tmpstart++ = path[1]; + /* copy machine name */ + while (*start && *start != '/' && *start != '\\') + *tmpstart++ = *start++; + if (*start) { + *tmpstart++ = *start; + start++; + /* copy share name */ + while (*start && *start != '/' && *start != '\\') + *tmpstart++ = *start++; + } + } + sep = *start++; + if (sep == '/' || sep == '\\') + *tmpstart++ = sep; + *tmpstart = '\0'; + while (sep) { + /* walk up to slash */ + while (*start && *start != '/' && *start != '\\') + ++start; + + /* discard doubled slashes */ + while (*start && (start[1] == '/' || start[1] == '\\')) + ++start; + sep = *start; + + /* stop and find full name of component */ + *start = '\0'; + fhand = FindFirstFile(path,&fdata); + if (fhand != INVALID_HANDLE_VALUE) { + strcpy(tmpstart, fdata.cFileName); + tmpstart += strlen(fdata.cFileName); + if (sep) + *tmpstart++ = sep; + *tmpstart = '\0'; + *start++ = sep; + FindClose(fhand); + } + else { + /* failed a step, just return without side effects */ + /*PerlIO_printf(Perl_debug_log, "Failed to find %s\n", path);*/ + *start = sep; + return Nullch; + } + } + strcpy(path,tmpbuf); + return path; +} + #ifndef USE_WIN32_RTL_ENV DllExport char * win32_getenv(const char *name) { - static char *curitem = Nullch; /* XXX threadead */ - static DWORD curlen = 0; /* XXX threadead */ + dTHXo; + WCHAR wBuffer[MAX_PATH+1]; DWORD needlen; - if (!curitem) { - curlen = 512; - New(1305,curitem,curlen,char); - } + SV *curitem = Nullsv; - needlen = GetEnvironmentVariable(name,curitem,curlen); + if (USING_WIDE()) { + A2WHELPER(name, wBuffer, sizeof(wBuffer)); + needlen = GetEnvironmentVariableW(wBuffer, NULL, 0); + } + else + needlen = GetEnvironmentVariableA(name,NULL,0); if (needlen != 0) { - while (needlen > curlen) { - Renew(curitem,needlen,char); - curlen = needlen; - needlen = GetEnvironmentVariable(name,curitem,curlen); + curitem = sv_2mortal(newSVpvn("", 0)); + if (USING_WIDE()) { + SV *acuritem; + do { + SvGROW(curitem, (needlen+1)*sizeof(WCHAR)); + needlen = GetEnvironmentVariableW(wBuffer, + (WCHAR*)SvPVX(curitem), + needlen); + } while (needlen >= SvLEN(curitem)/sizeof(WCHAR)); + SvCUR_set(curitem, (needlen*sizeof(WCHAR))+1); + acuritem = sv_2mortal(newSVsv(curitem)); + W2AHELPER((WCHAR*)SvPVX(acuritem), SvPVX(curitem), SvCUR(curitem)); + } + else { + do { + SvGROW(curitem, needlen+1); + needlen = GetEnvironmentVariableA(name,SvPVX(curitem), + needlen); + } while (needlen >= SvLEN(curitem)); + SvCUR_set(curitem, needlen); } } else { /* allow any environment variables that begin with 'PERL' to be stored in the registry */ - if (curitem) - *curitem = '\0'; - - if (strncmp(name, "PERL", 4) == 0) { - if (curitem) { - Safefree(curitem); - curitem = Nullch; - curlen = 0; - } - curitem = GetRegStr(name, &curitem, &curlen); - } + if (strncmp(name, "PERL", 4) == 0) + (void)get_regstr(name, &curitem); } - if (curitem && *curitem == '\0') - return Nullch; + if (curitem && SvCUR(curitem)) + return SvPVX(curitem); - return curitem; + return Nullch; } DllExport int win32_putenv(const char *name) { + dTHXo; char* curitem; char* val; - int relval = -1; - if(name) { - New(1309,curitem,strlen(name)+1,char); - strcpy(curitem, name); - val = strchr(curitem, '='); - if(val) { - /* The sane way to deal with the environment. - * Has these advantages over putenv() & co.: - * * enables us to store a truly empty value in the - * environment (like in UNIX). - * * we don't have to deal with RTL globals, bugs and leaks. - * * Much faster. - * Why you may want to enable USE_WIN32_RTL_ENV: - * * environ[] and RTL functions will not reflect changes, - * which might be an issue if extensions want to access - * the env. via RTL. This cuts both ways, since RTL will - * not see changes made by extensions that call the Win32 - * functions directly, either. - * GSAR 97-06-07 - */ - *val++ = '\0'; - if(SetEnvironmentVariable(curitem, *val ? val : NULL)) - relval = 0; + WCHAR* wCuritem; + WCHAR* wVal; + int length, relval = -1; + + if (name) { + if (USING_WIDE()) { + length = strlen(name)+1; + New(1309,wCuritem,length,WCHAR); + A2WHELPER(name, wCuritem, length*sizeof(WCHAR)); + wVal = wcschr(wCuritem, '='); + if (wVal) { + *wVal++ = '\0'; + if (SetEnvironmentVariableW(wCuritem, *wVal ? wVal : NULL)) + relval = 0; + } + Safefree(wCuritem); + } + else { + New(1309,curitem,strlen(name)+1,char); + strcpy(curitem, name); + val = strchr(curitem, '='); + if (val) { + /* The sane way to deal with the environment. + * Has these advantages over putenv() & co.: + * * enables us to store a truly empty value in the + * environment (like in UNIX). + * * we don't have to deal with RTL globals, bugs and leaks. + * * Much faster. + * Why you may want to enable USE_WIN32_RTL_ENV: + * * environ[] and RTL functions will not reflect changes, + * which might be an issue if extensions want to access + * the env. via RTL. This cuts both ways, since RTL will + * not see changes made by extensions that call the Win32 + * functions directly, either. + * GSAR 97-06-07 + */ + *val++ = '\0'; + if (SetEnvironmentVariableA(curitem, *val ? val : NULL)) + relval = 0; + } + Safefree(curitem); } - Safefree(curitem); } return relval; } @@ -1041,11 +1384,11 @@ win32_putenv(const char *name) static long filetime_to_clock(PFILETIME ft) { - __int64 qw = ft->dwHighDateTime; - qw <<= 32; - qw |= ft->dwLowDateTime; - qw /= 10000; /* File time ticks at 0.1uS, clock at 1mS */ - return (long) qw; + __int64 qw = ft->dwHighDateTime; + qw <<= 32; + qw |= ft->dwLowDateTime; + qw /= 10000; /* File time ticks at 0.1uS, clock at 1mS */ + return (long) qw; } DllExport int @@ -1072,14 +1415,13 @@ win32_times(struct tms *timebuf) return 0; } -/* fix utime() so it works on directories in NT - * thanks to Jan Dubois <jan.dubois@ibm.net> - */ +/* fix utime() so it works on directories in NT */ static BOOL filetime_from_time(PFILETIME pFileTime, time_t Time) { - struct tm *pTM = gmtime(&Time); + struct tm *pTM = localtime(&Time); SYSTEMTIME SystemTime; + FILETIME LocalTime; if (pTM == NULL) return FALSE; @@ -1092,19 +1434,77 @@ filetime_from_time(PFILETIME pFileTime, time_t Time) SystemTime.wSecond = pTM->tm_sec; SystemTime.wMilliseconds = 0; - return SystemTimeToFileTime(&SystemTime, pFileTime); + return SystemTimeToFileTime(&SystemTime, &LocalTime) && + LocalFileTimeToFileTime(&LocalTime, pFileTime); +} + +DllExport int +win32_unlink(const char *filename) +{ + dTHXo; + int ret; + DWORD attrs; + + if (USING_WIDE()) { + WCHAR wBuffer[MAX_PATH+1]; + WCHAR* pwBuffer; + + A2WHELPER(filename, wBuffer, sizeof(wBuffer)); + pwBuffer = PerlDir_mapW(wBuffer); + attrs = GetFileAttributesW(pwBuffer); + if (attrs == 0xFFFFFFFF) + goto fail; + if (attrs & FILE_ATTRIBUTE_READONLY) { + (void)SetFileAttributesW(pwBuffer, attrs & ~FILE_ATTRIBUTE_READONLY); + ret = _wunlink(pwBuffer); + if (ret == -1) + (void)SetFileAttributesW(pwBuffer, attrs); + } + else + ret = _wunlink(pwBuffer); + } + else { + filename = PerlDir_mapA(filename); + attrs = GetFileAttributesA(filename); + if (attrs == 0xFFFFFFFF) + goto fail; + if (attrs & FILE_ATTRIBUTE_READONLY) { + (void)SetFileAttributesA(filename, attrs & ~FILE_ATTRIBUTE_READONLY); + ret = unlink(filename); + if (ret == -1) + (void)SetFileAttributesA(filename, attrs); + } + else + ret = unlink(filename); + } + return ret; +fail: + errno = ENOENT; + return -1; } DllExport int win32_utime(const char *filename, struct utimbuf *times) { + dTHXo; HANDLE handle; FILETIME ftCreate; FILETIME ftAccess; FILETIME ftWrite; struct utimbuf TimeBuffer; + WCHAR wbuffer[MAX_PATH+1]; + WCHAR* pwbuffer; - int rc = utime(filename,times); + int rc; + if (USING_WIDE()) { + A2WHELPER(filename, wbuffer, sizeof(wbuffer)); + pwbuffer = PerlDir_mapW(wbuffer); + rc = _wutime(pwbuffer, (struct _utimbuf*)times); + } + else { + filename = PerlDir_mapA(filename); + rc = utime(filename, times); + } /* EACCES: path specifies directory or readonly file */ if (rc == 0 || errno != EACCES /* || !IsWinNT() */) return rc; @@ -1116,9 +1516,16 @@ win32_utime(const char *filename, struct utimbuf *times) } /* This will (and should) still fail on readonly files */ - handle = CreateFile(filename, GENERIC_READ | GENERIC_WRITE, - FILE_SHARE_READ | FILE_SHARE_DELETE, NULL, - OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); + if (USING_WIDE()) { + handle = CreateFileW(pwbuffer, GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_DELETE, NULL, + OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); + } + else { + handle = CreateFileA(filename, GENERIC_READ | GENERIC_WRITE, + FILE_SHARE_READ | FILE_SHARE_DELETE, NULL, + OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); + } if (handle == INVALID_HANDLE_VALUE) return rc; @@ -1135,35 +1542,181 @@ win32_utime(const char *filename, struct utimbuf *times) } DllExport int +win32_uname(struct utsname *name) +{ + struct hostent *hep; + STRLEN nodemax = sizeof(name->nodename)-1; + OSVERSIONINFO osver; + + memset(&osver, 0, sizeof(OSVERSIONINFO)); + osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + if (GetVersionEx(&osver)) { + /* sysname */ + switch (osver.dwPlatformId) { + case VER_PLATFORM_WIN32_WINDOWS: + strcpy(name->sysname, "Windows"); + break; + case VER_PLATFORM_WIN32_NT: + strcpy(name->sysname, "Windows NT"); + break; + case VER_PLATFORM_WIN32s: + strcpy(name->sysname, "Win32s"); + break; + default: + strcpy(name->sysname, "Win32 Unknown"); + break; + } + + /* release */ + sprintf(name->release, "%d.%d", + osver.dwMajorVersion, osver.dwMinorVersion); + + /* version */ + sprintf(name->version, "Build %d", + osver.dwPlatformId == VER_PLATFORM_WIN32_NT + ? osver.dwBuildNumber : (osver.dwBuildNumber & 0xffff)); + if (osver.szCSDVersion[0]) { + char *buf = name->version + strlen(name->version); + sprintf(buf, " (%s)", osver.szCSDVersion); + } + } + else { + *name->sysname = '\0'; + *name->version = '\0'; + *name->release = '\0'; + } + + /* nodename */ + hep = win32_gethostbyname("localhost"); + if (hep) { + STRLEN len = strlen(hep->h_name); + if (len <= nodemax) { + strcpy(name->nodename, hep->h_name); + } + else { + strncpy(name->nodename, hep->h_name, nodemax); + name->nodename[nodemax] = '\0'; + } + } + else { + DWORD sz = nodemax; + if (!GetComputerName(name->nodename, &sz)) + *name->nodename = '\0'; + } + + /* machine (architecture) */ + { + SYSTEM_INFO info; + char *arch; + GetSystemInfo(&info); + +#if defined(__BORLANDC__) || defined(__MINGW32__) + switch (info.u.s.wProcessorArchitecture) { +#else + switch (info.wProcessorArchitecture) { +#endif + case PROCESSOR_ARCHITECTURE_INTEL: + arch = "x86"; break; + case PROCESSOR_ARCHITECTURE_MIPS: + arch = "mips"; break; + case PROCESSOR_ARCHITECTURE_ALPHA: + arch = "alpha"; break; + case PROCESSOR_ARCHITECTURE_PPC: + arch = "ppc"; break; + default: + arch = "unknown"; break; + } + strcpy(name->machine, arch); + } + return 0; +} + +DllExport int win32_waitpid(int pid, int *status, int flags) { - int rc; - if (pid == -1) - return win32_wait(status); + dTHXo; + int retval = -1; + if (pid == -1) /* XXX threadid == 1 ? */ + return win32_wait(status); +#ifdef USE_ITHREADS + else if (pid < 0) { + long child = find_pseudo_pid(-pid); + if (child >= 0) { + HANDLE hThread = w32_pseudo_child_handles[child]; + DWORD waitcode = WaitForSingleObject(hThread, INFINITE); + if (waitcode != WAIT_FAILED) { + if (GetExitCodeThread(hThread, &waitcode)) { + *status = (int)((waitcode & 0xff) << 8); + retval = (int)w32_pseudo_child_pids[child]; + remove_dead_pseudo_process(child); + return retval; + } + } + else + errno = ECHILD; + } + } +#endif else { - rc = cwait(status, pid, WAIT_CHILD); - /* cwait() returns "correctly" on Borland */ + long child = find_pid(pid); + if (child >= 0) { + HANDLE hProcess = w32_child_handles[child]; + DWORD waitcode = WaitForSingleObject(hProcess, INFINITE); + if (waitcode != WAIT_FAILED) { + if (GetExitCodeProcess(hProcess, &waitcode)) { + *status = (int)((waitcode & 0xff) << 8); + retval = (int)w32_child_pids[child]; + remove_dead_process(child); + return retval; + } + } + else + errno = ECHILD; + } + else { + retval = cwait(status, pid, WAIT_CHILD); + /* cwait() returns "correctly" on Borland */ #ifndef __BORLANDC__ - if (status) - *status *= 256; + if (status) + *status *= 256; #endif - remove_dead_process((HANDLE)pid); + } } - return rc >= 0 ? pid : rc; + return retval >= 0 ? pid : retval; } DllExport int win32_wait(int *status) { -#ifdef USE_RTL_WAIT - return wait(status); -#else /* XXX this wait emulation only knows about processes * spawned via win32_spawnvp(P_NOWAIT, ...). */ + dTHXo; int i, retval; DWORD exitcode, waitcode; +#ifdef USE_ITHREADS + if (w32_num_pseudo_children) { + waitcode = WaitForMultipleObjects(w32_num_pseudo_children, + w32_pseudo_child_handles, + FALSE, + INFINITE); + if (waitcode != WAIT_FAILED) { + if (waitcode >= WAIT_ABANDONED_0 + && waitcode < WAIT_ABANDONED_0 + w32_num_pseudo_children) + i = waitcode - WAIT_ABANDONED_0; + else + i = waitcode - WAIT_OBJECT_0; + if (GetExitCodeThread(w32_pseudo_child_handles[i], &exitcode)) { + *status = (int)((exitcode & 0xff) << 8); + retval = (int)w32_pseudo_child_pids[i]; + remove_dead_pseudo_process(i); + return retval; + } + } + } +#endif + if (!w32_num_children) { errno = ECHILD; return -1; @@ -1171,7 +1724,7 @@ win32_wait(int *status) /* if a child exists, wait for it to die */ waitcode = WaitForMultipleObjects(w32_num_children, - w32_child_pids, + w32_child_handles, FALSE, INFINITE); if (waitcode != WAIT_FAILED) { @@ -1180,13 +1733,10 @@ win32_wait(int *status) i = waitcode - WAIT_ABANDONED_0; else i = waitcode - WAIT_OBJECT_0; - if (GetExitCodeProcess(w32_child_pids[i], &exitcode) ) { - CloseHandle(w32_child_pids[i]); + if (GetExitCodeProcess(w32_child_handles[i], &exitcode) ) { *status = (int)((exitcode & 0xff) << 8); retval = (int)w32_child_pids[i]; - Copy(&w32_child_pids[i+1], &w32_child_pids[i], - (w32_num_children-i-1), HANDLE); - w32_num_children--; + remove_dead_process(i); return retval; } } @@ -1194,22 +1744,25 @@ win32_wait(int *status) FAILED: errno = GetLastError(); return -1; - -#endif } +#ifndef PERL_OBJECT + static UINT timerid = 0; static VOID CALLBACK TimerProc(HWND win, UINT msg, UINT id, DWORD time) { - KillTimer(NULL,timerid); - timerid=0; - sighandler(14); + dTHXo; + KillTimer(NULL,timerid); + timerid=0; + sighandler(14); } +#endif /* !PERL_OBJECT */ DllExport unsigned int win32_alarm(unsigned int sec) { +#ifndef PERL_OBJECT /* * the 'obvious' implentation is SetTimer() with a callback * which does whatever receiving SIGALRM would do @@ -1219,11 +1772,12 @@ win32_alarm(unsigned int sec) * Snag is unless something is looking at the message queue * nothing happens :-( */ + dTHXo; if (sec) { timerid = SetTimer(NULL,timerid,sec*1000,(TIMERPROC)TimerProc); if (!timerid) - croak("Cannot set timer"); + Perl_croak_nocontext("Cannot set timer"); } else { @@ -1233,10 +1787,10 @@ win32_alarm(unsigned int sec) timerid=0; } } +#endif /* !PERL_OBJECT */ return 0; } -#if defined(HAVE_DES_FCRYPT) || defined(PERL_OBJECT) #ifdef HAVE_DES_FCRYPT extern char * des_fcrypt(const char *txt, const char *salt, char *cbuf); #endif @@ -1244,63 +1798,81 @@ extern char * des_fcrypt(const char *txt, const char *salt, char *cbuf); DllExport char * win32_crypt(const char *txt, const char *salt) { + dTHXo; #ifdef HAVE_DES_FCRYPT dTHR; - return des_fcrypt(txt, salt, crypt_buffer); + return des_fcrypt(txt, salt, w32_crypt_buffer); #else - die("The crypt() function is unimplemented due to excessive paranoia."); + Perl_croak(aTHX_ "The crypt() function is unimplemented due to excessive paranoia."); return Nullch; #endif } -#endif -#ifdef USE_FIXED_OSFHANDLE +/* C doesn't like repeat struct definitions */ + +#if defined(USE_FIXED_OSFHANDLE) || defined(PERL_MSVCRT_READFIX) -EXTERN_C int __cdecl _alloc_osfhnd(void); -EXTERN_C int __cdecl _set_osfhnd(int fh, long value); -EXTERN_C void __cdecl _lock_fhandle(int); -EXTERN_C void __cdecl _unlock_fhandle(int); -EXTERN_C void __cdecl _unlock(int); +#ifndef _CRTIMP +#define _CRTIMP __declspec(dllimport) +#endif -#if (_MSC_VER >= 1000) -typedef struct { +/* + * Control structure for lowio file handles + */ +typedef struct { long osfhnd; /* underlying OS file HANDLE */ char osfile; /* attributes of file (e.g., open in text mode?) */ char pipech; /* one char buffer for handles opened on pipes */ -#if defined (_MT) && !defined (DLL_FOR_WIN32S) int lockinitflag; CRITICAL_SECTION lock; -#endif /* defined (_MT) && !defined (DLL_FOR_WIN32S) */ -} ioinfo; +} ioinfo; + + +/* + * Array of arrays of control structures for lowio files. + */ +EXTERN_C _CRTIMP ioinfo* __pioinfo[]; + +/* + * Definition of IOINFO_L2E, the log base 2 of the number of elements in each + * array of ioinfo structs. + */ +#define IOINFO_L2E 5 + +/* + * Definition of IOINFO_ARRAY_ELTS, the number of elements in ioinfo array + */ +#define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E) -EXTERN_C ioinfo * __pioinfo[]; +/* + * Access macros for getting at an ioinfo struct and its fields from a + * file handle + */ +#define _pioinfo(i) (__pioinfo[(i) >> IOINFO_L2E] + ((i) & (IOINFO_ARRAY_ELTS - 1))) +#define _osfhnd(i) (_pioinfo(i)->osfhnd) +#define _osfile(i) (_pioinfo(i)->osfile) +#define _pipech(i) (_pioinfo(i)->pipech) -#define IOINFO_L2E 5 -#define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E) -#define _pioinfo(i) (__pioinfo[i >> IOINFO_L2E] + (i & (IOINFO_ARRAY_ELTS - 1))) -#define _osfile(i) (_pioinfo(i)->osfile) +#endif -#else /* (_MSC_VER >= 1000) */ -extern char _osfile[]; -#endif /* (_MSC_VER >= 1000) */ +#ifdef USE_FIXED_OSFHANDLE #define FOPEN 0x01 /* file handle open */ +#define FNOINHERIT 0x10 /* file handle opened O_NOINHERIT */ #define FAPPEND 0x20 /* file handle opened O_APPEND */ #define FDEV 0x40 /* file handle refers to device */ #define FTEXT 0x80 /* file handle is in text mode */ -#define _STREAM_LOCKS 26 /* Table of stream locks */ -#define _LAST_STREAM_LOCK (_STREAM_LOCKS+_NSTREAM_-1) /* Last stream lock */ -#define _FH_LOCKS (_LAST_STREAM_LOCK+1) /* Table of fh locks */ - /*** *int my_open_osfhandle(long osfhandle, int flags) - open C Runtime file handle * *Purpose: * This function allocates a free C Runtime file handle and associates * it with the Win32 HANDLE specified by the first parameter. This is a -* temperary fix for WIN95's brain damage GetFileType() error on socket -* we just bypass that call for socket +* temperary fix for WIN95's brain damage GetFileType() error on socket +* we just bypass that call for socket +* +* This works with MSVC++ 4.0+ or GCC/Mingw32 * *Entry: * long osfhandle - Win32 HANDLE to associate with C Runtime file handle. @@ -1314,6 +1886,31 @@ extern char _osfile[]; * *******************************************************************************/ +/* + * we fake up some parts of the CRT that aren't exported by MSVCRT.dll + * this lets sockets work on Win9X with GCC and should fix the problems + * with perl95.exe + * -- BKS, 1-23-2000 +*/ + +/* since we are not doing a dup2(), this works fine */ + +#define _set_osfhnd(fh, osfh) (void)(_osfhnd(fh) = osfh) + +/* create an ioinfo entry, kill its handle, and steal the entry */ + +static int +_alloc_osfhnd(void) +{ + HANDLE hF = CreateFile("NUL", 0, 0, NULL, OPEN_ALWAYS, 0, NULL); + int fh = _open_osfhandle((long)hF, 0); + CloseHandle(hF); + if (fh == -1) + return fh; + EnterCriticalSection(&(_pioinfo(fh)->lock)); + return fh; +} + static int my_open_osfhandle(long osfhandle, int flags) { @@ -1329,6 +1926,9 @@ my_open_osfhandle(long osfhandle, int flags) if (flags & O_TEXT) fileflags |= FTEXT; + if (flags & O_NOINHERIT) + fileflags |= FNOINHERIT; + /* attempt to allocate a C Runtime file handle */ if ((fh = _alloc_osfhnd()) == -1) { errno = EMFILE; /* too many open files */ @@ -1341,18 +1941,12 @@ my_open_osfhandle(long osfhandle, int flags) fileflags |= FOPEN; /* mark as open */ -#if (_MSC_VER >= 1000) _osfile(fh) = fileflags; /* set osfile entry */ - _unlock_fhandle(fh); -#else - _osfile[fh] = fileflags; /* set osfile entry */ - _unlock(fh+_FH_LOCKS); /* unlock handle */ -#endif + LeaveCriticalSection(&_pioinfo(fh)->lock); return fh; /* return handle */ } -#define _open_osfhandle my_open_osfhandle #endif /* USE_FIXED_OSFHANDLE */ /* simulate flock by locking a range on the file */ @@ -1368,7 +1962,8 @@ win32_flock(int fd, int oper) HANDLE fh; if (!IsWinNT()) { - croak("flock() unimplemented on this platform"); + dTHXo; + Perl_croak_nocontext("flock() unimplemented on this platform"); return -1; } fh = (HANDLE)_get_osfhandle(fd); @@ -1466,15 +2061,16 @@ win32_strerror(int e) DWORD source = 0; if (e < 0 || e > sys_nerr) { - dTHR; + dTHXo; if (e < 0) e = GetLastError(); if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, &source, e, 0, - strerror_buffer, sizeof(strerror_buffer), NULL) == 0) - strcpy(strerror_buffer, "Unknown Error"); + w32_strerror_buffer, + sizeof(w32_strerror_buffer), NULL) == 0) + strcpy(w32_strerror_buffer, "Unknown Error"); - return strerror_buffer; + return w32_strerror_buffer; } return strerror(e); } @@ -1488,21 +2084,27 @@ win32_str_os_error(void *sv, DWORD dwErr) |FORMAT_MESSAGE_IGNORE_INSERTS |FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwErr, 0, (char *)&sMsg, 1, NULL); + /* strip trailing whitespace and period */ if (0 < dwLen) { - while (0 < dwLen && isspace(sMsg[--dwLen])) - ; + do { + --dwLen; /* dwLen doesn't include trailing null */ + } while (0 < dwLen && isSPACE(sMsg[dwLen])); if ('.' != sMsg[dwLen]) dwLen++; - sMsg[dwLen]= '\0'; + sMsg[dwLen] = '\0'; } if (0 == dwLen) { sMsg = (char*)LocalAlloc(0, 64/**sizeof(TCHAR)*/); - dwLen = sprintf(sMsg, - "Unknown error #0x%lX (lookup 0x%lX)", - dwErr, GetLastError()); + if (sMsg) + dwLen = sprintf(sMsg, + "Unknown error #0x%lX (lookup 0x%lX)", + dwErr, GetLastError()); + } + if (sMsg) { + dTHXo; + sv_setpvn((SV*)sv, sMsg, dwLen); + LocalFree(sMsg); } - sv_setpvn((SV*)sv, sMsg, dwLen); - LocalFree(sMsg); } @@ -1548,12 +2150,32 @@ win32_fwrite(const void *buf, size_t size, size_t count, FILE *fp) return fwrite(buf, size, count, fp); } +#define MODE_SIZE 10 + DllExport FILE * win32_fopen(const char *filename, const char *mode) { + dTHXo; + WCHAR wMode[MODE_SIZE], wBuffer[MAX_PATH+1]; + FILE *f; + + if (!*filename) + return NULL; + if (stricmp(filename, "/dev/null")==0) - return fopen("NUL", mode); - return fopen(filename, mode); + filename = "NUL"; + + if (USING_WIDE()) { + A2WHELPER(mode, wMode, sizeof(wMode)); + A2WHELPER(filename, wBuffer, sizeof(wBuffer)); + f = _wfopen(PerlDir_mapW(wBuffer), wMode); + } + else + f = fopen(PerlDir_mapA(filename), mode); + /* avoid buffering headaches for child processes */ + if (f && *mode == 'a') + win32_fseek(f, 0, SEEK_END); + return f; } #ifndef USE_SOCKETS_AS_HANDLES @@ -1562,17 +2184,37 @@ win32_fopen(const char *filename, const char *mode) #endif DllExport FILE * -win32_fdopen( int handle, const char *mode) -{ - return fdopen(handle, (char *) mode); +win32_fdopen(int handle, const char *mode) +{ + dTHXo; + WCHAR wMode[MODE_SIZE]; + FILE *f; + if (USING_WIDE()) { + A2WHELPER(mode, wMode, sizeof(wMode)); + f = _wfdopen(handle, wMode); + } + else + f = fdopen(handle, (char *) mode); + /* avoid buffering headaches for child processes */ + if (f && *mode == 'a') + win32_fseek(f, 0, SEEK_END); + return f; } DllExport FILE * -win32_freopen( const char *path, const char *mode, FILE *stream) +win32_freopen(const char *path, const char *mode, FILE *stream) { + dTHXo; + WCHAR wMode[MODE_SIZE], wBuffer[MAX_PATH+1]; if (stricmp(path, "/dev/null")==0) - return freopen("NUL", mode, stream); - return freopen(path, mode, stream); + path = "NUL"; + + if (USING_WIDE()) { + A2WHELPER(mode, wMode, sizeof(wMode)); + A2WHELPER(path, wBuffer, sizeof(wBuffer)); + return _wfreopen(PerlDir_mapW(wBuffer), wMode, stream); + } + return freopen(PerlDir_mapA(path), mode, stream); } DllExport int @@ -1737,17 +2379,23 @@ win32_popen(const char *command, const char *mode) win32_close(p[child]); /* start the child */ - if ((childpid = do_spawn_nowait((char*)command)) == -1) - goto cleanup; + { + dTHXo; + if ((childpid = do_spawn_nowait((char*)command)) == -1) + goto cleanup; - /* revert stdfd to whatever it was before */ - if (win32_dup2(oldfd, stdfd) == -1) - goto cleanup; + /* revert stdfd to whatever it was before */ + if (win32_dup2(oldfd, stdfd) == -1) + goto cleanup; - /* close saved handle */ - win32_close(oldfd); + /* close saved handle */ + win32_close(oldfd); - sv_setiv(*av_fetch(w32_fdpid, p[parent], TRUE), childpid); + sv_setiv(*av_fetch(w32_fdpid, p[parent], TRUE), childpid); + + /* set process id so that it can be returned by perl's open() */ + PL_forkprocess = childpid; + } /* we have an fd, return a file stream */ return (win32_fdopen(p[parent], (char *)mode)); @@ -1775,7 +2423,7 @@ win32_pclose(FILE *pf) #ifdef USE_RTL_POPEN return _pclose(pf); #else - + dTHXo; int childpid, status; SV *sv; @@ -1793,29 +2441,129 @@ win32_pclose(FILE *pf) win32_fclose(pf); SvIVX(sv) = 0; - remove_dead_process((HANDLE)childpid); + if (win32_waitpid(childpid, &status, 0) == -1) + return -1; - /* wait for the child */ - if (cwait(&status, childpid, WAIT_CHILD) == -1) - return (-1); - /* cwait() returns "correctly" on Borland */ -#ifndef __BORLANDC__ - status *= 256; -#endif - return (status); + return status; #endif /* USE_RTL_POPEN */ } +static BOOL WINAPI +Nt4CreateHardLinkW( + LPCWSTR lpFileName, + LPCWSTR lpExistingFileName, + LPSECURITY_ATTRIBUTES lpSecurityAttributes) +{ + HANDLE handle; + WCHAR wFullName[MAX_PATH+1]; + LPVOID lpContext = NULL; + WIN32_STREAM_ID StreamId; + DWORD dwSize = (char*)&StreamId.cStreamName - (char*)&StreamId; + DWORD dwWritten; + DWORD dwLen; + BOOL bSuccess; + + BOOL (__stdcall *pfnBackupWrite)(HANDLE, LPBYTE, DWORD, LPDWORD, + BOOL, BOOL, LPVOID*) = + (BOOL (__stdcall *)(HANDLE, LPBYTE, DWORD, LPDWORD, + BOOL, BOOL, LPVOID*)) + GetProcAddress(GetModuleHandle("kernel32.dll"), "BackupWrite"); + if (pfnBackupWrite == NULL) + return 0; + + dwLen = GetFullPathNameW(lpFileName, MAX_PATH, wFullName, NULL); + if (dwLen == 0) + return 0; + dwLen = (dwLen+1)*sizeof(WCHAR); + + handle = CreateFileW(lpExistingFileName, FILE_WRITE_ATTRIBUTES, + FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, + NULL, OPEN_EXISTING, 0, NULL); + if (handle == INVALID_HANDLE_VALUE) + return 0; + + StreamId.dwStreamId = BACKUP_LINK; + StreamId.dwStreamAttributes = 0; + StreamId.dwStreamNameSize = 0; +#if defined(__BORLANDC__) || defined(__MINGW32__) + StreamId.Size.u.HighPart = 0; + StreamId.Size.u.LowPart = dwLen; +#else + StreamId.Size.HighPart = 0; + StreamId.Size.LowPart = dwLen; +#endif + + bSuccess = pfnBackupWrite(handle, (LPBYTE)&StreamId, dwSize, &dwWritten, + FALSE, FALSE, &lpContext); + if (bSuccess) { + bSuccess = pfnBackupWrite(handle, (LPBYTE)wFullName, dwLen, &dwWritten, + FALSE, FALSE, &lpContext); + pfnBackupWrite(handle, NULL, 0, &dwWritten, TRUE, FALSE, &lpContext); + } + + CloseHandle(handle); + return bSuccess; +} + +DllExport int +win32_link(const char *oldname, const char *newname) +{ + dTHXo; + BOOL (__stdcall *pfnCreateHardLinkW)(LPCWSTR,LPCWSTR,LPSECURITY_ATTRIBUTES); + WCHAR wOldName[MAX_PATH+1]; + WCHAR wNewName[MAX_PATH+1]; + + if (IsWin95()) + Perl_croak(aTHX_ PL_no_func, "link"); + + pfnCreateHardLinkW = + (BOOL (__stdcall *)(LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES)) + GetProcAddress(GetModuleHandle("kernel32.dll"), "CreateHardLinkW"); + if (pfnCreateHardLinkW == NULL) + pfnCreateHardLinkW = Nt4CreateHardLinkW; + + if ((A2WHELPER(oldname, wOldName, sizeof(wOldName))) && + (A2WHELPER(newname, wNewName, sizeof(wNewName))) && + (wcscpy(wOldName, PerlDir_mapW(wOldName)), + pfnCreateHardLinkW(PerlDir_mapW(wNewName), wOldName, NULL))) + { + return 0; + } + errno = (GetLastError() == ERROR_FILE_NOT_FOUND) ? ENOENT : EINVAL; + return -1; +} + DllExport int win32_rename(const char *oname, const char *newname) { + WCHAR wOldName[MAX_PATH+1]; + WCHAR wNewName[MAX_PATH+1]; + char szOldName[MAX_PATH+1]; + char szNewName[MAX_PATH+1]; + BOOL bResult; + dTHXo; + /* XXX despite what the documentation says about MoveFileEx(), * it doesn't work under Windows95! */ if (IsWinNT()) { - if (!MoveFileEx(oname,newname, - MOVEFILE_COPY_ALLOWED|MOVEFILE_REPLACE_EXISTING)) { + DWORD dwFlags = MOVEFILE_COPY_ALLOWED; + if (USING_WIDE()) { + A2WHELPER(oname, wOldName, sizeof(wOldName)); + A2WHELPER(newname, wNewName, sizeof(wNewName)); + if (wcsicmp(wNewName, wOldName)) + dwFlags |= MOVEFILE_REPLACE_EXISTING; + wcscpy(wOldName, PerlDir_mapW(wOldName)); + bResult = MoveFileExW(wOldName,PerlDir_mapW(wNewName), dwFlags); + } + else { + if (stricmp(newname, oname)) + dwFlags |= MOVEFILE_REPLACE_EXISTING; + strcpy(szOldName, PerlDir_mapA(oname)); + bResult = MoveFileExA(szOldName,PerlDir_mapA(newname), dwFlags); + } + if (!bResult) { DWORD err = GetLastError(); switch (err) { case ERROR_BAD_NET_NAME: @@ -1838,14 +2586,17 @@ win32_rename(const char *oname, const char *newname) } else { int retval = 0; - char tmpname[MAX_PATH+1]; + char szTmpName[MAX_PATH+1]; char dname[MAX_PATH+1]; char *endname = Nullch; STRLEN tmplen = 0; DWORD from_attr, to_attr; + strcpy(szOldName, PerlDir_mapA(oname)); + strcpy(szNewName, PerlDir_mapA(newname)); + /* if oname doesn't exist, do nothing */ - from_attr = GetFileAttributes(oname); + from_attr = GetFileAttributes(szOldName); if (from_attr == 0xFFFFFFFF) { errno = ENOENT; return -1; @@ -1855,7 +2606,7 @@ win32_rename(const char *oname, const char *newname) * don't delete it in case oname happens to be the same file * (but perhaps accessed via a different path) */ - to_attr = GetFileAttributes(newname); + to_attr = GetFileAttributes(szNewName); if (to_attr != 0xFFFFFFFF) { /* if newname is a directory, we fail * XXX could overcome this with yet more convoluted logic */ @@ -1863,29 +2614,29 @@ win32_rename(const char *oname, const char *newname) errno = EACCES; return -1; } - tmplen = strlen(newname); - strcpy(tmpname,newname); - endname = tmpname+tmplen; - for (; endname > tmpname ; --endname) { + tmplen = strlen(szNewName); + strcpy(szTmpName,szNewName); + endname = szTmpName+tmplen; + for (; endname > szTmpName ; --endname) { if (*endname == '/' || *endname == '\\') { *endname = '\0'; break; } } - if (endname > tmpname) - endname = strcpy(dname,tmpname); + if (endname > szTmpName) + endname = strcpy(dname,szTmpName); else endname = "."; /* get a temporary filename in same directory * XXX is this really the best we can do? */ - if (!GetTempFileName((LPCTSTR)endname, "plr", 0, tmpname)) { + if (!GetTempFileName((LPCTSTR)endname, "plr", 0, szTmpName)) { errno = ENOENT; return -1; } - DeleteFile(tmpname); + DeleteFile(szTmpName); - retval = rename(newname, tmpname); + retval = rename(szNewName, szTmpName); if (retval != 0) { errno = EACCES; return retval; @@ -1893,16 +2644,16 @@ win32_rename(const char *oname, const char *newname) } /* rename oname to newname */ - retval = rename(oname, newname); + retval = rename(szOldName, szNewName); /* if we created a temporary file before ... */ if (endname != Nullch) { /* ...and rename succeeded, delete temporary file/directory */ if (retval == 0) - DeleteFile(tmpname); + DeleteFile(szTmpName); /* else restore it to what it was */ else - (void)rename(tmpname, newname); + (void)rename(szTmpName, szNewName); } return retval; } @@ -1929,16 +2680,23 @@ win32_tell(int fd) DllExport int win32_open(const char *path, int flag, ...) { + dTHXo; va_list ap; int pmode; + WCHAR wBuffer[MAX_PATH+1]; va_start(ap, flag); pmode = va_arg(ap, int); va_end(ap); if (stricmp(path, "/dev/null")==0) - return open("NUL", flag, pmode); - return open(path,flag,pmode); + path = "NUL"; + + if (USING_WIDE()) { + A2WHELPER(path, wBuffer, sizeof(wBuffer)); + return _wopen(PerlDir_mapW(wBuffer), flag, pmode); + } + return open(PerlDir_mapA(path), flag, pmode); } DllExport int @@ -1965,10 +2723,210 @@ win32_dup2(int fd1,int fd2) return dup2(fd1,fd2); } +#ifdef PERL_MSVCRT_READFIX + +#define LF 10 /* line feed */ +#define CR 13 /* carriage return */ +#define CTRLZ 26 /* ctrl-z means eof for text */ +#define FOPEN 0x01 /* file handle open */ +#define FEOFLAG 0x02 /* end of file has been encountered */ +#define FCRLF 0x04 /* CR-LF across read buffer (in text mode) */ +#define FPIPE 0x08 /* file handle refers to a pipe */ +#define FAPPEND 0x20 /* file handle opened O_APPEND */ +#define FDEV 0x40 /* file handle refers to device */ +#define FTEXT 0x80 /* file handle is in text mode */ +#define MAX_DESCRIPTOR_COUNT (64*32) /* this is the maximun that MSVCRT can handle */ + +int __cdecl +_fixed_read(int fh, void *buf, unsigned cnt) +{ + int bytes_read; /* number of bytes read */ + char *buffer; /* buffer to read to */ + int os_read; /* bytes read on OS call */ + char *p, *q; /* pointers into buffer */ + char peekchr; /* peek-ahead character */ + ULONG filepos; /* file position after seek */ + ULONG dosretval; /* o.s. return value */ + + /* validate handle */ + if (((unsigned)fh >= (unsigned)MAX_DESCRIPTOR_COUNT) || + !(_osfile(fh) & FOPEN)) + { + /* out of range -- return error */ + errno = EBADF; + _doserrno = 0; /* not o.s. error */ + return -1; + } + + /* + * If lockinitflag is FALSE, assume fd is device + * lockinitflag is set to TRUE by open. + */ + if (_pioinfo(fh)->lockinitflag) + EnterCriticalSection(&(_pioinfo(fh)->lock)); /* lock file */ + + bytes_read = 0; /* nothing read yet */ + buffer = (char*)buf; + + if (cnt == 0 || (_osfile(fh) & FEOFLAG)) { + /* nothing to read or at EOF, so return 0 read */ + goto functionexit; + } + + if ((_osfile(fh) & (FPIPE|FDEV)) && _pipech(fh) != LF) { + /* a pipe/device and pipe lookahead non-empty: read the lookahead + * char */ + *buffer++ = _pipech(fh); + ++bytes_read; + --cnt; + _pipech(fh) = LF; /* mark as empty */ + } + + /* read the data */ + + if (!ReadFile((HANDLE)_osfhnd(fh), buffer, cnt, (LPDWORD)&os_read, NULL)) + { + /* ReadFile has reported an error. recognize two special cases. + * + * 1. map ERROR_ACCESS_DENIED to EBADF + * + * 2. just return 0 if ERROR_BROKEN_PIPE has occurred. it + * means the handle is a read-handle on a pipe for which + * all write-handles have been closed and all data has been + * read. */ + + if ((dosretval = GetLastError()) == ERROR_ACCESS_DENIED) { + /* wrong read/write mode should return EBADF, not EACCES */ + errno = EBADF; + _doserrno = dosretval; + bytes_read = -1; + goto functionexit; + } + else if (dosretval == ERROR_BROKEN_PIPE) { + bytes_read = 0; + goto functionexit; + } + else { + bytes_read = -1; + goto functionexit; + } + } + + bytes_read += os_read; /* update bytes read */ + + if (_osfile(fh) & FTEXT) { + /* now must translate CR-LFs to LFs in the buffer */ + + /* set CRLF flag to indicate LF at beginning of buffer */ + /* if ((os_read != 0) && (*(char *)buf == LF)) */ + /* _osfile(fh) |= FCRLF; */ + /* else */ + /* _osfile(fh) &= ~FCRLF; */ + + _osfile(fh) &= ~FCRLF; + + /* convert chars in the buffer: p is src, q is dest */ + p = q = (char*)buf; + while (p < (char *)buf + bytes_read) { + if (*p == CTRLZ) { + /* if fh is not a device, set ctrl-z flag */ + if (!(_osfile(fh) & FDEV)) + _osfile(fh) |= FEOFLAG; + break; /* stop translating */ + } + else if (*p != CR) + *q++ = *p++; + else { + /* *p is CR, so must check next char for LF */ + if (p < (char *)buf + bytes_read - 1) { + if (*(p+1) == LF) { + p += 2; + *q++ = LF; /* convert CR-LF to LF */ + } + else + *q++ = *p++; /* store char normally */ + } + else { + /* This is the hard part. We found a CR at end of + buffer. We must peek ahead to see if next char + is an LF. */ + ++p; + + dosretval = 0; + if (!ReadFile((HANDLE)_osfhnd(fh), &peekchr, 1, + (LPDWORD)&os_read, NULL)) + dosretval = GetLastError(); + + if (dosretval != 0 || os_read == 0) { + /* couldn't read ahead, store CR */ + *q++ = CR; + } + else { + /* peekchr now has the extra character -- we now + have several possibilities: + 1. disk file and char is not LF; just seek back + and copy CR + 2. disk file and char is LF; store LF, don't seek back + 3. pipe/device and char is LF; store LF. + 4. pipe/device and char isn't LF, store CR and + put char in pipe lookahead buffer. */ + if (_osfile(fh) & (FDEV|FPIPE)) { + /* non-seekable device */ + if (peekchr == LF) + *q++ = LF; + else { + *q++ = CR; + _pipech(fh) = peekchr; + } + } + else { + /* disk file */ + if (peekchr == LF) { + /* nothing read yet; must make some + progress */ + *q++ = LF; + /* turn on this flag for tell routine */ + _osfile(fh) |= FCRLF; + } + else { + HANDLE osHandle; /* o.s. handle value */ + /* seek back */ + if ((osHandle = (HANDLE)_get_osfhandle(fh)) != (HANDLE)-1) + { + if ((filepos = SetFilePointer(osHandle, -1, NULL, FILE_CURRENT)) == -1) + dosretval = GetLastError(); + } + if (peekchr != LF) + *q++ = CR; + } + } + } + } + } + } + + /* we now change bytes_read to reflect the true number of chars + in the buffer */ + bytes_read = q - (char *)buf; + } + +functionexit: + if (_pioinfo(fh)->lockinitflag) + LeaveCriticalSection(&(_pioinfo(fh)->lock)); /* unlock file */ + + return bytes_read; +} + +#endif /* PERL_MSVCRT_READFIX */ + DllExport int win32_read(int fd, void *buf, unsigned int cnt) { +#ifdef PERL_MSVCRT_READFIX + return _fixed_read(fd, buf, cnt); +#else return read(fd, buf, cnt); +#endif } DllExport int @@ -1980,52 +2938,374 @@ win32_write(int fd, const void *buf, unsigned int cnt) DllExport int win32_mkdir(const char *dir, int mode) { - return mkdir(dir); /* just ignore mode */ + dTHXo; + if (USING_WIDE()) { + WCHAR wBuffer[MAX_PATH+1]; + A2WHELPER(dir, wBuffer, sizeof(wBuffer)); + return _wmkdir(PerlDir_mapW(wBuffer)); + } + return mkdir(PerlDir_mapA(dir)); /* just ignore mode */ } DllExport int win32_rmdir(const char *dir) { - return rmdir(dir); + dTHXo; + if (USING_WIDE()) { + WCHAR wBuffer[MAX_PATH+1]; + A2WHELPER(dir, wBuffer, sizeof(wBuffer)); + return _wrmdir(PerlDir_mapW(wBuffer)); + } + return rmdir(PerlDir_mapA(dir)); } DllExport int win32_chdir(const char *dir) { + dTHXo; + if (USING_WIDE()) { + WCHAR wBuffer[MAX_PATH+1]; + A2WHELPER(dir, wBuffer, sizeof(wBuffer)); + return _wchdir(wBuffer); + } return chdir(dir); } +DllExport int +win32_access(const char *path, int mode) +{ + dTHXo; + if (USING_WIDE()) { + WCHAR wBuffer[MAX_PATH+1]; + A2WHELPER(path, wBuffer, sizeof(wBuffer)); + return _waccess(PerlDir_mapW(wBuffer), mode); + } + return access(PerlDir_mapA(path), mode); +} + +DllExport int +win32_chmod(const char *path, int mode) +{ + dTHXo; + if (USING_WIDE()) { + WCHAR wBuffer[MAX_PATH+1]; + A2WHELPER(path, wBuffer, sizeof(wBuffer)); + return _wchmod(PerlDir_mapW(wBuffer), mode); + } + return chmod(PerlDir_mapA(path), mode); +} + + +static char * +create_command_line(const char* command, const char * const *args) +{ + dTHXo; + int index; + char *cmd, *ptr, *arg; + STRLEN len = strlen(command) + 1; + + for (index = 0; (ptr = (char*)args[index]) != NULL; ++index) + len += strlen(ptr) + 1; + + New(1310, cmd, len, char); + ptr = cmd; + strcpy(ptr, command); + + for (index = 0; (arg = (char*)args[index]) != NULL; ++index) { + ptr += strlen(ptr); + *ptr++ = ' '; + strcpy(ptr, arg); + } + + return cmd; +} + +static char * +qualified_path(const char *cmd) +{ + dTHXo; + char *pathstr; + char *fullcmd, *curfullcmd; + STRLEN cmdlen = 0; + int has_slash = 0; + + if (!cmd) + return Nullch; + fullcmd = (char*)cmd; + while (*fullcmd) { + if (*fullcmd == '/' || *fullcmd == '\\') + has_slash++; + fullcmd++; + cmdlen++; + } + + /* look in PATH */ + pathstr = win32_getenv("PATH"); + New(0, fullcmd, MAX_PATH+1, char); + curfullcmd = fullcmd; + + while (1) { + DWORD res; + + /* start by appending the name to the current prefix */ + strcpy(curfullcmd, cmd); + curfullcmd += cmdlen; + + /* if it doesn't end with '.', or has no extension, try adding + * a trailing .exe first */ + if (cmd[cmdlen-1] != '.' + && (cmdlen < 4 || cmd[cmdlen-4] != '.')) + { + strcpy(curfullcmd, ".exe"); + res = GetFileAttributes(fullcmd); + if (res != 0xFFFFFFFF && !(res & FILE_ATTRIBUTE_DIRECTORY)) + return fullcmd; + *curfullcmd = '\0'; + } + + /* that failed, try the bare name */ + res = GetFileAttributes(fullcmd); + if (res != 0xFFFFFFFF && !(res & FILE_ATTRIBUTE_DIRECTORY)) + return fullcmd; + + /* quit if no other path exists, or if cmd already has path */ + if (!pathstr || !*pathstr || has_slash) + break; + + /* skip leading semis */ + while (*pathstr == ';') + pathstr++; + + /* build a new prefix from scratch */ + curfullcmd = fullcmd; + while (*pathstr && *pathstr != ';') { + if (*pathstr == '"') { /* foo;"baz;etc";bar */ + pathstr++; /* skip initial '"' */ + while (*pathstr && *pathstr != '"') { + if (curfullcmd-fullcmd < MAX_PATH-cmdlen-5) + *curfullcmd++ = *pathstr; + pathstr++; + } + if (*pathstr) + pathstr++; /* skip trailing '"' */ + } + else { + if (curfullcmd-fullcmd < MAX_PATH-cmdlen-5) + *curfullcmd++ = *pathstr; + pathstr++; + } + } + if (*pathstr) + pathstr++; /* skip trailing semi */ + if (curfullcmd > fullcmd /* append a dir separator */ + && curfullcmd[-1] != '/' && curfullcmd[-1] != '\\') + { + *curfullcmd++ = '\\'; + } + } +GIVE_UP: + Safefree(fullcmd); + return Nullch; +} + +/* The following are just place holders. + * Some hosts may provide and environment that the OS is + * not tracking, therefore, these host must provide that + * environment and the current directory to CreateProcess + */ + +void* +get_childenv(void) +{ + return NULL; +} + +void +free_childenv(void* d) +{ +} + +char* +get_childdir(void) +{ + dTHXo; + char* ptr; + char szfilename[(MAX_PATH+1)*2]; + if (USING_WIDE()) { + WCHAR wfilename[MAX_PATH+1]; + GetCurrentDirectoryW(MAX_PATH+1, wfilename); + W2AHELPER(wfilename, szfilename, sizeof(szfilename)); + } + else { + GetCurrentDirectoryA(MAX_PATH+1, szfilename); + } + + New(0, ptr, strlen(szfilename)+1, char); + strcpy(ptr, szfilename); + return ptr; +} + +void +free_childdir(char* d) +{ + dTHXo; + Safefree(d); +} + + +/* XXX this needs to be made more compatible with the spawnvp() + * provided by the various RTLs. In particular, searching for + * *.{com,bat,cmd} files (as done by the RTLs) is unimplemented. + * This doesn't significantly affect perl itself, because we + * always invoke things using PERL5SHELL if a direct attempt to + * spawn the executable fails. + * + * XXX splitting and rejoining the commandline between do_aspawn() + * and win32_spawnvp() could also be avoided. + */ + DllExport int win32_spawnvp(int mode, const char *cmdname, const char *const *argv) { - int status; +#ifdef USE_RTL_SPAWNVP + return spawnvp(mode, cmdname, (char * const *)argv); +#else + dTHXo; + int ret; + void* env; + char* dir; + child_IO_table tbl; + STARTUPINFO StartupInfo; + PROCESS_INFORMATION ProcessInformation; + DWORD create = 0; + + char *cmd = create_command_line(cmdname, strcmp(cmdname, argv[0]) == 0 + ? &argv[1] : argv); + char *fullcmd = Nullch; + + env = PerlEnv_get_childenv(); + dir = PerlEnv_get_childdir(); + + switch(mode) { + case P_NOWAIT: /* asynch + remember result */ + if (w32_num_children >= MAXIMUM_WAIT_OBJECTS) { + errno = EAGAIN; + ret = -1; + goto RETVAL; + } + /* FALL THROUGH */ + case P_WAIT: /* synchronous execution */ + break; + default: /* invalid mode */ + errno = EINVAL; + ret = -1; + goto RETVAL; + } + memset(&StartupInfo,0,sizeof(StartupInfo)); + StartupInfo.cb = sizeof(StartupInfo); + memset(&tbl,0,sizeof(tbl)); + PerlEnv_get_child_IO(&tbl); + StartupInfo.dwFlags = tbl.dwFlags; + StartupInfo.dwX = tbl.dwX; + StartupInfo.dwY = tbl.dwY; + StartupInfo.dwXSize = tbl.dwXSize; + StartupInfo.dwYSize = tbl.dwYSize; + StartupInfo.dwXCountChars = tbl.dwXCountChars; + StartupInfo.dwYCountChars = tbl.dwYCountChars; + StartupInfo.dwFillAttribute = tbl.dwFillAttribute; + StartupInfo.wShowWindow = tbl.wShowWindow; + StartupInfo.hStdInput = tbl.childStdIn; + StartupInfo.hStdOutput = tbl.childStdOut; + StartupInfo.hStdError = tbl.childStdErr; + if (StartupInfo.hStdInput != INVALID_HANDLE_VALUE && + StartupInfo.hStdOutput != INVALID_HANDLE_VALUE && + StartupInfo.hStdError != INVALID_HANDLE_VALUE) + { + StartupInfo.dwFlags |= STARTF_USESTDHANDLES; + } + else { + create |= CREATE_NEW_CONSOLE; + } -#ifndef USE_RTL_WAIT - if (mode == P_NOWAIT && w32_num_children >= MAXIMUM_WAIT_OBJECTS) - return -1; -#endif +RETRY: + if (!CreateProcess(cmdname, /* search PATH to find executable */ + cmd, /* executable, and its arguments */ + NULL, /* process attributes */ + NULL, /* thread attributes */ + TRUE, /* inherit handles */ + create, /* creation flags */ + (LPVOID)env, /* inherit environment */ + dir, /* inherit cwd */ + &StartupInfo, + &ProcessInformation)) + { + /* initial NULL argument to CreateProcess() does a PATH + * search, but it always first looks in the directory + * where the current process was started, which behavior + * is undesirable for backward compatibility. So we + * jump through our own hoops by picking out the path + * we really want it to use. */ + if (!fullcmd) { + fullcmd = qualified_path(cmdname); + if (fullcmd) { + cmdname = fullcmd; + goto RETRY; + } + } + errno = ENOENT; + ret = -1; + goto RETVAL; + } - status = spawnvp(mode, cmdname, (char * const *) argv); -#ifndef USE_RTL_WAIT - /* XXX For the P_NOWAIT case, Borland RTL returns pinfo.dwProcessId - * while VC RTL returns pinfo.hProcess. For purposes of the custom - * implementation of win32_wait(), we assume the latter. - */ - if (mode == P_NOWAIT && status >= 0) - w32_child_pids[w32_num_children++] = (HANDLE)status; + if (mode == P_NOWAIT) { + /* asynchronous spawn -- store handle, return PID */ + w32_child_handles[w32_num_children] = ProcessInformation.hProcess; + w32_child_pids[w32_num_children] = ProcessInformation.dwProcessId; + ret = (int)ProcessInformation.dwProcessId; + ++w32_num_children; + } + else { + DWORD status; + WaitForSingleObject(ProcessInformation.hProcess, INFINITE); + GetExitCodeProcess(ProcessInformation.hProcess, &status); + ret = (int)status; + CloseHandle(ProcessInformation.hProcess); + } + + CloseHandle(ProcessInformation.hThread); + +RETVAL: + PerlEnv_free_childenv(env); + PerlEnv_free_childdir(dir); + Safefree(cmd); + Safefree(fullcmd); + return ret; #endif - return status; } DllExport int win32_execv(const char *cmdname, const char *const *argv) { +#ifdef USE_ITHREADS + dTHXo; + /* if this is a pseudo-forked child, we just want to spawn + * the new program, and return */ + if (w32_pseudo_id) + return spawnv(P_WAIT, cmdname, (char *const *)argv); +#endif return execv(cmdname, (char *const *)argv); } DllExport int win32_execvp(const char *cmdname, const char *const *argv) { +#ifdef USE_ITHREADS + dTHXo; + /* if this is a pseudo-forked child, we just want to spawn + * the new program, and return */ + if (w32_pseudo_id) + return win32_spawnvp(P_WAIT, cmdname, (char *const *)argv); +#endif return execvp(cmdname, (char *const *)argv); } @@ -2208,6 +3488,10 @@ win32_free(void *block) int win32_open_osfhandle(long handle, int flags) { +#ifdef USE_FIXED_OSFHANDLE + if (IsWin95()) + return my_open_osfhandle(handle, flags); +#endif return _open_osfhandle(handle, flags); } @@ -2217,6 +3501,22 @@ win32_get_osfhandle(int fd) return _get_osfhandle(fd); } +DllExport void* +win32_dynaload(const char* filename) +{ + dTHXo; + HMODULE hModule; + if (USING_WIDE()) { + WCHAR wfilename[MAX_PATH+1]; + A2WHELPER(filename, wfilename, sizeof(wfilename)); + hModule = LoadLibraryExW(PerlDir_mapW(wfilename), NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + } + else { + hModule = LoadLibraryExA(PerlDir_mapA(filename), NULL, LOAD_WITH_ALTERED_SEARCH_PATH); + } + return hModule; +} + /* * Extras. */ @@ -2225,32 +3525,33 @@ static XS(w32_GetCwd) { dXSARGS; - SV *sv = sv_newmortal(); - /* Make one call with zero size - return value is required size */ - DWORD len = GetCurrentDirectory((DWORD)0,NULL); - SvUPGRADE(sv,SVt_PV); - SvGROW(sv,len); - SvCUR(sv) = GetCurrentDirectory((DWORD) SvLEN(sv), SvPVX(sv)); + /* Make the host for current directory */ + char* ptr = PerlEnv_get_childdir(); /* - * If result != 0 + * If ptr != Nullch * then it worked, set PV valid, - * else leave it 'undef' + * else return 'undef' */ - if (SvCUR(sv)) + if (ptr) { + SV *sv = sv_newmortal(); + sv_setpv(sv, ptr); + PerlEnv_free_childdir(ptr); + + EXTEND(SP,1); SvPOK_on(sv); - EXTEND(SP,1); - ST(0) = sv; - XSRETURN(1); + ST(0) = sv; + XSRETURN(1); + } + XSRETURN_UNDEF; } static XS(w32_SetCwd) { dXSARGS; - STRLEN n_a; if (items != 1) - croak("usage: Win32::SetCurrentDirectory($cwd)"); - if (SetCurrentDirectory(SvPV(ST(0),n_a))) + Perl_croak(aTHX_ "usage: Win32::SetCurrentDirectory($cwd)"); + if (!PerlDir_chdir(SvPV_nolen(ST(0)))) XSRETURN_YES; XSRETURN_NO; @@ -2262,6 +3563,8 @@ XS(w32_GetNextAvailDrive) dXSARGS; char ix = 'C'; char root[] = "_:\\"; + + EXTEND(SP,1); while (ix <= 'Z') { root[0] = ix++; if (GetDriveType(root) == 1) { @@ -2276,18 +3579,30 @@ static XS(w32_GetLastError) { dXSARGS; + EXTEND(SP,1); XSRETURN_IV(GetLastError()); } static +XS(w32_SetLastError) +{ + dXSARGS; + if (items != 1) + Perl_croak(aTHX_ "usage: Win32::SetLastError($error)"); + SetLastError(SvIV(ST(0))); + XSRETURN_EMPTY; +} + +static XS(w32_LoginName) { dXSARGS; - char *name = getlogin_buffer; - DWORD size = sizeof(getlogin_buffer); + char *name = w32_getlogin_buffer; + DWORD size = sizeof(w32_getlogin_buffer); + EXTEND(SP,1); if (GetUserName(name,&size)) { /* size includes NULL */ - ST(0) = sv_2mortal(newSVpv(name,size-1)); + ST(0) = sv_2mortal(newSVpvn(name,size-1)); XSRETURN(1); } XSRETURN_UNDEF; @@ -2299,9 +3614,10 @@ XS(w32_NodeName) dXSARGS; char name[MAX_COMPUTERNAME_LENGTH+1]; DWORD size = sizeof(name); + EXTEND(SP,1); if (GetComputerName(name,&size)) { /* size does NOT include NULL :-( */ - ST(0) = sv_2mortal(newSVpv(name,size)); + ST(0) = sv_2mortal(newSVpvn(name,size)); XSRETURN(1); } XSRETURN_UNDEF; @@ -2312,41 +3628,63 @@ static XS(w32_DomainName) { dXSARGS; -#ifndef HAS_NETWKSTAGETINFO - /* mingw32 (and Win95) don't have NetWksta*(), so do it the old way */ - char name[256]; - DWORD size = sizeof(name); - if (GetUserName(name,&size)) { - char sid[1024]; - DWORD sidlen = sizeof(sid); + HINSTANCE hNetApi32 = LoadLibrary("netapi32.dll"); + DWORD (__stdcall *pfnNetApiBufferFree)(LPVOID Buffer); + DWORD (__stdcall *pfnNetWkstaGetInfo)(LPWSTR servername, DWORD level, + void *bufptr); + + if (hNetApi32) { + pfnNetApiBufferFree = (DWORD (__stdcall *)(void *)) + GetProcAddress(hNetApi32, "NetApiBufferFree"); + pfnNetWkstaGetInfo = (DWORD (__stdcall *)(LPWSTR, DWORD, void *)) + GetProcAddress(hNetApi32, "NetWkstaGetInfo"); + } + EXTEND(SP,1); + if (hNetApi32 && pfnNetWkstaGetInfo && pfnNetApiBufferFree) { + /* this way is more reliable, in case user has a local account. */ char dname[256]; DWORD dnamelen = sizeof(dname); - SID_NAME_USE snu; - if (LookupAccountName(NULL, name, (PSID)&sid, &sidlen, - dname, &dnamelen, &snu)) { - XSRETURN_PV(dname); /* all that for this */ + struct { + DWORD wki100_platform_id; + LPWSTR wki100_computername; + LPWSTR wki100_langroup; + DWORD wki100_ver_major; + DWORD wki100_ver_minor; + } *pwi; + /* NERR_Success *is* 0*/ + if (0 == pfnNetWkstaGetInfo(NULL, 100, &pwi)) { + if (pwi->wki100_langroup && *(pwi->wki100_langroup)) { + WideCharToMultiByte(CP_ACP, NULL, pwi->wki100_langroup, + -1, (LPSTR)dname, dnamelen, NULL, NULL); + } + else { + WideCharToMultiByte(CP_ACP, NULL, pwi->wki100_computername, + -1, (LPSTR)dname, dnamelen, NULL, NULL); + } + pfnNetApiBufferFree(pwi); + FreeLibrary(hNetApi32); + XSRETURN_PV(dname); } + FreeLibrary(hNetApi32); } -#else - /* this way is more reliable, in case user has a local account. - * XXX need dynamic binding of netapi32.dll symbols or this will fail on - * Win95. Probably makes more sense to move it into libwin32. */ - char dname[256]; - DWORD dnamelen = sizeof(dname); - PWKSTA_INFO_100 pwi; - if (NERR_Success == NetWkstaGetInfo(NULL, 100, (LPBYTE*)&pwi)) { - if (pwi->wki100_langroup && *(pwi->wki100_langroup)) { - WideCharToMultiByte(CP_ACP, NULL, pwi->wki100_langroup, - -1, (LPSTR)dname, dnamelen, NULL, NULL); - } - else { - WideCharToMultiByte(CP_ACP, NULL, pwi->wki100_computername, - -1, (LPSTR)dname, dnamelen, NULL, NULL); + else { + /* Win95 doesn't have NetWksta*(), so do it the old way */ + char name[256]; + DWORD size = sizeof(name); + if (hNetApi32) + FreeLibrary(hNetApi32); + if (GetUserName(name,&size)) { + char sid[ONE_K_BUFSIZE]; + DWORD sidlen = sizeof(sid); + char dname[256]; + DWORD dnamelen = sizeof(dname); + SID_NAME_USE snu; + if (LookupAccountName(NULL, name, (PSID)&sid, &sidlen, + dname, &dnamelen, &snu)) { + XSRETURN_PV(dname); /* all that for this */ + } } - NetApiBufferFree(pwi); - XSRETURN_PV(dname); } -#endif XSRETURN_UNDEF; } @@ -2358,41 +3696,58 @@ XS(w32_FsType) DWORD flags, filecomplen; if (GetVolumeInformation(NULL, NULL, 0, NULL, &filecomplen, &flags, fsname, sizeof(fsname))) { - if (GIMME == G_ARRAY) { - XPUSHs(sv_2mortal(newSVpv(fsname,0))); + if (GIMME_V == G_ARRAY) { + XPUSHs(sv_2mortal(newSVpvn(fsname,strlen(fsname)))); XPUSHs(sv_2mortal(newSViv(flags))); XPUSHs(sv_2mortal(newSViv(filecomplen))); PUTBACK; return; } + EXTEND(SP,1); XSRETURN_PV(fsname); } - XSRETURN_UNDEF; + XSRETURN_EMPTY; } static XS(w32_GetOSVersion) { dXSARGS; - OSVERSIONINFO osver; - - osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - if (GetVersionEx(&osver)) { - XPUSHs(newSVpv(osver.szCSDVersion, 0)); - XPUSHs(newSViv(osver.dwMajorVersion)); - XPUSHs(newSViv(osver.dwMinorVersion)); - XPUSHs(newSViv(osver.dwBuildNumber)); - XPUSHs(newSViv(osver.dwPlatformId)); - PUTBACK; - return; + OSVERSIONINFOA osver; + + if (USING_WIDE()) { + OSVERSIONINFOW osverw; + char szCSDVersion[sizeof(osverw.szCSDVersion)]; + osverw.dwOSVersionInfoSize = sizeof(OSVERSIONINFOW); + if (!GetVersionExW(&osverw)) { + XSRETURN_EMPTY; + } + W2AHELPER(osverw.szCSDVersion, szCSDVersion, sizeof(szCSDVersion)); + XPUSHs(newSVpvn(szCSDVersion, strlen(szCSDVersion))); + osver.dwMajorVersion = osverw.dwMajorVersion; + osver.dwMinorVersion = osverw.dwMinorVersion; + osver.dwBuildNumber = osverw.dwBuildNumber; + osver.dwPlatformId = osverw.dwPlatformId; } - XSRETURN_UNDEF; + else { + osver.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA); + if (!GetVersionExA(&osver)) { + XSRETURN_EMPTY; + } + XPUSHs(newSVpvn(osver.szCSDVersion, strlen(osver.szCSDVersion))); + } + XPUSHs(newSViv(osver.dwMajorVersion)); + XPUSHs(newSViv(osver.dwMinorVersion)); + XPUSHs(newSViv(osver.dwBuildNumber)); + XPUSHs(newSViv(osver.dwPlatformId)); + PUTBACK; } static XS(w32_IsWinNT) { dXSARGS; + EXTEND(SP,1); XSRETURN_IV(IsWinNT()); } @@ -2400,6 +3755,7 @@ static XS(w32_IsWin95) { dXSARGS; + EXTEND(SP,1); XSRETURN_IV(IsWin95()); } @@ -2408,15 +3764,27 @@ XS(w32_FormatMessage) { dXSARGS; DWORD source = 0; - char msgbuf[1024]; + char msgbuf[ONE_K_BUFSIZE]; if (items != 1) - croak("usage: Win32::FormatMessage($errno)"); + Perl_croak(aTHX_ "usage: Win32::FormatMessage($errno)"); - if (FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, - &source, SvIV(ST(0)), 0, - msgbuf, sizeof(msgbuf)-1, NULL)) - XSRETURN_PV(msgbuf); + if (USING_WIDE()) { + WCHAR wmsgbuf[ONE_K_BUFSIZE]; + if (FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM, + &source, SvIV(ST(0)), 0, + wmsgbuf, ONE_K_BUFSIZE-1, NULL)) + { + W2AHELPER(wmsgbuf, msgbuf, sizeof(msgbuf)); + XSRETURN_PV(msgbuf); + } + } + else { + if (FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, + &source, SvIV(ST(0)), 0, + msgbuf, sizeof(msgbuf)-1, NULL)) + XSRETURN_PV(msgbuf); + } XSRETURN_UNDEF; } @@ -2429,13 +3797,12 @@ XS(w32_Spawn) PROCESS_INFORMATION stProcInfo; STARTUPINFO stStartInfo; BOOL bSuccess = FALSE; - STRLEN n_a; if (items != 3) - croak("usage: Win32::Spawn($cmdName, $args, $PID)"); + Perl_croak(aTHX_ "usage: Win32::Spawn($cmdName, $args, $PID)"); - cmd = SvPV(ST(0),n_a); - args = SvPV(ST(1), n_a); + cmd = SvPV_nolen(ST(0)); + args = SvPV_nolen(ST(1)); memset(&stStartInfo, 0, sizeof(stStartInfo)); /* Clear the block */ stStartInfo.cb = sizeof(stStartInfo); /* Set the structure size */ @@ -2465,7 +3832,11 @@ static XS(w32_GetTickCount) { dXSARGS; - XSRETURN_IV(GetTickCount()); + DWORD msec = GetTickCount(); + EXTEND(SP,1); + if ((IV)msec > 0) + XSRETURN_IV(msec); + XSRETURN_NV(msec); } static @@ -2476,7 +3847,7 @@ XS(w32_GetShortPathName) DWORD len; if (items != 1) - croak("usage: Win32::GetShortPathName($longPathName)"); + Perl_croak(aTHX_ "usage: Win32::GetShortPathName($longPathName)"); shortpath = sv_mortalcopy(ST(0)); SvUPGRADE(shortpath, SVt_PV); @@ -2489,10 +3860,67 @@ XS(w32_GetShortPathName) if (len) { SvCUR_set(shortpath,len); ST(0) = shortpath; + XSRETURN(1); } - else - ST(0) = &PL_sv_undef; - XSRETURN(1); + XSRETURN_UNDEF; +} + +static +XS(w32_GetFullPathName) +{ + dXSARGS; + SV *filename; + SV *fullpath; + char *filepart; + DWORD len; + + if (items != 1) + Perl_croak(aTHX_ "usage: Win32::GetFullPathName($filename)"); + + filename = ST(0); + fullpath = sv_mortalcopy(filename); + SvUPGRADE(fullpath, SVt_PV); + do { + len = GetFullPathName(SvPVX(filename), + SvLEN(fullpath), + SvPVX(fullpath), + &filepart); + } while (len >= SvLEN(fullpath) && sv_grow(fullpath,len+1)); + if (len) { + if (GIMME_V == G_ARRAY) { + EXTEND(SP,1); + XST_mPV(1,filepart); + len = filepart - SvPVX(fullpath); + items = 2; + } + SvCUR_set(fullpath,len); + ST(0) = fullpath; + XSRETURN(items); + } + XSRETURN_EMPTY; +} + +static +XS(w32_GetLongPathName) +{ + dXSARGS; + SV *path; + char tmpbuf[MAX_PATH+1]; + char *pathstr; + STRLEN len; + + if (items != 1) + Perl_croak(aTHX_ "usage: Win32::GetLongPathName($pathname)"); + + path = ST(0); + pathstr = SvPV(path,len); + strcpy(tmpbuf, pathstr); + pathstr = win32_longpath(tmpbuf); + if (pathstr) { + ST(0) = sv_2mortal(newSVpvn(pathstr, strlen(pathstr))); + XSRETURN(1); + } + XSRETURN_EMPTY; } static @@ -2500,22 +3928,54 @@ XS(w32_Sleep) { dXSARGS; if (items != 1) - croak("usage: Win32::Sleep($milliseconds)"); + Perl_croak(aTHX_ "usage: Win32::Sleep($milliseconds)"); Sleep(SvIV(ST(0))); XSRETURN_YES; } +static +XS(w32_CopyFile) +{ + dXSARGS; + BOOL bResult; + if (items != 3) + Perl_croak(aTHX_ "usage: Win32::CopyFile($from, $to, $overwrite)"); + if (USING_WIDE()) { + WCHAR wSourceFile[MAX_PATH+1]; + WCHAR wDestFile[MAX_PATH+1]; + A2WHELPER(SvPV_nolen(ST(0)), wSourceFile, sizeof(wSourceFile)); + wcscpy(wSourceFile, PerlDir_mapW(wSourceFile)); + A2WHELPER(SvPV_nolen(ST(1)), wDestFile, sizeof(wDestFile)); + bResult = CopyFileW(wSourceFile, PerlDir_mapW(wDestFile), !SvTRUE(ST(2))); + } + else { + char szSourceFile[MAX_PATH+1]; + strcpy(szSourceFile, PerlDir_mapA(SvPV_nolen(ST(0)))); + bResult = CopyFileA(szSourceFile, PerlDir_mapA(SvPV_nolen(ST(1))), !SvTRUE(ST(2))); + } + + if (bResult) + XSRETURN_YES; + XSRETURN_NO; +} + void -Perl_init_os_extras() +Perl_init_os_extras(void) { + dTHXo; char *file = __FILE__; dXSUB_SYS; w32_perlshell_tokens = Nullch; w32_perlshell_items = -1; w32_fdpid = newAV(); /* XXX needs to be in Perl_win32_init()? */ -#ifndef USE_RTL_WAIT + New(1313, w32_children, 1, child_tab); w32_num_children = 0; + w32_init_socktype = 0; +#ifdef USE_ITHREADS + w32_pseudo_id = 0; + New(1313, w32_pseudo_children, 1, child_tab); + w32_num_pseudo_children = 0; #endif /* these names are Activeware compatible */ @@ -2523,6 +3983,7 @@ Perl_init_os_extras() newXS("Win32::SetCwd", w32_SetCwd, file); newXS("Win32::GetNextAvailDrive", w32_GetNextAvailDrive, file); newXS("Win32::GetLastError", w32_GetLastError, file); + newXS("Win32::SetLastError", w32_SetLastError, file); newXS("Win32::LoginName", w32_LoginName, file); newXS("Win32::NodeName", w32_NodeName, file); newXS("Win32::DomainName", w32_DomainName, file); @@ -2534,6 +3995,9 @@ Perl_init_os_extras() newXS("Win32::Spawn", w32_Spawn, file); newXS("Win32::GetTickCount", w32_GetTickCount, file); newXS("Win32::GetShortPathName", w32_GetShortPathName, file); + newXS("Win32::GetFullPathName", w32_GetFullPathName, file); + newXS("Win32::GetLongPathName", w32_GetLongPathName, file); + newXS("Win32::CopyFile", w32_CopyFile, file); newXS("Win32::Sleep", w32_Sleep, file); /* XXX Bloat Alert! The following Activeware preloads really @@ -2563,27 +4027,69 @@ Perl_win32_init(int *argcp, char ***argvp) MALLOC_INIT; } -#ifdef USE_BINMODE_SCRIPTS +void +win32_get_child_IO(child_IO_table* ptbl) +{ + ptbl->childStdIn = GetStdHandle(STD_INPUT_HANDLE); + ptbl->childStdOut = GetStdHandle(STD_OUTPUT_HANDLE); + ptbl->childStdErr = GetStdHandle(STD_ERROR_HANDLE); +} + + +#ifdef USE_ITHREADS + +# ifdef PERL_OBJECT +# undef Perl_sys_intern_dup +# define Perl_sys_intern_dup CPerlObj::Perl_sys_intern_dup +# define pPerl this +# endif void -win32_strip_return(SV *sv) +Perl_sys_intern_dup(pTHX_ struct interp_intern *src, struct interp_intern *dst) +{ + dst->perlshell_tokens = Nullch; + dst->perlshell_vec = (char**)NULL; + dst->perlshell_items = 0; + dst->fdpid = newAV(); + Newz(1313, dst->children, 1, child_tab); + Newz(1313, dst->pseudo_children, 1, child_tab); + dst->pseudo_id = 0; + dst->children->num = 0; + dst->thr_intern.Winit_socktype = src->thr_intern.Winit_socktype; +} +#endif + +#ifdef PERL_OBJECT +# undef this +# define this pPerl +#endif + +static void +win32_free_argvw(pTHXo_ void *ptr) { - char *s = SvPVX(sv); - char *e = s+SvCUR(sv); - char *d = s; - while (s < e) - { - if (*s == '\r' && s[1] == '\n') - { - *d++ = '\n'; - s += 2; + char** argv = (char**)ptr; + while(*argv) { + Safefree(*argv); + *argv++ = Nullch; } - else - { - *d++ = *s++; - } - } - SvCUR_set(sv,d-SvPVX(sv)); } -#endif +void +win32_argv2utf8(int argc, char** argv) +{ + dTHXo; + char* psz; + int length, wargc; + LPWSTR* lpwStr = CommandLineToArgvW(GetCommandLineW(), &wargc); + if (lpwStr && argc) { + while (argc--) { + length = WideCharToMultiByte(CP_UTF8, 0, lpwStr[--wargc], -1, NULL, 0, NULL, NULL); + Newz(0, psz, length, char); + WideCharToMultiByte(CP_UTF8, 0, lpwStr[wargc], -1, psz, length, NULL, NULL); + argv[argc] = psz; + } + call_atexit(win32_free_argvw, argv); + } + GlobalFree((HGLOBAL)lpwStr); +} + diff --git a/gnu/usr.bin/perl/win32/win32.h b/gnu/usr.bin/perl/win32/win32.h index 961347d5fea..35d5bdfa985 100644 --- a/gnu/usr.bin/perl/win32/win32.h +++ b/gnu/usr.bin/perl/win32/win32.h @@ -9,31 +9,30 @@ #ifndef _INC_WIN32_PERL5 #define _INC_WIN32_PERL5 -#ifdef PERL_OBJECT +#ifndef _WIN32_WINNT +# define _WIN32_WINNT 0x0400 /* needed for TryEnterCriticalSection() etc. */ +#endif + +#if defined(PERL_OBJECT) || defined(PERL_IMPLICIT_SYS) || defined(PERL_CAPI) # define DYNAMIC_ENV_FETCH # define ENV_HV_NAME "___ENV_HV_NAME___" +# define HAS_GETENV_LEN # define prime_env_iter() # define WIN32IO_IS_STDIO /* don't pull in custom stdio layer */ +# define WIN32SCK_IS_STDSCK /* don't pull in custom wsock layer */ # ifdef PERL_GLOBAL_STRUCT -# error PERL_GLOBAL_STRUCT cannot be defined with PERL_OBJECT +# error PERL_GLOBAL_STRUCT cannot be defined with PERL_IMPLICIT_SYS # endif # define win32_get_privlib PerlEnv_lib_path # define win32_get_sitelib PerlEnv_sitelib_path +# define win32_get_vendorlib PerlEnv_vendorlib_path #endif #ifdef __GNUC__ -typedef long long __int64; -# define Win32_Winsock -/* GCC does not do __declspec() - render it a nop - * and turn on options to avoid importing data - */ -#ifndef __declspec -# define __declspec(x) -#endif -# ifndef PERL_OBJECT -# define PERL_GLOBAL_STRUCT -# define MULTIPLICITY +# ifndef __int64 /* some versions seem to #define it already */ +# define __int64 long long # endif +# define Win32_Winsock #endif /* Define DllExport akin to perl's EXT, @@ -42,6 +41,8 @@ typedef long long __int64; * otherwise import it. */ +/* now even GCC supports __declspec() */ + #if defined(PERL_OBJECT) #define DllExport #else @@ -70,6 +71,7 @@ typedef long long __int64; #include <stdio.h> #include <direct.h> #include <stdlib.h> +#include <fcntl.h> #ifndef EXT #include "EXTERN.h" #endif @@ -81,6 +83,18 @@ struct tms { long tms_cstime; }; +#ifndef SYS_NMLN +#define SYS_NMLN 257 +#endif + +struct utsname { + char sysname[SYS_NMLN]; + char nodename[SYS_NMLN]; + char release[SYS_NMLN]; + char version[SYS_NMLN]; + char machine[SYS_NMLN]; +}; + #ifndef START_EXTERN_C #undef EXTERN_C #ifdef __cplusplus @@ -106,15 +120,18 @@ struct tms { #define PERL_SOCK_SYSREAD_IS_RECV #define PERL_SOCK_SYSWRITE_IS_SEND +#define PERL_NO_FORCE_LINK /* no need for PL_force_link_funcs */ /* if USE_WIN32_RTL_ENV is not defined, Perl uses direct Win32 calls * to read the environment, bypassing the runtime's (usually broken) * facilities for accessing the same. See note in util.c/my_setenv(). */ /*#define USE_WIN32_RTL_ENV */ -/* Define USE_FIXED_OSFHANDLE to fix VC's _open_osfhandle() on W95. - * Can only enable it if not using the DLL CRT (it doesn't expose internals) */ -#if defined(_MSC_VER) && !defined(_DLL) && defined(_M_IX86) +/* Define USE_FIXED_OSFHANDLE to fix MSVCRT's _open_osfhandle() on W95. + It now uses some black magic to work seamlessly with the DLL CRT and + works with MSVC++ 4.0+ or GCC/Mingw32 + -- BKS 1-24-2000 */ +#if (defined(_M_IX86) && _MSC_VER >= 1000) || defined(__MINGW32__) #define USE_FIXED_OSFHANDLE #endif @@ -128,12 +145,24 @@ struct tms { #define FILE_SHARE_DELETE 0x00000004 #endif +/* access() mode bits */ +#ifndef R_OK +# define R_OK 4 +# define W_OK 2 +# define X_OK 1 +# define F_OK 0 +#endif + +#define PERL_GET_CONTEXT_DEFINED + /* Compiler-specific stuff. */ #ifdef __BORLANDC__ /* Borland C++ */ #define _access access #define _chdir chdir +#define _getpid getpid +#define wcsicmp _wcsicmp #include <sys/types.h> #ifndef DllMain @@ -149,70 +178,27 @@ struct tms { #pragma warn -use /* "'foo' is declared but never used" */ #pragma warn -csu /* "comparing signed and unsigned values" */ #pragma warn -pro /* "call to function with no prototype" */ - -#define USE_RTL_WAIT /* Borland has a working wait() */ +#pragma warn -stu /* "undefined structure 'foo'" */ /* Borland is picky about a bare member function name used as its ptr */ #ifdef PERL_OBJECT -#define FUNC_NAME_TO_PTR(name) &(name) +# define MEMBER_TO_FPTR(name) &(name) #endif +/* Borland C thinks that a pointer to a member variable is 12 bytes in size. */ +#define PERL_MEMBER_PTR_SIZE 12 + #endif #ifdef _MSC_VER /* Microsoft Visual C++ */ typedef long uid_t; typedef long gid_t; +typedef unsigned short mode_t; #pragma warning(disable: 4018 4035 4101 4102 4244 4245 4761) -#ifndef PERL_OBJECT - /* Visual C thinks that a pointer to a member variable is 16 bytes in size. */ -#define STRUCT_MGVTBL_DEFINITION \ -struct mgvtbl { \ - union { \ - int (CPERLscope(*svt_get)) _((SV *sv, MAGIC* mg)); \ - char handle_VC_problem1[16]; \ - }; \ - union { \ - int (CPERLscope(*svt_set)) _((SV *sv, MAGIC* mg)); \ - char handle_VC_problem2[16]; \ - }; \ - union { \ - U32 (CPERLscope(*svt_len)) _((SV *sv, MAGIC* mg)); \ - char handle_VC_problem3[16]; \ - }; \ - union { \ - int (CPERLscope(*svt_clear)) _((SV *sv, MAGIC* mg)); \ - char handle_VC_problem4[16]; \ - }; \ - union { \ - int (CPERLscope(*svt_free)) _((SV *sv, MAGIC* mg)); \ - char handle_VC_problem5[16]; \ - }; \ -} - -#define BASEOP_DEFINITION \ - OP* op_next; \ - OP* op_sibling; \ - OP* (CPERLscope(*op_ppaddr))_((ARGSproto)); \ - char handle_VC_problem[12]; \ - PADOFFSET op_targ; \ - OPCODE op_type; \ - U16 op_seq; \ - U8 op_flags; \ - U8 op_private; - -#define UNION_ANY_DEFINITION union any { \ - void* any_ptr; \ - I32 any_i32; \ - IV any_iv; \ - long any_long; \ - void (CPERLscope(*any_dptr)) _((void*)); \ - char handle_VC_problem[16]; \ -} - -#endif /* PERL_OBJECT */ +#define PERL_MEMBER_PTR_SIZE 16 #endif /* _MSC_VER */ @@ -227,14 +213,7 @@ typedef long gid_t; #define fcloseall _fcloseall #ifdef PERL_OBJECT -#define FUNC_NAME_TO_PTR(name) &(name) -#endif - -#ifndef _O_NOINHERIT -# define _O_NOINHERIT 0x0080 -# ifndef _NO_OLDNAMES -# define O_NOINHERIT _O_NOINHERIT -# endif +# define MEMBER_TO_FPTR(name) &(name) #endif #ifndef _O_NOINHERIT @@ -246,9 +225,53 @@ typedef long gid_t; #endif /* __MINGW32__ */ +/* both GCC/Mingw32 and MSVC++ 4.0 are missing this, so we put it here */ +#ifndef CP_UTF8 +# define CP_UTF8 65001 +#endif + /* compatibility stuff for other compilers goes here */ +#if !defined(PERL_OBJECT) && defined(PERL_CAPI) && defined(PERL_MEMBER_PTR_SIZE) +# define STRUCT_MGVTBL_DEFINITION \ +struct mgvtbl { \ + union { \ + int (CPERLscope(*svt_get))(pTHX_ SV *sv, MAGIC* mg); \ + char handle_VC_problem1[PERL_MEMBER_PTR_SIZE]; \ + }; \ + union { \ + int (CPERLscope(*svt_set))(pTHX_ SV *sv, MAGIC* mg); \ + char handle_VC_problem2[PERL_MEMBER_PTR_SIZE]; \ + }; \ + union { \ + U32 (CPERLscope(*svt_len))(pTHX_ SV *sv, MAGIC* mg); \ + char handle_VC_problem3[PERL_MEMBER_PTR_SIZE]; \ + }; \ + union { \ + int (CPERLscope(*svt_clear))(pTHX_ SV *sv, MAGIC* mg); \ + char handle_VC_problem4[PERL_MEMBER_PTR_SIZE]; \ + }; \ + union { \ + int (CPERLscope(*svt_free))(pTHX_ SV *sv, MAGIC* mg); \ + char handle_VC_problem5[PERL_MEMBER_PTR_SIZE]; \ + }; \ +} + +# define BASEOP_DEFINITION \ + OP* op_next; \ + OP* op_sibling; \ + OP* (CPERLscope(*op_ppaddr))(pTHX); \ + char handle_VC_problem[PERL_MEMBER_PTR_SIZE-sizeof(OP*)]; \ + PADOFFSET op_targ; \ + OPCODE op_type; \ + U16 op_seq; \ + U8 op_flags; \ + U8 op_private; + +#endif /* !PERL_OBJECT && PERL_CAPI && PERL_MEMBER_PTR_SIZE */ + + START_EXTERN_C /* For UNIX compatibility. */ @@ -271,8 +294,34 @@ extern int chown(const char *p, uid_t o, gid_t g); #define init_os_extras Perl_init_os_extras DllExport void Perl_win32_init(int *argcp, char ***argvp); -DllExport void Perl_init_os_extras(void); +DllExport void Perl_init_os_extras(); DllExport void win32_str_os_error(void *sv, DWORD err); +DllExport int RunPerl(int argc, char **argv, char **env); + +typedef struct { + HANDLE childStdIn; + HANDLE childStdOut; + HANDLE childStdErr; + /* + * the following correspond to the fields of the same name + * in the STARTUPINFO structure. Embedders can use these to + * control the spawning process' look. + * Example - to hide the window of the spawned process: + * dwFlags = STARTF_USESHOWWINDOW; + * wShowWindow = SW_HIDE; + */ + DWORD dwFlags; + DWORD dwX; + DWORD dwY; + DWORD dwXSize; + DWORD dwYSize; + DWORD dwXCountChars; + DWORD dwYCountChars; + DWORD dwFillAttribute; + WORD wShowWindow; +} child_IO_table; + +DllExport void win32_get_child_IO(child_IO_table* ptr); #ifndef USE_SOCKETS_AS_HANDLES extern FILE * my_fdopen(int, char *); @@ -281,11 +330,16 @@ extern int my_fclose(FILE *); extern int do_aspawn(void *really, void **mark, void **sp); extern int do_spawn(char *cmd); extern int do_spawn_nowait(char *cmd); -extern char do_exec(char *cmd); -extern char * win32_get_privlib(char *pl); -extern char * win32_get_sitelib(char *pl); +extern char * win32_get_privlib(const char *pl); +extern char * win32_get_sitelib(const char *pl); +extern char * win32_get_vendorlib(const char *pl); extern int IsWin95(void); extern int IsWinNT(void); +extern void win32_argv2utf8(int argc, char** argv); + +#ifdef PERL_IMPLICIT_SYS +extern void win32_delete_internal_host(void *h); +#endif extern char * staticlinkmodules[]; @@ -309,50 +363,21 @@ typedef char * caddr_t; /* In malloc.c (core address). */ #define PERL_CORE #endif -#ifdef USE_BINMODE_SCRIPTS -#define PERL_SCRIPT_MODE "rb" -EXT void win32_strip_return(struct sv *sv); +#ifdef PERL_TEXTMODE_SCRIPTS +# define PERL_SCRIPT_MODE "r" #else -#define PERL_SCRIPT_MODE "r" -#define win32_strip_return(sv) NOOP -#endif - -#define HAVE_INTERP_INTERN -struct interp_intern { - char * w32_perlshell_tokens; - char ** w32_perlshell_vec; - long w32_perlshell_items; - struct av * w32_fdpid; -#ifndef USE_RTL_WAIT - long w32_num_children; - HANDLE w32_child_pids[MAXIMUM_WAIT_OBJECTS]; -#endif -}; - -#define w32_perlshell_tokens (PL_sys_intern.w32_perlshell_tokens) -#define w32_perlshell_vec (PL_sys_intern.w32_perlshell_vec) -#define w32_perlshell_items (PL_sys_intern.w32_perlshell_items) -#define w32_fdpid (PL_sys_intern.w32_fdpid) - -#ifndef USE_RTL_WAIT -# define w32_num_children (PL_sys_intern.w32_num_children) -# define w32_child_pids (PL_sys_intern.w32_child_pids) +# define PERL_SCRIPT_MODE "rb" #endif /* * Now Win32 specific per-thread data stuff */ -#ifdef USE_THREADS -# ifndef USE_DECLSPEC_THREAD -# define HAVE_THREAD_INTERN - struct thread_intern { /* XXX can probably use one buffer instead of several */ char Wstrerror_buffer[512]; struct servent Wservent; char Wgetlogin_buffer[128]; - char Ww32_perllib_root[MAX_PATH+1]; # ifdef USE_SOCKETS_AS_HANDLES int Winit_socktype; # endif @@ -363,7 +388,100 @@ struct thread_intern { void * retv; /* slot for thread return value */ # endif }; + +#ifdef USE_THREADS +# ifndef USE_DECLSPEC_THREAD +# define HAVE_THREAD_INTERN # endif /* !USE_DECLSPEC_THREAD */ #endif /* USE_THREADS */ +#define HAVE_INTERP_INTERN +typedef struct { + long num; + DWORD pids[MAXIMUM_WAIT_OBJECTS]; + HANDLE handles[MAXIMUM_WAIT_OBJECTS]; +} child_tab; + +struct interp_intern { + char * perlshell_tokens; + char ** perlshell_vec; + long perlshell_items; + struct av * fdpid; + child_tab * children; +#ifdef USE_ITHREADS + DWORD pseudo_id; + child_tab * pseudo_children; +#endif + void * internal_host; +#ifndef USE_THREADS + struct thread_intern thr_intern; +#endif +}; + + +#define w32_perlshell_tokens (PL_sys_intern.perlshell_tokens) +#define w32_perlshell_vec (PL_sys_intern.perlshell_vec) +#define w32_perlshell_items (PL_sys_intern.perlshell_items) +#define w32_fdpid (PL_sys_intern.fdpid) +#define w32_children (PL_sys_intern.children) +#define w32_num_children (w32_children->num) +#define w32_child_pids (w32_children->pids) +#define w32_child_handles (w32_children->handles) +#define w32_pseudo_id (PL_sys_intern.pseudo_id) +#define w32_pseudo_children (PL_sys_intern.pseudo_children) +#define w32_num_pseudo_children (w32_pseudo_children->num) +#define w32_pseudo_child_pids (w32_pseudo_children->pids) +#define w32_pseudo_child_handles (w32_pseudo_children->handles) +#define w32_internal_host (PL_sys_intern.internal_host) +#ifdef USE_THREADS +# define w32_strerror_buffer (thr->i.Wstrerror_buffer) +# define w32_getlogin_buffer (thr->i.Wgetlogin_buffer) +# define w32_crypt_buffer (thr->i.Wcrypt_buffer) +# define w32_servent (thr->i.Wservent) +# define w32_init_socktype (thr->i.Winit_socktype) +#else +# define w32_strerror_buffer (PL_sys_intern.thr_intern.Wstrerror_buffer) +# define w32_getlogin_buffer (PL_sys_intern.thr_intern.Wgetlogin_buffer) +# define w32_crypt_buffer (PL_sys_intern.thr_intern.Wcrypt_buffer) +# define w32_servent (PL_sys_intern.thr_intern.Wservent) +# define w32_init_socktype (PL_sys_intern.thr_intern.Winit_socktype) +#endif /* USE_THREADS */ + +/* UNICODE<>ANSI translation helpers */ +/* Use CP_ACP when mode is ANSI */ +/* Use CP_UTF8 when mode is UTF8 */ + +#define A2WHELPER_LEN(lpa, alen, lpw, nBytes)\ + (lpw[0] = 0, MultiByteToWideChar((IN_BYTE) ? CP_ACP : CP_UTF8, 0, \ + lpa, alen, lpw, (nBytes/sizeof(WCHAR)))) +#define A2WHELPER(lpa, lpw, nBytes) A2WHELPER_LEN(lpa, -1, lpw, nBytes) + +#define W2AHELPER_LEN(lpw, wlen, lpa, nChars)\ + (lpa[0] = '\0', WideCharToMultiByte((IN_BYTE) ? CP_ACP : CP_UTF8, 0, \ + lpw, wlen, (LPSTR)lpa, nChars,NULL,NULL)) +#define W2AHELPER(lpw, lpa, nChars) W2AHELPER_LEN(lpw, -1, lpa, nChars) + +#define USING_WIDE() (PL_widesyscalls && PerlEnv_os_id() == VER_PLATFORM_WIN32_NT) + +#ifdef USE_ITHREADS +# define PERL_WAIT_FOR_CHILDREN \ + STMT_START { \ + if (w32_pseudo_children && w32_num_pseudo_children) { \ + long children = w32_num_pseudo_children; \ + WaitForMultipleObjects(children, \ + w32_pseudo_child_handles, \ + TRUE, INFINITE); \ + while (children) \ + CloseHandle(w32_pseudo_child_handles[--children]); \ + } \ + } STMT_END +#endif + +/* + * This provides a layer of functions and macros to ensure extensions will + * get to use the same RTL functions as the core. + */ +#include "win32iop.h" + #endif /* _INC_WIN32_PERL5 */ + diff --git a/gnu/usr.bin/perl/win32/win32iop.h b/gnu/usr.bin/perl/win32/win32iop.h index c7a74444e06..d7c2ac4f743 100644 --- a/gnu/usr.bin/perl/win32/win32iop.h +++ b/gnu/usr.bin/perl/win32/win32iop.h @@ -113,6 +113,13 @@ DllExport void win32_free(void *block); DllExport int win32_open_osfhandle(long handle, int flags); DllExport long win32_get_osfhandle(int fd); +DllExport DIR* win32_opendir(char *filename); +DllExport struct direct* win32_readdir(DIR *dirp); +DllExport long win32_telldir(DIR *dirp); +DllExport void win32_seekdir(DIR *dirp, long loc); +DllExport void win32_rewinddir(DIR *dirp); +DllExport int win32_closedir(DIR *dirp); + #ifndef USE_WIN32_RTL_ENV DllExport char* win32_getenv(const char *name); DllExport int win32_putenv(const char *name); @@ -122,15 +129,22 @@ DllExport unsigned win32_sleep(unsigned int); DllExport int win32_times(struct tms *timebuf); DllExport unsigned win32_alarm(unsigned int sec); DllExport int win32_stat(const char *path, struct stat *buf); +DllExport char* win32_longpath(char *path); DllExport int win32_ioctl(int i, unsigned int u, char *data); +DllExport int win32_link(const char *oldname, const char *newname); +DllExport int win32_unlink(const char *f); DllExport int win32_utime(const char *f, struct utimbuf *t); +DllExport int win32_uname(struct utsname *n); DllExport int win32_wait(int *status); DllExport int win32_waitpid(int pid, int *status, int flags); DllExport int win32_kill(int pid, int sig); +DllExport unsigned long win32_os_id(void); +DllExport void* win32_dynaload(const char*filename); +DllExport int win32_access(const char *path, int mode); +DllExport int win32_chmod(const char *path, int mode); +DllExport int win32_getpid(void); -#if defined(HAVE_DES_FCRYPT) || defined(PERL_OBJECT) DllExport char * win32_crypt(const char *txt, const char *salt); -#endif END_EXTERN_C @@ -152,7 +166,9 @@ END_EXTERN_C #undef times #undef alarm #undef ioctl +#undef unlink #undef utime +#undef uname #undef wait #ifdef __BORLANDC__ @@ -205,6 +221,7 @@ END_EXTERN_C #define abort() win32_abort() #define fstat(fd,bufptr) win32_fstat(fd,bufptr) #define stat(pth,bufptr) win32_stat(pth,bufptr) +#define longpath(pth) win32_longpath(pth) #define rename(old,new) win32_rename(old,new) #define setmode(fd,mode) win32_setmode(fd,mode) #define lseek(fd,offset,orig) win32_lseek(fd,offset,orig) @@ -242,6 +259,9 @@ END_EXTERN_C #define getchar win32_getchar #undef putchar #define putchar win32_putchar +#define access(p,m) win32_access(p,m) +#define chmod(p,m) win32_chmod(p,m) + #if !defined(MYMALLOC) || !defined(PERL_CORE) #undef malloc @@ -260,7 +280,10 @@ END_EXTERN_C #define times win32_times #define alarm win32_alarm #define ioctl win32_ioctl +#define link win32_link +#define unlink win32_unlink #define utime win32_utime +#define uname win32_uname #define wait win32_wait #define waitpid win32_waitpid #define kill win32_kill @@ -271,11 +294,11 @@ END_EXTERN_C #define seekdir win32_seekdir #define rewinddir win32_rewinddir #define closedir win32_closedir +#define os_id win32_os_id +#define getpid win32_getpid -#ifdef HAVE_DES_FCRYPT #undef crypt -#define crypt win32_crypt -#endif +#define crypt(t,s) win32_crypt(t,s) #ifndef USE_WIN32_RTL_ENV #undef getenv diff --git a/gnu/usr.bin/perl/win32/win32sck.c b/gnu/usr.bin/perl/win32/win32sck.c index 27136058402..93d501edefb 100644 --- a/gnu/usr.bin/perl/win32/win32sck.c +++ b/gnu/usr.bin/perl/win32/win32sck.c @@ -20,7 +20,6 @@ #if defined(PERL_OBJECT) #define NO_XSLOCKS -extern CPerlObj* pPerl; #include "XSUB.h" #endif @@ -76,23 +75,12 @@ static struct servent* win32_savecopyservent(struct servent*d, struct servent*s, const char *proto); -#ifdef USE_THREADS -#ifdef USE_DECLSPEC_THREAD -__declspec(thread) struct servent myservent; -__declspec(thread) int init_socktype; -#else -#define myservent (thr->i.Wservent) -#define init_socktype (thr->i.Winit_socktype) -#endif -#else -static struct servent myservent; -#endif - static int wsock_started = 0; void start_sockets(void) { + dTHXo; unsigned short version; WSADATA retdata; int ret; @@ -103,9 +91,9 @@ start_sockets(void) */ version = 0x101; if(ret = WSAStartup(version, &retdata)) - croak("Unable to locate winsock library!\n"); + Perl_croak_nocontext("Unable to locate winsock library!\n"); if(retdata.wVersion != version) - croak("Could not find version 1.1 of winsock dll\n"); + Perl_croak_nocontext("Could not find version 1.1 of winsock dll\n"); /* atexit((void (*)(void)) EndSockets); */ wsock_started = 1; @@ -116,17 +104,17 @@ set_socktype(void) { #ifdef USE_SOCKETS_AS_HANDLES #ifdef USE_THREADS - dTHR; - if(!init_socktype) { + dTHX; + if (!w32_init_socktype) { #endif - int iSockOpt = SO_SYNCHRONOUS_NONALERT; - /* - * Enable the use of sockets as filehandles - */ - setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, - (char *)&iSockOpt, sizeof(iSockOpt)); + int iSockOpt = SO_SYNCHRONOUS_NONALERT; + /* + * Enable the use of sockets as filehandles + */ + setsockopt(INVALID_SOCKET, SOL_SOCKET, SO_OPENTYPE, + (char *)&iSockOpt, sizeof(iSockOpt)); #ifdef USE_THREADS - init_socktype = 1; + w32_init_socktype = 1; } #endif #endif /* USE_SOCKETS_AS_HANDLES */ @@ -495,12 +483,12 @@ win32_getprotobynumber(int num) struct servent * win32_getservbyname(const char *name, const char *proto) { + dTHXo; struct servent *r; - dTHR; SOCKET_TEST(r = getservbyname(name, proto), NULL); if (r) { - r = win32_savecopyservent(&myservent, r, proto); + r = win32_savecopyservent(&w32_servent, r, proto); } return r; } @@ -508,12 +496,12 @@ win32_getservbyname(const char *name, const char *proto) struct servent * win32_getservbyport(int port, const char *proto) { + dTHXo; struct servent *r; - dTHR; SOCKET_TEST(r = getservbyport(port, proto), NULL); if (r) { - r = win32_savecopyservent(&myservent, r, proto); + r = win32_savecopyservent(&w32_servent, r, proto); } return r; } @@ -521,18 +509,19 @@ win32_getservbyport(int port, const char *proto) int win32_ioctl(int i, unsigned int u, char *data) { + dTHXo; u_long argp = (u_long)data; int retval; if (!wsock_started) { - croak("ioctl implemented only on sockets"); + Perl_croak_nocontext("ioctl implemented only on sockets"); /* NOTREACHED */ } retval = ioctlsocket(TO_SOCKET(i), (long)u, &argp); if (retval == SOCKET_ERROR) { if (WSAGetLastError() == WSAENOTSOCK) { - croak("ioctl implemented only on sockets"); + Perl_croak_nocontext("ioctl implemented only on sockets"); /* NOTREACHED */ } errno = WSAGetLastError(); @@ -561,88 +550,101 @@ win32_inet_addr(const char FAR *cp) void win32_endhostent() { - croak("endhostent not implemented!\n"); + dTHXo; + Perl_croak_nocontext("endhostent not implemented!\n"); } void win32_endnetent() { - croak("endnetent not implemented!\n"); + dTHXo; + Perl_croak_nocontext("endnetent not implemented!\n"); } void win32_endprotoent() { - croak("endprotoent not implemented!\n"); + dTHXo; + Perl_croak_nocontext("endprotoent not implemented!\n"); } void win32_endservent() { - croak("endservent not implemented!\n"); + dTHXo; + Perl_croak_nocontext("endservent not implemented!\n"); } struct netent * win32_getnetent(void) { - croak("getnetent not implemented!\n"); + dTHXo; + Perl_croak_nocontext("getnetent not implemented!\n"); return (struct netent *) NULL; } struct netent * win32_getnetbyname(char *name) { - croak("getnetbyname not implemented!\n"); + dTHXo; + Perl_croak_nocontext("getnetbyname not implemented!\n"); return (struct netent *)NULL; } struct netent * win32_getnetbyaddr(long net, int type) { - croak("getnetbyaddr not implemented!\n"); + dTHXo; + Perl_croak_nocontext("getnetbyaddr not implemented!\n"); return (struct netent *)NULL; } struct protoent * win32_getprotoent(void) { - croak("getprotoent not implemented!\n"); + dTHXo; + Perl_croak_nocontext("getprotoent not implemented!\n"); return (struct protoent *) NULL; } struct servent * win32_getservent(void) { - croak("getservent not implemented!\n"); + dTHXo; + Perl_croak_nocontext("getservent not implemented!\n"); return (struct servent *) NULL; } void win32_sethostent(int stayopen) { - croak("sethostent not implemented!\n"); + dTHXo; + Perl_croak_nocontext("sethostent not implemented!\n"); } void win32_setnetent(int stayopen) { - croak("setnetent not implemented!\n"); + dTHXo; + Perl_croak_nocontext("setnetent not implemented!\n"); } void win32_setprotoent(int stayopen) { - croak("setprotoent not implemented!\n"); + dTHXo; + Perl_croak_nocontext("setprotoent not implemented!\n"); } void win32_setservent(int stayopen) { - croak("setservent not implemented!\n"); + dTHXo; + Perl_croak_nocontext("setservent not implemented!\n"); } static struct servent* |