diff options
author | Larry Wall <larry@wall.org> | 1989-10-18 00:00:00 +0000 |
---|---|---|
committer | Larry Wall <larry@wall.org> | 1989-10-18 00:00:00 +0000 |
commit | a687059cbaf2c6fdccb5e0fae2aee80ec15625a8 (patch) | |
tree | 674c8533b7bd942204f23782934c72f8624dd308 /stab.h | |
parent | 13281fa4f8547e0eb31d1986b865d9b7ec7d0dcc (diff) | |
download | perl-a687059cbaf2c6fdccb5e0fae2aee80ec15625a8.tar.gz |
perl 3.0: (no announcement message available)perl-3.000
A few of the new features: (18 Oct)
* Perl can now handle binary data correctly and has functions to pack and unpack binary structures into arrays or lists. You can now do arbitrary ioctl functions.
* You can now pass things to subroutines by reference.
* Debugger enhancements.
* An array or associative array may now appear in a local() list.
* Array values may now be interpolated into strings.
* Subroutine names are now distinguished by prefixing with &. You can call subroutines without using do, and without passing any argument list at all.
* You can use the new -u switch to cause perl to dump core so that you can run undump and produce a binary executable image. Alternately you can use the "dump" operator after initializing any variables and such.
* You can now chop lists.
* Perl now uses /bin/csh to do filename globbing, if available. This means that filenames with spaces or other strangenesses work right.
* New functions: mkdir and rmdir, getppid, getpgrp and setpgrp, getpriority and setpriority, chroot, ioctl and fcntl, flock, readlink, lstat, rindex, pack and unpack, read, warn, dbmopen and dbmclose, dump, reverse, defined, undef.
Diffstat (limited to 'stab.h')
-rw-r--r-- | stab.h | 88 |
1 files changed, 59 insertions, 29 deletions
@@ -1,37 +1,65 @@ -/* $Header: stab.h,v 2.0 88/06/05 00:11:05 root Exp $ +/* $Header: stab.h,v 3.0 89/10/18 15:23:30 lwall Locked $ + * + * Copyright (c) 1989, Larry Wall + * + * You may distribute under the terms of the GNU General Public License + * as specified in the README file that comes with the perl 3.0 kit. * * $Log: stab.h,v $ - * Revision 2.0 88/06/05 00:11:05 root - * Baseline version 2.0. + * Revision 3.0 89/10/18 15:23:30 lwall + * 3.0 baseline * */ -struct stab { - struct stab *stab_next; - char *stab_name; - STR *stab_val; - struct stio *stab_io; - FCMD *stab_form; - ARRAY *stab_array; - HASH *stab_hash; - SUBR *stab_sub; - char stab_flags; +struct stabptrs { + char stbp_magic[4]; + STR *stbp_val; /* scalar value */ + struct stio *stbp_io; /* filehandle value */ + FCMD *stbp_form; /* format value */ + ARRAY *stbp_array; /* array value */ + HASH *stbp_hash; /* associative array value */ + SUBR *stbp_sub; /* subroutine value */ + int stbp_lastexpr; /* used by nothing_in_common() */ + line_t stbp_line; /* line first declared at (for -w) */ + char stbp_flags; }; +#define stab_magic(stab) (((STBP*)(stab->str_ptr))->stbp_magic) +#define stab_val(stab) (((STBP*)(stab->str_ptr))->stbp_val) +#define stab_io(stab) (((STBP*)(stab->str_ptr))->stbp_io) +#define stab_form(stab) (((STBP*)(stab->str_ptr))->stbp_form) +#define stab_xarray(stab) (((STBP*)(stab->str_ptr))->stbp_array) +#define stab_array(stab) (((STBP*)(stab->str_ptr))->stbp_array ? \ + ((STBP*)(stab->str_ptr))->stbp_array : \ + ((STBP*)(aadd(stab)->str_ptr))->stbp_array) +#define stab_xhash(stab) (((STBP*)(stab->str_ptr))->stbp_hash) +#define stab_hash(stab) (((STBP*)(stab->str_ptr))->stbp_hash ? \ + ((STBP*)(stab->str_ptr))->stbp_hash : \ + ((STBP*)(hadd(stab)->str_ptr))->stbp_hash) +#define stab_sub(stab) (((STBP*)(stab->str_ptr))->stbp_sub) +#define stab_lastexpr(stab) (((STBP*)(stab->str_ptr))->stbp_lastexpr) +#define stab_line(stab) (((STBP*)(stab->str_ptr))->stbp_line) +#define stab_flags(stab) (((STBP*)(stab->str_ptr))->stbp_flags) +#define stab_name(stab) (stab->str_magic->str_ptr) + #define SF_VMAGIC 1 /* call routine to dereference STR val */ #define SF_MULTI 2 /* seen more than once */ struct stio { - FILE *fp; - long lines; - long page; - long page_len; - long lines_left; - char *top_name; - STAB *top_stab; - char *fmt_name; - STAB *fmt_stab; - short subprocess; + FILE *ifp; /* ifp and ofp are normally the same */ + FILE *ofp; /* but sockets need separate streams */ +#if defined(I_DIRENT) || defined(I_SYSDIR) + DIR *dirp; /* for opendir, readdir, etc */ +#endif + long lines; /* $. */ + long page; /* $% */ + long page_len; /* $= */ + long lines_left; /* $- */ + char *top_name; /* $^ */ + STAB *top_stab; /* $^ */ + char *fmt_name; /* $~ */ + STAB *fmt_stab; /* $~ */ + short subprocess; /* -| or |- */ char type; char flags; }; @@ -49,18 +77,20 @@ struct sub { #define Nullstab Null(STAB*) -#define STAB_STR(s) (tmpstab = (s), tmpstab->stab_flags & SF_VMAGIC ? stab_str(tmpstab) : tmpstab->stab_val) -#define STAB_GET(s) (tmpstab = (s), str_get(tmpstab->stab_flags & SF_VMAGIC ? stab_str(tmpstab) : tmpstab->stab_val)) -#define STAB_GNUM(s) (tmpstab = (s), str_gnum(tmpstab->stab_flags & SF_VMAGIC ? stab_str(tmpstab) : tmpstab->stab_val)) +#define STAB_STR(s) (tmpstab = (s), stab_flags(tmpstab) & SF_VMAGIC ? stab_str(stab_val(tmpstab)->str_magic) : stab_val(tmpstab)) +#define STAB_GET(s) (tmpstab = (s), str_get(stab_flags(tmpstab) & SF_VMAGIC ? stab_str(tmpstab->str_magic) : stab_val(tmpstab))) +#define STAB_GNUM(s) (tmpstab = (s), str_gnum(stab_flags(tmpstab) & SF_VMAGIC ? stab_str(tmpstab->str_magic) : stab_val(tmpstab))) EXT STAB *tmpstab; EXT STAB *stab_index[128]; -EXT char *envname; /* place for ENV name being assigned--gross cheat */ -EXT char *signame; /* place for SIG name being assigned--gross cheat */ - EXT unsigned short statusvalue; +EXT int delaymagic INIT(0); +#define DM_DELAY 1 +#define DM_REUID 2 +#define DM_REGID 4 + STAB *aadd(); STAB *hadd(); |