700 Commits

Author SHA1 Message Date
nobody
5c8a5c5941 This commit was manufactured by cvs2svn to create tag
'r3_1_2_eurosys_cd'.
2006-04-13 18:12:33 +00:00
Ben Gras
b1e5779b1c *** empty log message *** 2006-04-13 18:12:33 +00:00
Ben Gras
3aedf32a8a *** empty log message *** 2006-04-13 18:07:42 +00:00
Ben Gras
28290d0898 install motd as motd.install 2006-04-13 18:06:22 +00:00
Ben Gras
96e45935a1 Undo issue 2006-04-13 17:49:54 +00:00
Ben Gras
0f7b997dd5 remove issue 2006-04-13 17:48:21 +00:00
Ben Gras
b2648f99b7 Install dinks 2006-04-13 17:47:51 +00:00
Ben Gras
f36a9ad718 Tweak 2006-04-13 17:15:58 +00:00
Ben Gras
613e25760d Fixes for image. 2006-04-13 17:15:40 +00:00
Ben Gras
0e100664d0 Install dinks 2006-04-13 15:09:39 +00:00
Ben Gras
b539acfbd2 message 2006-04-13 14:38:16 +00:00
Ben Gras
4a8d5f5e38 fiX 2006-04-13 14:36:11 +00:00
Ben Gras
35d96ce368 Newline fix 2006-04-13 14:30:05 +00:00
Ben Gras
928b493106 Andy's issue. 2006-04-13 14:29:11 +00:00
Ben Gras
c3a0a231c6 Andy's motd 2006-04-13 14:27:16 +00:00
Ben Gras
37a2ea0212 Andy's install message. 2006-04-13 14:24:59 +00:00
Ben Gras
d061f4c3b2 sigh 2006-04-13 14:18:23 +00:00
Ben Gras
57245468ca Sum wrong way round 2006-04-13 13:49:08 +00:00
Ben Gras
ebdfcbf297 For packages. 2006-04-13 12:44:06 +00:00
Ben Gras
353d71a731 More packages - more usr 2006-04-13 02:00:54 +00:00
Ben Gras
d8af4488d9 2nd is sum. 2006-04-13 01:59:43 +00:00
Ben Gras
e377457daa Install ls in /bin too 2006-04-12 21:51:01 +00:00
Ben Gras
e87dff0619 Install elvis as elvis, not vi 2006-04-12 20:22:42 +00:00
Ben Gras
5bb4530aba No beta 2006-04-12 15:53:37 +00:00
Ben Gras
0f0cb51072 Compute 1440k for mkboot 2006-04-12 15:53:19 +00:00
Ben Gras
c8196c483f Bigger root. 2006-04-12 11:33:07 +00:00
Ben Gras
683efbe4c1 Fixes for bios emulation (image names) 2006-04-12 11:32:49 +00:00
Philip Homburg
e860feaa2c Added PCI_IDE_PRI_NATIVE and PCI_IDE_SEC_NATIVE. 2006-04-12 11:26:20 +00:00
Philip Homburg
2dc693cfe5 Do not record BARs for IDE controllers in compatibility mode. 2006-04-12 11:18:13 +00:00
Ben Gras
ef7f412175 Maybe one more beta 2006-04-12 09:33:53 +00:00
Ben Gras
c1a20efeb9 Less stack for tar - a bit cramped installing binary packages
on 16MB machines otherwise.
2006-04-12 00:10:17 +00:00
Ben Gras
7a0f8e28ba Start nonamed in local mode by default 2006-04-11 13:42:58 +00:00
Ben Gras
ab3b9ed760 added -L option that makes nonamed ignore queries that don't come from
localhost.
2006-04-11 13:42:29 +00:00
Ben Gras
730b6a20d0 New version 2006-04-11 12:03:06 +00:00
Ben Gras
103f18cb1f (1) remove ftpd in favour of ftpd200
(2) add /etc/rc.daemons.dist, can be copied to /etc/rc.daemons
    if user wants the standard daemons to run, which are no longer run
    by default
2006-04-11 11:55:45 +00:00
Philip Homburg
867e30469a Extra debug output for iogap. 2006-04-11 11:50:29 +00:00
Ben Gras
ae0b780257 ssh port 2006-04-10 15:36:48 +00:00
Ben Gras
8dd76cb556 -p option to not include packages
Fix usage kb issue - don't count packages
2006-04-10 14:18:54 +00:00
Ben Gras
f8b66e3d79 Kill everyone even in tinyhalt. This causes tty to important clean up. 2006-04-10 00:29:34 +00:00
Ben Gras
9f3cc391a2 Little bug in tinyhalt causing it not to recognize when called as reboot. 2006-04-09 23:24:37 +00:00
Ben Gras
3172b4d0ad Patches by Jeff Bailey for posixifications. 2006-04-09 23:16:13 +00:00
Ben Gras
23f881aa29 Hack to mask 1586 ('extended family') as 686 2006-04-05 20:57:18 +00:00
Ben Gras
04a1d3b3d7 Disable debug log 2006-04-05 14:25:21 +00:00
Ben Gras
dcfdbcae74 install elvis as /bin/vi and /usr/bin/vi 2006-04-05 12:01:48 +00:00
Ben Gras
9ee6aa8b7b Kludge for 1586 processor id. 2006-04-05 11:56:05 +00:00
Ben Gras
978feddf13 Don't do this here too 2006-04-05 11:27:25 +00:00
Ben Gras
d0686d11b0 Make root bigger for commands and logs and such. 2006-04-05 10:33:31 +00:00
Ben Gras
321b886f70 Call elvis vi. 2006-04-05 10:32:58 +00:00
Ben Gras
6137c5898c -f 2006-04-05 09:29:18 +00:00
Ben Gras
ddfc600485 Put elvis temporary files in /tmp, so it works from cd. 2006-04-05 09:28:52 +00:00
Ben Gras
3b6220fe77 Add /usr/local/gnu/lib 2006-04-04 16:15:34 +00:00
Ben Gras
0787908d1b Only update manpages if dir exists 2006-04-04 16:15:00 +00:00
Ben Gras
7a1853a524 Remove old syslogd.pid at boot time 2006-04-04 16:12:08 +00:00
Ben Gras
b24c08c254 Formatting fixes for 100% usage 2006-04-04 14:59:51 +00:00
Ben Gras
b38a20904c use smallbunzip only when we can't start bunzip 2006-04-04 14:52:22 +00:00
Ben Gras
7cfb7d912f Fix 2006-04-04 14:22:40 +00:00
Ben Gras
753e119f18 Make syslogd work, even if it can only open klog and not udp or vice versa
(but not neither)
2006-04-04 14:18:16 +00:00
Ben Gras
f219efb41e Fix /var/log 2006-04-04 13:50:05 +00:00
Ben Gras
ea398f994a Only fiddle with /var/log on cd 2006-04-04 13:44:23 +00:00
Ben Gras
7e2a2854d6 Don't bzip iso. 2006-04-04 13:40:38 +00:00
Ben Gras
3775ce2eba Fixes for /var/log 2006-04-04 13:31:56 +00:00
Ben Gras
a18229a8f7 *** empty log message *** 2006-04-04 13:25:19 +00:00
Ben Gras
5c88f19a5a *** empty log message *** 2006-04-04 12:59:30 +00:00
Ben Gras
b9e31bead6 Include .minixpackage info file 2006-04-04 12:57:48 +00:00
Ben Gras
6367fcdf51 Include syslogd 2006-04-04 12:55:20 +00:00
Ben Gras
98ae81cc92 Clean this up 2006-04-04 12:52:22 +00:00
Ben Gras
27cae0a47e Don't let lance steal keys 2006-04-04 12:50:07 +00:00
Philip Homburg
36f4976e17 Support for IDE controllers that announce themselves as RAID controllers. 2006-04-04 12:27:28 +00:00
Philip Homburg
acf9910a6e Added some defines for mass storage. 2006-04-04 12:26:37 +00:00
Ben Gras
51e2078d8a Bah 2006-04-04 12:14:18 +00:00
Ben Gras
c9a0768242 Beta 3 2006-04-04 12:11:30 +00:00
Ben Gras
a3dfe3c9a4 Make /var/log writable (in /tmp); start syslogd after that 2006-04-04 11:52:57 +00:00
Ben Gras
d93b0e8f18 Tralala 2006-04-04 11:46:50 +00:00
Ben Gras
697c1ec143 *** empty log message *** 2006-04-04 09:47:19 +00:00
Ben Gras
f7683420ae *** empty log message *** 2006-04-04 09:46:54 +00:00
Ben Gras
356623fa81 Fixes for noninteractive use 2006-04-04 09:43:26 +00:00
Ben Gras
11a5f05cba Don't put 3 copies of the image on the boot floppy 2006-04-03 20:06:07 +00:00
Ben Gras
261ae3b463 Use /dev instead of MAKEDEV because release builds are run as bin. 2006-04-03 19:36:15 +00:00
Ben Gras
38676609c1 Don't redirect stderr to /dev/null 2006-04-03 18:47:28 +00:00
Ben Gras
d5320164cf Redundancy in std 2006-04-03 18:46:59 +00:00
Ben Gras
87dbe50e8c setenv() compiler fixes 2006-04-03 18:31:27 +00:00
Ben Gras
f0ebf5e4c3 We have setenv() now. 2006-04-03 18:26:43 +00:00
Ben Gras
0a24534f62 Some more definitions for applications 2006-04-03 15:07:09 +00:00
Ben Gras
dbc345e1dd . getifaddrs() and data
. sysexit definitions

for porting
2006-04-03 15:06:31 +00:00
Ben Gras
7d0b64505a Added getifaddrs() 2006-04-03 15:03:43 +00:00
Ben Gras
d464faf987 updated syslog(), added setenv() 2006-04-03 15:03:07 +00:00
Ben Gras
321f95f6c5 setenv() 2006-04-03 15:02:32 +00:00
Ben Gras
dcb0fee484 script to generate /dev part of proto file. 2006-04-03 15:01:43 +00:00
Ben Gras
ee2c14934a syslog related manpages 2006-04-03 14:59:52 +00:00
Ben Gras
aaf30491f3 write_log() after killing everyone. This improves the quality of
the reboot-check, as otherwise logout records can get written after
our reboot record.
2006-04-03 14:50:07 +00:00
Ben Gras
969989b7e6 Hmm, binary mkfs lying around 2006-04-03 14:40:21 +00:00
Philip Homburg
18fa537efe Make harddisk-emulation CD work. 2006-04-03 14:31:59 +00:00
Ben Gras
910d6c8255 Added a default $MANPATH 2006-04-03 14:26:53 +00:00
Ben Gras
14a82e2d05 start syslogd instead of usyslogd ; include syslog.conf 2006-04-03 13:09:47 +00:00
Ben Gras
6a0829c700 Kick out usyslogd in favour of syslogd Giovanni's syslogd port 2006-04-03 13:07:42 +00:00
Ben Gras
f3771bb74c Update X manpages too. 2006-04-03 13:06:22 +00:00
Ben Gras
4437f258c9 probe all the way to d7 2006-04-03 13:05:04 +00:00
Philip Homburg
846ae81717 Fix for 'pci: mem_top too low' panic. Removed 'pci_next_dev: got nothing'
message.
2006-04-03 12:12:04 +00:00
Ben Gras
a65e215874 .. 2006-04-02 18:12:11 +00:00
Ben Gras
59ffa8127e Even more pci busses. 2006-04-01 16:32:28 +00:00
Ben Gras
5ea6a2cd2c make find accept -type p for FIFOs
also -type s but never match
2006-04-01 00:04:29 +00:00
Ben Gras
61f8571ff2 postfix complaint 2006-03-31 22:33:29 +00:00
Ben Gras
5519b87186 make gcc doesn't work if $SHELL is unexpected 2006-03-31 22:26:42 +00:00
Ben Gras
8b8fecf10d Add rsync ass service 2006-03-31 20:37:54 +00:00
Ben Gras
b057dcf920 Mail user+group 2006-03-30 22:10:32 +00:00
Ben Gras
a704a57c46 include BSHELL path 2006-03-30 11:28:15 +00:00
Ben Gras
cdcb3df821 1-sized passwd cache 2006-03-29 12:44:06 +00:00
Ben Gras
2ab95796b5 Don't install in /sbin - confusing with real tty command 2006-03-29 12:41:11 +00:00
Ben Gras
99158dbdfc Add pty entries 2006-03-29 10:03:49 +00:00
Ben Gras
fcbfcfcd07 Don't do anything if time between updates is less than one tick. 2006-03-28 23:44:10 +00:00
Ben Gras
dd19ec55ea . have a user interface - q works! (use curses)
also pressing anything else updates the display
 . interval is settable, default changed to 2sec
 . window size changes are detected and display is
   updated
2006-03-28 23:42:55 +00:00
Ben Gras
ea4038ac50 *** empty log message *** 2006-03-28 13:58:12 +00:00
Ben Gras
3e6ec29095 psip fix 2006-03-28 13:38:52 +00:00
Ben Gras
ef676bd39b Set ip address manually without dhcp when psip is set in /etc/inet.conf. 2006-03-28 12:35:33 +00:00
Ben Gras
f32289c86f Never disable inet (for X) 2006-03-28 12:32:14 +00:00
Ben Gras
7497a76779 More filesystems. 2006-03-28 11:34:59 +00:00
Ben Gras
97f5d89780 Read .binpackage rc in package sources for configuration. 2006-03-28 11:28:43 +00:00
Ben Gras
2d5058685d Don't open pipes readwrite as it leads to confusion. 2006-03-28 11:28:16 +00:00
Ben Gras
52cd12195e Typo 2006-03-28 10:09:43 +00:00
Ben Gras
354a40a813 Added full termcap file from
http://www.catb.org/terminfo/termtypes.tc.gz
as termcap.big and screen entries to termcap
2006-03-27 14:16:45 +00:00
Ben Gras
9e2ee91082 Don't close the master fd before returning if slave opens ok 2006-03-27 11:08:53 +00:00
Ben Gras
1c88703f7b Let su report something more useful when shells fail to exec() 2006-03-27 11:08:17 +00:00
Ben Gras
d4f8286997 minor changes 2006-03-27 11:08:04 +00:00
Ben Gras
894fa0520e getsockname() reported local port and remote address - changed to local address. 2006-03-27 11:07:06 +00:00
Ben Gras
5cecf2d6ee Shorter message to fit on one console line 2006-03-26 20:33:14 +00:00
Ben Gras
44737aa233 Clarify message 2006-03-26 19:59:06 +00:00
Ben Gras
60277631e4 Make urlget for package list interruptable with ^C 2006-03-26 19:56:05 +00:00
Ben Gras
9b0832bbdd Update packme -> packman 2006-03-26 19:39:15 +00:00
Ben Gras
05fc502374 Intr doesn't work here. 2006-03-26 19:33:48 +00:00
Ben Gras
9399633416 Take out the local test. 2006-03-26 19:31:40 +00:00
Ben Gras
227d2c886d Fixed network availability check 2006-03-26 19:30:33 +00:00
Ben Gras
094beb2f1e Fix compile warnings 2006-03-26 18:13:35 +00:00
Ben Gras
17ff3090c4 Let builds work with any shell (set SHELL= so su works) 2006-03-26 18:08:08 +00:00
Ben Gras
04ad142c76 package/release tweaks 2006-03-26 18:01:39 +00:00
Ben Gras
27c0f507f9 Can't exec() with long arguments - slightly reduce default nargs under
regular minix.
2006-03-26 17:44:29 +00:00
Ben Gras
f53b73f4ea *** empty log message *** 2006-03-26 16:46:37 +00:00
Ben Gras
0524ed35cd Install tty in /sbin 2006-03-26 16:22:02 +00:00
Ben Gras
224aec8568 Index without .tar.bz 2006-03-26 16:00:25 +00:00
Ben Gras
807cd19e17 Package tweaks. 2006-03-26 15:51:34 +00:00
Ben Gras
bfb0e87265 Smarter packman that unifies cdrom and network packages. 2006-03-26 15:48:55 +00:00
Ben Gras
7b58dd7f9b Renamed findproc() to _pm_findproc() to reduce polluting of application
namespace.
2006-03-25 04:49:04 +00:00
Ben Gras
d9544b38d3 Install sources in /usr/src/commands 2006-03-25 00:00:23 +00:00
Ben Gras
ae54c6ed27 sys_in* bug 2006-03-24 23:11:10 +00:00
Ben Gras
654220cdb2 Compiler warning fix 2006-03-24 23:09:04 +00:00
Ben Gras
d130e2838e Fix for sys_in* bug 2006-03-24 23:08:19 +00:00
Ben Gras
ffa55918db fix for sys_in* bugs / compiler warnings 2006-03-24 23:07:23 +00:00
Ben Gras
df947669b3 Compiler warning 2006-03-24 23:05:54 +00:00
Ben Gras
d149383750 Compiler warnings 2006-03-24 23:05:21 +00:00
Ben Gras
dac520e6f2 Compile warnings 2006-03-24 23:02:56 +00:00
Ben Gras
df9f4f4369 . minor fix in select() logic on pipes
. fix in pipe_check when 'notouch' is on - we touched something!
2006-03-24 20:53:10 +00:00
Ben Gras
9f6b2666e1 Compiler warnings fix 2006-03-24 14:16:13 +00:00
Ben Gras
22c9e97029 Don't do this 2006-03-24 14:16:06 +00:00
Ben Gras
c1585a6b5e Compiler warning fix 2006-03-24 14:08:51 +00:00
Philip Homburg
3290604a80 Added NWIOTCPGERROR. 2006-03-24 14:08:46 +00:00
Ben Gras
5501dcd01b Fix compiler warning 2006-03-24 14:07:45 +00:00
Philip Homburg
e6dbd5cabf Added SO_ERROR support for tcp sockets. 2006-03-24 14:07:42 +00:00
Philip Homburg
6e0bf57f82 Fixed bug in tcp select, added NWIOTCPGERROR. 2006-03-24 14:06:03 +00:00
Philip Homburg
e695deb8f8 Fixed mq leak in NWIOQUERYPARAM. 2006-03-24 14:05:11 +00:00
Ben Gras
1ba2b198b4 Compiler warning 2006-03-24 14:04:16 +00:00
Ben Gras
65723cba53 Fix compiler warnings for pax 2006-03-24 14:03:25 +00:00
Ben Gras
e1f91e1855 Fix compiler warnings 2006-03-24 13:55:04 +00:00
Ben Gras
58aee91edf Fix compiler warnings. 2006-03-24 13:53:09 +00:00
Ben Gras
b56917558b Version builds 2006-03-24 13:48:14 +00:00
Ben Gras
dead87238d version -B2 2006-03-24 13:47:50 +00:00
Ben Gras
9faaae8222 version 1.2 2006-03-24 13:46:51 +00:00
Ben Gras
471c1e5f00 reply failed to whom? 2006-03-24 12:45:35 +00:00
Ben Gras
21aae71cbe Bigger bigsh 2006-03-23 20:31:40 +00:00
Ben Gras
0bcb14b384 _SC_PAGESIZE sysconf() support 2006-03-23 11:05:15 +00:00
Ben Gras
e28fe339bf Pports iwll go in commands, not bigports 2006-03-22 20:06:26 +00:00
Ben Gras
95ac103f34 Fix 2006-03-22 19:47:05 +00:00
Ben Gras
12e3d40eb4 *** empty log message *** 2006-03-22 19:39:26 +00:00
Ben Gras
986bd522b5 Sources are easypack packages, so get them from /software/, where easypack
packages are stored on the website.
2006-03-22 17:06:53 +00:00
Ben Gras
f28a4d0e9c .bz -> .bz2 2006-03-22 16:44:45 +00:00
Ben Gras
d9aad59630 bz2 2006-03-22 16:43:12 +00:00
Ben Gras
8a0e1e9575 Get rows from termcap it not available from term, or use 24 rows if none known 2006-03-22 15:32:44 +00:00
Ben Gras
9b7acd5257 Easypack and binpackage try build.minix first, in case a package includes
build itself.
2006-03-22 15:08:36 +00:00
Ben Gras
12ac96cf51 Fail if chmem fails 2006-03-22 15:08:14 +00:00
Ben Gras
e76a222de7 Rename latin-am to latin-america 2006-03-22 13:02:28 +00:00
Ben Gras
844caeaacb Make lots of pty's (for telnet, ssh, xterms, etc) 2006-03-20 17:13:02 +00:00
Ben Gras
9d564995cd Fix rename 2006-03-20 10:44:43 +00:00
Ben Gras
12f37ed99e Rename packme to packman. 2006-03-19 21:36:20 +00:00
Ben Gras
61e6eb290f Include version in ISO. 2006-03-19 20:57:22 +00:00
Ben Gras
95ea6383b5 we have longer filenames now so can spell scandinavian in full.
: ----------------------------------------------------------------------
2006-03-19 20:53:20 +00:00
Ben Gras
c2765f9fa6 *** empty log message *** 2006-03-18 01:10:17 +00:00
Ben Gras
e7fdb58915 *** empty log message *** 2006-03-18 00:35:33 +00:00
Ben Gras
42103a43c2 *** empty log message *** 2006-03-17 20:50:27 +00:00
Ben Gras
05915b5c5f Install setup in /bin 2006-03-17 20:22:39 +00:00
Ben Gras
7fc4f837bb usertime 2006-03-17 20:04:55 +00:00
Ben Gras
fb8c7e6fca Tinyhalt can't call REBOOT as PM can't deal with that any more. 2006-03-17 19:14:26 +00:00
Ben Gras
9e1428fb91 Exit status propagation fix from freebsd's sh 2006-03-17 17:33:20 +00:00
Ben Gras
ac9a157ba2 Absolute path feature for packit 2006-03-17 15:32:14 +00:00
Philip Homburg
d2e0cbc872 Fail when /etc/binary_sizes.$mode does not exist. 2006-03-17 15:25:21 +00:00
Philip Homburg
64a9d53b12 PCI reports the amount of video memory (for chmem'ing the X server) 2006-03-17 15:23:59 +00:00
Ben Gras
816f031854 set_lids() not done. 2006-03-17 15:22:17 +00:00
Ben Gras
0275fbcd31 *** empty log message *** 2006-03-17 14:46:38 +00:00
Ben Gras
5583cdc48f Sed typo 2006-03-17 14:03:07 +00:00
Ben Gras
4cdc27d7dc Don't echo and grep 2006-03-17 14:02:17 +00:00
Ben Gras
d142190ae1 Mount readonly 2006-03-17 14:00:26 +00:00
Ben Gras
382ebe8f2b case sensitive 2006-03-17 13:55:12 +00:00
Ben Gras
c37acca419 unterminated quoted string..
found on line 666! argh
2006-03-17 13:45:40 +00:00
Ben Gras
26a59eea43 readlink(); check bounds
top: add 'system' cpu time to 'kernel', 'idle' and 'user'
2006-03-17 13:34:40 +00:00
Ben Gras
0c3199c3aa *** empty log message *** 2006-03-17 13:23:50 +00:00
Ben Gras
4269039311 NE 2006-03-17 12:32:32 +00:00
Ben Gras
f889a34b58 Package message 2006-03-17 12:31:35 +00:00
Ben Gras
acac3c84f4 Fixes for absolute path names. 2006-03-17 12:27:20 +00:00
Ben Gras
7fb338622b Let top distinguish kernel time, explain in manpage. 2006-03-17 10:04:14 +00:00
Ben Gras
96783ed1f7 readlink command implementation + manpage 2006-03-17 09:27:26 +00:00
Ben Gras
ce64a1d542 Readlink, symlink manpage; fix for lstat 2006-03-17 09:10:39 +00:00
Ben Gras
827159c8ea *** empty log message *** 2006-03-17 08:15:13 +00:00
Ben Gras
e1d412d71e Top manpage + comment in code 2006-03-17 07:54:55 +00:00
Ben Gras
b833c48af2 Only postinstall if umount succeeded 2006-03-17 07:28:17 +00:00
Ben Gras
18388e4bf0 *** empty log message *** 2006-03-16 14:46:57 +00:00
Ben Gras
6a53881760 Packme - CD and network interface to packit 2006-03-16 14:36:07 +00:00
Ben Gras
af189061a8 *** empty log message *** 2006-03-16 13:38:47 +00:00
Ben Gras
35778a97ca Packages 2006-03-16 12:57:11 +00:00
Ben Gras
6257b0a0dc More for em_opt for bzip2 2006-03-16 12:53:04 +00:00
Ben Gras
6d14bd5ad3 *** empty log message *** 2006-03-16 12:49:53 +00:00
Ben Gras
0c8dbc55c9 Ignore PROC_EVENTs 2006-03-16 11:22:31 +00:00
Ben Gras
eae250dea4 . load average calculation changed to calculate it all over every tick
instead of keeping a running total of enqueued processes
   (because somehow the load average was broken)
 . added SI_KPROC_TAB to get a copy of kernel process table from PM, for
   a top implementation
 . fixed arg to sys_nice() to make it an endpoint, not a slot number
2006-03-16 09:33:35 +00:00
Ben Gras
e61522402a More fixes to reality 2006-03-16 01:47:52 +00:00
Ben Gras
5f9de84674 Tick calculation tweak 2006-03-16 01:44:06 +00:00
Ben Gras
fcd663d75f Top, welcome to minix.
Minix, welcome to the world of top.

A from-scratch top implementation for minix!
2006-03-16 01:29:51 +00:00
Ben Gras
6e7ba75acb Driver disappearing during dev_io() is not a fatal error. 2006-03-15 21:55:32 +00:00
Ben Gras
84ba9dd4d3 Dinks for the (source/binary) package scripts 2006-03-15 17:02:46 +00:00
Philip Homburg
7f861650b0 Use the sysutil library's printf code also for the kernel. 2006-03-15 16:15:23 +00:00
Ben Gras
91917f59e1 *** empty log message *** 2006-03-15 16:03:15 +00:00
Ben Gras
93f94cb7cc chroot in /bin for install script 2006-03-15 16:02:38 +00:00
Ben Gras
ff67776995 FS:
. loops checked for PID_FREE
  . exit broken down in exit and cleanup functions; when reboot happens,
    cleanup is done but not exit (as processes have not actually exited),
    this keeps drivers working
  . fixed a few uninitialized and unused variables

scripts:
  . new packaging system
2006-03-15 15:34:12 +00:00
Ben Gras
7879c008ae More stack for yacc (to compile nawk) 2006-03-15 15:16:43 +00:00
Ben Gras
557d865b35 Removed some debug prints 2006-03-15 15:16:16 +00:00
Ben Gras
e07a62161a . verbose recovery of tcpd
. chroot shows exit status to parent
2006-03-15 14:39:20 +00:00
Philip Homburg
7fecfd3740 Use assembler instead of C for the ramdisk. The assembler requires less
memory.
2006-03-15 14:28:05 +00:00
Ben Gras
36fa006cec Let tcpd retry on errors. 2006-03-15 13:59:13 +00:00
Philip Homburg
50d805144c dmap_io now returns a status. map_driver no longer calls dev_up. 2006-03-15 13:37:20 +00:00
Philip Homburg
36e8c1a185 Added assert to syslib. Moved panic from sysutil to syslib for assert.
Panic now tries sys_kill with SIGKILL first.
2006-03-15 12:06:18 +00:00
Philip Homburg
c1da6e6e24 Allow a process to kill itself. Remove the endpoint of a process that kills
itself before reporting the singal to pm.
2006-03-15 12:01:59 +00:00
Ben Gras
b351811f18 one-line descriptions 2006-03-15 11:50:15 +00:00
Philip Homburg
454dc8a180 Disabled special processing of KILL signals that are passed to pm by the kernel 2006-03-15 11:35:53 +00:00
Philip Homburg
57ed4b2bf7 Pass endpoint to sys_trace instead of slot number. 2006-03-15 11:32:00 +00:00
Ben Gras
55bdde85f0 Hack out of proc.c; function and flags width in ipc.h back to nibbles
instead of bytes for backwards compatability
2006-03-15 11:29:54 +00:00
Philip Homburg
d2d193c7b6 More space for mdb. Terminate an error message with a newline. 2006-03-15 11:29:22 +00:00
Ben Gras
8500d0f238 Backwards compatability hack 2006-03-15 11:11:54 +00:00
Ben Gras
ffd98d1b91 Fix test to match reality 2006-03-15 10:32:23 +00:00
Philip Homburg
d0d56cfb2b Reverting some of changes that break backward compatibility. 2006-03-15 10:18:59 +00:00
Ben Gras
def8c13ba8 Do a sync() before reboot()ing in FS. 2006-03-14 13:54:20 +00:00
Ben Gras
733f5da611 debug msg 2006-03-13 15:41:07 +00:00
Philip Homburg
5ceb98e9ee Added -u option for making USB-stick images. 2006-03-13 15:40:23 +00:00
Philip Homburg
5731e07839 Some /dev entries for c0d7. 2006-03-13 15:37:43 +00:00
Philip Homburg
4ca6f516c6 Added boot environment option 'ata_no_dma' to disable DMA. 2006-03-13 15:36:57 +00:00
Ben Gras
48b2be3ccc /dev/ram is a path 2006-03-13 14:49:08 +00:00
Ben Gras
3bd337d54c make a ramdisk if necessary 2006-03-13 14:44:34 +00:00
Ben Gras
34b1f1c738 Create a ramdisk using 'ramdisk'. 2006-03-13 14:41:54 +00:00
Ben Gras
1a7f7d6333 at_wini: removed RO_BIT misfeature, not used any more
pm: fixed rebooting by making a copy of the monitor code from the user
    process. this is necessary because that process is dead by the time
    sys_abort() is called.

    also added more info to the "can't reply" panic.
2006-03-13 13:21:13 +00:00
Ben Gras
b3f969af94 . Version is '3.1.2-B1', stands for -beta1
. Removed old copyright notice from <minix/const.h>
2006-03-13 13:18:39 +00:00
Ben Gras
cd8905f906 Don't need this change with new reboot 2006-03-13 10:36:52 +00:00
Jorrit Herder
0619cce2ab *** empty log message *** 2006-03-13 10:33:50 +00:00
Ben Gras
acdac1ec92 Don't choose FS by labels after all. 2006-03-13 08:47:05 +00:00
Ben Gras
ef077116b1 Don't set any labels. 2006-03-13 08:46:33 +00:00
Ben Gras
23158865b2 Don't include ramdisk image in .depend - breaks 'make depend' 2006-03-11 10:58:38 +00:00
Ben Gras
9b1d4ef233 special case when exiting FS - don't core dump and don't tell FS about it
Because if FS is hanging in a signal, the exit won't work.
This way FS gets exited on e.g. SIGSEGV.
2006-03-10 17:35:55 +00:00
Ben Gras
682efc75e5 Wait longer for ip address (fxp) 2006-03-10 17:33:15 +00:00
Ben Gras
c236121692 Let reboot work again by making PM check for RBT_REBOOT 2006-03-10 16:50:27 +00:00
Ben Gras
138a372e84 Understand PROC_EVENT 2006-03-10 16:38:36 +00:00
Ben Gras
71fd7596fa Understand PROC_EVENT 2006-03-10 16:27:21 +00:00
Jorrit Herder
376d8485d8 *** empty log message *** 2006-03-10 16:20:24 +00:00
Jorrit Herder
453beb04ad Library progress 2006-03-10 16:16:21 +00:00
Jorrit Herder
021e3234d8 Jorrit's ... "progress?" 2006-03-10 16:10:05 +00:00
Ben Gras
498e232a5c Keep file modes and such 2006-03-10 14:35:15 +00:00
Ben Gras
6fe89cfbe8 Hack small and big fs into a single image. Must now set BIG or SMALL label. 2006-03-10 14:11:19 +00:00
Ben Gras
525af3c6b2 controller variable is no longer sensible
set default label to BIG
2006-03-10 14:10:11 +00:00
Ben Gras
25fdc7657d panic() on inconsistent endpoints 2006-03-10 12:59:46 +00:00
Ben Gras
bf081105f1 No label stuff. All drivers. 2006-03-10 12:43:26 +00:00
Ben Gras
6746ee10f5 If re-open fails, mark fd as unusable but not-reusable either (until
close()d).
2006-03-09 16:00:33 +00:00
Philip Homburg
1353798747 Better probing code 2006-03-09 15:05:43 +00:00
Ben Gras
9a6987e9cd Medium stack for ds and rs 2006-03-09 14:03:39 +00:00
Ben Gras
0d831b9c22 Don't print anything if anything is wrong in send_sig() 2006-03-09 14:02:56 +00:00
Ben Gras
95285c399e A little more stack for memory 2006-03-09 14:02:32 +00:00
Ben Gras
6d98f7205a Verify if log process numbers are sensible 2006-03-09 14:00:33 +00:00
Ben Gras
5498a74d87 Typo in comment. 2006-03-09 13:59:59 +00:00
Ben Gras
af9aa29858 No gmake in use 2006-03-08 16:46:40 +00:00
Ben Gras
63e8494043 *** empty log message *** 2006-03-08 16:45:55 +00:00
Ben Gras
02a66adca0 *** empty log message *** 2006-03-08 16:34:36 +00:00
Ben Gras
a0d72d263c update needs more stack in order to handle signals 2006-03-08 15:42:31 +00:00
Ben Gras
925dd3321f Don't blindly skip 0-group processes in signals 2006-03-08 14:46:42 +00:00
Ben Gras
6c2a1bac7b endpoint fixes for RS 2006-03-08 14:38:35 +00:00
Ben Gras
acb804f0bd RS formatting fixes 2006-03-08 14:37:26 +00:00
Ben Gras
df361e818e Endpoint-enabled fix 2006-03-08 13:10:35 +00:00
Philip Homburg
4b62006c04 Fixed typo. 2006-03-08 12:30:43 +00:00
Ben Gras
4d115fcd91 rc: don't start floppy or at driver
passwd: add games for nethack
2006-03-08 12:21:40 +00:00
Philip Homburg
167ea0faa5 Added some disabled debug code. 2006-03-08 12:06:33 +00:00
Philip Homburg
9a1dfc5128 Do not confuse proc with proc_addr if you want a bug free kernel. 2006-03-08 11:59:59 +00:00
Ben Gras
4686e11dd5 Test receive() return code 2006-03-07 15:45:14 +00:00
Ben Gras
0cd9341f21 Tightened generation size - don't count process numbers more than once 2006-03-07 15:44:34 +00:00
Ben Gras
18df4cb859 Improved test constant 2006-03-07 15:44:00 +00:00
Ben Gras
7d95abb072 Take out arbitrary constant 2006-03-07 15:38:43 +00:00
Ben Gras
28324dc841 Fixed wrong fix 2006-03-07 14:58:18 +00:00
Ben Gras
f5029b721a Include boot options 2006-03-07 14:32:41 +00:00
Philip Homburg
e25dc302a9 Fixed masks on I/O ports. 2006-03-07 14:16:13 +00:00
Philip Homburg
a40988a29f Disabled pci_intel_ctrl. 2006-03-07 14:14:53 +00:00
Philip Homburg
69bd34a076 Added rawspeed. 2006-03-07 14:12:51 +00:00
Ben Gras
d63e366944 Less stack for ds and rs 2006-03-07 13:22:36 +00:00
Ben Gras
f3639098fb Align on 16 byte boundary, not 64k 2006-03-07 12:38:51 +00:00
Ben Gras
34e4c7d02c Do alignment after 64k-dma-boundary adjustment 2006-03-06 16:46:12 +00:00
Philip Homburg
2478cde442 Print PCI capability types. 2006-03-06 15:19:51 +00:00
Philip Homburg
d8c209b4f8 A bit of leftover cleanup work. 2006-03-06 10:42:51 +00:00
Ben Gras
b31d93aaa4 Comment fixes mailed to bugs@ 2006-03-04 22:51:52 +00:00
Ben Gras
10eeb788f9 Generation number printed too 2006-03-03 16:34:37 +00:00
Philip Homburg
9ddef3c59d Build memory driver last. 2006-03-03 15:38:27 +00:00
Philip Homburg
816973d1fe Support for DMA. 2006-03-03 15:37:51 +00:00
Ben Gras
7465aa5b60 Always do sanity check now. (Possible now that we have lba48.) 2006-03-03 15:34:24 +00:00
Ben Gras
aa3932eb8b Added 'xxl' binsizes size for x.
Leave sh and make at normal size for 'big'.
Call binsizes normal after creating release.
2006-03-03 12:44:22 +00:00
Ben Gras
9f200f8807 Endpoint field name 2006-03-03 12:13:37 +00:00
Ben Gras
b103bf5dc7 Fix of endpointless slot message in FS
Removed some leftover '#if 0'ed debug code in PM
2006-03-03 10:25:28 +00:00
Ben Gras
d1d4b5ae4d *** empty log message *** 2006-03-03 10:22:35 +00:00
Ben Gras
f877da3aec endpoint migration for drivers.
mostly renaming message field names to the new names.

tty stored process numbers in chars in tty and pty structs - now ints.
2006-03-03 10:21:45 +00:00
Ben Gras
7967177710 endpoint-aware conversion of servers.
'who', indicating caller number in pm and fs and some other servers, has
been removed in favour of 'who_e' (endpoint) and 'who_p' (proc nr.).

In both PM and FS, isokendpt() convert endpoints to process slot
numbers, returning OK if it was a valid and consistent endpoint number.
okendpt() does the same but panic()s if it doesn't succeed. (In PM,
this is pm_isok..)

pm and fs keep their own records of process endpoints in their proc tables,
which are needed to make kernel calls about those processes.

message field names have changed.

fs drivers are endpoints.

fs now doesn't try to get out of driver deadlock, as the protocol isn't
supposed to let that happen any more. (A warning is printed if ELOCKED
is detected though.)

fproc[].fp_task (indicating which driver the process is suspended on)
became an int.

PM and FS now get endpoint numbers of initial boot processes from the
kernel. These happen to be the same as the old proc numbers, to let
user processes reach them with the old numbers, but FS and PM don't know
that. All new processes after INIT, even after the generation number
wraps around, get endpoint numbers with generation 1 and higher, so
the first instances of the boot processes are the only processes ever
to have endpoint numbers in the old proc number range.

More return code checks of sys_* functions have been added.

IS has become endpoint-aware. Ditched the 'text' and 'data' fields
in the kernel dump (which show locations, not sizes, so aren't terribly
useful) in favour of the endpoint number. Proc number is still visible.

Some other dumps (e.g. dmap, rs) show endpoint numbers now too which got
the formatting changed.

PM reading segments using rw_seg() has changed - it uses other fields
in the message now instead of encoding the segment and process number and
fd in the fd field. For that it uses _read_pm() and _write_pm() which to
_taskcall()s directly in pm/misc.c.

PM now sys_exit()s itself on panic(), instead of sys_abort().

RS also talks in endpoints instead of process numbers.
2006-03-03 10:20:58 +00:00
Ben Gras
1335d5d700 'proc number' is process slot, 'endpoint' are generation-aware process
instance numbers, encoded and decoded using macros in <minix/endpoint.h>.

proc number -> endpoint migration
  . proc_nr in the interrupt hook is now an endpoint, proc_nr_e.
  . m_source for messages and notifies is now an endpoint, instead of
    proc number.
  . isokendpt() converts an endpoint to a process number, returns
    success (but fails if the process number is out of range, the
    process slot is not a living process, or the given endpoint
    number does not match the endpoint number in the process slot,
    indicating an old process).
  . okendpt() is the same as isokendpt(), but panic()s if the conversion
    fails. This is mainly used for decoding message.m_source endpoints,
    and other endpoint numbers in kernel data structures, which should
    always be correct.
  . if DEBUG_ENABLE_IPC_WARNINGS is enabled, isokendpt() and okendpt()
    get passed the __FILE__ and __LINE__ of the calling lines, and
    print messages about what is wrong with the endpoint number
    (out of range proc, empty proc, or inconsistent endpoint number),
    with the caller, making finding where the conversion failed easy
    without having to include code for every call to print where things
    went wrong. Sometimes this is harmless (wrong arg to a kernel call),
    sometimes it's a fatal internal inconsistency (bogus m_source).
  . some process table fields have been appended an _e to indicate it's
    become and endpoint.
  . process endpoint is stored in p_endpoint, without generation number.
    it turns out the kernel never needs the generation number, except
    when fork()ing, so it's decoded then.
  . kernel calls all take endpoints as arguments, not proc numbers.
    the one exception is sys_fork(), which needs to know in which slot
    to put the child.
2006-03-03 10:00:02 +00:00
Ben Gras
5d7f5fccf5 . rename message fields to endpoint variants
. remove or optionalify some pci debugging stuff
2006-03-03 09:44:55 +00:00
Ben Gras
7550304e19 Changes to support endpoints.
. rename message field name macros from *PROC* to *ENDPT*,
    both to reflect the new meaning and to use it to hunt down where
    they are used
  . _PM_SEG_FLAG in fd replaces funny segment loading construction by
    PM in FS
  . _MAX_MAGIC_PROC is the highest used proc number, including magic
    constants such as (currently) ANY, NONE and SELF, used by the
    endpoint macros to make sure they are encoded properly and no valid
    endpoint number ever encodes to it.
  . rename proc_nr in address copy struct to proc_nr_e (endpoint)
2006-03-03 09:43:06 +00:00
Ben Gras
7475a433bb Test fixes
Added test41, for endpoint macros
2006-03-01 15:28:07 +00:00
Ben Gras
7d83ef196d Don't include cdprobe any more 2006-02-24 12:56:06 +00:00
Philip Homburg
4ae5403558 LBA48 support. 2006-02-24 12:55:47 +00:00
Philip Homburg
b6d12e81aa Change to some debug code. 2006-02-24 12:55:00 +00:00
Philip Homburg
f1bf17aa68 Allow bigger sizes. 2006-02-24 12:53:54 +00:00
Ben Gras
c08b6c2e28 Lance needs 4k due to 4k clicksize 2006-02-22 13:45:29 +00:00
Ben Gras
c69fe50658 Don't complain, urlget 2006-02-21 16:06:28 +00:00
Ben Gras
04429a150b Peter Boonstoppel's recwave update. 2006-02-21 16:04:18 +00:00
Ben Gras
fb240f6354 Peter Boonstoppel's audio changes. 2006-02-21 15:59:33 +00:00
Ben Gras
284dbccf65 Initial endpoint macros. 2006-02-21 15:26:12 +00:00
Ben Gras
b89ee5b188 *** empty log message *** 2006-02-20 16:00:24 +00:00
Ben Gras
fec2fa95e2 It's not always initialization 2006-02-20 15:11:41 +00:00
Philip Homburg
1d78f4a203 Fixed bug in canceling TCP ioctls before INET got an IP address. 2006-02-20 14:35:01 +00:00
Ben Gras
ba667a0774 Don't copy memory to rescue
local package initialization
2006-02-17 16:46:08 +00:00
Ben Gras
17032f9909 Make a /usr/local/etc/rc.d 2006-02-17 15:14:46 +00:00
Ben Gras
b3d3ed8f7c Install memory in /usr/sbin 2006-02-17 15:03:38 +00:00
Ben Gras
73c79dde56 Smaller device 2006-02-17 14:43:00 +00:00
Philip Homburg
b13e39ed1b Conditional compilation for SIGIOT and SIGEMT. 2006-02-17 14:12:47 +00:00
Philip Homburg
83bac36746 Reintroduced SIGEMT. 2006-02-17 14:12:12 +00:00
Ben Gras
c2f668d1d2 Refix 2006-02-17 14:05:46 +00:00
Philip Homburg
c367670fa8 improved tcp_acceptto. 2006-02-17 13:47:31 +00:00
Philip Homburg
1991246020 Socket options SO_RCVBUF, SO_SNDBUF, and TCP_NODELAY. 2006-02-17 13:45:41 +00:00
Philip Homburg
38804a964b More error texts. 2006-02-17 13:44:48 +00:00
Philip Homburg
fa6f63c3cb New errors and defines for socket options. 2006-02-17 13:43:50 +00:00
Philip Homburg
d430c4fac8 SIGBUS needs its own number. Removed SIGEMT. Made SIGIOT conditional on
_MINIX.
2006-02-17 13:43:07 +00:00
Ben Gras
36a571d78f don't make clean first 2006-02-17 13:27:48 +00:00
Ben Gras
997d2dcbd3 Throw elvis out of the base system 2006-02-17 13:27:01 +00:00
Ben Gras
2fa6eb3993 memory moved 2006-02-17 13:19:10 +00:00
Ben Gras
07308df374 Make 'make install' work 2006-02-17 13:12:07 +00:00
Ben Gras
77b0252796 Let saving random data work again 2006-02-17 13:11:20 +00:00
Ben Gras
151401bcb4 *** empty log message *** 2006-02-17 13:10:37 +00:00
Ben Gras
c162654310 Kick nvi out of base 2006-02-17 12:36:53 +00:00
Ben Gras
32a4ffb9c0 Make more 2006-02-17 12:34:18 +00:00
Ben Gras
e7657e1b67 Added some of my root devices 2006-02-17 11:58:02 +00:00
Ben Gras
65e7b878d4 getmachine info first, then init tty.
Problem report and fix given by:
Prof: Alejandro T. Bello Ruiz <abello@macareo.pucp.edu.pe>
2006-02-17 10:23:16 +00:00
Ben Gras
2827767745 bigmake.inc is obsolete 2006-02-16 20:56:34 +00:00
Ben Gras
7862ac9f42 *** empty log message *** 2006-02-16 15:44:52 +00:00
Ben Gras
f7132f1b1a Fixes for packaging system that will read .postinstall script and run it
if exists.

packit installs a package.
2006-02-16 15:43:37 +00:00
Ben Gras
fc1582bb57 sshd user 2006-02-16 15:38:13 +00:00
Philip Homburg
df92754d67 Fixed two memory leaks. 2006-02-16 14:13:36 +00:00
Ben Gras
30f7f852ba Really disable debug 2006-02-15 14:22:40 +00:00
Philip Homburg
7034c0795d Moved PCI driver to the ramdisk. 2006-02-15 14:21:56 +00:00
Ben Gras
1116853ae9 Turn off debug in getsockname.c
allow NULL for setgroups argument
2006-02-15 14:16:06 +00:00
Philip Homburg
c3a88d15d8 Initial root filesystem is now on a ramdisk that is part of the image. 2006-02-15 11:18:21 +00:00
Philip Homburg
3a05de3763 image_small doesn't fit anymore. What do we do with that? 2006-02-15 11:06:32 +00:00
Philip Homburg
bc015a9b49 /dev/ram is no longer hardcoded. 2006-02-15 11:05:47 +00:00
Philip Homburg
d4bb027db5 Accept optional device parameter for cdfdboot. 2006-02-15 11:03:28 +00:00
Ben Gras
39816868de Make initgroups() fail if user has any supplemental groups. 2006-02-13 15:06:01 +00:00
Ben Gras
5911460ce5 Fake setgroups() and initgroups() implementation. 2006-02-13 15:00:49 +00:00
Ben Gras
db963438c6 *** empty log message *** 2006-02-13 13:10:53 +00:00
Ben Gras
f8e186e8b1 Added truncate/ftruncate manpage. 2006-02-13 12:53:50 +00:00
Ben Gras
1b28ca47b1 . changed MAXOPEN's from statics to (OPEN_MAX-3)
(test broke after increasing OPEN_MAX)
. changed s_nokill to s_nokill_stop
  (test broken as SIGSTOP isn't maskable)
2006-02-13 11:07:21 +00:00
Ben Gras
1d4d75795b Revert to 30 OPEN_MAX (committed by mistake) 2006-02-13 10:32:05 +00:00
Ben Gras
b9bdbcba1b Don't sync before exiting drivers.
Wipe inodes of pipes in truncate_inode(), to avoid the size remaining
at PIPE_SIZE causing pipes to break.
2006-02-13 10:28:42 +00:00
Ben Gras
88ba4b5268 added reenter check to lock_dequeue() to avoid unlocking of interrupts
via cause_sig() during an exception.

moved lock check configuration to <minix/sys_config.h> instead of
kernel/config.h, because the 'relocking' field in kinfo depends on it.

other prettification: common locking macro, whether lock timing is on or
not.
2006-02-10 16:53:51 +00:00
Ben Gras
c273654032 umount /usr first 2006-02-06 16:40:15 +00:00
Ben Gras
b561091d13 Run postinstall script 2006-02-06 16:17:54 +00:00
Ben Gras
cde8d88dcc Ignore system signals. 2006-02-06 15:33:39 +00:00
Ben Gras
0a02bfb056 Moved ipc debug out of conditional.
Gave pci server sys_getinfo privilege.
2006-02-06 15:16:14 +00:00
Ben Gras
13e0afef7b #ifdeffed out some more debug stuff 2006-02-06 15:03:51 +00:00
Ben Gras
dc410a6245 #ifdeffed out some debug code 2006-02-06 15:02:19 +00:00
Ben Gras
e47299045c Packme fix. 2006-02-06 10:55:38 +00:00
Ben Gras
fc508d9175 *** empty log message *** 2006-02-03 16:06:14 +00:00
Ben Gras
9e924462a1 Packages. 2006-02-03 15:57:49 +00:00
Ben Gras
12d931953c bzip 2006-02-03 15:55:54 +00:00
Ben Gras
832bba4a56 Removed flex from base. 2006-02-03 15:52:12 +00:00
Ben Gras
98562d8cfc Don't copy /usr/gnu 2006-02-03 15:43:29 +00:00
Ben Gras
28087e3f17 *** empty log message *** 2006-02-03 15:41:58 +00:00
Ben Gras
040cebcefe Don't kill processes by signals in process group 0, and do a sync before
killing all processes in FS reboot.
2006-02-03 15:21:00 +00:00
Ben Gras
bcb67841a5 Give init process group 1. 2006-02-03 14:54:20 +00:00
Ben Gras
2b610431ad isodir prints one entry on each line without padding or trailing slashes
(for dirs) if the output isn't a tty, like ls, for use in shell scripts.
2006-02-03 12:59:58 +00:00
Ben Gras
f088bc5c6d Save name of cd drive for package manager 2006-02-02 18:20:09 +00:00
Ben Gras
d8341f678a Test for non-cd users 2006-02-02 18:14:42 +00:00
Ben Gras
a4e64f44bf Make easypack check for errors from urlget instead of trying with <HTML..
grepping.
2006-02-02 18:12:21 +00:00
Ben Gras
df1989aeae Make urlget return errors on non-200 http codes 2006-02-02 18:08:25 +00:00
Ben Gras
1bec73d61c fix builds not to do bigmakes
gzip is out of the base system
2006-02-02 17:13:07 +00:00
Ben Gras
ac71ad109e . rotate uses bzip2 instead of gzip
. binpackages runs a binpackage batch
. easypack does binsizes big first
2006-02-02 17:12:16 +00:00
Ben Gras
087c550186 Include binary packages on cd. 2006-02-02 17:11:10 +00:00
Ben Gras
a3bda44a41 . use proper S_ISFIFO for ISFIFO check
. ignore ESPIPE error from lseek() in fflush() on read streams
  (because fifo's aren't detected when stdin, stdout or stderr)
2006-02-02 16:59:07 +00:00
Ben Gras
17f48fc972 i86 driver not built as package 2006-02-01 14:29:58 +00:00
Ben Gras
cbbace7d73 fix for no 'build' arg 2006-02-01 11:18:54 +00:00
Philip Homburg
8aa8552e95 Added SIGCONT to the list of signal that are to be ignored by default. 2006-01-30 16:27:49 +00:00
Ben Gras
972dc358f5 cleanup 2006-01-27 14:44:05 +00:00
Ben Gras
d292ba7d21 build scripts accept 'build' argument to not install 2006-01-27 14:38:23 +00:00
Ben Gras
ae5ba10b9e Compile fix for major 2006-01-27 14:31:27 +00:00
Philip Homburg
3ef1d71b75 Fail when make in a subdirectory fails. 2006-01-27 14:14:51 +00:00
Philip Homburg
8ec6f7af83 Make sys_privctl make the prototype. 2006-01-27 14:14:13 +00:00
Ben Gras
7392c839e0 fts import from freebsd
re-activated fchdir()
2006-01-27 14:01:36 +00:00
Ben Gras
dd284552b4 fixes to include major() and minor() in system header files (in a different
file than sys/types.h)

small binpackage update
2006-01-27 13:57:18 +00:00
Philip Homburg
f4ae126596 Cosmetic changes. 2006-01-27 13:26:42 +00:00
Philip Homburg
38a16399f8 Store resource lists for drivers. Limited checks to enforce those lists. 2006-01-27 13:21:12 +00:00
Philip Homburg
ee2253ec52 Use the sys_privctl library function. 2006-01-27 13:20:06 +00:00
Philip Homburg
cf7db577ae Report resources to the kernel. 2006-01-27 13:18:07 +00:00
Philip Homburg
8036f12f47 I/O, memory and IRQ resource control interface. 2006-01-27 13:02:02 +00:00
Philip Homburg
21c06cfa1f Check contents of symbolic links. 2006-01-27 12:58:09 +00:00
Philip Homburg
4a713d8b6d Added sys_privctl.c. 2006-01-27 12:54:47 +00:00
Ben Gras
43051c182a Safety feature for symlink() - verify length of symlink contents
buffer with strlen()
2006-01-26 14:31:00 +00:00
Ben Gras
23bcf287cb Let symlinks be in the installed set of files ; make symlink from /var/log to
/usr/log.
2006-01-25 13:00:14 +00:00
Ben Gras
20add6baa2 . initial version of binpackage script
. build now used to make binary packages (and still in easypack), kick out
  makeme.sh
2006-01-23 12:22:06 +00:00
Ben Gras
8c1141d6b7 makeme.sh for binpackage 2006-01-23 12:15:05 +00:00
Ben Gras
817b4b8da5 Always install 2006-01-23 11:45:04 +00:00
Ben Gras
06db462da4 Added dvorak keymap. 2006-01-23 09:28:04 +00:00
Ben Gras
bea0bcc2eb Port of freebsd pax. 2006-01-20 14:45:27 +00:00
Ben Gras
e04832580d Some misc portability-enhancing definitions.
Added fts.h for fts library imported from freebsd.
2006-01-20 13:42:29 +00:00
Ben Gras
030c1c2560 fchdir() fix 2006-01-20 12:49:24 +00:00
Ben Gras
36f91229ea Re-enable fchdir() 2006-01-20 12:44:16 +00:00
Ben Gras
f806a66edf Fix for fchdir(). 2006-01-20 12:43:35 +00:00
Ben Gras
3bddaaf580 Let other uids (temporarily) set their mapping. 2006-01-20 12:43:19 +00:00
Ben Gras
a321c12f75 Move truncate()/ftruncate() prototype outside MINIX conditional 2006-01-19 15:33:13 +00:00
Ben Gras
24882f2409 Add -cnewer as find node 2006-01-19 09:36:49 +00:00
Ben Gras
d0067f45bd Make sure image* is gone before starting 2006-01-18 13:30:44 +00:00
Ben Gras
d62732171a small fix 2006-01-18 13:26:50 +00:00
Ben Gras
c806c7ba7c Install image as e.g. 3.1.2 instead of 3.1.2r0 if there is no revision file. 2006-01-18 12:37:45 +00:00
Ben Gras
6fab0ee47b more memory for as 2006-01-18 10:29:48 +00:00
Ben Gras
46ad16e688 . new version of minix
. less space on filesystems of cd image
2006-01-18 09:49:54 +00:00
Ben Gras
ad7f2784fe Made 'called by' DEBUG-conditional to avoid messy startup message 2006-01-18 09:48:32 +00:00
Ben Gras
a85797f486 Make error message conditional 2006-01-18 09:47:22 +00:00
Ben Gras
093cfe1143 . less verbose cd /usr debugging
. save random data only if /usr is mounted rw, don't display error otherwise
2006-01-18 09:33:09 +00:00
Ben Gras
428f9d63c4 Don't print randomness error when booting from install cd. 2006-01-17 17:57:40 +00:00
Ben Gras
966905d295 Not having a driver isn't a print-worthy error. Just return ENXIO. 2006-01-17 17:55:35 +00:00
Ben Gras
4102c1b44c Make drivers install signal handlers so they don't die at exit. 2006-01-17 17:43:35 +00:00
Ben Gras
24f8db780c Include rescue driver 2006-01-17 16:16:12 +00:00
Ben Gras
39f1fb81ea Don't print usage if service can't find binary. 2006-01-17 15:56:55 +00:00
Ben Gras
c452baf68d Made memory driver notice about location in DS a debug statement. 2006-01-17 15:53:43 +00:00
Ben Gras
b1ac60a03b The release script now remembers old settings (scratch partitions) and
re-uses them, with a warning. This is nice and quick for repeated release
builds.
2006-01-17 15:14:56 +00:00
Ben Gras
dbca8946f2 No more gmake in top makefile 2006-01-17 15:09:15 +00:00
Ben Gras
303eba31a4 Removed bits from Makefile that are now in 'bigports' 2006-01-17 11:25:29 +00:00
Ben Gras
b40438277b Prototype fix 2006-01-17 11:24:48 +00:00
Ben Gras
f4c085d3cc Added pci files. 2006-01-17 10:49:30 +00:00
Ben Gras
0e9a5612d7 Throw away unused dirs, generated Makefiles.
Moved some calls back.
2006-01-17 10:36:53 +00:00
Ben Gras
591e943779 Makefiles of Joren's new library build system. 2006-01-16 15:47:30 +00:00
Ben Gras
34d445c0af Joren's new library make system (minus Makefiles) 2006-01-16 15:44:55 +00:00
Philip Homburg
c461b0c63d '$(GMAKE) all' in lib target 2006-01-12 14:51:12 +00:00
Philip Homburg
a5cc1cb8d1 sh MAKEDEV to avoid depending on any x-bits. Make depend before make clean. 2006-01-12 14:50:05 +00:00
Philip Homburg
d65c8c116c Initial version of Cardbus support with the TI1225 Cardbus controler. 2006-01-12 14:47:48 +00:00
Philip Homburg
e44aaf4c37 Many changes for cardbus support, automatic detection of PCI bridges,
resource allocation, and tracking.
2006-01-12 14:46:12 +00:00
Philip Homburg
ac7f7f3022 Less debug output from keyboard. 2006-01-12 14:44:02 +00:00
Philip Homburg
21163c8da2 Print masked IRQs. 2006-01-12 14:41:40 +00:00
Philip Homburg
d9d970bdfa GET_IRQACTIDS, allow SELF in do_vm_map. 2006-01-12 14:38:51 +00:00
Philip Homburg
f18faca855 Added pci_init1.c, pci_attr_r16.c, pci_attr_w8.c, pci_attr_w16.c,
and pci_rescan_bus.c
2006-01-12 14:37:37 +00:00
Philip Homburg
2ac648b695 Restructured defines for bridges, added defines for cardbus. 2006-01-12 14:35:29 +00:00
Philip Homburg
c4035d9c96 Added BUSC_PCI_RESCAN and GET_IRQACTIDS. 2006-01-12 14:34:00 +00:00
Philip Homburg
9484279e5a Added sys_getirqactids, pci_init1, pci_rescan_bus, and pci_attr_w8. 2006-01-12 14:33:29 +00:00
Philip Homburg
988493b2e2 Added caching bits 2006-01-12 14:32:42 +00:00
Philip Homburg
ce7b2f64c5 Fixed bug in VLAN support. 2006-01-12 14:31:06 +00:00
Ben Gras
a9dd9784d1 Added truncate(1) manpage; added comment about holes in du; removed
minix-vmd specificness of F_FREESP as minix now implements it too.
2006-01-11 17:18:53 +00:00
Ben Gras
50b06261b6 Implementation of truncate(), ftruncate() and the F_FREESP fcntl().
Implemented by changing write_map to accept a WMAP_FREE flag. In that
case, it doesn't update the datablock (creating indirect zones as
necessary) pointer, but it frees the datablock if present. Also it
frees the single and double indirect blocks if unused.

This makes the implementation of truncate_inode() simpler.
truncate_inode() now accepts a truncation length which makes
implementing truncate() and ftruncate() simple.

This also allowed implementing the F_FREESP fcntl().
2006-01-11 17:14:51 +00:00
Ben Gras
d9827f56ba Fixes for #defines growing a _ 2006-01-06 16:49:58 +00:00
Ben Gras
ebca3a434c LICENSE taken from website instead of old PH license. 2006-01-05 16:58:38 +00:00
Ben Gras
f6a3259ef8 Ported bsd truncate(1) 2005-12-23 16:36:00 +00:00
Ben Gras
cccd4e01c5 Moved the print statement till after the K_CLAIM flag check after
this bug report (snippet):

> From: "Christos Karayiannis" <christos@kar.forthnet.gr>
> To: <bugs@minix3.org>
> Date: Tue, 20 Dec 2005 16:22:49 +0200
> Subject: bootimage.c
>
> Hi,
>
> at exec_image() of bootimage.c the a_bss and a_stack are printed with
> some values and then, if the K_CLAIM flag is set, they become zero. But
> this is then wrong information.
2005-12-20 14:38:14 +00:00
Ben Gras
6a911b5284 Merge of minix-vmd symlink code.
. new_node() now returns inode of parent dir as argument that
	  has to be put_node()d again by the caller of new_node().
	  it can also return the name of the last component as last_dir()
	  did.
	. advance() takes a pointer to a pointer of an inode as the
	  parent now. This parent can change, in which case the old
	  one is put_node()d and a new one is put there.
	. eat_path() replaced by more flexible parse_path()
	. last_dir() replaced by call to parse_path().
	. do_slink(), do_readlink(), do_lstat() and slink_traverse() added.

Also added some truncate()/ftruncate()-introduction related changes.
(e.g. renamed truncate() to truncate_inode().)
2005-12-20 14:23:44 +00:00
Ben Gras
ffe192724e Added truncate() and ftruncate() library calls (no FS support yet).
Added ELOOP message to errlist.
2005-12-20 14:18:16 +00:00
Ben Gras
fbc190e562 Added truncate and ftruncate() prototypes and call numbers (prematurely)
Added symlink-related prototypes
2005-12-20 14:17:05 +00:00
Ben Gras
743bdb038e Backout of symlink patches. 2005-12-19 10:45:50 +00:00
Ben Gras
eb1919722d Priority explicitization. 2005-12-14 12:08:49 +00:00
Ben Gras
f6e5052597 seteuid() and setegid() 2005-12-13 09:48:29 +00:00
Ben Gras
f18384d54c Make easypack remove tar after it's finished; and check for root, in
which case don't check for writability of source dir
2005-12-12 14:07:03 +00:00
Ben Gras
0a4047a8fe added -u flag to id for easypack 2005-12-12 13:55:58 +00:00
Ben Gras
d3ee328792 Hack for make libraries 2005-12-12 13:50:13 +00:00
Ben Gras
2f23951221 SIGSTOP can't be masked (report by Jaap Weel). 2005-12-12 13:11:22 +00:00
Ben Gras
32d5141935 Added prototype for getsockopt(). 2005-12-12 10:40:29 +00:00
Philip Homburg
9d8b27a2b1 Support for starting ethernet driver after inet has been started 2005-12-09 13:25:30 +00:00
Philip Homburg
e0634c0b47 Mark ethernet fd nonblocking to avoid waiting for an ethernet address 2005-12-09 13:21:58 +00:00
Philip Homburg
222fddd73a Added PCI driver 2005-12-02 14:47:20 +00:00
Philip Homburg
eec836014a PCI support in a separate driver 2005-12-02 14:45:38 +00:00
Philip Homburg
24cf667abb PCI support in a separate driver. 2005-12-02 14:45:10 +00:00
Philip Homburg
3dd0a97049 Stubs for accessing the PCI driver 2005-12-02 14:41:46 +00:00
Philip Homburg
b3cd15b01b Separate pci driver 2005-12-02 14:40:51 +00:00
Jorrit Herder
2aac756e76 New up() functions in rc scripts. 2005-11-28 15:39:01 +00:00
Ben Gras
7c1b2ef659 typedef dns_hdr_t HEADER;
for applications
2005-11-17 01:29:08 +00:00
Ben Gras
cbea840414 Define
IPPORT_RESERVED as 1024
for applications
2005-11-17 01:23:46 +00:00
Ben Gras
e45c9f2741 Synonyms for helping porting applications. 2005-11-17 01:23:33 +00:00
Ben Gras
348e18d474 Added del_route suggested by mij@bitchx.it. 2005-11-17 00:05:37 +00:00
Ben Gras
f08d6365be add_routes -> add_route in SEE ALSO 2005-11-16 23:52:56 +00:00
Ben Gras
4b59679ebb Add /usr/spool/mail 2005-11-16 13:49:13 +00:00
Ben Gras
9dea6e96bc Updated constant names 2005-11-15 12:12:00 +00:00
Ben Gras
dd99ee67e0 Rename some #defines such as MAX_BLOCK_SIZE to _MAX_BLOCK_SIZE and such
so as to not pollute application namespace.
2005-11-14 18:41:27 +00:00
Ben Gras
549e0bb855 Include X in path 2005-11-14 18:40:36 +00:00
Ben Gras
267c01b493 out-of-date comment fixed 2005-11-14 16:35:32 +00:00
Ben Gras
2ea0f4491d '.' fix for troff 2005-11-14 16:21:33 +00:00
Ben Gras
f9c1f3172d getloadavg 2005-11-14 15:58:07 +00:00
Ben Gras
1266ebcc93 last.c displays load average for uptime(1) 2005-11-14 15:51:28 +00:00
Ben Gras
87f2236ad2 load average measurement implementation, accessable through
getloadavg() system call in the library.
2005-11-14 15:50:46 +00:00
Ben Gras
aabef59faa getloadvg(3) manpage 2005-11-14 15:48:43 +00:00
Ben Gras
282e2f8e78 getloadavg() interface 2005-11-14 15:48:12 +00:00
Philip Homburg
a894f5842f Larger raw keyboard/kbdaux buffer 2005-11-10 15:41:25 +00:00
Philip Homburg
f6bc0beb6f Less debug output 2005-11-10 15:40:36 +00:00
Philip Homburg
233c092280 Resurrected sys_eniop. 2005-11-09 17:14:14 +00:00
Philip Homburg
b85736bd7b Grant tty permission to use SYS_VM_MAP and SYS_IOPENABLE. 2005-11-09 15:48:41 +00:00
Philip Homburg
b3cf63b890 Added /dev/video. /dev/kbd and /dev/kbdaux are renumbered. 2005-11-09 15:46:15 +00:00
Philip Homburg
5556281540 Added /dev/video for mapping video memory. 2005-11-09 15:45:48 +00:00
Philip Homburg
4102a5db28 Various changes to header files for tcpdump. 2005-11-09 15:43:39 +00:00
Philip Homburg
6d02d10805 Added getprotobyname. 2005-11-09 15:42:38 +00:00
Philip Homburg
3fb6640115 Added tcpstat and udpstat. 2005-11-08 14:02:36 +00:00
Philip Homburg
7394f38ed7 Added paramvalue to the library. 2005-11-08 13:59:27 +00:00
Philip Homburg
0f8090e653 Small fix for ioctls. 2005-11-08 13:57:48 +00:00
Philip Homburg
3a0af50c80 ARP command. 2005-11-08 12:09:00 +00:00
Ben Gras
c6412ae342 "forward compatible" hack for lstat() - make new binaries work on old
systems
2005-11-07 13:15:09 +00:00
Philip Homburg
df279ac347 Set IOPL when /dev/mem is opened. Fixed small bug in MIOCMAP/MIOCUNMAP 2005-11-04 17:16:54 +00:00
Philip Homburg
80cce8b3d3 Added prototype for hypot. 2005-11-04 17:14:59 +00:00
Philip Homburg
8950d7eae7 Make struct sockaddr at least as big as struct sockaddr_in 2005-11-04 17:07:39 +00:00
Philip Homburg
0b7fcbfd70 Only the memory driver should be allowed access to SYS_IOPENABLE 2005-11-04 17:06:49 +00:00
Philip Homburg
ee80996c9a _sigsetjmp was missing. 2005-11-04 17:05:28 +00:00
Philip Homburg
36e1cb4436 sys_eniop was missing. 2005-11-04 17:03:49 +00:00
Ben Gras
12f3eeaa01 Understand .SH "NAME" form too (e.g. perl manpages) 2005-11-04 10:50:49 +00:00
Ben Gras
6e37eb17b2 (mode_t) casts confused preprocessor 2005-11-03 17:04:50 +00:00
Ben Gras
a9702cca3a Let chmem return error code on failure 2005-11-03 16:58:10 +00:00
Ben Gras
26844e05e7 From: Giovanni <gfalzoni@inwind.it>
To: Ben Gras <beng@few.vu.nl>
Date: Wed, 02 Nov 2005 19:05:13 +0100
Subject: Re: [Minix-devel-l] Symbolic link

Using an alias for cd to set the prompt to display the current path
breaks the cd command.  I use in .ashrc:
PS3=$PS1
hostname=$(expr `cat /etc/hostname.file` : '\([^.]*\)')
cd() {          ## shows current directory as prompt
   command cd "$@"
   PS1="$PS3$USER@$hostname:`pwd` > "
}

If you change the macro in shell.h to:
#define SYMLINKS  0
the correct behaviour is restored.  Could you verify?
I think that the ash package needs the patch.
2005-11-03 15:25:18 +00:00
Philip Homburg
83df200475 Less restrictive I/O port check. 2005-11-03 13:42:56 +00:00
Philip Homburg
e6e1f4431d Make I/O port check less strict 2005-11-03 11:33:42 +00:00
Ben Gras
5ccf545e1b ast@'s update 2005-11-02 20:01:37 +00:00
Ben Gras
edb541fb98 Display "select" blocking status correctly, and add check for wrong
blocking process number
2005-11-02 17:43:19 +00:00
Ben Gras
bc010b74a2 Andy's new easypack 2005-11-02 12:05:01 +00:00
Ben Gras
ceb6a62f6d Install ftpd sh executable. 2005-11-01 22:57:42 +00:00
Ben Gras
fa76dcb8c1 Giovanni's symlink patches. 2005-11-01 13:19:40 +00:00
Ben Gras
a3752a3a51 Fix 2005-11-01 13:15:44 +00:00
Ben Gras
94d370ca5f library fixes for symlink, readlink and lstat 2005-11-01 13:13:31 +00:00
Ben Gras
0604dc26a8 Giovanni's symlink patches. 2005-10-31 14:33:12 +00:00
Ben Gras
b94a639398 Giovanni's symlink (+syslog+flock) patches. 2005-10-31 14:31:05 +00:00
Ben Gras
3acb6bf1fe Giovanni's symlinks patches (libs) 2005-10-31 14:28:19 +00:00
Ben Gras
4c648c343e Giovanni's symlink patches (includes only) 2005-10-31 14:14:54 +00:00
Ben Gras
2c704d288f Giovanni's syslog.h 2005-10-31 14:07:07 +00:00
Jorrit Herder
cd582e02be *** empty log message *** 2005-10-31 12:21:52 +00:00
Philip Homburg
c62239687d More stack for rlogind. 2005-10-24 14:06:36 +00:00
Philip Homburg
070f7673b9 More stack for cp, du, and synctree. 2005-10-24 14:04:22 +00:00
Philip Homburg
c11611802e Pass the right pointers to sys_inb 2005-10-24 14:02:45 +00:00
Philip Homburg
d9d4a4cacd kbdaux 2005-10-24 14:00:46 +00:00
Philip Homburg
0b5a135a67 Raw keyboard and AUX support. Needs cleaning up. 2005-10-24 13:57:19 +00:00
Philip Homburg
d920f5e0f9 Support for raw keyboard I/O and the AUX (PS/2 mouse) channel. 2005-10-24 13:52:53 +00:00
Philip Homburg
ed4ec02ddf Removed cast from sys_inb. 2005-10-24 13:51:39 +00:00
Philip Homburg
1de4b3a426 More filedescriptors 2005-10-24 13:51:02 +00:00
Philip Homburg
bfa0a555ad Removed debug printfs. 2005-10-24 13:48:50 +00:00
Philip Homburg
29eed99c71 Added paning variable to help routing debug output. 2005-10-24 13:47:24 +00:00
Philip Homburg
6a0a7c1a76 More filedescriptors 2005-10-24 13:43:03 +00:00
Ben Gras
7104974cb5 Optionalize memory and vm verbose prints 2005-10-21 19:37:31 +00:00
Ben Gras
bbcecf5e6d Don't panic on missing drivers. 2005-10-21 19:31:38 +00:00
Ben Gras
9270710246 Bigger 2005-10-21 19:30:13 +00:00
Ben Gras
40066b06f5 call libraries with $(GMAKE) 2005-10-21 18:31:45 +00:00
Ben Gras
d0806fd1af Make lance driver notify inet on startup, and respond to getname 2005-10-21 18:20:44 +00:00
Ben Gras
2b23d38c5b Panic fix 2005-10-21 18:20:26 +00:00
Ben Gras
85209d2e29 Test for SENDING else RECEIVING should be SENDING, then RECEIVING. 2005-10-21 18:13:10 +00:00
Ben Gras
81fa8fc3b8 Don't enqueue processes unless their flags have become 0 2005-10-21 17:35:39 +00:00
Philip Homburg
589e147ee3 Crash recovery changes. 2005-10-21 17:09:08 +00:00
Philip Homburg
ad1f30a63f Deal with crashing ethernet drivers 2005-10-21 16:51:21 +00:00
Jorrit Herder
f8edaa7de4 Added replies to status requests from RS. 2005-10-21 14:39:21 +00:00
Jorrit Herder
7a7e680da7 Added periodic checks from RS to drivers. 2005-10-21 14:34:13 +00:00
Jorrit Herder
78f20c3959 Rest ... 2005-10-21 13:46:47 +00:00
Jorrit Herder
9333141704 New rescue functionality. 2005-10-21 13:28:26 +00:00
Jorrit Herder
dd49f3586f New Rescue Device Driver (RAM disk like)
Allow restarting RTL8139
2005-10-21 13:24:22 +00:00
Jorrit Herder
4243d8e6bc Rescue script fixes. 2005-10-21 13:23:22 +00:00
Ben Gras
1b46117c0d Outside the book branch, remove references to the book on README.
Also remove source listings.
2005-10-21 11:52:41 +00:00
Philip Homburg
724813fdce Prelim commit for ethernet driver crash recovery. 2005-10-21 11:51:45 +00:00
Ben Gras
f0985a4e97 No /usr/gnu/bin in $PATH 2005-10-21 11:49:26 +00:00
Ben Gras
12898c03e4 *** empty log message *** 2005-10-21 11:40:24 +00:00
Ben Gras
aac4f32f51 Don't print SIGKSTOP message 2005-10-21 11:28:50 +00:00
Ben Gras
69a0586adf Changes to make gcc compile our libraries too (Joren) 2005-10-21 11:19:35 +00:00
Ben Gras
fd63815169 *** empty log message *** 2005-10-21 11:18:41 +00:00
Ben Gras
1a37474437 . minor formatting fixes (spaces, newlines) of messages
. check pids for being > 0 before kill()ing them (0 and negative
  numbers have special meanings that shouldn't be used)
2005-10-21 11:13:17 +00:00
Ben Gras
629453fba8 Added explanation of SIGKILL, REBOOT order. 2005-10-21 11:10:16 +00:00
Ben Gras
5333d4f4e4 . don't kill tty, send it messages on signals
. kill processes first, then tell fs to reboot (otherwise fs will have
  exited its processes and be confused when they exit again)
2005-10-21 11:07:33 +00:00
Jorrit Herder
4745238b9c New major device for Rescue Driver 2005-10-21 10:56:47 +00:00
Ben Gras
ca5b81bf6f /etc/rc.rescue initializes driver rescue environment 2005-10-21 10:47:13 +00:00
Ben Gras
fb7fb9e92c /boot/rescue (mount point for /dev/rescue) 2005-10-21 10:00:34 +00:00
Ben Gras
4e4d2f343c Make /dev/rescue 2005-10-21 10:00:03 +00:00
Jorrit Herder
d4e111c05d I forgot to enter this file so my disembodied ghost is committing it
through the body of ben.
2005-10-20 21:30:36 +00:00
Ben Gras
cf16c73e62 . check for notify() from NONE (shouldn't happen any more)
. test for cleared process slots when checking processes on exiting
 . clear process slot first, then do cleanup on exiting
2005-10-20 20:59:02 +00:00
Ben Gras
f7f30a3a44 2 extra error conditions on disappearing processes during/before sendrec() 2005-10-20 20:46:04 +00:00
Jorrit Herder
3e78f1aaa6 Tell RS server about upcoming shutdown. 2005-10-20 20:38:58 +00:00
Ben Gras
b74617dede gcc separate target 2005-10-20 20:38:12 +00:00
Jorrit Herder
e6c1aeade0 New IPC error codes: ESRCDIED, EDSTDIED, ETRAPDENIED.
New getsysinfo type to get DS store contents from IS.
New Data Store (DS) server message types and arguments.
2005-10-20 20:34:34 +00:00
Jorrit Herder
1058d49249 Updated Makefile for DS server. 2005-10-20 20:32:57 +00:00
Jorrit Herder
9ea63c60fa Updated makefile for DS server. 2005-10-20 20:32:40 +00:00
Jorrit Herder
7f6137d230 Renamed to manager.h. 2005-10-20 20:32:22 +00:00
Ben Gras
8d99d24ce6 Also dev_open opened block and character special files 2005-10-20 20:32:09 +00:00
Jorrit Herder
26188d9595 *** empty log message *** 2005-10-20 20:31:42 +00:00
Jorrit Herder
2a98fed515 New Reincarnation Server functionality.
- service refresh: to cleanly stop and restart a server or driver
- binary exponential backoff: don't restart in a loop
2005-10-20 20:31:18 +00:00
Jorrit Herder
d1f2ba26b0 New Data Store server. 2005-10-20 20:29:52 +00:00
Jorrit Herder
288860f6e6 New dumps for RS and DS server. 2005-10-20 20:28:54 +00:00
Jorrit Herder
381c24ce17 New MEM driver for recovery. 2005-10-20 20:26:02 +00:00
Jorrit Herder
86e3333454 New error codes for IPC errors.
Made VM code debug output disappear.
2005-10-20 20:25:32 +00:00
Jorrit Herder
e67d50a3c6 Service refresh. 2005-10-20 20:19:25 +00:00
Ben Gras
fca5dad684 Reduce buffer cache a bit to make space for boot device for drivers. 2005-10-20 20:11:51 +00:00
Ben Gras
f6bdd6a4a9 New DMAP_BABY flag in <minix/dmap.h> and to be printed by IS in dmap dump. 2005-10-20 19:40:44 +00:00
Ben Gras
b5e3e6d18c Two 'dynamic driver' features in FS:
.  When drivers disappear that have pending select()s, wake up
   those user processes with EAGAIN so that they can retry their
   select() and won't hang forever on it.
.  When drivers re-appear and are mapped into the dmap, run through
   the list of mounted filesystems and re-dev_open() every one (for
   partition tables and such). This can't happen before the driver
   has exec()ced itself, so processes that have fork()ed but not
   exec()ced yet are marked as DMAP_BABY in the dmap table if they
   are dmapped before they are execced. If that happens, the above
   procedure happens after the exec(). If the exec() happens before
   the dmapping, it (the dev_open()ing) happens right away.
2005-10-20 19:39:32 +00:00
Ben Gras
11146aba3d Newline after startup msg 2005-10-20 18:54:53 +00:00
Ben Gras
6f836afeef thisevent 2005-10-20 12:25:33 +00:00
Jorrit Herder
79a85aafaa New manual page for service(8). 2005-10-20 12:08:25 +00:00
Ben Gras
ad2bf251a3 Don't print KMESSages, they are sent to tty separately. 2005-10-20 09:29:18 +00:00
Ben Gras
7852300ec2 Don't beep (print bell characters) on rebooting 2005-10-19 10:36:10 +00:00
Ben Gras
eedca63a05 bugs in trunk 2005-10-18 21:06:46 +00:00
Ben Gras
a19614a19f Included Makefiles for ack and gcc 2005-10-18 17:37:58 +00:00
Ben Gras
df7c913bd9 Global included Makefile 2005-10-18 17:37:18 +00:00
Ben Gras
e50b781884 gcc includes fixup 2005-10-18 17:21:24 +00:00
Ben Gras
4bae163d37 High watermark memory usage feature 2005-10-18 17:21:11 +00:00
Ben Gras
2bf8bfe126 Turn IPC warning messages off by default
(because inet deadlocks are normal and will confuse our users).
2005-10-18 16:13:12 +00:00
Ben Gras
742f18a87c Bugfix by Joren 2005-10-18 11:00:03 +00:00
Ben Gras
4be59c3e03 Restore -lm 2005-10-18 10:42:05 +00:00
Ben Gras
ea75918df1 printf() by kernel and servers now send messages to an array of processes,
OUTPUT_PROCS_ARRAY in <minix/config.h>, in that order, terminated by NONE.
log no longer forwards messages to tty itself. This leads to less funny
loops and more robust debug-message handling. Also the list of
processes receiving messages can easily be changed around or disabled by
editing the array (e.g. disable it by changing the array to { NONE }.).
2005-10-18 10:34:54 +00:00
Ben Gras
d87bfc438b Restore libm 2005-10-18 10:32:28 +00:00
Ben Gras
0830c99b56 Leave out exit() that was in there to test RS. 2005-10-18 10:04:11 +00:00
Ben Gras
ee5940e097 Print quant as signed number so a 'scheduling defecit' appears as such 2005-10-17 14:06:08 +00:00
Ben Gras
b1ca4d2d42 Check for ZOMBIE flag with findproc 2005-10-17 13:20:07 +00:00
Jorrit Herder
bf3f53be27 Removed check if slot in use for keymapping: otherwise IS may have problems
to recover.
2005-10-17 13:19:48 +00:00
Ben Gras
c79574aba4 A new panic that makes processes exit with PM knowing about it, instead
of sys_exit, so that PM functions (e.g. findproc) keep working properly,
and RS finds out about process deaths.
2005-10-17 13:19:22 +00:00
Ben Gras
683322d997 Version number for sosp release 2005-10-17 09:04:36 +00:00
Ben Gras
61b6139752 Al's system -> kernel call change 2005-10-14 09:13:52 +00:00
Ben Gras
32514fb5f9 Al's system call -> kernel call renaming 2005-10-14 08:58:59 +00:00
Ben Gras
abd0b53e0a PM: added possibility to copy hole list from alloc.c to outside, for
misc.c to copy it away by getsysinfo
IS: prints out hole list + stats such as largest contiguous chunk
2005-10-13 12:48:43 +00:00
Ben Gras
f04d46f456 Fixup for gcc headers (if installed) 2005-10-13 12:46:23 +00:00
Ben Gras
54709f5a3a Added SI_* memory hole list type, to request a copy of
it via getsysinfo from PM.
2005-10-13 12:45:31 +00:00
Ben Gras
c06149cffe Moved 'struct hole' for memory holes from PM to <minix/type.h>; also
number of holes to sys_config.h, to make memory allocation data structure
visible from outside..
2005-10-13 12:45:09 +00:00
Ben Gras
ee9b08e5c0 Comment fix about sys_abort() 2005-10-13 09:43:39 +00:00
Ben Gras
7226f4685f Get out silly debug message 2005-10-13 08:49:42 +00:00
Philip Homburg
23d2c0e1eb Intel 82845B/A and Intel 82801B 2005-10-12 15:26:47 +00:00
Jorrit Herder
eb5ed13fd3 New libary functions.
Cleanup of halt.c.
2005-10-12 15:10:14 +00:00
Jorrit Herder
7842d4fb26 Minor changes for new library functions at PM. 2005-10-12 15:08:45 +00:00
Jorrit Herder
b16a88692a New deadlock check at proc.c.
New exit checks (stop IPC).
2005-10-12 15:08:23 +00:00
Jorrit Herder
5a9dec8bd2 New signal handling behaviour at PM (services can be killed).
New Shift-F6 dump for RS server at IS.
New getnpid, getnproc, getpproc library calls at PM.
New reincarnation server (basic functionality is there now).
2005-10-12 15:07:38 +00:00
Ben Gras
46678bdb7f Compile fix 2005-10-12 15:07:26 +00:00
Ben Gras
fc58687905 rw_block is private to cache.c 2005-10-12 15:06:47 +00:00
Jorrit Herder
ee1f2bcb39 Minor fixes for RS. Install signal handlers. 2005-10-12 15:06:00 +00:00
Ben Gras
2eca6f9374 If processes are blocked on device drivers (returning SUSPEND),
unblock the processes when the device drivers die.
2005-10-12 15:01:23 +00:00
Ben Gras
87dbfc7dda Added DEV_PING message type to drivers (but not ethernet drivers) so
RS can monitor them.
2005-10-12 14:31:39 +00:00
Ben Gras
866b3fda9c DEV_PING message type for device driver keepalives 2005-10-12 14:29:38 +00:00
Ben Gras
899d78ef0d Don't build vim tools 2005-10-12 09:57:09 +00:00
Ben Gras
d371e7eac4 A .vimrc that makes vim colours work on the minix console and in xterm. 2005-10-11 17:55:14 +00:00
Ben Gras
f463c247b6 Minor number for pty device nodes computed wrongly 2005-10-11 17:04:56 +00:00
Ben Gras
c5b1394133 Fix warning (gcc) 2005-10-10 16:10:27 +00:00
Ben Gras
a65191aa6b Larger dummy -lm 2005-10-10 15:28:55 +00:00
Ben Gras
1da5b5ccee gcc subdir for combined gcc/ack library build 2005-10-10 15:28:15 +00:00
Ben Gras
8c53e4007e ack subdir for combined ack/gcc library build 2005-10-10 15:27:47 +00:00
Ben Gras
04822e9cc9 Add /usr/gnu/bin to $PATH as last search step 2005-10-10 14:42:06 +00:00
Ben Gras
4dfe841667 No driver in dmap is NONE instead of 0. 2005-10-10 14:27:41 +00:00
Ben Gras
2e60aad2bb Fix 2005-10-10 09:03:11 +00:00
Ben Gras
b7a0c0f858 Make "mkdir -p a/./b" work (with ".") 2005-10-10 09:02:16 +00:00
Ben Gras
cc3201bacd Al's cosmetic rearrangement 2005-10-09 19:58:25 +00:00
Ben Gras
50951c50f9 *** empty log message *** 2005-10-07 14:00:52 +00:00
Ben Gras
f3e88a8352 Increase default binsize size 2005-10-07 13:51:06 +00:00
Ben Gras
ab1374a9cb Comment corrections from Al 2005-10-07 13:23:18 +00:00
Ben Gras
122c3ee967 don't make /usr/home any more 2005-10-06 15:28:19 +00:00
Ben Gras
4fc5f85a88 Corrected correction of clock's 2005-10-06 10:21:24 +00:00
Ben Gras
293e1ea70d Missing comma 2005-10-06 09:39:36 +00:00
Ben Gras
b46a51cfd6 Semidefinitive copyright statement. 2005-10-06 09:38:55 +00:00
Ben Gras
86ed54ee94 FS:
. unmap device drivers from dmap when PM signals they are dead
	. new null-io function (no_dev_io) to fill in for io functions
	  of unmapped drivers
	. driver (process number) of unmapped drivers is NONE instead of
	  0 (a valid process number)

IS:
	. print mutable flag of dmap table too

FS changes require sync() to be done 'manually' (currently by
reboot/shutdown) at shutdown time; could be caught by SIGTERM in
the future.
2005-10-05 15:38:15 +00:00
Ben Gras
a369d9c828 1 sync in shutdown procedure. 2005-10-05 15:07:08 +00:00
Jorrit Herder
cdc790c4da Fixed problem in subtest 1; Part of test is now in #if DEAD_CODE ... #endif,
because test setup seems bogus.
2005-10-05 11:28:12 +00:00
Jorrit Herder
f587fe41e5 Changed EDEADDST to EDEADSRCDST 2005-10-05 09:52:54 +00:00
Jorrit Herder
32c05f45c6 Minor bug fixes in proc.c and utility.c;
Removed debug dumps on panic from main.c;
Return error on exit when other process does IPC to/from exiting process.
2005-10-05 09:51:50 +00:00
Ben Gras
71b6f31d4e Let TTY call SYS_ABORT 2005-10-05 08:45:55 +00:00
Ben Gras
afc6721239 Al's comment fixes 2005-10-05 08:21:35 +00:00
Ben Gras
5fd54a0d53 Print fsck messages to explain delays 2005-10-04 14:35:36 +00:00
Ben Gras
b9defa9abd select status should return minor device number instead of tty
line number
2005-10-04 12:04:00 +00:00
Ben Gras
5b452954ba FSDEVUNMAP, late commit 2005-10-04 11:46:51 +00:00
Ben Gras
7ca48023af Al's comment bug. 2005-10-04 08:29:44 +00:00
Ben Gras
e32131bb05 Fixed wrong comment. 2005-10-04 08:28:07 +00:00
Ben Gras
2f88199e37 Manpage, initial version written by Jaap Weel <weel@ugcs.caltech.edu> 2005-10-03 14:31:28 +00:00
Ben Gras
2986c11811 DEV_UNMAP devctl()
FSDEVUNMAP svrctl()
2005-10-03 14:17:33 +00:00
Ben Gras
8c4166ee85 Add SIGWINCH signal and functionality in tty and support in PM. 2005-10-03 12:03:57 +00:00
Ben Gras
f1d9413da7 Make rlogin compile under non-minix-vmd with SIGWINCH defined 2005-10-03 12:02:43 +00:00
Ben Gras
7c2b94fd56 Make ps compile even if source tree isn't /usr/src 2005-10-03 11:01:21 +00:00
Ben Gras
15c6f7182b Al's comment fixes 2005-10-02 19:02:05 +00:00
Philip Homburg
5871979657 More stack space for dp8390, floppy, and fxp 2005-09-30 13:02:17 +00:00
Philip Homburg
9f8f2484dd Forward debug output that originates within TTY first to the log device. 2005-09-30 13:01:34 +00:00
Philip Homburg
72c0158393 Accept log output from TTY. 2005-09-30 12:59:12 +00:00
Philip Homburg
e0dbf0cd67 Intel 82801 Mobile 2005-09-30 12:58:14 +00:00
Philip Homburg
e281ad893d Added MIOCMAP and MIOCUNMAP ioctls. 2005-09-30 12:57:30 +00:00
Philip Homburg
42e1dad99c Hack to provide kernel with space for page table. 2005-09-30 12:56:00 +00:00
Philip Homburg
9bee3f4b08 IOPL, VM, and serial debug output (disabled). 2005-09-30 12:54:59 +00:00
Philip Homburg
9528152f68 Added sys_eniop, sys_vm_setbuf, and sys_vm_map. 2005-09-30 12:51:33 +00:00
Philip Homburg
731eee27c3 Nonblocking connect for TCP sockets. 2005-09-30 12:50:50 +00:00
Philip Homburg
4ac2d8d392 Optionally more debug output. 2005-09-30 12:50:14 +00:00
Philip Homburg
99fa9df344 X expects an implicit bind to INADDR_ANY for UDP sockets. 2005-09-30 12:49:10 +00:00
Philip Homburg
c4184bb45b nonamed doesn't like DNS requests over TCP. So, don't try to use them. 2005-09-30 12:48:26 +00:00
Philip Homburg
31c1d6bf0d Changes to includes for VM, IOPL, logging. Increased _NR_PROCS, CLICK_SIZE is
now 4096.
2005-09-30 12:47:03 +00:00
Philip Homburg
5f7b803dcd Asynchronous connect (for non-blocking socket connect emulation) 2005-09-30 12:44:39 +00:00
Philip Homburg
a9a8299e88 Misc. compatibility changes 2005-09-30 12:41:25 +00:00
Philip Homburg
440668c645 Added ELOOP 2005-09-30 12:39:12 +00:00
Ben Gras
7ba508eb17 Make binsizes work, even if /usr/src isn't there 2005-09-30 11:52:53 +00:00
Ben Gras
7de574f035 Let make install in src/etc also work from a source tree that isn't /usr/src 2005-09-30 11:45:59 +00:00
Ben Gras
52e964987c add arg to make releases from tags/branches 2005-09-29 13:02:41 +00:00
1032 changed files with 64338 additions and 54995 deletions

74
LICENSE
View File

@@ -1,32 +1,52 @@
Copyright (c) 1987,1997,2001 Prentice Hall
All rights reserved.
Redistribution and use of the MINIX operating system in source and
binary forms, with or without modification, are permitted provided
that the following conditions are met:
License
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
Copyright (c) 1987, 1997, 2006, Vrije Universiteit, Amsterdam,
The Netherlands All rights reserved. Redistribution and use of the MINIX 3
operating system in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Neither the name of Prentice Hall nor the names of the software
authors or contributors may be used to endorse or promote
products derived from this software without specific prior
written permission.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND
CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* Neither the name of the Vrije Universiteit nor the names of the
software authors or contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
* Any deviations from these conditions require written permission
from the copyright holder in advance
Disclaimer
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, AUTHORS, AND
CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
NO EVENT SHALL PRENTICE HALL OR ANY AUTHORS OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Aggregated Software
In addition to MINIX 3 itself, the distribution CD-ROM and this Website
contain additional software that is not part of MINIX 3 and is not
covered by this license. The licensing conditions for this additional
software are stated in the various packages. In particular, some of the
additional software falls under the GPL, and you must take care to
observe the conditions of the GPL with respect to this software. As
clearly stated in Article 2 of the GPL, when GPL and nonGPL software are
distributed together on the same medium, this aggregation does not cause
the license of either part to apply to the other part.

View File

@@ -3,21 +3,21 @@
MAKE = exec make -$(MAKEFLAGS)
usage:
@echo "" >&2
@echo "Master Makefile for MINIX commands and utilities." >&2
@echo "Root privileges are required for some actions." >&2
@echo "" >&2
@echo "Usage:" >&2
@echo " make world # Compile everything (libraries & commands)" >&2
@echo " make includes # Install include files from src/" >&2
@echo " make libraries # Compile and install libraries" >&2
@echo " make cmds # Compile all, commands, but don't install" >&2
@echo " make install # Compile and install commands" >&2
@echo " make depend # Generate required .depend files" >&2
@echo " make clean # Remove all compiler results" >&2
@echo "" >&2
@echo "Run 'make' in tools/ to create a new MINIX configuration." >&2; exit 0
@echo "" >&2
@echo ""
@echo "Master Makefile for MINIX commands and utilities."
@echo "Root privileges are required for some actions."
@echo ""
@echo "Usage:"
@echo " make world # Compile everything (libraries & commands)"
@echo " make includes # Install include files from src/"
@echo " make libraries # Compile and install libraries"
@echo " make cmds # Compile all, commands, but don't install"
@echo " make install # Compile and install commands"
@echo " make depend # Generate required .depend files"
@echo " make clean # Remove all compiler results"
@echo ""
@echo "Run 'make' in tools/ to create a new MINIX configuration."
@echo ""
# world has to be able to make a new system, even if there
# is no complete old system. it has to install commands, for which
@@ -30,10 +30,10 @@ usage:
world: includes depend libraries cmds install postinstall
includes:
cd include && $(MAKE) install
cd include && $(MAKE) install gcc
libraries:
cd lib && $(MAKE) install
cd lib && $(MAKE) all install
cmds:
if [ -f commands/Makefile ] ; then cd commands && $(MAKE) all; fi

View File

@@ -502,7 +502,9 @@ void initialize(void)
/* Check if data segment crosses a 64K boundary. */
if (newaddr + (daddr - caddr) < dma64k) newaddr= dma64k - runsize;
if (newaddr + (daddr - caddr) < dma64k) {
newaddr= (dma64k - runsize) & ~0x0000FL;
}
#endif
/* Set the new caddr for relocate. */
@@ -841,7 +843,7 @@ void get_parameters(void)
{
char params[SECTOR_SIZE + 1];
token **acmds;
int r, bus;
int r, bus, processor;
memory *mp;
static char bus_type[][4] = {
"xt", "at", "mca"
@@ -858,7 +860,9 @@ void get_parameters(void)
b_setvar(E_SPECIAL|E_VAR|E_DEV, "ramimagedev", "bootdev");
b_setvar(E_SPECIAL|E_VAR, "ramsize", "0");
#if BIOS
b_setvar(E_SPECIAL|E_VAR, "processor", ul2a10(getprocessor()));
processor = getprocessor();
if(processor == 1586) processor = 686;
b_setvar(E_SPECIAL|E_VAR, "processor", ul2a10(processor));
b_setvar(E_SPECIAL|E_VAR, "bus", bus_type[get_bus()]);
b_setvar(E_SPECIAL|E_VAR, "video", vid_type[get_video()]);
b_setvar(E_SPECIAL|E_VAR, "chrome", vid_chrome[get_video() & 1]);
@@ -872,14 +876,6 @@ void get_parameters(void)
}
b_setvar(E_SPECIAL|E_VAR, "memory", params);
#if 0
b_setvar(E_SPECIAL|E_VAR, "c0",
DOS ? "dosfile" : get_bus() == 1 ? "at" : "bios");
#else
b_setvar(E_SPECIAL|E_VAR, "label", "AT");
b_setvar(E_SPECIAL|E_VAR, "controller", "c0");
#endif
#if DOS
b_setvar(E_SPECIAL|E_VAR, "dosfile-d0", vdisk);
#endif

View File

@@ -500,6 +500,12 @@ void exec_image(char *image)
a_data+= a_text;
}
/* Read the data segment. */
if (!get_segment(&vsec, &a_data, &addr, limit)) return;
/* Make space for bss and stack unless... */
if (i != KERNEL && (k_flags & K_CLAIM)) a_bss= a_stack= 0;
printf("%07lx %07lx %8ld %8ld %8ld",
procp->cs, procp->ds,
hdr.process.a_text, hdr.process.a_data,
@@ -509,12 +515,6 @@ void exec_image(char *image)
printf(" %s\n", hdr.name);
/* Read the data segment. */
if (!get_segment(&vsec, &a_data, &addr, limit)) return;
/* Make space for bss and stack unless... */
if (i != KERNEL && (k_flags & K_CLAIM)) a_bss= a_stack= 0;
/* Note that a_data may be negative now, but we can look at it
* as -a_data bss bytes.
*/

View File

@@ -367,7 +367,7 @@ int raw_install(char *file, off_t *start, off_t *len, int block_size)
* Note: *len == 0 when an image is read. It is set right afterwards.
*/
{
static char buf[MAX_BLOCK_SIZE]; /* Nonvolatile block buffer. */
static char buf[_MAX_BLOCK_SIZE]; /* Nonvolatile block buffer. */
FILE *f;
off_t sec;
unsigned long devsize;
@@ -424,7 +424,7 @@ void make_bootable(enum howto how, char *device, char *bootblock,
* vector are added to the end of the device.
*/
{
char buf[MAX_BLOCK_SIZE + 256], *adrp, *parmp;
char buf[_MAX_BLOCK_SIZE + 256], *adrp, *parmp;
struct fileaddr {
off_t address;
int count;
@@ -695,7 +695,7 @@ void install_master(char *device, char *masterboot, char **guide)
FILE *masf;
unsigned long size;
struct stat st;
static char buf[MAX_BLOCK_SIZE];
static char buf[_MAX_BLOCK_SIZE];
/* Open device. */
if ((rawfd= open(rawdev= device, O_RDWR)) < 0) fatal(device);

View File

@@ -53,9 +53,9 @@ static struct super_block super; /* Superblock of file system */
#endif
static struct inode curfil; /* Inode of file under examination */
static char indir[MAX_BLOCK_SIZE]; /* Single indirect block. */
static char dindir[MAX_BLOCK_SIZE]; /* Double indirect block. */
static char dirbuf[MAX_BLOCK_SIZE]; /* Scratch/Directory block. */
static char indir[_MAX_BLOCK_SIZE]; /* Single indirect block. */
static char dindir[_MAX_BLOCK_SIZE]; /* Double indirect block. */
static char dirbuf[_MAX_BLOCK_SIZE]; /* Scratch/Directory block. */
#define scratch dirbuf
static block_t a_indir, a_dindir; /* Addresses of the indirects. */
@@ -83,8 +83,8 @@ off_t r_super(int *bs)
if(super.s_magic == SUPER_V2)
super.s_block_size = 1024;
*bs = block_size = super.s_block_size;
if(block_size < MIN_BLOCK_SIZE ||
block_size > MAX_BLOCK_SIZE) {
if(block_size < _MIN_BLOCK_SIZE ||
block_size > _MAX_BLOCK_SIZE) {
return 0;
}
nr_dzones= V2_NR_DZONES;

View File

@@ -1,18 +1,9 @@
# Makefile for commands.
MAKE = exec make -$(MAKEFLAGS)
FLEX=flex-2.5.4
GZIP=gzip-1.2.4
PYTHON=python-1.5.2
BZIP2=bzip2-1.0.3
KERMIT=kermit-2.1.1
NVI=nvi-1.79
NVIWORK=$(NVI)/minix
EMACS=emacs-21.4
LYNX=lynx2-8-5
COREUTILS=gnu-coreutils-5.2.1
SMALLPROGRAMS=`arch` aal advent ash autil awk bc byacc cawf cron de dhcpd dis88 elle elvis ftp ftpd ftpd200 httpd ibm indent m4 make mdb mined patch ps reboot rlogind scripts sh simple talk talkd telnet telnetd urlget yap zmodem
SMALLPROGRAMS=`arch` aal advent ash autil awk bc byacc cawf cron de dhcpd dis88 elle elvis ftp ftpd200 httpd ibm indent m4 make mdb mined patch pax ps reboot rlogind scripts sh simple syslogd talk talkd telnet telnetd urlget yap zmodem
usage:
@echo "Usage: make all # Compile all commands" >&2
@@ -22,8 +13,6 @@ usage:
@echo " make biginstall # Install all big commands" >&2
@echo " make small # Install all small commands" >&2
@echo " make smallinstall # Install all small commands" >&2
@echo " make ack # Make ack" >&2
@echo " make ackinstall # Install ack" >&2
@echo " "
@echo "big compiles the commands the require large compiler sizes."
@echo "small compiles the rest. all compiles all."
@@ -33,54 +22,19 @@ all: small big
install: biginstall smallinstall
small::
-mkdir $(NVIWORK)
cd $(GZIP) && CC="$(CC)" /bin/sh ./configure --prefix=/usr/local && $(MAKE) all
cd $(NVI) && make all
smallinstall:: small
cd $(GZIP) && $(MAKE) install
cd $(NVI) && make install
big:
cd $(FLEX) && /bin/sh makeme.sh
cd $(BZIP2) && /bin/sh makeme.sh
cd $(KERMIT) && /bin/sh makeme.sh
cd $(LYNX) && /bin/sh makeme.sh
cd $(COREUTILS) && /bin/sh makeme.sh
cd $(EMACS) && /bin/sh makeme.sh
cd $(PYTHON) && /bin/sh makeme.sh
cd $(BZIP2) && /bin/sh build build
biginstall: big
cd $(FLEX) && make install
cd $(PYTHON) && make install
cd $(BZIP2) && make install
cd $(KERMIT) && make install
cd $(LYNX) && make install
cd $(EMACS) && make install
cd $(COREUTILS) && make install
clean::
if [ -f $(FLEX)/Makefile ] ; then cd $(FLEX) && make $@; fi
if [ -f $(GZIP)/Makefile ] ; then cd $(GZIP) && make $@; fi
if [ -f $(PYTHON)/Makefile ] ; then cd $(PYTHON) && make $@; fi
cd $(BZIP2) && make clean
cd $(KERMIT) && make clean
if [ -f $(NVIWORK)/Makefile ]; then cd $(NVIWORK) && make clean; fi
if [ -f $(LYNX)/Makefile ] ; then cd $(LYNX) && make clean; fi
if [ -f $(EMACS)/Makefile ] ; then cd $(EMACS) && make clean; fi
cd $(COREUTILS) && make clean
for p in $(SMALLPROGRAMS); do ( cd $$p && make clean ); done
small::
for p in $(SMALLPROGRAMS); do ( cd $$p && make all ); done
set -e; for p in $(SMALLPROGRAMS); do ( cd $$p && make all ); done
smallinstall::
for p in $(SMALLPROGRAMS); do ( cd $$p && make install ); done
ack:
cd ackpack && make
ackinstall:
cd ackpack && make install
set -e; for p in $(SMALLPROGRAMS); do ( cd $$p && make install ); done

View File

@@ -44,7 +44,7 @@ install: /usr/bin/ash /usr/bin/sh /bin/sh /bin/bigsh
install -lcs $? $@
/bin/bigsh: /usr/bin/ash
install -S 500000 -lcs $? $@
install -S 1500000 -lcs $? $@
clean:
rm -f $(CLEANFILES) sh core

View File

@@ -246,7 +246,7 @@ ccl:
p++;
}
p++;
if (found == negate)
if (found == negate || c == 0)
goto bad;
break;
case RE_LP:

View File

@@ -84,6 +84,7 @@ int funcnest; /* depth of function calls */
char *commandname;
struct strlist *cmdenviron;
int exitstatus; /* exit status of last command */
int oexitstatus; /* saved exit status */
#ifdef __STDC__
@@ -272,8 +273,11 @@ evaltree(n, flags)
out:
if (pendingsigs)
dotrap();
if ((flags & EV_EXIT) || (eflag == 1 && exitstatus && !(flags & EV_TESTED)))
if ((flags & EV_EXIT) || (eflag && exitstatus
&& !(flags & EV_TESTED) && (n->type == NCMD ||
n->type == NSUBSHELL))) {
exitshell(exitstatus);
}
}
@@ -326,6 +330,7 @@ evalfor(n)
setstackmark(&smark);
arglist.lastp = &arglist.list;
for (argp = n->nfor.args ; argp ; argp = argp->narg.next) {
oexitstatus = exitstatus;
expandarg(argp, &arglist, 1);
if (evalskip)
goto out;
@@ -365,6 +370,7 @@ evalcase(n, flags)
setstackmark(&smark);
arglist.lastp = &arglist.list;
oexitstatus = exitstatus;
expandarg(n->ncase.expr, &arglist, 0);
for (cp = n->ncase.cases ; cp && evalskip == 0 ; cp = cp->nclist.next) {
for (patp = cp->nclist.pattern ; patp ; patp = patp->narg.next) {
@@ -421,6 +427,7 @@ expredir(n)
register union node *redir;
for (redir = n ; redir ; redir = redir->nfile.next) {
oexitstatus = exitstatus;
if (redir->type == NFROM
|| redir->type == NTO
|| redir->type == NAPPEND) {
@@ -525,6 +532,7 @@ evalbackcmd(n, result)
/* `` */
} else
if (n->type == NCMD) {
exitstatus = oexitstatus;
evalcommand(n, EV_BACKCMD, result);
} else {
if (pipe(pip) < 0)
@@ -588,6 +596,8 @@ evalcommand(cmd, flags, backcmd)
arglist.lastp = &arglist.list;
varlist.lastp = &varlist.list;
varflag = 1;
oexitstatus = exitstatus;
exitstatus = 0;
for (argp = cmd->ncmd.args ; argp ; argp = argp->narg.next) {
p = argp->narg.text;
if (varflag && is_name(*p)) {
@@ -722,7 +732,10 @@ evalcommand(cmd, flags, backcmd)
for (sp = varlist.list ; sp ; sp = sp->next)
mklocal(sp->text);
funcnest++;
evaltree(cmdentry.u.func, 0);
if (flags & EV_TESTED)
evaltree(cmdentry.u.func, EV_TESTED);
else
evaltree(cmdentry.u.func, 0);
funcnest--;
INTOFF;
poplocalvars();
@@ -895,7 +908,7 @@ breakcmd(argc, argv) char **argv; {
returncmd(argc, argv) char **argv; {
int ret;
ret = exitstatus;
ret = oexitstatus;
if (argc > 1)
ret = number(argv[1]);
if (funcnest) {

View File

@@ -463,7 +463,7 @@ varvalue(name, quoted, allow_split)
char temp[32];
char *p;
int i;
extern int exitstatus;
extern int oexitstatus;
char sep;
char **ap;
char const *syntax;
@@ -473,7 +473,7 @@ varvalue(name, quoted, allow_split)
num = rootpid;
goto numvar;
case '?':
num = exitstatus;
num = oexitstatus;
goto numvar;
case '#':
num = shellparam.nparam;

View File

@@ -321,8 +321,11 @@ dotcmd(argc, argv) char **argv; {
exitcmd(argc, argv) char **argv; {
extern int oexitstatus;
if (argc > 1)
exitstatus = number(argv[1]);
else
exitstatus = oexitstatus;
exitshell(exitstatus);
}

View File

@@ -58,7 +58,17 @@
#define JOBS 0
/* Set SYMLINKS to 0 by request of Giovanni Falzoni, who wrote the
* symlink patches for Minix; email to minix-devel-l of thu 3 nov.
*/
#if 0
#define SYMLINKS defined(S_ISLNK)
#else
#define SYMLINKS 0
#endif
#define DIRENT 1
#define UDIR 0
#define TILDE 1

View File

@@ -160,6 +160,3 @@ _PROTOTYPE(void process_params, (program_counter *pc, int func ));
_PROTOTYPE(int yyparse, (void));
_PROTOTYPE(int yylex, (void));
/* Other things... */
_PROTOTYPE(int getopt, (int, char * const [], const char * ));

View File

@@ -1,6 +0,0 @@
toptarget:
@echo "This program needs nonstandard compiler sizes or a "
@echo "nonstandard build procedure."
@echo "To build it, type 'sh makeme.sh'."

View File

@@ -50,7 +50,7 @@ all: $(PROGRAM)
$(PROGRAM): $(OBJS) $(LIBS)
$(LINKER) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
install -S 384k $(PROGRAM)
install -S 484k $(PROGRAM)
install: $(BINDIR)/yacc

View File

@@ -9,7 +9,7 @@ RANLIB=ranlib
LDFLAGS=
BIGFILES=#-D_FILE_OFFSET_BITS=64
CFLAGS=-Wall -Winline -O -g $(BIGFILES) -Dlstat=stat
CFLAGS=-Wall -Winline -O -g $(BIGFILES) -Dlstat=stat -D_POSIX_SOURCE=1
# Where you want it installed when you do 'make install'
PREFIX=/usr/local
@@ -27,8 +27,6 @@ OBJS= blocksort.o \
decompress.o \
bzlib.o
include ../bigmake.inc
all: all_notest
all_notest: libbz2.a bzip2 bzip2recover

View File

@@ -1,4 +1,6 @@
#!/bin/sh
make clean
sh makeme.sh
make install
make all
if [ "$1" != build ]
then make install
fi

View File

@@ -1 +0,0 @@
bigmake all

View File

@@ -3,6 +3,7 @@
*/
#define _MINIX_SOURCE
#define _MINIX 1
#define nil ((void*)0)
#include <sys/types.h>
@@ -32,21 +33,6 @@ static volatile int need_reload;/* Set if table reload required. */
static volatile int need_quit; /* Set if cron must exit. */
static volatile int debug; /* Debug level. */
static int setenv(char *var, char *val)
/* Set an environment variable. Return 0/-1 for success/failure. */
{
char *env;
env= malloc((strlen(var) + strlen(val) + 2) * sizeof(env[0]));
if (env == nil) return -1;
strcpy(env, var);
strcat(env, "=");
strcat(env, val);
if (putenv(env) < 0) return -1;
free(env);
return 0;
}
static void run_job(cronjob_t *job)
/* Execute a cron job. Register its pid in the job structure. If a job's
* crontab has an owner then its output is mailed to that owner, otherwise
@@ -204,11 +190,11 @@ static void run_job(cronjob_t *job)
setgid(pw->pw_gid);
setuid(pw->pw_uid);
chdir(pw->pw_dir);
if (setenv("USER", pw->pw_name) < 0) goto bad;
if (setenv("LOGNAME", pw->pw_name) < 0) goto bad;
if (setenv("HOME", pw->pw_dir) < 0) goto bad;
if (setenv("USER", pw->pw_name, 1) < 0) goto bad;
if (setenv("LOGNAME", pw->pw_name, 1) < 0) goto bad;
if (setenv("HOME", pw->pw_dir, 1) < 0) goto bad;
if (setenv("SHELL", pw->pw_shell[0] == 0 ? "/bin/sh"
: pw->pw_shell) < 0) goto bad;
: pw->pw_shell, 1) < 0) goto bad;
}
if (job->atjob) {

View File

@@ -244,7 +244,7 @@ typedef struct de_state /* State of disk ed. */
zone_t block; /* Current block (1K) */
unsigned offset; /* Offset within block */
char buffer[ MAX_BLOCK_SIZE ];
char buffer[ _MAX_BLOCK_SIZE ];
/* Display state */

View File

@@ -135,14 +135,14 @@ void Read_Super_Block( s )
s->zone_num_size = V1_ZONE_NUM_SIZE;
s->zones = super->s_nzones;
s->ndzones = V1_NR_DZONES;
s->block_size = STATIC_BLOCK_SIZE;
s->block_size = _STATIC_BLOCK_SIZE;
}
else if ( s->magic == SUPER_V2 || s->magic == SUPER_V3)
{
if(s->magic == SUPER_V3)
s->block_size = super->s_block_size;
else
s->block_size = STATIC_BLOCK_SIZE;
s->block_size = _STATIC_BLOCK_SIZE;
s->is_fs = TRUE;
s->v1 = FALSE;
s->inode_size = V2_INODE_SIZE;

View File

@@ -453,7 +453,7 @@ int Indirect( s, block, file_size, dblind )
union
{
zone1_t ind1[ V1_INDIRECTS ];
zone_t ind2[ V2_INDIRECTS(MAX_BLOCK_SIZE) ];
zone_t ind2[ V2_INDIRECTS(_MAX_BLOCK_SIZE) ];
} indirect;
int i;
zone_t zone;

View File

@@ -32,8 +32,10 @@
#include "de.h"
#ifndef major
#define major(x) ( (x>>8) & 0377)
#define minor(x) (x & 0377)
#endif
/****************************************************************/
/* Code for handling termcap */

View File

@@ -173,6 +173,7 @@ int opendev(network_t *np, fdtype_t fdtype, int compete)
switch (fdtype) {
case FT_ETHERNET:
fcntl(np->fdp->fd, F_SETFL, fcntl(np->fdp->fd, F_GETFL) | O_NONBLOCK);
if (ioctl(np->fdp->fd, NWIOGETHSTAT, &ethstat) < 0) {
/* Not an Ethernet. */
close(fdp->fd);

1
commands/elvis/.descr Normal file
View File

@@ -0,0 +1 @@
Lightweight vi

View File

@@ -60,12 +60,16 @@ elvprsv: elvprsv.c
install -S 4kw $@
install: /usr/bin/elvis \
/bin/elvis \
/usr/bin/ctags /usr/bin/ref /usr/bin/fmt \
/usr/bin/elvrec /usr/bin/elvprsv
/usr/bin/elvis: elvis
install -cs -o bin elvis $@
/bin/elvis: elvis
install -cs -o bin elvis $@
/usr/bin/ctags: ctags
install -cs -o bin ctags $@

View File

@@ -1,3 +1,2 @@
#!/bin/sh
make clean
make && make install

View File

@@ -260,9 +260,7 @@ extern long lseek();
#if ANY_UNIX
# ifndef TMPDIR
# if MINIX
# define TMPDIR "/usr/tmp" /* Keep elvis' temp files off RAM disk! */
# else
# define TMPDIR "/tmp" /* directory where temp files live */
# define TMPDIR "/tmp"
# endif
# endif
# ifndef PRSVDIR

View File

@@ -1,38 +0,0 @@
Flex carries the copyright used for BSD software, slightly modified
because it originated at the Lawrence Berkeley (not Livermore!) Laboratory,
which operates under a contract with the Department of Energy:
Copyright (c) 1990 The Regents of the University of California.
All rights reserved.
This code is derived from software contributed to Berkeley by
Vern Paxson.
The United States Government has rights in this work pursuant
to contract no. DE-AC03-76SF00098 between the United States
Department of Energy and the University of California.
Redistribution and use in source and binary forms with or without
modification are permitted provided that: (1) source distributions
retain this entire copyright notice and comment, and (2)
distributions including binaries display the following
acknowledgement: ``This product includes software developed by the
University of California, Berkeley and its contributors'' in the
documentation or other materials provided with the distribution and
in all advertising materials mentioning features or use of this
software. Neither the name of the University nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.
This basically says "do whatever you please with this software except
remove this notice or take advantage of the University's (or the flex
authors') name".
Note that the "flex.skl" scanner skeleton carries no copyright notice.
You are free to do whatever you please with scanners generated using flex;
for them, you are not even bound by the above copyright.

View File

@@ -1,186 +0,0 @@
// $Header$
// FlexLexer.h -- define interfaces for lexical analyzer classes generated
// by flex
// Copyright (c) 1993 The Regents of the University of California.
// All rights reserved.
//
// This code is derived from software contributed to Berkeley by
// Kent Williams and Tom Epperly.
//
// Redistribution and use in source and binary forms with or without
// modification are permitted provided that: (1) source distributions retain
// this entire copyright notice and comment, and (2) distributions including
// binaries display the following acknowledgement: ``This product includes
// software developed by the University of California, Berkeley and its
// contributors'' in the documentation or other materials provided with the
// distribution and in all advertising materials mentioning features or use
// of this software. Neither the name of the University nor the names of
// its contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
// THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
// This file defines FlexLexer, an abstract class which specifies the
// external interface provided to flex C++ lexer objects, and yyFlexLexer,
// which defines a particular lexer class.
//
// If you want to create multiple lexer classes, you use the -P flag
// to rename each yyFlexLexer to some other xxFlexLexer. You then
// include <FlexLexer.h> in your other sources once per lexer class:
//
// #undef yyFlexLexer
// #define yyFlexLexer xxFlexLexer
// #include <FlexLexer.h>
//
// #undef yyFlexLexer
// #define yyFlexLexer zzFlexLexer
// #include <FlexLexer.h>
// ...
#ifndef __FLEX_LEXER_H
// Never included before - need to define base class.
#define __FLEX_LEXER_H
#include <iostream.h>
extern "C++" {
struct yy_buffer_state;
typedef int yy_state_type;
class FlexLexer {
public:
virtual ~FlexLexer() { }
const char* YYText() { return yytext; }
int YYLeng() { return yyleng; }
virtual void
yy_switch_to_buffer( struct yy_buffer_state* new_buffer ) = 0;
virtual struct yy_buffer_state*
yy_create_buffer( istream* s, int size ) = 0;
virtual void yy_delete_buffer( struct yy_buffer_state* b ) = 0;
virtual void yyrestart( istream* s ) = 0;
virtual int yylex() = 0;
// Call yylex with new input/output sources.
int yylex( istream* new_in, ostream* new_out = 0 )
{
switch_streams( new_in, new_out );
return yylex();
}
// Switch to new input/output streams. A nil stream pointer
// indicates "keep the current one".
virtual void switch_streams( istream* new_in = 0,
ostream* new_out = 0 ) = 0;
int lineno() const { return yylineno; }
int debug() const { return yy_flex_debug; }
void set_debug( int flag ) { yy_flex_debug = flag; }
protected:
char* yytext;
int yyleng;
int yylineno; // only maintained if you use %option yylineno
int yy_flex_debug; // only has effect with -d or "%option debug"
};
}
#endif
#if defined(yyFlexLexer) || ! defined(yyFlexLexerOnce)
// Either this is the first time through (yyFlexLexerOnce not defined),
// or this is a repeated include to define a different flavor of
// yyFlexLexer, as discussed in the flex man page.
#define yyFlexLexerOnce
class yyFlexLexer : public FlexLexer {
public:
// arg_yyin and arg_yyout default to the cin and cout, but we
// only make that assignment when initializing in yylex().
yyFlexLexer( istream* arg_yyin = 0, ostream* arg_yyout = 0 );
virtual ~yyFlexLexer();
void yy_switch_to_buffer( struct yy_buffer_state* new_buffer );
struct yy_buffer_state* yy_create_buffer( istream* s, int size );
void yy_delete_buffer( struct yy_buffer_state* b );
void yyrestart( istream* s );
virtual int yylex();
virtual void switch_streams( istream* new_in, ostream* new_out );
protected:
virtual int LexerInput( char* buf, int max_size );
virtual void LexerOutput( const char* buf, int size );
virtual void LexerError( const char* msg );
void yyunput( int c, char* buf_ptr );
int yyinput();
void yy_load_buffer_state();
void yy_init_buffer( struct yy_buffer_state* b, istream* s );
void yy_flush_buffer( struct yy_buffer_state* b );
int yy_start_stack_ptr;
int yy_start_stack_depth;
int* yy_start_stack;
void yy_push_state( int new_state );
void yy_pop_state();
int yy_top_state();
yy_state_type yy_get_previous_state();
yy_state_type yy_try_NUL_trans( yy_state_type current_state );
int yy_get_next_buffer();
istream* yyin; // input source for default LexerInput
ostream* yyout; // output sink for default LexerOutput
struct yy_buffer_state* yy_current_buffer;
// yy_hold_char holds the character lost when yytext is formed.
char yy_hold_char;
// Number of characters read into yy_ch_buf.
int yy_n_chars;
// Points to current character in buffer.
char* yy_c_buf_p;
int yy_init; // whether we need to initialize
int yy_start; // start state number
// Flag which is used to allow yywrap()'s to do buffer switches
// instead of setting up a fresh yyin. A bit of a hack ...
int yy_did_buffer_switch_on_eof;
// The following are not always needed, but may be depending
// on use of certain flex features (like REJECT or yymore()).
yy_state_type yy_last_accepting_state;
char* yy_last_accepting_cpos;
yy_state_type* yy_state_buf;
yy_state_type* yy_state_ptr;
char* yy_full_match;
int* yy_full_state;
int yy_full_lp;
int yy_lp;
int yy_looking_for_trail_begin;
int yy_more_flag;
int yy_more_len;
int yy_more_offset;
int yy_prev_more_offset;
};
#endif

View File

@@ -1,117 +0,0 @@
This is a generic INSTALL file for utilities distributions.
If this package does not come with, e.g., installable documentation or
data files, please ignore the references to them below.
To compile this package:
1. Configure the package for your system. In the directory that this
file is in, type `./configure'. If you're using `csh' on an old
version of System V, you might need to type `sh configure' instead to
prevent `csh' from trying to execute `configure' itself.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation, and
creates the Makefile(s) (one in each subdirectory of the source
directory). In some packages it creates a C header file containing
system-dependent definitions. It also creates a file `config.status'
that you can run in the future to recreate the current configuration.
Running `configure' takes a minute or two. While it is running, it
prints some messages that tell what it is doing. If you don't want to
see the messages, run `configure' with its standard output redirected
to `/dev/null'; for example, `./configure >/dev/null'.
To compile the package in a different directory from the one
containing the source code, you must use a version of `make' that
supports the VPATH variable, such as GNU `make'. `cd' to the directory
where you want the object files and executables to go and run
`configure'. `configure' automatically checks for the source code in
the directory that `configure' is in and in `..'. If for some reason
`configure' is not in the source code directory that you are
configuring, then it will report that it can't find the source code.
In that case, run `configure' with the option `--srcdir=DIR', where
DIR is the directory that contains the source code.
By default, `make install' will install the package's files in
/usr/local/bin, /usr/local/lib, /usr/local/man, etc. You can specify
an installation prefix other than /usr/local by giving `configure' the
option `--prefix=PATH'. Alternately, you can do so by giving a value
for the `prefix' variable when you run `make', e.g.,
make prefix=/usr/gnu
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If
you give `configure' the option `--exec-prefix=PATH' or set the
`make' variable `exec_prefix' to PATH, the package will use PATH as
the prefix for installing programs and libraries. Data files and
documentation will still use the regular prefix. Normally, all files
are installed using the regular prefix.
Another `configure' option is useful mainly in `Makefile' rules for
updating `config.status' and `Makefile'. The `--no-create' option
figures out the configuration for your system and records it in
`config.status', without actually configuring the package (creating
`Makefile's and perhaps a configuration header file). Later, you can
run `./config.status' to actually configure the package. You can also
give `config.status' the `--recheck' option, which makes it re-run
`configure' with the same arguments you used before. This option is
useful if you change `configure'.
Some packages pay attention to `--with-PACKAGE' options to `configure',
where PACKAGE is something like `gnu-libc' or `x' (for X windows).
The README should mention any --with- options that the package recognizes.
`configure' ignores any other arguments that you give it.
If your system requires unusual options for compilation or linking
that `configure' doesn't know about, you can give `configure' initial
values for some variables by setting them in the environment. In
Bourne-compatible shells, you can do that on the command line like
this:
CC='gcc -traditional' DEFS=-D_POSIX_SOURCE ./configure
The `make' variables that you might want to override with environment
variables when running `configure' are:
(For these variables, any value given in the environment overrides the
value that `configure' would choose:)
CC C compiler program.
Default is `cc', or `gcc' if `gcc' is in your PATH.
INSTALL Program to use to install files.
Default is `install' if you have it, `cp' otherwise.
(For these variables, any value given in the environment is added to
the value that `configure' chooses:)
DEFS Configuration options, in the form `-Dfoo -Dbar ...'
Do not use this variable in packages that create a
configuration header file.
LIBS Libraries to link with, in the form `-lfoo -lbar ...'
If you need to do unusual things to compile the package, we encourage
you to figure out how `configure' could check whether to do them, and
mail diffs or instructions to the address given in the README so we
can include them in the next release.
2. Type `make' to compile the package. If you want, you can override
the `make' variables CFLAGS and LDFLAGS like this:
make CFLAGS=-O2 LDFLAGS=-s
3. If the package comes with self-tests and you want to run them,
type `make check'. If you're not sure whether there are any, try it;
if `make' responds with something like
make: *** No way to make target `check'. Stop.
then the package does not come with self-tests.
4. Type `make install' to install programs, data files, and
documentation.
5. You can remove the program binaries and object files from the
source directory by typing `make clean'. To also remove the
Makefile(s), the header file containing system-dependent definitions
(if the package uses one), and `config.status' (all the files that
`configure' created), type `make distclean'.
The file `configure.in' is used as a template to create `configure' by
a program called `autoconf'. You will only need it if you want to
regenerate `configure' using a newer version of `autoconf'.

View File

@@ -1,72 +0,0 @@
This file, ./MISC/Amiga/README.amiga, describes the necessary steps to get
the FLEX 2.5.1 program up and running on the Commodore AMIGA with the
help of SAS/C++ 6.51 and SMake 6.50. Also it describes the contents of the
subdirectory ./MISC/Amiga, where `.' denotes the root directory of the
standard installation of FLEX 2.5.1.
FILES ADDED FOR INSTALLING FLEX 2.5.1 ON THE AMIGA
The standard distribution of FLEX 2.5.1 is assumed to be installed on
your AMIGA computer. `Installed' means that all source files from the
original archive are present in a root directory (denoted by `.' in what
follows) and, if appropriate, one or more subdirectories, on your machine.
The original source files are totally left untouched, the necessary changes
are applied in the form of `change files'. For installing FLEX 2.5.1 on
the AMIGA, several additional files come with this patch.
-----rw-d 2 738 Apr 3 11:49 config.h
-----rw-d 1 169 Apr 3 11:33 libmain.ch
-----rw-d 1 159 Apr 3 11:33 libyywrap.ch
-----rw-d 1 167 Apr 3 11:33 parse.ych
-----rw-d 6 2840 Apr 3 11:34 README.amiga
-----rw-d 11 5503 Apr 3 11:45 smakefile
Dirs:0 Files:6 Blocks:22 Bytes:9576
HOW TO INSTALL FLEX 2.5.1 ON THE AMIGA
Copy all files from ./MISC/Amiga to the root directory of the FLEX 2.5.1
distribution and edit `SMakefile' as it instructs you. There shouldn't be
too many changes necessary. Then say "make bootflex". This creates a
preliminary version of FLEX 2.5.1 without using itself.
WARNING: Don't say "make flex" yet. Any pre-2.5 version of FLEX will fail
on the file `scan.l' due to some new features only present in FLEX 2.5.
Then say "make flex". At least once the FLEX program created in the first
step will be used. To make sure that everything is alright, finally say
"make check". If you change the code, you should also say "make bigcheck"
for some more thorough testing.
When you are satisfied with the results, say "make install". This will
copy the `flex' binary, the `libfl.lib' file, and the `FlexLexer.h' header
to the paths specified in the `SMakefile'.
Finally, you should say "make clean" to remove all intermediate files from
the root directory. "make veryclean" also removes `flex' and `scan.c'.
TROUBLE SHOOTING
FLEX 2.5.1 was ported to the AMIGA and tested with the following setup:
AMIGA 2000
GVP G-Force 030/50/50/8
SAS/C++ 6.51
SED 2.05
BISON 1.22
WMERGE from the CWEB distribution
Should you encounter problems with this AMIGA patch for FLEX 2.5.1 or
should you have ideas for further improvements, like using GnuMake instead
of SMake, contact the author of this contribution
Andreas Scherer
Roland-Stra{\ss}e 16
52070 Aachen
Germany
<scherer@genesis.informatik.rwth-aachen.de> (Internet)

View File

@@ -1,195 +0,0 @@
# @(#) $Header$ (LBL)
# If your version of "make" does not define $(MAKE), comment in the
# definition of "MAKE" below. (You only need to do this if you intend
# to do "make bigcheck" or "make dist".)
MAKE = smake
# Possible values for DEFS:
#
# For flex to always generate 8-bit scanners, add "-DDEFAULT_CSIZE=256"
# to DEFS.
#
# For Vax/VMS, add "-DVMS" to DEFS.
#
# For MS-DOS, add "-DMS_DOS" to DEFS. See the directory MISC/MSDOS for
# additional info.
CFLAGS = data=far ignore=85 noicons stackextend optimize
DEFS = define=YYBISON=1 define=YY_NEVER_INTERACTIVE=1
LDFLAGS = noicons
LIBS =
# Installation targeting. Files will be installed under the tree
# rooted at prefix. flex will be installed in bindir, libfl.lib in
# libdir, FlexLexer.h will be installed in includedir, and the manual
# pages will be installed in mandir with extension manext.
#
# Raw, unformatted troff source will be installed if INSTALLMAN=man,
# nroff preformatted versions will be installed if INSTALLMAN=cat.
prefix = Programmer:other # Change this for your AMIGA system.
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
includedir = $(prefix)/include
manext = 1
mandir = $(prefix)/man/man$(manext)
# You can define this to be "lex" if you want to replace lex at your site.
FLEX = flex
INSTALLMAN = man
SHELL =
srcdir = .
VPATH =
LN_S =
YACC = bison -y
SED = sed
CC = sc
WMERGE = wmerge # from the CWEB distribution
AR = oml
RANLIB =
INSTALL = copy clone
INSTALL_DATA = $(INSTALL)
INSTALL_PROGRAM = $(INSTALL)
# You normally do not need to modify anything below this point.
# ------------------------------------------------------------
CPPFLAGS = idir=. idir=$(srcdir) $(DEFS)
.c.o:
$(CC) $(CPPFLAGS) $(CFLAGS) $<
HEADERS = flexdef.h version.h
SOURCES = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.y \
scan.l skel.c sym.c tblcmp.c yylex.c
OBJECTS = ccl.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o \
skel.o sym.o tblcmp.o yylex.o \
$(libdir)/alloca.o $(libdir)/xmalloc.o
LIBSRCS = libmain.c libyywrap.c
LIBOBJS = ansilibmain.o ansilibyywrap.o
LINTSRCS = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.c \
scan.c skel.c sym.c tblcmp.c yylex.c
DISTFILES = README NEWS COPYING INSTALL FlexLexer.h \
configure.in conf.in Makefile.in mkskel.sh skel.c flex.skl \
$(HEADERS) $(SOURCES) $(LIBSRCS) MISC \
flex.1 scan.c install.sh mkinstalldirs configure
DIST_NAME = flex
# which "flex" to use to generate scan.c from scan.l
FLEX_EXEC = ./$(FLEX)
FLEX_FLAGS = -t $(PERF_REPORT)
COMPRESSION =
PERF_REPORT = -p
FLEXLIB = libfl.lib
all: $(FLEX)
$(FLEX): $(OBJECTS) $(FLEXLIB) scan.o
$(CC) $(CFLAGS) link to $(FLEX) $(LDFLAGS) $(OBJECTS) scan.o $(FLEXLIB) $(LIBS)
bootflex: $(OBJECTS) $(FLEXLIB) initscan.o
$(CC) $(CFLAGS) link to $(FLEX) $(LDFLAGS) $(OBJECTS) initscan.o $(FLEXLIB) $(LIBS)
parse.c: ansiparse.y
$(YACC) -d ansiparse.y
$(SED) "/extern char.*malloc/d" <y.tab.c >parse.tmp
copy parse.tmp parse.c
copy y.tab.h parse.h
@delete y.tab.c y.tab.h parse.tmp
ansiparse.y: $(srcdir)/parse.y parse.ych
$(WMERGE) $(srcdir)/parse.y parse.ych ansiparse.y
parse.h: parse.c
scan.c: scan.l
$(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) $(srcdir)/scan.l >scan.tmp
$(SED) s,\"$(srcdir)/scan.l\",\"scan.l\", <scan.tmp >scan.c
@delete scan.tmp
scan.o: scan.c parse.h flexdef.h config.h
initscan.o: initscan.c parse.h flexdef.h config.h
yylex.o: yylex.c parse.h flexdef.h config.h
skel.c: flex.skl mkskel.sh
$(SHELL) $(srcdir)/mkskel.sh $(srcdir)/flex.skl >skel.c
main.o: main.c flexdef.h config.h version.h
ccl.o: ccl.c flexdef.h config.h
dfa.o: dfa.c flexdef.h config.h
ecs.o: ecs.c flexdef.h config.h
gen.o: gen.c flexdef.h config.h
misc.o: misc.c flexdef.h config.h
nfa.o: nfa.c flexdef.h config.h
parse.o: parse.c flexdef.h config.h
skel.o: skel.c flexdef.h config.h
sym.o: sym.c flexdef.h config.h
tblcmp.o: tblcmp.c flexdef.h config.h
alloca.o: alloca.c
$(CC) $(CPPFLAGS) $(CFLAGS) define=xmalloc=yy_flex_xmalloc alloca.c
alloca.c: $(srcdir)/MISC/alloca.c
@delete alloca.c
copy $(srcdir)/MISC/alloca.c .
test: check
check: flex
$(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) $(srcdir)/scan.l > temp_a
$(SED) s,"$(srcdir)/scan.l","scan.l", < temp_a > temp_b
-diff scan.c temp_b -l10000 -w
@delete temp_?
@echo "Check successful, using COMPRESSION='$(COMPRESSION)'"
bigcheck:
delete scan.c
$(MAKE) COMPRESSION=-C check
delete scan.c
$(MAKE) COMPRESSION=-Ce check
delete scan.c
$(MAKE) COMPRESSION=-Cm check
delete scan.c
$(MAKE) COMPRESSION=-Cfea check
delete scan.c
$(MAKE) COMPRESSION=-CFer check
delete scan.c
$(MAKE) COMPRESSION=-l PERF_REPORT= check
delete scan.c
$(MAKE)
@echo "All checks successful"
$(FLEXLIB): $(LIBOBJS)
$(AR) $(FLEXLIB) R $(LIBOBJS)
$(FLEX).man: flex.1 # SMAKE can't `cd', sorry. And, I don't have nroff.
# cd $(srcdir), nroff -man flex.1 >$(FLEX).man
install: $(FLEX) $(FLEXLIB)
$(INSTALL_PROGRAM) $(FLEX) $(bindir)/$(FLEX)
# @delete $(bindir)/$(FLEX)++
$(INSTALL_DATA) $(FLEXLIB) $(libdir)/libfl.lib
$(INSTALL_DATA) $(srcdir)/FlexLexer.h $(includedir)/FlexLexer.h
ansilibmain.o: ansilibmain.c
ansilibmain.c: libmain.c libmain.ch
$(WMERGE) libmain.c libmain.ch ansilibmain.c
ansilibyywrap.o: ansilibyywrap.c
ansilibyywrap.c: libyywrap.c libyywrap.ch
$(WMERGE) libyywrap.c libyywrap.ch ansilibyywrap.c
clean:
-delete parse.(c|h) ansi\#? \#?.(bak|o|lnk) \
alloca.c lex.yy.(c|cc) $(FLEXLIB)
veryclean: clean
-delete $(FLEX) scan.c

View File

@@ -1,25 +0,0 @@
/* $Header$ */
/* Define to empty if the keyword does not work. */
#undef const
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H
/* Define if platform-specific command line handling is necessary. */
#undef NEED_ARGV_FIXUP

View File

@@ -1,8 +0,0 @@
Changes for LIBMAIN.C 2.4.7 by Andreas Scherer, January 19, 1995.
Modified for LIBMAIN.C 2.5.1, April 3, 1995.
@x l.5
extern int yylex();
@y
extern int yylex(void);
@z

View File

@@ -1,8 +0,0 @@
Changes for LIBYYWRAP.C 2.4.7 by Andreas Scherer, January 19, 1995.
Modified for LIBYYWRAP.C 2.5.1, April 3, 1995.
@x l.5
int yywrap()
@y
int yywrap(void)
@z

View File

@@ -1,8 +0,0 @@
Changes for PARSE.Y 2.4.7 by Andreas Scherer, January 20, 1995.
Modified for PARSE.Y 2.5.1, April 3, 1995.
@x l.60
char *alloca ();
@y
char *alloca(unsigned int);
@z

View File

@@ -1,911 +0,0 @@
(Message inbox:32)
Date: Mon, 03 Jul 89 21:15:32 CET
From: V61%DHDURZ1.BITNET@lbl.gov
Subject: Flex, bug fix, improvments, patches for Minix & TOS
To: vern@lbl-csam.arpa
At first I have to thank you for your wonderful program. I had ported the
old version to OS9,TOS (Atari ST) and Minix and the new version 2.1 Beta
to Minix and TOS.
While porting and using flex I detected a bug and made some improvements.
I have included a shared, compressed and uuencoded file contaning all cdiffs
and additional files (Sorry, but I'm on EBCDIC-Bitnet) and a short discussion
of the changes. Even some of the TOS specific changes might be of general
interest !
I posted these cdiffs to the minix discussion group, but I think it's up
to you to post them to the unix-sources group. If you plan to post even
the TOS compiler specific patches please contact me because there might be
further compiler (P.D.) additions. If you have an interest I could also
port the new version to OS9 -- this is a little bit more difficult, because
OS9 uses CR as end of line character (the EOL char. is coded into the
initscan.c tables,...). It is necessary to change all occurences of '\n' to
macros and variables and it's useful to add a new -n options (see commented
line in main.c)
The changes: (1.7.89 RAL)
- Bug fix: The original flex didn't like trailing spaces in exclusive start
condition lists ! If you add an trailing space to line 68 in scan.l
"%x SECT2 SECT2PROLOG SECT3 CODEBLOCK PICKUPDEF SC CARETISBOL NUM QUOTE "
you get a misleading error message:
"Syntax error at line 69: bad start condition list"
This bug can either be fixed in parse.y or in scan.l . I have chosen the
last because there the fix is minimal: Just change the rule (line 128)
"\n" to "{OPTWS}\n"
- Enhancements:
- new option "-?" that provides some help information about the other
flags (main.c)
- new option "-aTMPPATH" that allows a redefinition of the standard
path for the temporary file (this might be rather large >200k if
F,f options are selected). (main.c, flexdef.h (l.376))
- hexdump of illegal characters -- this proved to be a useful debugging
tool especialy if invisible control characters occur which weren't
covered by the rules. (scan.l fprintf statement line 129,...)
- Patches due to TOS
- General: TOS uses CR,LF as end of line char., Flex wants only a single
LF as EOL char. Therefore all I/O must be translated using f* calls.
This is done everywhere besides the YY_INPUT macro (flex.skel (scan.c),
line 31) that uses a low level 'read'. This should be definitly changed
to fread, so that all I/O calls occur on the same level.
- the short action_file_name has been "flexXXXXXX.tmp", but that's too
much for TOS,MSDOS ! I changed it to "flexXXXX.tmp" in main.c (patch
covered by the -a option additions)
- some compilers don't like external names that are ambiguous within
the first 8 characters. I defined macros that change all these long
external names to names that are unique within the first 8 characters.
Just define SHORT_EXTERNAL_NAMES to use this feature (flexdef.h)
- some statement changes that some compiler don't like:
typedef *xxx[] -> typedef **xxx (flexdef.h.,l.308)
"/*" -> '/','*' within a comment in (scan.l, l.209)
- changed short "lexyy.c" to "lex_yy.c" what's more similar to the unix
"lex.yy.c" (main.c).
- a few further really compiler dependent changes provided with
#ifdef ATARI && LATTICE res. TURBO braces.
- Additional TOS only files
- Makefile.tos: Common makefile for all TOS compilers. If you add further
ones please email me the new makefile.
- flex.lnk: Lattice - GST linker argument extension file
- flex.tlk: Turbo linker argument extension file
Additional remarks:
I didn't add a new initscan.c (= flex -ist scan.l). The current one is good
enough for a first compilation. With this first version of flex you can
rebuild your own scan.c and the final flex version !
Minix ST :
- I had to "chmem =70000 cv" (>50000) to get flex linked
- 'memset' (PC 1.3, EFTH40,...) is necessary
- chmem =90000 flex may be sufficient
Minix PC :
It should be possible to port Flex to Minix PC. The current sizes of flex
are:
Minix ST (ACK) Lattice (TOS) Turbo (TOS)
size 75300 83305 57957
compilation time 22' 15' 3'40"
flex -is scan.l 1'49" 43" 30"
The Minix ST size includes the bad generated code using only a subset of
the 68000 commands, long addresses only and a huge relocation table.
Therefore the PC size will be <64 k ! More serious is the fact that I had
to chmem =90000 flex to get scan.l converted to scan.c . But I never saw
a more complex lex source than scan.l -- so it should be possible to
reduce some array sizes without limitation for all day usage.
No one volunteered yet for a Minix PC port -- but if someone will try it
I would provide him with a new scan.c and some hints.
TOS:
Don't forget to adapt the flexskel path within flexdef.h !
Bitnet: V61@DHDURZ1 Ronald Lamprecht
UUCP: ...!unido!DHDURZ1.bitnet!V61 Theoretische Physik
ARPAnet: V61%DHDURZ1.BITNET@CUNYVM.CUNY.EDU (Heidelberg, West Germany)
(Message inbox:36)
Date: Wed, 05 Jul 89 21:16:07 CET
From: V61%DHDURZ1.BITNET@csa2.lbl.gov
Subject: Re: What is TOS
To: vern@lbl-csam.arpa
TOS is the name of the Atari ST operating system that is very similar
to MSDOS (Both use CR,LF as end of line character). Therefore I have
been astonished that no EOL convertion porblems occur within MSDOS.
I have been aware of the double buffering when changing read to fread and I
accept your argument of a possible slow down. But if you integrate the other
Atari - TOS changes, please insert a
#ifdef ATARI
fread ....
#else
read ....
#endif
in flex.skel .
Bitnet: V61@DHDURZ1 Ronald Lamprecht
UUCP: ...!unido!DHDURZ1.bitnet!V61 Theoretische Physik
ARPAnet: V61%DHDURZ1.BITNET@CUNYVM.CUNY.EDU (Heidelberg, West Germany)
echo x - Makefile_cdiff
sed '/^X/s///' > Makefile_cdiff << '/'
X*** Src_2.1/Makefile Thu Jun 28 00:06:42 1989
X--- Makefile Thu Jul 3 02:12:48 1989
X***************
X*** 5,10 ****
X--- 5,11 ----
X # Porting considerations:
X #
X # For System V Unix machines, add -DSYS_V to CFLAGS.
X+ # For Minix (ST), add -DSYS_V to CFLAGS
X # For Vax/VMS, add -DSYS_V to CFLAGS.
X # For MS-DOS, add "-DMS_DOS -DSYS_V" to CFLAGS. Create \tmp if not present.
X # You will also want to rename flex.skel to something with a three
X***************
X*** 21,28 ****
X SKELETON_DIR = /usr/local/lib
X SKELETON_FILE = flex.skel
X SKELFLAGS = -DDEFAULT_SKELETON_FILE=\"$(SKELETON_DIR)/$(SKELETON_FILE)\"
X! CFLAGS = -O
X! LDFLAGS = -s
X
X FLEX_FLAGS =
X FLEX = ./flex
X--- 22,29 ----
X SKELETON_DIR = /usr/local/lib
X SKELETON_FILE = flex.skel
X SKELFLAGS = -DDEFAULT_SKELETON_FILE=\"$(SKELETON_DIR)/$(SKELETON_FILE)\"
X! CFLAGS = -O -DSYS_V
X! LDFLAGS =
X
X FLEX_FLAGS =
X FLEX = ./flex
X***************
X*** 57,63 ****
X yylex.c
X
X flex : $(FLEXOBJS)
X! $(CC) $(CFLAGS) -o flex $(LDFLAGS) $(FLEXOBJS)
X
X first_flex:
X cp initscan.c scan.c
X--- 58,65 ----
X yylex.c
X
X flex : $(FLEXOBJS)
X! $(CC) $(CFLAGS) -o flex $(FLEXOBJS) $(LDFLAGS)
X! chmem =150000 flex
X
X first_flex:
X cp initscan.c scan.c
/
echo x - flex.skel_cdif
sed '/^X/s///' > flex.skel_cdif << '/'
X*** Src_2.1/flex.skel Thu Jun 28 00:19:20 1989
X--- flex.skel Thu Jul 2 22:18:31 1989
X***************
X*** 28,34 ****
X * is returned in "result".
X */
X #define YY_INPUT(buf,result,max_size) \
X! if ( (result = read( fileno(yyin), buf, max_size )) < 0 ) \
X YY_FATAL_ERROR( "read() in flex scanner failed" );
X #define YY_NULL 0
X #define yyterminate() return ( YY_NULL )
X--- 28,34 ----
X * is returned in "result".
X */
X #define YY_INPUT(buf,result,max_size) \
X! if ( (result = fread( buf,1, max_size, yyin )) < 0 ) \
X YY_FATAL_ERROR( "read() in flex scanner failed" );
X #define YY_NULL 0
X #define yyterminate() return ( YY_NULL )
/
echo x - flexdef.h_cdif
sed '/^X/s///' > flexdef.h_cdif << '/'
X*** Src_2.1/flexdef.h Thu Jun 28 00:43:27 1989
X--- flexdef.h Thu Jul 3 02:45:50 1989
X***************
X*** 26,31 ****
X--- 26,40 ----
X
X /* @(#) $Header$ (LBL) */
X
X+ #ifdef ATARI
X+ #define SYS_V
X+ #define abs(x) ((x) < 0 ? -(x) : (x))
X+ #define SHORT_FILE_NAMES
X+ #ifdef TURBO
X+ #define SHORT_EXTERNAL_NAMES
X+ #endif
X+ #endif
X+
X #ifndef FILE
X #include <stdio.h>
X #endif
X***************
X*** 41,47 ****
X #endif
X
X #ifndef VMS
X! char *memset();
X #else
X /* memset is needed for old versions of the VMS C runtime library */
X #define memset(s, c, n) \
X--- 50,58 ----
X #endif
X
X #ifndef VMS
X! #ifndef ATARI && TURBO
X! char *memset();
X! #endif
X #else
X /* memset is needed for old versions of the VMS C runtime library */
X #define memset(s, c, n) \
X***************
X*** 81,91 ****
X--- 92,129 ----
X #define true 1
X #define false 0
X
X+ #ifdef ATARI
X+ #define DEFAULT_SKELETON_FILE "D:\\include\\flexskel"
X+ #endif
X+
X
X #ifndef DEFAULT_SKELETON_FILE
X #define DEFAULT_SKELETON_FILE "flex.skel"
X #endif
X
X+ #ifdef SHORT_EXTERNAL_NAMES
X+ /* avoid long external names that are ambiguous within the first 8 characters */
X+ #define current_mns c__mns
X+ #define current_max_rules c__max_rules
X+ #define current_max_state_type c__max_state_type
X+ #define current_max_scs c__max_scs
X+ #define current_max_dfa_size c__max__size
X+ #define current_max_xpairs c__max_xpairs
X+ #define current_max_template_xpairs c__max_template_xpairs
X+ #define current_max_dfas c__max_dfas
X+ #define current_maxccls c__maxccles
X+ #define current_max_ccl_tbl_size c__max_ccl_tbl_size
X+ #define indent_puts ind_puts
X+ #define indent_put2s ind_put2s
X+ #define gen_next_compressed_state gen_n_comressed_state
X+ #define gen_next_match gen_n_match
X+ #define gen_next_state gen_n_state
X+ #define variable_trailing_context_rules var_tr_context_rules
X+ #define variable_trailing_rule var_tr_rule
X+ #define backtrack_report backtr_report
X+ #define backtrack_file backtr_file
X+ #endif
X+
X /* special chk[] values marking the slots taking by end-of-buffer and action
X * numbers
X */
X***************
X*** 305,311 ****
X int int_val;
X } ;
X
X! typedef struct hash_entry *hash_table[];
X
X #define NAME_TABLE_HASH_SIZE 101
X #define START_COND_HASH_SIZE 101
X--- 343,349 ----
X int int_val;
X } ;
X
X! typedef struct hash_entry **hash_table;
X
X #define NAME_TABLE_HASH_SIZE 101
X #define START_COND_HASH_SIZE 101
X***************
X*** 372,378 ****
X extern int datapos, dataline, linenum;
X extern FILE *skelfile, *yyin, *temp_action_file, *backtrack_file;
X extern char *infilename;
X! extern char action_file_name[];
X
X
X /* variables for stack of states having only one out-transition:
X--- 410,416 ----
X extern int datapos, dataline, linenum;
X extern FILE *skelfile, *yyin, *temp_action_file, *backtrack_file;
X extern char *infilename;
X! extern char *action_file_name;
X
X
X /* variables for stack of states having only one out-transition:
/
echo x - main.c_cdiff
sed '/^X/s///' > main.c_cdiff << '/'
X*** Src_2.1/main.c Thu Jun 28 00:30:39 1989
X--- main.c Thu Jul 3 02:27:47 1989
X***************
X*** 81,96 ****
X FILE *temp_action_file;
X FILE *backtrack_file;
X int end_of_buffer_state;
X! #ifndef SHORT_FILE_NAMES
X! char action_file_name[] = "/tmp/flexXXXXXX";
X! #else
X! char action_file_name[] = "flexXXXXXX.tmp";
X! #endif
X!
X #ifndef SHORT_FILE_NAMES
X static char outfile[] = "lex.yy.c";
X #else
X! static char outfile[] = "lexyy.c";
X #endif
X static int outfile_created = 0;
X
X--- 81,91 ----
X FILE *temp_action_file;
X FILE *backtrack_file;
X int end_of_buffer_state;
X! char *action_file_name;
X #ifndef SHORT_FILE_NAMES
X static char outfile[] = "lex.yy.c";
X #else
X! static char outfile[] = "lex_yy.c";
X #endif
X static int outfile_created = 0;
X
X***************
X*** 328,333 ****
X--- 323,329 ----
X {
X int i, sawcmpflag, use_stdout;
X char *arg, *skelname = NULL, *flex_gettime(), clower(), *mktemp();
X+ char *tmp_action =(char *)0, *malloc();
X
X printstats = syntaxerror = trace = spprdflt = interactive = caseins = false;
X backtrack_report = performance_report = ddebug = fulltbl = fullspd = false;
X***************
X*** 349,354 ****
X--- 345,355 ----
X for ( i = 1; arg[i] != '\0'; ++i )
X switch ( arg[i] )
X {
X+ case 'a':
X+ if ( i != 1 )
X+ flexerror( "-a flag must be given separately" );
X+ tmp_action = &arg[i+1];
X+ goto get_next_arg;
X case 'b':
X backtrack_report = true;
X break;
X***************
X*** 445,452 ****
X printstats = true;
X break;
X
X! default:
X! lerrif( "unknown flag %c", (int) arg[i] );
X break;
X }
X
X--- 446,458 ----
X printstats = true;
X break;
X
X! case '?':
X! flexinfo(0);
X! break;
X!
X! default:
X! fprintf(stderr,"flex : unknown flag %c\n", (int) arg[i] );
X! flexinfo(1);
X break;
X }
X
X***************
X*** 454,459 ****
X--- 460,493 ----
X ;
X }
X
X+
X+ /* if you change the default tmp file names don't forget to change the
X+ initialization for i, too !
X+
X+ */
X+ #ifndef SHORT_FILE_NAMES
X+ i = 10;
X+ if (!tmp_action) i += 5;
X+ #else
X+ i = 12;
X+ #endif
X+ if (tmp_action)
X+ i += strlen(tmp_action) + 1;
X+ if((action_file_name = malloc(i+1)) == (char *)0)
X+ flexerror("No memory for action_file_name");
X+ *action_file_name = (char) NULL;
X+ if (tmp_action)
X+ strcat(action_file_name,tmp_action);
X+ #ifndef SHORT_FILE_NAMES
X+ else
X+ strcat(action_file_name,"/tmp");
X+ strcat(action_file_name,"/flexXXXXXX");
X+ #else
X+ if (tmp_action)
X+ strcat(action_file_name,"/");
X+ strcat(action_file_name,"flexXXXX.tmp");
X+ #endif
X+
X if ( (fulltbl || fullspd) && usemecs )
X flexerror( "full table and -cm don't make sense together" );
X
X***************
X*** 520,526 ****
X if ( (skelfile = fopen( skelname, "r" )) == NULL )
X lerrsf( "can't open skeleton file %s", skelname );
X
X! (void) mktemp( action_file_name );
X
X if ( (temp_action_file = fopen( action_file_name, "w" )) == NULL )
X lerrsf( "can't open temporary action file %s", action_file_name );
X--- 554,562 ----
X if ( (skelfile = fopen( skelname, "r" )) == NULL )
X lerrsf( "can't open skeleton file %s", skelname );
X
X! #ifndef ATARI && LATTICE
X! (void) mktemp( action_file_name );
X! #endif
X
X if ( (temp_action_file = fopen( action_file_name, "w" )) == NULL )
X lerrsf( "can't open temporary action file %s", action_file_name );
X***************
X*** 566,571 ****
X--- 602,640 ----
X }
X
X
X+ flexinfo(status)
X+ int status;
X+ {
X+ fprintf(stderr,"Syntax : FLEX inp_file\n");
X+ fprintf(stderr,"Function: fast lexical analyzer generator V%s\n",flex_version);
X+ fprintf(stderr,"Options : a dir_path : directory path for temporary files\n");
X+ fprintf(stderr," - b : generate backtracking information to lex.backtrack\n");
X+ fprintf(stderr," - c : compressed table, no equiv., no meta equiv.classes\n");
X+ fprintf(stderr," e : equivalence classes\n");
X+ fprintf(stderr," F : fast table\n");
X+ fprintf(stderr," |f : full table\n");
X+ fprintf(stderr," |m : meta equivalence classes\n");
X+ fprintf(stderr," - d : generate debugging scanner\n");
X+ fprintf(stderr," - F : fast table\n");
X+ fprintf(stderr," - f : full (not compressed) table\n");
X+ fprintf(stderr," - I : generate interactive scanner\n");
X+ fprintf(stderr," - i : generate case-insensitive scanner\n");
X+ fprintf(stderr," - L : supress #line directives\n");
X+ /* fprintf(stderr," - n hexnum : generate scanner using <hexnum> as newline char.\n");*/
X+ fprintf(stderr," - p : generate performance report to stderr\n");
X+ fprintf(stderr," - S skeleton_path : file path for skeleton file\n");
X+ fprintf(stderr," - s : suppress echo of unmatched scanner input to stdout\n");
X+ fprintf(stderr," - T : run flex in trace mode\n");
X+ #ifdef ATARI
X+ fprintf(stderr," - t : place result on stdout instead of lex_yy.c\n");
X+ #else
X+ fprintf(stderr," - t : place result on stdout instead of lex.yy.c\n");
X+ #endif
X+ fprintf(stderr," - v : print statistics of generated scanner\n");
X+ fprintf(stderr," default = -cem\n");
X+ exit(status);
X+ }
X+
X /* readin - read in the rules section of the input file(s)
X *
X * synopsis
/
echo x - scan.l_cdiff
sed '/^X/s///' > scan.l_cdiff << '/'
X*** Src_2.1/scan.l Thu Jun 30 19:42:00 1989
X--- scan.l Thu Jul 2 22:19:26 1989
X***************
X*** 125,132 ****
X
X {SCNAME} RETURNNAME;
X ^{OPTWS}\n ++linenum; /* allows blank lines in section 1 */
X! \n ++linenum; return ( '\n' );
X! . synerr( "illegal character" ); BEGIN(RECOVER);
X
X
X <C_COMMENT>"*/" ECHO; BEGIN(0);
X--- 125,136 ----
X
X {SCNAME} RETURNNAME;
X ^{OPTWS}\n ++linenum; /* allows blank lines in section 1 */
X! {OPTWS}\n ++linenum; return ( '\n' );
X! . {
X! synerr( "illegal character" );
X! fprintf(stderr,"Char : $%x\n",yytext[yyleng-1]);
X! BEGIN(RECOVER);
X! }
X
X
X <C_COMMENT>"*/" ECHO; BEGIN(0);
X***************
X*** 206,212 ****
X <SECT2>^{OPTWS}\n ++linenum; /* allow blank lines in section 2 */
X
X /* this horrible mess of a rule matches indented lines which
X! * do not contain "/*". We need to make the distinction because
X * otherwise this rule will be taken instead of the rule which
X * matches the beginning of comments like this one
X */
X--- 210,216 ----
X <SECT2>^{OPTWS}\n ++linenum; /* allow blank lines in section 2 */
X
X /* this horrible mess of a rule matches indented lines which
X! * do not contain '/','*'. We need to make the distinction because
X * otherwise this rule will be taken instead of the rule which
X * matches the beginning of comments like this one
X */
/
echo x - Makefile.tos
sed '/^X/s///' > Makefile.tos << '/'
X# make file for "flex" tool
X
X# @(#) $Header$ (LBL)
X
X# Porting considerations:
X#
X# For System V Unix machines, add -DSYS_V to CFLAGS.
X# For Vax/VMS, add -DSYS_V to CFLAGS.
X# For MS-DOS, add "-DMS_DOS -DSYS_V" to CFLAGS. Create \tmp if not present.
X# You will also want to rename flex.skel to something with a three
X# character extension, change SKELETON_FILE below appropriately,
X# For Amiga, add "-DAMIGA -DSYS_V" to CFLAGS.
X#
X# A long time ago, flex was successfully built using Microsoft C and
X# the following options: /AL, /stack:10000, -LARGE, -Ml, -Mt128, -DSYS_V
X
X
X# the first time around use "make first_flex"
X
X# The following definitions must be set according to your compiler -
X# examples for a Lattice Compiler with GST assembler and TURBO C with
X# assembler are provided below and must just be updated (don't forget to
X# update the linker argument extension files (*.lnk,*.tlk), too) :
X#
X#CCPATH = path to compiler directory without trailing \
X#CHPATH = path to header files without trailing \
X#CC = filename of the compiler
X#CFLAGS = compiler option flags
X#CIEXT = extension of C sources that should be used for input filenames
X#ASMPATH = path to assembler directory without trailing \
X#ASM = filename of the assembler
X#AFLAGS = assembler option flags
X#AIEXT = extension of assembler sources that should be used for assembler
X# input filenames
X#AEXT = general assembler filename extension
X#LNKPATH = path to linker directory without trailing \
X#LINK = filename of the linker
X#LFLAG0 = first option (full pathname of C startupcode)
X#LFLAG1 = further options + option flag for argument extension filename
X#LFLAG2 = further options + option flag for output-filename
X#LNKEXT = extension of linker argument extension file
X#OIEXT = extension of objects that should be used for linker input files
X#OEXT = general object file extension
X
X# Lattice definitions
XCCPATH = d:\latt
XCHPATH = d:\latt\include
XCC = lc.ttp
XCFLAGS = -h -n -cw -cc -i$(CHPATH)\ -g$(CCPATH)\ -dLATTICE -dATARI
XCIEXT =
XASMPATH = d:\gst
XASM = assem.ttp
XAFLAGS = -nolist -errors errors.out
XAIEXT =
XAEXT = .asm
XLNKPATH = d:\gst
XLINK = ld.ttp
XLFLAG0 =
XLFLAG1 = -with
XLFLAG2 = -nolist -sec -mem 200 -prog
XLNKEXT = .lnk
XOIEXT =
XOEXT = .bin
X
X# Turbo definitions
X#CCPATH = d:\turbo
X#CHPATH = d:\turbo\include
X#CC = tcc.prg
X#CFLAGS = -GJMPRZ -H=$(CHPATH)\ -w- -DTURBO -DATARI
X#CIEXT = .c
X#ASMPATH = d:\turbo
X#ASM = mas.prg
X#AFLAGS =
X#AIEXT = .s
X#AEXT = .s
X#LNKPATH = d:\turbo
X#LINK = tlink.ttp
X#LFLAG0 = $(LNKPATH)\lib\tcstart.o
X#LFLAG1 = -I=
X#LFLAG2 = -O=
X#LNKEXT = .tlk
X#OIEXT = .o
X#OEXT = .o
X
X# Other definitions
X# (not used for Atari because of short argument string - defined in flexdef.h
X
XSKELETON_DIR = /usr/lib
XSKELETON_FILE = flex.skel
XSKELFLAGS = -DDEFAULT_SKELETON_FILE=\"$(SKELETON_DIR)/$(SKELETON_FILE)\"
X
X
XFLEX = d:\etc\flex.ttp
XFLEX_FLAGS = -is
XYACC = d:\etc\yacc.ttp
XRENAME = d:\bin\rename
XDEL = d:\bin\del
X
X# Internal definitions
XLNK = $(LNKPATH)\$(LINK)
X
XFLEXOBJS = \
X ccl$(OEXT) \
X dfa$(OEXT) \
X ecs$(OEXT) \
X gen$(OEXT) \
X main$(OEXT) \
X misc$(OEXT) \
X nfa$(OEXT) \
X parse$(OEXT) \
X scan$(OEXT) \
X sym$(OEXT) \
X tblcmp$(OEXT) \
X yylex$(OEXT)
X
XFLEX_C_SOURCES = \
X ccl.c \
X dfa.c \
X ecs.c \
X gen.c \
X main.c \
X misc.c \
X nfa.c \
X parse.c \
X scan.c \
X sym.c \
X tblcmp.c \
X yylex.c
X
Xflex : $(FLEXOBJS)
X $(LNK) $(LFLAG0) $(LFLAG1)flex$(LNKEXT) $(LFLAG2)flex.ttp
X
Xfirst_flex:
X cp initscan.c scan.c
X make $(MFLAGS) flex
X
Xparse.h parse.c : parse.y
X $(YACC) -d parse.y
X $(DEL) parse.c
X $(RENAME) y_tab.c parse.c
X $(DEL) parse.h
X $(RENAME) y_tab.h parse.h
X
Xscan.c : scan.l
X $(FLEX) $(FLEX_FLAGS) scan.l
X $(RENAME) lex_yy.c scan.c
X
Xscan$(OEXT) : scan.c parse.h flexdef.h
X $(CCPATH)\$(CC) $(CFLAGS) scan$(CIEXT)
X
Xmain$(OEXT) : main.c flexdef.h
X $(CCPATH)\$(CC) $(CFLAGS) main$(CIEXT)
X
Xccl$(OEXT) : ccl.c flexdef.h
X $(CCPATH)\$(CC) $(CFLAGS) ccl$(CIEXT)
X
Xdfa$(OEXT) : dfa.c flexdef.h
X $(CCPATH)\$(CC) $(CFLAGS) dfa$(CIEXT)
X
Xecs$(OEXT) : ecs.c flexdef.h
X $(CCPATH)\$(CC) $(CFLAGS) ecs$(CIEXT)
X
Xgen$(OEXT) : gen.c flexdef.h
X $(CCPATH)\$(CC) $(CFLAGS) gen$(CIEXT)
X
Xmisc$(OEXT) : misc.c flexdef.h
X $(CCPATH)\$(CC) $(CFLAGS) misc$(CIEXT)
X
Xnfa$(OEXT) : nfa.c flexdef.h
X $(CCPATH)\$(CC) $(CFLAGS) nfa$(CIEXT)
X
Xparse$(OEXT) : parse.c flexdef.h
X $(CCPATH)\$(CC) $(CFLAGS) parse$(CIEXT)
X
Xsym$(OEXT) : sym.c flexdef.h
X $(CCPATH)\$(CC) $(CFLAGS) sym$(CIEXT)
X
Xtblcmp$(OEXT) : tblcmp.c flexdef.h
X $(CCPATH)\$(CC) $(CFLAGS) tblcmp$(CIEXT)
X
Xyylex$(OEXT) : yylex.c flexdef.h
X $(CCPATH)\$(CC) $(CFLAGS) yylex$(CIEXT)
X
Xflex.man : flex.1
X nroff -man flex.1 >flex.man
X
Xlint : $(FLEX_C_SOURCES)
X lint $(FLEX_C_SOURCES) > flex.lint
X
Xdistrib :
X mv scan.c initscan.c
X chmod 444 initscan.c
X $(MAKE) $(MFLAGS) clean
X
Xclean :
X rm -f core errs flex *$(OEXT) parse.c *.lint parse.h flex.man tags
X
Xtags :
X ctags $(FLEX_C_SOURCES)
X
Xvms : flex.man
X $(MAKE) $(MFLAGS) distrib
X
Xtest :
X $(FLEX) $(FLEX_FLAGS) scan.l
X $(RENAME) lex_yy.c scan.ctest
X cmp scan.c scan.ctest
X
/
echo x - Readme2
sed '/^X/s///' > Readme2 << '/'
XThe changes: (1.7.89 RAL)
X
X - Bug fix: The original flex didn't like trailing spaces in exclusive start
X condition lists ! If you add an trailing space to line 68 in scan.l
X
X "%x SECT2 SECT2PROLOG SECT3 CODEBLOCK PICKUPDEF SC CARETISBOL NUM QUOTE "
X
X you get a misleading error message:
X
X "Syntax error at line 69: bad start condition list"
X
X This bug can either be fixed in parse.y or in scan.l . I have chosen the
X last because there the fix is minimal: Just change the rule (line 128)
X
X "\n" to "{OPTWS}\n"
X
X - Enhancements:
X - new option "-?" that provides some help information about the other
X flags (main.c)
X - new option "-aTMPPATH" that allows a redefinition of the standard
X path for the temporary file (this might be rather large >200k if
X F,f options are selected). (main.c, flexdef.h (l.376))
X - hexdump of illegal characters -- this proved to be a useful debugging
X tool especialy if invisible control characters occur which weren't
X covered by the rules. (scan.l fprintf statement line 129,...)
X
X - Patches due to TOS
X - General: TOS uses CR,LF as end of line char., Flex wants only a single
X LF as EOL char. Therefore all I/O must be translated using f* calls.
X This is done everywhere besides the YY_INPUT macro (flex.skel (scan.c),
X line 31) that uses a low level 'read'. This should be definitly changed
X to fread, so that all I/O calls occur on the same level.
X - the short action_file_name has been "flexXXXXXX.tmp", but that's too
X much for TOS,MSDOS ! I changed it to "flexXXXX.tmp" in main.c (patch
X covered by the -a option additions)
X - some compilers don't like external names that are ambiguous within
X the first 8 characters. I defined macros that change all these long
X external names to names that are unique within the first 8 characters.
X Just define SHORT_EXTERNAL_NAMES to use this feature (flexdef.h)
X - some statement changes that some compiler don't like:
X typedef *xxx[] -> typedef **xxx (flexdef.h.,l.308)
X "/*" -> '/','*' within a comment in (scan.l, l.209)
X - changed short "lexyy.c" to "lex_yy.c" what's more similar to the unix
X "lex.yy.c" (main.c).
X - a few further really compiler dependent changes provided with
X #ifdef ATARI && LATTICE res. TURBO braces.
X
X - Additional TOS only files
X - Makefile.tos: Common makefile for all TOS compilers. If you add further
X ones please email me the new makefile.
X - flex.lnk: Lattice - GST linker argument extension file
X - flex.tlk: Turbo linker argument extension file
X
X
XAdditional remarks:
X
XI didn't add a new initscan.c (= flex -ist scan.l). The current one is good
Xenough for a first compilation. With this first version of flex you can
Xrebuild your own scan.c and the final flex version !
X
XMinix ST :
X - I had to "chmem =70000 cv" (>50000) to get flex linked
X - 'memset' (PC 1.3, EFTH40,...) is necessary
X - chmem =90000 flex may be sufficient
X
XMinix PC :
X It should be possible to port Flex to Minix PC. The current sizes of flex
X are:
X Minix ST (ACK) Lattice (TOS) Turbo (TOS)
X
X size 75300 83305 57957
X compilation time 22' 15' 3'40"
X flex -is scan.l 1'49" 43" 30"
X
X The Minix ST size includes the bad generated code using only a subset of
X the 68000 commands, long addresses only and a huge relocation table.
X Therefore the PC size will be <64 k ! More serious is the fact that I had
X to chmem =90000 flex to get scan.l converted to scan.c . But I never saw
X a more complex lex source than scan.l -- so it should be possible to
X reduce some array sizes without limitation for all day usage.
X
X No one volunteered yet for a Minix PC port -- but if someone will try it
X I would provide him with a new scan.c and some hints.
X
XTOS:
X Don't forget to adapt the flexskel path within flexdef.h !
X
X
/
echo x - flex.lnk
sed '/^X/s///' > flex.lnk << '/'
X*
X*
X* linker control file for flex.ttp
X*
X*
X*
XINPUT d:\latt\lib\startup.bin
X*
XINPUT ccl.bin
XINPUT dfa.bin
XINPUT ecs.bin
XINPUT gen.bin
XINPUT misc.bin
XINPUT nfa.bin
XINPUT parse.bin
XINPUT sym.bin
XINPUT tblcmp.bin
XINPUT main.bin
XINPUT yylex.bin
XINPUT scan.bin
X*
XLIBRARY d:\latt\lib\clib.bin
X
/
echo x - flex.tlk
sed '/^X/s///' > flex.tlk << '/'
Xccl.o
Xdfa.o
Xecs.o
Xgen.o
Xmisc.o
Xnfa.o
Xparse.o
Xsym.o
Xtblcmp.o
Xyylex.o
Xmain.o
Xscan.o
Xd:\turbo\lib\tcstdlib.lib ; standard lib
Xd:\turbo\lib\tcextlib.lib ; extended lib
Xd:\turbo\lib\tctoslib.lib ; TOS lib
Xd:\turbo\lib\tcgemlib.lib ; AES and VDI lib
X-S=200000
/

View File

@@ -1,419 +0,0 @@
Received: from 128.140.1.1 by ee.lbl.gov for <vern@ee.lbl.gov> (8.6.9/1.43r)
id HAA01193; Thu, 29 Sep 1994 07:26:54 -0700
Received: from larry-le0.cc.emory.edu by
emoryu1.cc.emory.edu (5.65/Emory_cc.4.0.1) via SMTP
id AA07292 ; Thu, 29 Sep 94 10:26:41 -0400
From: tkane01@unix.cc.emory.edu (Terrence O Kane)
Received: by larry.cc.emory.edu (5.0) id AA11757; Thu, 29 Sep 1994 10:26:43 +0500
Message-Id: <9409291426.AA11757@larry.cc.emory.edu>
Subject: patches and makefile for Borland C 4.02, flex 2.4.7
To: vern@ee.lbl.gov
Date: Thu, 29 Sep 1994 10:26:42 -0400 (EDT)
X-Mailer: ELM [version 2.4 PL23]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Length: 9900
Enclosed are unified diffs and a makefile for Borland 4.02
The changes in the enclosed are 1) make the size parameters for memory
allocation "size_t", 2) change an include file when the lexer is
compiled within 'extern "C" {...}' in a C++ file, and 3) include pragmas
in the header suitable for BCC 4.02 to hush on warnings.
The latter is done because of the limit on command line size. A tradeoff
exists between putting pragmas in the header, or #defines in the header -
I put in the pragmas since they're suppoed to be ignored unless
understood - *and* they're enclosed in BCC specific ifdefs, anyway.
All changes are enclosed in "#ifdef __BORLANDC__".
--- misc.c Tue Jan 04 14:33:10 1994
+++ ../misc.c Wed Sep 28 18:44:32 1994
@@ -55,15 +55,19 @@
action_index += len;
}
/* allocate_array - allocate memory for an integer array of the given size */
void *allocate_array( size, element_size )
+#ifndef __BORLANDC__
int size, element_size;
+#else /* __BORLANDC__ */
+size_t size, element_size;
+#endif /* __BORLANDC__ */
{
register void *mem;
/* On 16-bit int machines (e.g., 80286) we might be trying to
* allocate more than a signed int can hold, and that won't
* work. Cheap test:
*/
@@ -634,15 +638,19 @@
}
/* reallocate_array - increase the size of a dynamic array */
void *reallocate_array( array, size, element_size )
void *array;
+#ifndef __BORLANDC__
int size, element_size;
+#else /* __BORLANDC__ */
+size_t size, element_size;
+#endif /* __BORLANDC__ */
{
register void *new_array;
/* Same worry as in allocate_array(): */
if ( size * element_size <= 0 )
flexfatal(
"attempt to increase array size by less than 1 byte" );
@@ -739,15 +747,19 @@
}
/* The following is only needed when building flex's parser using certain
* broken versions of bison.
*/
void *yy_flex_xmalloc( size )
+#ifndef __BORLANDC__
int size;
+#else /* __BORLANDC__ */
+size_t size;
+#endif /* __BORLANDC__ */
{
void *result = flex_alloc( size );
if ( ! result )
flexfatal( "memory allocation failed in yy_flex_xmalloc()" );
return result;
--- skel.c Wed Aug 03 11:38:32 1994
+++ ../skel.c Wed Sep 28 18:50:58 1994
@@ -26,15 +26,19 @@
"",
"#ifdef __cplusplus",
"",
"#include <stdlib.h>",
"%+",
"class istream;",
"%*",
+ "#ifndef __BORLANDC__",
"#include <unistd.h>",
+ "#else /* __BORLANDC__ */",
+ "#include <io.h>",
+ "#endif /* __BORLANDC__ */",
"",
"/* Use prototypes in function declarations. */",
"#define YY_USE_PROTOS",
"",
"/* The \"const\" storage-class-modifier is valid. */",
"#define YY_USE_CONST",
"",
@@ -240,16 +244,21 @@
"static int yy_start_stack_depth = 0;",
"static int *yy_start_stack = 0;",
"static void yy_push_state YY_PROTO(( int new_state ));",
"static void yy_pop_state YY_PROTO(( void ));",
"static int yy_top_state YY_PROTO(( void ));",
"%*",
"",
+ "#ifndef __BORLANDC__",
"static void *yy_flex_alloc YY_PROTO(( unsigned int ));",
"static void *yy_flex_realloc YY_PROTO(( void *, unsigned int ));",
+ "#else /* __BORLANDC__ */",
+ "static void *yy_flex_alloc YY_PROTO(( size_t ));",
+ "static void *yy_flex_realloc YY_PROTO(( void *, size_t ));",
+ "#endif /* __BORLANDC__ */",
"static void yy_flex_free YY_PROTO(( void * ));",
"",
"#define yy_new_buffer yy_create_buffer",
"",
"%% yytext/yyin/yyout/yy_state_type/yylineno etc. def's & init go here",
"",
"#ifndef yytext_ptr",
--- initscan.c Wed Aug 03 11:42:46 1994
+++ ../initscan.c Wed Sep 28 18:51:34 1994
@@ -16,15 +16,19 @@
#endif
#endif
#ifdef __cplusplus
#include <stdlib.h>
+#ifndef __BORLANDC__
#include <unistd.h>
+#else /* __BORLANDC__ */
+#include <io.h>
+#endif /* __BORLANDC__ */
/* Use prototypes in function declarations. */
#define YY_USE_PROTOS
/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST
@@ -220,16 +224,21 @@
static int yy_start_stack_ptr = 0;
static int yy_start_stack_depth = 0;
static int *yy_start_stack = 0;
static void yy_push_state YY_PROTO(( int new_state ));
static void yy_pop_state YY_PROTO(( void ));
static int yy_top_state YY_PROTO(( void ));
+#ifndef __BORLANDC__
static void *yy_flex_alloc YY_PROTO(( unsigned int ));
static void *yy_flex_realloc YY_PROTO(( void *, unsigned int ));
+#else /* __BORLANDC__ */
+static void *yy_flex_alloc YY_PROTO(( size_t ));
+static void *yy_flex_realloc YY_PROTO(( void *, size_t ));
+#endif /* __BORLANDC__ */
static void yy_flex_free YY_PROTO(( void * ));
#define yy_new_buffer yy_create_buffer
#define INITIAL 0
#define SECT2 1
#define SECT2PROLOG 2
--- flexdef.h Tue Jan 04 14:33:14 1994
+++ ../flexdef.h Wed Sep 28 18:53:44 1994
@@ -27,14 +27,25 @@
*/
/* @(#) $Header$ (LBL) */
#include <stdio.h>
#include <ctype.h>
+#ifdef __BORLANDC__
+#include <malloc.h>
+
+#pragma warn -pro
+#pragma warn -rch
+#pragma warn -use
+#pragma warn -aus
+#pragma warn -par
+#pragma warn -pia
+
+#endif /* __BORLANDC__ */
#if HAVE_STRING_H
#include <string.h>
#else
#include <strings.h>
#endif
#if __STDC__
@@ -607,19 +618,29 @@
*/
extern char nmstr[MAXLINE];
extern int sectnum, nummt, hshcol, dfaeql, numeps, eps2, num_reallocs;
extern int tmpuses, totnst, peakpairs, numuniq, numdup, hshsave;
extern int num_backing_up, bol_needed;
+#ifndef __BORLANDC__
void *allocate_array PROTO((int, int));
void *reallocate_array PROTO((void*, int, int));
+#else /* __BORLANDC__ */
+void *allocate_array PROTO((size_t, size_t));
+void *reallocate_array PROTO((void*, size_t, size_t));
+#endif /* __BORLANDC__ */
+#ifndef __BORLANDC__
void *flex_alloc PROTO((unsigned int));
void *flex_realloc PROTO((void*, unsigned int));
+#else /* __BORLANDC__ */
+void *flex_alloc PROTO((size_t));
+void *flex_realloc PROTO((void*, size_t));
+#endif /* __BORLANDC__ */
void flex_free PROTO((void*));
#define allocate_integer_array(size) \
(int *) allocate_array( size, sizeof( int ) )
#define reallocate_integer_array(array,size) \
(int *) reallocate_array( (void *) array, size, sizeof( int ) )
@@ -772,15 +793,19 @@
/* Write out one section of the skeleton file. */
extern void skelout PROTO((void));
/* Output a yy_trans_info structure. */
extern void transition_struct_out PROTO((int, int));
/* Only needed when using certain broken versions of bison to build parse.c. */
+#ifndef __BORLANDC__
extern void *yy_flex_xmalloc PROTO(( int ));
+#else /* __BORLANDC__ */
+extern void *yy_flex_xmalloc PROTO(( size_t ));
+#endif /* __BORLANDC__ */
/* Set a region of memory to 0. */
extern void zero_out PROTO((char *, int));
/* from file nfa.c */
###############################################################################
# Makefile for flex 2.4.7 with Borland C/C++ version 4.02
#
# This will probably need to be adjusted for your existing lexer/parser
# generators. See definitions for FLEX and YACC near the bottom of the
# makefile.
#
# Copy initscan.c to scan.c to make your first executable. After that,
# you may choose to try alternate compression options for your everyday
# flex executable.
#
# This will build flex with the large model. Don't use huge, but if you
# feel like experimenting with other models, post your success stories to
# comp.compilers, OK?
#
# This makefile does *not* implement the big testing found in "makefile.in".
#
# I also assume the availability of sed and the gnu file utilities on the
# system - they're readily available, so if you don't have them, why not?
# <grin>
#
# The resulting generated lexer (the real goal, right?) will compile
# (and run nicely, too) as a .c file, as well as being included such as
# extern "C" { #include "lexyyc" } in a .cplusplus file.
#
###############################################################################
DEBUG = 1
.autodepend
all: flex.exe
###############################################################################
#
# standard utilitities? ha.
#
CC = bcc
CPP = bcc
###############################################################################
#
MODEL = l
!if $(DEBUG) == 1
!message Building with debug.
debugCompile = -v
debugLink = /v
!else
!message Building without debug.
debugCompile =
debugLink =
!endif
LOADER = c0$(MODEL).obj
LIBS = c$(MODEL).lib
LINKFLAGS = $(debugLink)
DATASEG = -dc -Ff
SizeOPT = -Os -G-
Defines = -DSHORT_FILE_NAMES=1 -DHAVE_STRING_H=1
COMMON = -A -c -m$(MODEL) $(SizeOPT) $(DATASEG) $(Defines) $(debugCompile)
CFLAGS = -o$@ $(COMMON)
CCFLAGS = -o$@ $(COMMON) -Pcc
###############################################################################
.SUFFIXES: .cc
.cc.obj:
$(CPP) $(CCFLAGS) $<
.c.obj:
$(CPP) $(CFLAGS) $<
###############################################################################
#
# source & object files
#
SRC = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.c \
scan.c sym.c tblcmp.c yylex.c skel.c
OBJS = $(SRC:.c=.obj)
objects: $(OBJS)
@echo $(OBJS)
###############################################################################
#
# Executable
#
flex.exe: $(OBJS)
tlink $(LINKFLAGS) @&&!
$(LOADER) $**
$&.exe
$&.map
$(LIBS)
!
#
###############################################################################
#
# Lex files
#
FLEX = .\flex
FLEX_FLAGS = -ist
scan.c: scan.l
$(FLEX) $(FLEX_FLAGS) scan.l >scan.tmp
sed s,\"$(srcdir)/scan.l\",\"scan.l\", <scan.tmp >scan.c
@rm scan.tmp
###############################################################################
#
# YACC files
#
YACC = .\bison
YFLAGS = -vdyl
parse.c: parse.y
$(YACC) -ydl parse.y
@sed "/extern char.*malloc/d" <y_tab.c >parse.c
@rm -f y_tab.c
@mv y_tab.h parse.h
#
# end Makefile
#
###############################################################################

View File

@@ -1,179 +0,0 @@
Received: from 128.84.254.220 by ee.lbl.gov for <vern@ee.lbl.gov> (8.6.8.1/1.43r)
id PAA27266; Mon, 18 Apr 1994 15:08:26 -0700
Received: from CLOYD.CS.CORNELL.EDU by thialfi.cs.cornell.edu (5.67/I-1.99E)
id AA28742; Mon, 18 Apr 94 18:08:14 -0400
Received: from iraun1.ira.uka.de by cloyd.cs.cornell.edu (5.67/I-1.99D)
id AA19613; Mon, 18 Apr 94 18:08:19 -0400
Received: from t500i2.telematik.informatik. (actually t500i2.telematik.informatik.uni-karlsruhe.de)
by iraun1.ira.uka.de with SMTP (PP); Tue, 19 Apr 1994 00:07:55 +0200
Received: by t500i2.telematik.informatik.uni-karlsruhe.de (5.57/Ultrix3.0-C)
id AA10269; Tue, 19 Apr 94 00:09:14 +0200
From: beigl@t500i2.telematik.informatik.uni-karlsruhe.de (Michael Beigl)
Message-Id: <9404182209.AA10269@t500i2.telematik.informatik.uni-karlsruhe.de>
Subject: Makefile-TurboC
To: vern@cs.cornell.edu
Date: Tue, 19 Apr 1994 00:09:13 +0200 (MET DST)
X-Mailer: ELM [version 2.4 PL22]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Length: 2739
Hello
Here are some additional adjustments to my Makefile. I was using "pure" DOS
and an old Turbo C++ 1.0 version, so I had some problems with systemtools
like mv etc. and problems with variables in my Makefile.
Now follows my Makefile
############################################################################
# make file for "flex" tool
# @(#) $Header$ (LBL)
# Porting considerations:
#
# For BSD machines:
# CFLAGS =
# LDFLAGS = -s
# LINK = $(CC) $(CFLAGS) -o flex $(LDFLAGS) $(FLEXOBJS)
# SKELETON_DIR = .
# SKELETON_FILE = flex.skel
# SKELFLAGS = -DDEFAULT_SKELETON_FILE=\"$(SKELETON_DIR)/$(SKELETON_FILE)\"
# O = o
# YTAB = y.tab
# FLEX = ./flex
#
# For System V Unix or Vax/VMS machines, merely add:
# CFLAGS = -DSYS_V
#
# For MS-DOS, Turbo C:
CC = tcc
# -2+ 286 Options
CFLAGS = -DSYS_V -DMS_DOS -O -G -Z -ml -v -2
# /3 enable 32 bit processing
# /ye expanded memory swapping
# /yx extended memory swapping
LINK = tlink @flex.lnk/c/x/v/3/ye
SKELETON_DIR = .
SKELETON_FILE = flex.skl
SKELFLAGS = -DDEFAULT_SKELETON_FILE="$(SKELETON_DIR)/$(SKELETON_FILE)"
O = obj
EXE = .exe
YTAB = y_tab
FLEX = flex
YACC = /yacc/byacc
#
# the first time around use "make first_flex"
#
FLEX_FLAGS =
FLEXOBJS = \
ccl.$O \
dfa.$O \
ecs.$O \
gen.$O \
main.$O \
misc.$O \
nfa.$O \
parse.$O \
scan.$O \
sym.$O \
tblcmp.$O \
yylex.$O
FLEX_C_SOURCES = \
ccl.c \
dfa.c \
ecs.c \
gen.c \
main.c \
misc.c \
nfa.c \
parse.c \
scan.c \
sym.c \
tblcmp.c \
yylex.c
FLEX_C_SOURCES_1 = \
ccl.c \
dfa.c \
ecs.c \
gen.c \
main.c \
misc.c
FLEX_C_SOURCES_2 = \
nfa.c \
parse.c \
scan.c \
sym.c \
tblcmp.c \
yylex.c
flex.exe: $(FLEXOBJS)
$(LINK)
flex: $(FLEX_C_SOURCES)
$(CC) $(CFLAGS) -c $(SKELFLAGS) $(FLEX_C_SOURCES_1)
$(CC) $(CFLAGS) -c $(SKELFLAGS) $(FLEX_C_SOURCES_2)
$(LINK)
first_flex:
copy initscan.c scan.c
$(MAKE) flex
parse.h parse.c: parse.y
$(YACC) -d parse.y
@rename $(YTAB).c parse.c
@rename $(YTAB).h parse.h
scan.c: scan.l
$(FLEX) -ist $(FLEX_FLAGS) scan.l >scan.c
scan.$O: scan.c parse.h
main.$O: main.c
$(CC) $(CFLAGS) -c $(SKELFLAGS) main.c
flex.man: flex.1
nroff -man flex.1 >flex.man
lint: $(FLEX_C_SOURCES)
lint $(FLEX_C_SOURCES) > flex.lint
distrib:
rename scan.c initscan.c
attrib +R -A -H -S initscan.c
$(MAKE) clean
clean:
del *.obj
del *.lint
del core
del errs
del flex.exe
del parse.c
del parse.h
del flex.man
del tags
tags:
ctags $(FLEX_C_SOURCES)
vms: flex.man
$(MAKE) distrib
test:
$(FLEX) -ist $(FLEX_FLAGS) scan.l | diff scan.c -
############################################################################
I think this Makefile will help some other simple DOS user
M. Beigl

View File

@@ -1,163 +0,0 @@
###############################################################################
# Makefile for flex 2.5.0.6 (beta) with Borland C/C++ version 4.02
#
# This will probably need to be adjusted for your existing lexer/parser
# generators. See definitions for FLEX and YACC near the bottom of the
# makefile.
#
# This makefile builds initflex.exe and flex.exe by default. It
# removes initflex.exe after making flex.exe. After that, you may
# choose to try alternate compression options for your everyday flex
# executable.
#
# This will build flex with the large model. Don't use huge, but if you
# feel like experimenting with other models, post your success stories to
# comp.compilers, OK?
#
# This makefile does *not* implement the big testing found in "makefile.in".
#
# I also assume the availability of sed and the gnu file utilities on the
# system - they're readily available, so if you don't have them, why not?
# <grin>
#
# The resulting generated lexer (the real goal, right?) will compile
# (and run nicely, too) as a .c file, as well as being included such as
# extern "C" { #include "lexyyc" } in a .cplusplus file.
#
###############################################################################
DEBUG = 1
.autodepend
all: initflex.exe flex.exe
rm initflex.exe initflex.map
###############################################################################
#
# standard utilitities? ha.
#
CC = bcc
CPP = bcc
###############################################################################
#
MODEL = l
!if $(DEBUG) == 1
!message Building with debug.
debugCompile = -v
debugLink = /v
!else
!message Building without debug.
debugCompile =
debugLink =
!endif
LOADER = c0$(MODEL).obj
LIBS = c$(MODEL).lib
LINKFLAGS = $(debugLink)
DATASEG = -dc -Ff
SizeOPT = -Os -G-
Defines =
COMMON = -A -c -m$(MODEL) $(SizeOPT) $(DATASEG) $(Defines) $(debugCompile)
CFLAGS = -o$@ $(COMMON)
CCFLAGS = -o$@ $(COMMON) -Pcc
###############################################################################
.SUFFIXES: .cc
.cc.obj:
$(CPP) $(CCFLAGS) $<
.c.obj:
$(CPP) $(CFLAGS) $<
###############################################################################
#
# source & object files
#
BASESRC = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.c \
sym.c tblcmp.c yylex.c skel.c
INITSRC = $(BASESRC) initscan.c
INITOBJS = $(INITSRC:.c=.obj)
SRC = $(BASESRC) scan.c
OBJS = $(SRC:.c=.obj)
objects: $(OBJS)
@echo $(OBJS)
###############################################################################
#
# Executable
#
initflex.exe: $(INITOBJS)
tlink $(LINKFLAGS) @&&!
$(LOADER) $**
$&.exe
$(LIBS)
!
flex.exe: $(OBJS)
tlink $(LINKFLAGS) @&&!
$(LOADER) $**
$&.exe
$(LIBS)
!
#
###############################################################################
#
# Lex files
#
FLEX = .\initflex
FLEX_FLAGS = -ist
scan.c: scan.l
$(FLEX) $(FLEX_FLAGS) scan.l >scan.tmp
sed s,\"$(srcdir)/scan.l\",\"scan.l\", <scan.tmp >scan.c
@rm scan.tmp
###############################################################################
#
# YACC files
#
YACC = .\bison
YFLAGS = -vdyl
parse.c: parse.y
$(YACC) -ydl parse.y
@sed "/extern char.*malloc/d" <y_tab.c >parse.c
@rm -f y_tab.c
@mv y_tab.h parse.h
###############################################################################
#
# cleanup
#
clean:
-rm *.obj *.map initflex.exe
realclean: clean
-rm flex.exe
#
# end Makefile
#
###############################################################################

View File

@@ -1,66 +0,0 @@
Received: from 128.140.1.1 by ee.lbl.gov for <vern@ee.lbl.gov> (8.6.9/1.43r)
id PAA03966; Tue, 24 Jan 1995 15:03:57 -0800
Received: from larry-le0.cc.emory.edu by
emoryu1.cc.emory.edu (5.65/Emory_cc.4.0.1) via SMTP
id AA24158 ; Tue, 24 Jan 95 17:18:18 -0500
From: tkane01@unix.cc.emory.edu (Terrence O Kane)
Received: by larry.cc.emory.edu (5.0) id AA21979; Tue, 24 Jan 1995 17:17:40 -0500
Message-Id: <9501242217.AA21979@larry.cc.emory.edu>
Subject: Re: Beta test for DOS
To: vern@ee.lbl.gov (Vern Paxson)
Date: Tue, 24 Jan 1995 17:17:38 -0500 (EST)
In-Reply-To: <199501232138.NAA11430@daffy.ee.lbl.gov> from "Vern Paxson" at Jan 23, 95 01:38:02 pm
X-Mailer: ELM [version 2.4 PL23]
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Length: 5792
Vern,
I've made flex 2.5.0.6 successfully with no changes to the source
code at all. I'm including the Borland 4.02 makefile and config.h
at the end of this message.
When you're ready for release, I'll be happy to take care of getting
the appropriate archive files up to Simtel if you wish.
I have not used this version for any of my "work-related" scanners
yet, but have run the fastwc benchmark. The compiles were for large
memory model and optimization for fastest possible code. The test
machine was a Pentium-90 (hey! timing output was integer!) with
enhanced IDE on a PCI bus and no file system caching. I ran the
test on two different input files.
(Times are in seconds.)
The first input was a typical postscript file concatenated 10 times;
by typical, I mean that there were relatively few spaces, lots of lines
with no space, using lots of parentheses.
lines words characters
91200 356260 5889240
mywc 8.89
wc1s 15.22 default
wc1 10.82 -Cf
wc2 10.16 -Cf
wc3 9.17 -Cf
wc4 9.22 -Cf
wc5 10.98 -Cf
The second test run was on a file that consisted of 20 concatenations
of 'misc/flex.man'.
lines words characters
69960 305140 2399960
mywc 4.01
wc1s 6.87
wc1 5.32
wc2 4.95
wc3 4.12
wc4 4.12
wc5 5.05
[[Makefile and config.h moved to separate files -VP]]

View File

@@ -1,29 +0,0 @@
/* $Header$ */
/* ------------------------------------------------ */
/* version of config.h for Borland C/C++ v4.02 */
/* flex version 2.5.0.6 (beta) */
/* ------------------------------------------------ */
/* Define to empty if the keyword does not work. */
#undef const
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1
/* Define if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H
/* Define if platform-specific command line handling is necessary. */
#undef NEED_ARGV_FIXUP

View File

@@ -1,48 +0,0 @@
Return-Path: Mark_Ganter@liz.com
Received: from 192.216.61.11 by horse.ee.lbl.gov for vern (5.65/1.43r)
id AA02152; Tue, 11 Jan 94 06:19:36 -0800
Received: from melonville.radiomail.net (mayberry.radiomail.net) by radiomail.net with SMTP id AA20220
(5.65c+/IDA-1.4.4 for <vern@horse.ee.lbl.gov>); Tue, 11 Jan 1994 06:19:35 -0800
Message-Id: <199401111419.AA20220@radiomail.net>
Received: from liz.com by melonville.radiomail.net with CCGW-1.7(930217);
Tue, 11 Jan 94 06:19:17
From: Mark_Ganter@liz.com
Date: 11 Jan 94 09:05
To: vern@horse.ee.lbl.gov
Subject: Re[2]: Flex on an AS400
I have no problem at all with being a contact for advice
on porting Flex to EBCDIC. The code was put on an AS400, so
filing the message under /MISC/AS400 is more appropriate.
The port was an interesting, very educational experience.
Thanks again.
Mark
------------------------------------------------------------------------
Date: Tue, 18 Apr 1995 12:33:48 -0400
To: "Michael W. Duffy" <mduffy@netcom.com>, Mark_Ganter@liz.com,
vern@ee.lbl.gov (Vern Paxson), slayten@cas.org
From: slayten@cas.org (Steve Layten)
Subject: RE: Porting LEX scanner on EBCDIC machine
X-Mailer: <Windows Eudora Version 2.0.2>
Content-Length: 918
I came in late on this discussion - I don't follow comp.compilers very
closely these days because my job has shifted somewhat.
I ported (quite some time ago) flex 2.3.6 to an IBM 3090 under MVS, using
the SAS C compiler. The approach I used was, as Vern suggested, was to
translate the tables to reflect EBCDIC-based indices. I haven't even
downloaded flex 2.4 yet, so I don't know what's in the current distribution.
My patches were in the flex 2.3 distribution for a while in the MISC
directory. If you want any more info feel free to drop me a line - I still
have (somewhere) the patches that I created from version 2.3.6.
Steve Layten
--
Steven W. Layten, Senior Research Scientist
Chemical Abstracts Service PO BOX 3012, Columbus, OH 43210 +1 614 447 3600
INET: slayten@cas.org FAX: +1 614 447 3813
# # Speaking only for myself, and NOT for Chemical Abstracts Service! # # #

View File

@@ -1,115 +0,0 @@
#
# make file for "flex" tool
# @(#) $Header: /usr/fsys/odin/a/vern/flex/RCS/Makefile,v 2.9 90/05/26 17:28:44
vern Exp $ (LBL)
#
# the first time around use "make f_flex"
#
# This makefile is specific for Microsoft's C/C++ compiler (v7), nmake and
# lib
# - Paul Stuart, Jan 93 (pjs@scammell.ecos.tne.oz.au)
#
SKELFLAGS = -DDEFAULT_SKELETON_FILE=\"c:/src/flex/flex.skl\"
CFLAGS = -nologo -AL -W2 -F 8000 -Ox -Gt16000 -DMS_DOS -DUSG
LDFLAGS = /nologo /NOI /BATCH /ONERROR:NOEXE /STACK:8000
FLEX_FLAGS = -ist8 -Sflex.skl
FLEX = .\flex.exe
CC = cl
YACC = c:\lib\byacc
MAKE = nmake /nologo
#
# break obj-list into two because of 128 character command-line limit of
# Microsoft's link and lib utilities.
#
FLEXOBJS1 = \
ccl.obj \
dfa.obj \
ecs.obj \
gen.obj \
main.obj \
misc.obj \
nfa.obj \
parse.obj
FLEXOBJS2 = \
scan.obj \
sym.obj \
tblcmp.obj \
yylex.obj
FLEX_C_SOURCES = \
ccl.c \
dfa.c \
ecs.c \
gen.c \
main.c \
misc.c \
nfa.c \
parse.c \
scan.c \
sym.c \
tblcmp.c \
yylex.c
FLEX_LIB_OBJS = \
libmain.obj
all : flex.exe
#
# lib is used to get around the 128 character command-line limit of 'link'.
#
flex.exe : $(FLEXOBJS1) $(FLEXOBJS2)
lib /nologo tmplib $(FLEXOBJS1);
link $(LDFLAGS) $(FLEXOBJS2),$*.exe,,tmplib;
del tmplib.lib
f_flex:
copy initscan.c scan.c
touch scan.c
@echo compiling first flex
$(MAKE) flex.exe
del scan.c
@echo using first flex to generate final version...
$(MAKE) flex.exe
#
# general inference rule
#
.c.obj:
$(CC) -c $(CFLAGS) $*.c
parse.h parse.c : parse.y
$(YACC) -d parse.y
@mv y_tab.c parse.c
@mv y_tab.h parse.h
scan.c : scan.l
$(FLEX) $(FLEX_FLAGS) $(COMPRESSION) scan.l >scan.c
scan.obj : scan.c parse.h flexdef.h
main.obj : main.c flexdef.h
$(CC) $(CFLAGS) -c $(SKELFLAGS) main.c
ccl.obj : ccl.c flexdef.h
dfa.obj : dfa.c flexdef.h
ecs.obj : ecs.c flexdef.h
gen.obj : gen.c flexdef.h
misc.obj : misc.c flexdef.h
nfa.obj : nfa.c flexdef.h
parse.obj : parse.c flexdef.h
sym.obj : sym.c flexdef.h
tblcmp.obj : tblcmp.c flexdef.h
yylex.obj : yylex.c flexdef.h
clean :
del *.obj
del *.map

View File

@@ -1,6 +0,0 @@
@echo off
sed -e "s/y\.tab\./parse_tab\./" -e "/sed/ s/'/\"/g" < Makefile.in > Makefile
sed -f MISC/MSDOS/djgpp.sed Makefile.in > Makefile
update initscan.c scan.c

View File

@@ -1,12 +0,0 @@
s/y\.tab\./parse_tab\./
s/@DEFS@/-DMS_DOS/
s/@LIBS@//
s/@srcdir@/./
s/@YACC@/bison/
s/@CC@/gcc/
s/@RANLIB@/ranlib/
s/@ALLOCA@//
/^flex/ s/\.bootstrap//
/sed.*extern.*malloc/ c\
@mv parse_tab.c parse.c
/rm.*parse_tab.c/ d

View File

@@ -1,56 +0,0 @@
(Message inbox:40)
Date: Tue, 17 Jul 1990 11:56 EDT
From: swl26%CAS.BITNET@CORNELLC.cit.cornell.edu
Subject: Re(2): port of flex-2.3 to IBM/MVS
To: vern@cs.cornell.edu
>Message received. I'm sending this response to
>swl26%CAS.BITNET@CORNELLC.cit.cornell.edu.
Great -- we can talk.
>How extensive are the diffs? If they're fairly short then yes, please
>send them. If they're pretty involved then probably not, as I'm not aware
>of many MVS flex users ...
I've built a context diff file which is ~850 lines.
Summary of major changes necessary:
o a new initscan.c -- because MVS is ebcdic, the initial scanner had
to be changed. I built a scanner from scan.l using -Ce, then
hand-manipulated the yy_ec table to fit EBCDIC instead of ASCII
chars. (This is not included in the diff file above.)
o changes in main and flexdef.h to change how files are handled. (No
dynamic file names, etc.)
o Some lines had to be shortened to 80 bytes. This mostly impacted
your RCSID lines, which with the full path name were too long.
o SASC and the linker don't allow externals to be longer than 8 chars.
I thus wrote a Q&D program to shorten all externals. (This would be
a separate file 'fixit.l', which is not included in the diffs.)
o There are several places where there are tests for 'isascii' (which I
deleted conditionally, using #ifdefs), and tests for 'A' <= x <= 'Z'
which I changed to 'isupper'.
Many of the changes I've incorporated without impacting other systems.
Others are with 'ifdefs'. Still others (the short external names and new
initscan) are 'isolable' as separate files which would have to be
included with a distribution.
Obviously, you are not going to want to (even if you can :-) ) worry about
testing new versions in the MVS environment. Likewise, I don't have the
time or resources to provide much support. (I'm not sure my management
would allow any :-( )
With all of the above feel free to say "Thanks, but no thanks." If you
want to see the diffs anyway, I will certainly mail them.
Thanks for your time and efforts.
Steve Layten
Chemical Abstracts Service, PO Box 3012, Columbus, OH 43210, +1 614 421-3600
INET: swl26%cas.BITNET@CUNYVM.CUNY.Edu

View File

@@ -1,23 +0,0 @@
(Message inbox:47)
Date: Wed, 18 Jul 1990 14:16 EDT
From: swl26%CAS.BITNET@CORNELLC.cit.cornell.edu
Subject: Re(2): Re(2): diffs for mvs port of flex-2.3
To: vern@cs.cornell.edu
>Thanks, I've successfully unpacked the archive. I may simply distribute
>the diffs as a set of files in the MISC/ directory rather than incorporating
>them into the 2.4 release. Let me know if you don't want me to do so.
>
> Vern
Thank you! What you propose is okay. I might suggest, however, that you
look in the diffs for dfa.c, misc.c, and yylex.c, and consider removing
some of the ASCIIisms which are probably unnecessary. The manner in
which I made the changes was pure brute force, and there might be a
better way, but the changes I made there shouldn't hurt anything.
regards,
Steve

View File

@@ -1,341 +0,0 @@
Received: from CU-ARPA.CS.CORNELL.EDU by loki.cs.cornell.edu (5.61/I-1.91f)
id AA25874; Wed, 18 Jul 90 12:02:22 -0400
Message-Id: <9007181320.AA24810@cu-arpa.cs.cornell.edu>
Received: from CORNELLC.CIT.CORNELL.EDU by cu-arpa.cs.cornell.edu (5.61+2/1.91d)
id AA24810; Wed, 18 Jul 90 09:20:21 -0400
Received: from CORNELLC by CORNELLC.cit.cornell.edu (IBM VM SMTP R1.2.1MX) with BSMTP id 6769; Wed, 18 Jul 90 09:18:46 EDT
Received: from CAS.BITNET (MAILER) by CORNELLC (Mailer R2.05X) with BSMTP id
5378; Wed, 18 Jul 90 09:18:38 EDT
From: swl26%CAS.BITNET@CORNELLC.cit.cornell.edu
Date: Wed, 18 Jul 1990 09:16 EDT
Subject: Re(2): diffs for mvs port of flex-2.3
In-Reply-To: Your message of Tue, 17 Jul 90 17:42:3
To: vern@cs.cornell.edu
Sorry about the trailing blank problem. It's farily common with data sent
through bitnet paths, but ever the optimist ...
>I think there should be an 'M' at the beginning of the second line.
This isn't a problem. I believe that the first byte of the line indicates
it's length (in some manner).
Rather than re-send the data, how about a uudecode that compensates for
the trailing blank problem? I manually mangled the uuencoded file and ran
the following decode, and it seemed to work.
#! /bin/sh
# This is a shell archive. Remove anything before this line, then feed it
# into a shell via "sh file" or similar. To overwrite existing files,
# type "sh file -c".
# The tool that generated this appeared in the comp.sources.unix newsgroup;
# send mail to comp-sources-unix@uunet.uu.net if you want that tool.
# If this archive is complete, you will see the following message at the end:
# "End of shell archive."
# Contents: uudecode.c
# Wrapped by swl26@swl26aws on Wed Jul 18 08:59:24 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'uudecode.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'uudecode.c'\"
else
echo shar: Extracting \"'uudecode.c'\" \(6418 characters\)
sed "s/^X//" >'uudecode.c' <<'END_OF_FILE'
X/* #ifndef lint
Xstatic char sccsid[] = "@(#)uudecode.c 5.3-1 (Berkeley) 9/1/87";
X#endif */
X
X/* Written by Mark Horton */
X/* Modified by ajr (Alan J Rosenthatl,flaps@utcsri.UUCP) to use checksums */
X/* Modified by fnf (Fred Fish,well!fnf) to use Keith Pyle's suggestion for
X compatibility */
X/* Modified by bcn (Bryce Nesbitt,ucbvax!cogsci!bryce) to fix a misleading
X error message on the Amiga port, to fix a bug that prevented decoding
X certain files, to work even if trailing spaces have been removed from a
X file, to check the filesize (if present), to add some error checking, to
X loop for multiple decodes from a single file, and to handle common
X BITNET mangling. Also kludged around a missing string function in Aztec
X C */
X
X/*
X * uudecode [input]
X *
X * Decode a file encoded with uuencode. WIll extract multiple encoded
X * modules from a single file. Can deal with most mangled files, including
X * BITNET.
X */
X
X#include <stdio.h>
X#include <ctype.h>
X
X#ifdef AMIGA
X#define AMIGA_LATTICE /* Set for Amiga Lattice C */
X#define MCH_AMIGA
X#define MPU68000
X#endif
X
X#ifdef unix
X#include <pwd.h>
X#include <sys/types.h>
X#include <sys/stat.h>
X#endif
X
X#define SUMSIZE 64
X#define DEC(c) (((c) - ' ') & 077) /* single character decode */
X
Xmain(argc, argv)
Xchar **argv;
X{
XFILE *in, *out;
Xint through_loop=0; /* Dejavu indicator */
Xint mode; /* file's mode (from header) */
Xlong filesize; /* theoretical file size (from header) */
Xchar dest[128];
Xchar buf[80];
X
X#ifdef AMIGA_LATTICE
Xextern int Enable_Abort;
X Enable_Abort=1;
X#endif
X
X /* A filename can be specified to be uudecoded, or nothing can
X be specified, and the input will come from STDIN */
X
X switch (argc)
X {
X case 1:
X in=stdin;
X break;
X
X case 2:
X if ((in = fopen(argv[1], "r")) == NULL)
X {
X fprintf(stderr, "ERROR: can't find %s\n", argv[1]);
X fprintf(stderr, "USAGE: uudecode [infile]\n");
X exit(10);
X }
X break;
X
X default:
X fprintf(stderr, "USAGE: uudecode [infile]\n");
X exit(11);
X break;
X }
X
X /* Loop through file, searching for headers. Decode anything with a
X header, complain if there where no headers. */
X
Xfor (;;)
X{
X /* search file for header line */
X for (;;)
X {
X if (fgets(buf, sizeof buf, in) == NULL)
X {
X if (!through_loop)
X {
X fprintf(stderr, "ERROR: no `begin' line!\n");
X exit(12);
X }
X else
X {
X exit(0);
X }
X }
X if (strncmp(buf, "begin ", 6) == 0)
X break;
X }
X sscanf(buf, "begin %o %s", &mode, dest);
X
X#ifdef unix
X /* handle ~user/file format */
X if (dest[0] == '~')
X {
X char *sl;
X struct passwd *getpwnam();
X char *index();
X struct passwd *user;
X char dnbuf[100];
X
X sl = index(dest, '/');
X if (sl == NULL)
X {
X fprintf(stderr, "Illegal ~user\n");
X exit(13);
X }
X *sl++ = 0;
X user = getpwnam(dest+1);
X if (user == NULL)
X {
X fprintf(stderr, "No such user as %s\n", dest);
X exit(14);
X }
X strcpy(dnbuf, user->pw_dir);
X strcat(dnbuf, "/");
X strcat(dnbuf, sl);
X strcpy(dest, dnbuf);
X }
X#endif
X
X /* create output file */
X if ((out = fopen(dest, "w")) == NULL)
X {
X fprintf(stderr, "ERROR: can't open output file %s\n", dest);
X exit(15);
X }
X#ifdef unix
X chmod(dest, mode);
X#endif
X
X decode(in, out, dest);
X
X if (fgets(buf, sizeof buf, in) == NULL || strncmp(buf,"end",3))
X { /* don't be overly picky about newline ^ */
X fprintf(stderr, "ERROR: no `end' line\n");
X exit(16);
X }
X
X if (!(fgets(buf,sizeof buf,in) == NULL || strncmp(buf,"size ",3)))
X {
X sscanf(buf, "size %ld", &filesize);
X if (ftell(out) != filesize)
X {
X fprintf(stderr, "ERROR: file should have been %ld bytes long but was
X exit(17);
X }
X }
X through_loop = 1;
X} /* forever */
X} /* main */
X
X/*
X * Copy from in to out, decoding as you go.
X * If a return or newline is encountered too early in a line, it is
X * assumed that means that some editor has truncated trailing spaces.
X */
Xdecode(in, out, dest)
XFILE *in;
XFILE *out;
Xchar *dest;
X{
Xchar buf[81];
Xchar *bp;
Xint nosum=0;
X#ifndef unix
Xextern errno;
X#endif
Xregister int j;
Xregister int n;
Xint checksum, line;
X
X for (line = 1; ; line++) /* for each input line */
X {
X if (fgets(buf, sizeof buf, in) == NULL)
X {
X fprintf(stderr, "ERROR: input ended unexpectedly!\n");
X exit(18);
X }
X
X /* Pad end of lines in case some editor truncated trailing
X spaces */
X
X for (n=0;n<79;n++) /* search for first \r, \n or \000 */
X {
X if (buf[n]=='\176') /* If BITNET made a twiddle, */
X buf[n]='\136'; /* we make a caret */
X if (buf[n]=='\r'||buf[n]=='\n'||buf[n]=='\000')
X break;
X }
X for (;n<79;n++) /* when found, fill rest of line with space */
X {
X buf[n]=' ';
X }
X buf[79]=0; /* terminate new string */
X
X checksum = 0;
X n = DEC(buf[0]);
X if (n <= 0)
X break; /* 0 bytes on a line?? Must be the last line */
X
X bp = &buf[1];
X
X /* FOUR input characters go into each THREE output charcters */
X
X while (n >= 4)
X {
X j = DEC(bp[0]) << 2 | DEC(bp[1]) >> 4; putc(j, out); checksum += j;
X j = DEC(bp[1]) << 4 | DEC(bp[2]) >> 2; putc(j, out); checksum += j;
X j = DEC(bp[2]) << 6 | DEC(bp[3]); putc(j, out); checksum += j;
X checksum = checksum % SUMSIZE;
X bp += 4;
X n -= 3;
X }
X
X j = DEC(bp[0]) << 2 | DEC(bp[1]) >> 4;
X checksum += j;
X if (n >= 1)
X putc(j, out);
X j = DEC(bp[1]) << 4 | DEC(bp[2]) >> 2;
X checksum += j;
X if (n >= 2)
X putc(j, out);
X j = DEC(bp[2]) << 6 | DEC(bp[3]);
X checksum += j;
X if (n >= 3)
X putc(j, out);
X checksum = checksum % SUMSIZE;
X bp += 4;
X n -= 3;
X
X#ifndef unix
X /* Error checking under UNIX??? You must be kidding... */
X /* Check if an error occured while writing to that last line */
X if (errno)
X {
X fprintf(stderr, "ERROR: error writing to %s\n",dest);
X exit(19);
X }
X#endif
X
X /* The line has been decoded; now check that sum */
X
X nosum |= !isspace(*bp);
X if (nosum) /* Is there a checksum at all?? */
X {
X if (checksum != DEC(*bp)) /* Does that checksum match? */
X {
X fprintf(stderr, "ERROR: checksum mismatch decoding %s, line %d.\
X }
X } /* sum */
X } /* line */
X} /* function */
X
X#ifdef unix
X/*
X * Return the ptr in sp at which the character c appears;
X * 0 if not found
X */
Xchar *
Xindex(sp, c)
Xregister char *sp, c;
X{
X do
X {
X if (*sp == c)
X return(sp);
X }
X while (*sp++);
X
X return(0);
X}
X#endif unix
X
END_OF_FILE
echo shar: NEWLINE appended to \"'uudecode.c'\"
if test 6419 -ne `wc -c <'uudecode.c'`; then
echo shar: \"'uudecode.c'\" unpacked with wrong size!
fi
# end of 'uudecode.c'
fi
echo shar: End of shell archive.
exit 0

View File

@@ -1,44 +0,0 @@
These patches and supplemental programs should allow porting to MVS or MVS/XA
in an EBCDIC envrionment, using SAS C V4.00C.
Included are:
-rw-r--r-- 1 swl26 1573 Jul 17 14:32 README
-rw-rw-r-- 1 swl26 20861 Jul 17 13:41 diffs
-rw-rw-r-- 1 swl26 5022 Jul 17 14:00 fixit.l
-rw-rw-r-- 1 swl26 97644 Jul 17 13:42 initscan.mvs.c
-rw-rw-r-- 1 swl26 4898 Jul 17 14:08 unfixit.l
The file "diffs" contains context diffs for changes to flex 2.3.
The file "fixit.l" contains flex sources for a program to shorten external
variable and function names to 8 characters or less. This is required for the
"dumb" compiler linker used.
The file "unfixit.l" reverses the changes in "fixit.l", to restore long names.
This is useful when trying to build diff files as created here.
The file "initscan.mvs.c" is an already "flexed" version of scan.l, in an
EBCDIC environment.
To install in an MVS environment, use patch to apply the diffs to flex 2.3,
then run "fixit" on all .c, .h, .l, .y, and .skel files. Move the files
to the MVS machine, and compile each of the .c files. (You will need a
"yacc" functional equivalent under MVS to expand parse.y in that
environment.) Link together, and the resulting flex should be ready to
go. To test, run the MVSflex -is8 -Ce on the scan.l, and you should get
back a file which is identical to initscan.mvs.c.
Enjoy.
Steven W. Layten
Senior Engineer
Chemical Abstracts Service
PO Box 3012
2540 Olentangy River Road
Columbus, Ohio 43210
+1 614 421 3600 extension 3451
INET: swl26%cas.BITNET@CUNYVM.CUNY.Edu
UUCP: osu-cis!chemabs!swl26
BITNET: swl26@cas.bitnet

View File

@@ -1,854 +0,0 @@
diff -c ../Makefile ./Makefile
*** ../Makefile Thu Jun 28 00:44:07 1990
--- ./Makefile Mon Jul 16 13:57:26 1990
***************
*** 39,49 ****
# AUXDIR, manual pages will be installed in MANDIR with extension MANEXT.
# Raw, unformatted troff source will be installed if INSTALLMAN=man, nroff
# preformatted versions will be installed if INSTALLMAN=cat.
! DESTDIR =
BINDIR = /usr/local
LIBDIR = /usr/local/lib
AUXDIR = /usr/local/lib
MANDIR = /usr/man/manl
MANEXT = l
INSTALLMAN = man
--- 39,50 ----
# AUXDIR, manual pages will be installed in MANDIR with extension MANEXT.
# Raw, unformatted troff source will be installed if INSTALLMAN=man, nroff
# preformatted versions will be installed if INSTALLMAN=cat.
! DESTDIR = /projects/m751stereo/code/c/swl26
BINDIR = /usr/local
LIBDIR = /usr/local/lib
AUXDIR = /usr/local/lib
MANDIR = /usr/man/manl
+ INCLUDEDIR = .
MANEXT = l
INSTALLMAN = man
***************
*** 52,58 ****
SKELETON_FILE = $(DESTDIR)$(AUXDIR)/flex.skel
SKELFLAGS = -DDEFAULT_SKELETON_FILE=\"$(SKELETON_FILE)\"
! CFLAGS = -O
LDFLAGS = -s
COMPRESSION =
--- 53,59 ----
SKELETON_FILE = $(DESTDIR)$(AUXDIR)/flex.skel
SKELFLAGS = -DDEFAULT_SKELETON_FILE=\"$(SKELETON_FILE)\"
! CFLAGS = -O -DUSG -I$(INCLUDEDIR)
LDFLAGS = -s
COMPRESSION =
diff -c ../ccl.c ./ccl.c
*** ../ccl.c Thu Jun 28 00:44:07 1990
--- ./ccl.c Mon Jul 16 13:57:27 1990
***************
*** 28,37 ****
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
! #include "flexdef.h"
/* ccladd - add a single character to a ccl
*
--- 28,37 ----
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
! #include <flexdef.h>
/* ccladd - add a single character to a ccl
*
diff -c ../dfa.c ./dfa.c
*** ../dfa.c Thu Jun 28 00:44:08 1990
--- ./dfa.c Mon Jul 16 13:57:28 1990
***************
*** 28,37 ****
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
! #include "flexdef.h"
/* declare functions that have forward references */
--- 28,38 ----
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
! #include <flexdef.h>
! #include <ctype.h>
/* declare functions that have forward references */
***************
*** 682,688 ****
register int j;
for ( i = 'A', j = 'a'; i <= 'Z'; ++i, ++j )
! state[i] = state[j];
}
if ( ds > num_start_states )
--- 683,692 ----
register int j;
for ( i = 'A', j = 'a'; i <= 'Z'; ++i, ++j )
! {
! if (isupper(i) )
! state[i] = state[j];
! }
}
if ( ds > num_start_states )
***************
*** 958,964 ****
}
}
! else if ( sym >= 'A' && sym <= 'Z' && caseins )
flexfatal( "consistency check failed in symfollowset" );
else if ( sym == SYM_EPSILON )
--- 962,968 ----
}
}
! else if ( isupper ( sym ) && caseins )
flexfatal( "consistency check failed in symfollowset" );
else if ( sym == SYM_EPSILON )
Only in .: diffs
Only in .: diffs.new
diff -c ../ecs.c ./ecs.c
*** ../ecs.c Thu Jun 28 00:44:08 1990
--- ./ecs.c Mon Jul 16 13:57:28 1990
***************
*** 28,37 ****
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
! #include "flexdef.h"
/* ccl2ecl - convert character classes to set of equivalence classes
*
--- 28,37 ----
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
! #include <flexdef.h>
/* ccl2ecl - convert character classes to set of equivalence classes
*
diff -c ../flex.skel ./flex.skel
*** ../flex.skel Thu Jun 28 00:44:27 1990
--- ./flex.skel Mon Jul 16 13:57:29 1990
***************
*** 1,7 ****
/* A lexical scanner generated by flex */
/* scanner skeleton version:
! * $Header$
*/
#define FLEX_SCANNER
--- 1,7 ----
/* A lexical scanner generated by flex */
/* scanner skeleton version:
! * $Header$
*/
#define FLEX_SCANNER
diff -c ../flexdef.h ./flexdef.h
*** ../flexdef.h Thu Jun 28 00:44:27 1990
--- ./flexdef.h Mon Jul 16 13:57:30 1990
***************
*** 26,32 ****
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
! /* @(#) $Header$ (LBL) */
#ifndef FILE
#include <stdio.h>
--- 26,32 ----
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
! /* @(#) $Header$ (LBL) */
#ifndef FILE
#include <stdio.h>
***************
*** 45,51 ****
/* size of input alphabet - should be size of ASCII set */
#ifndef DEFAULT_CSIZE
! #define DEFAULT_CSIZE 128
#endif
#ifndef PROTO
--- 45,51 ----
/* size of input alphabet - should be size of ASCII set */
#ifndef DEFAULT_CSIZE
! #define DEFAULT_CSIZE 256
#endif
#ifndef PROTO
***************
*** 90,96 ****
--- 90,98 ----
#define SHORT_FILE_NAMES
#endif
+ #ifndef OSVS
char *malloc(), *realloc();
+ #endif
/* maximum line length we'll have to deal with */
***************
*** 116,125 ****
#define true 1
#define false 0
-
#ifndef DEFAULT_SKELETON_FILE
#define DEFAULT_SKELETON_FILE "flex.skel"
! #endif
/* special chk[] values marking the slots taking by end-of-buffer and action
* numbers
--- 118,132 ----
#define true 1
#define false 0
#ifndef DEFAULT_SKELETON_FILE
+ #ifdef OSVS
+ #define DEFAULT_SKELETON_FILE "ctri01"
+ #define SYSUT1 "sysut1"
+ #define SYSUT2 "sysut2"
+ #else
#define DEFAULT_SKELETON_FILE "flex.skel"
! #endif /* OSVS */
! #endif /* DEFAULT_SKELETON_FILE */
/* special chk[] values marking the slots taking by end-of-buffer and action
* numbers
***************
*** 226,233 ****
#define INITIAL_MAX_SCS 40 /* maximum number of start conditions */
#define MAX_SCS_INCREMENT 40 /* amount to bump by if it's not enough */
! #define ONE_STACK_SIZE 500 /* stack of states with only one out-transition */
! #define SAME_TRANS -1 /* transition is the same as "default" entry for state */
/* the following percentages are used to tune table compression:
--- 233,240 ----
#define INITIAL_MAX_SCS 40 /* maximum number of start conditions */
#define MAX_SCS_INCREMENT 40 /* amount to bump by if it's not enough */
! #define ONE_STACK_SIZE 500 /*stack of states with only one out-transition*/
! #define SAME_TRANS -1 /*transition is the same as "default" entry for state */
/* the following percentages are used to tune table compression:
diff -c ../gen.c ./gen.c
*** ../gen.c Thu Jun 28 00:44:28 1990
--- ./gen.c Mon Jul 16 13:57:32 1990
***************
*** 28,37 ****
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
! #include "flexdef.h"
/* declare functions that have forward references */
--- 28,37 ----
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
! #include <flexdef.h>
/* declare functions that have forward references */
***************
*** 292,298 ****
indent_puts( "{" );
! indent_puts( "if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )" );
indent_up();
indent_puts( "{" );
indent_puts( "yy_act = yy_acclist[yy_lp];" );
--- 292,298 ----
indent_puts( "{" );
! indent_puts("if( yy_lp && yy_lp < yy_accept[yy_current_state + 1] )");
indent_up();
indent_puts( "{" );
indent_puts( "yy_act = yy_acclist[yy_lp];" );
diff -c ../initscan.c ./initscan.c
*** ../initscan.c Thu Jun 28 00:44:51 1990
--- ./initscan.c Mon Jul 16 13:57:33 1990
***************
*** 1,7 ****
/* A lexical scanner generated by flex */
/* scanner skeleton version:
! * $Header$
*/
#define FLEX_SCANNER
--- 1,7 ----
/* A lexical scanner generated by flex */
/* scanner skeleton version:
! * $Header$
*/
#define FLEX_SCANNER
***************
*** 193,199 ****
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
#undef yywrap
--- 193,199 ----
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
#undef yywrap
diff -c ../libmain.c ./libmain.c
*** ../libmain.c Thu Jun 28 00:44:28 1990
--- ./libmain.c Mon Jul 16 13:57:34 1990
***************
*** 1,6 ****
/* libmain - flex run-time support library "main" function */
! /* $Header$ */
extern int yylex();
--- 1,6 ----
/* libmain - flex run-time support library "main" function */
! /* $Header$ */
extern int yylex();
diff -c ../main.c ./main.c
*** ../main.c Thu Jun 28 00:44:29 1990
--- ./main.c Mon Jul 16 13:57:34 1990
***************
*** 34,44 ****
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
! #include "flexdef.h"
static char flex_version[] = "2.3";
--- 34,44 ----
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
! #include <flexdef.h>
static char flex_version[] = "2.3";
***************
*** 97,106 ****
char *program_name;
#ifndef SHORT_FILE_NAMES
static char *outfile = "lex.yy.c";
! #else
static char *outfile = "lexyy.c";
! #endif
static int outfile_created = 0;
static int use_stdout;
static char *skelname = NULL;
--- 97,110 ----
char *program_name;
#ifndef SHORT_FILE_NAMES
+ #ifdef OSVS
+ static char *outfile = "ctro01";
+ #else /* not OSVS */
static char *outfile = "lex.yy.c";
! #endif /* not OSVS */
! #else /* SHORT_FILE_NAMES */
static char *outfile = "lexyy.c";
! #endif /* SHORT_FILE_NAMES */
static int outfile_created = 0;
static int use_stdout;
static char *skelname = NULL;
***************
*** 209,216 ****
--- 213,222 ----
else if ( fclose( temp_action_file ) )
flexfatal( "error occurred when closing temporary action file" );
+ #ifndef OSVS
else if ( unlink( action_file_name ) )
flexfatal( "error occurred when deleting temporary action file" );
+ #endif
}
if ( status != 0 && outfile_created )
***************
*** 221,228 ****
--- 227,236 ----
else if ( fclose( stdout ) )
flexfatal( "error occurred when closing output file" );
+ #ifndef OSVS
else if ( unlink( outfile ) )
flexfatal( "error occurred when deleting output file" );
+ #endif
}
if ( backtrack_report && backtrack_file )
***************
*** 574,583 ****
if ( backtrack_report )
{
#ifndef SHORT_FILE_NAMES
backtrack_file = fopen( "lex.backtrack", "w" );
! #else
backtrack_file = fopen( "lex.bck", "w" );
! #endif
if ( backtrack_file == NULL )
flexerror( "could not create lex.backtrack" );
--- 582,595 ----
if ( backtrack_report )
{
#ifndef SHORT_FILE_NAMES
+ #ifdef OSVS
+ backtrack_file = fopen( SYSUT2, "w");
+ #else /* not OSVS */
backtrack_file = fopen( "lex.backtrack", "w" );
! #endif /* OSVS */
! #else /* SHORT_FILE_NAMES */
backtrack_file = fopen( "lex.bck", "w" );
! #endif /* SHORT_FILE_NAMES */
if ( backtrack_file == NULL )
flexerror( "could not create lex.backtrack" );
***************
*** 597,604 ****
lerrsf( "can't open skeleton file %s", skelname );
#ifdef SYS_V
action_file_name = tmpnam( NULL );
! #endif
if ( action_file_name == NULL )
{
--- 609,620 ----
lerrsf( "can't open skeleton file %s", skelname );
#ifdef SYS_V
+ #ifndef OSVS
action_file_name = tmpnam( NULL );
! #else /* OSVS */
! action_file_name = SYSUT1;
! #endif /* OSVS */
! #endif /* SYS_V */
if ( action_file_name == NULL )
{
***************
*** 609,615 ****
--- 625,636 ----
#else
(void) strcpy( temp_action_file_name, "flexXXXXXX.tmp" );
#endif
+ #ifndef OSVS
(void) mktemp( temp_action_file_name );
+ #else /* OSVS */
+ /* should never be executed in OSVS as IF should always be false */
+ (void) strcpy( temp_action_file_name, SYSUT1 ) ;
+ #endif /* OSVS */
action_file_name = temp_action_file_name;
}
diff -c ../misc.c ./misc.c
*** ../misc.c Thu Jun 28 00:44:40 1990
--- ./misc.c Mon Jul 16 13:57:35 1990
***************
*** 28,38 ****
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
#include <ctype.h>
! #include "flexdef.h"
/* ANSI C does not guarantee that isascii() is defined */
--- 28,38 ----
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
#include <ctype.h>
! #include <flexdef.h>
/* ANSI C does not guarantee that isascii() is defined */
***************
*** 107,113 ****
--- 107,117 ----
{
while ( *str )
{
+ #ifdef OSVS
+ if ( ! islower( *str ) )
+ #else
if ( ! isascii( *str ) || ! islower( *str ) )
+ #endif
return ( 0 );
++str;
}
***************
*** 130,136 ****
--- 134,144 ----
{
while ( *str )
{
+ #ifdef OSVS
+ if ( ! isupper( (char) *str ) )
+ #else
if ( ! isascii( *str ) || ! isupper( (char) *str ) )
+ #endif
return ( 0 );
++str;
}
***************
*** 182,188 ****
--- 190,200 ----
register int c;
{
+ #ifdef OSVS
+ return ( isupper( c ) ? (Char) tolower( c ) : (Char) c );
+ #else
return ( (isascii( c ) && isupper( c )) ? tolower( c ) : c );
+ #endif
}
***************
*** 204,210 ****
for ( c = str; *c; ++c )
;
! copy = malloc( (unsigned) ((c - str + 1) * sizeof( char )) );
if ( copy == NULL )
flexfatal( "dynamic memory failure in copy_string()" );
--- 216,222 ----
for ( c = str; *c; ++c )
;
! copy = (char *) malloc( (unsigned) ((c - str + 1) * sizeof( char )) );
if ( copy == NULL )
flexfatal( "dynamic memory failure in copy_string()" );
***************
*** 392,403 ****
--- 404,421 ----
#ifndef MS_DOS
#ifndef VMS
+ #ifndef OSVS
#include <sys/types.h>
+ #endif /* OSVS */
#else
#include <types.h>
#endif
#endif
+ #ifdef OSVS
+ #include <time.h>
+ #endif /* OSVS */
+
#ifdef MS_DOS
#include <time.h>
typedef long time_t;
***************
*** 615,621 ****
--- 633,643 ----
if ( array[1] == 'x' )
++sptr;
+ #ifdef OSVS
+ while ( isdigit( array[sptr] ) )
+ #else
while ( isascii( array[sptr] ) && isdigit( array[sptr] ) )
+ #endif
/* don't increment inside loop control because if
* isdigit() is a macro it will expand it to two
* increments ...
Only in ..: new
diff -c ../nfa.c ./nfa.c
*** ../nfa.c Thu Jun 28 00:44:40 1990
--- ./nfa.c Mon Jul 16 13:57:36 1990
***************
*** 28,37 ****
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
! #include "flexdef.h"
/* declare functions that have forward references */
--- 28,37 ----
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
! #include <flexdef.h>
/* declare functions that have forward references */
***************
*** 110,116 ****
{
int sym, tsp1, tsp2, anum, ns;
! fprintf( stderr, "\n\n********** beginning dump of nfa with start state %d\n",
state1 );
/* we probably should loop starting at firstst[state1] and going to
--- 110,116 ----
{
int sym, tsp1, tsp2, anum, ns;
! fprintf(stderr,"\n\n********* beginning dump of nfa with start state %d\n",
state1 );
/* we probably should loop starting at firstst[state1] and going to
diff -c ../parse.y ./parse.y
*** ../parse.y Thu Jun 28 00:44:40 1990
--- ./parse.y Mon Jul 16 13:57:36 1990
***************
*** 32,45 ****
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
! #include "flexdef.h"
int pat, scnum, eps, headcnt, trailcnt, anyccl, lastchar, i, actvp, rulelen;
int trlcontxt, xcluflg, cclsorted, varlength, variable_trail_rule;
Char clower();
static int madeany = false; /* whether we've made the '.' character class */
int previous_continued_action; /* whether the previous rule's action was '|' */
--- 32,47 ----
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
! #include <flexdef.h>
int pat, scnum, eps, headcnt, trailcnt, anyccl, lastchar, i, actvp, rulelen;
int trlcontxt, xcluflg, cclsorted, varlength, variable_trail_rule;
Char clower();
+ void build_eof_action();
+ void yyerror();
static int madeany = false; /* whether we've made the '.' character class */
int previous_continued_action; /* whether the previous rule's action was '|' */
diff -c ../scan.l ./scan.l
*** ../scan.l Thu Jun 28 00:44:41 1990
--- ./scan.l Mon Jul 16 13:57:37 1990
***************
*** 30,42 ****
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
#undef yywrap
! #include "flexdef.h"
! #include "parse.h"
#define ACTION_ECHO fprintf( temp_action_file, "%s", yytext )
#define MARK_END_OF_PROLOG fprintf( temp_action_file, "%%%% end of prolog\n" );
--- 30,42 ----
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
#undef yywrap
! #include <flexdef.h>
! #include <parse.h>
#define ACTION_ECHO fprintf( temp_action_file, "%s", yytext )
#define MARK_END_OF_PROLOG fprintf( temp_action_file, "%%%% end of prolog\n" );
diff -c ../sym.c ./sym.c
*** ../sym.c Thu Jun 28 00:44:41 1990
--- ./sym.c Mon Jul 16 13:57:37 1990
***************
*** 28,37 ****
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
! #include "flexdef.h"
/* declare functions that have forward references */
--- 28,37 ----
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
! #include <flexdef.h>
/* declare functions that have forward references */
diff -c ../tblcmp.c ./tblcmp.c
*** ../tblcmp.c Thu Jun 28 00:44:41 1990
--- ./tblcmp.c Mon Jul 16 13:57:38 1990
***************
*** 28,37 ****
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
! #include "flexdef.h"
/* declarations for functions that have forward references */
--- 28,37 ----
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
! #include <flexdef.h>
/* declarations for functions that have forward references */
diff -c ../yylex.c ./yylex.c
*** ../yylex.c Thu Jun 28 00:44:41 1990
--- ./yylex.c Mon Jul 16 13:57:38 1990
***************
*** 28,39 ****
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
#include <ctype.h>
! #include "flexdef.h"
! #include "parse.h"
/* ANSI C does not guarantee that isascii() is defined */
--- 28,39 ----
#ifndef lint
static char rcsid[] =
! "@(#) $Header$ (LBL)";
#endif
#include <ctype.h>
! #include <flexdef.h>
! #include <parse.h>
/* ANSI C does not guarantee that isascii() is defined */
***************
*** 180,186 ****
--- 180,190 ----
break;
default:
+ #ifdef OSVS
+ if ( ! isprint( yylval ) )
+ #else
if ( ! isascii( yylval ) || ! isprint( yylval ) )
+ #endif
fprintf( stderr, "\\%.3o", yylval );
else
(void) putc( yylval, stderr );

View File

@@ -1,138 +0,0 @@
%{
/* fixit.l - convert long external names to names of 8-bytes or less */
/*
* This program is included to satisfy "dumb" compilers/linkers which
* do not know about externals of names longer than 8 bytes.
*
* Steven W. Layten
* Chemical Abstracts Service
* PO BOX 3012
* Columbus, OH 43210
*/
%}
%%
"action_file_name" printf("actfilnm");
"action_out" printf("actnout");
"add_accept" printf("addacpt");
"all_lower" printf("alllower");
"all_upper" printf("allupper");
"allocate_array" printf("allocarr");
"assoc_rule" printf("asscrule");
"backtrack_file" printf("bktrkfil");
"backtrack_report" printf("bktrkrep");
"bol_needed" printf("bol_nded");
"build_eof_action" printf("bldeofac");
"cclinstal" printf("cclnstal");
"ccllookup" printf("ccllookp");
"cclnegate" printf("cclnegat");
"cclsorted" printf("cclsrted");
"check_for_backtracking" printf("ck4bktrk");
"check_trailing_context" printf("cktrlcnt");
"continued_action" printf("cntdactn");
"copy_string" printf("copystrn");
"copy_unsigned_string" printf("cpunsstr");
"copyright" printf("cpyrght");
"copysingl" printf("copysngl");
"current_max_ccl_tbl_size" printf("c_mx_ccl");
"current_max_dfa_size" printf("c_mx_dfa");
"current_max_dfas" printf("c_mxdfas");
"current_max_rules" printf("curmxrls");
"current_max_scs" printf("c_mx_scs");
"current_max_template_xpairs" printf("c_mx_tmp");
"current_max_xpairs" printf("c_mx_xpr");
"current_maxccls" printf("c_mxccls");
"current_mns" printf("curr_mns");
"current_state_type" printf("cursttyp");
"dataflush" printf("datflush");
"dfaacc_union" printf("dfacunin");
"do_indent" printf("do_indnt");
"dump_associated_rules" printf("dmpasrl");
"dump_transitions" printf("dmptrns");
"dupmachine" printf("dupmach");
"ecs_from_xlation" printf("ecsfrmxt");
"end_of_buffer_state" printf("eobstate");
"epsclosure" printf("epsclos");
"expand_nxt_chk" printf("expnxtck");
"find_table_space" printf("fndtblsp");
"finish_rule" printf("fnshrule");
"firstfree" printf("firstfre");
"firstprot" printf("firstprt");
"flex_gettime" printf("flxgettm");
"flexerror" printf("flxerror");
"flexfatal" printf("flxfatal");
"format_pinpoint_message" printf("fmtptmsg");
"gen_NUL_trans" printf("gnNULtrn");
"gen_backtracking" printf("gnbktrkg");
"gen_bt_action" printf("gnbtactn");
"gen_find_action" printf("gnfndact");
"gen_line_dirs" printf("gnlindir");
"gen_next_compressed_state" printf("gnnxcste");
"gen_next_match" printf("gnnxmtch");
"gen_next_state" printf("gnnxtst");
"gen_start_state" printf("gnstrtst");
"hash_entry" printf("hshentry");
"hashfunct" printf("hshfct");
"increase_max_dfas" printf("incmxdfa");
"indent_put2s" printf("indput2s");
"indent_puts" printf("indputs");
"infilename" printf("infilnam");
"input_files" printf("inp_fles");
"interactive" printf("intractv");
"line_directive_out" printf("lndirout");
"link_machines" printf("lnkmchns");
"list_character_set" printf("lst_cset");
"make_tables" printf("maketbls");
"mark_beginning_as_normal" printf("mkbgnorm");
"mktemplate" printf("mktmplat");
"num_backtracking" printf("nbktrckg");
"num_input_files" printf("ninfiles");
"num_reallocs" printf("numraloc");
"num_rules" printf("numrules");
"num_xlations" printf("nuxlatns");
"numsnpairs" printf("numnpair");
"output_file_name" printf("outfilnm");
"peakpairs" printf("peakpair");
"performance_report" printf("perf_rep");
"pinpoint_message" printf("pptmsg");
"place_state" printf("plcstate");
"previous_continued_action" printf("prvctdan");
"printstats" printf("prtstats");
"program_name" printf("pgm_name");
"protcomst" printf("prtcomst");
"readable_form" printf("rdblefrm");
"real_reject" printf("realrjct");
"reallocate_array" printf("rallocar");
"reject_really_used" printf("rjctused");
"rule_linenum" printf("rulelnno");
"rule_type" printf("ruletype");
"set_input_file" printf("stinpfle");
"set_up_initial_allocations" printf("setupia");
"starttime" printf("startime");
"state_type" printf("ste_type");
"symfollowset" printf("symfollo");
"sympartition" printf("sympartn");
"syntaxerror" printf("syntxerr");
"temp_action_file" printf("tmpactfl");
"todo_head" printf("todohead");
"todo_next" printf("todonext");
"transchar" printf("trnschar");
"transition_struct_out" printf("trnstout");
"trlcontxt" printf("trlcntxt");
"variable_trail_rule" printf("vtrailrl");
"variable_trailing_context_rules" printf("vtrlctrl");
"varlength" printf("varlngth");
"yy_create_buffer" printf("yycrbffr");
"yy_delete_buffer" printf("yydlbffr");
"yy_init_buffer" printf("yyinbffr");
"yy_load_buffer_state" printf("yyldbfst");
"yy_switch_to_buffer" printf("yyswtobf");
"yyerrflag" printf("yyerrflg");
"yymore_really_used" printf("yymrreus");
"yymore_used" printf("yymrused");
"yyrestart" printf("yyrestrt");
. ECHO;
%%
main()
{
yylex();
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,141 +0,0 @@
%{
/* unfixit.l - convert shortened external names to names back to their
* original names. (See fixit.l)
*/
/*
* This program is included to satisfy "dumb" compilers/linkers which
* do not know about externals of names longer than 8 bytes.
*
* Steven W. Layten
* Chemical Abstracts Service
* PO BOX 3012
* Columbus, OH 43210
*/
%}
%%
"actfilnm" printf("action_file_name");
"actnout" printf("action_out");
"addacpt" printf("add_accept");
"alllower" printf("all_lower");
"allupper" printf("all_upper");
"allocarr" printf("allocate_array");
"asscrule" printf("assoc_rule");
"bktrkfil" printf("backtrack_file");
"bktrkrep" printf("backtrack_report");
"bol_nded" printf("bol_needed");
"bldeofac" printf("build_eof_action");
"cclnstal" printf("cclinstal");
"ccllookp" printf("ccllookup");
"cclnegat" printf("cclnegate");
"cclsrted" printf("cclsorted");
"ck4bktrk" printf("check_for_backtracking");
"cktrlcnt" printf("check_trailing_context");
"cntdactn" printf("continued_action");
"copystrn" printf("copy_string");
"cpunsstr" printf("copy_unsigned_string");
"cpyrght" printf("copyright");
"copysngl" printf("copysingl");
"c_mx_ccl" printf("current_max_ccl_tbl_size");
"c_mx_dfa" printf("current_max_dfa_size");
"c_mxdfas" printf("current_max_dfas");
"curmxrls" printf("current_max_rules");
"c_mx_scs" printf("current_max_scs");
"c_mx_tmp" printf("current_max_template_xpairs");
"c_mx_xpr" printf("current_max_xpairs");
"c_mxccls" printf("current_maxccls");
"curr_mns" printf("current_mns");
"cursttyp" printf("current_state_type");
"datflush" printf("dataflush");
"dfacunin" printf("dfaacc_union");
"do_indnt" printf("do_indent");
"dmpasrl" printf("dump_associated_rules");
"dmptrns" printf("dump_transitions");
"dupmach" printf("dupmachine");
"ecsfrmxt" printf("ecs_from_xlation");
"eobstate" printf("end_of_buffer_state");
"epsclos" printf("epsclosure");
"expnxtck" printf("expand_nxt_chk");
"fndtblsp" printf("find_table_space");
"fnshrule" printf("finish_rule");
"firstfre" printf("firstfree");
"firstprt" printf("firstprot");
"flxgettm" printf("flex_gettime");
"flxerror" printf("flexerror");
"flxfatal" printf("flexfatal");
"fmtptmsg" printf("format_pinpoint_message");
"gnNULtrn" printf("gen_NUL_trans");
"gnbktrkg" printf("gen_backtracking");
"gnbtactn" printf("gen_bt_action");
"gnfndact" printf("gen_find_action");
"gnlindir" printf("gen_line_dirs");
"gnnxcste" printf("gen_next_compressed_state");
"gnnxmtch" printf("gen_next_match");
"gnnxtst" printf("gen_next_state");
"gnstrtst" printf("gen_start_state");
"hshentry" printf("hash_entry");
"hshfct" printf("hashfunct");
"incmxdfa" printf("increase_max_dfas");
"indput2s" printf("indent_put2s");
"indputs" printf("indent_puts");
"infilnam" printf("infilename");
"inp_fles" printf("input_files");
"intractv" printf("interactive");
"lndirout" printf("line_directive_out");
"lnkmchns" printf("link_machines");
"lst_cset" printf("list_character_set");
"maketbls" printf("make_tables");
"mkbgnorm" printf("mark_beginning_as_normal");
"mktmplat" printf("mktemplate");
"nbktrckg" printf("num_backtracking");
"ninfiles" printf("num_input_files");
"numraloc" printf("num_reallocs");
"numrules" printf("num_rules");
"nuxlatns" printf("num_xlations");
"numnpair" printf("numsnpairs");
"outfilnm" printf("output_file_name");
"peakpair" printf("peakpairs");
"perf_rep" printf("performance_report");
"pptmsg" printf("pinpoint_message");
"plcstate" printf("place_state");
"prvctdan" printf("previous_continued_action");
"prtstats" printf("printstats");
"pgm_name" printf("program_name");
"prtcomst" printf("protcomst");
"rdblefrm" printf("readable_form");
"realrjct" printf("real_reject");
"rallocar" printf("reallocate_array");
"rjctused" printf("reject_really_used");
"rulelnno" printf("rule_linenum");
"ruletype" printf("rule_type");
"stinpfle" printf("set_input_file");
"setupia" printf("set_up_initial_allocations");
"startime" printf("starttime");
"ste_type" printf("state_type");
"symfollo" printf("symfollowset");
"sympartn" printf("sympartition");
"syntxerr" printf("syntaxerror");
"tmpactfl" printf("temp_action_file");
"todohead" printf("todo_head");
"todonext" printf("todo_next");
"trnschar" printf("transchar");
"trnstout" printf("transition_struct_out");
"trlcntxt" printf("trlcontxt");
"vtrailrl" printf("variable_trail_rule");
"vtrlctrl" printf("variable_trailing_context_rules");
"varlngth" printf("varlength");
"yycrbffr" printf("yy_create_buffer");
"yydlbffr" printf("yy_delete_buffer");
"yyinbffr" printf("yy_init_buffer");
"yyldbfst" printf("yy_load_buffer_state");
"yyswtobf" printf("yy_switch_to_buffer");
"yyerrflg" printf("yyerrflag");
"yymrreus" printf("yymore_really_used");
"yymrused" printf("yymore_used");
"yyrestrt" printf("yyrestart");
. ECHO;
%%
main()
{
yylex();
}

View File

@@ -1,100 +0,0 @@
Notes on the THINK C version of Flex 2.4.6
Scott Hofmann 23-JUL-94
Internet: scotth@visix.com
The only changes needed to compile Flex 2.4.6 under Symantec C++ 6.0 was
to #include <console.h> in main.c and call ccommand() just before flexinit()
in main(). The notes below are mostly of historical significance only; most
of the workarounds below were to get around restrictions/problems in earlier
versions of THINK C. The only section which still applies is Russell Finn's
description of how to make Flex generate output of type 'KAHL'. Also, 4-byte
ints must be used by any project which uses Flex output.
If you want to recreate the project, you'll need to add the files
alloca.c and xmalloc.c in this directory. Both files are copylefted; see
the GNU General Public License for details. You will also need to recompile
both the ANSI and unix libraries to use 4 byte ints, and if you want the
files that flex creates to have 'KAHL' as the creator you'll need to apply
Russell Finn's patch.
Notes on the THINK C version of Flex 2.3.7
Jonas Barklund, 25-JAN-92
Internet: jonas@csd.uu.se
I have merged the sources for Flex version 2.3.7 with the older version
which was hacked for THINK C version 4. I have conditionalized the code
so that I think it should work with both THINK C version 4 and 5 (for
those of you who don't know: the THINK_C symbol is defined as 1 in version
4 and as 5 in version 5). I have put in some missing prototypes, so it
compiles also with "require prototypes" on.
Most of the notes below still apply, in particular that about the MakeRes
program.
Notes on the THINK C version of Flex
Russell S. Finn, 19-FEB-90
Internet: rsfinn@athena.mit.edu, rsfinn@neutron.lcs.mit.edu
CompuServe: 76377,1107
GEnie: RSFINN
Flex appears to be covered by a copyright notice from the University of
California, similar to the one covering Berkeley Unix; the Free Software
Foundation is not part of the picture here. So here is a version
created with THINK C 4.0, along with the source code; as with the
Bison distribution, I am including *all* of the source code I received
with the package.
The current version (modification date January 25, 1990) has only the
bare-bones interface provided by the THINK C library routine "ccommand",
which allows the user to type a command line and to redirect the output.
Perhaps someday I may try to implement a "real" user interface; perhaps
not.
The only modifications made to the source file are surrounded by "#ifdef
THINK_C"..."#endif"; in theory, then, these sources could be recompiled
on another system if necessary. These are the actual files modified:
alloca.c, dfa.c, flexdef.h, main.c, misc.c, scan.c, sym.c. Most of these
changes were minor, and many of them would have been unnecessary if the
original Flex source code had been written for an ANSI-compliant C compiler.
In addition, the file "macutils.c" is completely new; see the discussion
of "MakeRes" below.
THINK C users may find it convenient to have the output text files written
by Flex be THINK C documents. To do this, create a copy of the "ANSI"
project called "ANSI-KAHL", and a copy of the file "fopen.c" called
"fopen-KAHL.c". In the copy, find the routine "setfiletype", and replace
the lines:
if (!(oflag & F_BINARY))
pb.ioFlFndrInfo.fdType = 'TEXT';
with the lines:
if (!(oflag & F_BINARY)) {
pb.ioFlFndrInfo.fdType = 'TEXT';
pb.ioFlFndrInfo.fdCreator = 'KAHL';
}
Replace "fopen.c" with the new "fopen-KAHL.c", rebuild the new project
"ANSI-KAHL", and use this project in the project file "Flex.¹"
instead of the "ANSI" project.
** The "MakeRes" program
The output files created by Flex contain large amounts of preinitialized
static data; the file "scan.c" contained in the Flex.¹ project is one
such file. However, the Macintosh architecture limits normal applications
to 32K of global data. In many cases (including Flex), this limit can
be surpassed by the static data generated by Flex.
The solution I have implemented for the THINK C version of Flex is to
extract the data tables from the Flex output file, and paste them into
the file "MakeRes.c". Then, by recompiling and running the program in
the "MakeRes.¹" project (it is not necessary to create an application),
a resource file called "Flex.¹.rsrc" is created in the current directory.
The Flex output file "scan.c" has been modified to load the static data
from the resource fork of the Flex application. This is done by calling
the "load_table" function, which is defined in the file "macutils.c".
In the application for which I needed Flex, the data tables were small
enough that I didn't need to do this. However, if your application
requires you to do this, simply follow the model of "scan.c"; the MakeRes
project and source code has been included for your use.

View File

@@ -1,195 +0,0 @@
/*
alloca -- (mostly) portable public-domain implementation -- D A Gwyn
last edit: 86/05/30 rms
include config.h, since on VMS it renames some symbols.
Use xmalloc instead of malloc.
This implementation of the PWB library alloca() function,
which is used to allocate space off the run-time stack so
that it is automatically reclaimed upon procedure exit,
was inspired by discussions with J. Q. Johnson of Cornell.
It should work under any C implementation that uses an
actual procedure stack (as opposed to a linked list of
frames). There are some preprocessor constants that can
be defined when compiling for your specific system, for
improved efficiency; however, the defaults should be okay.
The general concept of this implementation is to keep
track of all alloca()-allocated blocks, and reclaim any
that are found to be deeper in the stack than the current
invocation. This heuristic does not reclaim storage as
soon as it becomes invalid, but it will do so eventually.
As a special case, alloca(0) reclaims storage without
allocating any. It is a good idea to use alloca(0) in
your main control loop, etc. to force garbage collection.
*/
#ifndef lint
static char SCCSid[] = "@(#)alloca.c 1.1"; /* for the "what" utility */
#endif
#ifdef emacs
#include "config.h"
#ifdef static
/* actually, only want this if static is defined as ""
-- this is for usg, in which emacs must undefine static
in order to make unexec workable
*/
#ifndef STACK_DIRECTION
you
lose
-- must know STACK_DIRECTION at compile-time
#endif /* STACK_DIRECTION undefined */
#endif /* static */
#endif /* emacs */
#ifndef alloca /* If compiling with GCC, this file's not needed. */
#ifdef __STDC__
typedef void *pointer; /* generic pointer type */
#else
typedef char *pointer; /* generic pointer type */
#endif
#define NULL 0 /* null pointer constant */
extern void free();
extern pointer xmalloc();
/*
Define STACK_DIRECTION if you know the direction of stack
growth for your system; otherwise it will be automatically
deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown
*/
#ifndef STACK_DIRECTION
#define STACK_DIRECTION 0 /* direction unknown */
#endif
#if STACK_DIRECTION != 0
#define STACK_DIR STACK_DIRECTION /* known at compile-time */
#else /* STACK_DIRECTION == 0; need run-time code */
static int stack_dir; /* 1 or -1 once known */
#define STACK_DIR stack_dir
static void
find_stack_direction (/* void */)
{
static char *addr = NULL; /* address of first
`dummy', once known */
auto char dummy; /* to get stack address */
if (addr == NULL)
{ /* initial entry */
addr = &dummy;
find_stack_direction (); /* recurse once */
}
else /* second entry */
if (&dummy > addr)
stack_dir = 1; /* stack grew upward */
else
stack_dir = -1; /* stack grew downward */
}
#endif /* STACK_DIRECTION == 0 */
/*
An "alloca header" is used to:
(a) chain together all alloca()ed blocks;
(b) keep track of stack depth.
It is very important that sizeof(header) agree with malloc()
alignment chunk size. The following default should work okay.
*/
#ifndef ALIGN_SIZE
#define ALIGN_SIZE sizeof(double)
#endif
typedef union hdr
{
char align[ALIGN_SIZE]; /* to force sizeof(header) */
struct
{
union hdr *next; /* for chaining headers */
char *deep; /* for stack depth measure */
} h;
} header;
/*
alloca( size ) returns a pointer to at least `size' bytes of
storage which will be automatically reclaimed upon exit from
the procedure that called alloca(). Originally, this space
was supposed to be taken from the current stack frame of the
caller, but that method cannot be made to work for some
implementations of C, for example under Gould's UTX/32.
*/
static header *last_alloca_header = NULL; /* -> last alloca header */
pointer
alloca (size) /* returns pointer to storage */
unsigned size; /* # bytes to allocate */
{
auto char probe; /* probes stack depth: */
register char *depth = &probe;
#if STACK_DIRECTION == 0
if (STACK_DIR == 0) /* unknown growth direction */
find_stack_direction ();
#endif
/* Reclaim garbage, defined as all alloca()ed storage that
was allocated from deeper in the stack than currently. */
{
register header *hp; /* traverses linked list */
for (hp = last_alloca_header; hp != NULL;)
if ((STACK_DIR > 0 && hp->h.deep > depth)
|| (STACK_DIR < 0 && hp->h.deep < depth))
{
register header *np = hp->h.next;
free ((pointer) hp); /* collect garbage */
hp = np; /* -> next header */
}
else
break; /* rest are not deeper */
last_alloca_header = hp; /* -> last valid storage */
}
if (size == 0)
return NULL; /* no allocation required */
/* Allocate combined header + user data storage. */
{
register pointer new = xmalloc (sizeof (header) + size);
/* address of header */
((header *)new)->h.next = last_alloca_header;
((header *)new)->h.deep = depth;
last_alloca_header = (header *)new;
/* User storage begins just after header. */
return (pointer)((char *)new + sizeof(header));
}
}
#endif /* no alloca */

View File

@@ -1,10 +0,0 @@
/****************
** alloca.h
**
** header for alloca()
*****************/
typedef void *pointer;
pointer alloca(unsigned size);

View File

@@ -1,69 +0,0 @@
/* xmalloc.c -- malloc with out of memory checking
Copyright (C) 1990, 1991 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#if STDC_HEADERS || THINK_C
#include <stdlib.h>
#else
char *malloc ();
char *realloc ();
void free ();
#endif
#ifdef THINK_C
#define error(x, y, z) perror(z) /* Throw out meaningless arguments */
#else
void error ();
#endif
/* Allocate N bytes of memory dynamically, with error checking. */
char *
xmalloc (n)
unsigned n;
{
char *p;
p = malloc (n);
if (p == 0)
/* Must exit with 2 for `cmp'. */
error (2, 0, "virtual memory exhausted");
return p;
}
/* Change the size of an allocated block of memory P to N bytes,
with error checking.
If P is NULL, run xmalloc.
If N is 0, run free and return NULL. */
char *
xrealloc (p, n)
char *p;
unsigned n;
{
if (p == 0)
return xmalloc (n);
if (n == 0)
{
free (p);
return 0;
}
p = realloc (p, n);
if (p == 0)
/* Must exit with 2 for `cmp'. */
error (2, 0, "virtual memory exhausted");
return p;
}

View File

@@ -1,103 +0,0 @@
#
# make file for "flex" tool
# @(#) $Header: /usr/fsys/odin/a/vern/flex/RCS/Makefile,v 2.9
# 90/05/26 17:28:44 vern Exp $ (LBL)
#
# the first time around use "nmake f_flex"
#
# This makefile is specific for Microsoft's Visual C 2.0, & nmake
#
# - Stan Adermann <stana@leonardo.lmt.com>
#
SKELFLAGS = -DDEFAULT_SKELETON_FILE=\"c:/src/flex/flex.skl\"
CFLAGS = -nologo -W2 -F 8000 -Ox -DUSG
LDFLAGS = /nologo /BATCH /STACK:8000
FLEX_FLAGS = -ist8 -Sflex.skl
FLEX = .\flex.exe
CC = cl
YACC = c:\lib\byacc
MAKE = nmake /nologo
FLEXOBJS = \
ccl.obj \
dfa.obj \
ecs.obj \
gen.obj \
main.obj \
misc.obj \
nfa.obj \
parse.obj \
scan.obj \
skel.obj \
sym.obj \
tblcmp.obj \
yylex.obj
FLEX_C_SOURCES = \
ccl.c \
dfa.c \
ecs.c \
gen.c \
main.c \
misc.c \
nfa.c \
parse.c \
scan.c \
skel.c \
sym.c \
tblcmp.c \
yylex.c
all : flex.exe
flex.exe : $(FLEXOBJS)
link $(LDFLAGS) $(FLEXOBJS) -out:$*.exe
f_flex:
copy initscan.c scan.c
touch scan.c
@echo compiling first flex
$(MAKE) flex.exe
del scan.c
@echo using first flex to generate final version...
$(MAKE) flex.exe
#
# general inference rule
#
.c.obj:
$(CC) -c $(CFLAGS) $*.c
parse.h parse.c : parse.y
$(YACC) -d parse.y
@move y_tab.c parse.c
@move y_tab.h parse.h
scan.c : scan.l
$(FLEX) $(FLEX_FLAGS) $(COMPRESSION) scan.l >scan.c
scan.obj : scan.c parse.h flexdef.h
main.obj : main.c flexdef.h
$(CC) $(CFLAGS) -c $(SKELFLAGS) main.c
ccl.obj : ccl.c flexdef.h
dfa.obj : dfa.c flexdef.h
ecs.obj : ecs.c flexdef.h
gen.obj : gen.c flexdef.h
misc.obj : misc.c flexdef.h
nfa.obj : nfa.c flexdef.h
parse.obj : parse.c flexdef.h
sym.obj : sym.c flexdef.h
tblcmp.obj : tblcmp.c flexdef.h
yylex.obj : yylex.c flexdef.h
skel.obj : skel.c flexdef.h
clean :
del *.obj
del *.map

View File

@@ -1,32 +0,0 @@
/* config.h. Generated automatically by configure. */
/* $Header: /home/daffy/u0/vern/flex/RCS/conf.in,v 1.2 95/01/09
12:11:51 vern Exp $ */
/* Define to empty if the keyword does not work. */
/* #undef const */
/* Define to `unsigned' if <sys/types.h> doesn't define. */
/* #undef size_t */
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1
/* Define if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define if you have <alloca.h> and it should be used (not on
Ultrix). */
#define HAVE_ALLOCA_H 0
/* Define if platform-specific command line handling is necessary. */
/* #undef NEED_ARGV_FIXUP */
/* Define if you use FAT file system, leave undefined for NTFS */
#undef SHORT_FILE_NAMES
/* #define SHORT_FILE_NAMES 1 */

View File

@@ -1,34 +0,0 @@
this API is not documented/supported by NeXT and may go away at any time,
so test again when you upgrade (works fine for me on NEXTSTEP_Dev_3.2)
-------------------------------------------------------------------------
See KBNS.32.2.029 from the successor of:
ftp://ftp.cs.orst.edu/software/NeXT/documents/KBNS.32.1.rtf
Otherwise (that successor not yet having been published), ask me for a copy
of the item on RfSchtkt@maze.ruca.ua.ac.be. Bison's messages are not as
disciplined as flex' ones, so it should get more discipline first.
Specifically (in addition to what's described in the KBNS item):
makeUser.o and make_support.o should be added to OBJECTS in Makefile.in
In parse.y, line_pinpoint() (assumption all messages ultimately go there), add:
make_support(
// don't worry about declaring: cc's source doesn't either,
// it seems
syntaxerror?0:1,
NULL,
infilename,
line,
str,
0,0,0
);
FMyIO: in cc, these files contain the word make_support:
ChangeLog-NeXT
Makefile.in
config/next.h: defines REPORT_EVENT in terms of make_support
make_support.c
FMyIO: in cc, these files contain the word REPORT_EVENT:
cccp.c
config/next.h
gcc.c
toplev.c

View File

@@ -1,72 +0,0 @@
# make file for "flex" tool, emx+gcc
release:
$(MAKE) -f Makefile.os2 flex.exe \
CC="gcc -Zomf -O" O=".obj" A=".lib" AR="emxomfar" \
LDFLAGS="-s -Zcrtdll -Zstack 512"
debug:
$(MAKE) -f Makefile.os2 flex.exe \
CC="gcc -g" O=".o" A=".a" AR="ar"
CFLAGS = -DOS2 -DSHORT_FILE_NAMES
YACC = bison
FLEX = flex
FLEX_FLAGS = -ist
.SUFFIXES: .c $O
.c$O:
$(CC) $(CFLAGS) -c $<
FLEXLIB = fl$A
FLEXOBJS = ccl$O dfa$O ecs$O gen$O main$O misc$O nfa$O parse$O \
scan$O skel$O sym$O tblcmp$O yylex$O
LIBOBJS = libmain$O libyywrap$O
flex.exe : $(FLEXOBJS) $(FLEXLIB)
$(CC) $(LDFLAGS) -o $@ $(FLEXOBJS) $(FLEXLIB)
first_flex:
cp initscan.c scan.c
$(MAKE) $(MFLAGS) flex
$(FLEXLIB): $(LIBOBJS)
$(AR) cru $(FLEXLIB) $(LIBOBJS)
$(AR) s $(FLEXLIB)
parse.h parse.c: parse.y
$(YACC) -d -o parse.c parse.y
scan.c : scan.l
$(FLEX) $(FLEX_FLAGS) $(COMPRESSION) scan.l >scan.c
scan$O : scan.c parse.h flexdef.h
main$O : main.c flexdef.h
ccl$O : ccl.c flexdef.h
dfa$O : dfa.c flexdef.h
ecs$O : ecs.c flexdef.h
gen$O : gen.c flexdef.h
misc$O : misc.c flexdef.h
nfa$O : nfa.c flexdef.h
parse$O : parse.c flexdef.h
sym$O : sym.c flexdef.h
tblcmp$O : tblcmp.c flexdef.h
yylex$O : yylex.c flexdef.h
skel.c: flex.skl mkskel.sh
$(SHELL) mkskel.sh flex.skl >skel.c
test : flex
flex $(FLEX_FLAGS) $(COMPRESSION) scan.l | diff scan.c -
bigtest :
rm -f scan.c ; $(MAKE) COMPRESSION="-C" test
rm -f scan.c ; $(MAKE) COMPRESSION="-Ce" test
rm -f scan.c ; $(MAKE) COMPRESSION="-Cm" test
rm -f scan.c ; $(MAKE) COMPRESSION="-Cfe" test
rm -f scan.c ; $(MAKE) COMPRESSION="-CFe" test
rm -f scan.c ; $(MAKE) COMPRESSION="-Cf" test
rm -f scan.c ; $(MAKE) COMPRESSION="-CF" test
rm -f scan.c ; $(MAKE)

View File

@@ -1,28 +0,0 @@
/* ------------------------------------------------ */
/* version of config.h for OS/2 */
/* ------------------------------------------------ */
/* Define to empty if the keyword does not work. */
#undef const
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1
/* Define if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#define HAVE_ALLOCA_H
/* Define if platform-specific command line handling is necessary. */
#define NEED_ARGV_FIXUP
#define argv_fixup(ac,av) { _response(ac,av); _wildcard(ac,av);}

View File

@@ -1,76 +0,0 @@
Miscellaneous flex stuff. The items which have been tested with flex 2.5 are:
- texinfo/, a subdirectory containing a "texinfo" version of flex(1)
and the corresponding "info" files (contributed by Francois Pinard).
- VMS/, a subdirectory containing makefiles, configuration files,
run-time support, and installation notes for building flex 2.5
on VMS (contributed by Pat Rankin).
- Borland/ - makefile and config.h for Borland 4.02 compiler
(contributed by Terrence O Kane, who notes that no source
code changes were necessary).
- NT/ - Makefile and config.h for NT, contributed by Stan Adermann.
- OS2/ - Makefile and config.h for building flex under OS/2,
contributed by Kai Uwe Rommel.
- Amiga/: notes on building flex for the Amiga, contributed
by Andreas Scherer.
- parse.c, parse.h - output of running yacc (byacc, actually)
on parse.y. If your system doesn't have a flavor of yacc available,
copy these into the main flex source directory instead.
- flex.man - preformatted version of flex man page
The following have been tested using flex 2.4:
- debflex.awk, an awk script for anotating flex debug output.
It presently only works with gawk and mawk, not with "old"
or "new" awk.
- NeXT: ProjectBuilder.app support for use in the NeXT world.
- Notes on building flex for the Macintosh using Think-C,
in the Macintosh/ subdirectory.
- testxxLexer.l, a sample C++ program that uses flex's scanner
class option ("-+").
- fastwc/, a subdirectory containing examples of how to use flex
to write progressively higher-performance versions of the Unix
"wc" utility. This certainly should work with 2.5, but hasn't
been tested.
- Borland.old/: notes on building flex 2.4 for Borland C++ 3.1
on MS-DOS. These shouldn't be needed for flex 2.5. Included
only in case you encounter unanticipated difficulties.
- EBCDIC: contact information for building flex for EBCDIC.
The following are all out-of-date with respect to flex release 2.4 (and
in general up-to-date for flex 2.3):
- Atari/Atari.patches, patches for porting flex to the Atari and
to Minix.
- A number of notes and Makefiles for compiling flex under MS-DOS,
in the MSDOS/ subdirectory.
- Notes on building flex for MVS, in the MVS/ subdirectory.
If any of this is out-of-date and can be deleted, please let me know.
And the following is included for compatibility with some broken versions
of bison:
- alloca.c, a public-domain, mostly-portable version of the
alloca() routine (used by bison's parsers) written by D. A. Gwyn.
Many thanks to those who contributed these files. Updated versions will
be appreciated!

View File

@@ -1,83 +0,0 @@
Brief instructions for building flex 2.5.x for VMS:
0) if you have either MMS (from Digital) or MMK (freeware) for use
as a `make' utility, follow the directions in steps #1 through #5 below.
If not, execute
@BUILD.COM xxxC
where "xxxC" is either "VAXC" or "DECC" or "GNUC", and then skip to
step #5.
1) set default to the source directory (not the [.MISC.VMS] subdirectory
where this file is located).
2) COPY [.MISC.VMS]DESCRIP.MMS []*.*
(Recursive invocations of `make' for the `bigcheck' test assume that the
makefile will be found as descrip.mms in the current directory.)
To build with VAX C for VAX/VMS:
3) MMS /MACRO=("VAXC=1") FLEX.EXE
(The /macro qualifier is optional in this case.)
To build with GNU C for VAX/VMS:
2.5) possibly edit descrip.mms to uncomment `SET COMMAND' for GCCINIT,
depending on local site configuration
3) MMS /MACRO=("GNUC=1") FLEX.EXE
To build with DEC C for either VAX/VMS or Alpha/VMS:
3) MMS /MACRO=("DECC=1") FLEX.EXE
(Expect one or two informational messages from the compiler about
implicitly declared functions.)
Minimal testing of the resulting program:
4) MMS CHECK
(If `diff' reports no warnings, the test has succeeded.)
More thorough testing:
4.5) MMS /MACRO=("xxxC=1") BIGCHECK ! "xxxC=1" as in step #3 above
(If using an older version of MMK rather than MMS, this might fail when
`make' is invoked recursively due to excessive BYTLM usage by MMK.)
Installation (the VMS makefile does not support an `install' target;
you'll need to do this part manually):
5) copy flex.exe, flex.doc, flex.skl, flexlib.olb, and FlexLexer.h to
location(s) appropriate for your site. To use flex, define a "foreign"
command by making a DCL symbol whose value begins with a dollar sign
immediately followed by the filename for flex.exe, as in
$ flex :== $local_tools:flex.exe
where `local_tools:' is the logical name pointing to flex.exe's location.
This symbol will ordinarily be a candidate for your login.com. When
invoking flex, upper- or mixed-case command line options must be enclosed
in quotes. For example,
$ flex "-Pxyz" "-L" -t mylexer.l > mylexer.c
(use prefix "xyz" instead of "yy", suppress `#line' compiler directives
in the output, write the output to `stdout', process file mylexer.l,
and capture `stdout' in file mylexer.c). As illustrated here, this VMS
version of flex supports emulation of command line I/O redirection used
by Unix shells.
flex.exe -- the executable image for the flex program;
flex.doc -- documentation, the "man page" describing flex (flex.1
processed with `nroff -man' followed by `col -b');
flex.skl -- a text file containing flex's default skeleton;
with this version of flex, it is for reference only;
flex.exe does not need to know where to find it;
flexlib.olb -- an object library containing some support routines;
you might need to link your generated lexer against
it, depending on how your program is designed;
flex.exe does not access it; it corresponds to
`libfl.a' under Unix;
FlexLexer.h -- header file used for C++ class-based lexers; not
needed for ordinary C lexers.
Notes:
This VMS port of flex supports only the original Unix command line
interface, not the native DCL interface which was available for flex 2.3.
build.com -- DCL command procedure as alternative to descrip.mms;
descrip.mms -- 2.5.x makefile for use with MMS or MMK (see step #1);
mkskel.tpu -- TPU program used to make skel.c from flex.skl for full
build from scratch; performs same function as mkskel.sh;
vms-conf.h -- pre-configured `conf.in', copied to [-.-]config.h;
vms-code.c -- VMS-specific support code, copied to [-.-]vms-code.c;
README.VMS -- this file

View File

@@ -1,155 +0,0 @@
$! VMS build procedure for flex 2.5.x;
$ v = 'f$verify(0)'
$!
$! usage:
$! $ @[.MISC.VMS]BUILD.COM compiler parser [test]
$! where `compiler' is either "GNUC" or "DECC" or "VAXC" or empty
$! and `parser' is either "BISON" or "BYACC" or "YACC" or empty
$! and `[test]' is either "CHECK-ONLY" or "NO-CHECK" or empty
$! empty compiler defaults to VAX C (even under Alpha/VMS);
$! special "LINK" compiler value does link without compilation;
$! empty parser defaults to using supplied parse code in [.MISC];
$! optional test is performed by default.
$!
$
$! we start from [.MISC.VMS], then move to the main source directory
$ where = f$parse("_._;",f$environ("PROCEDURE")) - "_._;"
$ set default 'where'
$ brkt = f$extract(f$length(where)-1,1,where)
$ if f$locate(".MISC.VMS"+brkt,where).lt.f$length(where) then -
set default 'f$string(f$extract(0,1,f$dir()) + "-.-" + brkt)'
$
$ p1 := 'p1'
$ p2 := 'p2'
$ p3 := 'p3'
$ if p1.eqs."LINK" then goto link
$ if p3.eqs."CHECK-ONLY" then goto check
$ p2 = p2 - "_PARSER"
$!
$ CDEFS = "/Define=(""VMS"")" ! =(""VMS"",""DEFAULT_CSIZE=256"")
$!
$ if p1.eqs."GNUC"
$ then CC = "gcc"
$ CFLAGS = "/noList/Opt=2/Debug/noVerbose"
$ LIBS = "gnu_cc:[000000]gcclib.olb/Library, sys$library:vaxcrtl.olb/Library"
$ else CC = "cc"
$ if p1.eqs."DECC"
$ then CFLAGS = "/noList/Prefix=All"
$ LIBS = ""
$ if f$trnlnm("DECC$CC_DEFAULT").nes."" then CC = CC + "/DECC"
$ else CFLAGS = "/noList/Optimize=noInline"
$ LIBS = "sys$share:vaxcrtl.exe/Shareable"
$ if f$trnlnm("DECC$CC_DEFAULT").nes."" then CC = CC + "/VAXC"
$ if p1.nes."" .and. p1.nes."VAXC" then exit %x002C
$ endif
$ endif
$!
$ no_parser = 0
$ if p2.eqs."BISON"
$ then YACC = "bison"
$ YACCFLAGS = "/Defines/Fixed_Outfiles"
$ ALLOCA = ",[]alloca.obj"
$ else
$ YACCFLAGS = "-d"
$ ALLOCA = ""
$ if p2.eqs."BYACC" .or. p2.eqs."YACC"
$ then YACC = f$edit(p2,"LOWERCASE")
$ else YACC = "! yacc"
$ if p2.nes."" .and. p2.nes."NO" .and. p2.nes."NONE" then exit %x002C
$ no_parser = 1
$ endif
$ endif
$!
$ ECHO = "write sys$output"
$ COPY = "copy_"
$ MOVE = "rename_/New_Vers"
$ MUNG = "search_/Exact/Match=NOR"
$ PURGE = "purge_/noConfirm/noLog"
$ REMOVE = "delete_/noConfirm/noLog"
$ TPU = "edit_/TPU/noJournal/noDisplay/noSection"
$!
$ if v then set verify
$!
$ 'COPY' [.misc.vms]vms-conf.h config.h
$ 'COPY' [.misc.vms]vms-code.c vms-code.c
$ 'COPY' [.misc]flex.man flex.doc
$ if ALLOCA.nes."" then 'COPY' [.MISC]alloca.c alloca.c
$ 'COPY' initscan.c scan.c !make.bootstrap
$!
$ if f$search("skel.c").nes."" then -
if f$cvtime(f$file_attr("skel.c","RDT")).gts. -
f$cvtime(f$file_attr("flex.skl","RDT")) then goto skip_mkskel
$ 'TPU' /Command=[.misc.vms]mkskel.tpu flex.skl /Output=skel.c
$skip_mkskel:
$!
$ if f$search("parse.c").nes."" .and. f$search("parse.h").nes."" then -
if f$cvtime(f$file_attr("parse.c","RDT")).gts. -
f$cvtime(f$file_attr("parse.y","RDT")) then goto skip_yacc
$ if f$search("y_tab.%").nes."" then 'REMOVE' y_tab.%;*
$ if no_parser
$ then 'COPY' [.misc]parse.% sys$disk:[]y_tab.*
$ else 'YACC' 'YACCFLAGS' parse.y
$ endif
$ 'MUNG' y_tab.c "#module","#line" /Output=parse.c
$ 'REMOVE' y_tab.c;*
$ 'MOVE' y_tab.h parse.h
$skip_yacc:
$!
$ 'CC' 'CFLAGS' 'CDEFS' /Include=[] ccl.c
$ 'CC' 'CFLAGS' 'CDEFS' /Include=[] dfa.c
$ 'CC' 'CFLAGS' 'CDEFS' /Include=[] ecs.c
$ 'CC' 'CFLAGS' 'CDEFS' /Include=[] gen.c
$ 'CC' 'CFLAGS' 'CDEFS' /Include=[] main.c
$ 'CC' 'CFLAGS' 'CDEFS' /Include=[] misc.c
$ 'CC' 'CFLAGS' 'CDEFS' /Include=[] nfa.c
$ 'CC' 'CFLAGS' 'CDEFS' /Include=[] parse.c
$ 'CC' 'CFLAGS' 'CDEFS' /Include=[] scan.c
$ 'CC' 'CFLAGS' 'CDEFS' /Include=[] skel.c
$ 'CC' 'CFLAGS' 'CDEFS' /Include=[] sym.c
$ 'CC' 'CFLAGS' 'CDEFS' /Include=[] tblcmp.c
$ 'CC' 'CFLAGS' 'CDEFS' /Include=[] yylex.c
$ 'CC' 'CFLAGS' 'CDEFS' /Include=[] vms-code.c
$ if ALLOCA.nes."" then - !bison
'CC' 'CFLAGS' /Define=("STACK_DIRECTION=-1","xmalloc=yy_flex_xmalloc") alloca.c
$!
$ 'CC' 'CFLAGS' 'CDEFS' /Include=[] libmain.c
$ 'CC' 'CFLAGS' 'CDEFS' /Include=[] libyywrap.c
$ library/Obj flexlib.olb/Create libmain.obj,libyywrap.obj/Insert
$ if f$search("flexlib.olb;-1").nes."" then 'PURGE' flexlib.olb
$!
$ open/Write optfile sys$disk:[]crtl.opt
$ write optfile LIBS
$ close optfile
$ if f$search("crtl.opt;-1").nes."" then 'PURGE' crtl.opt
$!
$ version = "# flex ""2.5""" !default, overridden by version.h
$ open/Read/Error=v_h_2 hfile version.h
$ read/End=v_h_1 hfile version
$v_h_1: close/noLog hfile
$v_h_2: version = f$element(1,"""",version)
$ open/Write optfile sys$disk:[]ident.opt
$ write optfile "identification=""flex ''version'"""
$ close optfile
$ if f$search("ident.opt;-1").nes."" then 'PURGE' ident.opt
$!
$link:
$ link/noMap/Exe=flex.exe ccl.obj,dfa.obj,ecs.obj,gen.obj,main.obj,misc.obj,-
nfa.obj,parse.obj,scan.obj,skel.obj,sym.obj,tblcmp.obj,yylex.obj,-
vms-code.obj 'ALLOCA' ,flexlib.olb/Lib,-
sys$disk:[]crtl.opt/Opt,sys$disk:[]ident.opt/Opt
$!
$ if p3.eqs."NO-CHECK" .or. p3.eqs."NOCHECK" then goto done
$
$check:
$ 'ECHO' ""
$ 'ECHO' " Checking with COMPRESSION="""""
$ mcr sys$disk:[]flex.exe -t -p scan.l > scan.chk
$ diff_/Output=_NL:/Maximum_Diff=1 scan.c scan.chk
$ if $status
$ then 'ECHO' " Test passed."
$ 'REMOVE' scan.chk;*
$ else 'ECHO' "? Test failed!"
$ endif
$
$done:
$ exit

View File

@@ -1,311 +0,0 @@
# descrip.mms -- makefile for building `flex' using MMS or MMK on VMS;
# created manually from Makefile.in
# flex 2.5.0 Jan'95
MAKEFILE = descrip.mms # from [.MISC.VMS]
MAKE = $(MMS) /Descr=$(MAKEFILE)
MAKEFLAGS = $(MMSQUALIFIERS)
# Possible values for DEFS:
# "VMS" -- used just to make sure parentheses aren't empty;
# For flex to always generate 8-bit scanners, append
# ,"DEFAULT_CSIZE=256" inside /Define=() of DEFS.
DEFS = /Define=("VMS")
LDFLAGS = /noMap
# compiler handling
.ifdef GNUC
CC = gcc
GCCINIT = ! SET COMMAND GNU_CC:[000000]GCC
CFLAGS = /noList/Opt=2/Debug/noVerbose
LIBS = gnu_cc:[000000]gcclib.olb/Library, sys$library:vaxcrtl.olb/Library
C_CHOICE = "GNUC=1"
.else ! not GNU C
CC = cc
GCCINIT =
.ifdef DECC
CFLAGS = /noList/Prefix=All
LIBS =
C_CHOICE = "DECC=1"
.else ! not DEC C; assume VAX C
CFLAGS = /noList/Optimize=noInline
LIBS = sys$share:vaxcrtl.exe/Shareable
C_CHOICE = "VAXC=1"
.endif
.endif
# parser handling
# mms/macro=("xxxC=1","zzz_parser=1"), where "zzz_parser" is
# either "bison_parser" or "byacc_parser" or "yacc_parser",
# otherwise assumed to be "no_parser"; and where "xxxC=1" is
# either "VAXC=1", "GNUC=1", or "DECC=1" as above
.ifdef bison_parser
YACC = bison
YACCFLAGS = /Defines/Fixed_Outfiles
YACCINIT = set command gnu_bison:[000000]bison
ALLOCA = ,[]alloca.obj # note leading comma
.else
YACCFLAGS = -d
YACCINIT =
ALLOCA =
.ifdef byacc_parser
YACC = byacc
.else
.ifdef yacc_parser
YACC = yacc
.else
# none of bison, byacc, or yacc specified
.ifdef no_parser
.else
no_parser=1
.endif #<none>
.endif #yacc
.endif #byacc
.endif #bison
# VMS-specific hackery
ECHO = write sys$output # requires single quoted arg
COPY = copy_ #
MOVE = rename_/New_Vers # within same device only
MUNG = search_/Exact/Match=NOR # to strip unwanted `#module' directive
NOOP = continue # non-empty command that does nothing
PURGE = purge_/noConfirm/noLog # relatively quiet file removal
REMOVE = delete_/noConfirm/noLog # ditto
TOUCH = append_/New _NL: # requires single file arg
TPU = edit_/TPU/noJournal/noDisplay/noSection
# You can define this to be "lex.exe" if you want to replace lex at your site.
FLEX =flex.exe
# note: there should be no whitespace between `=' and the name,
# or else $(FLEX_EXEC) below will not function properly.
FLEXLIB = flexlib.olb
# You normally do not need to modify anything below this point.
# ------------------------------------------------------------
VMSDIR = [.MISC.VMS]
MISCDIR = [.MISC]
CURDIR = sys$disk:[]
CPPFLAGS = $(DEFS)/Include=[]
LIBOPT = $(CURDIR)crtl.opt # run-time library(s)
ID_OPT = $(CURDIR)ident.opt # version identification
.SUFFIXES : # avoid overhead of umpteen built-in rules
.SUFFIXES : .obj .c
.c.obj :
$(CC)$(CFLAGS)$(CPPFLAGS) $<
VMSHDRS = $(VMSDIR)vms-conf.h # copied to []config.h
VMSSRCS = $(VMSDIR)vms-code.c # copied to []vms-code.c
VMSOBJS = ,vms-code.obj # note leading comma
HEADERS = flexdef.h version.h
SOURCES = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.y \
scan.l skel.c sym.c tblcmp.c yylex.c
OBJECTS = ccl.obj,dfa.obj,ecs.obj,gen.obj,main.obj,misc.obj,nfa.obj,parse.obj,\
scan.obj,skel.obj,sym.obj,tblcmp.obj,yylex.obj $(VMSOBJS) $(ALLOCA)
LIBSRCS = libmain.c libyywrap.c
LIBOBJS = libmain.obj,libyywrap.obj
LINTSRCS = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.c \
scan.c skel.c sym.c tblcmp.c yylex.c
DISTFILES = README NEWS COPYING INSTALL FlexLexer.h \
configure.in conf.in Makefile.in mkskel.sh flex.skl \
$(HEADERS) $(SOURCES) $(LIBSRCS) MISC \
flex.1 scan.c install.sh mkinstalldirs configure
DIST_NAME = flex
# flex options to use when generating scan.c from scan.l
COMPRESSION =
PERF_REPORT = -p
# which "flex" to use to generate scan.c from scan.l
FLEX_EXEC = mcr $(CURDIR)$(FLEX)
FLEX_FLAGS = -t $(PERF_REPORT) #$(COMPRESSION)
MARKER = make.bootstrap
##### targets start here #####
all : $(FLEX) flex.doc
@ $(NOOP)
install : $(FLEX) flex.doc flex.skl $(FLEXLIB) FlexLexer.h
@ $(ECHO) "-- Installation must be done manually."
@ $(ECHO) " $+"
.ifdef GCCINIT
.FIRST
$(GCCINIT)
.endif #GCCINIT
flex : $(FLEX)
@ $(NOOP)
$(FLEX) : $(MARKER) $(OBJECTS) $(FLEXLIB) $(LIBOPT) $(ID_OPT)
$(LINK)/Exe=$(FLEX) $(LDFLAGS)\
$(OBJECTS),$(FLEXLIB)/Lib,$(LIBOPT)/Opt,$(ID_OPT)/Opt
$(MARKER) : initscan.c
@- if f$search("scan.c").nes."" then $(REMOVE) scan.c;*
$(COPY) initscan.c scan.c
@ $(TOUCH) $(MARKER)
parse.c : parse.y
@- if f$search("y_tab.%").nes."" then $(REMOVE) y_tab.%;*
.ifdef no_parser
$(COPY) $(MISCDIR)parse.% $(CURDIR)y_tab.*
.else
$(YACCINIT)
$(YACC) $(YACCFLAGS) parse.y
.endif
$(MUNG) y_tab.c "#module","#line" /Output=parse.c
@- $(REMOVE) y_tab.c;*
$(MOVE) y_tab.h parse.h
parse.h : parse.c
@ $(TOUCH) parse.h
scan.c : scan.l
$(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) scan.l > scan.c
scan.obj : scan.c parse.h flexdef.h config.h
yylex.obj : yylex.c parse.h flexdef.h config.h
skel.c : flex.skl $(VMSDIR)mkskel.tpu
$(TPU) /Command=$(VMSDIR)mkskel.tpu flex.skl /Output=skel.c
main.obj : main.c flexdef.h config.h version.h
ccl.obj : ccl.c flexdef.h config.h
dfa.obj : dfa.c flexdef.h config.h
ecs.obj : ecs.c flexdef.h config.h
gen.obj : gen.c flexdef.h config.h
misc.obj : misc.c flexdef.h config.h
nfa.obj : nfa.c flexdef.h config.h
parse.obj : parse.c flexdef.h config.h
skel.obj : skel.c flexdef.h config.h
sym.obj : sym.c flexdef.h config.h
tblcmp.obj : tblcmp.c flexdef.h config.h
vms-code.obj : vms-code.c flexdef.h config.h
[]alloca.obj : alloca.c
$(CC)$(CFLAGS)/Define=("STACK_DIRECTION=-1","xmalloc=yy_flex_xmalloc") alloca.c
alloca.c : $(MISCDIR)alloca.c
$(COPY) $(MISCDIR)alloca.c alloca.c
config.h : $(VMSDIR)vms-conf.h
$(COPY) $(VMSDIR)vms-conf.h config.h
vms-code.c : $(VMSDIR)vms-code.c
$(COPY) $(VMSDIR)vms-code.c vms-code.c
test : check
@ $(NOOP)
check : $(FLEX)
@ $(ECHO) ""
@ $(ECHO) " Checking with COMPRESSION="$(COMPRESSION)""
$(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) scan.l > scan.chk
diff_/Output=_NL:/Maximum_Diff=1 scan.c scan.chk
bigcheck :
@- if f$search("scan.c").nes."" then $(REMOVE) scan.c;*
$(MAKE)$(MAKEFLAGS) /Macro=($(C_CHOICE),"COMPRESSION=""-C""") check
@- $(REMOVE) scan.c;*
$(MAKE)$(MAKEFLAGS) /Macro=($(C_CHOICE),"COMPRESSION=""-Ce""") check
@- $(REMOVE) scan.c;*
$(MAKE)$(MAKEFLAGS) /Macro=($(C_CHOICE),"COMPRESSION=""-Cm""") check
@- $(REMOVE) scan.c;*
$(MAKE)$(MAKEFLAGS) /Macro=($(C_CHOICE),"COMPRESSION=""-f""") check
@- $(REMOVE) scan.c;*
$(MAKE)$(MAKEFLAGS) /Macro=($(C_CHOICE),"COMPRESSION=""-Cfea""") check
@- $(REMOVE) scan.c;*
$(MAKE)$(MAKEFLAGS) /Macro=($(C_CHOICE),"COMPRESSION=""-CFer""") check
@- $(REMOVE) scan.c;*
$(MAKE)$(MAKEFLAGS) /Macro=($(C_CHOICE),"COMPRESSION=""-l""","PERF_REPORT=") check
@- $(REMOVE) scan.c;*,scan.chk;*
$(MAKE)$(MAKEFLAGS) $(FLEX)
@- $(PURGE) scan.obj
@ $(ECHO) "All checks successful"
$(FLEXLIB) : $(LIBOBJS)
library/Obj $(FLEXLIB)/Create $(LIBOBJS)/Insert
@ if f$search("$(FLEXLIB);-1").nes."" then $(PURGE) $(FLEXLIB)
# We call it .doc instead of .man, to lessen culture shock. :-}
# If MISC/flex.man is out of date relative to flex.1, there's
# not much we can do about it with the tools readily available.
flex.doc : flex.1
@ if f$search("$(MISCDIR)flex.man").eqs."" then \
$(COPY) flex.1 $(MISCDIR)flex.man
$(COPY) $(MISCDIR)flex.man flex.doc
#
# This is completely VMS-specific...
#
# Linker options file specifying run-time library(s) to link against;
# choice depends on which C compiler is used, and might be empty.
$(LIBOPT) : $(MAKEFILE)
@ open/Write optfile $(LIBOPT)
@ write optfile "$(LIBS)"
@ close optfile
# Linker options file putting the version number where the ANALYZE/IMAGE
# command will be able to find and report it; assumes that the first line
# of version.h has the version number enclosed within the first and second
# double quotes on it [as in ``#define FLEX_VERSION "2.5.0"''].
$(ID_OPT) : version.h
@ version = "# flex ""2.5""" !default, overridden by version.h
@- open/Read hfile version.h
@- read hfile version
@- close/noLog hfile
@ version = f$element(1,"""",version)
@ open/Write optfile $(ID_OPT)
@ write optfile "identification=""flex ''version'"""
@ close optfile
#
# This is the only stuff moderately useful from the remainder
# of Makefile.in...
#
mostlyclean :
@- if f$search("scan.chk").nes."" then $(REMOVE) scan.chk;*
@- if f$search("*.obj;-1").nes."" then $(PURGE) *.obj
@- if f$search("*.exe;-1").nes."" then $(PURGE) *.exe
@- if f$search("*.opt;-1").nes."" then $(PURGE) *.opt
clean : mostlyclean
@- if f$search("*.obj").nes."" then $(REMOVE) *.obj;*
@- if f$search("parse.h").nes."" then $(REMOVE) parse.h;*
@- if f$search("parse.c").nes."" then $(REMOVE) parse.c;*
@- if f$search("alloca.c").nes."" .and.-
f$search("$(MISCDIR)alloca.c").nes."" then $(REMOVE) alloca.c;*
@- if f$search("$(LIBOPT)").nes."" then $(REMOVE) $(LIBOPT);*
@- if f$search("$(ID_OPT)").nes."" then $(REMOVE) $(ID_OPT);*
distclean : clean
@- if f$search("$(MARKER)").nes."" then $(REMOVE) $(MARKER);*
@- if f$search("$(FLEX)").nes."" then $(REMOVE) $(FLEX);*
@- if f$search("$(FLEXLIB)").nes."" then $(REMOVE) $(FLEXLIB);*
@- if f$search("flex.doc").nes."" then $(REMOVE) flex.doc;*
@- if f$search("scan.c").nes."" then $(REMOVE) scan.c;*
@- if f$search("vms-code.c").nes."" .and.-
f$search("$(VMSDIR)vms-code.c").nes."" then $(REMOVE) vms-code.c;*
@- if f$search("config.h").nes."" .and.-
f$search("$(VMSDIR)vms-conf.h").nes."" then $(REMOVE) config.h;*
# @- if f$search("descrip.mms").nes."" .and.-
# f$search("$(VMSDIR)descrip.mms").nes."" then $(REMOVE) descrip.mms;*
realclean : distclean
@- if f$search("skel.c").nes."" then $(REMOVE) skel.c;*

View File

@@ -1,45 +0,0 @@
! mkskel.tpu
! usage:
! edit/TPU/noDisplay/noSection/Command=mkskel.tpu flex.skl /Output=skel.c
!
! Create a C source file from the flex skeleton data. Copy the file,
! changing backslash (\) to doubled backslash (\\) and quote (")
! to backslash quote (\"). For each line, insert space+space+quote
! at the beginning and quote+comma at the end. Bracket the updated
! text with several lines of prologue and epilogue.
!
skelfile := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
SET(NO_WRITE, skelfile);
target := '"' | '\'; !do this once, outside loops
POSITION(BEGINNING_OF(skelfile)); !start here
rest_of_line := CREATE_RANGE(MARK(NONE), MARK(NONE)); !also outside loops
LOOP
EXITIF MARK(NONE) = END_OF(skelfile); !are we done yet?
COPY_TEXT(' "'); start_pos := MARK(NONE);
POSITION(LINE_END); end_pos := MARK(NONE);
MODIFY_RANGE(rest_of_line, start_pos, end_pos);
LOOP
next_match := SEARCH_QUIETLY(target, FORWARD, EXACT, rest_of_line);
EXITIF next_match = 0;
POSITION(BEGINNING_OF(next_match));
COPY_TEXT('\'); MOVE_HORIZONTAL(1); !past the matched character
MODIFY_RANGE(rest_of_line, MARK(NONE), end_pos);
ENDLOOP;
POSITION(LINE_END); COPY_TEXT('",');
MOVE_VERTICAL(1); POSITION(LINE_BEGIN); !go to next line
ENDLOOP;
POSITION(BEGINNING_OF(skelfile)); !insert five line prologue
COPY_TEXT('/* File created from flex.skl via mkskel.tpu */'); SPLIT_LINE;
SPLIT_LINE;
COPY_TEXT('#include "flexdef.h"'); SPLIT_LINE;
SPLIT_LINE;
COPY_TEXT('const char *skel[] = {'); SPLIT_LINE;
POSITION(END_OF(skelfile)); !append two line epilogue
COPY_TEXT(' 0'); SPLIT_LINE;
COPY_TEXT('};'); !! SPLIT_LINE;
WRITE_FILE(skelfile, GET_INFO(COMMAND_LINE, "output_file"));
QUIT
!--<eof>--

View File

@@ -1,152 +0,0 @@
/* vms-code.c -- additional VMS-specific support code for flex
*/
#include "flexdef.h"
static const char *original_arg0;
static const char default_arg0[] = "flex.exe";
#define IN_FD 0
#define OUT_FD 1
#define ERR_FD 2
static char *fix_arg0 PROTO((const char *));
/* Command line arguments fixup -- simplify argv[0], and handle `>'
output redirection request; called first thing from main(). */
void argv_fixup( iargc, iargv )
int *iargc;
char ***iargv;
{
const char *mode[3], *rfm[3], *name[3];
char *p;
int i, oargc, punct, which, append, alt_rfm;
/*
* Get original argv[0] supplied by run-time library startup code,
* then replace it with a stripped down one.
*/
original_arg0 = (*iargv)[0];
(*iargv)[0] = fix_arg0(original_arg0);
/*
* Check command line arguments for redirection request(s).
* For simplicity, if multiple attempts are made, the last one wins.
*/
name[0] = name[1] = name[2] = 0;
oargc = 1; /* number of args caller will see; count includes argv[0] */
for (i = 1; i < *iargc; i++) {
p = (*iargv)[i];
switch (*p) {
case '<':
/* might be "<dir>file"; then again, perhaps "<<dir>file" */
punct = (strchr(p, '>') != 0);
if (p[1] == '<') {
if (!punct || p[2] == '<')
flexerror("<<'sentinel' input not supported.");
punct = 0;
}
if (punct) /* the '<' seems to be directory punctuation */
goto arg; /*GOTO*/
mode[IN_FD] = "r";
rfm[IN_FD] = 0;
name[IN_FD] = ++p;
if (!*p && (i + 1) < *iargc)
name[IN_FD] = (*iargv)[++i];
break;
case '>':
append = (p[1] == '>');
if (append) ++p;
alt_rfm = (p[1] == '$');
if (alt_rfm) ++p;
which = (p[1] == '&' ? ERR_FD : OUT_FD);
if (which == ERR_FD) ++p;
mode[which] = append ? "a" : "w";
rfm[which] = alt_rfm ? "rfm=var" : "rfm=stmlf";
name[which] = ++p;
if (!*p && (i + 1) < *iargc)
name[which] = (*iargv)[++i];
break;
case '|':
flexerror("pipe output not supported.");
/*NOTREACHED*/
break;
default:
arg: /* ordinary option or argument */
(*iargv)[oargc++] = p;
break;
}
}
/* perform any requested redirection; don't bother with SYS$xxx logicals */
if (name[IN_FD])
if (!freopen(name[IN_FD], mode[IN_FD], stdin))
lerrsf("failed to redirect `stdin' from \"%s\"", name[IN_FD]);
if (name[OUT_FD])
if (!freopen(name[OUT_FD], mode[OUT_FD], stdout,
rfm[OUT_FD], "rat=cr", "mbc=32", "shr=nil"))
lerrsf("failed to redirect `stdout' to \"%s\"", name[OUT_FD]);
if (name[ERR_FD]) /* likely won't see message if this fails; oh well... */
if (!freopen(name[ERR_FD], mode[ERR_FD], stderr,
rfm[ERR_FD], "rat=cr"))
lerrsf("failed to redirect `stderr' to \"%s\"", name[ERR_FD]);
/* remove any excess arguments (used up from redirection) */
while (*iargc > oargc)
(*iargv)[--*iargc] = 0;
/* all done */
return;
}
/* Pick out the basename of a full filename, and return a pointer
to a modifiable copy of it. */
static char *fix_arg0( arg0 )
const char *arg0;
{
char *p, *new_arg0;
if (arg0) {
/* strip off the path */
if ((p = strrchr(arg0, ':')) != 0) /* device punctuation */
arg0 = p + 1;
if ((p = strrchr(arg0, ']')) != 0) /* directory punctuation */
arg0 = p + 1;
if ((p = strrchr(arg0, '>')) != 0) /* alternate dir punct */
arg0 = p + 1;
}
if (!arg0 || !*arg0)
arg0 = default_arg0;
/* should now have "something.exe;#"; make a modifiable copy */
new_arg0 = copy_string(arg0);
/* strip off ".exe" and/or ";#" (version number),
unless it ended up as the whole name */
if ((p = strchr(new_arg0, '.')) != 0 && (p > new_arg0)
&& (p[1] == 'e' || p[1] == 'E')
&& (p[2] == 'x' || p[2] == 'X')
&& (p[3] == 'e' || p[3] == 'E')
&& (p[4] == ';' || p[4] == '.' || p[4] == '\0'))
*p = '\0';
else if ((p = strchr(new_arg0, ';')) != 0 && (p > new_arg0))
*p = '\0';
return new_arg0;
}
#include <ssdef.h>
#include <stsdef.h>
#ifdef exit
#undef exit
extern void exit PROTO((int)); /* <stdlib.h> ended up prototyping vms_exit */
#endif
/* Convert zero to VMS success and non-zero to VMS failure. The latter
does not bother trying to distinguish between various failure reasons. */
void vms_exit( status )
int status;
{
exit( status == 0 ? SS$_NORMAL : (SS$_ABORT | STS$M_INHIB_MSG) );
}

View File

@@ -1,32 +0,0 @@
/* config.h manually constructed for VMS */
/* Define to empty if the keyword does not work. */
#undef const
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS
/* Define if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define if you have the <string.h> header file. */
#define HAVE_STRING_H
/* Define if you have the <sys/types.h> header file. */
#ifndef __GNUC__
#undef HAVE_SYS_TYPES_H
#else
#define HAVE_SYS_TYPES_H
#endif
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H
/* Extra platform-specific command line handling. */
#define NEED_ARGV_FIXUP
/* Override default exit behavior. */
#define exit vms_exit

View File

@@ -1,484 +0,0 @@
/* alloca.c -- allocate automatically reclaimed memory
(Mostly) portable public-domain implementation -- D A Gwyn
This implementation of the PWB library alloca function,
which is used to allocate space off the run-time stack so
that it is automatically reclaimed upon procedure exit,
was inspired by discussions with J. Q. Johnson of Cornell.
J.Otto Tennant <jot@cray.com> contributed the Cray support.
There are some preprocessor constants that can
be defined when compiling for your specific system, for
improved efficiency; however, the defaults should be okay.
The general concept of this implementation is to keep
track of all alloca-allocated blocks, and reclaim any
that are found to be deeper in the stack than the current
invocation. This heuristic does not reclaim storage as
soon as it becomes invalid, but it will do so eventually.
As a special case, alloca(0) reclaims storage without
allocating any. It is a good idea to use alloca(0) in
your main control loop, etc. to force garbage collection. */
#ifdef HAVE_CONFIG_H
#if defined (emacs) || defined (CONFIG_BROKETS)
#include <config.h>
#else
#include "config.h"
#endif
#endif
/* If compiling with GCC 2, this file's not needed. */
#if !defined (__GNUC__) || __GNUC__ < 2
/* If someone has defined alloca as a macro,
there must be some other way alloca is supposed to work. */
#ifndef alloca
#ifdef emacs
#ifdef static
/* actually, only want this if static is defined as ""
-- this is for usg, in which emacs must undefine static
in order to make unexec workable
*/
#ifndef STACK_DIRECTION
you
lose
-- must know STACK_DIRECTION at compile-time
#endif /* STACK_DIRECTION undefined */
#endif /* static */
#endif /* emacs */
/* If your stack is a linked list of frames, you have to
provide an "address metric" ADDRESS_FUNCTION macro. */
#if defined (CRAY) && defined (CRAY_STACKSEG_END)
long i00afunc ();
#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
#else
#define ADDRESS_FUNCTION(arg) &(arg)
#endif
#if __STDC__
typedef void *pointer;
#else
typedef char *pointer;
#endif
#define NULL 0
/* Different portions of Emacs need to call different versions of
malloc. The Emacs executable needs alloca to call xmalloc, because
ordinary malloc isn't protected from input signals. On the other
hand, the utilities in lib-src need alloca to call malloc; some of
them are very simple, and don't have an xmalloc routine.
Non-Emacs programs expect this to call use xmalloc.
Callers below should use malloc. */
#ifndef emacs
#define malloc xmalloc
#endif
extern pointer malloc ();
/* Define STACK_DIRECTION if you know the direction of stack
growth for your system; otherwise it will be automatically
deduced at run-time.
STACK_DIRECTION > 0 => grows toward higher addresses
STACK_DIRECTION < 0 => grows toward lower addresses
STACK_DIRECTION = 0 => direction of growth unknown */
#ifndef STACK_DIRECTION
#define STACK_DIRECTION 0 /* Direction unknown. */
#endif
#if STACK_DIRECTION != 0
#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
#else /* STACK_DIRECTION == 0; need run-time code. */
static int stack_dir; /* 1 or -1 once known. */
#define STACK_DIR stack_dir
static void
find_stack_direction ()
{
static char *addr = NULL; /* Address of first `dummy', once known. */
auto char dummy; /* To get stack address. */
if (addr == NULL)
{ /* Initial entry. */
addr = ADDRESS_FUNCTION (dummy);
find_stack_direction (); /* Recurse once. */
}
else
{
/* Second entry. */
if (ADDRESS_FUNCTION (dummy) > addr)
stack_dir = 1; /* Stack grew upward. */
else
stack_dir = -1; /* Stack grew downward. */
}
}
#endif /* STACK_DIRECTION == 0 */
/* An "alloca header" is used to:
(a) chain together all alloca'ed blocks;
(b) keep track of stack depth.
It is very important that sizeof(header) agree with malloc
alignment chunk size. The following default should work okay. */
#ifndef ALIGN_SIZE
#define ALIGN_SIZE sizeof(double)
#endif
typedef union hdr
{
char align[ALIGN_SIZE]; /* To force sizeof(header). */
struct
{
union hdr *next; /* For chaining headers. */
char *deep; /* For stack depth measure. */
} h;
} header;
static header *last_alloca_header = NULL; /* -> last alloca header. */
/* Return a pointer to at least SIZE bytes of storage,
which will be automatically reclaimed upon exit from
the procedure that called alloca. Originally, this space
was supposed to be taken from the current stack frame of the
caller, but that method cannot be made to work for some
implementations of C, for example under Gould's UTX/32. */
pointer
alloca (size)
unsigned size;
{
auto char probe; /* Probes stack depth: */
register char *depth = ADDRESS_FUNCTION (probe);
#if STACK_DIRECTION == 0
if (STACK_DIR == 0) /* Unknown growth direction. */
find_stack_direction ();
#endif
/* Reclaim garbage, defined as all alloca'd storage that
was allocated from deeper in the stack than currently. */
{
register header *hp; /* Traverses linked list. */
for (hp = last_alloca_header; hp != NULL;)
if ((STACK_DIR > 0 && hp->h.deep > depth)
|| (STACK_DIR < 0 && hp->h.deep < depth))
{
register header *np = hp->h.next;
free ((pointer) hp); /* Collect garbage. */
hp = np; /* -> next header. */
}
else
break; /* Rest are not deeper. */
last_alloca_header = hp; /* -> last valid storage. */
}
if (size == 0)
return NULL; /* No allocation required. */
/* Allocate combined header + user data storage. */
{
register pointer new = malloc (sizeof (header) + size);
/* Address of header. */
((header *) new)->h.next = last_alloca_header;
((header *) new)->h.deep = depth;
last_alloca_header = (header *) new;
/* User storage begins just after header. */
return (pointer) ((char *) new + sizeof (header));
}
}
#if defined (CRAY) && defined (CRAY_STACKSEG_END)
#ifdef DEBUG_I00AFUNC
#include <stdio.h>
#endif
#ifndef CRAY_STACK
#define CRAY_STACK
#ifndef CRAY2
/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
struct stack_control_header
{
long shgrow:32; /* Number of times stack has grown. */
long shaseg:32; /* Size of increments to stack. */
long shhwm:32; /* High water mark of stack. */
long shsize:32; /* Current size of stack (all segments). */
};
/* The stack segment linkage control information occurs at
the high-address end of a stack segment. (The stack
grows from low addresses to high addresses.) The initial
part of the stack segment linkage control information is
0200 (octal) words. This provides for register storage
for the routine which overflows the stack. */
struct stack_segment_linkage
{
long ss[0200]; /* 0200 overflow words. */
long sssize:32; /* Number of words in this segment. */
long ssbase:32; /* Offset to stack base. */
long:32;
long sspseg:32; /* Offset to linkage control of previous
segment of stack. */
long:32;
long sstcpt:32; /* Pointer to task common address block. */
long sscsnm; /* Private control structure number for
microtasking. */
long ssusr1; /* Reserved for user. */
long ssusr2; /* Reserved for user. */
long sstpid; /* Process ID for pid based multi-tasking. */
long ssgvup; /* Pointer to multitasking thread giveup. */
long sscray[7]; /* Reserved for Cray Research. */
long ssa0;
long ssa1;
long ssa2;
long ssa3;
long ssa4;
long ssa5;
long ssa6;
long ssa7;
long sss0;
long sss1;
long sss2;
long sss3;
long sss4;
long sss5;
long sss6;
long sss7;
};
#else /* CRAY2 */
/* The following structure defines the vector of words
returned by the STKSTAT library routine. */
struct stk_stat
{
long now; /* Current total stack size. */
long maxc; /* Amount of contiguous space which would
be required to satisfy the maximum
stack demand to date. */
long high_water; /* Stack high-water mark. */
long overflows; /* Number of stack overflow ($STKOFEN) calls. */
long hits; /* Number of internal buffer hits. */
long extends; /* Number of block extensions. */
long stko_mallocs; /* Block allocations by $STKOFEN. */
long underflows; /* Number of stack underflow calls ($STKRETN). */
long stko_free; /* Number of deallocations by $STKRETN. */
long stkm_free; /* Number of deallocations by $STKMRET. */
long segments; /* Current number of stack segments. */
long maxs; /* Maximum number of stack segments so far. */
long pad_size; /* Stack pad size. */
long current_address; /* Current stack segment address. */
long current_size; /* Current stack segment size. This
number is actually corrupted by STKSTAT to
include the fifteen word trailer area. */
long initial_address; /* Address of initial segment. */
long initial_size; /* Size of initial segment. */
};
/* The following structure describes the data structure which trails
any stack segment. I think that the description in 'asdef' is
out of date. I only describe the parts that I am sure about. */
struct stk_trailer
{
long this_address; /* Address of this block. */
long this_size; /* Size of this block (does not include
this trailer). */
long unknown2;
long unknown3;
long link; /* Address of trailer block of previous
segment. */
long unknown5;
long unknown6;
long unknown7;
long unknown8;
long unknown9;
long unknown10;
long unknown11;
long unknown12;
long unknown13;
long unknown14;
};
#endif /* CRAY2 */
#endif /* not CRAY_STACK */
#ifdef CRAY2
/* Determine a "stack measure" for an arbitrary ADDRESS.
I doubt that "lint" will like this much. */
static long
i00afunc (long *address)
{
struct stk_stat status;
struct stk_trailer *trailer;
long *block, size;
long result = 0;
/* We want to iterate through all of the segments. The first
step is to get the stack status structure. We could do this
more quickly and more directly, perhaps, by referencing the
$LM00 common block, but I know that this works. */
STKSTAT (&status);
/* Set up the iteration. */
trailer = (struct stk_trailer *) (status.current_address
+ status.current_size
- 15);
/* There must be at least one stack segment. Therefore it is
a fatal error if "trailer" is null. */
if (trailer == 0)
abort ();
/* Discard segments that do not contain our argument address. */
while (trailer != 0)
{
block = (long *) trailer->this_address;
size = trailer->this_size;
if (block == 0 || size == 0)
abort ();
trailer = (struct stk_trailer *) trailer->link;
if ((block <= address) && (address < (block + size)))
break;
}
/* Set the result to the offset in this segment and add the sizes
of all predecessor segments. */
result = address - block;
if (trailer == 0)
{
return result;
}
do
{
if (trailer->this_size <= 0)
abort ();
result += trailer->this_size;
trailer = (struct stk_trailer *) trailer->link;
}
while (trailer != 0);
/* We are done. Note that if you present a bogus address (one
not in any segment), you will get a different number back, formed
from subtracting the address of the first block. This is probably
not what you want. */
return (result);
}
#else /* not CRAY2 */
/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
Determine the number of the cell within the stack,
given the address of the cell. The purpose of this
routine is to linearize, in some sense, stack addresses
for alloca. */
static long
i00afunc (long address)
{
long stkl = 0;
long size, pseg, this_segment, stack;
long result = 0;
struct stack_segment_linkage *ssptr;
/* Register B67 contains the address of the end of the
current stack segment. If you (as a subprogram) store
your registers on the stack and find that you are past
the contents of B67, you have overflowed the segment.
B67 also points to the stack segment linkage control
area, which is what we are really interested in. */
stkl = CRAY_STACKSEG_END ();
ssptr = (struct stack_segment_linkage *) stkl;
/* If one subtracts 'size' from the end of the segment,
one has the address of the first word of the segment.
If this is not the first segment, 'pseg' will be
nonzero. */
pseg = ssptr->sspseg;
size = ssptr->sssize;
this_segment = stkl - size;
/* It is possible that calling this routine itself caused
a stack overflow. Discard stack segments which do not
contain the target address. */
while (!(this_segment <= address && address <= stkl))
{
#ifdef DEBUG_I00AFUNC
fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
#endif
if (pseg == 0)
break;
stkl = stkl - pseg;
ssptr = (struct stack_segment_linkage *) stkl;
size = ssptr->sssize;
pseg = ssptr->sspseg;
this_segment = stkl - size;
}
result = address - this_segment;
/* If you subtract pseg from the current end of the stack,
you get the address of the previous stack segment's end.
This seems a little convoluted to me, but I'll bet you save
a cycle somewhere. */
while (pseg != 0)
{
#ifdef DEBUG_I00AFUNC
fprintf (stderr, "%011o %011o\n", pseg, size);
#endif
stkl = stkl - pseg;
ssptr = (struct stack_segment_linkage *) stkl;
size = ssptr->sssize;
pseg = ssptr->sspseg;
result += size;
}
return (result);
}
#endif /* not CRAY2 */
#endif /* CRAY */
#endif /* no alloca */
#endif /* not GCC version 2 */

View File

@@ -1,119 +0,0 @@
# Clarify the flex debug trace by substituting first line of each rule.
# Francois Pinard <pinard@iro.umontreal.ca>, July 1990.
#
# Rewritten to process correctly \n's in scanner input.
# BEGIN section modified to correct a collection of rules.
# Michal Jaegermann <michal@phys.ualberta.ca>, December 1993
#
# Sample usage:
# flex -d PROGRAM.l
# gcc -o PROGRAM PROGRAM.c -lfl
# PROGRAM 2>&1 | gawk -f debflex.awk PROGRAM.l
#
# (VP's note: this script presently does not work with either "old" or
# "new" awk; fixes so it does will be welcome)
BEGIN {
# Insure proper usage.
if (ARGC != 2) {
print "usage: gawk -f debflex.awk FLEX_SOURCE <DEBUG_OUTPUT";
exit (1);
}
# Remove and save the name of flex source.
source = ARGV[1];
ARGC--;
# Swallow the flex source file.
line = 0;
section = 1;
while (getline <source) {
# Count the lines.
line++;
# Count the sections. When encountering section 3,
# break out of the awk BEGIN block.
if (match ($0, /^%%/)) {
section++;
if (section == 3) {
break;
}
}
else {
# Only the lines in section 2 which do not begin in a
# tab or space might be referred to by the flex debug
# trace. Save only those lines.
if (section == 2 && match ($0, /^[^ \t]/)) {
rules[line] = $0;
}
}
}
dashes = "-----------------------------------------------------------";
collect = "";
line = 0;
}
# collect complete rule output from a scanner
$0 !~ /^--/ {
collect = collect "\n" $0;
next;
}
# otherwise we have a new rule - process what we got so far
{
process();
}
# and the same thing if we hit EOF
END {
process();
}
function process() {
# splitting this way we loose some double dashes and
# left parentheses from echoed input - a small price to pay
n = split(collect, field, "\n--|[(]");
# this loop kicks in only when we already collected something
for (i = 1; i <= n; i++) {
if (0 != line) {
# we do not care for traces of newlines.
if (0 == match(field[i], /\"\n+\"[)]/)) {
if (rules[line]) {
text = field[i];
while ( ++i <= n) {
text = text field[i];
}
printf("%s:%d: %-8s -- %s\n",
source, line, text, rules[line]);
}
else {
print;
printf "%s:%d: *** No such rule.\n", source, line;
}
}
line = 0;
break;
}
if ("" != field[i]) {
if ("end of buffer or a NUL)" == field[i]) {
print dashes; # Simplify trace of buffer reloads
continue;
}
if (match(field[i], /accepting rule at line /)) {
# force interpretation of line as a number
line = 0 + substr(field[i], RLENGTH);
continue;
}
# echo everything else
printf("--%s\n", field[i]);
}
}
collect = "\n" $0; # ... and start next trace
}

View File

@@ -1,56 +0,0 @@
This directory contains some examples illustrating techniques for extracting
high-performance from flex scanners. Each program implements a simplified
version of the Unix "wc" tool: read text from stdin and print the number of
characters, words, and lines present in the text. All programs were compiled
using gcc (version unavailable, sorry) with the -O flag, and run on a
SPARCstation 1+. The input used was a PostScript file, mainly containing
figures, with the following "wc" counts:
lines words characters
214217 635954 2592172
The basic principles illustrated by these programs are:
- match as much text with each rule as possible
- adding rules does not slow you down!
- avoid backing up
and the big caveat that comes with them is:
- you buy performance with decreased maintainability; make
sure you really need it before applying the above techniques.
See the "Performance Considerations" section of flexdoc for more
details regarding these principles.
The different versions of "wc":
mywc.c
a simple but fairly efficient C version
wc1.l a naive flex "wc" implementation
wc2.l somewhat faster; adds rules to match multiple tokens at once
wc3.l faster still; adds more rules to match longer runs of tokens
wc4.l fastest; still more rules added; hard to do much better
using flex (or, I suspect, hand-coding)
wc5.l identical to wc3.l except one rule has been slightly
shortened, introducing backing-up
Timing results (all times in user CPU seconds):
program time notes
------- ---- -----
wc1 16.4 default flex table compression (= -Cem)
wc1 6.7 -Cf compression option
/bin/wc 5.8 Sun's standard "wc" tool
mywc 4.6 simple but better C implementation!
wc2 4.6 as good as C implementation; built using -Cf
wc3 3.8 -Cf
wc4 3.3 -Cf
wc5 5.7 -Cf; ouch, backing up is expensive

View File

@@ -1,26 +0,0 @@
/* A simple but fairly efficient C version of the Unix "wc" tool */
#include <stdio.h>
#include <ctype.h>
main()
{
register int c, cc = 0, wc = 0, lc = 0;
FILE *f = stdin;
while ((c = getc(f)) != EOF) {
++cc;
if (isgraph(c)) {
++wc;
do {
c = getc(f);
if (c == EOF)
goto done;
++cc;
} while (isgraph(c));
}
if (c == '\n')
++lc;
}
done: printf( "%8d%8d%8d\n", lc, wc, cc );
}

View File

@@ -1,18 +0,0 @@
/* First cut at a flex-based "wc" tool. */
ws [ \t]
nonws [^ \t\n]
%%
int cc = 0, wc = 0, lc = 0;
{nonws}+ cc += yyleng; ++wc;
{ws}+ cc += yyleng;
\n ++lc; ++cc;
<<EOF>> {
printf( "%8d %8d %8d\n", lc, wc, cc );
yyterminate();
}

View File

@@ -1,20 +0,0 @@
/* Somewhat faster "wc" tool: match more text with each rule */
ws [ \t]
nonws [^ \t\n]
word {ws}*{nonws}+
%%
int cc = 0, wc = 0, lc = 0;
{word}{ws}* cc += yyleng; ++wc;
{word}{ws}*\n cc += yyleng; ++wc; ++lc;
{ws}+ cc += yyleng;
\n+ cc += yyleng; lc += yyleng;
<<EOF>> {
printf( "%8d %8d %8d\n", lc, wc, cc );
yyterminate();
}

View File

@@ -1,24 +0,0 @@
/* Somewhat faster still: potentially match a lot of text with each rule */
ws [ \t]
nonws [^ \t\n]
word {ws}*{nonws}+
words {word}{ws}+
%%
int cc = 0, wc = 0, lc = 0;
{word}{ws}* cc += yyleng; ++wc;
{word}{ws}*\n cc += yyleng; ++wc; ++lc;
{words}{word}{ws}* cc += yyleng; wc += 2;
{words}{2}{word}{ws}* cc += yyleng; wc += 3;
{words}{3}{word}{ws}* cc += yyleng; wc += 4;
{ws}+ cc += yyleng;
\n+ cc += yyleng; lc += yyleng;
<<EOF>> {
printf( "%8d %8d %8d\n", lc, wc, cc );
yyterminate();
}

View File

@@ -1,27 +0,0 @@
/* Fastest version of wc: add rules to pick up newlines, too */
ws [ \t]
nonws [^ \t\n]
word {ws}*{nonws}+
words {word}{ws}+
%%
int cc = 0, wc = 0, lc = 0;
{word}{ws}* ++wc; cc += yyleng;
{word}{ws}*\n ++wc; cc += yyleng; ++lc;
{words}{word}{ws}* wc += 2; cc += yyleng;
{words}{word}{ws}*\n wc += 2; cc += yyleng; ++lc;
{words}{2}{word}{ws}* wc += 3; cc += yyleng;
{words}{2}{word}{ws}*\n wc += 3; cc += yyleng; ++lc;
{words}{3}{word}{ws}* wc += 4; cc += yyleng;
{words}{3}{word}{ws}*\n wc += 4; cc += yyleng; ++lc;
{ws}+ cc += yyleng;
\n+ cc += yyleng; lc += yyleng;
<<EOF>> {
printf( "%8d %8d %8d\n", lc, wc, cc );
yyterminate();
}

View File

@@ -1,24 +0,0 @@
/* Oops; slight change from wc3.l introduces backtracking */
ws [ \t]
nonws [^ \t\n]
word {ws}*{nonws}+
words {word}{ws}+
%%
int cc = 0, wc = 0, lc = 0;
{word}{ws}* cc += yyleng; ++wc;
{word}{ws}*\n cc += yyleng; ++wc; ++lc;
{words}{word} cc += yyleng; wc += 2; /* oops */
{words}{2}{word}{ws}* cc += yyleng; wc += 3;
{words}{3}{word}{ws}* cc += yyleng; wc += 4;
{ws}+ cc += yyleng;
\n+ cc += yyleng; lc += yyleng;
<<EOF>> {
printf( "%8d %8d %8d\n", lc, wc, cc );
yyterminate();
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,24 +0,0 @@
#define CHAR 257
#define NUMBER 258
#define SECTEND 259
#define SCDECL 260
#define XSCDECL 261
#define NAME 262
#define PREVCCL 263
#define EOF_OP 264
#define OPTION_OP 265
#define OPT_OUTFILE 266
#define OPT_PREFIX 267
#define OPT_YYCLASS 268
#define CCE_ALNUM 269
#define CCE_ALPHA 270
#define CCE_BLANK 271
#define CCE_CNTRL 272
#define CCE_DIGIT 273
#define CCE_GRAPH 274
#define CCE_LOWER 275
#define CCE_PRINT 276
#define CCE_PUNCT 277
#define CCE_SPACE 278
#define CCE_UPPER 279
#define CCE_XDIGIT 280

View File

@@ -1,58 +0,0 @@
// An example of using the flex C++ scanner class.
%option C++ noyywrap
%{
int mylineno = 0;
%}
string \"[^\n"]+\"
ws [ \t]+
alpha [A-Za-z]
dig [0-9]
name ({alpha}|{dig}|\$)({alpha}|{dig}|\_|\.|\-|\/|\$)*
num1 [-+]?{dig}+\.?([eE][-+]?{dig}+)?
num2 [-+]?{dig}*\.{dig}+([eE][-+]?{dig}+)?
number {num1}|{num2}
%%
{ws} /* skip blanks and tabs */
"/*" {
int c;
while((c = yyinput()) != 0)
{
if(c == '\n')
++mylineno;
else if(c == '*')
{
if((c = yyinput()) == '/')
break;
else
unput(c);
}
}
}
{number} cout << "number " << YYText() << '\n';
\n mylineno++;
{name} cout << "name " << YYText() << '\n';
{string} cout << "string " << YYText() << '\n';
%%
int main( int /* argc */, char** /* argv */ )
{
FlexLexer* lexer = new yyFlexLexer;
while(lexer->yylex() != 0)
;
return 0;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,263 +0,0 @@
# @(#) $Header$ (LBL)
@SET_MAKE@
# Possible values for DEFS:
#
# By default, flex generates 8-bit scanners when using table compression,
# and 7-bit scanners when using uncompressed tables (-f or -F options).
# For flex to always generate 8-bit scanners, add "-DDEFAULT_CSIZE=256"
# to DEFS.
#
# For Vax/VMS, add "-DVMS" to DEFS.
#
# For MS-DOS, add "-DMS_DOS" to DEFS. See the directory MISC/MSDOS for
# additional info.
CFLAGS = @CFLAGS@
CPPFLAGS = @CPPFLAGS@
DEFS = @DEFS@
LDFLAGS = -stack 256k
LIBS = @LIBS@
# Installation targeting. Files will be installed under the tree
# rooted at prefix. flex will be installed in bindir, libfl.a in
# libdir, FlexLexer.h will be installed in includedir, and the manual
# pages will be installed in mandir with extension manext.
#
# Raw, unformatted troff source will be installed if INSTALLMAN=man,
# nroff preformatted versions will be installed if INSTALLMAN=cat.
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
includedir = $(prefix)/include
manext = 1
mandir = $(prefix)/man/man$(manext)
# You can define these to be "lex" and "libl.a" if you want to replace
# lex at your site.
FLEX = flex
FLEXLIB = libfl.a
INSTALLMAN = man
SHELL = /bin/sh
srcdir = @srcdir@
VPATH = @srcdir@
LN_S = @LN_S@
YACC = @YACC@
CC = @CC@
AR = ar
RANLIB = @RANLIB@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
# You normally do not need to modify anything below this point.
# ------------------------------------------------------------
CPPFLAGS = -I. -I$(srcdir)
.c.o:
$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
HEADERS = flexdef.h version.h
SOURCES = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.y \
scan.l skel.c sym.c tblcmp.c yylex.c
OBJECTS = ccl.o dfa.o ecs.o gen.o main.o misc.o nfa.o parse.o \
scan.o skel.o sym.o tblcmp.o yylex.o @ALLOCA@
LIBSRCS = libmain.c libyywrap.c
LIBOBJS = libmain.o libyywrap.o
LINTSRCS = ccl.c dfa.c ecs.c gen.c main.c misc.c nfa.c parse.c \
scan.c skel.c sym.c tblcmp.c yylex.c
DISTFILES = README NEWS COPYING INSTALL FlexLexer.h \
configure.in conf.in Makefile.in mkskel.sh flex.skl \
$(HEADERS) $(SOURCES) $(LIBSRCS) MISC \
flex.1 scan.c install.sh mkinstalldirs configure
DIST_NAME = flex
# which "flex" to use to generate scan.c from scan.l
FLEX_EXEC = ./$(FLEX)
FLEX_FLAGS = -t $(PERF_REPORT)
COMPRESSION =
PERF_REPORT = -p
include ../bigmake.inc
all: $(FLEX)
$(FLEX): .bootstrap $(OBJECTS) $(FLEXLIB)
$(CC) $(CFLAGS) -o $(FLEX) $(LDFLAGS) $(OBJECTS) $(FLEXLIB) $(LIBS)
.bootstrap: initscan.c
@rm -f scan.c
cp $(srcdir)/initscan.c scan.c
touch .bootstrap
parse.c: parse.y
$(YACC) -d $(srcdir)/parse.y
@sed '/extern char.*malloc/d' <y.tab.c >parse.tmp
@mv parse.tmp parse.c
@mv y.tab.h parse.h
@rm -f y.tab.c
parse.h: parse.c
scan.c: scan.l
$(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) $(srcdir)/scan.l >scan.c
@sed s,\"$(srcdir)/scan.l\",\"scan.l\", <scan.c >scan.tmp
@mv scan.tmp scan.c
scan.o: scan.c parse.h flexdef.h config.h
yylex.o: yylex.c parse.h flexdef.h config.h
skel.c: flex.skl mkskel.sh
$(SHELL) $(srcdir)/mkskel.sh $(srcdir)/flex.skl >skel.c
main.o: main.c flexdef.h config.h version.h
ccl.o: ccl.c flexdef.h config.h
dfa.o: dfa.c flexdef.h config.h
ecs.o: ecs.c flexdef.h config.h
gen.o: gen.c flexdef.h config.h
misc.o: misc.c flexdef.h config.h
nfa.o: nfa.c flexdef.h config.h
parse.o: parse.c flexdef.h config.h
skel.o: skel.c flexdef.h config.h
sym.o: sym.c flexdef.h config.h
tblcmp.o: tblcmp.c flexdef.h config.h
alloca.o: alloca.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c -Dxmalloc=yy_flex_xmalloc alloca.c
alloca.c: $(srcdir)/MISC/alloca.c
@rm -f alloca.c
cp $(srcdir)/MISC/alloca.c .
test: check
check: $(FLEX)
$(FLEX_EXEC) $(FLEX_FLAGS) $(COMPRESSION) $(srcdir)/scan.l \
| sed s,\"$(srcdir)/scan.l\",\"scan.l\", \
| diff scan.c -
@echo "Check successful, using COMPRESSION=\"$(COMPRESSION)\""
bigcheck:
rm -f scan.c ; $(MAKE) COMPRESSION="-C" check
rm -f scan.c ; $(MAKE) COMPRESSION="-Ce" check
rm -f scan.c ; $(MAKE) COMPRESSION="-Cm" check
rm -f scan.c ; $(MAKE) COMPRESSION="-f" check
rm -f scan.c ; $(MAKE) COMPRESSION="-Cfea" check
rm -f scan.c ; $(MAKE) COMPRESSION="-CFer" check
rm -f scan.c ; $(MAKE) COMPRESSION="-l" PERF_REPORT="" check
rm -f scan.c ; $(MAKE)
@echo "All checks successful"
$(FLEXLIB): $(LIBOBJS)
$(AR) cru $(FLEXLIB) $(LIBOBJS)
-$(RANLIB) $(FLEXLIB)
$(FLEX).man: flex.1
cd $(srcdir) && nroff -man flex.1 >$(FLEX).man
install: $(FLEX) $(FLEXLIB) installdirs install.$(INSTALLMAN)
$(INSTALL_PROGRAM) $(FLEX) $(bindir)/$(FLEX)
@rm -f $(bindir)/$(FLEX)++
cd $(bindir) && $(LN_S) $(FLEX) $(FLEX)++
$(INSTALL_DATA) $(FLEXLIB) $(libdir)/$(FLEXLIB)
-cd $(libdir) && $(RANLIB) $(FLEXLIB)
$(INSTALL_DATA) $(srcdir)/FlexLexer.h $(includedir)/FlexLexer.h
# Note, the following rules delete any vestigial flexdoc installed
# for a prior flex release.
install.man: flex.1
rm -f $(mandir)/$(FLEX)doc.$(manext)
$(INSTALL_DATA) $(srcdir)/flex.1 $(mandir)/$(FLEX).$(manext)
install.cat: $(FLEX).man
rm -f $(mandir)/$(FLEX)doc.$(manext)
$(INSTALL_DATA) $(srcdir)/$(FLEX).man $(mandir)/$(FLEX).$(manext)
installdirs:
$(SHELL) $(srcdir)/mkinstalldirs \
$(bindir) $(libdir) $(includedir) $(mandir)
uninstall:
rm -f $(bindir)/$(FLEX) $(bindir)/$(FLEX)++
rm -f $(libdir)/$(FLEXLIB)
rm -f $(includedir)/FlexLexer.h
rm -f $(mandir)/$(FLEX).$(manext) $(mandir)/$(FLEX)doc.$(manext)
tags: $(SOURCES)
ctags $(SOURCES)
TAGS: $(SOURCES)
etags $(SOURCES)
lint: $(LINTSRCS)
lint -Dconst= $(LINTSRCS) > flex.lint
gcc-lint: $(LINTSRCS)
gcc -Dlint -Wall $(LINTSRCS) >flex.gcc-lint 2>&1
mostlyclean:
rm -f a.out *.bak core errs scan.tmp
clean: mostlyclean
rm -f flex parse.c parse.h *.o alloca.c *.lint lex.yy.c lex.yy.cc \
$(FLEXLIB) config.log config.cache
distclean: clean
rm -f .bootstrap $(FLEX) scan.c tags TAGS Makefile config.status \
config.h stamp-h config.log config.cache
maintainer-clean: distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
rm -f $(FLEX).man skel.c flex*.tar.gz flex*.tar.Z
dist: $(FLEX) $(DISTFILES) parse.c parse.h $(srcdir)/$(FLEX).man
$(MAKE) DIST_NAME=flex-`sed <version.h 's/[^"]*"//' | sed 's/"//'` dist2
dist2:
@rm -rf $(DIST_NAME)
@rm -f $(DIST_NAME).tar $(DIST_NAME).tar.Z $(DIST_NAME).tar.gz
@mkdir $(DIST_NAME)
tar cf - $(DISTFILES) | (cd $(DIST_NAME) && tar xfB -)
@mv $(DIST_NAME)/scan.c $(DIST_NAME)/initscan.c
@chmod 444 $(DIST_NAME)/initscan.c
@chmod +w $(DIST_NAME)/Makefile.in
@cp parse.c parse.h $(DIST_NAME)/MISC
@col -b <$(srcdir)/$(FLEX).man >$(DIST_NAME)/MISC/flex.man
tar chf $(DIST_NAME).tar $(DIST_NAME)
compress <$(DIST_NAME).tar >$(DIST_NAME).tar.Z
gzip <$(DIST_NAME).tar >$(DIST_NAME).tar.gz
@rm $(DIST_NAME).tar
# For an explanation of the following Makefile rules, see node
# `Automatic Remaking' in GNU Autoconf documentation.
Makefile: $(srcdir)/Makefile.in config.status
CONFIG_FILES=$@ CONFIG_HEADERS= ./config.status
config.status: configure
./config.status --recheck
configure: configure.in
cd $(srcdir) && autoconf
#config.h: stamp-h
stamp-h: conf.in config.status
CONFIG_FILES= CONFIG_HEADERS=config.h:conf.in ./config.status
echo timestamp >stamp-h
# conf.in: stamp-h.in
# stamp-h.in: configure.in acconfig.h
# cd $(srcdir) && autoheader
# config.h.in conf.in
# cho timestamp > $(srcdir)/stamp-h.in
# Tell versions [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

File diff suppressed because it is too large Load Diff

View File

@@ -1,60 +0,0 @@
This is release 2.5 of flex. See "version.h" for the exact patch-level.
See the file "NEWS" to find out what is new in this Flex release.
Read the file "INSTALL" for general installation directives. Peek near
the beginning of the file "Makefile.in" for special DEFS values. On most
systems, you can just run the "configure" script and type "make" to build
flex; then "make check" to test whether it built correctly; and if it did,
then "make install" to install it.
If you're feeling adventurous, you can also issue "make bigcheck" (be
prepared to wait a while).
Note that flex is distributed under a copyright very similar to that of
BSD Unix, and not under the GNU General Public License (GPL), except for
the "configure" script, which is covered by the GPL.
Many thanks to the 2.5 beta-testers for finding bugs and helping test and
increase portability: Stan Adermann, Scott David Daniels, Charles Elliott,
Joe Gayda, Chris Meier, James Nordby, Terrence O'Kane, Karsten Pahnke,
Francois Pinard, Pat Rankin, Andreas Scherer, Marc Wiese, Nathan Zelle.
Please send bug reports and feedback to: Vern Paxson (vern@ee.lbl.gov).
The flex distribution consists of the following files:
README This message
NEWS Differences between the various releases
INSTALL General installation information
COPYING flex's copyright
conf.in, configure.in, configure, Makefile.in, install.sh,
mkinstalldirs
elements of the "autoconf" auto-configuration process
flexdef.h, parse.y, scan.l, ccl.c, dfa.c, ecs.c, gen.c, main.c,
misc.c, nfa.c, sym.c, tblcmp.c, yylex.c
source files
version.h version of this flex release
flex.skl flex scanner skeleton
mkskel.sh script for converting flex.skl to C source file skel.c
skel.c pre-converted C version of flex.skl
libmain.c flex library (-lfl) sources
libyywrap.c
initscan.c pre-flex'd version of scan.l
FlexLexer.h header file for C++ lexer class
flex.1 user documentation
MISC/ a directory containing miscellaneous contributions.
See MISC/README for details.

View File

@@ -1,4 +0,0 @@
#!/bin/sh
make clean
sh makeme.sh
make install

View File

@@ -1,149 +0,0 @@
/* ccl - routines for character classes */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Vern Paxson.
*
* The United States Government has rights in this work pursuant
* to contract no. DE-AC03-76SF00098 between the United States
* Department of Energy and the University of California.
*
* Redistribution and use in source and binary forms with or without
* modification are permitted provided that: (1) source distributions retain
* this entire copyright notice and comment, and (2) distributions including
* binaries display the following acknowledgement: ``This product includes
* software developed by the University of California, Berkeley and its
* contributors'' in the documentation or other materials provided with the
* distribution and in all advertising materials mentioning features or use
* of this software. Neither the name of the University nor the names of
* its contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header$ */
#include "flexdef.h"
/* ccladd - add a single character to a ccl */
void ccladd( cclp, ch )
int cclp;
int ch;
{
int ind, len, newpos, i;
check_char( ch );
len = ccllen[cclp];
ind = cclmap[cclp];
/* check to see if the character is already in the ccl */
for ( i = 0; i < len; ++i )
if ( ccltbl[ind + i] == ch )
return;
newpos = ind + len;
if ( newpos >= current_max_ccl_tbl_size )
{
current_max_ccl_tbl_size += MAX_CCL_TBL_SIZE_INCREMENT;
++num_reallocs;
ccltbl = reallocate_Character_array( ccltbl,
current_max_ccl_tbl_size );
}
ccllen[cclp] = len + 1;
ccltbl[newpos] = ch;
}
/* cclinit - return an empty ccl */
int cclinit()
{
if ( ++lastccl >= current_maxccls )
{
current_maxccls += MAX_CCLS_INCREMENT;
++num_reallocs;
cclmap = reallocate_integer_array( cclmap, current_maxccls );
ccllen = reallocate_integer_array( ccllen, current_maxccls );
cclng = reallocate_integer_array( cclng, current_maxccls );
}
if ( lastccl == 1 )
/* we're making the first ccl */
cclmap[lastccl] = 0;
else
/* The new pointer is just past the end of the last ccl.
* Since the cclmap points to the \first/ character of a
* ccl, adding the length of the ccl to the cclmap pointer
* will produce a cursor to the first free space.
*/
cclmap[lastccl] = cclmap[lastccl - 1] + ccllen[lastccl - 1];
ccllen[lastccl] = 0;
cclng[lastccl] = 0; /* ccl's start out life un-negated */
return lastccl;
}
/* cclnegate - negate the given ccl */
void cclnegate( cclp )
int cclp;
{
cclng[cclp] = 1;
}
/* list_character_set - list the members of a set of characters in CCL form
*
* Writes to the given file a character-class representation of those
* characters present in the given CCL. A character is present if it
* has a non-zero value in the cset array.
*/
void list_character_set( file, cset )
FILE *file;
int cset[];
{
register int i;
putc( '[', file );
for ( i = 0; i < csize; ++i )
{
if ( cset[i] )
{
register int start_char = i;
putc( ' ', file );
fputs( readable_form( i ), file );
while ( ++i < csize && cset[i] )
;
if ( i - 1 > start_char )
/* this was a run */
fprintf( file, "-%s", readable_form( i - 1 ) );
putc( ' ', file );
}
}
putc( ']', file );
}

View File

@@ -1,25 +0,0 @@
/* $Header$ */
/* Define to empty if the keyword does not work. */
#undef const
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
#undef HAVE_ALLOCA_H
/* Define if platform-specific command line handling is necessary. */
#undef NEED_ARGV_FIXUP

File diff suppressed because it is too large Load Diff

View File

@@ -1,24 +0,0 @@
dnl Process this file with autoconf to produce a configure script.
dnl
AC_INIT(initscan.c)
AC_CONFIG_HEADER(config.h:conf.in)
AC_LN_S
AC_PROG_YACC
AC_PROG_CC
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_CONST
AC_TYPE_SIZE_T
AC_HEADER_STDC
AC_HAVE_HEADERS(string.h malloc.h sys/types.h)
case "$YACC" in
*bison*)
AC_ALLOCA
;;
esac
AC_OUTPUT(Makefile,
[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])

View File

@@ -1,2 +0,0 @@
#!/bin/sh
./configure --prefix=/usr

File diff suppressed because it is too large Load Diff

View File

@@ -1,225 +0,0 @@
/* ecs - equivalence class routines */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Vern Paxson.
*
* The United States Government has rights in this work pursuant
* to contract no. DE-AC03-76SF00098 between the United States
* Department of Energy and the University of California.
*
* Redistribution and use in source and binary forms with or without
* modification are permitted provided that: (1) source distributions retain
* this entire copyright notice and comment, and (2) distributions including
* binaries display the following acknowledgement: ``This product includes
* software developed by the University of California, Berkeley and its
* contributors'' in the documentation or other materials provided with the
* distribution and in all advertising materials mentioning features or use
* of this software. Neither the name of the University nor the names of
* its contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/
/* $Header$ */
#include "flexdef.h"
/* ccl2ecl - convert character classes to set of equivalence classes */
void ccl2ecl()
{
int i, ich, newlen, cclp, ccls, cclmec;
for ( i = 1; i <= lastccl; ++i )
{
/* We loop through each character class, and for each character
* in the class, add the character's equivalence class to the
* new "character" class we are creating. Thus when we are all
* done, character classes will really consist of collections
* of equivalence classes
*/
newlen = 0;
cclp = cclmap[i];
for ( ccls = 0; ccls < ccllen[i]; ++ccls )
{
ich = ccltbl[cclp + ccls];
cclmec = ecgroup[ich];
if ( cclmec > 0 )
{
ccltbl[cclp + newlen] = cclmec;
++newlen;
}
}
ccllen[i] = newlen;
}
}
/* cre8ecs - associate equivalence class numbers with class members
*
* fwd is the forward linked-list of equivalence class members. bck
* is the backward linked-list, and num is the number of class members.
*
* Returned is the number of classes.
*/
int cre8ecs( fwd, bck, num )
int fwd[], bck[], num;
{
int i, j, numcl;
numcl = 0;
/* Create equivalence class numbers. From now on, ABS( bck(x) )
* is the equivalence class number for object x. If bck(x)
* is positive, then x is the representative of its equivalence
* class.
*/
for ( i = 1; i <= num; ++i )
if ( bck[i] == NIL )
{
bck[i] = ++numcl;
for ( j = fwd[i]; j != NIL; j = fwd[j] )
bck[j] = -numcl;
}
return numcl;
}
/* mkeccl - update equivalence classes based on character class xtions
*
* synopsis
* Char ccls[];
* int lenccl, fwd[llsiz], bck[llsiz], llsiz, NUL_mapping;
* void mkeccl( Char ccls[], int lenccl, int fwd[llsiz], int bck[llsiz],
* int llsiz, int NUL_mapping );
*
* ccls contains the elements of the character class, lenccl is the
* number of elements in the ccl, fwd is the forward link-list of equivalent
* characters, bck is the backward link-list, and llsiz size of the link-list.
*
* NUL_mapping is the value which NUL (0) should be mapped to.
*/
void mkeccl( ccls, lenccl, fwd, bck, llsiz, NUL_mapping )
Char ccls[];
int lenccl, fwd[], bck[], llsiz, NUL_mapping;
{
int cclp, oldec, newec;
int cclm, i, j;
static unsigned char cclflags[CSIZE]; /* initialized to all '\0' */
/* Note that it doesn't matter whether or not the character class is
* negated. The same results will be obtained in either case.
*/
cclp = 0;
while ( cclp < lenccl )
{
cclm = ccls[cclp];
if ( NUL_mapping && cclm == 0 )
cclm = NUL_mapping;
oldec = bck[cclm];
newec = cclm;
j = cclp + 1;
for ( i = fwd[cclm]; i != NIL && i <= llsiz; i = fwd[i] )
{ /* look for the symbol in the character class */
for ( ; j < lenccl; ++j )
{
register int ccl_char;
if ( NUL_mapping && ccls[j] == 0 )
ccl_char = NUL_mapping;
else
ccl_char = ccls[j];
if ( ccl_char > i )
break;
if ( ccl_char == i && ! cclflags[j] )
{
/* We found an old companion of cclm
* in the ccl. Link it into the new
* equivalence class and flag it as
* having been processed.
*/
bck[i] = newec;
fwd[newec] = i;
newec = i;
/* Set flag so we don't reprocess. */
cclflags[j] = 1;
/* Get next equivalence class member. */
/* continue 2 */
goto next_pt;
}
}
/* Symbol isn't in character class. Put it in the old
* equivalence class.
*/
bck[i] = oldec;
if ( oldec != NIL )
fwd[oldec] = i;
oldec = i;
next_pt: ;
}
if ( bck[cclm] != NIL || oldec != bck[cclm] )
{
bck[cclm] = NIL;
fwd[oldec] = NIL;
}
fwd[newec] = NIL;
/* Find next ccl member to process. */
for ( ++cclp; cclflags[cclp] && cclp < lenccl; ++cclp )
{
/* Reset "doesn't need processing" flag. */
cclflags[cclp] = 0;
}
}
}
/* mkechar - create equivalence class for single character */
void mkechar( tch, fwd, bck )
int tch, fwd[], bck[];
{
/* If until now the character has been a proper subset of
* an equivalence class, break it away to create a new ec
*/
if ( fwd[tch] != NIL )
bck[fwd[tch]] = bck[tch];
if ( bck[tch] != NIL )
fwd[bck[tch]] = fwd[tch];
fwd[tch] = NIL;
bck[tch] = NIL;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More