summaryrefslogtreecommitdiff
path: root/x2p/a2p.h
diff options
context:
space:
mode:
authorLarry Wall <lwall@jpl-devvax.jpl.nasa.gov>1989-12-21 07:38:16 +0000
committerLarry Wall <lwall@jpl-devvax.jpl.nasa.gov>1989-12-21 07:38:16 +0000
commitd8f2e4ccb684dfafc2c7b30a318ebf5798a9a1a4 (patch)
tree3c16387648ad5ab6cf979332dd605ab3fedb214e /x2p/a2p.h
parentffed7fefd1d95d05e699dababfbb57ef2497cea1 (diff)
downloadperl-d8f2e4ccb684dfafc2c7b30a318ebf5798a9a1a4.tar.gz
perl 3.0 patch #7 (combined patch)
The select operator didn't interpret bit vectors correctly on non-little-endian machines such as Suns. Rather than bollux up the rather straightforward interpretation of bit vectors, I made the select operator rearrange the bytes as necessary. So it is still true that vec($foo,0,1) refers to the first bit of the first byte of string $foo, even on big-endian machines. The send() socket operator didn't correctly allow you to specify a TO argument even though this was documented. (The TO argument is desirable for sending datagram packets.) In ANSI standard C, they decided that longjmp() didn't have to guarantee anything about registers. Several people sent me some patches that declared certain variables as volatile rather than register for such compilers. Rather than go that route, however, I wanted to keep some of these variables in registers, so I just made sure that the important ones are restored from non-register locations after longjmp(). I think "volatile" encourages people to punt too easily. The foreach construct still had some difficulty with two nested foreach loops referring to the same array, and to a single foreach that called its enclosing subroutine recursively. I think I've got this straight now. You wouldn't think a little iterator would give some much trouble. A pattern like /b*/ wouldn't match a null string before the first character. And certain patterns didn't match correctly at end of string. The upshot was that $_ = 'aaa'; s/b*/x/g; produced 'axaxa' rather than the expected 'xaxaxax'. This has been fixed. Note however that the split operator will still not match a null string before the first character, so that split(/b*/,'aaa') produces ('a','a','a'), not ('','a','a','a',''). The saga continues, and hopefully concludes. I realized I was fighting a losing battle trying to grep out all the includes from <time.h> and <sys/time.h>. There are just too many funny includes, symbols, links and such on too many kinds of machines. Configure now compiles a test program several different ways to figure out which way to define the various symbols. Configure now lets you pick between yacc or bison for your compiler compiler. If you pick bison, be sure you have alloca somewhere on your system. The ANSI function strerror() is now supported where available. In addition, errno may now be a macro with an lvalue, so errno isn't declared extern if it's defined as a macro in <errno.h>. The memcpy() and memset() are now allowed to return void. There is now support for sys/ndir.h for systems such as Xenix. It's now also easier to cross compile on a 386 for a 286. DG/UX has functions setpgrp2() and getpgrp2() to keep the BSD sematics separate from the SystemV semantics. So now we have yet another wonderful non-standard way of doing things. There is also a utime.h file which lets them put time stamps on files to microsecond resolutions, though perl doesn't take advantage of this. The list of optional libraries to be searched for now includes -lnet_s, -lnsl_s, -lsocket and -lx. We can now find .h files down in /usr/include/lan. Microport systems have problems. I've added some CRIPPLED_CC support for them, but you still need to read the README.uport file for some extra rigamarole. In the README file, there are now hints for what to do if your compile doesn't work right, and specific hints for machines known to require certain switches. The grep operator with a simple first argument, such as grep(1,@array), didn't work right. That one seems silly, but grep($_,@array) didn't work either. Now it does. A /$pat/ followed by a // wrongly freed the runtime pattern twice, causing ill-will on the part of all concerned. The ord() function now always returns positive even on signed-char machines. This seems to be less surprising to people. If you still want a signed value on such machines, you can always use unpack. The lib/complete.pl file misused the @_ array. The array has been renamed. In the man page, I clarified that s`pat`repl` does command substitution on the replacement string, that $timeleft from select() is likely not implemented in many places, and that the qualified form package'filehandle works as well as $package'variable. It is also explicitly stated that certain identifiers (non-alpha, STDIN, etc.) are always resolved in package main's symbol table. Perl didn't grok setuid scripts that had a space on the first line between the shebang and the interpreter name. In stab.c, sighandler() may now return either void or int, depending on the value of VOIDSIG. You couldn't debug a script that used -p or -n because they would try to slap an extra } on the end of the perldb.pl file. This upset the parser. The interpration of strings like " ''$foo'' " caused problems because the tokener didn't realize that neither single quote following the variable was indicating a package qualifier. (It knew the last one wasn't, but was confused about the first one.) Merely changing an if to a while fixed it. Well, two if's. Another place we don't want ' to be interpreted as a package qualifier is if it's the delimiter for an m'pat' or s'pat'repl'. These have been grandfathered to look like a match and a substitution. There were a couple of problems in a2p. First, the ops array was dimensioned too big on 286's. Second, there was a problem involving passing a union where I should've passed a member of the union, which meant user-defined functions didn't work right on some machines.
Diffstat (limited to 'x2p/a2p.h')
-rw-r--r--x2p/a2p.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/x2p/a2p.h b/x2p/a2p.h
index b322516b4f..67ad21e211 100644
--- a/x2p/a2p.h
+++ b/x2p/a2p.h
@@ -1,4 +1,4 @@
-/* $Header: a2p.h,v 3.0.1.1 89/11/11 05:07:00 lwall Locked $
+/* $Header: a2p.h,v 3.0.1.2 89/12/21 20:30:29 lwall Locked $
*
* Copyright (c) 1989, Larry Wall
*
@@ -6,6 +6,9 @@
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: a2p.h,v $
+ * Revision 3.0.1.2 89/12/21 20:30:29 lwall
+ * patch7: arranged so a2p has a chance of running on a 286
+ *
* Revision 3.0.1.1 89/11/11 05:07:00 lwall
* patch2: Configure may now set -DDEBUGGING
*
@@ -213,11 +216,16 @@ extern char *opname[];
EXT int mop INIT(1);
-#define OPSMAX 50000
-union {
+union u_ops {
int ival;
char *cval;
-} ops[OPSMAX]; /* hope they have 200k to spare */
+};
+#if defined(iAPX286) || defined(M_I286) || defined(I80286) /* 80286 hack */
+#define OPSMAX (64000/sizeof(union u_ops)) /* approx. max segment size */
+#else
+#define OPSMAX 50000
+#endif /* 80286 hack */
+union u_ops ops[OPSMAX];
#include <stdio.h>
#include <ctype.h>