Compare commits
346 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba2871aa34 | ||
|
|
edde805980 | ||
|
|
db74d0da32 | ||
|
|
1253330adc | ||
|
|
26e2d7dd5e | ||
|
|
9c3b2e0d9a | ||
|
|
51da6c0e6e | ||
|
|
dbe1779a29 | ||
|
|
c6f46414ed | ||
|
|
552f5ed4c2 | ||
|
|
2d61fa76c3 | ||
|
|
72d7321b45 | ||
|
|
82817c9308 | ||
|
|
c849b8f1f8 | ||
|
|
1febcc5f9f | ||
|
|
7b1d52abff | ||
|
|
2f2d84e6a0 | ||
|
|
6794c38ff4 | ||
|
|
840cd1db8b | ||
|
|
f6602a8a6d | ||
|
|
97dfd3ae89 | ||
|
|
e728e7f25d | ||
|
|
146bae8a98 | ||
|
|
724973121b | ||
|
|
cc59786ed6 | ||
|
|
4c51256273 | ||
|
|
27ddb2eef0 | ||
|
|
c213981071 | ||
|
|
75302a4eec | ||
|
|
2252835438 | ||
|
|
9e2d5993f6 | ||
|
|
a47779d9d6 | ||
|
|
bd9f0208d2 | ||
|
|
4fdec2101b | ||
|
|
9c50b5a97d | ||
|
|
37d1b00b7c | ||
|
|
716151b46f | ||
|
|
8458c9e3c4 | ||
|
|
4e2c809150 | ||
|
|
ef83392732 | ||
|
|
9d5c61e023 | ||
|
|
d5002ad0ac | ||
|
|
00c4bf1ea1 | ||
|
|
9f617eb6fe | ||
|
|
71faeb6c76 | ||
|
|
a0c256c1f0 | ||
|
|
9d8ad7ccf5 | ||
|
|
a5d7f4ea99 | ||
|
|
435d3c34cf | ||
|
|
0e39621fea | ||
|
|
7477abe7f3 | ||
|
|
7075769d7c | ||
|
|
f5452b74de | ||
|
|
f3dbdc7615 | ||
|
|
66e5cd88c0 | ||
|
|
0583055d00 | ||
|
|
aea2050c49 | ||
|
|
5fde14ecea | ||
|
|
ca67f33a30 | ||
|
|
20238b7208 | ||
|
|
1a7125b892 | ||
|
|
d048ee200e | ||
|
|
6ddcb56e2a | ||
|
|
148bb1cac6 | ||
|
|
b2bde490b4 | ||
|
|
e1d3583dcd | ||
|
|
21f8d60095 | ||
|
|
6457d878c0 | ||
|
|
e5c844eff2 | ||
|
|
4e90456341 | ||
|
|
bfc3125556 | ||
|
|
fa094d1744 | ||
|
|
b7a3d6f665 | ||
|
|
fb05f20fbe | ||
|
|
e050ac6ee6 | ||
|
|
8dd0fb4860 | ||
|
|
6028db705a | ||
|
|
6d501bfc7c | ||
|
|
09205046a4 | ||
|
|
ac9ef0eee9 | ||
|
|
e073fcbd64 | ||
|
|
0507073b60 | ||
|
|
76cb491c09 | ||
|
|
f3f28ceca5 | ||
|
|
e3c86f0ffa | ||
|
|
7503ce7856 | ||
|
|
1a1daf15a3 | ||
|
|
a40bcee878 | ||
|
|
e67e939fb9 | ||
|
|
9027547fa6 | ||
|
|
7c2aa43862 | ||
|
|
8988b8b013 | ||
|
|
d2940a8719 | ||
|
|
be1726a662 | ||
|
|
2fd36d9175 | ||
|
|
6f0a48330c | ||
|
|
4dd9308e25 | ||
|
|
98f3efcb70 | ||
|
|
2e716e099c | ||
|
|
03ed62db5d | ||
|
|
c46bd3c1e9 | ||
|
|
a673c028f8 | ||
|
|
7ddf7686a3 | ||
|
|
abcfb06b0b | ||
|
|
e00196ee21 | ||
|
|
5b04c6b168 | ||
|
|
7f69510488 | ||
|
|
058b6c4de0 | ||
|
|
1e4005cc4b | ||
|
|
66a7727085 | ||
|
|
2bfd3df2a6 | ||
|
|
162f0d34b5 | ||
|
|
3ee11917bb | ||
|
|
b259f58533 | ||
|
|
42fd2f99bd | ||
|
|
ff8e4c81d0 | ||
|
|
691fdfaa2f | ||
|
|
d8708af48a | ||
|
|
7d3e799c82 | ||
|
|
91cbbfbad0 | ||
|
|
f87ab8d4c4 | ||
|
|
37646559fd | ||
|
|
1a5f550fe1 | ||
|
|
666f22786f | ||
|
|
8d15906495 | ||
|
|
5bff2b428c | ||
|
|
94d38c939f | ||
|
|
f2c4d11b74 | ||
|
|
ce4fbe98b7 | ||
|
|
ec2a748448 | ||
|
|
ade0fff092 | ||
|
|
d4dbb43d44 | ||
|
|
f8bde663cf | ||
|
|
c08045dafe | ||
|
|
c1ff69edd2 | ||
|
|
7562e8e410 | ||
|
|
b134c1f84c | ||
|
|
0f920ee55a | ||
|
|
401d36eee7 | ||
|
|
8d820f763f | ||
|
|
2bb8bfabb3 | ||
|
|
e82e5f2ce1 | ||
|
|
e8572fdfd7 | ||
|
|
789505045c | ||
|
|
a78f66c220 | ||
|
|
8b5e30f416 | ||
|
|
1d32cd012a | ||
|
|
d2fb9b98a6 | ||
|
|
08edaaba8c | ||
|
|
b99fcc6c8c | ||
|
|
f7d93551cb | ||
|
|
793e6052bd | ||
|
|
61cc452f1b | ||
|
|
21c5beb7a6 | ||
|
|
20e1ad2cb2 | ||
|
|
9831ddd3a8 | ||
|
|
8f220cdf97 | ||
|
|
776dee30ea | ||
|
|
023f848428 | ||
|
|
0f7e688c2e | ||
|
|
3e439df5a2 | ||
|
|
e8e186905a | ||
|
|
d68b2f2dc1 | ||
|
|
644b6c2112 | ||
|
|
09112b6b7a | ||
|
|
84a38361a5 | ||
|
|
c4cc4bc397 | ||
|
|
4f7baefbf0 | ||
|
|
dc75784799 | ||
|
|
5cb608d7e1 | ||
|
|
fdb295ec25 | ||
|
|
3073e9af87 | ||
|
|
1d0b58ab60 | ||
|
|
5041402681 | ||
|
|
1faf08d3ab | ||
|
|
661929317c | ||
|
|
3a4cc2d440 | ||
|
|
80ab2d4721 | ||
|
|
a36504720c | ||
|
|
4ca4a58468 | ||
|
|
9c749994c1 | ||
|
|
976bf303cc | ||
|
|
bf92da35b8 | ||
|
|
f53ab56d1a | ||
|
|
51e09b4885 | ||
|
|
dbd2d74487 | ||
|
|
3db23e5d6a | ||
|
|
c6360fb676 | ||
|
|
51e46b333b | ||
|
|
3dda877dfb | ||
|
|
c9ed14824b | ||
|
|
218466583d | ||
|
|
7a8eff3fa3 | ||
|
|
261f70aef6 | ||
|
|
2b09c13056 | ||
|
|
3b1e8d40d7 | ||
|
|
0087168ba6 | ||
|
|
967ec35fd2 | ||
|
|
b906f7c2c5 | ||
|
|
0194d839ef | ||
|
|
b2806f3ad2 | ||
|
|
355ad339ef | ||
|
|
c631ae5d43 | ||
|
|
717ab59efd | ||
|
|
9c8ee0a1a4 | ||
|
|
2c41b4d9e1 | ||
|
|
3678ba6aee | ||
|
|
85300993b9 | ||
|
|
137963240e | ||
|
|
6facb3f56d | ||
|
|
bbaa00df52 | ||
|
|
f17fa5a116 | ||
|
|
ac83afdde8 | ||
|
|
496e7ac168 | ||
|
|
d7e7ae368d | ||
|
|
58359c0ff4 | ||
|
|
a73bd691b3 | ||
|
|
f055b45453 | ||
|
|
9f05f511a6 | ||
|
|
8ba13c2f71 | ||
|
|
fcad15f7e6 | ||
|
|
5de76c3cf1 | ||
|
|
a6396122f6 | ||
|
|
d1eb7c79c2 | ||
|
|
095e957995 | ||
|
|
8546991046 | ||
|
|
328bdf4bbf | ||
|
|
a302352054 | ||
|
|
94c02410e4 | ||
|
|
fc9d89eff2 | ||
|
|
23cafa1006 | ||
|
|
9f6a53122a | ||
|
|
a8c229ed36 | ||
|
|
592e2014fb | ||
|
|
635d8ff2f7 | ||
|
|
49de16b343 | ||
|
|
c19654daa9 | ||
|
|
585773955b | ||
|
|
5f2b01ddda | ||
|
|
d80a636a62 | ||
|
|
0aaf6c25f6 | ||
|
|
ae75f1cecc | ||
|
|
c44239cb64 | ||
|
|
4634b23849 | ||
|
|
2401afee53 | ||
|
|
09f3488389 | ||
|
|
b73411b3bd | ||
|
|
4bf3ca1292 | ||
|
|
6419a655f4 | ||
|
|
531a56ed51 | ||
|
|
aaaa3fd193 | ||
|
|
d6164dd82b | ||
|
|
00279386d7 | ||
|
|
b331d3e0aa | ||
|
|
c8939dc646 | ||
|
|
c2a86d50bb | ||
|
|
d29b887f18 | ||
|
|
f71ce9fc62 | ||
|
|
0a1960c864 | ||
|
|
e8cb02f3f7 | ||
|
|
0b8e8bd520 | ||
|
|
84247c1ba5 | ||
|
|
0c3fffb6f6 | ||
|
|
66cadb02a1 | ||
|
|
be7c8f804e | ||
|
|
af1147432a | ||
|
|
a9b2a816ba | ||
|
|
0329394f94 | ||
|
|
1bf595e11a | ||
|
|
455d7aeffe | ||
|
|
694c364cb4 | ||
|
|
75470f1ac5 | ||
|
|
804d646577 | ||
|
|
9623203f20 | ||
|
|
8d061f04e3 | ||
|
|
49550e87d8 | ||
|
|
6504a97fd1 | ||
|
|
b81bb822f3 | ||
|
|
236fc62bb3 | ||
|
|
3890f0a6aa | ||
|
|
24e057667e | ||
|
|
0cf79d71cf | ||
|
|
229b664f35 | ||
|
|
4c343f1525 | ||
|
|
219e2c3071 | ||
|
|
9d39282ae9 | ||
|
|
81a8a8379d | ||
|
|
ea7c1415d7 | ||
|
|
d1f1e614f0 | ||
|
|
d9b3b93176 | ||
|
|
880e6639ac | ||
|
|
f462811ae9 | ||
|
|
664cc16008 | ||
|
|
84445ee1f7 | ||
|
|
bca590d42b | ||
|
|
aedd0138b3 | ||
|
|
b028c7bb4b | ||
|
|
57b3ba3506 | ||
|
|
75778ddd4b | ||
|
|
76832ba217 | ||
|
|
48de8a19bb | ||
|
|
21ddf7fa5a | ||
|
|
1a5e0e40d9 | ||
|
|
428764c187 | ||
|
|
ce8371152f | ||
|
|
47988903ae | ||
|
|
31caa114fe | ||
|
|
ff81751188 | ||
|
|
b72cfc52f9 | ||
|
|
c4e86a1a12 | ||
|
|
5f4ecde705 | ||
|
|
f3ee6644b2 | ||
|
|
6b3455956a | ||
|
|
e08e51f1b9 | ||
|
|
a234dfc7dc | ||
|
|
f08aabff03 | ||
|
|
ea88242733 | ||
|
|
4e8398cbc9 | ||
|
|
33fbb51528 | ||
|
|
76df048700 | ||
|
|
d10b71a307 | ||
|
|
51f41b2cca | ||
|
|
fcf0f3dad2 | ||
|
|
e949850567 | ||
|
|
3afa8e5979 | ||
|
|
976d84d56d | ||
|
|
d5599ae63a | ||
|
|
0c22adf6bf | ||
|
|
7590783d92 | ||
|
|
6144631bc5 | ||
|
|
4ea521eabf | ||
|
|
352d23a073 | ||
|
|
c054a40805 | ||
|
|
23f426ded5 | ||
|
|
bf27d6d5c3 | ||
|
|
c40136c25d | ||
|
|
ea03a4bc98 | ||
|
|
581ab61262 | ||
|
|
f2fe94f32d | ||
|
|
ff4a186025 | ||
|
|
d95f161319 | ||
|
|
a20c02c11f | ||
|
|
e5e44bfb94 | ||
|
|
acd1b5da26 | ||
|
|
a4bdbd4662 | ||
|
|
301d069a1a |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -24,7 +24,6 @@
|
|||||||
*.dis
|
*.dis
|
||||||
*.0
|
*.0
|
||||||
*.img
|
*.img
|
||||||
sdcard.rd
|
|
||||||
.profile
|
|
||||||
|
|
||||||
Makefile.user
|
Makefile.user
|
||||||
|
TODO
|
||||||
|
|||||||
49
Makefile
49
Makefile
@@ -8,32 +8,6 @@
|
|||||||
# The `make' will compile everything, including a kernel, utilities
|
# The `make' will compile everything, including a kernel, utilities
|
||||||
# and a root filesystem image.
|
# and a root filesystem image.
|
||||||
|
|
||||||
#
|
|
||||||
# Supported boards
|
|
||||||
#
|
|
||||||
MAX32 = sys/pic32/max32/MAX32
|
|
||||||
FUBARINO = sys/pic32/fubarino/FUBARINO
|
|
||||||
FUBARINOBIG = sys/pic32/fubarino/FUBARINO-UART2CONS-UART1-SRAMC
|
|
||||||
SDXL = sys/pic32/sdxl/SDXL
|
|
||||||
MAXIMITE = sys/pic32/maximite/MAXIMITE
|
|
||||||
MAXCOLOR = sys/pic32/maximite-color/MAXCOLOR
|
|
||||||
DUINOMITE = sys/pic32/duinomite/DUINOMITE
|
|
||||||
DUINOMITEUART = sys/pic32/duinomite-uart/DUINOMITE-UART
|
|
||||||
DUINOMITEE = sys/pic32/duinomite-e/DUINOMITE-E
|
|
||||||
DUINOMITEEUART = sys/pic32/duinomite-e-uart/DUINOMITE-E-UART
|
|
||||||
MMBMX7 = sys/pic32/mmb-mx7/MMB-MX7
|
|
||||||
WF32 = sys/pic32/wf32/WF32
|
|
||||||
UBW32 = sys/pic32/ubw32/UBW32
|
|
||||||
UBW32UART = sys/pic32/ubw32-uart/UBW32-UART
|
|
||||||
UBW32UARTSDRAM = sys/pic32/ubw32-uart-sdram/UBW32-UART-SDRAM
|
|
||||||
EXPLORER16 = sys/pic32/explorer16/EXPLORER16
|
|
||||||
STARTERKIT = sys/pic32/starter-kit/STARTER-KIT
|
|
||||||
BAREMETAL = sys/pic32/baremetal/BAREMETAL
|
|
||||||
RETROONE = sys/pic32/retroone/RETROONE
|
|
||||||
|
|
||||||
# Select target board
|
|
||||||
TARGET ?= $(MAX32)
|
|
||||||
|
|
||||||
# Filesystem and swap sizes.
|
# Filesystem and swap sizes.
|
||||||
FS_MBYTES = 100
|
FS_MBYTES = 100
|
||||||
U_MBYTES = 100
|
U_MBYTES = 100
|
||||||
@@ -55,23 +29,19 @@ FSUTIL = tools/fsutil/fsutil
|
|||||||
|
|
||||||
-include Makefile.user
|
-include Makefile.user
|
||||||
|
|
||||||
TARGETDIR = $(shell dirname $(TARGET))
|
|
||||||
TARGETNAME = $(shell basename $(TARGET))
|
|
||||||
TOPSRC = $(shell pwd)
|
TOPSRC = $(shell pwd)
|
||||||
CONFIG = $(TOPSRC)/tools/configsys/config
|
CONFIG = $(TOPSRC)/tools/configsys/config
|
||||||
|
|
||||||
all: .profile
|
all:
|
||||||
$(MAKE) -C tools
|
$(MAKE) -C tools
|
||||||
|
$(MAKE) -C src
|
||||||
$(MAKE) -C lib
|
$(MAKE) -C lib
|
||||||
$(MAKE) -C src install
|
$(MAKE) -C install
|
||||||
$(MAKE) kernel
|
$(MAKE) kernel
|
||||||
$(MAKE) fs
|
$(MAKE) fs
|
||||||
|
|
||||||
kernel: $(TARGETDIR)/Makefile
|
kernel: $(CONFIG)
|
||||||
$(MAKE) -C $(TARGETDIR)
|
$(MAKE) -C sys/pic32 all
|
||||||
|
|
||||||
$(TARGETDIR)/Makefile: $(CONFIG) $(TARGETDIR)/$(TARGETNAME)
|
|
||||||
cd $(TARGETDIR) && ../../../tools/configsys/config $(TARGETNAME)
|
|
||||||
|
|
||||||
fs: sdcard.img
|
fs: sdcard.img
|
||||||
|
|
||||||
@@ -80,7 +50,9 @@ sdcard.img: $(FSUTIL) rootfs.manifest userfs.manifest
|
|||||||
rm -f $@
|
rm -f $@
|
||||||
$(FSUTIL) --repartition=fs=$(FS_MBYTES)M:swap=$(SWAP_MBYTES)M:fs=$(U_MBYTES)M $@
|
$(FSUTIL) --repartition=fs=$(FS_MBYTES)M:swap=$(SWAP_MBYTES)M:fs=$(U_MBYTES)M $@
|
||||||
$(FSUTIL) --new --partition=1 --manifest=rootfs.manifest $@ .
|
$(FSUTIL) --new --partition=1 --manifest=rootfs.manifest $@ .
|
||||||
$(FSUTIL) --new --partition=3 --manifest=userfs.manifest $@ u
|
# In case you need a separate /u partition,
|
||||||
|
# uncomment the following line.
|
||||||
|
# $(FSUTIL) --new --partition=3 --manifest=userfs.manifest $@ u
|
||||||
|
|
||||||
$(FSUTIL):
|
$(FSUTIL):
|
||||||
cd tools/fsutil; $(MAKE)
|
cd tools/fsutil; $(MAKE)
|
||||||
@@ -100,7 +72,7 @@ cleanall: clean
|
|||||||
rm -f share/re.help share/emg.keys share/misc/more.help
|
rm -f share/re.help share/emg.keys share/misc/more.help
|
||||||
rm -f etc/termcap etc/remote etc/phones
|
rm -f etc/termcap etc/remote etc/phones
|
||||||
rm -f tools/configsys/.depend
|
rm -f tools/configsys/.depend
|
||||||
rm -f var/log/aculog
|
rm -f var/log/aculog sdcard.img
|
||||||
rm -rf var/lock share/unixbench
|
rm -rf var/lock share/unixbench
|
||||||
|
|
||||||
installfs:
|
installfs:
|
||||||
@@ -118,6 +90,3 @@ installflash:
|
|||||||
# TODO: make it relative to Target
|
# TODO: make it relative to Target
|
||||||
installboot:
|
installboot:
|
||||||
sudo pic32prog sys/pic32/fubarino/bootloader.hex
|
sudo pic32prog sys/pic32/fubarino/bootloader.hex
|
||||||
|
|
||||||
.profile: etc/root/dot.profile
|
|
||||||
cp etc/root/dot.profile .profile
|
|
||||||
|
|||||||
49
README.md
49
README.md
@@ -15,54 +15,35 @@
|
|||||||
|
|
||||||
## Supported hardware
|
## Supported hardware
|
||||||
|
|
||||||
* chipKIT Max32 board.
|
* Fubarino SD board.
|
||||||
* Sparkfun UBW32 board.
|
* Olimex Duinomite, Duinomite-Mini, Duinomite-Mega and Duinomite-eMega boards.
|
||||||
|
* Olimex Pinguino-Micro board with PIC32MX795F512H microcontroller.
|
||||||
* Maximite and Colour Maximite computers.
|
* Maximite and Colour Maximite computers.
|
||||||
|
* Majenko SDXL board.
|
||||||
|
* 4D Systems Picadillo-35T board.
|
||||||
|
* MikroElektronika MultiMedia Board for PIC32MX7.
|
||||||
|
* chipKIT Max32 board with SD card shield.
|
||||||
|
* chipKIT WF32 board with 2.4" LCD TFT display shield.
|
||||||
|
* Sparkfun UBW32 board with SD card slot.
|
||||||
* Microchip Explorer 16 board, with PIC32 CAN-USB plug-in module and SD & MMC pictail.
|
* Microchip Explorer 16 board, with PIC32 CAN-USB plug-in module and SD & MMC pictail.
|
||||||
* Microchip PIC32 USB or Ethernet Starter Kit, with I/O Expansion board and SD & MMC pictail.
|
* Microchip PIC32 USB or Ethernet Starter Kit, with I/O Expansion board and SD & MMC pictail.
|
||||||
* Olimex Duinomite, Duinomite-Mini and Duinomite-Mega boards.
|
|
||||||
* Olimex Pinguino-Micro board with PIC32MX795F512H microcontroller.
|
|
||||||
* eflightworks DIP board.
|
|
||||||
|
|
||||||
|
|
||||||
## Build
|
## Build
|
||||||
|
|
||||||
To compile everything from sources, you'll need some packages installed, namely:
|
To compile everything from sources, you'll need some packages installed, namely:
|
||||||
Berkeley YACC, GNU bison and flex, ELF library and FUSE library.
|
Berkeley YACC, GNU bison, flex, groff, ELF library and FUSE library.
|
||||||
Under Ubuntu, for example, you can do it by command:
|
Under Ubuntu, for example, you can do it by command:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
$ sudo apt-get install bison byacc flex libelf-dev libfuse-dev
|
$ sudo apt-get install bison byacc flex groff-base libelf-dev
|
||||||
```
|
```
|
||||||
|
|
||||||
By default, the system is configured for the Max32 board.
|
You can change a desired filesystem size and swap area size, as required.
|
||||||
To select another target board, edit a top-level user-specific Makefile called "Makefile.user"
|
Default is:
|
||||||
and set a TARGET value:
|
|
||||||
|
|
||||||
```Makefile
|
```Makefile
|
||||||
TARGET = $(MAX32) # for the chipKIT Max32 board with SD card shield (default)
|
FS_MBYTES = 100
|
||||||
TARGET = $(FUBARINO) # Fubarino SD board
|
SWAP_MBYTES = 2
|
||||||
TARGET = $(FUBARINOBIG) # Fubarino SD board with 8MB SRAM RAMDISK
|
|
||||||
TARGET = $(MAXIMITE) # for the Maximite board
|
|
||||||
TARGET = $(MAXCOLOR) # for the Colour Maximite board
|
|
||||||
TARGET = $(DUINOMITE) # for the Duinomite board with USB console
|
|
||||||
TARGET = $(DUINOMITEUART) # for the Duinomite board with UART console
|
|
||||||
TARGET = $(DUINOMITEE) # for the Duinomite E board with USB console
|
|
||||||
TARGET = $(DUINOMITEEUART) # for the Duinomite E board with UART console
|
|
||||||
TARGET = $(MMBMX7) # MMB MX7 board
|
|
||||||
TARGET = $(UBW32) # for the UBW32 board with USB console
|
|
||||||
TARGET = $(UBW32UART) # for the UBW32 board with UART console
|
|
||||||
TARGET = $(UBW32UARTSDRAM) # for the UBW32 boars with UART console and 8MB SRAM ramdisk
|
|
||||||
TARGET = $(EXPLORER16) # for the Explorer 16 board
|
|
||||||
TARGET = $(STARTERKIT) # for the PIC32 USB or Ethernet Starter Kit
|
|
||||||
TARGET = $(BAREMETAL) # Bare PIC32 chip on a breakout board
|
|
||||||
```
|
|
||||||
|
|
||||||
You can also change a desired filesystem size and swap area size,
|
|
||||||
as required. Default is:
|
|
||||||
```Makefile
|
|
||||||
FS_KBYTES = 16384
|
|
||||||
SWAP_KBYTES = 2048
|
|
||||||
```
|
```
|
||||||
To compile the kernel and build a filesystem image, run:
|
To compile the kernel and build a filesystem image, run:
|
||||||
|
|
||||||
|
|||||||
8
cross.mk
8
cross.mk
@@ -23,9 +23,13 @@ LDFLAGS =
|
|||||||
LIBS =
|
LIBS =
|
||||||
|
|
||||||
# Add system include path
|
# Add system include path
|
||||||
ifeq (,$(wildcard /usr/include/i386-linux-gnu))
|
ifeq (/usr/include/x86_64-linux-gnu,$(wildcard /usr/include/x86_64-linux-gnu))
|
||||||
CFLAGS += -I/usr/include
|
CFLAGS += -I/usr/include/x86_64-linux-gnu
|
||||||
else
|
else
|
||||||
|
ifeq (/usr/include/i386-linux-gnu,$(wildcard /usr/include/i386-linux-gnu))
|
||||||
CFLAGS += -I/usr/include/i386-linux-gnu
|
CFLAGS += -I/usr/include/i386-linux-gnu
|
||||||
|
else
|
||||||
|
CFLAGS += -I/usr/include
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
CFLAGS += -I$(TOPSRC)/include
|
CFLAGS += -I$(TOPSRC)/include
|
||||||
|
|||||||
1
etc/.gitignore
vendored
1
etc/.gitignore
vendored
@@ -1,3 +1,4 @@
|
|||||||
|
localtime
|
||||||
phones
|
phones
|
||||||
remote
|
remote
|
||||||
termcap
|
termcap
|
||||||
|
|||||||
42
etc/MAKEDEV
42
etc/MAKEDEV
@@ -4,46 +4,14 @@
|
|||||||
# All rights reserved. The Berkeley software License Agreement
|
# All rights reserved. The Berkeley software License Agreement
|
||||||
# specifies the terms and conditions for redistribution.
|
# specifies the terms and conditions for redistribution.
|
||||||
#
|
#
|
||||||
# @(#)MAKEDEV 4.27.6 (2.11BSD) 1999/2/19
|
|
||||||
#
|
|
||||||
# Device "make" file. Valid arguments:
|
# Device "make" file. Valid arguments:
|
||||||
# std standard devices
|
# std standard devices
|
||||||
# local configuration specific devices
|
# local configuration specific devices
|
||||||
# fd file descriptor driver
|
# fd file descriptor driver
|
||||||
# Tapes:
|
|
||||||
# ht* unibus tu77 & te16
|
|
||||||
# tm* unibus tm11 & te10 emulations (e.g. Emulex tc-11)
|
|
||||||
# ts* unibus ts11
|
|
||||||
# tu* tmscp (tk50/tu81)
|
|
||||||
# Disks:
|
# Disks:
|
||||||
# br* unibus Eaton br1538 or br1711
|
# sd* flash cards SecureDigital
|
||||||
# hk* unibus rk06 and rk07
|
|
||||||
# ra* unibus uda50 w/ ra??
|
|
||||||
# rk* unibus rk05
|
|
||||||
# rl* unibus rl01/rl02
|
|
||||||
# rx* unibus rx02
|
|
||||||
# si* unibus cdc 9766 w/ si 9500
|
|
||||||
# xp* unibus rm02/03/05, rp04/05/06, diva, eagle, cdc9766, fuji 160.
|
|
||||||
# Terminal multiplexors:
|
|
||||||
# dl* dl-11 units other than the console
|
|
||||||
# dz* unibus dz11 and dz32
|
|
||||||
# dh* unibus dh11 and emulations (e.g. Able dmax, Emulex cs-11)
|
|
||||||
# dmf* unibus dmf32
|
|
||||||
# dhu* unibus dhu11
|
|
||||||
# dmz* unibus dmz32
|
|
||||||
# dhv* qbus dhv11
|
|
||||||
# Pseudo terminals:
|
# Pseudo terminals:
|
||||||
# pty* set of 16 master and slave pseudo terminals
|
# pty* set of 16 master and slave pseudo terminals
|
||||||
# Printers:
|
|
||||||
# lp* unibus lp11 parallel interface
|
|
||||||
# va* unibus varian parallel interface
|
|
||||||
# vp* unibus versatec parallel interface
|
|
||||||
# Call units:
|
|
||||||
# Special purpose devices:
|
|
||||||
# dr* unibus dr11
|
|
||||||
# ram* memory disk
|
|
||||||
# dn* dn11 dialer
|
|
||||||
# ingreslock Ingres lock driver.
|
|
||||||
|
|
||||||
PATH=/etc:/sbin:/usr/sbin:/bin:/usr/bin
|
PATH=/etc:/sbin:/usr/sbin:/bin:/usr/bin
|
||||||
umask 77
|
umask 77
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ DESTDIR = /foobar
|
|||||||
OWN = root
|
OWN = root
|
||||||
GRP = wheel
|
GRP = wheel
|
||||||
|
|
||||||
SUBDIR = root
|
|
||||||
FILES = crontab fstab gettytab group motd passwd \
|
FILES = crontab fstab gettytab group motd passwd \
|
||||||
rc rc.local shells syslog.conf ttys
|
rc rc.local shells syslog.conf ttys
|
||||||
|
|
||||||
@@ -19,8 +18,6 @@ all install depend lint tags:
|
|||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *~
|
rm -f *~
|
||||||
-for i in ${SUBDIR}; do \
|
|
||||||
(cd $$i; make DESTDIR=${DESTDIR} $@); done
|
|
||||||
|
|
||||||
distribution:
|
distribution:
|
||||||
-@mkdir -p ${DESTDIR}/dev
|
-@mkdir -p ${DESTDIR}/dev
|
||||||
@@ -75,5 +72,3 @@ distribution:
|
|||||||
${DESTDIR}/usr/adm/savacct
|
${DESTDIR}/usr/adm/savacct
|
||||||
install -c -o uucp -g daemon -m 600 /dev/null \
|
install -c -o uucp -g daemon -m 600 /dev/null \
|
||||||
${DESTDIR}/usr/adm/aculog
|
${DESTDIR}/usr/adm/aculog
|
||||||
-for i in ${SUBDIR}; do \
|
|
||||||
(cd $$i; make DESTDIR=${DESTDIR} distribution); done
|
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
/dev/rd0a / ufs rw,async 1 1
|
/dev/sd0a / ufs rw,async 1 1
|
||||||
#/dev/rd0c /u ufs rw,async 1 2
|
#/dev/sd0c /u ufs rw,async 1 2
|
||||||
|
|||||||
11
etc/passwd
11
etc/passwd
@@ -1,8 +1,7 @@
|
|||||||
root:5:0:1:The Man:/:/bin/sh
|
root:5:0:1:The Man:/root:/bin/sh
|
||||||
daemon:*:1:1:The devil himself:/:/bin/sh
|
daemon:*:1:1:The devil himself:/root:/bin/sh
|
||||||
sys:*:4:2:Operating System:/tmp:nologin
|
sys:*:4:2:Operating System:/tmp:nologin
|
||||||
operator:*:2:5:System &:/usr/guest/operator:/bin/csh
|
operator:*:2:5:System &:/u/operator:/bin/sh
|
||||||
bin:*:3:20:Binaries Commands and Source:/:/bin/csh
|
bin:*:3:20:Binaries Commands and Source:/root:/bin/sh
|
||||||
nobody:*:32767:31:Nobody:/nonexistent:/bin/sh
|
nobody:*:32767:31:Nobody:/nonexistent:/bin/sh
|
||||||
uucp:*:66:1:UNIX-to-UNIX Copy:/usr/spool/uucppublic:/usr/sbin/uucico
|
uucp:*:66:1:UNIX-to-UNIX Copy:/spool/uucppublic:/sbin/uucico
|
||||||
ingres:*:39:74:INGRES Owner:/usr/ingres:/bin/csh
|
|
||||||
|
|||||||
2
etc/rc
2
etc/rc
@@ -3,8 +3,6 @@ HOME=/; export HOME
|
|||||||
PATH=/bin:/sbin; export PATH
|
PATH=/bin:/sbin; export PATH
|
||||||
exec >/dev/console 2>&1
|
exec >/dev/console 2>&1
|
||||||
|
|
||||||
/sbin/devupdate
|
|
||||||
|
|
||||||
if test "$1" != "autoboot"; then
|
if test "$1" != "autoboot"; then
|
||||||
#
|
#
|
||||||
# Switch from single-user to multi-user mode.
|
# Switch from single-user to multi-user mode.
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
#
|
|
||||||
# DESTDIR is defined here to be something which does *NOT* exist - it must be
|
|
||||||
# specified on the command line when doing a "make DESTDIR=/mnt distribution".
|
|
||||||
# This is aimed at avoiding overwriting the system disk's /etc files.
|
|
||||||
|
|
||||||
DESTDIR = /foobar
|
|
||||||
OWN = root
|
|
||||||
GRP = wheel
|
|
||||||
|
|
||||||
all install depend lint tags:
|
|
||||||
|
|
||||||
distribution:
|
|
||||||
install -c -o ${OWN} -g ${GRP} -m 644 dot.cshrc ${DESTDIR}/.cshrc
|
|
||||||
install -c -o ${OWN} -g ${GRP} -m 644 dot.login ${DESTDIR}/.login
|
|
||||||
install -c -o ${OWN} -g ${GRP} -m 644 dot.profile ${DESTDIR}/.profile
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *~
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
set history=30
|
|
||||||
set path=(/bin /sbin /etc /usr/sbin /usr/ucb /usr/bin /usr/new /usr/local)
|
|
||||||
if ($?prompt) then
|
|
||||||
set prompt="\!% "
|
|
||||||
endif
|
|
||||||
|
|
||||||
set filec
|
|
||||||
set mail=( 0 /usr/spool/mail/$USER )
|
|
||||||
set cdpath=( ~ /usr/spool/mqueue)
|
|
||||||
set prompt="\!% root--> "
|
|
||||||
alias mail /usr/ucb/Mail
|
|
||||||
alias pwd 'echo $cwd'
|
|
||||||
alias h history
|
|
||||||
alias q5 'tail -5 /usr/spool/mqueue/syslog'
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
unset noglob
|
|
||||||
set path=(/bin /etc /sbin /usr/sbin /usr/ucb /usr/bin /usr/local /usr/new)
|
|
||||||
umask 26
|
|
||||||
stty dec erase ^H kill ^U eof ^D
|
|
||||||
set prompt="[\!] root--> "
|
|
||||||
|
|
||||||
if ( "$TERM" == dialup || "$TERM" == network) then
|
|
||||||
setenv TERM vt100
|
|
||||||
echo -n "Terminal ($TERM)? "
|
|
||||||
set argv = "$<"
|
|
||||||
if ( "$argv" != '' ) setenv TERM "$argv"
|
|
||||||
endif
|
|
||||||
|
|
||||||
biff y
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
echo 'erase, kill ^U, intr ^C'
|
|
||||||
stty dec
|
|
||||||
stty erase
|
|
||||||
PATH=/bin:/sbin:/usr/sbin:/etc:/usr/ucb:/usr/bin:/usr/new
|
|
||||||
export PATH
|
|
||||||
HOME=/
|
|
||||||
export HOME
|
|
||||||
export TERM
|
|
||||||
11
etc/shadow
11
etc/shadow
@@ -1,8 +1,7 @@
|
|||||||
root:ro46DZg1ViGBs:0:1:The Man:/:/bin/sh
|
root:ro46DZg1ViGBs:0:1:The Man:/root:/bin/sh
|
||||||
daemon:*:1:1:The devil himself:/:/bin/sh
|
daemon:*:1:1:The devil himself:/root:/bin/sh
|
||||||
sys:*:4:2:Operating System:/tmp:nologin
|
sys:*:4:2:Operating System:/tmp:nologin
|
||||||
operator:*:2:5:System &:/usr/guest/operator:/bin/csh
|
operator:*:2:5:System &:/u/operator:/bin/sh
|
||||||
bin:*:3:20:Binaries Commands and Source:/:/bin/csh
|
bin:*:3:20:Binaries Commands and Source:/root:/bin/sh
|
||||||
nobody:*:32767:31:Nobody:/nonexistent:/bin/sh
|
nobody:*:32767:31:Nobody:/nonexistent:/bin/sh
|
||||||
uucp:*:66:1:UNIX-to-UNIX Copy:/usr/spool/uucppublic:/usr/sbin/uucico
|
uucp:*:66:1:UNIX-to-UNIX Copy:/spool/uucppublic:/sbin/uucico
|
||||||
ingres:*:39:74:INGRES Owner:/usr/ingres:/bin/csh
|
|
||||||
|
|||||||
1
include/.gitignore
vendored
Normal file
1
include/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
readline
|
||||||
@@ -12,8 +12,8 @@
|
|||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* 3. All advertising materials mentioning features or use of this software
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
* must display the following acknowledgement:
|
* must display the following acknowledgement:
|
||||||
* This product includes software developed by the University of
|
* This product includes software developed by the University of
|
||||||
* California, Berkeley and its contributors.
|
* California, Berkeley and its contributors.
|
||||||
* 4. Neither the name of the University nor the names of its contributors
|
* 4. Neither the name of the University nor the names of its contributors
|
||||||
* may be used to endorse or promote products derived from this software
|
* may be used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
@@ -30,12 +30,12 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#ifndef _AOUT_H_
|
#ifndef _AOUT_H_
|
||||||
#define _AOUT_H_
|
#define _AOUT_H_
|
||||||
|
|
||||||
#include <sys/exec_aout.h>
|
#include <sys/exec_aout.h>
|
||||||
|
|
||||||
#define _AOUT_INCLUDE_
|
#define _AOUT_INCLUDE_
|
||||||
#include <nlist.h>
|
#include <nlist.h>
|
||||||
|
|
||||||
/* Relocations */
|
/* Relocations */
|
||||||
@@ -65,4 +65,4 @@ struct reloc {
|
|||||||
* for RIGH16 and RIGH16S */
|
* for RIGH16 and RIGH16S */
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* !_AOUT_H_ */
|
#endif /* !_AOUT_H_ */
|
||||||
|
|||||||
30
include/ar.h
30
include/ar.h
@@ -15,8 +15,8 @@
|
|||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* 3. All advertising materials mentioning features or use of this software
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
* must display the following acknowledgement:
|
* must display the following acknowledgement:
|
||||||
* This product includes software developed by the University of
|
* This product includes software developed by the University of
|
||||||
* California, Berkeley and its contributors.
|
* California, Berkeley and its contributors.
|
||||||
* 4. Neither the name of the University nor the names of its contributors
|
* 4. Neither the name of the University nor the names of its contributors
|
||||||
* may be used to endorse or promote products derived from this software
|
* may be used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
@@ -35,24 +35,24 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _AR_H_
|
#ifndef _AR_H_
|
||||||
#define _AR_H_
|
#define _AR_H_
|
||||||
|
|
||||||
#define ARMAG "!<arch>\n" /* ar "magic number" */
|
#define ARMAG "!<arch>\n" /* ar "magic number" */
|
||||||
#define SARMAG 8 /* strlen(ARMAG); */
|
#define SARMAG 8 /* strlen(ARMAG); */
|
||||||
|
|
||||||
#define AR_EFMT1 "#1/" /* extended format #1 */
|
#define AR_EFMT1 "#1/" /* extended format #1 */
|
||||||
|
|
||||||
struct ar_hdr {
|
struct ar_hdr {
|
||||||
char ar_name[16]; /* name */
|
char ar_name[16]; /* name */
|
||||||
char ar_date[12]; /* modification time */
|
char ar_date[12]; /* modification time */
|
||||||
char ar_uid[6]; /* user id */
|
char ar_uid[6]; /* user id */
|
||||||
char ar_gid[6]; /* group id */
|
char ar_gid[6]; /* group id */
|
||||||
char ar_mode[8]; /* octal file permissions */
|
char ar_mode[8]; /* octal file permissions */
|
||||||
char ar_size[10]; /* size in bytes */
|
char ar_size[10]; /* size in bytes */
|
||||||
#define ARFMAG "`\n"
|
#define ARFMAG "`\n"
|
||||||
char ar_fmag[2]; /* consistency check */
|
char ar_fmag[2]; /* consistency check */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ARHDRSZ 60
|
#define ARHDRSZ 60
|
||||||
|
|
||||||
#endif /* !_AR_H_ */
|
#endif /* !_AR_H_ */
|
||||||
|
|||||||
@@ -19,11 +19,11 @@
|
|||||||
* External definitions for
|
* External definitions for
|
||||||
* functions in inet(3N)
|
* functions in inet(3N)
|
||||||
*/
|
*/
|
||||||
struct in_addr;
|
struct in_addr;
|
||||||
|
|
||||||
unsigned long inet_addr (char *);
|
unsigned long inet_addr (char *);
|
||||||
char *inet_ntoa (struct in_addr);
|
char *inet_ntoa (struct in_addr);
|
||||||
struct in_addr inet_makeaddr (long, long);
|
struct in_addr inet_makeaddr (long, long);
|
||||||
unsigned long inet_network (char *);
|
unsigned long inet_network (char *);
|
||||||
unsigned long inet_netof (struct in_addr);
|
unsigned long inet_netof (struct in_addr);
|
||||||
unsigned long inet_lnaof (struct in_addr);
|
unsigned long inet_lnaof (struct in_addr);
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
/* assert.h 4.2 85/01/21 */
|
|
||||||
|
|
||||||
# ifndef NDEBUG
|
# ifndef NDEBUG
|
||||||
# define _assert(ex) {if (!(ex)){fprintf(stderr,"Assertion failed: file \"%s\", line %d\n", __FILE__, __LINE__);exit(1);}}
|
# define _assert(ex) {if (!(ex)){fprintf(stderr,"Assertion failed: file \"%s\", line %d\n", __FILE__, __LINE__);exit(1);}}
|
||||||
# define assert(ex) _assert(ex)
|
# define assert(ex) _assert(ex)
|
||||||
# else
|
# else
|
||||||
# define _assert(ex)
|
# define _assert(ex)
|
||||||
# define assert(ex)
|
# define assert(ex)
|
||||||
|
|||||||
@@ -1,28 +1,26 @@
|
|||||||
/* ctype.h 4.2 85/09/04 */
|
#define _U 01
|
||||||
|
#define _L 02
|
||||||
|
#define _N 04
|
||||||
|
#define _S 010
|
||||||
|
#define _P 020
|
||||||
|
#define _C 040
|
||||||
|
#define _X 0100
|
||||||
|
#define _B 0200
|
||||||
|
|
||||||
#define _U 01
|
extern char _ctype_[];
|
||||||
#define _L 02
|
|
||||||
#define _N 04
|
|
||||||
#define _S 010
|
|
||||||
#define _P 020
|
|
||||||
#define _C 040
|
|
||||||
#define _X 0100
|
|
||||||
#define _B 0200
|
|
||||||
|
|
||||||
extern char _ctype_[];
|
#define isalpha(c) ((_ctype_+1)[(int)(c)]&(_U|_L))
|
||||||
|
#define isupper(c) ((_ctype_+1)[(int)(c)]&_U)
|
||||||
#define isalpha(c) ((_ctype_+1)[(int)(c)]&(_U|_L))
|
#define islower(c) ((_ctype_+1)[(int)(c)]&_L)
|
||||||
#define isupper(c) ((_ctype_+1)[(int)(c)]&_U)
|
#define isdigit(c) ((_ctype_+1)[(int)(c)]&_N)
|
||||||
#define islower(c) ((_ctype_+1)[(int)(c)]&_L)
|
#define isxdigit(c) ((_ctype_+1)[(int)(c)]&(_N|_X))
|
||||||
#define isdigit(c) ((_ctype_+1)[(int)(c)]&_N)
|
#define isspace(c) ((_ctype_+1)[(int)(c)]&_S)
|
||||||
#define isxdigit(c) ((_ctype_+1)[(int)(c)]&(_N|_X))
|
#define ispunct(c) ((_ctype_+1)[(int)(c)]&_P)
|
||||||
#define isspace(c) ((_ctype_+1)[(int)(c)]&_S)
|
#define isalnum(c) ((_ctype_+1)[(int)(c)]&(_U|_L|_N))
|
||||||
#define ispunct(c) ((_ctype_+1)[(int)(c)]&_P)
|
#define isprint(c) ((_ctype_+1)[(int)(c)]&(_P|_U|_L|_N|_B))
|
||||||
#define isalnum(c) ((_ctype_+1)[(int)(c)]&(_U|_L|_N))
|
#define isgraph(c) ((_ctype_+1)[(int)(c)]&(_P|_U|_L|_N))
|
||||||
#define isprint(c) ((_ctype_+1)[(int)(c)]&(_P|_U|_L|_N|_B))
|
#define iscntrl(c) ((_ctype_+1)[(int)(c)]&_C)
|
||||||
#define isgraph(c) ((_ctype_+1)[(int)(c)]&(_P|_U|_L|_N))
|
#define isascii(c) ((unsigned)(c)<=0177)
|
||||||
#define iscntrl(c) ((_ctype_+1)[(int)(c)]&_C)
|
#define toupper(c) ((c)-'a'+'A')
|
||||||
#define isascii(c) ((unsigned)(c)<=0177)
|
#define tolower(c) ((c)-'A'+'a')
|
||||||
#define toupper(c) ((c)-'a'+'A')
|
#define toascii(c) ((c)&0177)
|
||||||
#define tolower(c) ((c)-'A'+'a')
|
|
||||||
#define toascii(c) ((c)&0177)
|
|
||||||
|
|||||||
205
include/curses.h
205
include/curses.h
@@ -9,155 +9,152 @@
|
|||||||
#include <sgtty.h>
|
#include <sgtty.h>
|
||||||
#include <term.h>
|
#include <term.h>
|
||||||
|
|
||||||
#define bool int
|
#define bool int
|
||||||
#define reg register
|
|
||||||
|
|
||||||
#define TRUE (1)
|
#define TRUE (1)
|
||||||
#define FALSE (0)
|
#define FALSE (0)
|
||||||
#define ERR (0)
|
#define ERR (0)
|
||||||
#define OK (1)
|
#define OK (1)
|
||||||
|
|
||||||
#define _ENDLINE 001
|
#define _ENDLINE 001
|
||||||
#define _FULLWIN 002
|
#define _FULLWIN 002
|
||||||
#define _SCROLLWIN 004
|
#define _SCROLLWIN 004
|
||||||
#define _FLUSH 010
|
#define _FLUSH 010
|
||||||
#define _FULLLINE 020
|
#define _FULLLINE 020
|
||||||
#define _IDLINE 040
|
#define _IDLINE 040
|
||||||
#define _STANDOUT 0200
|
#define _STANDOUT 0200
|
||||||
#define _NOCHANGE -1
|
#define _NOCHANGE -1
|
||||||
|
|
||||||
#define _puts(s) tputs(s, 0, _putchar)
|
#define _puts(s) tputs(s, 0, _putchar)
|
||||||
|
|
||||||
typedef struct sgttyb SGTTY;
|
typedef struct sgttyb SGTTY;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Capabilities from termcap
|
* Capabilities from termcap
|
||||||
*/
|
*/
|
||||||
|
extern bool AM, BS, CA, DA, DB, EO, HC, HZ, IN, MI, MS, NC, NS, OS, UL,
|
||||||
extern bool AM, BS, CA, DA, DB, EO, HC, HZ, IN, MI, MS, NC, NS, OS, UL,
|
XB, XN, XT, XS, XX;
|
||||||
XB, XN, XT, XS, XX;
|
extern char *AL, *BC, *BT, *CD, *CE, *CL, *CM, *CR, *CS, *DC, *DL,
|
||||||
extern char *AL, *BC, *BT, *CD, *CE, *CL, *CM, *CR, *CS, *DC, *DL,
|
*DM, *DO, *ED, *EI, *K0, *K1, *K2, *K3, *K4, *K5, *K6,
|
||||||
*DM, *DO, *ED, *EI, *K0, *K1, *K2, *K3, *K4, *K5, *K6,
|
*K7, *K8, *K9, *HO, *IC, *IM, *IP, *KD, *KE, *KH, *KL,
|
||||||
*K7, *K8, *K9, *HO, *IC, *IM, *IP, *KD, *KE, *KH, *KL,
|
*KR, *KS, *KU, *LL, *MA, *ND, *NL, *RC, *SC, *SE, *SF,
|
||||||
*KR, *KS, *KU, *LL, *MA, *ND, *NL, *RC, *SC, *SE, *SF,
|
*SO, *SR, *TA, *TE, *TI, *UC, *UE, *UP, *US, *VB, *VS,
|
||||||
*SO, *SR, *TA, *TE, *TI, *UC, *UE, *UP, *US, *VB, *VS,
|
*VE, *AL_PARM, *DL_PARM, *UP_PARM, *DOWN_PARM,
|
||||||
*VE, *AL_PARM, *DL_PARM, *UP_PARM, *DOWN_PARM,
|
*LEFT_PARM, *RIGHT_PARM;
|
||||||
*LEFT_PARM, *RIGHT_PARM;
|
extern char PC;
|
||||||
extern char PC;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* From the tty modes...
|
* From the tty modes...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern bool GT, NONL, UPPERCASE, normtty, _pfast;
|
extern bool GT, NONL, UPPERCASE, normtty, _pfast;
|
||||||
|
|
||||||
struct _win_st {
|
struct _win_st {
|
||||||
short _cury, _curx;
|
short _cury, _curx;
|
||||||
short _maxy, _maxx;
|
short _maxy, _maxx;
|
||||||
short _begy, _begx;
|
short _begy, _begx;
|
||||||
short _flags;
|
short _flags;
|
||||||
short _ch_off;
|
short _ch_off;
|
||||||
bool _clear;
|
bool _clear;
|
||||||
bool _leave;
|
bool _leave;
|
||||||
bool _scroll;
|
bool _scroll;
|
||||||
char **_y;
|
char **_y;
|
||||||
short *_firstch;
|
short *_firstch;
|
||||||
short *_lastch;
|
short *_lastch;
|
||||||
struct _win_st *_nextp, *_orig;
|
struct _win_st *_nextp, *_orig;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define WINDOW struct _win_st
|
#define WINDOW struct _win_st
|
||||||
|
|
||||||
extern bool My_term, _echoit, _rawmode, _endwin;
|
extern bool My_term, _echoit, _rawmode, _endwin;
|
||||||
|
|
||||||
extern char *Def_term, ttytype[];
|
extern char *Def_term, ttytype[];
|
||||||
|
|
||||||
extern int LINES, COLS, _tty_ch, _res_flg;
|
extern int LINES, COLS, _tty_ch, _res_flg;
|
||||||
|
|
||||||
extern SGTTY _tty;
|
extern SGTTY _tty;
|
||||||
|
|
||||||
extern WINDOW *stdscr, *curscr;
|
extern WINDOW *stdscr, *curscr;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Define VOID to stop lint from generating "null effect"
|
* Define VOID to stop lint from generating "null effect"
|
||||||
* comments.
|
* comments.
|
||||||
*/
|
*/
|
||||||
#ifdef lint
|
#ifdef lint
|
||||||
int __void__;
|
int __void__;
|
||||||
#define VOID(x) (__void__ = (int) (x))
|
#define VOID(x) (__void__ = (int) (x))
|
||||||
#else
|
#else
|
||||||
#define VOID(x) (x)
|
#define VOID(x) ((void)(x))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* psuedo functions for standard screen
|
* psuedo functions for standard screen
|
||||||
*/
|
*/
|
||||||
#define addch(ch) VOID(waddch(stdscr, ch))
|
#define addch(ch) VOID(waddch(stdscr, ch))
|
||||||
#define getch() VOID(wgetch(stdscr))
|
#define getch() wgetch(stdscr)
|
||||||
#define addstr(str) VOID(waddstr(stdscr, str))
|
#define addstr(str) VOID(waddstr(stdscr, str))
|
||||||
#define getstr(str) VOID(wgetstr(stdscr, str))
|
#define getstr(str) VOID(wgetstr(stdscr, str))
|
||||||
#define move(y, x) VOID(wmove(stdscr, y, x))
|
#define move(y, x) wmove(stdscr, y, x)
|
||||||
#define clear() VOID(wclear(stdscr))
|
#define clear() VOID(wclear(stdscr))
|
||||||
#define erase() VOID(werase(stdscr))
|
#define erase() VOID(werase(stdscr))
|
||||||
#define clrtobot() VOID(wclrtobot(stdscr))
|
#define clrtobot() VOID(wclrtobot(stdscr))
|
||||||
#define clrtoeol() VOID(wclrtoeol(stdscr))
|
#define clrtoeol() VOID(wclrtoeol(stdscr))
|
||||||
#define insertln() VOID(winsertln(stdscr))
|
#define insertln() VOID(winsertln(stdscr))
|
||||||
#define deleteln() VOID(wdeleteln(stdscr))
|
#define deleteln() VOID(wdeleteln(stdscr))
|
||||||
#define refresh() VOID(wrefresh(stdscr))
|
#define refresh() VOID(wrefresh(stdscr))
|
||||||
#define inch() VOID(winch(stdscr))
|
#define inch() VOID(winch(stdscr))
|
||||||
#define insch(c) VOID(winsch(stdscr,c))
|
#define insch(c) VOID(winsch(stdscr,c))
|
||||||
#define delch() VOID(wdelch(stdscr))
|
#define delch() VOID(wdelch(stdscr))
|
||||||
#define standout() VOID(wstandout(stdscr))
|
#define standout() VOID(wstandout(stdscr))
|
||||||
#define standend() VOID(wstandend(stdscr))
|
#define standend() VOID(wstandend(stdscr))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* mv functions
|
* mv functions
|
||||||
*/
|
*/
|
||||||
#define mvwaddch(win,y,x,ch) VOID(wmove(win,y,x)==ERR?ERR:waddch(win,ch))
|
#define mvwaddch(win,y,x,ch) (wmove(win,y,x) == ERR ? ERR : waddch(win,ch))
|
||||||
#define mvwgetch(win,y,x) VOID(wmove(win,y,x)==ERR?ERR:wgetch(win))
|
#define mvwgetch(win,y,x) VOID(wmove(win,y,x)==ERR?ERR:wgetch(win))
|
||||||
#define mvwaddstr(win,y,x,str) VOID(wmove(win,y,x)==ERR?ERR:waddstr(win,str))
|
#define mvwaddstr(win,y,x,str) VOID(wmove(win,y,x)==ERR?ERR:waddstr(win,str))
|
||||||
#define mvwgetstr(win,y,x,str) VOID(wmove(win,y,x)==ERR?ERR:wgetstr(win,str))
|
#define mvwgetstr(win,y,x,str) VOID(wmove(win,y,x)==ERR?ERR:wgetstr(win,str))
|
||||||
#define mvwinch(win,y,x) VOID(wmove(win,y,x) == ERR ? ERR : winch(win))
|
#define mvwinch(win,y,x) VOID(wmove(win,y,x) == ERR ? ERR : winch(win))
|
||||||
#define mvwdelch(win,y,x) VOID(wmove(win,y,x) == ERR ? ERR : wdelch(win))
|
#define mvwdelch(win,y,x) VOID(wmove(win,y,x) == ERR ? ERR : wdelch(win))
|
||||||
#define mvwinsch(win,y,x,c) VOID(wmove(win,y,x) == ERR ? ERR:winsch(win,c))
|
#define mvwinsch(win,y,x,c) VOID(wmove(win,y,x) == ERR ? ERR:winsch(win,c))
|
||||||
#define mvaddch(y,x,ch) mvwaddch(stdscr,y,x,ch)
|
#define mvaddch(y,x,ch) mvwaddch(stdscr,y,x,ch)
|
||||||
#define mvgetch(y,x) mvwgetch(stdscr,y,x)
|
#define mvgetch(y,x) mvwgetch(stdscr,y,x)
|
||||||
#define mvaddstr(y,x,str) mvwaddstr(stdscr,y,x,str)
|
#define mvaddstr(y,x,str) mvwaddstr(stdscr,y,x,str)
|
||||||
#define mvgetstr(y,x,str) mvwgetstr(stdscr,y,x,str)
|
#define mvgetstr(y,x,str) mvwgetstr(stdscr,y,x,str)
|
||||||
#define mvinch(y,x) mvwinch(stdscr,y,x)
|
#define mvinch(y,x) mvwinch(stdscr,y,x)
|
||||||
#define mvdelch(y,x) mvwdelch(stdscr,y,x)
|
#define mvdelch(y,x) mvwdelch(stdscr,y,x)
|
||||||
#define mvinsch(y,x,c) mvwinsch(stdscr,y,x,c)
|
#define mvinsch(y,x,c) mvwinsch(stdscr,y,x,c)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* psuedo functions
|
* psuedo functions
|
||||||
*/
|
*/
|
||||||
|
#define clearok(win,bf) (win->_clear = bf)
|
||||||
|
#define leaveok(win,bf) (win->_leave = bf)
|
||||||
|
#define scrollok(win,bf) (win->_scroll = bf)
|
||||||
|
#define flushok(win,bf) (bf ? (win->_flags |= _FLUSH):(win->_flags &= ~_FLUSH))
|
||||||
|
#define getyx(win,y,x) y = win->_cury, x = win->_curx
|
||||||
|
#define winch(win) (win->_y[win->_cury][win->_curx] & 0177)
|
||||||
|
|
||||||
#define clearok(win,bf) (win->_clear = bf)
|
#define raw() (_tty.sg_flags|=RAW, _pfast=_rawmode=TRUE, ioctl(_tty_ch,TIOCSETP,&_tty))
|
||||||
#define leaveok(win,bf) (win->_leave = bf)
|
#define noraw() (_tty.sg_flags&=~RAW,_rawmode=FALSE,_pfast=!(_tty.sg_flags&CRMOD),ioctl(_tty_ch,TIOCSETP,&_tty))
|
||||||
#define scrollok(win,bf) (win->_scroll = bf)
|
#define cbreak() (_tty.sg_flags |= CBREAK, _rawmode = TRUE, ioctl(_tty_ch,TIOCSETP,&_tty))
|
||||||
#define flushok(win,bf) (bf ? (win->_flags |= _FLUSH):(win->_flags &= ~_FLUSH))
|
#define nocbreak() (_tty.sg_flags &= ~CBREAK,_rawmode=FALSE,ioctl(_tty_ch,TIOCSETP,&_tty))
|
||||||
#define getyx(win,y,x) y = win->_cury, x = win->_curx
|
#define crmode() cbreak() /* backwards compatability */
|
||||||
#define winch(win) (win->_y[win->_cury][win->_curx] & 0177)
|
#define nocrmode() nocbreak() /* backwards compatability */
|
||||||
|
#define echo() (_tty.sg_flags |= ECHO, _echoit = TRUE, ioctl(_tty_ch, TIOCSETP, &_tty))
|
||||||
|
#define noecho() (_tty.sg_flags &= ~ECHO, _echoit = FALSE, ioctl(_tty_ch, TIOCSETP, &_tty))
|
||||||
|
#define nl() (_tty.sg_flags |= CRMOD, _pfast = _rawmode,ioctl(_tty_ch, TIOCSETP, &_tty))
|
||||||
|
#define nonl() (_tty.sg_flags &= ~CRMOD,_pfast = TRUE, ioctl(_tty_ch, TIOCSETP,&_tty))
|
||||||
|
#define savetty() ((void) ioctl(_tty_ch, TIOCGETP, &_tty), _res_flg = _tty.sg_flags)
|
||||||
|
#define resetty() (_tty.sg_flags = _res_flg, (void) ioctl(_tty_ch, TIOCSETP, &_tty))
|
||||||
|
|
||||||
#define raw() (_tty.sg_flags|=RAW, _pfast=_rawmode=TRUE, ioctl(_tty_ch,TIOCSETP,&_tty))
|
#define erasechar() (_tty.sg_erase)
|
||||||
#define noraw() (_tty.sg_flags&=~RAW,_rawmode=FALSE,_pfast=!(_tty.sg_flags&CRMOD),ioctl(_tty_ch,TIOCSETP,&_tty))
|
#define killchar() (_tty.sg_kill)
|
||||||
#define cbreak() (_tty.sg_flags |= CBREAK, _rawmode = TRUE, ioctl(_tty_ch,TIOCSETP,&_tty))
|
#define baudrate() (_tty.sg_ospeed)
|
||||||
#define nocbreak() (_tty.sg_flags &= ~CBREAK,_rawmode=FALSE,ioctl(_tty_ch,TIOCSETP,&_tty))
|
|
||||||
#define crmode() cbreak() /* backwards compatability */
|
|
||||||
#define nocrmode() nocbreak() /* backwards compatability */
|
|
||||||
#define echo() (_tty.sg_flags |= ECHO, _echoit = TRUE, ioctl(_tty_ch, TIOCSETP, &_tty))
|
|
||||||
#define noecho() (_tty.sg_flags &= ~ECHO, _echoit = FALSE, ioctl(_tty_ch, TIOCSETP, &_tty))
|
|
||||||
#define nl() (_tty.sg_flags |= CRMOD, _pfast = _rawmode,ioctl(_tty_ch, TIOCSETP, &_tty))
|
|
||||||
#define nonl() (_tty.sg_flags &= ~CRMOD,_pfast = TRUE, ioctl(_tty_ch, TIOCSETP,&_tty))
|
|
||||||
#define savetty() ((void) ioctl(_tty_ch, TIOCGETP, &_tty), _res_flg = _tty.sg_flags)
|
|
||||||
#define resetty() (_tty.sg_flags = _res_flg, (void) ioctl(_tty_ch, TIOCSETP, &_tty))
|
|
||||||
|
|
||||||
#define erasechar() (_tty.sg_erase)
|
WINDOW *initscr(), *newwin(), *subwin();
|
||||||
#define killchar() (_tty.sg_kill)
|
char *longname(), *getcap();
|
||||||
#define baudrate() (_tty.sg_ospeed)
|
|
||||||
|
|
||||||
WINDOW *initscr(), *newwin(), *subwin();
|
|
||||||
char *longname(), *getcap();
|
|
||||||
|
|
||||||
int wmove (WINDOW *, int, int);
|
int wmove (WINDOW *, int, int);
|
||||||
int wrefresh (WINDOW *);
|
int wrefresh (WINDOW *);
|
||||||
@@ -189,7 +186,7 @@ int mvwprintw(WINDOW *win, int y, int x, char *fmt, ...);
|
|||||||
/*
|
/*
|
||||||
* Used to be in unctrl.h.
|
* Used to be in unctrl.h.
|
||||||
*/
|
*/
|
||||||
#define unctrl(c) _unctrl[(c) & 0177]
|
#define unctrl(c) _unctrl[(c) & 0177]
|
||||||
extern char *_unctrl[];
|
extern char *_unctrl[];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 1980 Regents of the University of California.
|
|
||||||
* All rights reserved. The Berkeley software License Agreement
|
|
||||||
* specifies the terms and conditions for redistribution.
|
|
||||||
*
|
|
||||||
* @(#)dbm.h 5.1 (Berkeley) 3/27/86
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef NULL
|
|
||||||
/*
|
|
||||||
* this is lunacy, we no longer use it (and never should have
|
|
||||||
* unconditionally defined it), but, this whole file is for
|
|
||||||
* backwards compatability - someone may rely on this.
|
|
||||||
*/
|
|
||||||
#define NULL ((char *) 0)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <ndbm.h>
|
|
||||||
|
|
||||||
datum fetch();
|
|
||||||
datum firstkey();
|
|
||||||
datum nextkey();
|
|
||||||
#if 0
|
|
||||||
datum makdatum();
|
|
||||||
datum firsthash();
|
|
||||||
long calchash();
|
|
||||||
long hashinc();
|
|
||||||
#endif
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1980, 1993
|
* Copyright (c) 1980, 1993
|
||||||
* The Regents of the University of California. All rights reserved.
|
* The Regents of the University of California. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -12,8 +12,8 @@
|
|||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* 3. All advertising materials mentioning features or use of this software
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
* must display the following acknowledgement:
|
* must display the following acknowledgement:
|
||||||
* This product includes software developed by the University of
|
* This product includes software developed by the University of
|
||||||
* California, Berkeley and its contributors.
|
* California, Berkeley and its contributors.
|
||||||
* 4. Neither the name of the University nor the names of its contributors
|
* 4. Neither the name of the University nor the names of its contributors
|
||||||
* may be used to endorse or promote products derived from this software
|
* may be used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)fstab.h 8.1.1 (2.11BSD) 1996/1/15
|
* @(#)fstab.h 8.1.1 (2.11BSD) 1996/1/15
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _FSTAB_H_
|
#ifndef _FSTAB_H_
|
||||||
@@ -47,23 +47,20 @@
|
|||||||
* if type is "rq", then use concatenation of fs_file and "quotas" to locate
|
* if type is "rq", then use concatenation of fs_file and "quotas" to locate
|
||||||
* quota file.
|
* quota file.
|
||||||
*/
|
*/
|
||||||
#define _PATH_FSTAB "/etc/fstab"
|
#define FSTAB_RW "rw" /* read/write device */
|
||||||
#define FSTAB "/etc/fstab" /* deprecated */
|
#define FSTAB_RQ "rq" /* read/write with quotas */
|
||||||
|
#define FSTAB_RO "ro" /* read-only device */
|
||||||
#define FSTAB_RW "rw" /* read/write device */
|
#define FSTAB_SW "sw" /* swap device */
|
||||||
#define FSTAB_RQ "rq" /* read/write with quotas */
|
#define FSTAB_XX "xx" /* ignore totally */
|
||||||
#define FSTAB_RO "ro" /* read-only device */
|
|
||||||
#define FSTAB_SW "sw" /* swap device */
|
|
||||||
#define FSTAB_XX "xx" /* ignore totally */
|
|
||||||
|
|
||||||
struct fstab {
|
struct fstab {
|
||||||
char *fs_spec; /* block special device name */
|
char *fs_spec; /* block special device name */
|
||||||
char *fs_file; /* file system path prefix */
|
char *fs_file; /* file system path prefix */
|
||||||
char *fs_vfstype; /* File system type, ufs, nfs */
|
char *fs_vfstype; /* File system type, ufs, nfs */
|
||||||
char *fs_mntops; /* Mount options ala -o */
|
char *fs_mntops; /* Mount options ala -o */
|
||||||
char *fs_type; /* FSTAB_* from fs_mntops */
|
char *fs_type; /* FSTAB_* from fs_mntops */
|
||||||
int fs_freq; /* dump frequency, in days */
|
int fs_freq; /* dump frequency, in days */
|
||||||
int fs_passno; /* pass number on parallel dump */
|
int fs_passno; /* pass number on parallel dump */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct fstab *getfsent();
|
struct fstab *getfsent();
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
/* grp.h 4.1 83/05/03 */
|
/* grp.h 4.1 83/05/03 */
|
||||||
|
|
||||||
struct group { /* see getgrent(3) */
|
struct group { /* see getgrent(3) */
|
||||||
char *gr_name;
|
char *gr_name;
|
||||||
char *gr_passwd;
|
char *gr_passwd;
|
||||||
int gr_gid;
|
int gr_gid;
|
||||||
char **gr_mem;
|
char **gr_mem;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct group *getgrent(void);
|
struct group *getgrent(void);
|
||||||
@@ -13,3 +13,5 @@ struct group *getgrgid(gid_t gid);
|
|||||||
void setgrent(void);
|
void setgrent(void);
|
||||||
void endgrent(void);
|
void endgrent(void);
|
||||||
int setgroups(size_t size, const gid_t *list);
|
int setgroups(size_t size, const gid_t *list);
|
||||||
|
int getgrouplist(char *uname, gid_t agroup, gid_t *groups, int *grpcnt);
|
||||||
|
int initgroups(char *uname, int agroup);
|
||||||
|
|||||||
2
include/inttypes.h
Normal file
2
include/inttypes.h
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
#include <stdint.h>
|
||||||
|
#include <stddef.h>
|
||||||
@@ -3,11 +3,11 @@
|
|||||||
* All rights reserved. The Berkeley software License Agreement
|
* All rights reserved. The Berkeley software License Agreement
|
||||||
* specifies the terms and conditions for redistribution.
|
* specifies the terms and conditions for redistribution.
|
||||||
*
|
*
|
||||||
* @(#)lastlog.h 5.1 (Berkeley) 5/30/85
|
* @(#)lastlog.h 5.1 (Berkeley) 5/30/85
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct lastlog {
|
struct lastlog {
|
||||||
time_t ll_time;
|
time_t ll_time;
|
||||||
char ll_line[8];
|
char ll_line[8];
|
||||||
char ll_host[16]; /* same as in utmp */
|
char ll_host[16]; /* same as in utmp */
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -36,36 +36,6 @@
|
|||||||
#ifndef _LIMITS_H_
|
#ifndef _LIMITS_H_
|
||||||
#define _LIMITS_H_
|
#define _LIMITS_H_
|
||||||
|
|
||||||
/*
|
|
||||||
* We don't need this crud at the moment so save on abuse of the C
|
|
||||||
* preprocessor by not doing the defines.
|
|
||||||
|
|
||||||
#define _POSIX_ARG_MAX 4096
|
|
||||||
#define _POSIX_CHILD_MAX 6
|
|
||||||
#define _POSIX_LINK_MAX 8
|
|
||||||
#define _POSIX_MAX_CANON 255
|
|
||||||
#define _POSIX_MAX_INPUT 255
|
|
||||||
#define _POSIX_NAME_MAX 14
|
|
||||||
#define _POSIX_NGROUPS_MAX 0
|
|
||||||
#define _POSIX_OPEN_MAX 16
|
|
||||||
#define _POSIX_PATH_MAX 255
|
|
||||||
#define _POSIX_PIPE_BUF 512
|
|
||||||
#define _POSIX_SSIZE_MAX 32767
|
|
||||||
#define _POSIX_STREAM_MAX 8
|
|
||||||
#define _POSIX_TZNAME_MAX 3
|
|
||||||
|
|
||||||
#define _POSIX2_BC_BASE_MAX 99
|
|
||||||
#define _POSIX2_BC_DIM_MAX 2048
|
|
||||||
#define _POSIX2_BC_SCALE_MAX 99
|
|
||||||
#define _POSIX2_BC_STRING_MAX 1000
|
|
||||||
#define _POSIX2_EQUIV_CLASS_MAX 2
|
|
||||||
#define _POSIX2_EXPR_NEST_MAX 32
|
|
||||||
#define _POSIX2_LINE_MAX 2048
|
|
||||||
#define _POSIX2_RE_DUP_MAX 255
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <machine/limits.h>
|
#include <machine/limits.h>
|
||||||
/* #include <sys/syslimits.h> */
|
|
||||||
|
|
||||||
#endif /* !_LIMITS_H_ */
|
#endif /* !_LIMITS_H_ */
|
||||||
|
|||||||
@@ -4,16 +4,16 @@
|
|||||||
* specifies the terms and conditions for redistribution.
|
* specifies the terms and conditions for redistribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern double fabs(), floor(), ceil(), fmod(), ldexp();
|
double fabs(double), floor(double), ceil(double);
|
||||||
extern double sqrt(), hypot(), atof();
|
double sqrt(double), hypot(double, double);
|
||||||
extern double sin(), cos(), tan(), asin(), acos(), atan(), atan2();
|
double sin(double), cos(double), tan(double);
|
||||||
extern double exp(), log(), log10(), pow();
|
double asin(double), acos(double), atan(double), atan2(double, double);
|
||||||
extern double sinh(), cosh(), tanh();
|
double exp(double), log(double), log10(double), pow(double, double);
|
||||||
extern double gamma();
|
double sinh(double), cosh(double), tanh(double);
|
||||||
extern double j0(), j1(), jn(), y0(), y1(), yn();
|
double j0(double), j1(double), jn(int, double);
|
||||||
|
double y0(double), y1(double), yn(int, double);
|
||||||
|
|
||||||
#define HUGE 1.701411733192644270e38
|
#define HUGE_VAL 3.40282347e+38 /* TBD??? use infinity? */
|
||||||
#define LOGHUGE 39
|
|
||||||
|
|
||||||
int isnanf(float x);
|
int isnanf(float x);
|
||||||
int isnan(double x);
|
int isnan(double x);
|
||||||
@@ -31,3 +31,21 @@ float ldexpf(float x, int exp);
|
|||||||
double ldexp(double x, int exp);
|
double ldexp(double x, int exp);
|
||||||
|
|
||||||
double fmod(double x, double y);
|
double fmod(double x, double y);
|
||||||
|
|
||||||
|
#if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
|
||||||
|
|
||||||
|
#define M_E 2.7182818284590452354 /* e */
|
||||||
|
#define M_LOG2E 1.4426950408889634074 /* log 2e */
|
||||||
|
#define M_LOG10E 0.43429448190325182765 /* log 10e */
|
||||||
|
#define M_LN2 0.69314718055994530942 /* log e2 */
|
||||||
|
#define M_LN10 2.30258509299404568402 /* log e10 */
|
||||||
|
#define M_PI 3.14159265358979323846 /* pi */
|
||||||
|
#define M_PI_2 1.57079632679489661923 /* pi/2 */
|
||||||
|
#define M_PI_4 0.78539816339744830962 /* pi/4 */
|
||||||
|
#define M_1_PI 0.31830988618379067154 /* 1/pi */
|
||||||
|
#define M_2_PI 0.63661977236758134308 /* 2/pi */
|
||||||
|
#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
|
||||||
|
#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
|
||||||
|
#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
|
||||||
|
|
||||||
|
#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */
|
||||||
|
|||||||
@@ -3,14 +3,14 @@
|
|||||||
* All rights reserved. The Berkeley software License Agreement
|
* All rights reserved. The Berkeley software License Agreement
|
||||||
* specifies the terms and conditions for redistribution.
|
* specifies the terms and conditions for redistribution.
|
||||||
*
|
*
|
||||||
* @(#)mtab.h 5.1 (Berkeley) 5/30/85
|
* @(#)mtab.h 5.1 (Berkeley) 5/30/85
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mounted device accounting file.
|
* Mounted device accounting file.
|
||||||
*/
|
*/
|
||||||
struct mtab {
|
struct mtab {
|
||||||
char m_path[32]; /* mounted on pathname */
|
char m_path[32]; /* mounted on pathname */
|
||||||
char m_dname[32]; /* block device pathname */
|
char m_dname[32]; /* block device pathname */
|
||||||
char m_type[4]; /* read-only, quotas */
|
char m_type[4]; /* read-only, quotas */
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -3,64 +3,60 @@
|
|||||||
* All rights reserved. The Berkeley software License Agreement
|
* All rights reserved. The Berkeley software License Agreement
|
||||||
* specifies the terms and conditions for redistribution.
|
* specifies the terms and conditions for redistribution.
|
||||||
*
|
*
|
||||||
* @(#)ndbm.h 5.1.1 (2.11BSD GTE) 12/31/93
|
* @(#)ndbm.h 5.1.1 (2.11BSD GTE) 12/31/93
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Hashed key data base library.
|
* Hashed key data base library.
|
||||||
*/
|
*/
|
||||||
#define PBLKSIZ 1024
|
#define PBLKSIZ 1024
|
||||||
#ifdef pdp11
|
#define DBLKSIZ 1024
|
||||||
#define DBLKSIZ 512
|
|
||||||
#else
|
|
||||||
#define DBLKSIZ 4096
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int dbm_dirf; /* open directory file */
|
int dbm_dirf; /* open directory file */
|
||||||
int dbm_pagf; /* open page file */
|
int dbm_pagf; /* open page file */
|
||||||
int dbm_flags; /* flags, see below */
|
int dbm_flags; /* flags, see below */
|
||||||
long dbm_maxbno; /* last ``bit'' in dir file */
|
long dbm_maxbno; /* last ``bit'' in dir file */
|
||||||
long dbm_bitno; /* current bit number */
|
long dbm_bitno; /* current bit number */
|
||||||
long dbm_hmask; /* hash mask */
|
long dbm_hmask; /* hash mask */
|
||||||
long dbm_blkptr; /* current block for dbm_nextkey */
|
long dbm_blkptr; /* current block for dbm_nextkey */
|
||||||
int dbm_keyptr; /* current key for dbm_nextkey */
|
int dbm_keyptr; /* current key for dbm_nextkey */
|
||||||
long dbm_blkno; /* current page to read/write */
|
long dbm_blkno; /* current page to read/write */
|
||||||
long dbm_pagbno; /* current page in pagbuf */
|
long dbm_pagbno; /* current page in pagbuf */
|
||||||
char dbm_pagbuf[PBLKSIZ]; /* page file block buffer */
|
char dbm_pagbuf[PBLKSIZ]; /* page file block buffer */
|
||||||
long dbm_dirbno; /* current block in dirbuf */
|
long dbm_dirbno; /* current block in dirbuf */
|
||||||
char dbm_dirbuf[DBLKSIZ]; /* directory file block buffer */
|
char dbm_dirbuf[DBLKSIZ]; /* directory file block buffer */
|
||||||
} DBM;
|
} DBM;
|
||||||
|
|
||||||
#define _DBM_RDONLY 0x1 /* data base open read-only */
|
#define _DBM_RDONLY 0x1 /* data base open read-only */
|
||||||
#define _DBM_IOERR 0x2 /* data base I/O error */
|
#define _DBM_IOERR 0x2 /* data base I/O error */
|
||||||
|
|
||||||
#define dbm_rdonly(db) ((db)->dbm_flags & _DBM_RDONLY)
|
#define dbm_rdonly(db) ((db)->dbm_flags & _DBM_RDONLY)
|
||||||
|
|
||||||
#define dbm_error(db) ((db)->dbm_flags & _DBM_IOERR)
|
#define dbm_error(db) ((db)->dbm_flags & _DBM_IOERR)
|
||||||
/* use this one at your own risk! */
|
/* use this one at your own risk! */
|
||||||
#define dbm_clearerr(db) ((db)->dbm_flags &= ~_DBM_IOERR)
|
#define dbm_clearerr(db) ((db)->dbm_flags &= ~_DBM_IOERR)
|
||||||
|
|
||||||
/* for flock(2) and fstat(2) */
|
/* for flock(2) and fstat(2) */
|
||||||
#define dbm_dirfno(db) ((db)->dbm_dirf)
|
#define dbm_dirfno(db) ((db)->dbm_dirf)
|
||||||
#define dbm_pagfno(db) ((db)->dbm_pagf)
|
#define dbm_pagfno(db) ((db)->dbm_pagf)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *dptr;
|
char *dptr;
|
||||||
int dsize;
|
int dsize;
|
||||||
} datum;
|
} datum;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* flags to dbm_store()
|
* flags to dbm_store()
|
||||||
*/
|
*/
|
||||||
#define DBM_INSERT 0
|
#define DBM_INSERT 0
|
||||||
#define DBM_REPLACE 1
|
#define DBM_REPLACE 1
|
||||||
|
|
||||||
DBM *dbm_open();
|
DBM *dbm_open();
|
||||||
void dbm_close();
|
void dbm_close();
|
||||||
datum dbm_fetch();
|
datum dbm_fetch();
|
||||||
datum dbm_firstkey();
|
datum dbm_firstkey();
|
||||||
datum dbm_nextkey();
|
datum dbm_nextkey();
|
||||||
long dbm_forder();
|
long dbm_forder();
|
||||||
int dbm_delete();
|
int dbm_delete();
|
||||||
int dbm_store();
|
int dbm_store();
|
||||||
|
|||||||
@@ -18,17 +18,17 @@
|
|||||||
/*
|
/*
|
||||||
* Protocols
|
* Protocols
|
||||||
*/
|
*/
|
||||||
#define IPPROTO_IP 0 /* dummy for IP */
|
#define IPPROTO_IP 0 /* dummy for IP */
|
||||||
#define IPPROTO_ICMP 1 /* control message protocol */
|
#define IPPROTO_ICMP 1 /* control message protocol */
|
||||||
#define IPPROTO_GGP 3 /* gateway^2 (deprecated) */
|
#define IPPROTO_GGP 3 /* gateway^2 (deprecated) */
|
||||||
#define IPPROTO_TCP 6 /* tcp */
|
#define IPPROTO_TCP 6 /* tcp */
|
||||||
#define IPPROTO_EGP 8 /* exterior gateway protocol */
|
#define IPPROTO_EGP 8 /* exterior gateway protocol */
|
||||||
#define IPPROTO_PUP 12 /* pup */
|
#define IPPROTO_PUP 12 /* pup */
|
||||||
#define IPPROTO_UDP 17 /* user datagram protocol */
|
#define IPPROTO_UDP 17 /* user datagram protocol */
|
||||||
#define IPPROTO_IDP 22 /* xns idp */
|
#define IPPROTO_IDP 22 /* xns idp */
|
||||||
|
|
||||||
#define IPPROTO_RAW 255 /* raw IP packet */
|
#define IPPROTO_RAW 255 /* raw IP packet */
|
||||||
#define IPPROTO_MAX 256
|
#define IPPROTO_MAX 256
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -37,21 +37,21 @@
|
|||||||
* Ports > IPPORT_USERRESERVED are reserved
|
* Ports > IPPORT_USERRESERVED are reserved
|
||||||
* for servers, not necessarily privileged.
|
* for servers, not necessarily privileged.
|
||||||
*/
|
*/
|
||||||
#define IPPORT_RESERVED 1024
|
#define IPPORT_RESERVED 1024
|
||||||
#define IPPORT_USERRESERVED 5000
|
#define IPPORT_USERRESERVED 5000
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Link numbers
|
* Link numbers
|
||||||
*/
|
*/
|
||||||
#define IMPLINK_IP 155
|
#define IMPLINK_IP 155
|
||||||
#define IMPLINK_LOWEXPER 156
|
#define IMPLINK_LOWEXPER 156
|
||||||
#define IMPLINK_HIGHEXPER 158
|
#define IMPLINK_HIGHEXPER 158
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Internet address (a structure for historical reasons)
|
* Internet address (a structure for historical reasons)
|
||||||
*/
|
*/
|
||||||
struct in_addr {
|
struct in_addr {
|
||||||
u_long s_addr;
|
u_long s_addr;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -59,51 +59,51 @@ struct in_addr {
|
|||||||
* On subnets, the decomposition of addresses to host and net parts
|
* On subnets, the decomposition of addresses to host and net parts
|
||||||
* is done according to subnet mask, not the masks here.
|
* is done according to subnet mask, not the masks here.
|
||||||
*/
|
*/
|
||||||
#define IN_CLASSA(i) (((long)(i) & 0x80000000L) == 0)
|
#define IN_CLASSA(i) (((long)(i) & 0x80000000L) == 0)
|
||||||
#define IN_CLASSA_NET 0xff000000L
|
#define IN_CLASSA_NET 0xff000000L
|
||||||
#define IN_CLASSA_NSHIFT 24
|
#define IN_CLASSA_NSHIFT 24
|
||||||
#define IN_CLASSA_HOST 0x00ffffffL
|
#define IN_CLASSA_HOST 0x00ffffffL
|
||||||
#define IN_CLASSA_MAX 128
|
#define IN_CLASSA_MAX 128
|
||||||
|
|
||||||
#define IN_CLASSB(i) (((long)(i) & 0xc0000000L) == 0x80000000L)
|
#define IN_CLASSB(i) (((long)(i) & 0xc0000000L) == 0x80000000L)
|
||||||
#define IN_CLASSB_NET 0xffff0000L
|
#define IN_CLASSB_NET 0xffff0000L
|
||||||
#define IN_CLASSB_NSHIFT 16
|
#define IN_CLASSB_NSHIFT 16
|
||||||
#define IN_CLASSB_HOST 0x0000ffffL
|
#define IN_CLASSB_HOST 0x0000ffffL
|
||||||
#define IN_CLASSB_MAX 65536
|
#define IN_CLASSB_MAX 65536
|
||||||
|
|
||||||
#define IN_CLASSC(i) (((long)(i) & 0xe0000000L) == 0xc0000000L)
|
#define IN_CLASSC(i) (((long)(i) & 0xe0000000L) == 0xc0000000L)
|
||||||
#define IN_CLASSC_NET 0xffffff00L
|
#define IN_CLASSC_NET 0xffffff00L
|
||||||
#define IN_CLASSC_NSHIFT 8
|
#define IN_CLASSC_NSHIFT 8
|
||||||
#define IN_CLASSC_HOST 0x000000ffL
|
#define IN_CLASSC_HOST 0x000000ffL
|
||||||
|
|
||||||
#define IN_CLASSD(i) (((long)(i) & 0xf0000000L) == 0xe0000000L)
|
#define IN_CLASSD(i) (((long)(i) & 0xf0000000L) == 0xe0000000L)
|
||||||
#define IN_MULTICAST(i) IN_CLASSD(i)
|
#define IN_MULTICAST(i) IN_CLASSD(i)
|
||||||
|
|
||||||
#define IN_EXPERIMENTAL(i) (((long)(i) & 0xe0000000L) == 0xe0000000L)
|
#define IN_EXPERIMENTAL(i) (((long)(i) & 0xe0000000L) == 0xe0000000L)
|
||||||
#define IN_BADCLASS(i) (((long)(i) & 0xf0000000L) == 0xf0000000L)
|
#define IN_BADCLASS(i) (((long)(i) & 0xf0000000L) == 0xf0000000L)
|
||||||
|
|
||||||
#define INADDR_ANY 0x00000000L
|
#define INADDR_ANY 0x00000000L
|
||||||
#define INADDR_BROADCAST 0xffffffffL /* must be masked */
|
#define INADDR_BROADCAST 0xffffffffL /* must be masked */
|
||||||
#ifndef KERNEL
|
#ifndef KERNEL
|
||||||
#define INADDR_NONE 0xffffffffL /* -1 return */
|
#define INADDR_NONE 0xffffffffL /* -1 return */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define IN_LOOPBACKNET 127 /* official! */
|
#define IN_LOOPBACKNET 127 /* official! */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Socket address, internet style.
|
* Socket address, internet style.
|
||||||
*/
|
*/
|
||||||
struct sockaddr_in {
|
struct sockaddr_in {
|
||||||
short sin_family;
|
short sin_family;
|
||||||
u_short sin_port;
|
u_short sin_port;
|
||||||
struct in_addr sin_addr;
|
struct in_addr sin_addr;
|
||||||
char sin_zero[8];
|
char sin_zero[8];
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Options for use with [gs]etsockopt at the IP level.
|
* Options for use with [gs]etsockopt at the IP level.
|
||||||
*/
|
*/
|
||||||
#define IP_OPTIONS 1 /* set/get IP per-packet options */
|
#define IP_OPTIONS 1 /* set/get IP per-packet options */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Definitions for inet sysctl operations.
|
* Definitions for inet sysctl operations.
|
||||||
@@ -111,55 +111,55 @@ struct sockaddr_in {
|
|||||||
* Third level is protocol number.
|
* Third level is protocol number.
|
||||||
* Fourth level is desired variable within that protocol.
|
* Fourth level is desired variable within that protocol.
|
||||||
*/
|
*/
|
||||||
#define IPPROTO_MAXID (IPPROTO_IDP + 1) /* don't list to IPPROTO_MAX */
|
#define IPPROTO_MAXID (IPPROTO_IDP + 1) /* don't list to IPPROTO_MAX */
|
||||||
|
|
||||||
#ifndef KERNEL
|
#ifndef KERNEL
|
||||||
#define CTL_IPPROTO_NAMES { \
|
#define CTL_IPPROTO_NAMES { \
|
||||||
{ "ip", CTLTYPE_NODE }, \
|
{ "ip", CTLTYPE_NODE }, \
|
||||||
{ "icmp", CTLTYPE_NODE }, \
|
{ "icmp", CTLTYPE_NODE }, \
|
||||||
{ "igmp", CTLTYPE_NODE }, \
|
{ "igmp", CTLTYPE_NODE }, \
|
||||||
{ 0, 0 }, \
|
{ 0, 0 }, \
|
||||||
{ 0, 0 }, \
|
{ 0, 0 }, \
|
||||||
{ 0, 0 }, \
|
{ 0, 0 }, \
|
||||||
{ "tcp", CTLTYPE_NODE }, \
|
{ "tcp", CTLTYPE_NODE }, \
|
||||||
{ 0, 0 }, \
|
{ 0, 0 }, \
|
||||||
{ 0, 0 }, \
|
{ 0, 0 }, \
|
||||||
{ 0, 0 }, \
|
{ 0, 0 }, \
|
||||||
{ 0, 0 }, \
|
{ 0, 0 }, \
|
||||||
{ 0, 0 }, \
|
{ 0, 0 }, \
|
||||||
{ 0, 0 }, \
|
{ 0, 0 }, \
|
||||||
{ 0, 0 }, \
|
{ 0, 0 }, \
|
||||||
{ 0, 0 }, \
|
{ 0, 0 }, \
|
||||||
{ 0, 0 }, \
|
{ 0, 0 }, \
|
||||||
{ 0, 0 }, \
|
{ 0, 0 }, \
|
||||||
{ "udp", CTLTYPE_NODE }, \
|
{ "udp", CTLTYPE_NODE }, \
|
||||||
{ 0, 0 }, \
|
{ 0, 0 }, \
|
||||||
{ 0, 0 }, \
|
{ 0, 0 }, \
|
||||||
{ 0, 0 }, \
|
{ 0, 0 }, \
|
||||||
{ 0, 0 }, \
|
{ 0, 0 }, \
|
||||||
{ "idp", CTLTYPE_NODE }, \
|
{ "idp", CTLTYPE_NODE }, \
|
||||||
}
|
}
|
||||||
#endif /* KERNEL */
|
#endif /* KERNEL */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Names for IP sysctl objects
|
* Names for IP sysctl objects
|
||||||
*/
|
*/
|
||||||
#define IPCTL_FORWARDING 1 /* act as router */
|
#define IPCTL_FORWARDING 1 /* act as router */
|
||||||
#define IPCTL_SENDREDIRECTS 2 /* may send redirects when forwarding */
|
#define IPCTL_SENDREDIRECTS 2 /* may send redirects when forwarding */
|
||||||
#define IPCTL_DEFTTL 3 /* default TTL */
|
#define IPCTL_DEFTTL 3 /* default TTL */
|
||||||
#ifdef notyet
|
#ifdef notyet
|
||||||
#define IPCTL_DEFMTU 4 /* default MTU */
|
#define IPCTL_DEFMTU 4 /* default MTU */
|
||||||
#endif
|
#endif
|
||||||
#define IPCTL_FORWSRCRT 5 /* forward source-routed dgrams */
|
#define IPCTL_FORWSRCRT 5 /* forward source-routed dgrams */
|
||||||
#define IPCTL_MAXID 6
|
#define IPCTL_MAXID 6
|
||||||
|
|
||||||
#ifndef KERNEL
|
#ifndef KERNEL
|
||||||
#define IPCTL_NAMES { \
|
#define IPCTL_NAMES { \
|
||||||
{ 0, 0 }, \
|
{ 0, 0 }, \
|
||||||
{ "forwarding", CTLTYPE_INT }, \
|
{ "forwarding", CTLTYPE_INT }, \
|
||||||
{ "redirect", CTLTYPE_INT }, \
|
{ "redirect", CTLTYPE_INT }, \
|
||||||
{ "ttl", CTLTYPE_INT }, \
|
{ "ttl", CTLTYPE_INT }, \
|
||||||
{ "mtu", CTLTYPE_INT }, \
|
{ "mtu", CTLTYPE_INT }, \
|
||||||
{ "forwsrcrt", CTLTYPE_INT }, \
|
{ "forwsrcrt", CTLTYPE_INT }, \
|
||||||
}
|
}
|
||||||
#endif /* KERNEL */
|
#endif /* KERNEL */
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* 3. All advertising materials mentioning features or use of this software
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
* must display the following acknowledgement:
|
* must display the following acknowledgement:
|
||||||
* This product includes software developed by the University of
|
* This product includes software developed by the University of
|
||||||
* California, Berkeley and its contributors.
|
* California, Berkeley and its contributors.
|
||||||
* 4. Neither the name of the University nor the names of its contributors
|
* 4. Neither the name of the University nor the names of its contributors
|
||||||
* may be used to endorse or promote products derived from this software
|
* may be used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
@@ -30,37 +30,37 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#ifndef _NLIST_H_
|
#ifndef _NLIST_H_
|
||||||
#define _NLIST_H_
|
#define _NLIST_H_
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Symbol table entry format.
|
* Symbol table entry format.
|
||||||
*/
|
*/
|
||||||
struct nlist {
|
struct nlist {
|
||||||
char *n_name; /* In memory address of symbol name,
|
char *n_name; /* In memory address of symbol name,
|
||||||
or string table offset (file) */
|
* or string table offset (file) */
|
||||||
u_short n_len; /* Length of name in bytes */
|
u_short n_len; /* Length of name in bytes */
|
||||||
u_short n_type; /* Type of symbol - see below */
|
u_short n_type; /* Type of symbol - see below */
|
||||||
u_int n_value; /* Symbol value */
|
u_int n_value; /* Symbol value */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Simple values for n_type.
|
* Simple values for n_type.
|
||||||
*/
|
*/
|
||||||
#define N_UNDF 0x00 /* undefined */
|
#define N_UNDF 0x00 /* undefined */
|
||||||
#define N_ABS 0x01 /* absolute */
|
#define N_ABS 0x01 /* absolute */
|
||||||
#define N_TEXT 0x02 /* text segment */
|
#define N_TEXT 0x02 /* text segment */
|
||||||
#define N_DATA 0x03 /* data segment */
|
#define N_DATA 0x03 /* data segment */
|
||||||
#define N_BSS 0x04 /* bss segment */
|
#define N_BSS 0x04 /* bss segment */
|
||||||
#define N_STRNG 0x05 /* string segment (for assembler) */
|
#define N_STRNG 0x05 /* string segment (for assembler) */
|
||||||
#define N_COMM 0x06 /* .comm segment (for assembler) */
|
#define N_COMM 0x06 /* .comm segment (for assembler) */
|
||||||
#define N_FN 0x1f /* file name */
|
#define N_FN 0x1f /* file name */
|
||||||
|
|
||||||
#define N_TYPE 0x1f /* mask for all the type bits */
|
#define N_TYPE 0x1f /* mask for all the type bits */
|
||||||
#define N_EXT 0x20 /* external (global) bit, OR'ed in */
|
#define N_EXT 0x20 /* external (global) bit, OR'ed in */
|
||||||
#define N_WEAK 0x40 /* weak reference bit, OR'ed in */
|
#define N_WEAK 0x40 /* weak reference bit, OR'ed in */
|
||||||
#define N_LOC 0x80 /* local, for assembler */
|
#define N_LOC 0x80 /* local, for assembler */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Get symbols from a file.
|
* Get symbols from a file.
|
||||||
@@ -72,4 +72,4 @@ int nlist (char *name, struct nlist *list);
|
|||||||
*/
|
*/
|
||||||
int knlist (struct nlist *list);
|
int knlist (struct nlist *list);
|
||||||
|
|
||||||
#endif /* !_NLIST_H_ */
|
#endif /* !_NLIST_H_ */
|
||||||
|
|||||||
@@ -14,46 +14,53 @@
|
|||||||
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
*/
|
*/
|
||||||
#define _PATH_BSHELL "/bin/sh"
|
#define _PATH_BSHELL "/bin/sh"
|
||||||
#define _PATH_CSHELL "/bin/csh"
|
#define _PATH_CSHELL "/bin/csh"
|
||||||
#define _PATH_CP "/bin/cp"
|
#define _PATH_CP "/bin/cp"
|
||||||
#define _PATH_ECHO "/bin/echo"
|
#define _PATH_ECHO "/bin/echo"
|
||||||
#define _PATH_MORE "/bin/more"
|
#define _PATH_MORE "/bin/more"
|
||||||
#define _PATH_RSH "/bin/rsh"
|
#define _PATH_RSH "/bin/rsh"
|
||||||
#define _PATH_VI "/bin/vi"
|
#define _PATH_VI "/bin/vi"
|
||||||
#define _PATH_CORE "/core"
|
#define _PATH_CORE "/core"
|
||||||
#define _PATH_DEV "/dev/"
|
#define _PATH_DEV "/dev/"
|
||||||
#define _PATH_CONSOLE "/dev/console"
|
#define _PATH_CONSOLE "/dev/console"
|
||||||
#define _PATH_DEVNULL "/dev/null"
|
#define _PATH_LOG "/dev/log"
|
||||||
#define _PATH_TTY "/dev/tty"
|
#define _PATH_DEVNULL "/dev/null"
|
||||||
|
#define _PATH_TTY "/dev/tty"
|
||||||
#define _PATH_MEM "/dev/mem"
|
#define _PATH_MEM "/dev/mem"
|
||||||
#define _PATH_SWAP "/dev/swap"
|
#define _PATH_SWAP "/dev/swap"
|
||||||
#define _PATH_LOCALTIME "/etc/localtime"
|
#define _PATH_FSTAB "/etc/fstab"
|
||||||
#define _PATH_MOTD "/etc/motd"
|
#define _PATH_LOCALTIME "/etc/localtime"
|
||||||
#define _PATH_NOLOGIN "/etc/nologin"
|
#define _PATH_MOTD "/etc/motd"
|
||||||
|
#define _PATH_NOLOGIN "/etc/nologin"
|
||||||
|
#define _PATH_PASSWD "/etc/passwd"
|
||||||
|
#define _PATH_PTMP "/etc/ptmp"
|
||||||
|
#define _PATH_SHADOW "/etc/shadow"
|
||||||
|
#define _PATH_TERMCAP "/etc/termcap"
|
||||||
#define _PATH_USRLIB "/lib/"
|
#define _PATH_USRLIB "/lib/"
|
||||||
#define _PATH_CTIMED "/libexec/ctimed"
|
#define _PATH_CTIMED "/libexec/ctimed"
|
||||||
#define _PATH_LOCALLIB "/local/lib/"
|
#define _PATH_LOCALLIB "/local/lib/"
|
||||||
#define _PATH_SBIN "/sbin/"
|
#define _PATH_SBIN "/sbin/"
|
||||||
#define _PATH_USRSBIN "/sbin/"
|
#define _PATH_USRSBIN "/sbin/"
|
||||||
#define _PATH_SENDMAIL "/sbin/sendmail"
|
#define _PATH_MKPASSWD "/sbin/mkpasswd"
|
||||||
|
#define _PATH_SENDMAIL "/sbin/sendmail"
|
||||||
#define _PATH_SHARE "/share/"
|
#define _PATH_SHARE "/share/"
|
||||||
#define _PATH_ZONEINFO "/share/zoneinfo" /* Time zone object file directory */
|
#define _PATH_ZONEINFO "/share/zoneinfo" /* Time zone object file directory */
|
||||||
#define _PATH_TMP "/tmp/"
|
#define _PATH_TMP "/tmp/"
|
||||||
#define _PATH_USRTMP "/tmp/"
|
#define _PATH_USRTMP "/tmp/"
|
||||||
#define _PATH_LASTLOG "/var/log/lastlog"
|
#define _PATH_LASTLOG "/var/log/lastlog"
|
||||||
#define _PATH_MESSAGES "/var/log/messages"
|
#define _PATH_MESSAGES "/var/log/messages"
|
||||||
#define _PATH_WTMP "/var/log/wtmp"
|
#define _PATH_WTMP "/var/log/wtmp"
|
||||||
#define _PATH_MAIL "/var/mail/"
|
#define _PATH_MAIL "/var/mail/"
|
||||||
#define _PATH_VARRUN "/var/run/"
|
#define _PATH_VARRUN "/var/run/"
|
||||||
#define _PATH_DEVDB "/var/run/dev"
|
#define _PATH_DEVDB "/var/run/dev"
|
||||||
#define _PATH_UTMP "/var/run/utmp"
|
#define _PATH_UTMP "/var/run/utmp"
|
||||||
#define _PATH_ARTMP "/tmp/ar.XXXXXX"
|
#define _PATH_ARTMP "/tmp/ar.XXXXXX"
|
||||||
#define _PATH_RANTMP "/tmp/ranlib.XXXXXX"
|
#define _PATH_RANTMP "/tmp/ranlib.XXXXXX"
|
||||||
|
|
||||||
#define _PATH_STDPATH "/bin"
|
#define _PATH_STDPATH "/bin"
|
||||||
#define _PATH_SYSPATH "/bin:/sbin:/local"
|
#define _PATH_SYSPATH "/bin:/sbin:/local"
|
||||||
#define _PATH_MAN "/share/man:/local/man"
|
#define _PATH_MAN "/share/man:/local/man"
|
||||||
#define _PATH_LOCALMAN "/local/man"
|
#define _PATH_LOCALMAN "/local/man"
|
||||||
|
|
||||||
#define _PATH_HUSHLOGIN ".hushlogin"
|
#define _PATH_HUSHLOGIN ".hushlogin"
|
||||||
|
|||||||
229
include/pcc.h
229
include/pcc.h
@@ -1,229 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 1983 Regents of the University of California.
|
|
||||||
* All rights reserved. The Berkeley software License Agreement
|
|
||||||
* specifies the terms and conditions for redistribution.
|
|
||||||
*
|
|
||||||
* @(#)pcc.h 5.1 (Berkeley) 5/30/85
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This file contains definitions for all the constants and structures
|
|
||||||
* needed to use the intermediate code files generated and read by
|
|
||||||
* the Portable C Compiler and related compilers.
|
|
||||||
*
|
|
||||||
* Rules for changing this code:
|
|
||||||
* 1) All op values must be integer constants -- this permits us to run
|
|
||||||
* a 'sed' script on this file to create %term declarations for yacc.
|
|
||||||
* 2) Because the PCC uses fancy ASG and UNARY macros, assignment
|
|
||||||
* operators must have values 1 greater than corresponding normal
|
|
||||||
* operators, and unary operators must have values 2 greater ditto.
|
|
||||||
* 3) Ops used only by f1 must have values >= 150 (PCCF_FORTOPS).
|
|
||||||
* 4) Other language-dependent ops must have values >= 200.
|
|
||||||
*/
|
|
||||||
|
|
||||||
# ifndef PCC_TOKENS
|
|
||||||
|
|
||||||
# define PCC_TOKENS 0
|
|
||||||
|
|
||||||
# define PCC_ERROR 1 /* an error node */
|
|
||||||
# define PCC_FREE 2 /* an unused node */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Constants.
|
|
||||||
*/
|
|
||||||
# define PCC_STRING 3 /* a string constant */
|
|
||||||
# define PCC_ICON 4 /* an integer constant */
|
|
||||||
# define PCC_FCON 5 /* a floating point constant */
|
|
||||||
# define PCC_DCON 6 /* a double precision f.p. constant */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Leaf types.
|
|
||||||
*/
|
|
||||||
# define PCC_NAME 7 /* an identifier */
|
|
||||||
# define PCC_REG 8 /* a register */
|
|
||||||
# define PCC_OREG 9 /* register and offset */
|
|
||||||
# define PCC_CCODES 10 /* condition codes */
|
|
||||||
# define PCC_FLD 11 /* a bit field */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Arithmetic operators.
|
|
||||||
*/
|
|
||||||
# define PCC_PLUS 12 /* + */
|
|
||||||
# define PCC_PLUSEQ 13 /* += */
|
|
||||||
# define PCC_UPLUS 14 /* unary + (for completeness) */
|
|
||||||
# define PCC_MINUS 15 /* - */
|
|
||||||
# define PCC_MINUSEQ 16 /* -= */
|
|
||||||
# define PCC_UMINUS 17 /* unary - */
|
|
||||||
# define PCC_MUL 18 /* * */
|
|
||||||
# define PCC_MULEQ 19 /* *= */
|
|
||||||
/* Reserve a slot for 'unary *', which is PCC jargon for PCC_DEREF (yech) */
|
|
||||||
# define PCC_DIV 21 /* / */
|
|
||||||
# define PCC_DIVEQ 22 /* /= */
|
|
||||||
# define PCC_MOD 23 /* % */
|
|
||||||
# define PCC_MODEQ 24 /* %= */
|
|
||||||
# define PCC_INCR 25 /* ++ */
|
|
||||||
# define PCC_DECR 26 /* -- */
|
|
||||||
# define PCC_ASSIGN 27 /* = (these last 3 are stretching it) */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Bit operators.
|
|
||||||
*/
|
|
||||||
# define PCC_AND 28 /* & */
|
|
||||||
# define PCC_ANDEQ 29 /* &= */
|
|
||||||
/* Reserve a slot for 'unary &', jargon for PCC_ADDROF */
|
|
||||||
# define PCC_OR 31 /* | */
|
|
||||||
# define PCC_OREQ 32 /* |= */
|
|
||||||
# define PCC_ER 33 /* ^ */
|
|
||||||
# define PCC_EREQ 34 /* ^= */
|
|
||||||
# define PCC_LS 35 /* << */
|
|
||||||
# define PCC_LSEQ 36 /* <<= */
|
|
||||||
# define PCC_RS 37 /* >> */
|
|
||||||
# define PCC_RSEQ 38 /* >>= */
|
|
||||||
# define PCC_COMPL 39 /* ~ */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Booleans.
|
|
||||||
*/
|
|
||||||
# define PCC_EQ 40 /* == */
|
|
||||||
# define PCC_NE 41 /* != */
|
|
||||||
# define PCC_LE 42 /* <= */
|
|
||||||
# define PCC_LT 43 /* < */
|
|
||||||
# define PCC_GE 44 /* >= */
|
|
||||||
# define PCC_GT 45 /* > */
|
|
||||||
# define PCC_ULE 46 /* unsigned <= */
|
|
||||||
# define PCC_ULT 47 /* unsigned < */
|
|
||||||
# define PCC_UGE 48 /* unsigned >= */
|
|
||||||
# define PCC_UGT 49 /* unsigned > */
|
|
||||||
# define PCC_QUEST 50 /* ? (for conditional expressions) */
|
|
||||||
# define PCC_COLON 51 /* : (for conditional expressions) */
|
|
||||||
# define PCC_ANDAND 52 /* && */
|
|
||||||
# define PCC_OROR 53 /* || */
|
|
||||||
# define PCC_NOT 54 /* ! */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Function calls.
|
|
||||||
*/
|
|
||||||
# define PCC_CALL 55 /* call by value */
|
|
||||||
/* no ASG */
|
|
||||||
# define PCC_UCALL 57 /* call with no arguments */
|
|
||||||
# define PCC_FORTCALL 58 /* call by reference? */
|
|
||||||
/* no ASG */
|
|
||||||
# define PCC_UFORTCALL 60 /* ??? */
|
|
||||||
# ifdef INLINE
|
|
||||||
# define PCC_INLINE 61 /* inline function */
|
|
||||||
/* no ASG */
|
|
||||||
# define PCC_UINLINE 63 /* inline with no arguments */
|
|
||||||
# endif INLINE
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Referencing and dereferencing.
|
|
||||||
*/
|
|
||||||
# define PCC_DEREF 20 /* * */
|
|
||||||
# define PCC_ADDROF 30 /* & */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Special structure operators.
|
|
||||||
*/
|
|
||||||
# define PCC_DOT 64 /* . */
|
|
||||||
# define PCC_STREF 65 /* -> */
|
|
||||||
# define PCC_STASG 66 /* structure assignment */
|
|
||||||
# define PCC_STARG 67 /* an argument of type structure */
|
|
||||||
# define PCC_STCALL 68 /* a function of type structure */
|
|
||||||
/* no ASG */
|
|
||||||
# define PCC_USTCALL 70 /* unary structure function */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Conversions.
|
|
||||||
*/
|
|
||||||
# define PCC_SCONV 71 /* scalar conversion */
|
|
||||||
# define PCC_PCONV 72 /* pointer conversion */
|
|
||||||
# define PCC_PMCONV 73 /* pointer multiply conversion */
|
|
||||||
# define PCC_PVCONV 74 /* pointer divide conversion */
|
|
||||||
# define PCC_CAST 75 /* redundant? */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Bracket types.
|
|
||||||
*/
|
|
||||||
# define PCC_LB 76 /* [ */
|
|
||||||
# define PCC_RB 77 /* ] */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Comma nodes.
|
|
||||||
*/
|
|
||||||
# define PCC_COMOP 78 /* , (in expressions) */
|
|
||||||
# define PCC_CM 79 /* , (in argument lists) */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Miscellaneous.
|
|
||||||
*/
|
|
||||||
# define PCC_FORCE 80 /* result of last expression goes in r0 */
|
|
||||||
# define PCC_GOTO 81 /* unconditional goto */
|
|
||||||
# define PCC_CBRANCH 82 /* goto label if !test */
|
|
||||||
# define PCC_RETURN 83 /* return from function */
|
|
||||||
# define PCC_INIT 84 /* initialized data */
|
|
||||||
# define PCC_TYPE 85 /* a type */
|
|
||||||
# define PCC_CLASS 86 /* a storage class */
|
|
||||||
|
|
||||||
# define PCC_MAXOP 86 /* highest numbered PCC op */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Special codes for interfacing to /lib/f1.
|
|
||||||
*/
|
|
||||||
# define PCCF_FORTOPS 150
|
|
||||||
# define PCCF_FTEXT 150 /* pass literal assembler text */
|
|
||||||
# define PCCF_FEXPR 151 /* a statement */
|
|
||||||
# define PCCF_FSWITCH 152 /* not implemented */
|
|
||||||
# define PCCF_FLBRAC 153 /* beginning of subroutine */
|
|
||||||
# define PCCF_FRBRAC 154 /* end of subroutine */
|
|
||||||
# define PCCF_FEOF 155 /* end of file */
|
|
||||||
# define PCCF_FARIF 156 /* not implemented */
|
|
||||||
# define PCCF_FLABEL 157 /* an f77 label */
|
|
||||||
|
|
||||||
# endif PCC_TOKENS
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Types, as encoded in intermediate file cookies.
|
|
||||||
*/
|
|
||||||
# define PCCT_UNDEF 0
|
|
||||||
# define PCCT_FARG 1 /* function argument */
|
|
||||||
# define PCCT_CHAR 2
|
|
||||||
# define PCCT_SHORT 3
|
|
||||||
# define PCCT_INT 4
|
|
||||||
# define PCCT_LONG 5
|
|
||||||
# define PCCT_FLOAT 6
|
|
||||||
# define PCCT_DOUBLE 7
|
|
||||||
# define PCCT_STRTY 8
|
|
||||||
# define PCCT_UNIONTY 9
|
|
||||||
# define PCCT_ENUMTY 10
|
|
||||||
# define PCCT_MOETY 11 /* member of enum */
|
|
||||||
# define PCCT_UCHAR 12
|
|
||||||
# define PCCT_USHORT 13
|
|
||||||
# define PCCT_UNSIGNED 14
|
|
||||||
# define PCCT_ULONG 15
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Type modifiers.
|
|
||||||
*/
|
|
||||||
# define PCCTM_PTR 020
|
|
||||||
# define PCCTM_FTN 040
|
|
||||||
# define PCCTM_ARY 060
|
|
||||||
# define PCCTM_BASETYPE 017
|
|
||||||
# define PCCTM_TYPESHIFT 2
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Useful macros. 'PCCOM' macros apply to ops.
|
|
||||||
*/
|
|
||||||
# define PCCOM_ASG 1+
|
|
||||||
# define PCCOM_UNARY 2+
|
|
||||||
# define PCCOM_NOASG (-1)+
|
|
||||||
# define PCCOM_NOUNARY (-2)+
|
|
||||||
|
|
||||||
# define PCCM_TRIPLE(op, var, type) \
|
|
||||||
((op) | ((var) << 8) | (long) (type) << 16)
|
|
||||||
# define PCCM_TEXT(s) \
|
|
||||||
PCCM_TRIPLE(PCCF_FTEXT, (strlen(s) + 3) / 4, 0)
|
|
||||||
# define PCCM_ADDTYPE(t, m) \
|
|
||||||
((((t) &~ PCCTM_BASETYPE) << PCCTM_TYPESHIFT) | \
|
|
||||||
(m) | ((t) & PCCTM_BASETYPE))
|
|
||||||
@@ -14,27 +14,27 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct psout {
|
struct psout {
|
||||||
dev_t o_ttyd; /* u_ttyd */
|
dev_t o_ttyd; /* u_ttyd */
|
||||||
int o_flag; /* p_flag */
|
int o_flag; /* p_flag */
|
||||||
short o_pid; /* p_pid */
|
short o_pid; /* p_pid */
|
||||||
char o_tty[3]; /* 1st 2 chars of tty after 'tty' */
|
char o_tty[3]; /* 1st 2 chars of tty after 'tty' */
|
||||||
char o_stat; /* p_stat */
|
char o_stat; /* p_stat */
|
||||||
short o_uid; /* p_uid */
|
short o_uid; /* p_uid */
|
||||||
char o_uname[UT_NAMESIZE]; /* login name of process owner */
|
char o_uname[UT_NAMESIZE]; /* login name of process owner */
|
||||||
short o_ppid; /* p_ppid */
|
short o_ppid; /* p_ppid */
|
||||||
char o_cpu; /* p_cpu */
|
char o_cpu; /* p_cpu */
|
||||||
char o_pri; /* p_pri */
|
char o_pri; /* p_pri */
|
||||||
char o_nice; /* p_nice */
|
char o_nice; /* p_nice */
|
||||||
short o_addr0; /* p_addr[0] */
|
short o_addr0; /* p_addr[0] */
|
||||||
short o_size; /* p_size */
|
short o_size; /* p_size */
|
||||||
caddr_t o_wchan; /* p_wchan */
|
caddr_t o_wchan; /* p_wchan */
|
||||||
time_t o_utime; /* u_utime */
|
time_t o_utime; /* u_utime */
|
||||||
time_t o_stime; /* u_stime */
|
time_t o_stime; /* u_stime */
|
||||||
time_t o_cutime; /* u_cutime */
|
time_t o_cutime; /* u_cutime */
|
||||||
time_t o_cstime; /* u_cstime */
|
time_t o_cstime; /* u_cstime */
|
||||||
short o_pgrp; /* p_pgrp */
|
short o_pgrp; /* p_pgrp */
|
||||||
int o_sigs; /* sum of SIGINT & SIGQUIT,
|
int o_sigs; /* sum of SIGINT & SIGQUIT,
|
||||||
if == 2 proc is ignoring both.*/
|
* if == 2 proc is ignoring both.*/
|
||||||
char o_comm[MAXCOMLEN+1]; /* u_comm */
|
char o_comm[MAXCOMLEN+1]; /* u_comm */
|
||||||
char o_args[64]; /* best guess at args to process */
|
char o_args[64]; /* best guess at args to process */
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,22 +15,17 @@
|
|||||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define _PATH_PASSWD "/etc/passwd"
|
#define _PW_KEYBYNAME '0'
|
||||||
#define _PATH_SHADOW "/etc/shadow"
|
#define _PW_KEYBYUID '1'
|
||||||
#define _PATH_MKPASSWD "/sbin/mkpasswd"
|
|
||||||
#define _PATH_PTMP "/etc/ptmp"
|
|
||||||
|
|
||||||
#define _PW_KEYBYNAME '0'
|
|
||||||
#define _PW_KEYBYUID '1'
|
|
||||||
|
|
||||||
struct passwd {
|
struct passwd {
|
||||||
char *pw_name; /* user name */
|
char *pw_name; /* user name */
|
||||||
char *pw_passwd; /* encrypted password */
|
char *pw_passwd; /* encrypted password */
|
||||||
int pw_uid; /* user uid */
|
int pw_uid; /* user uid */
|
||||||
int pw_gid; /* user gid */
|
int pw_gid; /* user gid */
|
||||||
char *pw_gecos; /* real name */
|
char *pw_gecos; /* real name */
|
||||||
char *pw_dir; /* home directory */
|
char *pw_dir; /* home directory */
|
||||||
char *pw_shell; /* default shell */
|
char *pw_shell; /* default shell */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct passwd *getpwent(), *getpwuid(), *getpwnam();
|
struct passwd *getpwent(), *getpwuid(), *getpwnam();
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* 3. All advertising materials mentioning features or use of this software
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
* must display the following acknowledgement:
|
* must display the following acknowledgement:
|
||||||
* This product includes software developed by the University of
|
* This product includes software developed by the University of
|
||||||
* California, Berkeley and its contributors.
|
* California, Berkeley and its contributors.
|
||||||
* 4. Neither the name of the University nor the names of its contributors
|
* 4. Neither the name of the University nor the names of its contributors
|
||||||
* may be used to endorse or promote products derived from this software
|
* may be used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
@@ -32,15 +32,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _RANLIB_H_
|
#ifndef _RANLIB_H_
|
||||||
#define _RANLIB_H_
|
#define _RANLIB_H_
|
||||||
|
|
||||||
#define RANLIBMAG "__.SYMDEF" /* archive file name */
|
#define RANLIBMAG "__.SYMDEF" /* archive file name */
|
||||||
#define RANLIBSKEW 3 /* creation time offset */
|
#define RANLIBSKEW 3 /* creation time offset */
|
||||||
|
|
||||||
struct ranlib {
|
struct ranlib {
|
||||||
int ran_len; /* 1 byte - name length in bytes */
|
int ran_len; /* 1 byte - name length in bytes */
|
||||||
unsigned ran_off; /* 4 bytes - file offset */
|
unsigned ran_off; /* 4 bytes - file offset */
|
||||||
char *ran_name; /* in memory symbol name */
|
char *ran_name; /* in memory symbol name */
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* !_RANLIB_H_ */
|
#endif /* !_RANLIB_H_ */
|
||||||
|
|||||||
7
include/regex.h
Normal file
7
include/regex.h
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#ifndef _REGEX_H
|
||||||
|
#define _REGEX_H
|
||||||
|
|
||||||
|
char *re_comp(const char *regex);
|
||||||
|
int re_exec(const char *string);
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -5,14 +5,15 @@
|
|||||||
* not the System V one.
|
* not the System V one.
|
||||||
*/
|
*/
|
||||||
#define NSUBEXP 10
|
#define NSUBEXP 10
|
||||||
|
|
||||||
typedef struct regexp {
|
typedef struct regexp {
|
||||||
char *startp[NSUBEXP];
|
char *startp[NSUBEXP];
|
||||||
char *endp[NSUBEXP];
|
char *endp[NSUBEXP];
|
||||||
char regstart; /* Internal use only. */
|
char regstart; /* Internal use only. */
|
||||||
char reganch; /* Internal use only. */
|
char reganch; /* Internal use only. */
|
||||||
char *regmust; /* Internal use only. */
|
char *regmust; /* Internal use only. */
|
||||||
int regmlen; /* Internal use only. */
|
int regmlen; /* Internal use only. */
|
||||||
char program[1]; /* Unwarranted chumminess with compiler. */
|
char program[1]; /* Unwarranted chumminess with compiler. */
|
||||||
} regexp;
|
} regexp;
|
||||||
|
|
||||||
extern regexp *regcomp();
|
extern regexp *regcomp();
|
||||||
|
|||||||
@@ -10,105 +10,105 @@ extern int LINES, COLS;
|
|||||||
/*
|
/*
|
||||||
* pseudo functions for standard screen
|
* pseudo functions for standard screen
|
||||||
*/
|
*/
|
||||||
#define addch(ch) waddch(stdscr, ch)
|
#define addch(ch) waddch(stdscr, ch)
|
||||||
#define getch() wgetch(stdscr)
|
#define getch() wgetch(stdscr)
|
||||||
#define addstr(str) waddstr(stdscr, str)
|
#define addstr(str) waddstr(stdscr, str)
|
||||||
#define getstr(str) wgetstr(stdscr, str)
|
#define getstr(str) wgetstr(stdscr, str)
|
||||||
#define move(y, x) wmove(stdscr, y, x)
|
#define move(y, x) wmove(stdscr, y, x)
|
||||||
#define clear() wclear(stdscr)
|
#define clear() wclear(stdscr)
|
||||||
#define erase() werase(stdscr)
|
#define erase() werase(stdscr)
|
||||||
#define clrtobot() wclrtobot(stdscr)
|
#define clrtobot() wclrtobot(stdscr)
|
||||||
#define clrtoeol() wclrtoeol(stdscr)
|
#define clrtoeol() wclrtoeol(stdscr)
|
||||||
#define insertln() winsertln(stdscr)
|
#define insertln() winsertln(stdscr)
|
||||||
#define deleteln() wdeleteln(stdscr)
|
#define deleteln() wdeleteln(stdscr)
|
||||||
#define refresh() wrefresh(stdscr)
|
#define refresh() wrefresh(stdscr)
|
||||||
#define inch() winch(stdscr)
|
#define inch() winch(stdscr)
|
||||||
#define insch(c) winsch(stdscr,c)
|
#define insch(c) winsch(stdscr,c)
|
||||||
#define delch() wdelch(stdscr)
|
#define delch() wdelch(stdscr)
|
||||||
#define standout() wstandout(stdscr)
|
#define standout() wstandout(stdscr)
|
||||||
#define standend() wstandend(stdscr)
|
#define standend() wstandend(stdscr)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* mv functions
|
* mv functions
|
||||||
*/
|
*/
|
||||||
#define mvwaddch(win,y,x,ch) wmove(win,y,x) == 0 ? 0 : waddch(win,ch)
|
#define mvwaddch(win,y,x,ch) wmove(win,y,x) == 0 ? 0 : waddch(win,ch)
|
||||||
#define mvwgetch(win,y,x) wmove(win,y,x) == 0 ? 0 : wgetch(win)
|
#define mvwgetch(win,y,x) wmove(win,y,x) == 0 ? 0 : wgetch(win)
|
||||||
#define mvwaddstr(win,y,x,str) wmove(win,y,x) == 0 ? 0 : waddstr(win,str)
|
#define mvwaddstr(win,y,x,str) wmove(win,y,x) == 0 ? 0 : waddstr(win,str)
|
||||||
#define mvwgetstr(win,y,x,str) wmove(win,y,x) == 0 ? 0 : wgetstr(win,str)
|
#define mvwgetstr(win,y,x,str) wmove(win,y,x) == 0 ? 0 : wgetstr(win,str)
|
||||||
#define mvwinch(win,y,x) wmove(win,y,x) == 0 ? 0 : winch(win)
|
#define mvwinch(win,y,x) wmove(win,y,x) == 0 ? 0 : winch(win)
|
||||||
#define mvwdelch(win,y,x) wmove(win,y,x) == 0 ? 0 : wdelch(win)
|
#define mvwdelch(win,y,x) wmove(win,y,x) == 0 ? 0 : wdelch(win)
|
||||||
#define mvwinsch(win,y,x,c) wmove(win,y,x) == 0 ? 0 : winsch(win,c)
|
#define mvwinsch(win,y,x,c) wmove(win,y,x) == 0 ? 0 : winsch(win,c)
|
||||||
#define mvaddch(y,x,ch) mvwaddch(stdscr,y,x,ch)
|
#define mvaddch(y,x,ch) mvwaddch(stdscr,y,x,ch)
|
||||||
#define mvgetch(y,x) mvwgetch(stdscr,y,x)
|
#define mvgetch(y,x) mvwgetch(stdscr,y,x)
|
||||||
#define mvaddstr(y,x,str) mvwaddstr(stdscr,y,x,str)
|
#define mvaddstr(y,x,str) mvwaddstr(stdscr,y,x,str)
|
||||||
#define mvgetstr(y,x,str) mvwgetstr(stdscr,y,x,str)
|
#define mvgetstr(y,x,str) mvwgetstr(stdscr,y,x,str)
|
||||||
#define mvinch(y,x) mvwinch(stdscr,y,x)
|
#define mvinch(y,x) mvwinch(stdscr,y,x)
|
||||||
#define mvdelch(y,x) mvwdelch(stdscr,y,x)
|
#define mvdelch(y,x) mvwdelch(stdscr,y,x)
|
||||||
#define mvinsch(y,x,c) mvwinsch(stdscr,y,x,c)
|
#define mvinsch(y,x,c) mvwinsch(stdscr,y,x,c)
|
||||||
|
|
||||||
#ifdef TODO
|
#ifdef TODO
|
||||||
|
|
||||||
#define TRUE (1)
|
#define TRUE (1)
|
||||||
#define FALSE (0)
|
#define FALSE (0)
|
||||||
#define ERR (0)
|
#define ERR (0)
|
||||||
#define OK (1)
|
#define OK (1)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Capabilities from termcap
|
* Capabilities from termcap
|
||||||
*/
|
*/
|
||||||
extern int AM, BS, CA, DA, DB, EO, HC, HZ, IN, MI, MS, NC, NS, OS, UL,
|
extern int AM, BS, CA, DA, DB, EO, HC, HZ, IN, MI, MS, NC, NS, OS, UL,
|
||||||
XB, XN, XT, XS, XX;
|
XB, XN, XT, XS, XX;
|
||||||
extern char *AL, *BC, *BT, *CD, *CE, *CL, *CM, *CR, *CS, *DC, *DL,
|
extern char *AL, *BC, *BT, *CD, *CE, *CL, *CM, *CR, *CS, *DC, *DL,
|
||||||
*DM, *DO, *ED, *EI, *K0, *K1, *K2, *K3, *K4, *K5, *K6,
|
*DM, *DO, *ED, *EI, *K0, *K1, *K2, *K3, *K4, *K5, *K6,
|
||||||
*K7, *K8, *K9, *HO, *IC, *IM, *IP, *KD, *KE, *KH, *KL,
|
*K7, *K8, *K9, *HO, *IC, *IM, *IP, *KD, *KE, *KH, *KL,
|
||||||
*KR, *KS, *KU, *LL, *MA, *ND, *NL, *RC, *SC, *SE, *SF,
|
*KR, *KS, *KU, *LL, *MA, *ND, *NL, *RC, *SC, *SE, *SF,
|
||||||
*SO, *SR, *TA, *TE, *TI, *UC, *UE, *UP, *US, *VB, *VS,
|
*SO, *SR, *TA, *TE, *TI, *UC, *UE, *UP, *US, *VB, *VS,
|
||||||
*VE, *AL_PARM, *DL_PARM, *UP_PARM, *DOWN_PARM,
|
*VE, *AL_PARM, *DL_PARM, *UP_PARM, *DOWN_PARM,
|
||||||
*LEFT_PARM, *RIGHT_PARM;
|
*LEFT_PARM, *RIGHT_PARM;
|
||||||
extern char PC;
|
extern char PC;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* From the tty modes...
|
* From the tty modes...
|
||||||
*/
|
*/
|
||||||
extern int GT, NONL, UPPERCASE, normtty, _pfast;
|
extern int GT, NONL, UPPERCASE, normtty, _pfast;
|
||||||
|
|
||||||
extern int My_term, _echoit, _rawmode, _endwin;
|
extern int My_term, _echoit, _rawmode, _endwin;
|
||||||
|
|
||||||
extern char *Def_term, ttytype[];
|
extern char *Def_term, ttytype[];
|
||||||
|
|
||||||
extern int _tty_ch, _res_flg;
|
extern int _tty_ch, _res_flg;
|
||||||
|
|
||||||
extern SGTTY _tty;
|
extern SGTTY _tty;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* pseudo functions
|
* pseudo functions
|
||||||
*/
|
*/
|
||||||
#define clearok(win,bf) (win->_clear = bf)
|
#define clearok(win,bf) (win->_clear = bf)
|
||||||
#define leaveok(win,bf) (win->_leave = bf)
|
#define leaveok(win,bf) (win->_leave = bf)
|
||||||
#define scrollok(win,bf) (win->_scroll = bf)
|
#define scrollok(win,bf) (win->_scroll = bf)
|
||||||
#define flushok(win,bf) (bf ? (win->_flags |= _FLUSH):(win->_flags &= ~_FLUSH))
|
#define flushok(win,bf) (bf ? (win->_flags |= _FLUSH):(win->_flags &= ~_FLUSH))
|
||||||
#define getyx(win,y,x) y = win->_cury, x = win->_curx
|
#define getyx(win,y,x) y = win->_cury, x = win->_curx
|
||||||
#define winch(win) (win->_y[win->_cury][win->_curx] & 0177)
|
#define winch(win) (win->_y[win->_cury][win->_curx] & 0177)
|
||||||
|
|
||||||
#define raw() (_tty.sg_flags|=RAW, _pfast=_rawmode=TRUE, ioctl(_tty_ch,TIOCSETP,&_tty))
|
#define raw() (_tty.sg_flags|=RAW, _pfast=_rawmode=TRUE, ioctl(_tty_ch,TIOCSETP,&_tty))
|
||||||
#define noraw() (_tty.sg_flags&=~RAW,_rawmode=FALSE,_pfast=!(_tty.sg_flags&CRMOD),ioctl(_tty_ch,TIOCSETP,&_tty))
|
#define noraw() (_tty.sg_flags&=~RAW,_rawmode=FALSE,_pfast=!(_tty.sg_flags&CRMOD),ioctl(_tty_ch,TIOCSETP,&_tty))
|
||||||
#define cbreak() (_tty.sg_flags |= CBREAK, _rawmode = TRUE, ioctl(_tty_ch,TIOCSETP,&_tty))
|
#define cbreak() (_tty.sg_flags |= CBREAK, _rawmode = TRUE, ioctl(_tty_ch,TIOCSETP,&_tty))
|
||||||
#define nocbreak() (_tty.sg_flags &= ~CBREAK,_rawmode=FALSE,ioctl(_tty_ch,TIOCSETP,&_tty))
|
#define nocbreak() (_tty.sg_flags &= ~CBREAK,_rawmode=FALSE,ioctl(_tty_ch,TIOCSETP,&_tty))
|
||||||
#define echo() (_tty.sg_flags |= ECHO, _echoit = TRUE, ioctl(_tty_ch, TIOCSETP, &_tty))
|
#define echo() (_tty.sg_flags |= ECHO, _echoit = TRUE, ioctl(_tty_ch, TIOCSETP, &_tty))
|
||||||
#define noecho() (_tty.sg_flags &= ~ECHO, _echoit = FALSE, ioctl(_tty_ch, TIOCSETP, &_tty))
|
#define noecho() (_tty.sg_flags &= ~ECHO, _echoit = FALSE, ioctl(_tty_ch, TIOCSETP, &_tty))
|
||||||
#define nl() (_tty.sg_flags |= CRMOD, _pfast = _rawmode,ioctl(_tty_ch, TIOCSETP, &_tty))
|
#define nl() (_tty.sg_flags |= CRMOD, _pfast = _rawmode,ioctl(_tty_ch, TIOCSETP, &_tty))
|
||||||
#define nonl() (_tty.sg_flags &= ~CRMOD,_pfast = TRUE, ioctl(_tty_ch, TIOCSETP,&_tty))
|
#define nonl() (_tty.sg_flags &= ~CRMOD,_pfast = TRUE, ioctl(_tty_ch, TIOCSETP,&_tty))
|
||||||
#define savetty() ((void) ioctl(_tty_ch, TIOCGETP, &_tty), _res_flg = _tty.sg_flags)
|
#define savetty() ((void) ioctl(_tty_ch, TIOCGETP, &_tty), _res_flg = _tty.sg_flags)
|
||||||
#define resetty() (_tty.sg_flags = _res_flg, (void) ioctl(_tty_ch, TIOCSETP, &_tty))
|
#define resetty() (_tty.sg_flags = _res_flg, (void) ioctl(_tty_ch, TIOCSETP, &_tty))
|
||||||
|
|
||||||
#define erasechar() (_tty.sg_erase)
|
#define erasechar() (_tty.sg_erase)
|
||||||
#define killchar() (_tty.sg_kill)
|
#define killchar() (_tty.sg_kill)
|
||||||
#define baudrate() (_tty.sg_ospeed)
|
#define baudrate() (_tty.sg_ospeed)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Used to be in unctrl.h.
|
* Used to be in unctrl.h.
|
||||||
*/
|
*/
|
||||||
#define unctrl(c) _unctrl[(c) & 0177]
|
#define unctrl(c) _unctrl[(c) & 0177]
|
||||||
extern char *_unctrl[];
|
extern char *_unctrl[];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,38 +1,38 @@
|
|||||||
|
|
||||||
/* open-only flags */
|
/* open-only flags */
|
||||||
#define O_RDONLY 0x0000 /* open for reading only */
|
#define O_RDONLY 0x0000 /* open for reading only */
|
||||||
#define O_WRONLY 0x0001 /* open for writing only */
|
#define O_WRONLY 0x0001 /* open for writing only */
|
||||||
#define O_RDWR 0x0002 /* open for reading and writing */
|
#define O_RDWR 0x0002 /* open for reading and writing */
|
||||||
#define O_ACCMODE 0x0003 /* mask for above modes */
|
#define O_ACCMODE 0x0003 /* mask for above modes */
|
||||||
|
|
||||||
#define O_NONBLOCK 0x0004 /* no delay */
|
#define O_NONBLOCK 0x0004 /* no delay */
|
||||||
#define O_APPEND 0x0008 /* set append mode */
|
#define O_APPEND 0x0008 /* set append mode */
|
||||||
#define O_SHLOCK 0x0010 /* open with shared file lock */
|
#define O_SHLOCK 0x0010 /* open with shared file lock */
|
||||||
#define O_EXLOCK 0x0020 /* open with exclusive file lock */
|
#define O_EXLOCK 0x0020 /* open with exclusive file lock */
|
||||||
#define O_ASYNC 0x0040 /* signal pgrp when data ready */
|
#define O_ASYNC 0x0040 /* signal pgrp when data ready */
|
||||||
#define O_FSYNC 0x0080 /* synchronous writes */
|
#define O_FSYNC 0x0080 /* synchronous writes */
|
||||||
#define O_CREAT 0x0200 /* create if nonexistant */
|
#define O_CREAT 0x0200 /* create if nonexistant */
|
||||||
#define O_TRUNC 0x0400 /* truncate to zero length */
|
#define O_TRUNC 0x0400 /* truncate to zero length */
|
||||||
#define O_EXCL 0x0800 /* error if already exists */
|
#define O_EXCL 0x0800 /* error if already exists */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Constants used for fcntl(2)
|
* Constants used for fcntl(2)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* command values */
|
/* command values */
|
||||||
#define F_DUPFD 0 /* duplicate file descriptor */
|
#define F_DUPFD 0 /* duplicate file descriptor */
|
||||||
#define F_GETFD 1 /* get file descriptor flags */
|
#define F_GETFD 1 /* get file descriptor flags */
|
||||||
#define F_SETFD 2 /* set file descriptor flags */
|
#define F_SETFD 2 /* set file descriptor flags */
|
||||||
#define F_GETFL 3 /* get file status flags */
|
#define F_GETFL 3 /* get file status flags */
|
||||||
#define F_SETFL 4 /* set file status flags */
|
#define F_SETFL 4 /* set file status flags */
|
||||||
#define F_GETOWN 5 /* get SIGIO/SIGURG proc/pgrp */
|
#define F_GETOWN 5 /* get SIGIO/SIGURG proc/pgrp */
|
||||||
#define F_SETOWN 6 /* set SIGIO/SIGURG proc/pgrp */
|
#define F_SETOWN 6 /* set SIGIO/SIGURG proc/pgrp */
|
||||||
|
|
||||||
/* file descriptor flags (F_GETFD, F_SETFD) */
|
/* file descriptor flags (F_GETFD, F_SETFD) */
|
||||||
#define FD_CLOEXEC 1 /* close-on-exec flag */
|
#define FD_CLOEXEC 1 /* close-on-exec flag */
|
||||||
|
|
||||||
/* lock operations for flock() */
|
/* lock operations for flock() */
|
||||||
#define LOCK_SH 1 /* shared file lock */
|
#define LOCK_SH 1 /* shared file lock */
|
||||||
#define LOCK_EX 2 /* exclusive file lock */
|
#define LOCK_EX 2 /* exclusive file lock */
|
||||||
#define LOCK_NB 4 /* don't block when locking */
|
#define LOCK_NB 4 /* don't block when locking */
|
||||||
#define LOCK_UN 8 /* unlock file */
|
#define LOCK_UN 8 /* unlock file */
|
||||||
|
|||||||
@@ -3,74 +3,74 @@
|
|||||||
* All rights reserved. The Berkeley software License Agreement
|
* All rights reserved. The Berkeley software License Agreement
|
||||||
* specifies the terms and conditions for redistribution.
|
* specifies the terms and conditions for redistribution.
|
||||||
*/
|
*/
|
||||||
#ifndef NSIG
|
#ifndef NSIG
|
||||||
|
|
||||||
#define NSIG 32
|
#define NSIG 32
|
||||||
|
|
||||||
#define SIGHUP 1 /* hangup */
|
#define SIGHUP 1 /* hangup */
|
||||||
#define SIGINT 2 /* interrupt */
|
#define SIGINT 2 /* interrupt */
|
||||||
#define SIGQUIT 3 /* quit */
|
#define SIGQUIT 3 /* quit */
|
||||||
#define SIGILL 4 /* illegal instruction (not reset when caught) */
|
#define SIGILL 4 /* illegal instruction (not reset when caught) */
|
||||||
#define SIGTRAP 5 /* trace trap (not reset when caught) */
|
#define SIGTRAP 5 /* trace trap (not reset when caught) */
|
||||||
#define SIGIOT 6 /* IOT instruction */
|
#define SIGIOT 6 /* IOT instruction */
|
||||||
#define SIGABRT SIGIOT /* compatibility */
|
#define SIGABRT SIGIOT /* compatibility */
|
||||||
#define SIGEMT 7 /* EMT instruction */
|
#define SIGEMT 7 /* EMT instruction */
|
||||||
#define SIGFPE 8 /* floating point exception */
|
#define SIGFPE 8 /* floating point exception */
|
||||||
#define SIGKILL 9 /* kill (cannot be caught or ignored) */
|
#define SIGKILL 9 /* kill (cannot be caught or ignored) */
|
||||||
#define SIGBUS 10 /* bus error */
|
#define SIGBUS 10 /* bus error */
|
||||||
#define SIGSEGV 11 /* segmentation violation */
|
#define SIGSEGV 11 /* segmentation violation */
|
||||||
#define SIGSYS 12 /* bad argument to system call */
|
#define SIGSYS 12 /* bad argument to system call */
|
||||||
#define SIGPIPE 13 /* write on a pipe with no one to read it */
|
#define SIGPIPE 13 /* write on a pipe with no one to read it */
|
||||||
#define SIGALRM 14 /* alarm clock */
|
#define SIGALRM 14 /* alarm clock */
|
||||||
#define SIGTERM 15 /* software termination signal from kill */
|
#define SIGTERM 15 /* software termination signal from kill */
|
||||||
#define SIGURG 16 /* urgent condition on IO channel */
|
#define SIGURG 16 /* urgent condition on IO channel */
|
||||||
#define SIGSTOP 17 /* sendable stop signal not from tty */
|
#define SIGSTOP 17 /* sendable stop signal not from tty */
|
||||||
#define SIGTSTP 18 /* stop signal from tty */
|
#define SIGTSTP 18 /* stop signal from tty */
|
||||||
#define SIGCONT 19 /* continue a stopped process */
|
#define SIGCONT 19 /* continue a stopped process */
|
||||||
#define SIGCHLD 20 /* to parent on child stop or exit */
|
#define SIGCHLD 20 /* to parent on child stop or exit */
|
||||||
#define SIGCLD SIGCHLD /* compatibility */
|
#define SIGCLD SIGCHLD /* compatibility */
|
||||||
#define SIGTTIN 21 /* to readers pgrp upon background tty read */
|
#define SIGTTIN 21 /* to readers pgrp upon background tty read */
|
||||||
#define SIGTTOU 22 /* like TTIN for output if (tp->t_local<OSTOP) */
|
#define SIGTTOU 22 /* like TTIN for output if (tp->t_local<OSTOP) */
|
||||||
#define SIGIO 23 /* input/output possible signal */
|
#define SIGIO 23 /* input/output possible signal */
|
||||||
#define SIGXCPU 24 /* exceeded CPU time limit */
|
#define SIGXCPU 24 /* exceeded CPU time limit */
|
||||||
#define SIGXFSZ 25 /* exceeded file size limit */
|
#define SIGXFSZ 25 /* exceeded file size limit */
|
||||||
#define SIGVTALRM 26 /* virtual time alarm */
|
#define SIGVTALRM 26 /* virtual time alarm */
|
||||||
#define SIGPROF 27 /* profiling time alarm */
|
#define SIGPROF 27 /* profiling time alarm */
|
||||||
#define SIGWINCH 28 /* window size changes */
|
#define SIGWINCH 28 /* window size changes */
|
||||||
#define SIGUSR1 30 /* user defined signal 1 */
|
#define SIGUSR1 30 /* user defined signal 1 */
|
||||||
#define SIGUSR2 31 /* user defined signal 2 */
|
#define SIGUSR2 31 /* user defined signal 2 */
|
||||||
|
|
||||||
#define SIG_ERR -1
|
#define SIG_ERR -1
|
||||||
#define SIG_DFL 0
|
#define SIG_DFL 0
|
||||||
#define SIG_IGN 1
|
#define SIG_IGN 1
|
||||||
#define BADSIG SIG_ERR
|
#define BADSIG SIG_ERR
|
||||||
|
|
||||||
#define SA_ONSTACK 0x0001 /* take signal on signal stack */
|
#define SA_ONSTACK 0x0001 /* take signal on signal stack */
|
||||||
#define SA_RESTART 0x0002 /* restart system on signal return */
|
#define SA_RESTART 0x0002 /* restart system on signal return */
|
||||||
#define SA_DISABLE 0x0004 /* disable taking signals on alternate stack */
|
#define SA_DISABLE 0x0004 /* disable taking signals on alternate stack */
|
||||||
#define SA_NOCLDSTOP 0x0008 /* do not generate SIGCHLD on child stop */
|
#define SA_NOCLDSTOP 0x0008 /* do not generate SIGCHLD on child stop */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Flags for sigprocmask:
|
* Flags for sigprocmask:
|
||||||
*/
|
*/
|
||||||
#define SIG_BLOCK 1 /* block specified signal set */
|
#define SIG_BLOCK 1 /* block specified signal set */
|
||||||
#define SIG_UNBLOCK 2 /* unblock specified signal set */
|
#define SIG_UNBLOCK 2 /* unblock specified signal set */
|
||||||
#define SIG_SETMASK 3 /* set specified signal set */
|
#define SIG_SETMASK 3 /* set specified signal set */
|
||||||
|
|
||||||
#define MINSIGSTKSZ 128 /* minimum allowable stack */
|
#define MINSIGSTKSZ 128 /* minimum allowable stack */
|
||||||
#define SIGSTKSZ (MINSIGSTKSZ + 384) /* recommended stack size */
|
#define SIGSTKSZ (MINSIGSTKSZ + 384) /* recommended stack size */
|
||||||
|
|
||||||
#define SV_ONSTACK SA_ONSTACK /* take signal on signal stack */
|
#define SV_ONSTACK SA_ONSTACK /* take signal on signal stack */
|
||||||
#define SV_INTERRUPT SA_RESTART /* same bit, opposite sense */
|
#define SV_INTERRUPT SA_RESTART /* same bit, opposite sense */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Macro for converting signal number to a mask suitable for
|
* Macro for converting signal number to a mask suitable for
|
||||||
* sigblock().
|
* sigblock().
|
||||||
*/
|
*/
|
||||||
#define sigmask(m) (1L << ((m)-1))
|
#define sigmask(m) (1L << ((m)-1))
|
||||||
#define sigaddset(set, signo) (*(set) |= 1L << ((signo) - 1), 0)
|
#define sigaddset(set, signo) (*(set) |= 1L << ((signo) - 1), 0)
|
||||||
#define sigdelset(set, signo) (*(set) &= ~(1L << ((signo) - 1)), 0)
|
#define sigdelset(set, signo) (*(set) &= ~(1L << ((signo) - 1)), 0)
|
||||||
#define sigemptyset(set) (*(set) = (sigset_t)0, (int)0)
|
#define sigemptyset(set) (*(set) = (sigset_t)0, (int)0)
|
||||||
#define sigfillset(set) (*(set) = ~(sigset_t)0, (int)0)
|
#define sigfillset(set) (*(set) = ~(sigset_t)0, (int)0)
|
||||||
#define sigismember(set, signo) ((*(set) & (1L << ((signo) - 1))) != 0)
|
#define sigismember(set, signo) ((*(set) & (1L << ((signo) - 1))) != 0)
|
||||||
|
|
||||||
|
|||||||
@@ -1,24 +1,24 @@
|
|||||||
/*
|
/*
|
||||||
* SmallC: interface to stdio library.
|
* SmallC: interface to stdio library.
|
||||||
*/
|
*/
|
||||||
#define BUFSIZ 1024
|
#define BUFSIZ 1024
|
||||||
|
|
||||||
#ifndef NULL
|
#ifndef NULL
|
||||||
#define NULL 0
|
#define NULL 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define FILE int
|
#define FILE int
|
||||||
#define EOF (-1)
|
#define EOF (-1)
|
||||||
|
|
||||||
extern int _iob[];
|
extern int _iob[];
|
||||||
|
|
||||||
#define stdin (&_iob[0])
|
#define stdin (&_iob[0])
|
||||||
#define stdout (&_iob[5])
|
#define stdout (&_iob[5])
|
||||||
#define stderr (&_iob[10])
|
#define stderr (&_iob[10])
|
||||||
|
|
||||||
#define SEEK_SET 0 /* set file offset to offset */
|
#define SEEK_SET 0 /* set file offset to offset */
|
||||||
#define SEEK_CUR 1 /* set file offset to current plus offset */
|
#define SEEK_CUR 1 /* set file offset to current plus offset */
|
||||||
#define SEEK_END 2 /* set file offset to EOF plus offset */
|
#define SEEK_END 2 /* set file offset to EOF plus offset */
|
||||||
|
|
||||||
#define getc fgetc
|
#define getc fgetc
|
||||||
#define putc fputc
|
#define putc fputc
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
/*
|
/*
|
||||||
* Ioctl definitions for GPIO driver.
|
* Ioctl definitions for GPIO driver.
|
||||||
*/
|
*/
|
||||||
#define GPIO_PORT(n) (n) /* port number */
|
#define GPIO_PORT(n) (n) /* port number */
|
||||||
#define GPIO_PORTA 0
|
#define GPIO_PORTA 0
|
||||||
#define GPIO_PORTB 1
|
#define GPIO_PORTB 1
|
||||||
#define GPIO_PORTC 2
|
#define GPIO_PORTC 2
|
||||||
#define GPIO_PORTD 3
|
#define GPIO_PORTD 3
|
||||||
#define GPIO_PORTE 4
|
#define GPIO_PORTE 4
|
||||||
#define GPIO_PORTF 5
|
#define GPIO_PORTF 5
|
||||||
#define GPIO_PORTG 6
|
#define GPIO_PORTG 6
|
||||||
|
|
||||||
#define GPIO_CONFIN 0x20016700 /* configure as input */
|
#define GPIO_CONFIN 0x20016700 /* configure as input */
|
||||||
#define GPIO_CONFOUT 0x20026700 /* configure as output */
|
#define GPIO_CONFOUT 0x20026700 /* configure as output */
|
||||||
#define GPIO_CONFOD 0x20046700 /* configure as open drain */
|
#define GPIO_CONFOD 0x20046700 /* configure as open drain */
|
||||||
#define GPIO_DECONF 0x20086700 /* deconfigure */
|
#define GPIO_DECONF 0x20086700 /* deconfigure */
|
||||||
#define GPIO_STORE 0x20106700 /* store all outputs */
|
#define GPIO_STORE 0x20106700 /* store all outputs */
|
||||||
#define GPIO_SET 0x20206700 /* set to 1 by mask */
|
#define GPIO_SET 0x20206700 /* set to 1 by mask */
|
||||||
#define GPIO_CLEAR 0x20406700 /* set to 0 by mask */
|
#define GPIO_CLEAR 0x20406700 /* set to 0 by mask */
|
||||||
#define GPIO_INVERT 0x20806700 /* invert by mask */
|
#define GPIO_INVERT 0x20806700 /* invert by mask */
|
||||||
#define GPIO_POLL 0x21006700 /* poll */
|
#define GPIO_POLL 0x21006700 /* poll */
|
||||||
#define GPIO_LOL 0x82006700 /* display lol picture */
|
#define GPIO_LOL 0x82006700 /* display lol picture */
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 1980 Regents of the University of California.
|
|
||||||
* All rights reserved. The Berkeley software License Agreement
|
|
||||||
* specifies the terms and conditions for redistribution.
|
|
||||||
*
|
|
||||||
* @(#)stab.h 5.1 (Berkeley) 5/30/85
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* IF YOU ADD DEFINITIONS, ADD THEM TO nm.c as well */
|
|
||||||
/*
|
|
||||||
* This file gives definitions supplementing <a.out.h>
|
|
||||||
* for permanent symbol table entries.
|
|
||||||
* These must have one of the N_STAB bits on,
|
|
||||||
* and are subject to relocation according to the masks in <a.out.h>.
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* for symbolic debugger, sdb(1):
|
|
||||||
*/
|
|
||||||
#define N_GSYM 0x20 /* global symbol: name,,0,type,0 */
|
|
||||||
#define N_FNAME 0x22 /* procedure name (f77 kludge): name,,0 */
|
|
||||||
#define N_FUN 0x24 /* procedure: name,,0,linenumber,address */
|
|
||||||
#define N_STSYM 0x26 /* static symbol: name,,0,type,address */
|
|
||||||
#define N_LCSYM 0x28 /* .lcomm symbol: name,,0,type,address */
|
|
||||||
#define N_RSYM 0x40 /* register sym: name,,0,type,register */
|
|
||||||
#define N_SLINE 0x44 /* src line: 0,,0,linenumber,address */
|
|
||||||
#define N_SSYM 0x60 /* structure elt: name,,0,type,struct_offset */
|
|
||||||
#define N_SO 0x64 /* source file name: name,,0,0,address */
|
|
||||||
#define N_LSYM 0x80 /* local sym: name,,0,type,offset */
|
|
||||||
#define N_SOL 0x84 /* #included file name: name,,0,0,address */
|
|
||||||
#define N_PSYM 0xa0 /* parameter: name,,0,type,offset */
|
|
||||||
#define N_ENTRY 0xa4 /* alternate entry: name,linenumber,address */
|
|
||||||
#define N_LBRAC 0xc0 /* left bracket: 0,,0,nesting level,address */
|
|
||||||
#define N_RBRAC 0xe0 /* right bracket: 0,,0,nesting level,address */
|
|
||||||
#define N_BCOMM 0xe2 /* begin common: name,, */
|
|
||||||
#define N_ECOMM 0xe4 /* end common: name,, */
|
|
||||||
#define N_ECOML 0xe8 /* end common (local name): ,,address */
|
|
||||||
#define N_LENG 0xfe /* second stab entry with length information */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* for the berkeley pascal compiler, pc(1):
|
|
||||||
*/
|
|
||||||
#define N_PC 0x30 /* global pascal symbol: name,,0,subtype,line */
|
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
* Define va_start, va_arg, va_end, va_copy.
|
* Define va_start, va_arg, va_end, va_copy.
|
||||||
*/
|
*/
|
||||||
#if defined(__GNUC__) /* Gnu C */
|
#if defined(__GNUC__) /* Gnu C */
|
||||||
# define va_start(ap, last) __builtin_va_start((ap), last)
|
# define va_start(ap, last) __builtin_va_start((ap), last)
|
||||||
# define va_arg(ap, type) __builtin_va_arg((ap), type)
|
# define va_arg(ap, type) __builtin_va_arg((ap), type)
|
||||||
# define va_end(ap) __builtin_va_end((ap))
|
# define va_end(ap) __builtin_va_end((ap))
|
||||||
# define va_copy(dest, src) __builtin_va_copy((dest), (src))
|
# define va_copy(dest, src) __builtin_va_copy((dest), (src))
|
||||||
|
|||||||
37
include/stdbool.h
Normal file
37
include/stdbool.h
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2000 Jeroen Ruigrok van der Werven <asmodai@FreeBSD.org>
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. 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 AUTHOR 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 THE AUTHOR 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.
|
||||||
|
*/
|
||||||
|
#ifndef __bool_true_false_are_defined
|
||||||
|
#define __bool_true_false_are_defined 1
|
||||||
|
|
||||||
|
#ifndef __cplusplus
|
||||||
|
|
||||||
|
#define false 0
|
||||||
|
#define true 1
|
||||||
|
|
||||||
|
#define bool _Bool
|
||||||
|
|
||||||
|
#endif /* !__cplusplus */
|
||||||
|
#endif /* __bool_true_false_are_defined */
|
||||||
@@ -1,8 +1,22 @@
|
|||||||
|
#ifndef _STDDEF_H_
|
||||||
|
#define _STDDEF_H_
|
||||||
|
|
||||||
|
typedef int ptrdiff_t;
|
||||||
|
|
||||||
|
#ifndef _SIZE_T
|
||||||
|
#define _SIZE_T
|
||||||
|
typedef unsigned size_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef NULL
|
||||||
|
#define NULL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Offset of member MEMBER in a struct of type TYPE. */
|
/* Offset of member MEMBER in a struct of type TYPE. */
|
||||||
|
|
||||||
#if defined(__GNUC__) && __GNUC__ > 3
|
#if defined(__GNUC__) && __GNUC__ > 3
|
||||||
#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
|
#define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER)
|
||||||
#else
|
#else
|
||||||
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE*)0)->MEMBER)
|
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE*)0)->MEMBER)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif /* _STDDEF_H_ */
|
||||||
|
|||||||
@@ -2,14 +2,29 @@
|
|||||||
#ifndef _STDINT_H
|
#ifndef _STDINT_H
|
||||||
#define _STDINT_H
|
#define _STDINT_H
|
||||||
|
|
||||||
typedef signed char int8_t;
|
typedef signed char int8_t;
|
||||||
typedef short int int16_t;
|
typedef short int int16_t;
|
||||||
typedef int int32_t;
|
typedef int int32_t;
|
||||||
|
typedef long long int64_t;
|
||||||
|
|
||||||
typedef unsigned char uint8_t;
|
typedef unsigned char uint8_t;
|
||||||
typedef unsigned short int uint16_t;
|
typedef unsigned short int uint16_t;
|
||||||
typedef unsigned int uint32_t;
|
typedef unsigned int uint32_t;
|
||||||
|
typedef unsigned long long uint64_t;
|
||||||
|
|
||||||
|
#define INT8_C(x) x
|
||||||
|
#define UINT8_C(x) x##U
|
||||||
|
|
||||||
|
#define INT16_C(x) x
|
||||||
|
#define UINT16_C(x) x##U
|
||||||
|
|
||||||
|
#define INT32_C(x) x
|
||||||
|
#define UINT32_C(x) x##U
|
||||||
|
|
||||||
|
#define INT64_C(x) x##LL
|
||||||
|
#define UINT64_C(x) x##ULL
|
||||||
|
|
||||||
|
#define INTMAX_C(x) x##LL
|
||||||
|
#define UINTMAX_C(x) x##ULL
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
156
include/stdio.h
156
include/stdio.h
@@ -5,27 +5,25 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef FILE
|
#ifndef FILE
|
||||||
|
|
||||||
#include <sys/types.h>
|
#define BUFSIZ 1024
|
||||||
|
extern struct _iobuf {
|
||||||
#define BUFSIZ 1024
|
int _cnt;
|
||||||
extern struct _iobuf {
|
char *_ptr; /* should be unsigned char */
|
||||||
int _cnt;
|
char *_base; /* ditto */
|
||||||
char *_ptr; /* should be unsigned char */
|
int _bufsiz;
|
||||||
char *_base; /* ditto */
|
short _flag;
|
||||||
int _bufsiz;
|
short _file;
|
||||||
short _flag;
|
|
||||||
short _file;
|
|
||||||
} _iob[];
|
} _iob[];
|
||||||
|
|
||||||
#define _IOREAD 01
|
#define _IOREAD 01
|
||||||
#define _IOWRT 02
|
#define _IOWRT 02
|
||||||
#define _IONBF 04
|
#define _IONBF 04
|
||||||
#define _IOMYBUF 010
|
#define _IOMYBUF 010
|
||||||
#define _IOEOF 020
|
#define _IOEOF 020
|
||||||
#define _IOERR 040
|
#define _IOERR 040
|
||||||
#define _IOSTRG 0100
|
#define _IOSTRG 0100
|
||||||
#define _IOLBF 0200
|
#define _IOLBF 0200
|
||||||
#define _IORW 0400
|
#define _IORW 0400
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The following definition is for ANSI C, which took them
|
* The following definition is for ANSI C, which took them
|
||||||
@@ -33,58 +31,58 @@ extern struct _iobuf {
|
|||||||
* made them official arguments to setvbuf(), without renaming them.
|
* made them official arguments to setvbuf(), without renaming them.
|
||||||
* Hence, these ugly _IOxxx names are *supposed* to appear in user code.
|
* Hence, these ugly _IOxxx names are *supposed* to appear in user code.
|
||||||
*/
|
*/
|
||||||
#define _IOFBF 0 /* setvbuf should set fully buffered */
|
#define _IOFBF 0 /* setvbuf should set fully buffered */
|
||||||
/* _IONBF and _IOLBF are used from the flags above */
|
/* _IONBF and _IOLBF are used from the flags above */
|
||||||
|
|
||||||
#ifndef NULL
|
#ifndef NULL
|
||||||
#define NULL 0
|
#define NULL 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define FILE struct _iobuf
|
#ifndef _SIZE_T
|
||||||
#define EOF (-1)
|
#define _SIZE_T
|
||||||
|
typedef unsigned size_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
#define stdin (&_iob[0])
|
#define FILE struct _iobuf
|
||||||
#define stdout (&_iob[1])
|
#define EOF (-1)
|
||||||
#define stderr (&_iob[2])
|
|
||||||
|
|
||||||
#define SEEK_SET 0 /* set file offset to offset */
|
#define stdin (&_iob[0])
|
||||||
#define SEEK_CUR 1 /* set file offset to current plus offset */
|
#define stdout (&_iob[1])
|
||||||
#define SEEK_END 2 /* set file offset to EOF plus offset */
|
#define stderr (&_iob[2])
|
||||||
|
|
||||||
|
#define SEEK_SET 0 /* set file offset to offset */
|
||||||
|
#define SEEK_CUR 1 /* set file offset to current plus offset */
|
||||||
|
#define SEEK_END 2 /* set file offset to EOF plus offset */
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
#define getc(p) (--(p)->_cnt>=0? (int)(*(unsigned char *)(p)->_ptr++):_filbuf(p))
|
#define getc(p) (--(p)->_cnt>=0? (int)(*(unsigned char *)(p)->_ptr++):_filbuf(p))
|
||||||
#define putc(x, p) (--(p)->_cnt >= 0 ?\
|
#define putc(x, p) (--(p)->_cnt >= 0 ?\
|
||||||
(int)(*(unsigned char *)(p)->_ptr++ = (x)) :\
|
(int)(*(unsigned char *)(p)->_ptr++ = (x)) :\
|
||||||
(((p)->_flag & _IOLBF) && -(p)->_cnt < (p)->_bufsiz ?\
|
(((p)->_flag & _IOLBF) && -(p)->_cnt < (p)->_bufsiz ?\
|
||||||
((*(p)->_ptr = (x)) != '\n' ?\
|
((*(p)->_ptr = (x)) != '\n' ?\
|
||||||
(int)(*(unsigned char *)(p)->_ptr++) :\
|
(int)(*(unsigned char *)(p)->_ptr++) :\
|
||||||
_flsbuf(*(unsigned char *)(p)->_ptr, p)) :\
|
_flsbuf(*(unsigned char *)(p)->_ptr, p)) :\
|
||||||
_flsbuf((unsigned char)(x), p)))
|
_flsbuf((unsigned char)(x), p)))
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
#define getchar() getc(stdin)
|
FILE *fopen (const char *, const char *);
|
||||||
#define putchar(x) putc(x,stdout)
|
FILE *fdopen (int, const char *);
|
||||||
#define feof(p) (((p)->_flag&_IOEOF)!=0)
|
FILE *freopen (const char *, const char *, FILE *);
|
||||||
#define ferror(p) (((p)->_flag&_IOERR)!=0)
|
FILE *popen (const char *, const char *);
|
||||||
#define fileno(p) ((p)->_file)
|
int pclose(FILE *stream);
|
||||||
#define clearerr(p) ((p)->_flag &= ~(_IOERR|_IOEOF))
|
|
||||||
|
|
||||||
FILE *fopen (const char *, const char *);
|
|
||||||
FILE *fdopen (int, const char *);
|
|
||||||
FILE *freopen (const char *, const char *, FILE *);
|
|
||||||
FILE *popen (const char *, const char *);
|
|
||||||
FILE *tmpfile (void);
|
FILE *tmpfile (void);
|
||||||
int fclose (FILE *);
|
int fclose (FILE *);
|
||||||
long ftell (FILE *);
|
long ftell (FILE *);
|
||||||
int fflush (FILE *);
|
int fflush (FILE *);
|
||||||
int fgetc (FILE *);
|
int fgetc (FILE *);
|
||||||
int ungetc (int, FILE *);
|
int ungetc (int, FILE *);
|
||||||
int fputc (int, FILE *);
|
int fputc (int, FILE *);
|
||||||
int fputs (const char *, FILE *);
|
int putchar (int);
|
||||||
int puts (const char *);
|
int fputs (const char *, FILE *);
|
||||||
char *fgets (char *, int, FILE *);
|
int puts (const char *);
|
||||||
char *gets (char *);
|
char *fgets (char *, int, FILE *);
|
||||||
FILE *_findiop (void);
|
char *gets (char *);
|
||||||
|
FILE *_findiop (void);
|
||||||
int _filbuf (FILE *);
|
int _filbuf (FILE *);
|
||||||
int _flsbuf (unsigned char, FILE *);
|
int _flsbuf (unsigned char, FILE *);
|
||||||
void setbuf (FILE *, char *);
|
void setbuf (FILE *, char *);
|
||||||
@@ -92,22 +90,30 @@ void setbuffer (FILE *, char *, size_t);
|
|||||||
void setlinebuf (FILE *);
|
void setlinebuf (FILE *);
|
||||||
int setvbuf (FILE *, char *, int, size_t);
|
int setvbuf (FILE *, char *, int, size_t);
|
||||||
int fseek (FILE *, long, int);
|
int fseek (FILE *, long, int);
|
||||||
|
int rename(const char *, const char *);
|
||||||
void rewind (FILE *);
|
void rewind (FILE *);
|
||||||
int remove (const char *);
|
int remove (const char *);
|
||||||
int getw(FILE *stream);
|
int getw(FILE *stream);
|
||||||
int putw(int w, FILE *stream);
|
int putw(int w, FILE *stream);
|
||||||
|
|
||||||
size_t fread (void *, size_t, size_t, FILE *);
|
size_t fread (void *, size_t, size_t, FILE *);
|
||||||
size_t fwrite (const void *, size_t, size_t, FILE *);
|
size_t fwrite (const void *, size_t, size_t, FILE *);
|
||||||
|
|
||||||
int fprintf (FILE *, const char *, ...);
|
int fprintf (FILE *, const char *, ...);
|
||||||
int printf (const char *, ...);
|
int printf (const char *, ...);
|
||||||
int sprintf (char *, const char *, ...);
|
int sprintf (char *, const char *, ...);
|
||||||
int snprintf (char *, size_t, const char *, ...);
|
int snprintf (char *, size_t, const char *, ...);
|
||||||
|
|
||||||
int fscanf (FILE *, const char *, ...);
|
int fscanf (FILE *, const char *, ...);
|
||||||
int scanf (const char *, ...);
|
int scanf (const char *, ...);
|
||||||
int sscanf (const char *, const char *, ...);
|
int sscanf (const char *, const char *, ...);
|
||||||
|
|
||||||
|
#define getchar() getc(stdin)
|
||||||
|
#define putchar(x) putc(x,stdout)
|
||||||
|
#define feof(p) (((p)->_flag&_IOEOF)!=0)
|
||||||
|
#define ferror(p) (((p)->_flag&_IOERR)!=0)
|
||||||
|
#define fileno(p) ((p)->_file)
|
||||||
|
#define clearerr(p) ((p)->_flag &= ~(_IOERR|_IOEOF))
|
||||||
|
|
||||||
#ifndef _VA_LIST_
|
#ifndef _VA_LIST_
|
||||||
# ifdef __GNUC__
|
# ifdef __GNUC__
|
||||||
@@ -118,17 +124,17 @@ int sscanf (const char *, const char *, ...);
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int vfprintf (FILE *, const char *, va_list);
|
int vfprintf (FILE *, const char *, va_list);
|
||||||
int vprintf (const char *, va_list);
|
int vprintf (const char *, va_list);
|
||||||
int vsprintf (char *, const char *, va_list);
|
int vsprintf (char *, const char *, va_list);
|
||||||
int vsnprintf (char *, size_t, const char *, va_list);
|
int vsnprintf (char *, size_t, const char *, va_list);
|
||||||
|
|
||||||
int vfscanf (FILE *, const char *, va_list);
|
int vfscanf (FILE *, const char *, va_list);
|
||||||
int vscanf (const char *, va_list);
|
int vscanf (const char *, va_list);
|
||||||
int vsscanf (const char *, const char *, va_list);
|
int vsscanf (const char *, const char *, va_list);
|
||||||
|
|
||||||
int _doprnt (const char *, va_list, FILE *);
|
int _doprnt (const char *, va_list, FILE *);
|
||||||
int _doscan (FILE *, const char *, va_list);
|
int _doscan (FILE *, const char *, va_list);
|
||||||
|
|
||||||
#ifndef _VA_LIST_
|
#ifndef _VA_LIST_
|
||||||
# undef va_list
|
# undef va_list
|
||||||
|
|||||||
111
include/stdlib.h
111
include/stdlib.h
@@ -1,6 +1,6 @@
|
|||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1990, 1993
|
* Copyright (c) 1990, 1993
|
||||||
* The Regents of the University of California. All rights reserved.
|
* The Regents of the University of California. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -12,8 +12,8 @@
|
|||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* 3. All advertising materials mentioning features or use of this software
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
* must display the following acknowledgement:
|
* must display the following acknowledgement:
|
||||||
* This product includes software developed by the University of
|
* This product includes software developed by the University of
|
||||||
* California, Berkeley and its contributors.
|
* California, Berkeley and its contributors.
|
||||||
* 4. Neither the name of the University nor the names of its contributors
|
* 4. Neither the name of the University nor the names of its contributors
|
||||||
* may be used to endorse or promote products derived from this software
|
* may be used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* @(#)stdlib.h 8.3.2 (2.11BSD) 1996/1/12
|
* @(#)stdlib.h 8.3.2 (2.11BSD) 1996/1/12
|
||||||
*
|
*
|
||||||
* Adapted from the 4.4-Lite CD. The odds of a ANSI C compiler for 2.11BSD
|
* Adapted from the 4.4-Lite CD. The odds of a ANSI C compiler for 2.11BSD
|
||||||
* being slipped under the door are not distinguishable from 0 - so the
|
* being slipped under the door are not distinguishable from 0 - so the
|
||||||
@@ -43,62 +43,63 @@
|
|||||||
#ifndef _STDLIB_H_
|
#ifndef _STDLIB_H_
|
||||||
#define _STDLIB_H_
|
#define _STDLIB_H_
|
||||||
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
#ifndef NULL
|
#ifndef NULL
|
||||||
#define NULL 0
|
#define NULL 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define EXIT_FAILURE 1
|
#define EXIT_FAILURE 1
|
||||||
#define EXIT_SUCCESS 0
|
#define EXIT_SUCCESS 0
|
||||||
|
|
||||||
#define RAND_MAX 0x7fff
|
#define RAND_MAX 0x7fff
|
||||||
|
|
||||||
void abort (void);
|
#ifndef _SIZE_T
|
||||||
int abs (int);
|
#define _SIZE_T
|
||||||
int atexit (void (*)(void));
|
typedef unsigned size_t;
|
||||||
int atoi (const char *);
|
|
||||||
long atol (const char *);
|
|
||||||
void *calloc (size_t, size_t);
|
|
||||||
void exit (int);
|
|
||||||
void free (void *);
|
|
||||||
char *getenv (const char *);
|
|
||||||
long labs (long);
|
|
||||||
void *malloc (size_t);
|
|
||||||
char *mktemp (char *);
|
|
||||||
int mkstemp (char *);
|
|
||||||
void qsort (void *, size_t, size_t, int (*)(const void *, const void *));
|
|
||||||
int rand (void);
|
|
||||||
void *realloc (void*, size_t);
|
|
||||||
void srand (unsigned);
|
|
||||||
long strtol (const char *, char **, int);
|
|
||||||
unsigned long strtoul (const char *, char **, int);
|
|
||||||
int system (const char *);
|
|
||||||
|
|
||||||
int putenv (char *string);
|
|
||||||
int setenv (const char *name, const char *value, int overwrite);
|
|
||||||
int unsetenv (const char *name);
|
|
||||||
char *_findenv (const char *name, int *offset);
|
|
||||||
|
|
||||||
void *alloca (size_t size);
|
|
||||||
|
|
||||||
int daemon (int, int);
|
|
||||||
char *devname (dev_t dev, mode_t type);
|
|
||||||
int getloadavg (unsigned loadavg[], int nelem);
|
|
||||||
|
|
||||||
extern char *suboptarg; /* getsubopt(3) external variable */
|
|
||||||
int getsubopt (char **, char **, char **);
|
|
||||||
|
|
||||||
long random (void);
|
|
||||||
char *setstate (char *);
|
|
||||||
void srandom (unsigned);
|
|
||||||
|
|
||||||
#ifndef __SMALLER_C__
|
|
||||||
double atof (const char *);
|
|
||||||
double strtod (const char *, char **);
|
|
||||||
char *ecvt (double, int, int *, int *);
|
|
||||||
char *fcvt (double, int, int *, int *);
|
|
||||||
char *gcvt (double, int, char *);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void abort(void);
|
||||||
|
int abs(int);
|
||||||
|
int atexit(void (*)(void));
|
||||||
|
int atoi(const char *);
|
||||||
|
long atol(const char *);
|
||||||
|
void *calloc(size_t, size_t);
|
||||||
|
void exit(int);
|
||||||
|
void free(void *);
|
||||||
|
char *getenv(const char *);
|
||||||
|
long labs(long);
|
||||||
|
void *malloc(size_t);
|
||||||
|
char *mktemp(char *);
|
||||||
|
int mkstemp(char *);
|
||||||
|
void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
|
||||||
|
int rand(void);
|
||||||
|
void *realloc(void*, size_t);
|
||||||
|
void srand(unsigned);
|
||||||
|
long strtol(const char *, char **, int);
|
||||||
|
unsigned long strtoul(const char *, char **, int);
|
||||||
|
int system(const char *);
|
||||||
|
|
||||||
|
int putenv(char *string);
|
||||||
|
int setenv(const char *name, const char *value, int overwrite);
|
||||||
|
int unsetenv(const char *name);
|
||||||
|
char *_findenv(const char *name, int *offset);
|
||||||
|
|
||||||
|
void *alloca(size_t size);
|
||||||
|
|
||||||
|
int daemon(int, int);
|
||||||
|
char *devname(int dev, int type);
|
||||||
|
int getloadavg(unsigned loadavg[], int nelem);
|
||||||
|
|
||||||
|
extern char *suboptarg; /* getsubopt(3) external variable */
|
||||||
|
int getsubopt(char **, char **, char **);
|
||||||
|
|
||||||
|
long random(void);
|
||||||
|
char *setstate(char *);
|
||||||
|
void srandom(unsigned);
|
||||||
|
|
||||||
|
double atof(const char *);
|
||||||
|
double strtod(const char *, char **);
|
||||||
|
char *ecvt(double, int, int *, int *);
|
||||||
|
char *fcvt(double, int, int *, int *);
|
||||||
|
char *gcvt(double, int, char *);
|
||||||
|
|
||||||
#endif /* _STDLIB_H_ */
|
#endif /* _STDLIB_H_ */
|
||||||
|
|||||||
@@ -3,41 +3,44 @@
|
|||||||
* All rights reserved. The Berkeley software License Agreement
|
* All rights reserved. The Berkeley software License Agreement
|
||||||
* specifies the terms and conditions for redistribution.
|
* specifies the terms and conditions for redistribution.
|
||||||
*/
|
*/
|
||||||
#include <sys/types.h>
|
#ifndef NULL
|
||||||
|
#define NULL 0
|
||||||
#ifndef NULL
|
|
||||||
#define NULL 0
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char *strcat (char *, const char *);
|
#ifndef _SIZE_T
|
||||||
char *strncat (char *, const char *, size_t);
|
#define _SIZE_T
|
||||||
char *strcpy (char *, const char *);
|
typedef unsigned size_t;
|
||||||
char *strncpy (char *, const char *, size_t);
|
#endif
|
||||||
|
|
||||||
char *strstr (const char *, const char *);
|
char *strcat (char *, const char *);
|
||||||
|
char *strncat (char *, const char *, size_t);
|
||||||
|
char *strcpy (char *, const char *);
|
||||||
|
char *strncpy (char *, const char *, size_t);
|
||||||
|
|
||||||
int strcmp (const char *, const char *);
|
char *strstr (const char *, const char *);
|
||||||
int strncmp (const char *, const char *, size_t);
|
|
||||||
size_t strlen (const char *);
|
|
||||||
|
|
||||||
int memcmp (const void *, const void *, size_t);
|
int strcmp (const char *, const char *);
|
||||||
|
int strncmp (const char *, const char *, size_t);
|
||||||
|
size_t strlen (const char *);
|
||||||
|
|
||||||
|
int memcmp (const void *, const void *, size_t);
|
||||||
|
|
||||||
void *memmove (void *, const void *, size_t);
|
void *memmove (void *, const void *, size_t);
|
||||||
void *memccpy (void *, const void *, int, size_t);
|
void *memccpy (void *, const void *, int, size_t);
|
||||||
void *memchr (const void *, int, size_t);
|
void *memchr (const void *, int, size_t);
|
||||||
void *memcpy (void *, const void *, size_t);
|
void *memcpy (void *, const void *, size_t);
|
||||||
void *memset (void *, int, size_t);
|
void *memset (void *, int, size_t);
|
||||||
char *strchr (const char *, int);
|
char *strchr (const char *, int);
|
||||||
|
|
||||||
char *strdup (const char *);
|
char *strdup (const char *);
|
||||||
char *strpbrk (const char *, const char *);
|
char *strpbrk (const char *, const char *);
|
||||||
char *strrchr (const char *, int);
|
char *strrchr (const char *, int);
|
||||||
char *strsep (char **, const char *);
|
char *strsep (char **, const char *);
|
||||||
char *strtok (char *, const char *);
|
char *strtok (char *, const char *);
|
||||||
char *strtok_r (char *, const char *, char **);
|
char *strtok_r (char *, const char *, char **);
|
||||||
|
|
||||||
size_t strcspn (const char *, const char *);
|
size_t strcspn (const char *, const char *);
|
||||||
size_t strspn (const char *, const char *);
|
size_t strspn (const char *, const char *);
|
||||||
|
|
||||||
char *strerror (int);
|
char *strerror (int);
|
||||||
const char *syserrlst (int);
|
const char *syserrlst (int);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1990, 1993
|
* Copyright (c) 1990, 1993
|
||||||
* The Regents of the University of California. All rights reserved.
|
* The Regents of the University of California. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -12,8 +12,8 @@
|
|||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* 3. All advertising materials mentioning features or use of this software
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
* must display the following acknowledgement:
|
* must display the following acknowledgement:
|
||||||
* This product includes software developed by the University of
|
* This product includes software developed by the University of
|
||||||
* California, Berkeley and its contributors.
|
* California, Berkeley and its contributors.
|
||||||
* 4. Neither the name of the University nor the names of its contributors
|
* 4. Neither the name of the University nor the names of its contributors
|
||||||
* may be used to endorse or promote products derived from this software
|
* may be used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
@@ -30,11 +30,14 @@
|
|||||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include <sys/types.h>
|
#ifndef _SIZE_T
|
||||||
|
#define _SIZE_T
|
||||||
|
typedef unsigned size_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
int bcmp(const void *, const void *, size_t);
|
int bcmp(const void *, const void *, size_t);
|
||||||
void bcopy(const void *, void *, size_t);
|
void bcopy(const void *, void *, size_t);
|
||||||
void bzero(void *, unsigned long);
|
void bzero(void *, unsigned int);
|
||||||
int ffs(int);
|
int ffs(int);
|
||||||
char *index(const char *, int);
|
char *index(const char *, int);
|
||||||
char *rindex(const char *, int);
|
char *rindex(const char *, int);
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
/* struct.h 4.1 83/05/03 */
|
/* struct.h 4.1 83/05/03 */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* access to information relating to the fields of a structure
|
* access to information relating to the fields of a structure
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define fldoff(str, fld) ((int)&(((struct str *)0)->fld))
|
#define fldoff(str, fld) ((int)&(((struct str *)0)->fld))
|
||||||
#define fldsiz(str, fld) (sizeof(((struct str *)0)->fld))
|
#define fldsiz(str, fld) (sizeof(((struct str *)0)->fld))
|
||||||
#define strbase(str, ptr, fld) ((struct str *)((char *)(ptr)-fldoff(str, fld)))
|
#define strbase(str, ptr, fld) ((struct str *)((char *)(ptr)-fldoff(str, fld)))
|
||||||
|
|||||||
@@ -9,168 +9,168 @@
|
|||||||
* causes cpp to leave a trailing tab when expanding macros in pdp/sys/SYS.h
|
* causes cpp to leave a trailing tab when expanding macros in pdp/sys/SYS.h
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define SYS_exit 1
|
#define SYS_exit 1
|
||||||
#define SYS_fork 2
|
#define SYS_fork 2
|
||||||
#define SYS_read 3
|
#define SYS_read 3
|
||||||
#define SYS_write 4
|
#define SYS_write 4
|
||||||
#define SYS_open 5
|
#define SYS_open 5
|
||||||
#define SYS_close 6
|
#define SYS_close 6
|
||||||
#define SYS_wait4 7
|
#define SYS_wait4 7
|
||||||
/* 8 is old; creat */
|
/* 8 is old; creat */
|
||||||
#define SYS_link 9
|
#define SYS_link 9
|
||||||
#define SYS_unlink 10
|
#define SYS_unlink 10
|
||||||
#define SYS_execv 11
|
#define SYS_execv 11
|
||||||
#define SYS_chdir 12
|
#define SYS_chdir 12
|
||||||
#define SYS_fchdir 13
|
#define SYS_fchdir 13
|
||||||
#define SYS_mknod 14
|
#define SYS_mknod 14
|
||||||
#define SYS_chmod 15
|
#define SYS_chmod 15
|
||||||
#define SYS_chown 16
|
#define SYS_chown 16
|
||||||
#define SYS_chflags 17
|
#define SYS_chflags 17
|
||||||
#define SYS_fchflags 18
|
#define SYS_fchflags 18
|
||||||
#define SYS_lseek 19
|
#define SYS_lseek 19
|
||||||
#define SYS_getpid 20
|
#define SYS_getpid 20
|
||||||
#define SYS_mount 21
|
#define SYS_mount 21
|
||||||
#define SYS_umount 22
|
#define SYS_umount 22
|
||||||
#define SYS___sysctl 23
|
#define SYS___sysctl 23
|
||||||
#define SYS_getuid 24
|
#define SYS_getuid 24
|
||||||
#define SYS_geteuid 25
|
#define SYS_geteuid 25
|
||||||
#define SYS_ptrace 26
|
#define SYS_ptrace 26
|
||||||
#define SYS_getppid 27
|
#define SYS_getppid 27
|
||||||
#define SYS_statfs 28
|
#define SYS_statfs 28
|
||||||
#define SYS_fstatfs 29
|
#define SYS_fstatfs 29
|
||||||
#define SYS_getfsstat 30
|
#define SYS_getfsstat 30
|
||||||
#define SYS_sigaction 31
|
#define SYS_sigaction 31
|
||||||
#define SYS_sigprocmask 32
|
#define SYS_sigprocmask 32
|
||||||
#define SYS_access 33
|
#define SYS_access 33
|
||||||
#define SYS_sigpending 34
|
#define SYS_sigpending 34
|
||||||
#define SYS_sigaltstack 35
|
#define SYS_sigaltstack 35
|
||||||
#define SYS_sync 36
|
#define SYS_sync 36
|
||||||
#define SYS_kill 37
|
#define SYS_kill 37
|
||||||
#define SYS_stat 38
|
#define SYS_stat 38
|
||||||
/* 39 was getlogin */
|
/* 39 was getlogin */
|
||||||
#define SYS_lstat 40
|
#define SYS_lstat 40
|
||||||
#define SYS_dup 41
|
#define SYS_dup 41
|
||||||
#define SYS_pipe 42
|
#define SYS_pipe 42
|
||||||
/* 43 was setlogin */
|
/* 43 was setlogin */
|
||||||
#define SYS_profil 44
|
#define SYS_profil 44
|
||||||
#define SYS_setuid 45
|
#define SYS_setuid 45
|
||||||
#define SYS_seteuid 46
|
#define SYS_seteuid 46
|
||||||
#define SYS_getgid 47
|
#define SYS_getgid 47
|
||||||
#define SYS_getegid 48
|
#define SYS_getegid 48
|
||||||
#define SYS_setgid 49
|
#define SYS_setgid 49
|
||||||
#define SYS_setegid 50
|
#define SYS_setegid 50
|
||||||
#define SYS_kmemdev 51
|
#define SYS_kmemdev 51
|
||||||
#define SYS_phys 52
|
#define SYS_phys 52
|
||||||
#define SYS_lock 53
|
#define SYS_lock 53
|
||||||
#define SYS_ioctl 54
|
#define SYS_ioctl 54
|
||||||
#define SYS_reboot 55
|
#define SYS_reboot 55
|
||||||
#define SYS_sigwait 56
|
#define SYS_sigwait 56
|
||||||
#define SYS_symlink 57
|
#define SYS_symlink 57
|
||||||
#define SYS_readlink 58
|
#define SYS_readlink 58
|
||||||
#define SYS_execve 59
|
#define SYS_execve 59
|
||||||
#define SYS_umask 60
|
#define SYS_umask 60
|
||||||
#define SYS_chroot 61
|
#define SYS_chroot 61
|
||||||
#define SYS_fstat 62
|
#define SYS_fstat 62
|
||||||
/* 63 is unused */
|
/* 63 is unused */
|
||||||
/* 64 is old; getpagesize */
|
/* 64 is old; getpagesize */
|
||||||
#define SYS_pselect 65
|
#define SYS_pselect 65
|
||||||
#define SYS_vfork 2 /* 66 - not fixed yet */
|
#define SYS_vfork 2 /* 66 - not fixed yet */
|
||||||
/* 67 is old; vread */
|
/* 67 is old; vread */
|
||||||
/* 68 is old; vwrite */
|
/* 68 is old; vwrite */
|
||||||
#define SYS_sbrk 69
|
#define SYS_sbrk 69
|
||||||
#define SYS_rdglob 70
|
#define SYS_rdglob 70
|
||||||
#define SYS_wrglob 71
|
#define SYS_wrglob 71
|
||||||
/* 71 is unused 4.3: mmap */
|
/* 71 is unused 4.3: mmap */
|
||||||
#define SYS_msec 72 /* 72 is unused 4.3: vadvise */
|
#define SYS_msec 72 /* 72 is unused 4.3: vadvise */
|
||||||
/* 73 is unused 4.3: munmap */
|
/* 73 is unused 4.3: munmap */
|
||||||
/* 74 is unused 4.3: mprotect */
|
/* 74 is unused 4.3: mprotect */
|
||||||
/* 75 is unused 4.3: madvise */
|
/* 75 is unused 4.3: madvise */
|
||||||
#define SYS_vhangup 76
|
#define SYS_vhangup 76
|
||||||
/* 77 is old; vlimit */
|
/* 77 is old; vlimit */
|
||||||
/* 78 is unused 4.3: mincore */
|
/* 78 is unused 4.3: mincore */
|
||||||
#define SYS_getgroups 79
|
#define SYS_getgroups 79
|
||||||
#define SYS_setgroups 80
|
#define SYS_setgroups 80
|
||||||
#define SYS_getpgrp 81
|
#define SYS_getpgrp 81
|
||||||
#define SYS_setpgrp 82
|
#define SYS_setpgrp 82
|
||||||
#define SYS_setitimer 83
|
#define SYS_setitimer 83
|
||||||
/* 84 is old; wait,wait3 */
|
/* 84 is old; wait,wait3 */
|
||||||
#define SYS_swapon 85
|
#define SYS_swapon 85
|
||||||
#define SYS_getitimer 86
|
#define SYS_getitimer 86
|
||||||
/* 87 is old; gethostname */
|
/* 87 is old; gethostname */
|
||||||
/* 88 is old; sethostname */
|
/* 88 is old; sethostname */
|
||||||
#define SYS_getdtablesize 89
|
#define SYS_getdtablesize 89
|
||||||
#define SYS_dup2 90
|
#define SYS_dup2 90
|
||||||
/* 91 is unused 4.3: getdopt */
|
/* 91 is unused 4.3: getdopt */
|
||||||
#define SYS_fcntl 92
|
#define SYS_fcntl 92
|
||||||
#define SYS_select 93
|
#define SYS_select 93
|
||||||
/* 94 is unused 4.3: setdopt */
|
/* 94 is unused 4.3: setdopt */
|
||||||
#define SYS_fsync 95
|
#define SYS_fsync 95
|
||||||
#define SYS_setpriority 96
|
#define SYS_setpriority 96
|
||||||
#define SYS_socket 97
|
#define SYS_socket 97
|
||||||
#define SYS_connect 98
|
#define SYS_connect 98
|
||||||
#define SYS_accept 99
|
#define SYS_accept 99
|
||||||
#define SYS_getpriority 100
|
#define SYS_getpriority 100
|
||||||
#define SYS_send 101
|
#define SYS_send 101
|
||||||
#define SYS_recv 102
|
#define SYS_recv 102
|
||||||
#define SYS_sigreturn 103
|
#define SYS_sigreturn 103
|
||||||
#define SYS_bind 104
|
#define SYS_bind 104
|
||||||
#define SYS_setsockopt 105
|
#define SYS_setsockopt 105
|
||||||
#define SYS_listen 106
|
#define SYS_listen 106
|
||||||
#define SYS_sigsuspend 107
|
#define SYS_sigsuspend 107
|
||||||
/*
|
/*
|
||||||
* 108 thru 112 are 4.3BSD compatibility syscalls. sigstack has to remain
|
* 108 thru 112 are 4.3BSD compatibility syscalls. sigstack has to remain
|
||||||
* defined because no replacement routine exists. Sigh.
|
* defined because no replacement routine exists. Sigh.
|
||||||
*/
|
*/
|
||||||
/* 108 is old; sigvec */
|
/* 108 is old; sigvec */
|
||||||
/* 109 is old; sigblock */
|
/* 109 is old; sigblock */
|
||||||
/* 110 is old; sigsetmask */
|
/* 110 is old; sigsetmask */
|
||||||
/* 111 is old; sigpause */
|
/* 111 is old; sigpause */
|
||||||
#define SYS_sigstack 112
|
#define SYS_sigstack 112
|
||||||
|
|
||||||
#define SYS_recvmsg 113
|
#define SYS_recvmsg 113
|
||||||
#define SYS_sendmsg 114
|
#define SYS_sendmsg 114
|
||||||
/* 115 is old; vtrace */
|
/* 115 is old; vtrace */
|
||||||
#define SYS_gettimeofday 116
|
#define SYS_gettimeofday 116
|
||||||
#define SYS_getrusage 117
|
#define SYS_getrusage 117
|
||||||
#define SYS_getsockopt 118
|
#define SYS_getsockopt 118
|
||||||
/* 119 is old; resuba */
|
/* 119 is old; resuba */
|
||||||
#define SYS_readv 120
|
#define SYS_readv 120
|
||||||
#define SYS_writev 121
|
#define SYS_writev 121
|
||||||
#define SYS_settimeofday 122
|
#define SYS_settimeofday 122
|
||||||
#define SYS_fchown 123
|
#define SYS_fchown 123
|
||||||
#define SYS_fchmod 124
|
#define SYS_fchmod 124
|
||||||
#define SYS_recvfrom 125
|
#define SYS_recvfrom 125
|
||||||
/* 126 is old; setreuid */
|
/* 126 is old; setreuid */
|
||||||
/* 127 is old; setregid */
|
/* 127 is old; setregid */
|
||||||
#define SYS_rename 128
|
#define SYS_rename 128
|
||||||
#define SYS_truncate 129
|
#define SYS_truncate 129
|
||||||
#define SYS_ftruncate 130
|
#define SYS_ftruncate 130
|
||||||
#define SYS_flock 131
|
#define SYS_flock 131
|
||||||
/* 132 is unused */
|
/* 132 is unused */
|
||||||
#define SYS_sendto 133
|
#define SYS_sendto 133
|
||||||
#define SYS_shutdown 134
|
#define SYS_shutdown 134
|
||||||
#define SYS_socketpair 135
|
#define SYS_socketpair 135
|
||||||
#define SYS_mkdir 136
|
#define SYS_mkdir 136
|
||||||
#define SYS_rmdir 137
|
#define SYS_rmdir 137
|
||||||
#define SYS_utimes 138
|
#define SYS_utimes 138
|
||||||
/* 139 is unused */
|
/* 139 is unused */
|
||||||
#define SYS_adjtime 140
|
#define SYS_adjtime 140
|
||||||
#define SYS_getpeername 141
|
#define SYS_getpeername 141
|
||||||
/* 142 is old; gethostid */
|
/* 142 is old; gethostid */
|
||||||
/* 143 is old; sethostid */
|
/* 143 is old; sethostid */
|
||||||
#define SYS_getrlimit 144
|
#define SYS_getrlimit 144
|
||||||
#define SYS_setrlimit 145
|
#define SYS_setrlimit 145
|
||||||
#define SYS_killpg 146
|
#define SYS_killpg 146
|
||||||
/* 147 is unused */
|
/* 147 is unused */
|
||||||
#define SYS_setquota 148
|
#define SYS_setquota 148
|
||||||
#define SYS_quota 149
|
#define SYS_quota 149
|
||||||
#define SYS_getsockname 150
|
#define SYS_getsockname 150
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 2BSD special calls
|
* 2BSD special calls
|
||||||
*/
|
*/
|
||||||
/* 151 is unused */
|
/* 151 is unused */
|
||||||
#define SYS_ustore 152
|
#define SYS_ustore 152
|
||||||
#define SYS_ufetch 153
|
#define SYS_ufetch 153
|
||||||
#define SYS_ucall 154
|
#define SYS_ucall 154
|
||||||
/* 155 is unused */
|
/* 155 is unused */
|
||||||
|
|||||||
@@ -9,89 +9,89 @@
|
|||||||
* software without specific prior written permission. This software
|
* software without specific prior written permission. This software
|
||||||
* is provided ``as is'' without express or implied warranty.
|
* is provided ``as is'' without express or implied warranty.
|
||||||
*
|
*
|
||||||
* @(#)sysexits.h 4.4.1 (2.11BSD) 1996/11/29
|
* @(#)sysexits.h 4.4.1 (2.11BSD) 1996/11/29
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** SYSEXITS.H -- Exit status codes for system programs.
|
** SYSEXITS.H -- Exit status codes for system programs.
|
||||||
**
|
**
|
||||||
** This include file attempts to categorize possible error
|
** This include file attempts to categorize possible error
|
||||||
** exit statuses for system programs, notably delivermail
|
** exit statuses for system programs, notably delivermail
|
||||||
** and the Berkeley network.
|
** and the Berkeley network.
|
||||||
**
|
**
|
||||||
** Error numbers begin at EX__BASE to reduce the possibility of
|
** Error numbers begin at EX__BASE to reduce the possibility of
|
||||||
** clashing with other exit statuses that random programs may
|
** clashing with other exit statuses that random programs may
|
||||||
** already return. The meaning of the codes is approximately
|
** already return. The meaning of the codes is approximately
|
||||||
** as follows:
|
** as follows:
|
||||||
**
|
**
|
||||||
** EX_USAGE -- The command was used incorrectly, e.g., with
|
** EX_USAGE -- The command was used incorrectly, e.g., with
|
||||||
** the wrong number of arguments, a bad flag, a bad
|
** the wrong number of arguments, a bad flag, a bad
|
||||||
** syntax in a parameter, or whatever.
|
** syntax in a parameter, or whatever.
|
||||||
** EX_DATAERR -- The input data was incorrect in some way.
|
** EX_DATAERR -- The input data was incorrect in some way.
|
||||||
** This should only be used for user's data & not
|
** This should only be used for user's data & not
|
||||||
** system files.
|
** system files.
|
||||||
** EX_NOINPUT -- An input file (not a system file) did not
|
** EX_NOINPUT -- An input file (not a system file) did not
|
||||||
** exist or was not readable. This could also include
|
** exist or was not readable. This could also include
|
||||||
** errors like "No message" to a mailer (if it cared
|
** errors like "No message" to a mailer (if it cared
|
||||||
** to catch it).
|
** to catch it).
|
||||||
** EX_NOUSER -- The user specified did not exist. This might
|
** EX_NOUSER -- The user specified did not exist. This might
|
||||||
** be used for mail addresses or remote logins.
|
** be used for mail addresses or remote logins.
|
||||||
** EX_NOHOST -- The host specified did not exist. This is used
|
** EX_NOHOST -- The host specified did not exist. This is used
|
||||||
** in mail addresses or network requests.
|
** in mail addresses or network requests.
|
||||||
** EX_UNAVAILABLE -- A service is unavailable. This can occur
|
** EX_UNAVAILABLE -- A service is unavailable. This can occur
|
||||||
** if a support program or file does not exist. This
|
** if a support program or file does not exist. This
|
||||||
** can also be used as a catchall message when something
|
** can also be used as a catchall message when something
|
||||||
** you wanted to do doesn't work, but you don't know
|
** you wanted to do doesn't work, but you don't know
|
||||||
** why.
|
** why.
|
||||||
** EX_SOFTWARE -- An internal software error has been detected.
|
** EX_SOFTWARE -- An internal software error has been detected.
|
||||||
** This should be limited to non-operating system related
|
** This should be limited to non-operating system related
|
||||||
** errors as possible.
|
** errors as possible.
|
||||||
** EX_OSERR -- An operating system error has been detected.
|
** EX_OSERR -- An operating system error has been detected.
|
||||||
** This is intended to be used for such things as "cannot
|
** This is intended to be used for such things as "cannot
|
||||||
** fork", "cannot create pipe", or the like. It includes
|
** fork", "cannot create pipe", or the like. It includes
|
||||||
** things like getuid returning a user that does not
|
** things like getuid returning a user that does not
|
||||||
** exist in the passwd file.
|
** exist in the passwd file.
|
||||||
** EX_OSFILE -- Some system file (e.g., /etc/passwd, /var/run/utmp,
|
** EX_OSFILE -- Some system file (e.g., /etc/passwd, /var/run/utmp,
|
||||||
** etc.) does not exist, cannot be opened, or has some
|
** etc.) does not exist, cannot be opened, or has some
|
||||||
** sort of error (e.g., syntax error).
|
** sort of error (e.g., syntax error).
|
||||||
** EX_CANTCREAT -- A (user specified) output file cannot be
|
** EX_CANTCREAT -- A (user specified) output file cannot be
|
||||||
** created.
|
** created.
|
||||||
** EX_IOERR -- An error occurred while doing I/O on some file.
|
** EX_IOERR -- An error occurred while doing I/O on some file.
|
||||||
** EX_TEMPFAIL -- temporary failure, indicating something that
|
** EX_TEMPFAIL -- temporary failure, indicating something that
|
||||||
** is not really an error. In sendmail, this means
|
** is not really an error. In sendmail, this means
|
||||||
** that a mailer (e.g.) could not create a connection,
|
** that a mailer (e.g.) could not create a connection,
|
||||||
** and the request should be reattempted later.
|
** and the request should be reattempted later.
|
||||||
** EX_PROTOCOL -- the remote system returned something that
|
** EX_PROTOCOL -- the remote system returned something that
|
||||||
** was "not possible" during a protocol exchange.
|
** was "not possible" during a protocol exchange.
|
||||||
** EX_NOPERM -- You did not have sufficient permission to
|
** EX_NOPERM -- You did not have sufficient permission to
|
||||||
** perform the operation. This is not intended for
|
** perform the operation. This is not intended for
|
||||||
** file system problems, which should use NOINPUT or
|
** file system problems, which should use NOINPUT or
|
||||||
** CANTCREAT, but rather for higher level permissions.
|
** CANTCREAT, but rather for higher level permissions.
|
||||||
** For example, kre uses this to restrict who students
|
** For example, kre uses this to restrict who students
|
||||||
** can send mail to.
|
** can send mail to.
|
||||||
**
|
**
|
||||||
** Maintained by Eric Allman (eric@berkeley, ucbvax!eric) --
|
** Maintained by Eric Allman (eric@berkeley, ucbvax!eric) --
|
||||||
** please mail changes to me.
|
** please mail changes to me.
|
||||||
**
|
**
|
||||||
** @(#)sysexits.h 4.4 3/24/88
|
** @(#)sysexits.h 4.4 3/24/88
|
||||||
*/
|
*/
|
||||||
|
|
||||||
# define EX_OK 0 /* successful termination */
|
# define EX_OK 0 /* successful termination */
|
||||||
|
|
||||||
# define EX__BASE 64 /* base value for error messages */
|
# define EX__BASE 64 /* base value for error messages */
|
||||||
|
|
||||||
# define EX_USAGE 64 /* command line usage error */
|
# define EX_USAGE 64 /* command line usage error */
|
||||||
# define EX_DATAERR 65 /* data format error */
|
# define EX_DATAERR 65 /* data format error */
|
||||||
# define EX_NOINPUT 66 /* cannot open input */
|
# define EX_NOINPUT 66 /* cannot open input */
|
||||||
# define EX_NOUSER 67 /* addressee unknown */
|
# define EX_NOUSER 67 /* addressee unknown */
|
||||||
# define EX_NOHOST 68 /* host name unknown */
|
# define EX_NOHOST 68 /* host name unknown */
|
||||||
# define EX_UNAVAILABLE 69 /* service unavailable */
|
# define EX_UNAVAILABLE 69 /* service unavailable */
|
||||||
# define EX_SOFTWARE 70 /* internal software error */
|
# define EX_SOFTWARE 70 /* internal software error */
|
||||||
# define EX_OSERR 71 /* system error (e.g., can't fork) */
|
# define EX_OSERR 71 /* system error (e.g., can't fork) */
|
||||||
# define EX_OSFILE 72 /* critical OS file missing */
|
# define EX_OSFILE 72 /* critical OS file missing */
|
||||||
# define EX_CANTCREAT 73 /* can't create (user) output file */
|
# define EX_CANTCREAT 73 /* can't create (user) output file */
|
||||||
# define EX_IOERR 74 /* input/output error */
|
# define EX_IOERR 74 /* input/output error */
|
||||||
# define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */
|
# define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */
|
||||||
# define EX_PROTOCOL 76 /* remote error in protocol */
|
# define EX_PROTOCOL 76 /* remote error in protocol */
|
||||||
# define EX_NOPERM 77 /* permission denied */
|
# define EX_NOPERM 77 /* permission denied */
|
||||||
# define EX_CONFIG 78 /* configuration error */
|
# define EX_CONFIG 78 /* configuration error */
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* tcl.h --
|
* tcl.h --
|
||||||
*
|
*
|
||||||
* This header file describes the externally-visible facilities
|
* This header file describes the externally-visible facilities
|
||||||
* of the Tcl interpreter.
|
* of the Tcl interpreter.
|
||||||
*
|
*
|
||||||
* Copyright 1987-1991 Regents of the University of California
|
* Copyright 1987-1991 Regents of the University of California
|
||||||
* Permission to use, copy, modify, and distribute this
|
* Permission to use, copy, modify, and distribute this
|
||||||
@@ -16,9 +16,9 @@
|
|||||||
#ifndef _TCL
|
#ifndef _TCL
|
||||||
#define _TCL
|
#define _TCL
|
||||||
|
|
||||||
#define TCL_VERSION "6.7"
|
#define TCL_VERSION "6.7"
|
||||||
#define TCL_MAJOR_VERSION 6
|
#define TCL_MAJOR_VERSION 6
|
||||||
#define TCL_MINOR_VERSION 7
|
#define TCL_MINOR_VERSION 7
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Data structures defined opaquely in this module. The definitions
|
* Data structures defined opaquely in this module. The definitions
|
||||||
@@ -28,17 +28,17 @@
|
|||||||
* in the "real" definition in tclInt.h.
|
* in the "real" definition in tclInt.h.
|
||||||
*/
|
*/
|
||||||
typedef struct Tcl_Interp {
|
typedef struct Tcl_Interp {
|
||||||
unsigned char *result; /* Points to result string returned by last
|
unsigned char *result; /* Points to result string returned by last
|
||||||
* command. */
|
* command. */
|
||||||
void (*freeProc) (unsigned char *blockPtr);
|
void (*freeProc) (unsigned char *blockPtr);
|
||||||
/* Zero means result is statically allocated.
|
/* Zero means result is statically allocated.
|
||||||
* If non-zero, gives address of procedure
|
* If non-zero, gives address of procedure
|
||||||
* to invoke to free the result. Must be
|
* to invoke to free the result. Must be
|
||||||
* freed by Tcl_Eval before executing next
|
* freed by Tcl_Eval before executing next
|
||||||
* command. */
|
* command. */
|
||||||
unsigned short errorLine; /* When TCL_ERROR is returned, this gives
|
unsigned short errorLine; /* When TCL_ERROR is returned, this gives
|
||||||
* the line number within the command where
|
* the line number within the command where
|
||||||
* the error occurred (1 means first line). */
|
* the error occurred (1 means first line). */
|
||||||
} Tcl_Interp;
|
} Tcl_Interp;
|
||||||
|
|
||||||
typedef void *Tcl_Trace;
|
typedef void *Tcl_Trace;
|
||||||
@@ -50,23 +50,23 @@ typedef void *Tcl_CmdBuf;
|
|||||||
* the command procedure returns an integer value, which is one of the
|
* the command procedure returns an integer value, which is one of the
|
||||||
* following:
|
* following:
|
||||||
*
|
*
|
||||||
* TCL_OK Command completed normally; interp->result contains
|
* TCL_OK Command completed normally; interp->result contains
|
||||||
* the command's result.
|
* the command's result.
|
||||||
* TCL_ERROR The command couldn't be completed successfully;
|
* TCL_ERROR The command couldn't be completed successfully;
|
||||||
* interp->result describes what went wrong.
|
* interp->result describes what went wrong.
|
||||||
* TCL_RETURN The command requests that the current procedure
|
* TCL_RETURN The command requests that the current procedure
|
||||||
* return; interp->result contains the procedure's
|
* return; interp->result contains the procedure's
|
||||||
* return value.
|
* return value.
|
||||||
* TCL_BREAK The command requests that the innermost loop
|
* TCL_BREAK The command requests that the innermost loop
|
||||||
* be exited; interp->result is meaningless.
|
* be exited; interp->result is meaningless.
|
||||||
* TCL_CONTINUE Go on to the next iteration of the current loop;
|
* TCL_CONTINUE Go on to the next iteration of the current loop;
|
||||||
* interp->result is meaninless.
|
* interp->result is meaninless.
|
||||||
*/
|
*/
|
||||||
#define TCL_OK 0
|
#define TCL_OK 0
|
||||||
#define TCL_ERROR 1
|
#define TCL_ERROR 1
|
||||||
#define TCL_RETURN 2
|
#define TCL_RETURN 2
|
||||||
#define TCL_BREAK 3
|
#define TCL_BREAK 3
|
||||||
#define TCL_CONTINUE 4
|
#define TCL_CONTINUE 4
|
||||||
|
|
||||||
#define TCL_RESULT_SIZE 199
|
#define TCL_RESULT_SIZE 199
|
||||||
|
|
||||||
@@ -75,168 +75,168 @@ typedef void *Tcl_CmdBuf;
|
|||||||
*/
|
*/
|
||||||
typedef void (Tcl_CmdDeleteProc) (void *clientData);
|
typedef void (Tcl_CmdDeleteProc) (void *clientData);
|
||||||
typedef int (Tcl_CmdProc) (void *clientData,
|
typedef int (Tcl_CmdProc) (void *clientData,
|
||||||
Tcl_Interp *interp, int argc, unsigned char *argv[]);
|
Tcl_Interp *interp, int argc, unsigned char *argv[]);
|
||||||
typedef void (Tcl_CmdTraceProc) (void *clientData,
|
typedef void (Tcl_CmdTraceProc) (void *clientData,
|
||||||
Tcl_Interp *interp, int level, unsigned char *command, Tcl_CmdProc *proc,
|
Tcl_Interp *interp, int level, unsigned char *command, Tcl_CmdProc *proc,
|
||||||
void *cmdClientData, int argc, unsigned char *argv[]);
|
void *cmdClientData, int argc, unsigned char *argv[]);
|
||||||
typedef void (Tcl_FreeProc) (unsigned char *blockPtr);
|
typedef void (Tcl_FreeProc) (unsigned char *blockPtr);
|
||||||
typedef unsigned char *(Tcl_VarTraceProc) (void *clientData,
|
typedef unsigned char *(Tcl_VarTraceProc) (void *clientData,
|
||||||
Tcl_Interp *interp, unsigned char *part1, unsigned char *part2, int flags);
|
Tcl_Interp *interp, unsigned char *part1, unsigned char *part2, int flags);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Flag values passed to Tcl_Eval (see the man page for details; also
|
* Flag values passed to Tcl_Eval (see the man page for details; also
|
||||||
* see tclInt.h for additional flags that are only used internally by
|
* see tclInt.h for additional flags that are only used internally by
|
||||||
* Tcl):
|
* Tcl):
|
||||||
*/
|
*/
|
||||||
#define TCL_BRACKET_TERM 1
|
#define TCL_BRACKET_TERM 1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Flag that may be passed to Tcl_ConvertElement to force it not to
|
* Flag that may be passed to Tcl_ConvertElement to force it not to
|
||||||
* output braces (careful! if you change this flag be sure to change
|
* output braces (careful! if you change this flag be sure to change
|
||||||
* the definitions at the front of tclUtil.c).
|
* the definitions at the front of tclUtil.c).
|
||||||
*/
|
*/
|
||||||
#define TCL_DONT_USE_BRACES 1
|
#define TCL_DONT_USE_BRACES 1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Flag value passed to Tcl_RecordAndEval to request no evaluation
|
* Flag value passed to Tcl_RecordAndEval to request no evaluation
|
||||||
* (record only).
|
* (record only).
|
||||||
*/
|
*/
|
||||||
#define TCL_NO_EVAL -1
|
#define TCL_NO_EVAL -1
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Specil freeProc values that may be passed to Tcl_SetResult (see
|
* Specil freeProc values that may be passed to Tcl_SetResult (see
|
||||||
* the man page for details):
|
* the man page for details):
|
||||||
*/
|
*/
|
||||||
#define TCL_STATIC ((Tcl_FreeProc *) 0)
|
#define TCL_STATIC ((Tcl_FreeProc *) 0)
|
||||||
#define TCL_VOLATILE ((Tcl_FreeProc *) -1)
|
#define TCL_VOLATILE ((Tcl_FreeProc *) -1)
|
||||||
#define TCL_DYNAMIC ((Tcl_FreeProc *) -2)
|
#define TCL_DYNAMIC ((Tcl_FreeProc *) -2)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Flag values passed to variable-related procedures.
|
* Flag values passed to variable-related procedures.
|
||||||
*/
|
*/
|
||||||
#define TCL_GLOBAL_ONLY 1
|
#define TCL_GLOBAL_ONLY 1
|
||||||
#define TCL_APPEND_VALUE 2
|
#define TCL_APPEND_VALUE 2
|
||||||
#define TCL_LIST_ELEMENT 4
|
#define TCL_LIST_ELEMENT 4
|
||||||
#define TCL_NO_SPACE 8
|
#define TCL_NO_SPACE 8
|
||||||
#define TCL_TRACE_READS 0x10
|
#define TCL_TRACE_READS 0x10
|
||||||
#define TCL_TRACE_WRITES 0x20
|
#define TCL_TRACE_WRITES 0x20
|
||||||
#define TCL_TRACE_UNSETS 0x40
|
#define TCL_TRACE_UNSETS 0x40
|
||||||
#define TCL_TRACE_DESTROYED 0x80
|
#define TCL_TRACE_DESTROYED 0x80
|
||||||
#define TCL_INTERP_DESTROYED 0x100
|
#define TCL_INTERP_DESTROYED 0x100
|
||||||
#define TCL_LEAVE_ERR_MSG 0x200
|
#define TCL_LEAVE_ERR_MSG 0x200
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Additional flag passed back to variable watchers. This flag must
|
* Additional flag passed back to variable watchers. This flag must
|
||||||
* not overlap any of the TCL_TRACE_* flags defined above or the
|
* not overlap any of the TCL_TRACE_* flags defined above or the
|
||||||
* TRACE_* flags defined in tclInt.h.
|
* TRACE_* flags defined in tclInt.h.
|
||||||
*/
|
*/
|
||||||
#define TCL_VARIABLE_UNDEFINED 8
|
#define TCL_VARIABLE_UNDEFINED 8
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Exported Tcl procedures:
|
* Exported Tcl procedures:
|
||||||
*/
|
*/
|
||||||
extern void Tcl_AppendElement (Tcl_Interp *interp, unsigned char *string,
|
extern void Tcl_AppendElement (Tcl_Interp *interp, unsigned char *string,
|
||||||
int noSep);
|
int noSep);
|
||||||
extern void Tcl_AppendResult (Tcl_Interp *interp, ...);
|
extern void Tcl_AppendResult (Tcl_Interp *interp, ...);
|
||||||
extern unsigned char * Tcl_AssembleCmd (Tcl_CmdBuf buffer, unsigned char *string);
|
extern unsigned char * Tcl_AssembleCmd (Tcl_CmdBuf buffer, unsigned char *string);
|
||||||
extern void Tcl_AddErrorInfo (Tcl_Interp *interp, unsigned char *message);
|
extern void Tcl_AddErrorInfo (Tcl_Interp *interp, unsigned char *message);
|
||||||
extern char Tcl_Backslash (unsigned char *src, int *readPtr);
|
extern char Tcl_Backslash (unsigned char *src, int *readPtr);
|
||||||
extern int Tcl_CommandComplete (unsigned char *cmd);
|
extern int Tcl_CommandComplete (unsigned char *cmd);
|
||||||
extern unsigned char * Tcl_Concat (int argc, unsigned char **argv);
|
extern unsigned char * Tcl_Concat (int argc, unsigned char **argv);
|
||||||
extern int Tcl_ConvertElement (unsigned char *src, unsigned char *dst, int flags);
|
extern int Tcl_ConvertElement (unsigned char *src, unsigned char *dst, int flags);
|
||||||
extern Tcl_CmdBuf Tcl_CreateCmdBuf (void);
|
extern Tcl_CmdBuf Tcl_CreateCmdBuf (void);
|
||||||
extern void Tcl_CreateCommand (Tcl_Interp *interp, unsigned char *cmdName,
|
extern void Tcl_CreateCommand (Tcl_Interp *interp, unsigned char *cmdName,
|
||||||
Tcl_CmdProc *proc, void *clientData,
|
Tcl_CmdProc *proc, void *clientData,
|
||||||
Tcl_CmdDeleteProc *deleteProc);
|
Tcl_CmdDeleteProc *deleteProc);
|
||||||
extern Tcl_Interp * Tcl_CreateInterp (void);
|
extern Tcl_Interp * Tcl_CreateInterp (void);
|
||||||
extern int Tcl_CreatePipeline (Tcl_Interp *interp, int argc,
|
extern int Tcl_CreatePipeline (Tcl_Interp *interp, int argc,
|
||||||
unsigned char **argv, int **pidArrayPtr,
|
unsigned char **argv, int **pidArrayPtr,
|
||||||
int *inPipePtr, int *outPipePtr,
|
int *inPipePtr, int *outPipePtr,
|
||||||
int *errFilePtr);
|
int *errFilePtr);
|
||||||
extern Tcl_Trace Tcl_CreateTrace (Tcl_Interp *interp,
|
extern Tcl_Trace Tcl_CreateTrace (Tcl_Interp *interp,
|
||||||
int level, Tcl_CmdTraceProc *proc,
|
int level, Tcl_CmdTraceProc *proc,
|
||||||
void *clientData);
|
void *clientData);
|
||||||
extern void Tcl_DeleteCmdBuf (Tcl_CmdBuf buffer);
|
extern void Tcl_DeleteCmdBuf (Tcl_CmdBuf buffer);
|
||||||
extern int Tcl_DeleteCommand (Tcl_Interp *interp,
|
extern int Tcl_DeleteCommand (Tcl_Interp *interp,
|
||||||
unsigned char *cmdName);
|
unsigned char *cmdName);
|
||||||
extern void Tcl_DeleteInterp (Tcl_Interp *interp);
|
extern void Tcl_DeleteInterp (Tcl_Interp *interp);
|
||||||
extern void Tcl_DeleteTrace (Tcl_Interp *interp,
|
extern void Tcl_DeleteTrace (Tcl_Interp *interp,
|
||||||
Tcl_Trace trace);
|
Tcl_Trace trace);
|
||||||
extern void Tcl_DetachPids (int numPids, int *pidPtr);
|
extern void Tcl_DetachPids (int numPids, int *pidPtr);
|
||||||
extern unsigned char * Tcl_ErrnoId (void);
|
extern unsigned char * Tcl_ErrnoId (void);
|
||||||
extern int Tcl_Eval (Tcl_Interp *interp, unsigned char *cmd,
|
extern int Tcl_Eval (Tcl_Interp *interp, unsigned char *cmd,
|
||||||
int flags, unsigned char **termPtr);
|
int flags, unsigned char **termPtr);
|
||||||
extern int Tcl_EvalFile (Tcl_Interp *interp,
|
extern int Tcl_EvalFile (Tcl_Interp *interp,
|
||||||
unsigned char *fileName);
|
unsigned char *fileName);
|
||||||
extern int Tcl_ExprBoolean (Tcl_Interp *interp, unsigned char *string,
|
extern int Tcl_ExprBoolean (Tcl_Interp *interp, unsigned char *string,
|
||||||
int *ptr);
|
int *ptr);
|
||||||
extern int Tcl_ExprLong (Tcl_Interp *interp, unsigned char *string,
|
extern int Tcl_ExprLong (Tcl_Interp *interp, unsigned char *string,
|
||||||
long *ptr);
|
long *ptr);
|
||||||
extern int Tcl_ExprString (Tcl_Interp *interp, unsigned char *string);
|
extern int Tcl_ExprString (Tcl_Interp *interp, unsigned char *string);
|
||||||
extern int Tcl_Fork (void);
|
extern int Tcl_Fork (void);
|
||||||
extern void Tcl_FreeResult (Tcl_Interp *interp);
|
extern void Tcl_FreeResult (Tcl_Interp *interp);
|
||||||
extern int Tcl_GetBoolean (Tcl_Interp *interp,
|
extern int Tcl_GetBoolean (Tcl_Interp *interp,
|
||||||
unsigned char *string, int *boolPtr);
|
unsigned char *string, int *boolPtr);
|
||||||
extern int Tcl_GetInt (Tcl_Interp *interp,
|
extern int Tcl_GetInt (Tcl_Interp *interp,
|
||||||
unsigned char *string, int *intPtr);
|
unsigned char *string, int *intPtr);
|
||||||
extern unsigned char * Tcl_GetVar (Tcl_Interp *interp,
|
extern unsigned char * Tcl_GetVar (Tcl_Interp *interp,
|
||||||
unsigned char *varName, int flags);
|
unsigned char *varName, int flags);
|
||||||
extern unsigned char * Tcl_GetVar2 (Tcl_Interp *interp,
|
extern unsigned char * Tcl_GetVar2 (Tcl_Interp *interp,
|
||||||
unsigned char *part1, unsigned char *part2, int flags);
|
unsigned char *part1, unsigned char *part2, int flags);
|
||||||
extern int Tcl_GlobalEval (Tcl_Interp *interp,
|
extern int Tcl_GlobalEval (Tcl_Interp *interp,
|
||||||
unsigned char *command);
|
unsigned char *command);
|
||||||
extern void Tcl_InitHistory (Tcl_Interp *interp);
|
extern void Tcl_InitHistory (Tcl_Interp *interp);
|
||||||
extern void Tcl_InitMemory (Tcl_Interp *interp);
|
extern void Tcl_InitMemory (Tcl_Interp *interp);
|
||||||
extern unsigned char * Tcl_Merge (int argc, unsigned char **argv);
|
extern unsigned char * Tcl_Merge (int argc, unsigned char **argv);
|
||||||
extern unsigned char * Tcl_ParseVar (Tcl_Interp *interp,
|
extern unsigned char * Tcl_ParseVar (Tcl_Interp *interp,
|
||||||
unsigned char *string, unsigned char **termPtr);
|
unsigned char *string, unsigned char **termPtr);
|
||||||
extern int Tcl_RecordAndEval (Tcl_Interp *interp,
|
extern int Tcl_RecordAndEval (Tcl_Interp *interp,
|
||||||
unsigned char *cmd, int flags);
|
unsigned char *cmd, int flags);
|
||||||
extern void Tcl_ResetResult (Tcl_Interp *interp);
|
extern void Tcl_ResetResult (Tcl_Interp *interp);
|
||||||
extern int Tcl_ScanElement (unsigned char *string,
|
extern int Tcl_ScanElement (unsigned char *string,
|
||||||
int *flagPtr);
|
int *flagPtr);
|
||||||
extern void Tcl_SetErrorCode (Tcl_Interp *interp, ...);
|
extern void Tcl_SetErrorCode (Tcl_Interp *interp, ...);
|
||||||
extern void Tcl_SetResult (Tcl_Interp *interp,
|
extern void Tcl_SetResult (Tcl_Interp *interp,
|
||||||
unsigned char *string, Tcl_FreeProc *freeProc);
|
unsigned char *string, Tcl_FreeProc *freeProc);
|
||||||
extern unsigned char * Tcl_SetVar (Tcl_Interp *interp,
|
extern unsigned char * Tcl_SetVar (Tcl_Interp *interp,
|
||||||
unsigned char *varName, unsigned char *newValue, int flags);
|
unsigned char *varName, unsigned char *newValue, int flags);
|
||||||
extern unsigned char * Tcl_SetVar2 (Tcl_Interp *interp,
|
extern unsigned char * Tcl_SetVar2 (Tcl_Interp *interp,
|
||||||
unsigned char *part1, unsigned char *part2,
|
unsigned char *part1, unsigned char *part2,
|
||||||
unsigned char *newValue, int flags);
|
unsigned char *newValue, int flags);
|
||||||
extern unsigned char * Tcl_SignalId (int sig);
|
extern unsigned char * Tcl_SignalId (int sig);
|
||||||
extern unsigned char * Tcl_SignalMsg (int sig);
|
extern unsigned char * Tcl_SignalMsg (int sig);
|
||||||
extern int Tcl_SplitList (Tcl_Interp *interp,
|
extern int Tcl_SplitList (Tcl_Interp *interp,
|
||||||
unsigned char *list, int *argcPtr, unsigned char ***argvPtr);
|
unsigned char *list, int *argcPtr, unsigned char ***argvPtr);
|
||||||
extern int Tcl_StringMatch (unsigned char *string,
|
extern int Tcl_StringMatch (unsigned char *string,
|
||||||
unsigned char *pattern);
|
unsigned char *pattern);
|
||||||
extern unsigned char * Tcl_TildeSubst (Tcl_Interp *interp,
|
extern unsigned char * Tcl_TildeSubst (Tcl_Interp *interp,
|
||||||
unsigned char *name);
|
unsigned char *name);
|
||||||
extern int Tcl_TraceVar (Tcl_Interp *interp,
|
extern int Tcl_TraceVar (Tcl_Interp *interp,
|
||||||
unsigned char *varName, int flags, Tcl_VarTraceProc *proc,
|
unsigned char *varName, int flags, Tcl_VarTraceProc *proc,
|
||||||
void *clientData);
|
void *clientData);
|
||||||
extern int Tcl_TraceVar2 (Tcl_Interp *interp,
|
extern int Tcl_TraceVar2 (Tcl_Interp *interp,
|
||||||
unsigned char *part1, unsigned char *part2, int flags,
|
unsigned char *part1, unsigned char *part2, int flags,
|
||||||
Tcl_VarTraceProc *proc, void *clientData);
|
Tcl_VarTraceProc *proc, void *clientData);
|
||||||
extern int Tcl_UnsetVar (Tcl_Interp *interp,
|
extern int Tcl_UnsetVar (Tcl_Interp *interp,
|
||||||
unsigned char *varName, int flags);
|
unsigned char *varName, int flags);
|
||||||
extern int Tcl_UnsetVar2 (Tcl_Interp *interp,
|
extern int Tcl_UnsetVar2 (Tcl_Interp *interp,
|
||||||
unsigned char *part1, unsigned char *part2, int flags);
|
unsigned char *part1, unsigned char *part2, int flags);
|
||||||
extern void Tcl_UntraceVar (Tcl_Interp *interp,
|
extern void Tcl_UntraceVar (Tcl_Interp *interp,
|
||||||
unsigned char *varName, int flags, Tcl_VarTraceProc *proc,
|
unsigned char *varName, int flags, Tcl_VarTraceProc *proc,
|
||||||
void *clientData);
|
void *clientData);
|
||||||
extern void Tcl_UntraceVar2 (Tcl_Interp *interp,
|
extern void Tcl_UntraceVar2 (Tcl_Interp *interp,
|
||||||
unsigned char *part1, unsigned char *part2, int flags,
|
unsigned char *part1, unsigned char *part2, int flags,
|
||||||
Tcl_VarTraceProc *proc, void *clientData);
|
Tcl_VarTraceProc *proc, void *clientData);
|
||||||
extern int Tcl_VarEval (Tcl_Interp *interp, ...);
|
extern int Tcl_VarEval (Tcl_Interp *interp, ...);
|
||||||
extern void * Tcl_VarTraceInfo (Tcl_Interp *interp,
|
extern void * Tcl_VarTraceInfo (Tcl_Interp *interp,
|
||||||
unsigned char *varName, int flags,
|
unsigned char *varName, int flags,
|
||||||
Tcl_VarTraceProc *procPtr,
|
Tcl_VarTraceProc *procPtr,
|
||||||
void *prevClientData);
|
void *prevClientData);
|
||||||
extern void * Tcl_VarTraceInfo2 (Tcl_Interp *interp,
|
extern void * Tcl_VarTraceInfo2 (Tcl_Interp *interp,
|
||||||
unsigned char *part1, unsigned char *part2, int flags,
|
unsigned char *part1, unsigned char *part2, int flags,
|
||||||
Tcl_VarTraceProc *procPtr,
|
Tcl_VarTraceProc *procPtr,
|
||||||
void *prevClientData);
|
void *prevClientData);
|
||||||
extern int Tcl_WaitPids (int numPids, int *pidPtr,
|
extern int Tcl_WaitPids (int numPids, int *pidPtr,
|
||||||
int *statusPtr);
|
int *statusPtr);
|
||||||
|
|
||||||
#endif /* _TCL */
|
#endif /* _TCL */
|
||||||
|
|||||||
@@ -6,6 +6,6 @@ extern int tgetnum(char *);
|
|||||||
extern int tgetflag(char *);
|
extern int tgetflag(char *);
|
||||||
extern char *tgetstr(char *, char **);
|
extern char *tgetstr(char *, char **);
|
||||||
extern char *tgoto(char *, int, int);
|
extern char *tgoto(char *, int, int);
|
||||||
extern int tputs(register char *, int, int (*)());
|
extern int tputs(register char *, int, int (*)(int));
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -4,8 +4,6 @@
|
|||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#define E_TERMCAP "/etc/termcap"
|
|
||||||
|
|
||||||
typedef unsigned char cc_t;
|
typedef unsigned char cc_t;
|
||||||
typedef unsigned int speed_t;
|
typedef unsigned int speed_t;
|
||||||
typedef unsigned int tcflag_t;
|
typedef unsigned int tcflag_t;
|
||||||
@@ -17,7 +15,7 @@ struct termios
|
|||||||
tcflag_t c_oflag; /* output mode flags */
|
tcflag_t c_oflag; /* output mode flags */
|
||||||
tcflag_t c_cflag; /* control mode flags */
|
tcflag_t c_cflag; /* control mode flags */
|
||||||
tcflag_t c_lflag; /* local mode flags */
|
tcflag_t c_lflag; /* local mode flags */
|
||||||
cc_t c_line; /* line discipline */
|
cc_t c_line; /* line discipline */
|
||||||
cc_t c_cc[NCCS]; /* control characters */
|
cc_t c_cc[NCCS]; /* control characters */
|
||||||
speed_t c_ispeed; /* input speed */
|
speed_t c_ispeed; /* input speed */
|
||||||
speed_t c_ospeed; /* output speed */
|
speed_t c_ospeed; /* output speed */
|
||||||
@@ -145,5 +143,4 @@ extern int tcsetattr(int, int, struct termios *);
|
|||||||
#define TIOCSETAW _IOW(i, 92, struct termios)
|
#define TIOCSETAW _IOW(i, 92, struct termios)
|
||||||
#define TIOCSETAF _IOW(i, 92, struct termios)
|
#define TIOCSETAF _IOW(i, 92, struct termios)
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -6,30 +6,44 @@
|
|||||||
#ifndef _TIME_H
|
#ifndef _TIME_H
|
||||||
#define _TIME_H
|
#define _TIME_H
|
||||||
|
|
||||||
#include <sys/types.h> /* for time_t */
|
#ifndef NULL
|
||||||
|
#define NULL 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _TIME_T
|
||||||
|
#define _TIME_T
|
||||||
|
typedef long time_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _SIZE_T
|
||||||
|
#define _SIZE_T
|
||||||
|
typedef unsigned size_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Structure returned by gmtime and localtime calls (see ctime(3)).
|
* Structure returned by gmtime and localtime calls (see ctime(3)).
|
||||||
*/
|
*/
|
||||||
struct tm {
|
struct tm {
|
||||||
int tm_sec;
|
int tm_sec;
|
||||||
int tm_min;
|
int tm_min;
|
||||||
int tm_hour;
|
int tm_hour;
|
||||||
int tm_mday;
|
int tm_mday;
|
||||||
int tm_mon;
|
int tm_mon;
|
||||||
int tm_year;
|
int tm_year;
|
||||||
int tm_wday;
|
int tm_wday;
|
||||||
int tm_yday;
|
int tm_yday;
|
||||||
int tm_isdst;
|
int tm_isdst;
|
||||||
long tm_gmtoff;
|
long tm_gmtoff;
|
||||||
char *tm_zone;
|
char *tm_zone;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct tm *gmtime(), *localtime();
|
struct tm *gmtime(const time_t *);
|
||||||
extern char *asctime(), *ctime();
|
struct tm *localtime(const time_t *);
|
||||||
extern time_t time();
|
char *asctime(const struct tm *);
|
||||||
|
char *ctime(const time_t *);
|
||||||
|
time_t time(time_t *);
|
||||||
|
|
||||||
size_t strftime (char *s, size_t maxsize, const char *format,
|
size_t strftime (char *s, size_t maxsize, const char *format,
|
||||||
const struct tm *timeptr);
|
const struct tm *timeptr);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -4,17 +4,17 @@
|
|||||||
* specifies the terms and conditions for redistribution.
|
* specifies the terms and conditions for redistribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct ttyent { /* see getttyent(3) */
|
struct ttyent { /* see getttyent(3) */
|
||||||
char *ty_name; /* terminal device name */
|
char *ty_name; /* terminal device name */
|
||||||
char *ty_getty; /* command to execute, usually getty */
|
char *ty_getty; /* command to execute, usually getty */
|
||||||
char *ty_type; /* terminal type for termcap (3X) */
|
char *ty_type; /* terminal type for termcap (3X) */
|
||||||
int ty_status; /* status flags (see below for defines) */
|
int ty_status; /* status flags (see below for defines) */
|
||||||
char *ty_window; /* command to start up window manager */
|
char *ty_window; /* command to start up window manager */
|
||||||
char *ty_comment; /* usually the location of the terminal */
|
char *ty_comment; /* usually the location of the terminal */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define TTY_ON 0x1 /* enable logins (startup getty) */
|
#define TTY_ON 0x1 /* enable logins (startup getty) */
|
||||||
#define TTY_SECURE 0x2 /* allow root to login */
|
#define TTY_SECURE 0x2 /* allow root to login */
|
||||||
|
|
||||||
struct ttyent *getttyent (void);
|
struct ttyent *getttyent (void);
|
||||||
struct ttyent *getttynam (const char *name);
|
struct ttyent *getttynam (const char *name);
|
||||||
|
|||||||
110
include/tzfile.h
110
include/tzfile.h
@@ -1,35 +1,34 @@
|
|||||||
/*
|
/*
|
||||||
* @(#)tzfile.h 5.2.1 (2.11BSD) 1996/11/29
|
* @(#)tzfile.h 5.2.1 (2.11BSD) 1996/11/29
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Information about time zone files.
|
** Information about time zone files.
|
||||||
*/
|
*/
|
||||||
|
/* Time zone object file directory */
|
||||||
/* Time zone object file directory */
|
#define TZDIR "/usr/share/zoneinfo"
|
||||||
#define TZDEFAULT "/etc/localtime"
|
#define TZDEFAULT "/etc/localtime"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Each file begins with. . .
|
** Each file begins with. . .
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct tzhead {
|
struct tzhead {
|
||||||
char tzh_reserved[32]; /* reserved for future use */
|
char tzh_reserved[32]; /* reserved for future use */
|
||||||
char tzh_timecnt[4]; /* coded number of transition times */
|
char tzh_timecnt[4]; /* coded number of transition times */
|
||||||
char tzh_typecnt[4]; /* coded number of local time types */
|
char tzh_typecnt[4]; /* coded number of local time types */
|
||||||
char tzh_charcnt[4]; /* coded number of abbr. chars */
|
char tzh_charcnt[4]; /* coded number of abbr. chars */
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** . . .followed by. . .
|
** . . .followed by. . .
|
||||||
**
|
**
|
||||||
** tzh_timecnt (char [4])s coded transition times a la time(2)
|
** tzh_timecnt (char [4])s coded transition times a la time(2)
|
||||||
** tzh_timecnt (unsigned char)s types of local time starting at above
|
** tzh_timecnt (unsigned char)s types of local time starting at above
|
||||||
** tzh_typecnt repetitions of
|
** tzh_typecnt repetitions of
|
||||||
** one (char [4]) coded GMT offset in seconds
|
** one (char [4]) coded GMT offset in seconds
|
||||||
** one (unsigned char) used to set tm_isdt
|
** one (unsigned char) used to set tm_isdt
|
||||||
** one (unsigned char) that's an abbreviation list index
|
** one (unsigned char) that's an abbreviation list index
|
||||||
** tzh_charcnt (char)s '\0'-terminated zone abbreviaton strings
|
** tzh_charcnt (char)s '\0'-terminated zone abbreviaton strings
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -43,58 +42,57 @@ struct tzhead {
|
|||||||
** 138 years of Pacific Presidential Election time
|
** 138 years of Pacific Presidential Election time
|
||||||
** (where there are three time zone transitions every fourth year).
|
** (where there are three time zone transitions every fourth year).
|
||||||
*/
|
*/
|
||||||
#define TZ_MAX_TIMES 370
|
#define TZ_MAX_TIMES 370
|
||||||
|
|
||||||
#define NOSOLAR /* We currently don't handle solar time */
|
#define NOSOLAR /* We currently don't handle solar time */
|
||||||
|
|
||||||
#ifndef NOSOLAR
|
#ifndef NOSOLAR
|
||||||
#define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */
|
#define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */
|
||||||
#else /* !NOSOLAR */
|
#else /* !NOSOLAR */
|
||||||
#define TZ_MAX_TYPES 10 /* Maximum number of local time types */
|
#define TZ_MAX_TYPES 10 /* Maximum number of local time types */
|
||||||
#endif /* !NOSOLAR */
|
#endif /* !NOSOLAR */
|
||||||
|
|
||||||
#define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */
|
#define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */
|
||||||
|
|
||||||
#define SECS_PER_MIN 60
|
#define SECS_PER_MIN 60
|
||||||
#define MINS_PER_HOUR 60
|
#define MINS_PER_HOUR 60
|
||||||
#define HOURS_PER_DAY 24
|
#define HOURS_PER_DAY 24
|
||||||
#define DAYS_PER_WEEK 7
|
#define DAYS_PER_WEEK 7
|
||||||
#define DAYS_PER_NYEAR 365
|
#define DAYS_PER_NYEAR 365
|
||||||
#define DAYS_PER_LYEAR 366
|
#define DAYS_PER_LYEAR 366
|
||||||
#define SECS_PER_HOUR (SECS_PER_MIN * MINS_PER_HOUR)
|
#define SECS_PER_HOUR (SECS_PER_MIN * MINS_PER_HOUR)
|
||||||
#define SECS_PER_DAY ((long) SECS_PER_HOUR * HOURS_PER_DAY)
|
#define SECS_PER_DAY ((long) SECS_PER_HOUR * HOURS_PER_DAY)
|
||||||
#define MONS_PER_YEAR 12
|
#define MONS_PER_YEAR 12
|
||||||
|
|
||||||
#define TM_SUNDAY 0
|
#define TM_SUNDAY 0
|
||||||
#define TM_MONDAY 1
|
#define TM_MONDAY 1
|
||||||
#define TM_TUESDAY 2
|
#define TM_TUESDAY 2
|
||||||
#define TM_WEDNESDAY 3
|
#define TM_WEDNESDAY 3
|
||||||
#define TM_THURSDAY 4
|
#define TM_THURSDAY 4
|
||||||
#define TM_FRIDAY 5
|
#define TM_FRIDAY 5
|
||||||
#define TM_SATURDAY 6
|
#define TM_SATURDAY 6
|
||||||
|
|
||||||
#define TM_JANUARY 0
|
#define TM_JANUARY 0
|
||||||
#define TM_FEBRUARY 1
|
#define TM_FEBRUARY 1
|
||||||
#define TM_MARCH 2
|
#define TM_MARCH 2
|
||||||
#define TM_APRIL 3
|
#define TM_APRIL 3
|
||||||
#define TM_MAY 4
|
#define TM_MAY 4
|
||||||
#define TM_JUNE 5
|
#define TM_JUNE 5
|
||||||
#define TM_JULY 6
|
#define TM_JULY 6
|
||||||
#define TM_AUGUST 7
|
#define TM_AUGUST 7
|
||||||
#define TM_SEPTEMBER 8
|
#define TM_SEPTEMBER 8
|
||||||
#define TM_OCTOBER 9
|
#define TM_OCTOBER 9
|
||||||
#define TM_NOVEMBER 10
|
#define TM_NOVEMBER 10
|
||||||
#define TM_DECEMBER 11
|
#define TM_DECEMBER 11
|
||||||
#define TM_SUNDAY 0
|
#define TM_SUNDAY 0
|
||||||
|
|
||||||
#define TM_YEAR_BASE 1900
|
#define TM_YEAR_BASE 1900
|
||||||
|
|
||||||
#define EPOCH_YEAR 1970
|
#define EPOCH_YEAR 1970
|
||||||
#define EPOCH_WDAY TM_THURSDAY
|
#define EPOCH_WDAY TM_THURSDAY
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** Accurate only for the past couple of centuries;
|
** Accurate only for the past couple of centuries;
|
||||||
** that will probably do.
|
** that will probably do.
|
||||||
*/
|
*/
|
||||||
|
#define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)
|
||||||
#define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)
|
|
||||||
|
|||||||
204
include/unistd.h
204
include/unistd.h
@@ -1,6 +1,6 @@
|
|||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1991, 1993, 1994
|
* Copyright (c) 1991, 1993, 1994
|
||||||
* The Regents of the University of California. All rights reserved.
|
* The Regents of the University of California. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@@ -12,8 +12,8 @@
|
|||||||
* documentation and/or other materials provided with the distribution.
|
* documentation and/or other materials provided with the distribution.
|
||||||
* 3. All advertising materials mentioning features or use of this software
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
* must display the following acknowledgement:
|
* must display the following acknowledgement:
|
||||||
* This product includes software developed by the University of
|
* This product includes software developed by the University of
|
||||||
* California, Berkeley and its contributors.
|
* California, Berkeley and its contributors.
|
||||||
* 4. Neither the name of the University nor the names of its contributors
|
* 4. Neither the name of the University nor the names of its contributors
|
||||||
* may be used to endorse or promote products derived from this software
|
* may be used to endorse or promote products derived from this software
|
||||||
* without specific prior written permission.
|
* without specific prior written permission.
|
||||||
@@ -38,109 +38,125 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _UNISTD_H_
|
#ifndef _UNISTD_H_
|
||||||
#define _UNISTD_H_
|
#define _UNISTD_H_
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#define STDIN_FILENO 0 /* standard input file descriptor */
|
#define STDIN_FILENO 0 /* standard input file descriptor */
|
||||||
#define STDOUT_FILENO 1 /* standard output file descriptor */
|
#define STDOUT_FILENO 1 /* standard output file descriptor */
|
||||||
#define STDERR_FILENO 2 /* standard error file descriptor */
|
#define STDERR_FILENO 2 /* standard error file descriptor */
|
||||||
|
|
||||||
#ifndef NULL
|
#ifndef NULL
|
||||||
#define NULL 0 /* null pointer constant */
|
#define NULL 0 /* null pointer constant */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Values for the second argument to access.
|
/* Values for the second argument to access.
|
||||||
These may be OR'd together. */
|
These may be OR'd together. */
|
||||||
#define R_OK 4 /* Test for read permission. */
|
#define R_OK 4 /* Test for read permission. */
|
||||||
#define W_OK 2 /* Test for write permission. */
|
#define W_OK 2 /* Test for write permission. */
|
||||||
#define X_OK 1 /* Test for execute permission. */
|
#define X_OK 1 /* Test for execute permission. */
|
||||||
#define F_OK 0 /* Test for existence. */
|
#define F_OK 0 /* Test for existence. */
|
||||||
|
|
||||||
void _exit (int);
|
void _exit(int);
|
||||||
int access();
|
int access();
|
||||||
unsigned int alarm();
|
unsigned int alarm();
|
||||||
pid_t fork();
|
pid_t fork();
|
||||||
gid_t getegid();
|
pid_t setsid(void);
|
||||||
uid_t geteuid();
|
gid_t getegid();
|
||||||
gid_t getgid();
|
uid_t geteuid();
|
||||||
char *getlogin();
|
gid_t getgid();
|
||||||
pid_t getpgrp();
|
char *getlogin();
|
||||||
pid_t getpid();
|
int setlogin(const char *name);
|
||||||
pid_t getppid();
|
pid_t getpgrp();
|
||||||
uid_t getuid();
|
pid_t getpid();
|
||||||
off_t lseek();
|
pid_t getppid();
|
||||||
ssize_t read();
|
uid_t getuid();
|
||||||
unsigned int sleep();
|
off_t lseek();
|
||||||
char *ttyname();
|
ssize_t read();
|
||||||
ssize_t write (int fd, const void *buf, size_t count);
|
unsigned int sleep();
|
||||||
int truncate (const char *path, off_t length);
|
char *ttyname();
|
||||||
int ftruncate (int fd, off_t length);
|
ssize_t write(int fd, const void *buf, size_t count);
|
||||||
|
int truncate(const char *path, off_t length);
|
||||||
|
int ftruncate(int fd, off_t length);
|
||||||
|
|
||||||
void *brk (const void *addr);
|
void *brk(const void *addr);
|
||||||
int _brk (const void *addr);
|
int _brk(const void *addr);
|
||||||
char *crypt();
|
char *crypt();
|
||||||
void endusershell();
|
void endusershell();
|
||||||
long gethostid();
|
long gethostid();
|
||||||
char *getpass();
|
char *getpass();
|
||||||
char *getusershell();
|
char *getusershell();
|
||||||
char *getwd();
|
char *getwd();
|
||||||
void psignal();
|
void psignal();
|
||||||
extern char *sys_siglist[];
|
extern char *sys_siglist[];
|
||||||
char *re_comp();
|
char *re_comp();
|
||||||
void *sbrk (int incr);
|
void *sbrk(int incr);
|
||||||
int sethostid();
|
int sethostid();
|
||||||
void setusershell();
|
void setusershell();
|
||||||
void sync();
|
void sync(void);
|
||||||
unsigned int ualarm();
|
unsigned int ualarm();
|
||||||
void usleep();
|
void usleep();
|
||||||
int pause (void);
|
int pause(void);
|
||||||
pid_t vfork();
|
pid_t vfork();
|
||||||
|
|
||||||
int pipe (int pipefd[2]);
|
int pipe(int pipefd[2]);
|
||||||
int close (int fd);
|
int close(int fd);
|
||||||
int dup (int oldfd);
|
int dup(int oldfd);
|
||||||
int dup2 (int oldfd, int newfd);
|
int dup2(int oldfd, int newfd);
|
||||||
int unlink (const char *pathname);
|
int unlink(const char *pathname);
|
||||||
int link (const char *oldpath, const char *newpath);
|
int link(const char *oldpath, const char *newpath);
|
||||||
ssize_t readlink (const char *path, char *buf, size_t bufsiz);
|
ssize_t readlink(const char *path, char *buf, size_t bufsiz);
|
||||||
int chown (const char *path, uid_t owner, gid_t group);
|
int chown(const char *path, uid_t owner, gid_t group);
|
||||||
int nice (int inc);
|
int fchown(int fd, uid_t owner, gid_t group);
|
||||||
int setuid (uid_t uid);
|
int nice(int inc);
|
||||||
int setgid (gid_t gid);
|
int setuid(uid_t uid);
|
||||||
int seteuid (uid_t euid);
|
int setgid(gid_t gid);
|
||||||
int setegid (gid_t egid);
|
int seteuid(uid_t euid);
|
||||||
int setreuid (uid_t ruid, uid_t euid);
|
int setegid(gid_t egid);
|
||||||
int setregid (gid_t rgid, gid_t egid);
|
int setreuid(uid_t ruid, uid_t euid);
|
||||||
int isatty (int fd);
|
int setregid(gid_t rgid, gid_t egid);
|
||||||
int chdir (const char *path);
|
int setpgrp(void);
|
||||||
int fchdir (int fd);
|
int isatty(int fd);
|
||||||
int chflags (const char *path, u_long flags);
|
int chdir(const char *path);
|
||||||
int fchflags (int fd, u_long flags);
|
int fchdir(int fd);
|
||||||
int getgroups (int size, gid_t list[]);
|
int chflags(const char *path, u_long flags);
|
||||||
int getdtablesize (void);
|
int fchflags(int fd, u_long flags);
|
||||||
int rmdir (const char *pathname);
|
int getgroups(int size, gid_t list[]);
|
||||||
|
int getdtablesize(void);
|
||||||
|
int rmdir(const char *pathname);
|
||||||
|
|
||||||
struct stat;
|
struct stat;
|
||||||
int stat (const char *path, struct stat *buf);
|
int stat(const char *path, struct stat *buf);
|
||||||
int fstat (int fd, struct stat *buf);
|
int fstat(int fd, struct stat *buf);
|
||||||
int lstat (const char *path, struct stat *buf);
|
int lstat(const char *path, struct stat *buf);
|
||||||
|
|
||||||
int execl (const char *path, const char *arg0, ... /* NULL */);
|
int execl(const char *path, const char *arg0, ... /* NULL */);
|
||||||
int execle (const char *path, const char *arg0, ... /* NULL, char *envp[] */);
|
int execle(const char *path, const char *arg0, ... /* NULL, char *envp[] */);
|
||||||
int execlp (const char *file, const char *arg0, ... /* NULL */);
|
int execlp(const char *file, const char *arg0, ... /* NULL */);
|
||||||
|
|
||||||
int execv (const char *path, char *const argv[]);
|
int execv(const char *path, char *const argv[]);
|
||||||
int execve (const char *path, char *const arg0[], char *const envp[]);
|
int execve(const char *path, char *const arg0[], char *const envp[]);
|
||||||
int execvp (const char *file, char *const argv[]);
|
int execvp(const char *file, char *const argv[]);
|
||||||
|
|
||||||
extern char **environ; /* Environment, from crt0. */
|
extern char **environ; /* Environment, from crt0. */
|
||||||
extern const char *__progname; /* Program name, from crt0. */
|
extern const char *__progname; /* Program name, from crt0. */
|
||||||
|
|
||||||
int getopt (int argc, char * const argv[], const char *optstring);
|
int getopt(int argc, char * const argv[], const char *optstring);
|
||||||
|
|
||||||
extern char *optarg; /* getopt(3) external variables */
|
extern char *optarg; /* getopt(3) external variables */
|
||||||
extern int opterr, optind, optopt;
|
extern int opterr, optind, optopt;
|
||||||
|
|
||||||
|
int gethostname(char *name, int namelen);
|
||||||
|
int sethostname(char *name, int namelen);
|
||||||
|
|
||||||
|
int chroot(const char *path);
|
||||||
|
int fsync(int fd);
|
||||||
|
int getpagesize(void);
|
||||||
|
int symlink(const char *target, const char *linkpath);
|
||||||
|
int vhangup(void);
|
||||||
|
int mknod(const char *, mode_t, dev_t);
|
||||||
|
int reboot(int howto);
|
||||||
|
int ttyslot(void);
|
||||||
|
|
||||||
#ifndef _VA_LIST_
|
#ifndef _VA_LIST_
|
||||||
# ifdef __GNUC__
|
# ifdef __GNUC__
|
||||||
@@ -151,14 +167,14 @@ extern int opterr, optind, optopt;
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void err (int eval, const char *fmt, ...);
|
void err(int eval, const char *fmt, ...);
|
||||||
void errx (int eval, const char *fmt, ...);
|
void errx(int eval, const char *fmt, ...);
|
||||||
void warn (const char *fmt, ...);
|
void warn(const char *fmt, ...);
|
||||||
void warnx (const char *fmt, ...);
|
void warnx(const char *fmt, ...);
|
||||||
void verr (int eval, const char *fmt, va_list ap);
|
void verr(int eval, const char *fmt, va_list ap);
|
||||||
void verrx (int eval, const char *fmt, va_list ap);
|
void verrx(int eval, const char *fmt, va_list ap);
|
||||||
void vwarn (const char *fmt, va_list ap);
|
void vwarn(const char *fmt, va_list ap);
|
||||||
void vwarnx (const char *fmt, va_list ap);
|
void vwarnx(const char *fmt, va_list ap);
|
||||||
|
|
||||||
#ifndef _VA_LIST_
|
#ifndef _VA_LIST_
|
||||||
# undef va_list
|
# undef va_list
|
||||||
|
|||||||
@@ -15,13 +15,15 @@
|
|||||||
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define UT_NAMESIZE 15
|
#define UT_NAMESIZE 15
|
||||||
#define UT_LINESIZE 8
|
#define UT_LINESIZE 8
|
||||||
#define UT_HOSTSIZE 16
|
#define UT_HOSTSIZE 16
|
||||||
|
|
||||||
struct utmp {
|
struct utmp {
|
||||||
char ut_line[UT_LINESIZE];
|
char ut_line[UT_LINESIZE];
|
||||||
char ut_name[UT_NAMESIZE];
|
char ut_name[UT_NAMESIZE];
|
||||||
char ut_host[UT_HOSTSIZE];
|
char ut_host[UT_HOSTSIZE];
|
||||||
long ut_time;
|
long ut_time;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void login(struct utmp *ut);
|
||||||
|
|||||||
@@ -2,63 +2,62 @@
|
|||||||
* Author: S.M. Schultz
|
* Author: S.M. Schultz
|
||||||
*
|
*
|
||||||
* ----------- Modification History ------------
|
* ----------- Modification History ------------
|
||||||
* Version Date Reason For Modification
|
* Version Date Reason For Modification
|
||||||
* 1.0 01Jan80 1. Initial release.
|
* 1.0 01Jan80 1. Initial release.
|
||||||
* 2.0 31Mar83 2. Cleanup.
|
* 2.0 31Mar83 2. Cleanup.
|
||||||
* 3.0 08Sep93 3. Change v_foffset to off_t instead of int.
|
* 3.0 08Sep93 3. Change v_foffset to off_t instead of int.
|
||||||
* 3.1 21Oct93 4. Create union member of structure to
|
* 3.1 21Oct93 4. Create union member of structure to
|
||||||
* make 'int' or 'char' access to data easy.
|
* make 'int' or 'char' access to data easy.
|
||||||
* Define segment+offset and modified macros.
|
* Define segment+offset and modified macros.
|
||||||
* Place into the public domain.
|
* Place into the public domain.
|
||||||
* --------------------------------------------------
|
* --------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#define MAXSEGNO 16384 /* max number of segments in a space */
|
#define MAXSEGNO 16384 /* max number of segments in a space */
|
||||||
#define BYTESPERSEG 1024 /* must be power of two! */
|
#define BYTESPERSEG 1024 /* must be power of two! */
|
||||||
#define LOG2BPS 10 /* log2(BYTESPERSEG) */
|
#define LOG2BPS 10 /* log2(BYTESPERSEG) */
|
||||||
#define WORDSPERSEG (BYTESPERSEG/sizeof (int))
|
#define WORDSPERSEG (BYTESPERSEG/sizeof (int))
|
||||||
|
|
||||||
struct vspace {
|
struct vspace {
|
||||||
int v_fd; /* file for swapping */
|
int v_fd; /* file for swapping */
|
||||||
off_t v_foffset; /* offset for computing file addresses */
|
off_t v_foffset; /* offset for computing file addresses */
|
||||||
int v_maxsegno; /* number of segments in this space */
|
int v_maxsegno; /* number of segments in this space */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct dlink { /* general double link structure */
|
struct dlink { /* general double link structure */
|
||||||
struct dlink *fwd; /* forward link */
|
struct dlink *fwd; /* forward link */
|
||||||
struct dlink *back; /* back link */
|
struct dlink *back; /* back link */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct vseg { /* structure of a segment in memory */
|
struct vseg { /* structure of a segment in memory */
|
||||||
struct dlink s_link; /* for linking into lru list */
|
struct dlink s_link; /* for linking into lru list */
|
||||||
int s_segno; /* segment number */
|
int s_segno; /* segment number */
|
||||||
struct vspace *s_vspace; /* which virtual space */
|
struct vspace *s_vspace; /* which virtual space */
|
||||||
int s_lock_count;
|
int s_lock_count;
|
||||||
int s_flags;
|
int s_flags;
|
||||||
union
|
union {
|
||||||
{
|
int _winfo[WORDSPERSEG]; /* the actual segment */
|
||||||
int _winfo[WORDSPERSEG]; /* the actual segment */
|
char _cinfo[BYTESPERSEG];
|
||||||
char _cinfo[BYTESPERSEG];
|
} v_un;
|
||||||
} v_un;
|
};
|
||||||
};
|
|
||||||
|
|
||||||
#define s_winfo v_un._winfo
|
#define s_winfo v_un._winfo
|
||||||
#define s_cinfo v_un._cinfo
|
#define s_cinfo v_un._cinfo
|
||||||
|
|
||||||
/* masks for s_flags */
|
/* masks for s_flags */
|
||||||
#define S_DIRTY 01 /* segment has been modified */
|
#define S_DIRTY 01 /* segment has been modified */
|
||||||
|
|
||||||
long nswaps; /* number of swaps */
|
extern long nswaps; /* number of swaps */
|
||||||
long nmapsegs; /* number of mapseg calls */
|
extern long nmapsegs; /* number of mapseg calls */
|
||||||
|
|
||||||
int vminit(), vmopen();
|
int vminit(), vmopen();
|
||||||
struct vseg *vmmapseg();
|
struct vseg *vmmapseg();
|
||||||
void vmlock(), vmunlock(), vmclrseg(), vmmodify();
|
void vmlock(), vmunlock(), vmclrseg(), vmmodify();
|
||||||
void vmflush(), vmclose();
|
void vmflush(), vmclose();
|
||||||
|
|
||||||
typedef long VADDR;
|
typedef long VADDR;
|
||||||
#define VMMODIFY(seg) (seg->s_flags |= S_DIRTY)
|
|
||||||
#define VSEG(va) ((short)(va >> LOG2BPS))
|
#define VMMODIFY(seg) (seg->s_flags |= S_DIRTY)
|
||||||
#define VOFF(va) ((u_short)va % BYTESPERSEG)
|
#define VSEG(va) ((short)(va >> LOG2BPS))
|
||||||
|
#define VOFF(va) ((u_short)va % BYTESPERSEG)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#ifndef _SOCKET_H_
|
#ifndef _SOCKET_H_
|
||||||
#define _SOCKET_H_
|
#define _SOCKET_H_
|
||||||
|
|
||||||
#include "w5100.h"
|
#include "w5100.h"
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
* Updated August/3/2011 by Lowell Scott Hanson to be compatable with chipKIT boards
|
* Updated August/3/2011 by Lowell Scott Hanson to be compatable with chipKIT boards
|
||||||
* Updated April/13/2012 by Serge Vakulenko for RetroBSD project
|
* Updated April/13/2012 by Serge Vakulenko for RetroBSD project
|
||||||
*/
|
*/
|
||||||
#ifndef W5100_H_INCLUDED
|
#ifndef W5100_H_INCLUDED
|
||||||
#define W5100_H_INCLUDED
|
#define W5100_H_INCLUDED
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
|||||||
20
lib/Makefile
20
lib/Makefile
@@ -1,21 +1,11 @@
|
|||||||
TOPSRC = $(shell cd ..; pwd)
|
TOPSRC = $(shell cd ..; pwd)
|
||||||
SUBDIR = startup libc libcurses libtermlib libwiznet
|
SUBDIR = startup libc libm libcurses libtermlib libwiznet libreadline libgpanel
|
||||||
PROG = ar as aout ld nm ranlib size strip
|
PROG = ar as aout ld nm ranlib size strip
|
||||||
|
|
||||||
# Build a list of the host include directories.
|
CFLAGS = -Os -std=gnu89 -fno-builtin -g -Werror -Wall -DCROSS -I. \
|
||||||
CPP = $(shell gcc -print-prog-name=cc1)
|
-idirafter $(TOPSRC)/include \
|
||||||
HOSTINC = $(addprefix -I,$(shell echo | $(CPP) -v 2>&1 | grep '^ /.*include'))
|
-idirafter $(TOPSRC)/src/cmd/ar \
|
||||||
|
-idirafter $(TOPSRC)/src/cmd/as
|
||||||
# Add system include path
|
|
||||||
ifeq (,$(wildcard /usr/include/i386-linux-gnu))
|
|
||||||
HOSTINC += -I/usr/include
|
|
||||||
else
|
|
||||||
HOSTINC += -I/usr/include/i386-linux-gnu
|
|
||||||
endif
|
|
||||||
|
|
||||||
CFLAGS += -nostdinc -fno-builtin -g -Werror -Wall -DCROSS -I. $(HOSTINC) \
|
|
||||||
-I$(TOPSRC)/include -I$(TOPSRC)/src/cmd/ar \
|
|
||||||
-I$(TOPSRC)/src/cmd/as
|
|
||||||
LDFLAGS += -g
|
LDFLAGS += -g
|
||||||
|
|
||||||
AR_OBJS = ar.o append.o archive.o contents.o delete.o extract.o \
|
AR_OBJS = ar.o append.o archive.o contents.o delete.o extract.o \
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ vpath %.c $(LIBCDIR)/mips/sys $(LIBCDIR)/gen $(LIBCDIR)/stdio \
|
|||||||
$(LIBCDIR)/stdlib $(LIBCDIR)/string $(LIBCDIR)/inet \
|
$(LIBCDIR)/stdlib $(LIBCDIR)/string $(LIBCDIR)/inet \
|
||||||
$(LIBCDIR)/compat $(LIBCDIR)/runtime
|
$(LIBCDIR)/compat $(LIBCDIR)/runtime
|
||||||
|
|
||||||
CFLAGS += -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
CFLAGS = -Os -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
||||||
ASFLAGS += -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -I$(LIBCDIR)/mips/sys
|
ASFLAGS += -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -I$(LIBCDIR)/mips/sys
|
||||||
|
|
||||||
# modules which can not use SYSCALL and must be assembled from sources. The
|
# modules which can not use SYSCALL and must be assembled from sources. The
|
||||||
@@ -87,15 +87,16 @@ OBJS += inet_addr.o inet_network.o inet_netof.o \
|
|||||||
inet_ntoa.o inet_lnaof.o inet_maddr.o
|
inet_ntoa.o inet_lnaof.o inet_maddr.o
|
||||||
|
|
||||||
# libc/compat
|
# libc/compat
|
||||||
OBJS += creat.o ftime.o gethostid.o gtty.o memccpy.o memchr.o \
|
OBJS += creat.o ftime.o gethostid.o memccpy.o memchr.o \
|
||||||
memcmp.o memcpy.o memset.o nice.o pause.o rand.o \
|
memcmp.o memcpy.o memset.o nice.o pause.o rand.o \
|
||||||
sethostid.o setregid.o setreuid.o setrgid.o setruid.o \
|
sethostid.o setregid.o setreuid.o setrgid.o setruid.o \
|
||||||
sigcompat.o strchr.o strrchr.o stty.o times.o tmpnam.o \
|
sigcompat.o strchr.o strrchr.o times.o tmpnam.o \
|
||||||
utime.o
|
utime.o
|
||||||
|
|
||||||
# libc/runtime
|
# libc/runtime
|
||||||
OBJS += addsf3.o comparesf2.o divsf3.o fixsfsi.o floatsisf.o \
|
OBJS += addsf3.o comparesf2.o divsf3.o fixsfsi.o floatsisf.o \
|
||||||
mulsf3.o negsf2.o subsf3.o sc_case.o
|
mulsf3.o negsf2.o subsf3.o sc_case.o fixunssfsi.o \
|
||||||
|
floatunsisf.o
|
||||||
|
|
||||||
all: ../libc.a
|
all: ../libc.a
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ include $(TOPSRC)/target.mk
|
|||||||
|
|
||||||
vpath %.c $(TOPSRC)/src/libcurses
|
vpath %.c $(TOPSRC)/src/libcurses
|
||||||
|
|
||||||
CFLAGS += -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
CFLAGS = -Os -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
||||||
|
|
||||||
OBJS = addch.o addstr.o box.o clear.o clrtobot.o clrtoeol.o cr_put.o \
|
OBJS = addch.o addstr.o box.o clear.o clrtobot.o clrtoeol.o cr_put.o \
|
||||||
cr_tty.o curses.o delch.o deleteln.o delwin.o endwin.o erase.o \
|
cr_tty.o curses.o delch.o deleteln.o delwin.o endwin.o erase.o \
|
||||||
|
|||||||
18
lib/libgpanel/Makefile
Normal file
18
lib/libgpanel/Makefile
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
TOPSRC = $(shell cd ../..; pwd)
|
||||||
|
include $(TOPSRC)/target.mk
|
||||||
|
|
||||||
|
vpath %.c $(TOPSRC)/src/libgpanel
|
||||||
|
|
||||||
|
CFLAGS = -Os -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
||||||
|
|
||||||
|
OBJS = open.o clear.o pixel.o line.o rect.o fill.o fill_triangle.o \
|
||||||
|
circle.o image.o char.o text.o text_width.o
|
||||||
|
|
||||||
|
all: ../libgpanel.a
|
||||||
|
|
||||||
|
../libgpanel.a: ../ar ../ranlib $(OBJS)
|
||||||
|
../ar rc $@ $(OBJS)
|
||||||
|
../ranlib $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *~ *.o a.out *.a
|
||||||
18
lib/libm/Makefile
Normal file
18
lib/libm/Makefile
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
TOPSRC = $(shell cd ../..; pwd)
|
||||||
|
include $(TOPSRC)/target.mk
|
||||||
|
|
||||||
|
vpath %.c $(TOPSRC)/src/libm
|
||||||
|
|
||||||
|
CFLAGS = -Os -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
||||||
|
|
||||||
|
OBJS = asin.o atan.o exp.o erf.o floor.o fmod.o hypot.o j0.o j1.o \
|
||||||
|
jn.o log.o pow.o sin.o sinh.o sqrt.o tan.o tanh.o
|
||||||
|
|
||||||
|
all: ../libm.a
|
||||||
|
|
||||||
|
../libm.a: ../ar ../ranlib $(OBJS)
|
||||||
|
../ar rc $@ $(OBJS)
|
||||||
|
../ranlib $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *~ *.o a.out *.a
|
||||||
17
lib/libreadline/Makefile
Normal file
17
lib/libreadline/Makefile
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
TOPSRC = $(shell cd ../..; pwd)
|
||||||
|
include $(TOPSRC)/target.mk
|
||||||
|
|
||||||
|
vpath %.c $(TOPSRC)/src/libreadline
|
||||||
|
|
||||||
|
CFLAGS = -Os -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
||||||
|
|
||||||
|
OBJS = readline.o
|
||||||
|
|
||||||
|
all: ../libreadline.a
|
||||||
|
|
||||||
|
../libreadline.a: ../ar ../ranlib $(OBJS)
|
||||||
|
../ar rc $@ $(OBJS)
|
||||||
|
../ranlib $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *~ *.o a.out *.a
|
||||||
@@ -3,7 +3,7 @@ include $(TOPSRC)/target.mk
|
|||||||
|
|
||||||
vpath %.c $(TOPSRC)/src/libtermlib
|
vpath %.c $(TOPSRC)/src/libtermlib
|
||||||
|
|
||||||
CFLAGS += -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
CFLAGS = -Os -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
||||||
|
|
||||||
OBJS = termcap.o tgoto.o tputs.o tcattr.o
|
OBJS = termcap.o tgoto.o tputs.o tcattr.o
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ include $(TOPSRC)/target.mk
|
|||||||
|
|
||||||
vpath %.c $(TOPSRC)/src/libwiznet
|
vpath %.c $(TOPSRC)/src/libwiznet
|
||||||
|
|
||||||
CFLAGS += -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
CFLAGS = -Os -B$(TOPSRC)/lib/ $(DEFS) -Wa,-x -Wall -Werror
|
||||||
|
|
||||||
OBJS = w5100.o socket.o ethernet.o client.o server.o udp.o
|
OBJS = w5100.o socket.o ethernet.o client.o server.o udp.o
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ TOPSRC = $(shell cd ../..; pwd)
|
|||||||
include $(TOPSRC)/target.mk
|
include $(TOPSRC)/target.mk
|
||||||
vpath %.c $(TOPSRC)/src/startup-mips
|
vpath %.c $(TOPSRC)/src/startup-mips
|
||||||
|
|
||||||
CFLAGS = -B$(TOPSRC)/lib/ -O -Wa,-x $(DEFS)
|
CFLAGS = -Os -B$(TOPSRC)/lib/ -fno-integrated-as -Xassembler -x $(DEFS)
|
||||||
|
|
||||||
OBJS = ../crt0.o
|
OBJS = ../crt0.o
|
||||||
|
|
||||||
|
|||||||
7
root/.profile
Normal file
7
root/.profile
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
echo 'erase ^?, kill ^U, intr ^C'
|
||||||
|
stty dec
|
||||||
|
PATH=/bin:/sbin:/etc
|
||||||
|
export PATH
|
||||||
|
HOME=/
|
||||||
|
export HOME
|
||||||
|
export TERM
|
||||||
2128
rootfs.manifest
2128
rootfs.manifest
File diff suppressed because it is too large
Load Diff
8
share/.gitignore
vendored
8
share/.gitignore
vendored
@@ -1,4 +1,6 @@
|
|||||||
re.help
|
calendar
|
||||||
misc
|
|
||||||
unixbench
|
|
||||||
emg.keys
|
emg.keys
|
||||||
|
misc
|
||||||
|
re.help
|
||||||
|
unixbench
|
||||||
|
zoneinfo
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
|
|
||||||
all: ashello echo chello stdarg skeleton
|
|
||||||
|
|
||||||
ashello: ashello.o
|
|
||||||
$(LD) ashello.o -o $@
|
|
||||||
|
|
||||||
chello: chello.o
|
|
||||||
$(CC) chello.o -o $@
|
|
||||||
|
|
||||||
echo: echo.o
|
|
||||||
$(LD) $@.o -o $@
|
|
||||||
|
|
||||||
stdarg: stdarg.o
|
|
||||||
$(CC) stdarg.o -o $@
|
|
||||||
|
|
||||||
skeleton: skeleton.o
|
|
||||||
$(CC) skeleton.o -o $@
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.o ashello echo chello stdarg skeleton *.dis *~
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
TOPSRC = $(shell cd ../..; pwd)
|
|
||||||
include $(TOPSRC)/target.mk
|
|
||||||
|
|
||||||
CFLAGS += -Werror
|
|
||||||
ASFLAGS += -DCROSS
|
|
||||||
ASLDFLAGS = --oformat=elf32-tradlittlemips -N -nostartfiles -T $(TOPSRC)/src/elf32-mips.ld
|
|
||||||
|
|
||||||
all: chello cplus echo stdarg
|
|
||||||
|
|
||||||
chello: chello.o
|
|
||||||
${CC} ${LDFLAGS} -o chello.elf chello.o ${LIBS}
|
|
||||||
${OBJDUMP} -S chello.elf > chello.dis
|
|
||||||
${SIZE} chello.elf
|
|
||||||
${ELF2AOUT} chello.elf $@
|
|
||||||
|
|
||||||
cplus: cplus.o
|
|
||||||
${CXX} ${LDFLAGS} -nostdlib -o cplus.elf cplus.o ${LIBS}
|
|
||||||
${OBJDUMP} -S cplus.elf > cplus.dis
|
|
||||||
${SIZE} cplus.elf
|
|
||||||
${ELF2AOUT} cplus.elf $@
|
|
||||||
|
|
||||||
echo: echo.o
|
|
||||||
${LD} ${ASLDFLAGS} -o $@.elf $@.o
|
|
||||||
${OBJDUMP} -S $@.elf > $@.dis
|
|
||||||
${SIZE} $@.elf
|
|
||||||
${ELF2AOUT} $@.elf $@
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f *.o *.elf ${MAN} chello cplus echo stdarg *.elf *.dis tags *~
|
|
||||||
11
share/examples/asm/Makefile
Normal file
11
share/examples/asm/Makefile
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
all: ashello echo
|
||||||
|
|
||||||
|
ashello: ashello.o
|
||||||
|
$(LD) ashello.o -o $@
|
||||||
|
|
||||||
|
echo: echo.o
|
||||||
|
$(LD) $@.o -o $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *.o ashello echo *.dis *~
|
||||||
17
share/examples/asm/Makefile-host
Normal file
17
share/examples/asm/Makefile-host
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
TOPSRC = $(shell cd ../../..; pwd)
|
||||||
|
include $(TOPSRC)/target.mk
|
||||||
|
|
||||||
|
CFLAGS += -Werror
|
||||||
|
ASFLAGS += -DCROSS
|
||||||
|
ASLDFLAGS = --oformat=elf32-tradlittlemips -N -nostartfiles -T $(TOPSRC)/src/elf32-mips.ld
|
||||||
|
|
||||||
|
all: echo
|
||||||
|
|
||||||
|
echo: echo.o
|
||||||
|
${LD} ${ASLDFLAGS} -o $@.elf $@.o
|
||||||
|
${OBJDUMP} -S $@.elf > $@.dis
|
||||||
|
${SIZE} $@.elf
|
||||||
|
${ELF2AOUT} $@.elf $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *.o *.elf ${MAN} echo *.elf *.dis tags *~
|
||||||
50
share/examples/c/Makefile
Normal file
50
share/examples/c/Makefile
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
CC = cc
|
||||||
|
PROG = hello stdarg skeleton primelist primesum test1 test2 test3 \
|
||||||
|
gpio adc rain q8 tetris lcd6
|
||||||
|
|
||||||
|
all: $(PROG)
|
||||||
|
|
||||||
|
hello: hello.c
|
||||||
|
$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $?
|
||||||
|
|
||||||
|
stdarg: stdarg.c
|
||||||
|
$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $?
|
||||||
|
|
||||||
|
skeleton: skeleton.c
|
||||||
|
$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $?
|
||||||
|
|
||||||
|
primelist: primelist.c
|
||||||
|
$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $?
|
||||||
|
|
||||||
|
primesum: primesum.c
|
||||||
|
$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $?
|
||||||
|
|
||||||
|
gpio: gpio.c
|
||||||
|
$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $?
|
||||||
|
|
||||||
|
adc: adc.c
|
||||||
|
$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $?
|
||||||
|
|
||||||
|
rain: rain.c
|
||||||
|
$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $?
|
||||||
|
|
||||||
|
q8: q8.c
|
||||||
|
$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $?
|
||||||
|
|
||||||
|
tetris: tetris.c
|
||||||
|
$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $?
|
||||||
|
|
||||||
|
lcd6: lcd6.c
|
||||||
|
$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $?
|
||||||
|
|
||||||
|
test1: test1.c
|
||||||
|
$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $?
|
||||||
|
|
||||||
|
test2: test2.c
|
||||||
|
$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $?
|
||||||
|
|
||||||
|
test3: test3.c
|
||||||
|
$(CC) $(CFLAGS) -o $@ $(LDFLAGS) $?
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *.o *~ $(PROG)
|
||||||
27
share/examples/c/Makefile-host
Normal file
27
share/examples/c/Makefile-host
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
TOPSRC = $(shell cd ../../..; pwd)
|
||||||
|
include $(TOPSRC)/target.mk
|
||||||
|
|
||||||
|
CFLAGS += -Werror -Wall
|
||||||
|
|
||||||
|
all: chello stdarg lcd6
|
||||||
|
|
||||||
|
chello: chello.o
|
||||||
|
${CC} ${LDFLAGS} -o chello.elf chello.o ${LIBS}
|
||||||
|
${OBJDUMP} -S chello.elf > chello.dis
|
||||||
|
${SIZE} chello.elf
|
||||||
|
${ELF2AOUT} chello.elf $@
|
||||||
|
|
||||||
|
tetris: tetris.o
|
||||||
|
${CC} ${LDFLAGS} -o tetris.elf tetris.o ${LIBS}
|
||||||
|
${OBJDUMP} -S tetris.elf > tetris.dis
|
||||||
|
${SIZE} tetris.elf
|
||||||
|
${ELF2AOUT} tetris.elf $@
|
||||||
|
|
||||||
|
lcd6: lcd6.o
|
||||||
|
${CC} ${LDFLAGS} -o lcd6.elf lcd6.o ${LIBS}
|
||||||
|
${OBJDUMP} -S lcd6.elf > lcd6.dis
|
||||||
|
${SIZE} lcd6.elf
|
||||||
|
${ELF2AOUT} lcd6.elf $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *.o *.elf ${MAN} chello stdarg lcd6 *.elf *.dis tags *~
|
||||||
287
share/examples/c/lcd6.c
Normal file
287
share/examples/c/lcd6.c
Normal file
@@ -0,0 +1,287 @@
|
|||||||
|
/*
|
||||||
|
* Demo for 6 digit LCD module based on HT1261 controller.
|
||||||
|
* Based on example sources from http://www.canton-electronics.com
|
||||||
|
*
|
||||||
|
* Copyright (C) 2015 Serge Vakulenko
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and distribute this software
|
||||||
|
* and its documentation for any purpose and without fee is hereby
|
||||||
|
* granted, provided that the above copyright notice appear in all
|
||||||
|
* copies and that both that the copyright notice and this
|
||||||
|
* permission notice and warranty disclaimer appear in supporting
|
||||||
|
* documentation, and that the name of the author not be used in
|
||||||
|
* advertising or publicity pertaining to distribution of the
|
||||||
|
* software without specific, written prior permission.
|
||||||
|
*
|
||||||
|
* The author disclaim all warranties with regard to this
|
||||||
|
* software, including all implied warranties of merchantability
|
||||||
|
* and fitness. In no event shall the author be liable for any
|
||||||
|
* special, indirect or consequential damages or any damages
|
||||||
|
* whatsoever resulting from loss of use, data or profits, whether
|
||||||
|
* in an action of contract, negligence or other tortious action,
|
||||||
|
* arising out of or in connection with the use or performance of
|
||||||
|
* this software.
|
||||||
|
*/
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <sys/gpio.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Digits, decimal dots and battery levels:
|
||||||
|
* A B C D E F
|
||||||
|
* -- -- -- -- -- -- z
|
||||||
|
* | | | | | | | | | | | | y
|
||||||
|
* -- -- -- -- -- -- x
|
||||||
|
* | | | | | | | | | | | |
|
||||||
|
* -- -- -- c -- d -- e --
|
||||||
|
*
|
||||||
|
* Memory map:
|
||||||
|
* Byte 0, bits 0-6 - segments of digit 'F'
|
||||||
|
* Byte 0, bit 7 - decimal dot 'e'
|
||||||
|
* Byte 1, bits 0-6 - segments of digit 'E'
|
||||||
|
* Byte 1, bit 7 - decimal dot 'd'
|
||||||
|
* Byte 2, bits 0-6 - segments of digit 'D'
|
||||||
|
* Byte 2, bit 7 - decimal dot 'c'
|
||||||
|
* Byte 3, bits 0-6 - segments of digit 'C'
|
||||||
|
* Byte 3, bit 7 - battery level 'x'
|
||||||
|
* Byte 4, bits 0-6 - segments of digit 'B'
|
||||||
|
* Byte 4, bit 7 - battery level 'y'
|
||||||
|
* Byte 5, bits 0-6 - segments of digit 'A'
|
||||||
|
* Byte 5, bit 7 - battery level 'z'
|
||||||
|
*
|
||||||
|
* Segments are mapped to bits 0-6:
|
||||||
|
* --4--
|
||||||
|
* 0---5
|
||||||
|
* --1--
|
||||||
|
* 2---6
|
||||||
|
* --3--
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Signal assignment.
|
||||||
|
* LED modulee is connected to pins 16,17,18 of Fubarino SD board.
|
||||||
|
*
|
||||||
|
* Fubarino PIC32 LED module
|
||||||
|
* --------------------------
|
||||||
|
* 16 RE0 CS
|
||||||
|
* 17 RE1 WR
|
||||||
|
* 18 RE2 DATA
|
||||||
|
*/
|
||||||
|
#define gpio_cs_clear() ioctl(gpio, GPIO_PORTE | GPIO_CLEAR, 1 << 0)
|
||||||
|
#define gpio_cs_set() ioctl(gpio, GPIO_PORTE | GPIO_SET, 1 << 0)
|
||||||
|
#define gpio_wr_clear() ioctl(gpio, GPIO_PORTE | GPIO_CLEAR, 1 << 1)
|
||||||
|
#define gpio_wr_set() ioctl(gpio, GPIO_PORTE | GPIO_SET, 1 << 1)
|
||||||
|
#define gpio_data_clear() ioctl(gpio, GPIO_PORTE | GPIO_CLEAR, 1 << 2)
|
||||||
|
#define gpio_data_set() ioctl(gpio, GPIO_PORTE | GPIO_SET, 1 << 2)
|
||||||
|
|
||||||
|
/*
|
||||||
|
* HT1621 commands
|
||||||
|
*/
|
||||||
|
#define HT_SYS_DIS 0x00 /* Turn off system osc and bias generator */
|
||||||
|
#define HT_SYS_EN 0x01 /* Turn on system oscillator */
|
||||||
|
#define HT_LCD_OFF 0x02 /* Turn off LCD bias generator */
|
||||||
|
#define HT_LCD_ON 0x03 /* Turn on LCD bias generator */
|
||||||
|
#define HT_CLOCK_XTAL 0x14 /* Crystal 32kHz */
|
||||||
|
#define HT_CLOCK_RC 0x18 /* On-chip RC oscillator 256kHz */
|
||||||
|
#define HT_CLOCK_EXT 0x1c /* External clock */
|
||||||
|
#define HT_BIAS_1_3 0x21 /* LCD 1/3 bias option, 2 commons default */
|
||||||
|
#define HT_COMMONS_3 0x04 /* 3 commons option */
|
||||||
|
#define HT_COMMONS_4 0x08 /* 4 commons option */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Mapping of symbols to segments.
|
||||||
|
* 0, 1, 2, 3, 4, 5, 6, 7,
|
||||||
|
* 8, 9, A, b, C, c, d, E,
|
||||||
|
* F, H, h, L, n, N, o, P,
|
||||||
|
* r, t, U, -, ,
|
||||||
|
*/
|
||||||
|
const char char_to_segm[] = {
|
||||||
|
0x7D, 0x60, 0x3E, 0x7A, 0x63, 0x5B, 0x5F, 0x70,
|
||||||
|
0x7F, 0x7B, 0x77, 0x4F, 0x1D, 0x0E, 0x6E, 0x1F,
|
||||||
|
0x17, 0x67, 0x47, 0x0D, 0x46, 0x75, 0x37, 0x06,
|
||||||
|
0x0F, 0x6D, 0x02, 0x00,
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
* File descriptor for GPIO driver.
|
||||||
|
*/
|
||||||
|
int gpio;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Suspend the process for some amount of milliseconds.
|
||||||
|
*/
|
||||||
|
void mdelay(unsigned msec)
|
||||||
|
{
|
||||||
|
usleep(msec * 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Send a series of bits to HT1621.
|
||||||
|
* Up to 8 bits, high bit first.
|
||||||
|
* Max clock rate is 150kHz.
|
||||||
|
*/
|
||||||
|
void ht_send(int nbits, int data)
|
||||||
|
{
|
||||||
|
data <<= (8 - nbits);
|
||||||
|
gpio_wr_clear();
|
||||||
|
while (nbits-- > 0) {
|
||||||
|
if (data & 0x80)
|
||||||
|
gpio_data_set();
|
||||||
|
else
|
||||||
|
gpio_data_clear();
|
||||||
|
gpio_wr_set();
|
||||||
|
gpio_wr_clear();
|
||||||
|
data <<= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Send command to HT1621.
|
||||||
|
*/
|
||||||
|
void ht_cmd(int command)
|
||||||
|
{
|
||||||
|
gpio_cs_clear();
|
||||||
|
ht_send(3, 0x4); /* Mode "100" */
|
||||||
|
ht_send(8, command);
|
||||||
|
gpio_cs_set();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Send data and command.
|
||||||
|
*/
|
||||||
|
void ht_write(int addr, int data)
|
||||||
|
{
|
||||||
|
gpio_cs_clear();
|
||||||
|
ht_send(3, 0x5); /* Mode "101" */
|
||||||
|
ht_send(6, addr << 1); /* Half-byte address 6 bits */
|
||||||
|
ht_send(8, data); /* Data 8 bits */
|
||||||
|
gpio_cs_set();
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Initialize LCD controller.
|
||||||
|
*/
|
||||||
|
void lcd_init()
|
||||||
|
{
|
||||||
|
/* Open GPIO driver. */
|
||||||
|
gpio = open("/dev/porta", 1);
|
||||||
|
if (gpio < 0) {
|
||||||
|
perror("/dev/porta");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Configure pins RE0-RE2 as outputs. */
|
||||||
|
ioctl(gpio, GPIO_PORTE | GPIO_CONFOUT, 0x07);
|
||||||
|
gpio_cs_set();
|
||||||
|
gpio_wr_clear();
|
||||||
|
|
||||||
|
/* Setup appropriate HT1621 mode. */
|
||||||
|
ht_cmd(HT_SYS_EN);
|
||||||
|
ht_cmd(HT_CLOCK_RC);
|
||||||
|
ht_cmd(HT_BIAS_1_3 | HT_COMMONS_4);
|
||||||
|
ht_cmd(HT_LCD_ON);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set display memory to given value.
|
||||||
|
*/
|
||||||
|
void lcd_clear(int value)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i=0; i<6; i++) {
|
||||||
|
ht_write(i, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* LCD on/off.
|
||||||
|
*/
|
||||||
|
void lcd_enable(int on)
|
||||||
|
{
|
||||||
|
if (on)
|
||||||
|
ht_cmd(HT_LCD_ON);
|
||||||
|
else
|
||||||
|
ht_cmd(HT_LCD_OFF);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Display data.
|
||||||
|
* val - Data to be displayed, 0-999999
|
||||||
|
* dot - Display decimal dot, 0-3
|
||||||
|
* bat - Battery level, 0-3
|
||||||
|
*/
|
||||||
|
void lcd_display(unsigned val, int dot, int bat)
|
||||||
|
{
|
||||||
|
int i, byte[6];
|
||||||
|
|
||||||
|
/* Set numeric value. */
|
||||||
|
byte[5] = char_to_segm[val / 100000];
|
||||||
|
byte[4] = char_to_segm[(val / 10000) % 10];
|
||||||
|
byte[3] = char_to_segm[(val / 1000) % 10];
|
||||||
|
byte[2] = char_to_segm[(val / 100) % 10];
|
||||||
|
byte[1] = char_to_segm[(val / 10) % 10];
|
||||||
|
byte[0] = char_to_segm[val % 10];
|
||||||
|
|
||||||
|
/* Enable decimal dot/ */
|
||||||
|
switch (dot) {
|
||||||
|
case 1:
|
||||||
|
byte[0] |= 1 << 7;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
byte[1] |= 1 << 7;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
byte[2] |= 1 << 7;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (bat > 0)
|
||||||
|
byte[3] |= 1 << 7;
|
||||||
|
if (bat > 1)
|
||||||
|
byte[4] |= 1 << 7;
|
||||||
|
if (bat > 2)
|
||||||
|
byte[5] |= 1 << 7;
|
||||||
|
|
||||||
|
for (i=0; i<6; i++) {
|
||||||
|
ht_write(i, byte[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
/* Initialize hardware. */
|
||||||
|
lcd_init();
|
||||||
|
|
||||||
|
/* Blink all segments twice. */
|
||||||
|
lcd_clear(0xff);
|
||||||
|
mdelay(1000);
|
||||||
|
lcd_clear(0);
|
||||||
|
mdelay(1000);
|
||||||
|
lcd_clear(0xff);
|
||||||
|
mdelay(1000);
|
||||||
|
lcd_clear(0);
|
||||||
|
mdelay(1000);
|
||||||
|
|
||||||
|
/* Show all characters on all segments. */
|
||||||
|
for (i=0; i<sizeof(char_to_segm); i++) {
|
||||||
|
lcd_clear(char_to_segm[i]);
|
||||||
|
mdelay(200);
|
||||||
|
}
|
||||||
|
lcd_clear(0);
|
||||||
|
|
||||||
|
/* Display counter 0 to 999999. */
|
||||||
|
for (;;) {
|
||||||
|
for (i=0; i<999999; i++) {
|
||||||
|
lcd_display(i, i/10%4, i/10%4);
|
||||||
|
mdelay(100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user