Browse Source

APE is definitively gone from main tree.

rc/bin/ape scripts were moved to ape repo (next cl in APE repo)

Change-Id: I5b52e02fb8c7d1fa446773b72b8b898358f18690
Elbing Miss 8 years ago
parent
commit
aa4621f522
81 changed files with 0 additions and 4937 deletions
  1. 0 15
      rc/bin/ape/ar89
  2. 0 2
      rc/bin/ape/c89
  3. 0 18
      rc/bin/ape/cat
  4. 0 4
      rc/bin/ape/chown
  5. 0 9
      rc/bin/ape/dircp
  6. 0 2
      rc/bin/ape/egrep
  7. 0 2
      rc/bin/ape/false
  8. 0 2
      rc/bin/ape/fgrep
  9. 0 25
      rc/bin/ape/grep
  10. 0 40
      rc/bin/ape/install
  11. 0 6
      rc/bin/ape/ld
  12. 0 24
      rc/bin/ape/ln
  13. 0 66
      rc/bin/ape/ls
  14. 0 4
      rc/bin/ape/printf
  15. 0 16
      rc/bin/ape/psh
  16. 0 3
      rc/bin/ape/ranlib
  17. 0 2
      rc/bin/ape/rmdir
  18. 0 2
      rc/bin/ape/true
  19. 0 2
      rc/bin/ape/umask
  20. 0 16
      rc/bin/ape/yacc
  21. 0 29
      sys/include/ape/Plan9libnet.h
  22. 0 33
      sys/include/ape/ar.h
  23. 0 155
      sys/include/ape/arpa/inet.h
  24. 0 26
      sys/include/ape/assert.h
  25. 0 63
      sys/include/ape/bsd.h
  26. 0 64
      sys/include/ape/ctype.h
  27. 0 19
      sys/include/ape/cursor.h
  28. 0 49
      sys/include/ape/dirent.h
  29. 0 563
      sys/include/ape/draw.h
  30. 0 95
      sys/include/ape/errno.h
  31. 0 28
      sys/include/ape/error.h
  32. 0 19
      sys/include/ape/event.h
  33. 0 68
      sys/include/ape/fcntl.h
  34. 0 123
      sys/include/ape/fmt.h
  35. 0 35
      sys/include/ape/grp.h
  36. 0 32
      sys/include/ape/inttypes.h
  37. 0 15
      sys/include/ape/keyboard.h
  38. 0 87
      sys/include/ape/lib9.h
  39. 0 24
      sys/include/ape/libl.h
  40. 0 29
      sys/include/ape/libnet.h
  41. 0 436
      sys/include/ape/libsec.h
  42. 0 48
      sys/include/ape/libv.h
  43. 0 96
      sys/include/ape/limits.h
  44. 0 55
      sys/include/ape/locale.h
  45. 0 39
      sys/include/ape/lock.h
  46. 0 15
      sys/include/ape/mouse.h
  47. 0 162
      sys/include/ape/mp.h
  48. 0 130
      sys/include/ape/netdb.h
  49. 0 156
      sys/include/ape/netinet/in.h
  50. 0 9
      sys/include/ape/netinet/tcp.h
  51. 0 37
      sys/include/ape/pwd.h
  52. 0 50
      sys/include/ape/qlock.h
  53. 0 86
      sys/include/ape/regexp.h
  54. 0 43
      sys/include/ape/select.h
  55. 0 35
      sys/include/ape/setjmp.h
  56. 0 104
      sys/include/ape/signal.h
  57. 0 34
      sys/include/ape/stddef.h
  58. 0 166
      sys/include/ape/stdio.h
  59. 0 64
      sys/include/ape/stdlib.h
  60. 0 58
      sys/include/ape/string.h
  61. 0 31
      sys/include/ape/sys/ioctl.h
  62. 0 37
      sys/include/ape/sys/limits.h
  63. 0 27
      sys/include/ape/sys/param.h
  64. 0 27
      sys/include/ape/sys/pty.h
  65. 0 38
      sys/include/ape/sys/resource.h
  66. 0 43
      sys/include/ape/sys/select.h
  67. 0 205
      sys/include/ape/sys/socket.h
  68. 0 93
      sys/include/ape/sys/stat.h
  69. 0 31
      sys/include/ape/sys/time.h
  70. 0 36
      sys/include/ape/sys/times.h
  71. 0 55
      sys/include/ape/sys/types.h
  72. 0 43
      sys/include/ape/sys/uio.h
  73. 0 35
      sys/include/ape/sys/un.h
  74. 0 32
      sys/include/ape/sys/utsname.h
  75. 0 44
      sys/include/ape/sys/wait.h
  76. 0 141
      sys/include/ape/termios.h
  77. 0 74
      sys/include/ape/time.h
  78. 0 28
      sys/include/ape/u.h
  79. 0 177
      sys/include/ape/unistd.h
  80. 0 70
      sys/include/ape/utf.h
  81. 0 31
      sys/include/ape/utime.h

+ 0 - 15
rc/bin/ape/ar89

@@ -1,15 +0,0 @@
-#!/bin/rc
-
-flagfmt='c,d,p,r,t,u,v,x'
-args='archive [files ...]'
-
-if(! ifs=() eval `{aux/getflags $*} || ~ $#* 0) {
-	aux/usage
-	exit usage
-}
-
-key=''
-for(i in c d p r t x u v)
-	if(f=flag$i ~ $#$f 1)
-		key=$key$i
-exec /$cputype/bin/ar $key $*

+ 0 - 2
rc/bin/ape/c89

@@ -1,2 +0,0 @@
-#!/bin/rc
-exec /$cputype/bin/ape/cc $*

+ 0 - 18
rc/bin/ape/cat

@@ -1,18 +0,0 @@
-#!/bin/rc
-
-rfork e
-
-files=()
-while(! ~ $#* 0){
-	switch($1){
-	case -
-		files=($files /fd/0)
-	case -*
-		;
-	case *
-		files=($files $1)
-	}
-	shift
-}
-
-exec /$cputype/bin/cat $files

+ 0 - 4
rc/bin/ape/chown

@@ -1,4 +0,0 @@
-#!/bin/rc
-
-echo 'Permission denied'
-exit 1

+ 0 - 9
rc/bin/ape/dircp

@@ -1,9 +0,0 @@
-#!/bin/rc
-# dircp src dest - copy a tree with ape's tar
-switch($#*){
-case 2
-	@{cd $1 && tar cf /fd/1 .} | @{cd $2 && tar xf /fd/0}
-case *
-	echo usage: dircp from to >[1=2]
-	exit usage
-}

+ 0 - 2
rc/bin/ape/egrep

@@ -1,2 +0,0 @@
-#!/bin/rc
-exec /rc/bin/ape/grep $*

+ 0 - 2
rc/bin/ape/false

@@ -1,2 +0,0 @@
-#!/bin/rc
-exit 1

+ 0 - 2
rc/bin/ape/fgrep

@@ -1,2 +0,0 @@
-#!/bin/rc
-exec /rc/bin/ape/grep $*

+ 0 - 25
rc/bin/ape/grep

@@ -1,25 +0,0 @@
-#!/bin/rc
-
-rfork e
-
-opts=()
-files=()
-argv0=$0
-while(! ~ $#* 0){
-	switch($1){
-	case -e
-		opts=($opts $1 $2)
-		shift
-	case -[cfinsv]
-		opts=($opts $1)
-	case -q
-		opts=($opts -s)
-	case -*
-		echo $argv0 $1 not supported >[2=1]
-		exit 'not supported'
-	case *
-		files=($files $1)
-	}
-	shift
-}
-exec /$cputype/bin/grep $opts $files

+ 0 - 40
rc/bin/ape/install

@@ -1,40 +0,0 @@
-#!/bin/rc
-# Usage: install [options] srcfile dstfile
-# Usage: install srcfile dstfile owner group mode
-
-fn usage {
-	echo 'usage: install [-c|-m mode] srcfile dstfile' >[1=2]
-	exit 1
-}
-
-mode=775
-while(! ~ $#* 0){
-	switch($1){
-	case -c
-		;
-	case -m
-		mode=$2
-		shift
-	case -*
-		usage
-	case *
-		switch($#*) {
-		case 2
-			;
-		case 5
-			mode=$5	# backward compatibility
-		case *
-			usage
-		}
-		srcfile=$1
-		dstfile=$2
-		if (! test -f $dstfile || ! cmp -s $srcfile $dstfile) {
-			cp $srcfile $dstfile
-			chmod $mode $dstfile
-			chmod g+w $dstfile
-		}
-		exit 0
-	}
-	shift
-}
-usage

+ 0 - 6
rc/bin/ape/ld

@@ -1,6 +0,0 @@
-#!/bin/rc
-# ld for ape, to keep configure happy
-
-O=`{sed -n 's/^O=//p' /$cputype/mkfile}
-
-$O^l $*

+ 0 - 24
rc/bin/ape/ln

@@ -1,24 +0,0 @@
-#!/bin/rc
-
-argv0=$0
-force=n
-while(! ~ $#* 0 && ~ $1 -*){
-	switch($1){
-	case -f
-		force=y
-	case -s
-		;
-	case *
-		echo 'usage: ln [-s] [-f] source destination' >[2=1]
-		exit 'usage'
-	}
-	shift
-}
-
-
-if(~ $force n && test -e $2 && ! test -d $2){
-	echo ln: $2 destination exists >[2=1]
-	exit 'usage'
-}
-
-exec cp -gux $1 $2

+ 0 - 66
rc/bin/ape/ls

@@ -1,66 +0,0 @@
-#!/bin/rc
-
-# flags common to GNU and BSD ls
-
-# -A	all except . and ..
-# -C	force mc
-# -F	usual
-# -H	follow symlinks
-# -L	follow symlinks
-# -R	recursive list
-# -U	unsorted (gnu)
-# 
-# -a	include .files
-# -c	show ctime
-# -d	dirs
-# -f	no sorting
-# -i	inode numbers
-# -l	long
-# -p	put slash after dir (-F)
-# -r	reverse
-# -s	sizes
-# -t	time sort
-# -u	utime
-# -1	single-column
-
-
-flagfmt='A,C,F,H,L,R,U,a,c,d,f,i,l,p,r,s,t,u,1'
-args='[file ...]'
-
-if(! ifs=() eval `{aux/getflags $*}){
-	aux/usage
-	exit usage
-}
-
-fn fixlong {
-	echo total 1000
-	/$cputype/bin/sed 's/^(.).(.........) . [0-9]+ /\1\2 1 /'
-}
-
-fn qid2inode {
-	/$cputype/bin/sed 's/^\(([^ ]+).*\) /\1 /'
-}
-
-post=cat
-post2=cat
-
-all=()
-# ignore -A
-if(~ $flagC 1) post=mc
-if(~ $flagF 1) all=($all -F)
-# ignore -H, -L
-# save -R for later
-if(~ $flagU 1) all=($all -n)
-# ignore -a, -c
-if(~ $flagd 1) all=($all -d)
-if(~ $flagf 1) all=($all -n)
-if(~ $flagl 1) { all=($all -l); post=fixlong }
-if(~ $flagi 1) { all=($all -q); post2=qid2inode }
-if(~ $flagp 1) all=($all -F)
-if(~ $flagr 1) all=($all -r)
-if(~ $flags 1) all=($all -s)
-if(~ $flagt 1) all=($all -t)
-if(~ $flagu 1) all=($all -u)
-# ignore -1
-
-/$cputype/bin/ls $all $* | $post | $post2

+ 0 - 4
rc/bin/ape/printf

@@ -1,4 +0,0 @@
-#!/bin/rc
-
-# Here only for autoconf and friends.
-echo -n $1

+ 0 - 16
rc/bin/ape/psh

@@ -1,16 +0,0 @@
-#!/bin/rc
-# set up a shell running in an approximate POSIX 1003.2 environment
-rfork en
-fn sigterm{}
-HOME=$home
-bind -b /rc/bin/ape /bin
-bind -b /$cputype/bin/ape /bin
-if(test -d /$cputype/bin/pub)
-	bind -a /$cputype/bin/pub /bin
-if(test -d /$cputype/bin/X11){
-	bind -a /$cputype/bin/X11 /bin
-	if(test ! -e /env/DISPLAY)
-		DISPLAY=:0.0
-}
-
-/bin/sh $*

+ 0 - 3
rc/bin/ape/ranlib

@@ -1,3 +0,0 @@
-#!/bin/rc
-
-exit 0

+ 0 - 2
rc/bin/ape/rmdir

@@ -1,2 +0,0 @@
-#!/bin/rc
-rm $*

+ 0 - 2
rc/bin/ape/true

@@ -1,2 +0,0 @@
-#!/bin/rc
-exit 0

+ 0 - 2
rc/bin/ape/umask

@@ -1,2 +0,0 @@
-#!/bin/rc
-echo no umask in Plan 9

+ 0 - 16
rc/bin/ape/yacc

@@ -1,16 +0,0 @@
-#!/bin/rc
-
-flagfmt='d,l,t,v,b stem'
-args='grammar'
-
-if(! ifs=() eval `{aux/getflags $*} || ! ~ $#* 1){
-	aux/usage
-	exit usage
-}
-
-y=-S
-if (~ $#flagb 1) y=($y -s $flagb)
-if (~ $#flagd 1) y=($y -d)
-if (~ $#flagt 1) y=($y -D2)
-if (~ $#flagv 1) y=($y -v)
-exec /$cputype/bin/yacc $y $*

+ 0 - 29
sys/include/ape/Plan9libnet.h

@@ -1,29 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __LIBNET_H
-#define __LIBNET_H
-#ifndef _NET_EXTENSION
-   This header file is not defined in ANSI or POSIX
-#endif
-#pragma lib "/$M/lib/ape/libnet.a"
-
-#define NETPATHLEN 40
-
-extern	int	accept(int, char*);
-extern	int	announce(char*, char*);
-extern	int	dial(char*, char*, char*, int*);
-extern	int	hangup(int);
-extern	int	listen(char*, char*);
-extern	char*	netmkaddr(char*, char*, char*);
-extern	int	reject(int, char*, char *);
-
-extern char    dialerrstr[64];
-
-#endif /* __LIBNET_H */

+ 0 - 33
sys/include/ape/ar.h

@@ -1,33 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __AR_H
-#define __AR_H
-#ifndef _RESEARCH_SOURCE
-   This header file is not defined in ANSI or POSIX
-#endif
-
-#define	ARMAG	"!<arch>\n"
-#define	SARMAG	8
-
-#define	ARFMAG	"`\n"
-
-struct	ar_hdr
-{
-	char	ar_name[16];
-	char	ar_date[12];
-	char	ar_uid[6];
-	char	ar_gid[6];
-	char	ar_mode[8];
-	char	ar_size[10];
-	char	ar_fmag[2];
-};
-#define	SAR_HDR	60
-
-#endif

+ 0 - 155
sys/include/ape/arpa/inet.h

@@ -1,155 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __netinet_in__
-#define __netinet_in__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Copyright (c) 1982, 1986, 1990 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution is only permitted until one year after the first shipment
- * of 4.4BSD by the Regents.  Otherwise, redistribution and use in source and
- * binary forms are permitted provided that: (1) source distributions retain
- * this entire copyright notice and comment, and (2) distributions including
- * binaries display the following acknowledgement:  This product includes
- * software developed by the University of California, Berkeley and its
- * contributors'' in the documentation or other materials provided with the
- * distribution and in all advertising materials mentioning features or use
- * of this software.  Neither the name of the University nor the names of
- * its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- *	@(#)in.h	7.10 (Berkeley) 6/28/90 plus MULTICAST 1.1
- */
-
-/*
- * Constants and structures defined by the internet system,
- * Per RFC 790, September 1981.
- */
-
-/*
- * Protocols
- */
-#define	IPPROTO_IP		0		/* dummy for IP */
-#define	IPPROTO_ICMP		1		/* control message protocol */
-#define	IPPROTO_GGP		3		/* gateway^2 (deprecated) */
-#define	IPPROTO_TCP		6		/* tcp */
-#define	IPPROTO_EGP		8		/* exterior gateway protocol */
-#define	IPPROTO_PUP		12		/* pup */
-#define	IPPROTO_UDP		17		/* user datagram protocol */
-#define	IPPROTO_IDP		22		/* xns idp */
-#define	IPPROTO_TP		29 		/* tp-4 w/ class negotiation */
-#define	IPPROTO_EON		80		/* ISO cnlp */
-
-#define	IPPROTO_RAW		255		/* raw IP packet */
-#define	IPPROTO_MAX		256
-
-
-/*
- * Local port number conventions:
- * Ports < IPPORT_RESERVED are reserved for
- * privileged processes (e.g. root).
- * Ports > IPPORT_USERRESERVED are reserved
- * for servers, not necessarily privileged.
- */
-#define	IPPORT_RESERVED		1024
-#define	IPPORT_USERRESERVED	5000
-
-/*
- * Internet address (a structure for historical reasons)
- */
-struct in_addr {
-	unsigned long s_addr;
-};
-
-/*
- * Definitions of bits in internet address integers.
- * On subnets, the decomposition of addresses to host and net parts
- * is done according to subnet mask, not the masks here.
- */
-#define	IN_CLASSA(i)		(((int32_t)(i) & 0x80000000) == 0)
-#define	IN_CLASSA_NET		0xff000000
-#define	IN_CLASSA_NSHIFT	24
-#define	IN_CLASSA_HOST		0x00ffffff
-#define	IN_CLASSA_MAX		128
-
-#define	IN_CLASSB(i)		(((int32_t)(i) & 0xc0000000) == 0x80000000)
-#define	IN_CLASSB_NET		0xffff0000
-#define	IN_CLASSB_NSHIFT	16
-#define	IN_CLASSB_HOST		0x0000ffff
-#define	IN_CLASSB_MAX		65536
-
-#define	IN_CLASSC(i)		(((int32_t)(i) & 0xe0000000) == 0xc0000000)
-#define	IN_CLASSC_NET		0xffffff00
-#define	IN_CLASSC_NSHIFT	8
-#define	IN_CLASSC_HOST		0x000000ff
-
-#define	IN_CLASSD(i)		(((int32_t)(i) & 0xf0000000) == 0xe0000000)
-#define	IN_MULTICAST(i)		IN_CLASSD(i)
-
-#define	IN_EXPERIMENTAL(i)	(((int32_t)(i) & 0xe0000000) == 0xe0000000)
-#define	IN_BADCLASS(i)		(((int32_t)(i) & 0xf0000000) == 0xf0000000)
-
-#define	INADDR_ANY		(unsigned long)0x00000000
-#define	INADDR_BROADCAST	(unsigned long)0xffffffff	/* must be masked */
-
-#define	IN_LOOPBACKNET		127			/* official! */
-
-/*
- * Socket address, internet style.
- */
-struct sockaddr_in {
-	int16_t	sin_family;
-	unsigned short	sin_port;
-	struct	in_addr sin_addr;
-	char	sin_zero[8];
-};
-
-/*
- * Structure used to describe IP options.
- * Used to store options internally, to pass them to a process,
- * or to restore options retrieved earlier.
- * The ip_dst is used for the first-hop gateway when using a source route
- * (this gets put into the header proper).
- */
-struct ip_opts {
-	struct	in_addr ip_dst;		/* first hop, 0 w/o src rt */
-	char	ip_opts[40];		/* actually variable in size */
-};
-
-/*
- * Options for use with [gs]etsockopt at the IP level.
- * First word of comment is data type; bool is stored in int.
- */
-#define	IP_OPTIONS	1	/* buf/ip_opts; set/get IP per-packet options */
-#define	IP_HDRINCL	7	/* int; header is included with data (raw) */
-#define	IP_TOS		8	/* int; IP type of service and precedence */
-#define	IP_TTL		9	/* int; IP time to live */
-
-extern unsigned long	ntohl(unsigned long x);
-extern unsigned short	ntohs(unsigned short x);
-extern unsigned long	htonl(unsigned long x);
-extern unsigned short	htons(unsigned short x);
-extern unsigned long	inet_addr(char*);
-extern char*		inet_ntoa(struct in_addr);
-extern unsigned long	nptohl(void*);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __netinet_in__ */

+ 0 - 26
sys/include/ape/assert.h

@@ -1,26 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#pragma lib "/$M/lib/ape/libap.a"
-
-#undef assert
-#ifdef NDEBUG
-#define assert(ignore) ((void)0)
-#else
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern void _assert(char *, unsigned);
-
-#ifdef __cplusplus
-}
-#endif
-#define assert(e) {if(!(e))_assert(__FILE__, __LINE__);}
-#endif /* NDEBUG */

+ 0 - 63
sys/include/ape/bsd.h

@@ -1,63 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef _BSD_EXTENSION
-    This header file is an extension to ANSI/POSIX
-#endif
-
-#ifndef __BSD_H_
-#define __BSD_H_
-#pragma src "/sys/src/ape/lib/bsd"
-#pragma lib "/$M/lib/ape/libbsd.a"
-
-#ifndef __TYPES_H
-#include <sys/types.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef unsigned long size_t;
-#endif
-
-/* ifndefs because X11 stuff (ugh) */
-#ifndef bcopy
-extern void	bcopy(void*, void*, size_t);
-#endif
-#ifndef bcmp
-extern int	bcmp(void*, void*, size_t);
-#endif
-#ifndef bzero
-extern void	bzero(void*, size_t);
-#endif
-extern int	ffs(unsigned int);
-extern void	bhappy(void*);
-extern int	rresvport(int*);
-extern int	rcmd(char**, int, char*, char*, char*, int*);
-extern int	strcasecmp(char*, char*);
-extern int 	putenv(char*);
-extern int	strncasecmp(char*, char*,int);
-
-extern int	getopt(int, char**, char*);
-extern int	opterr;
-extern int	optind;
-extern int	optopt;
-extern char	*optarg;
-extern char	*mktemp(char *);
-extern char	*sys_errlist[];
-extern int		sys_nerr;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 64
sys/include/ape/ctype.h

@@ -1,64 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __CTYPE
-#define __CTYPE
-#pragma lib "/$M/lib/ape/libap.a"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int isalnum(int);
-extern int isalpha(int);
-extern int iscntrl(int);
-extern int isdigit(int);
-extern int isgraph(int);
-extern int islower(int);
-extern int isprint(int);
-extern int ispunct(int);
-extern int isspace(int);
-extern int isupper(int);
-extern int isxdigit(int);
-extern int tolower(int);
-extern int toupper(int);
-
-#ifdef __cplusplus
-}
-#endif
-enum
-{
-  _ISupper = 01,	/* UPPERCASE.  */
-  _ISlower = 02,	/* lowercase.  */
-  _ISdigit = 04,	/* Numeric.  */
-  _ISspace = 010,	/* Whitespace.  */
-  _ISpunct = 020,	/* Punctuation.  */
-  _IScntrl = 040,	/* Control character.  */
-  _ISblank = 0100,	/* Blank (usually SPC and TAB).  */
-  _ISxdigit = 0200,	/* Hexadecimal numeric.  */
-};
-
-extern unsigned char _ctype[];
-#define	isalnum(c)	(_ctype[(unsigned char)(c)]&(_ISupper|_ISlower|_ISdigit))
-#define	isalpha(c)	(_ctype[(unsigned char)(c)]&(_ISupper|_ISlower))
-#define	iscntrl(c)	(_ctype[(unsigned char)(c)]&_IScntrl)
-#define	isdigit(c)	(_ctype[(unsigned char)(c)]&_ISdigit)
-#define	isgraph(c)	(_ctype[(unsigned char)(c)]&(_ISpunct|_ISupper|_ISlower|_ISdigit))
-#define	islower(c)	(_ctype[(unsigned char)(c)]&_ISlower)
-#define	isprint(c)	(_ctype[(unsigned char)(c)]&(_ISpunct|_ISupper|_ISlower|_ISdigit|_ISblank))
-#define	ispunct(c)	(_ctype[(unsigned char)(c)]&_ISpunct)
-#define	isspace(c)	(_ctype[(unsigned char)(c)]&_ISspace)
-#define	isupper(c)	(_ctype[(unsigned char)(c)]&_ISupper)
-#define	isxdigit(c)	(_ctype[(unsigned char)(c)]&_ISxdigit)
-
-#ifdef _BSD_EXTENSION
-#define	isascii(c) (((unsigned int)(c))<0x80)
-#endif
-
-#endif /* __CTYPE */

+ 0 - 19
sys/include/ape/cursor.h

@@ -1,19 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef _PLAN9_SOURCE
-  This header file is an extension to ANSI/POSIX
-#endif
-
-#ifndef	__CURSOR_H_
-#define	__CURSOR_H_
-#include "/sys/include/cursor.h"
-
-#endif
-

+ 0 - 49
sys/include/ape/dirent.h

@@ -1,49 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef	__DIRENT_H
-#define	__DIRENT_H
-#pragma lib "/$M/lib/ape/libap.a"
-/*
- * this must be a power of 2 and a multiple of all the ones in the system
- */
-#define MAXNAMLEN 255
-
-struct	dirent {
-	char	d_name[MAXNAMLEN + 1];
-};
-
-typedef struct _dirdesc {
-	int	dd_fd;		/* file descriptor */
-	int32_t	dd_loc;		/* buf offset of entry from last readdir() */
-	int32_t	dd_size;	/* amount of valid data in buffer */
-	char	*dd_buf;	/* directory data buffer */
-	void *dirs;
-	int	dirsize;
-	int	dirloc;
-} DIR;
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * functions defined on directories
- */
-DIR		*opendir(const char *);
-struct dirent	*readdir(DIR *);
-void		rewinddir(DIR *);
-int		closedir(DIR *);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 563
sys/include/ape/draw.h

@@ -1,563 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef _PLAN9_SOURCE
-  This header file is an extension to ANSI/POSIX
-#endif
-
-#ifndef	__DRAW_H_
-#define	__DRAW_H_
-#pragma src "/sys/src/ape/lib/draw"
-#pragma lib "/$M/lib/ape/libdraw.a"
-
-#include <u.h>
-#include <fmt.h>
-#include <qlock.h>
-
-typedef struct	Cachefont Cachefont;
-typedef struct	Cacheinfo Cacheinfo;
-typedef struct	Cachesubf Cachesubf;
-typedef struct	Display Display;
-typedef struct	Font Font;
-typedef struct	Fontchar Fontchar;
-typedef struct	Image Image;
-typedef struct	Mouse Mouse;
-typedef struct	Point Point;
-typedef struct	Rectangle Rectangle;
-typedef struct	RGB RGB;
-typedef struct	Screen Screen;
-typedef struct	Subfont Subfont;
-
-#pragma varargck	type	"R"	Rectangle
-#pragma varargck	type	"P"	Point
-extern	int	Rfmt(Fmt*);
-extern	int	Pfmt(Fmt*);
-
-enum
-{
-	DOpaque		= 0xFFFFFFFF,
-	DTransparent	= 0x00000000,		/* only useful for allocimage, memfillcolor */
-	DBlack		= 0x000000FF,
-	DWhite		= 0xFFFFFFFF,
-	DRed		= 0xFF0000FF,
-	DGreen		= 0x00FF00FF,
-	DBlue		= 0x0000FFFF,
-	DCyan		= 0x00FFFFFF,
-	DMagenta		= 0xFF00FFFF,
-	DYellow		= 0xFFFF00FF,
-	DPaleyellow	= 0xFFFFAAFF,
-	DDarkyellow	= 0xEEEE9EFF,
-	DDarkgreen	= 0x448844FF,
-	DPalegreen	= 0xAAFFAAFF,
-	DMedgreen	= 0x88CC88FF,
-	DDarkblue	= 0x000055FF,
-	DPalebluegreen= 0xAAFFFFFF,
-	DPaleblue		= 0x0000BBFF,
-	DBluegreen	= 0x008888FF,
-	DGreygreen	= 0x55AAAAFF,
-	DPalegreygreen	= 0x9EEEEEFF,
-	DYellowgreen	= 0x99994CFF,
-	DMedblue		= 0x000099FF,
-	DGreyblue	= 0x005DBBFF,
-	DPalegreyblue	= 0x4993DDFF,
-	DPurpleblue	= 0x8888CCFF,
-
-	DNotacolor	= 0xFFFFFF00,
-	DNofill		= DNotacolor,
-	
-};
-
-enum
-{
-	Displaybufsize	= 8000,
-	ICOSSCALE	= 1024,
-	Borderwidth =	4,
-};
-
-enum
-{
-	/* refresh methods */
-	Refbackup	= 0,
-	Refnone		= 1,
-	Refmesg		= 2
-};
-#define	NOREFRESH	((void*)-1)
-
-enum
-{
-	/* line ends */
-	Endsquare	= 0,
-	Enddisc		= 1,
-	Endarrow	= 2,
-	Endmask		= 0x1F
-};
-
-#define	ARROW(a, b, c)	(Endarrow|((a)<<5)|((b)<<14)|((c)<<23))
-
-typedef enum
-{
-	/* Porter-Duff compositing operators */
-	Clear	= 0,
-
-	SinD	= 8,
-	DinS	= 4,
-	SoutD	= 2,
-	DoutS	= 1,
-
-	S		= SinD|SoutD,
-	SoverD	= SinD|SoutD|DoutS,
-	SatopD	= SinD|DoutS,
-	SxorD	= SoutD|DoutS,
-
-	D		= DinS|DoutS,
-	DoverS	= DinS|DoutS|SoutD,
-	DatopS	= DinS|SoutD,
-	DxorS	= DoutS|SoutD,	/* == SxorD */
-
-	Ncomp = 12,
-} Drawop;
-
-/*
- * image channel descriptors 
- */
-enum {
-	CRed = 0,
-	CGreen,
-	CBlue,
-	CGrey,
-	CAlpha,
-	CMap,
-	CIgnore,
-	NChan,
-};
-
-#define __DC(type, nbits)	((((type)&15)<<4)|((nbits)&15))
-#define CHAN1(a,b)	__DC(a,b)
-#define CHAN2(a,b,c,d)	(CHAN1((a),(b))<<8|__DC((c),(d)))
-#define CHAN3(a,b,c,d,e,f)	(CHAN2((a),(b),(c),(d))<<8|__DC((e),(f)))
-#define CHAN4(a,b,c,d,e,f,g,h)	(CHAN3((a),(b),(c),(d),(e),(f))<<8|__DC((g),(h)))
-
-#define NBITS(c) ((c)&15)
-#define TYPE(c) (((c)>>4)&15)
-
-enum {
-	GREY1	= CHAN1(CGrey, 1),
-	GREY2	= CHAN1(CGrey, 2),
-	GREY4	= CHAN1(CGrey, 4),
-	GREY8	= CHAN1(CGrey, 8),
-	CMAP8	= CHAN1(CMap, 8),
-	RGB15	= CHAN4(CIgnore, 1, CRed, 5, CGreen, 5, CBlue, 5),
-	RGB16	= CHAN3(CRed, 5, CGreen, 6, CBlue, 5),
-	RGB24	= CHAN3(CRed, 8, CGreen, 8, CBlue, 8),
-	RGBA32	= CHAN4(CRed, 8, CGreen, 8, CBlue, 8, CAlpha, 8),
-	ARGB32	= CHAN4(CAlpha, 8, CRed, 8, CGreen, 8, CBlue, 8),	/* stupid VGAs */
-	XRGB32	= CHAN4(CIgnore, 8, CRed, 8, CGreen, 8, CBlue, 8),
-	BGR24	= CHAN3(CBlue, 8, CGreen, 8, CRed, 8),
-	ABGR32	= CHAN4(CAlpha, 8, CBlue, 8, CGreen, 8, CRed, 8),
-	XBGR32	= CHAN4(CIgnore, 8, CBlue, 8, CGreen, 8, CRed, 8),
-};
-
-extern	char*	chantostr(char*, uint32_t);
-extern	uint32_t	strtochan(char*);
-extern	int		chantodepth(uint32_t);
-
-struct	Point
-{
-	int	x;
-	int	y;
-};
-
-struct Rectangle
-{
-	Point	min;
-	Point	max;
-};
-
-typedef void	(*Reffn)(Image*, Rectangle, void*);
-
-struct Screen
-{
-	Display	*display;	/* display holding data */
-	int	id;		/* id of system-held Screen */
-	Image	*image;		/* unused; for reference only */
-	Image	*fill;		/* color to paint behind windows */
-};
-
-struct Display
-{
-	QLock	qlock;
-	int		locking;	/*program is using lockdisplay */
-	int		dirno;
-	int		fd;
-	int		reffd;
-	int		ctlfd;
-	int		imageid;
-	int		local;
-	void		(*error)(Display*, char*);
-	char		*devdir;
-	char		*windir;
-	char		oldlabel[64];
-	uint32_t		dataqid;
-	Image		*white;
-	Image		*black;
-	Image		*opaque;
-	Image		*transparent;
-	Image		*image;
-	uint8_t		*buf;
-	int			bufsize;
-	uint8_t		*bufp;
-	Font		*defaultfont;
-	Subfont		*defaultsubfont;
-	Image		*windows;
-	Image		*screenimage;
-	int			_isnewdisplay;
-};
-
-struct Image
-{
-	Display		*display;	/* display holding data */
-	int		id;		/* id of system-held Image */
-	Rectangle	r;		/* rectangle in data area, local coords */
-	Rectangle 	clipr;		/* clipping region */
-	int		depth;		/* number of bits per pixel */
-	uint32_t	chan;
-	int		repl;		/* flag: data replicates to tile clipr */
-	Screen		*screen;	/* 0 if not a window */
-	Image		*next;	/* next in list of windows */
-};
-
-struct RGB
-{
-	uint32_t	red;
-	uint32_t	green;
-	uint32_t	blue;
-};
-
-/*
- * Subfonts
- *
- * given char c, Subfont *f, Fontchar *i, and Point p, one says
- *	i = f->info+c;
- *	draw(b, Rect(p.x+i->left, p.y+i->top,
- *		p.x+i->left+((i+1)->x-i->x), p.y+i->bottom),
- *		color, f->bits, Pt(i->x, i->top));
- *	p.x += i->width;
- * to draw characters in the specified color (itself an Image) in Image b.
- */
-
-struct	Fontchar
-{
-	int		x;		/* left edge of bits */
-	uint8_t		top;		/* first non-zero scan-line */
-	uint8_t		bottom;		/* last non-zero scan-line + 1 */
-	char		left;		/* offset of baseline */
-	uint8_t		width;		/* width of baseline */
-};
-
-struct	Subfont
-{
-	char		*name;
-	int16_t		n;		/* number of chars in font */
-	uint8_t		height;		/* height of image */
-	char		ascent;		/* top of image to baseline */
-	Fontchar 	*info;		/* n+1 character descriptors */
-	Image		*bits;		/* of font */
-	int		ref;
-};
-
-enum
-{
-	/* starting values */
-	LOG2NFCACHE =	6,
-	NFCACHE =	(1<<LOG2NFCACHE),	/* #chars cached */
-	NFLOOK =	5,			/* #chars to scan in cache */
-	NFSUBF =	2,			/* #subfonts to cache */
-	/* max value */
-	MAXFCACHE =	1024+NFLOOK,		/* upper limit */
-	MAXSUBF =	50,			/* generous upper limit */
-	/* deltas */
-	DSUBF = 	4,
-	/* expiry ages */
-	SUBFAGE	=	10000,
-	CACHEAGE =	10000
-};
-
-struct Cachefont
-{
-	Rune		min;	/* lowest rune value to be taken from subfont */
-	Rune		max;	/* highest rune value+1 to be taken from subfont */
-	int		offset;	/* position in subfont of character at min */
-	char		*name;			/* stored in font */
-	char		*subfontname;		/* to access subfont */
-};
-
-struct Cacheinfo
-{
-	uint16_t		x;		/* left edge of bits */
-	uint8_t		width;		/* width of baseline */
-	schar		left;		/* offset of baseline */
-	Rune		value;	/* value of character at this slot in cache */
-	uint16_t		age;
-};
-
-struct Cachesubf
-{
-	uint32_t		age;	/* for replacement */
-	Cachefont	*cf;	/* font info that owns us */
-	Subfont		*f;	/* attached subfont */
-};
-
-struct Font
-{
-	char		*name;
-	Display		*display;
-	int16_t		height;	/* max height of image, interline spacing */
-	int16_t		ascent;	/* top of image to baseline */
-	int16_t		width;	/* widest so far; used in caching only */	
-	int16_t		nsub;	/* number of subfonts */
-	uint32_t		age;	/* increasing counter; used for LRU */
-	int		maxdepth;	/* maximum depth of all loaded subfonts */
-	int		ncache;	/* size of cache */
-	int		nsubf;	/* size of subfont list */
-	Cacheinfo	*cache;
-	Cachesubf	*subf;
-	Cachefont	**sub;	/* as read from file */
-	Image		*cacheimage;
-};
-
-#define	Dx(r)	((r).max.x-(r).min.x)
-#define	Dy(r)	((r).max.y-(r).min.y)
-
-#ifdef	__cplusplus
-extern "C" { 
-#endif
-
-/*
- * Image management
- */
-extern Image*	_allocimage(Image*, Display*, Rectangle, uint32_t, int,
-				 uint32_t, int, int);
-extern Image*	allocimage(Display*, Rectangle, uint32_t, int,
-				uint32_t);
-extern uint8_t*	bufimage(Display*, int);
-extern int	bytesperline(Rectangle, int);
-extern void	closedisplay(Display*);
-extern void	drawerror(Display*, char*);
-extern int	flushimage(Display*, int);
-extern int	freeimage(Image*);
-extern int	_freeimage1(Image*);
-extern int	geninitdraw(char*, void(*)(Display*, char*), char*,
-			      char*, char*, int);
-extern int	initdraw(void(*)(Display*, char*), char*, char*);
-extern int	newwindow(char*);
-extern Display*	initdisplay(char*, char*,
-				   void(*)(Display*, char*));
-extern int	loadimage(Image*, Rectangle, uint8_t*, int);
-extern int	cloadimage(Image*, Rectangle, uint8_t*, int);
-extern int	getwindow(Display*, int);
-extern int	gengetwindow(Display*, char*, Image**, Screen**, int);
-extern Image* readimage(Display*, int, int);
-extern Image* creadimage(Display*, int, int);
-extern int	unloadimage(Image*, Rectangle, uint8_t*, int);
-extern int	wordsperline(Rectangle, int);
-extern int	writeimage(int, Image*, int);
-extern Image*	namedimage(Display*, char*);
-extern int	nameimage(Image*, char*, int);
-extern Image* allocimagemix(Display*, uint32_t, uint32_t);
-
-/*
- * Colors
- */
-extern	void	readcolmap(Display*, RGB*);
-extern	void	writecolmap(Display*, RGB*);
-extern	uint32_t	setalpha(uint32_t, uint8_t);
-
-/*
- * Windows
- */
-extern Screen*	allocscreen(Image*, Image*, int);
-extern Image*	_allocwindow(Image*, Screen*, Rectangle, int, uint32_t);
-extern Image*	allocwindow(Screen*, Rectangle, int, uint32_t);
-extern void	bottomnwindows(Image**, int);
-extern void	bottomwindow(Image*);
-extern int	freescreen(Screen*);
-extern Screen*	publicscreen(Display*, int, uint32_t);
-extern void	topnwindows(Image**, int);
-extern void	topwindow(Image*);
-extern int	originwindow(Image*, Point, Point);
-
-/*
- * Geometry
- */
-extern Point		Pt(int, int);
-extern Rectangle	Rect(int, int, int, int);
-extern Rectangle	Rpt(Point, Point);
-extern Point		addpt(Point, Point);
-extern Point		subpt(Point, Point);
-extern Point		divpt(Point, int);
-extern Point		mulpt(Point, int);
-extern int		eqpt(Point, Point);
-extern int		eqrect(Rectangle, Rectangle);
-extern Rectangle	insetrect(Rectangle, int);
-extern Rectangle	rectaddpt(Rectangle, Point);
-extern Rectangle	rectsubpt(Rectangle, Point);
-extern Rectangle	canonrect(Rectangle);
-extern int		rectXrect(Rectangle, Rectangle);
-extern int		rectinrect(Rectangle, Rectangle);
-extern void		combinerect(Rectangle*, Rectangle);
-extern int		rectclip(Rectangle*, Rectangle);
-extern int		ptinrect(Point, Rectangle);
-extern void		replclipr(Image*, int, Rectangle);
-extern int		drawreplxy(int, int, int);	/* used to be drawsetxy */
-extern Point	drawrepl(Rectangle, Point);
-extern int		rgb2cmap(int, int, int);
-extern int		cmap2rgb(int);
-extern int		cmap2rgba(int);
-extern void		icossin(int, int*, int*);
-extern void		icossin2(int, int, int*, int*);
-
-/*
- * Graphics
- */
-extern void	draw(Image*, Rectangle, Image*, Image*, Point);
-extern void	drawop(Image*, Rectangle, Image*, Image*, Point, Drawop);
-extern void	gendraw(Image*, Rectangle, Image*, Point, Image*, Point);
-extern void	gendrawop(Image*, Rectangle, Image*, Point, Image*, Point, Drawop);
-extern void	line(Image*, Point, Point, int, int, int, Image*, Point);
-extern void	lineop(Image*, Point, Point, int, int, int, Image*, Point, Drawop);
-extern void	poly(Image*, Point*, int, int, int, int, Image*, Point);
-extern void	polyop(Image*, Point*, int, int, int, int, Image*, Point, Drawop);
-extern void	fillpoly(Image*, Point*, int, int, Image*, Point);
-extern void	fillpolyop(Image*, Point*, int, int, Image*, Point, Drawop);
-extern Point	string(Image*, Point, Image*, Point, Font*, char*);
-extern Point	stringop(Image*, Point, Image*, Point, Font*, char*,
-			     Drawop);
-extern Point	stringn(Image*, Point, Image*, Point, Font*, char*,
-			    int);
-extern Point	stringnop(Image*, Point, Image*, Point, Font*, char*,
-			      int, Drawop);
-extern Point	runestring(Image*, Point, Image*, Point, Font*, Rune*);
-extern Point	runestringop(Image*, Point, Image*, Point, Font*, Rune*, Drawop);
-extern Point	runestringn(Image*, Point, Image*, Point, Font*, Rune*, int);
-extern Point	runestringnop(Image*, Point, Image*, Point, Font*, Rune*, int, Drawop);
-extern Point	stringbg(Image*, Point, Image*, Point, Font*, char*,
-			     Image*, Point);
-extern Point	stringbgop(Image*, Point, Image*, Point, Font*, char*,
-			       Image*, Point, Drawop);
-extern Point	stringnbg(Image*, Point, Image*, Point, Font*, char*,
-			      int, Image*, Point);
-extern Point	stringnbgop(Image*, Point, Image*, Point, Font*, char*,
-				int, Image*, Point, Drawop);
-extern Point	runestringbg(Image*, Point, Image*, Point, Font*, Rune*, Image*, Point);
-extern Point	runestringbgop(Image*, Point, Image*, Point, Font*, Rune*, Image*, Point, Drawop);
-extern Point	runestringnbg(Image*, Point, Image*, Point, Font*, Rune*, int, Image*, Point);
-extern Point	runestringnbgop(Image*, Point, Image*, Point, Font*, Rune*, int, Image*, Point, Drawop);
-extern Point	_string(Image*, Point, Image*, Point, Font*, char*,
-			    Rune*, int, Rectangle, Image*, Point, Drawop);
-extern Point	stringsubfont(Image*, Point, Image*, Subfont*, char*);
-extern int		bezier(Image*, Point, Point, Point, Point, int, int, int, Image*, Point);
-extern int		bezierop(Image*, Point, Point, Point, Point, int, int, int, Image*, Point, Drawop);
-extern int		bezspline(Image*, Point*, int, int, int, int, Image*, Point);
-extern int		bezsplineop(Image*, Point*, int, int, int, int, Image*, Point, Drawop);
-extern int		bezsplinepts(Point*, int, Point**);
-extern int		fillbezier(Image*, Point, Point, Point, Point, int, Image*, Point);
-extern int		fillbezierop(Image*, Point, Point, Point, Point, int, Image*, Point, Drawop);
-extern int		fillbezspline(Image*, Point*, int, int, Image*, Point);
-extern int		fillbezsplineop(Image*, Point*, int, int, Image*, Point, Drawop);
-extern void	ellipse(Image*, Point, int, int, int, Image*, Point);
-extern void	ellipseop(Image*, Point, int, int, int, Image*, Point, Drawop);
-extern void	fillellipse(Image*, Point, int, int, Image*, Point);
-extern void	fillellipseop(Image*, Point, int, int, Image*, Point, Drawop);
-extern void	arc(Image*, Point, int, int, int, Image*, Point, int, int);
-extern void	arcop(Image*, Point, int, int, int, Image*, Point, int, int, Drawop);
-extern void	fillarc(Image*, Point, int, int, Image*, Point, int, int);
-extern void	fillarcop(Image*, Point, int, int, Image*, Point, int, int, Drawop);
-extern void	border(Image*, Rectangle, int, Image*, Point);
-extern void	borderop(Image*, Rectangle, int, Image*, Point, Drawop);
-
-/*
- * Font management
- */
-extern Font*	openfont(Display*, char*);
-extern Font*	buildfont(Display*, char*, char*);
-extern void	freefont(Font*);
-extern Font*	mkfont(Subfont*, Rune);
-extern int	cachechars(Font*, char**, Rune**, uint16_t*, int,
-			     int*,
-			     char**);
-extern void	agefont(Font*);
-extern Subfont*	allocsubfont(char*, int, int, int, Fontchar*,
-				    Image*);
-extern Subfont*	lookupsubfont(Display*, char*);
-extern void	installsubfont(char*, Subfont*);
-extern void	uninstallsubfont(Subfont*);
-extern void	freesubfont(Subfont*);
-extern Subfont*	readsubfont(Display*, char*, int, int);
-extern Subfont*	readsubfonti(Display*, char*, int, Image*, int);
-extern int	writesubfont(int, Subfont*);
-extern void	_unpackinfo(Fontchar*, uint8_t*, int);
-extern Point	stringsize(Font*, char*);
-extern int	stringwidth(Font*, char*);
-extern int	stringnwidth(Font*, char*, int);
-extern Point	runestringsize(Font*, Rune*);
-extern int	runestringwidth(Font*, Rune*);
-extern int	runestringnwidth(Font*, Rune*, int);
-extern Point	strsubfontwidth(Subfont*, char*);
-extern int	loadchar(Font*, Rune, Cacheinfo*, int, int, char**);
-extern char*	subfontname(char*, char*, int);
-extern Subfont*	_getsubfont(Display*, char*);
-extern Subfont*	getdefont(Display*);
-extern void		lockdisplay(Display*);
-extern void	unlockdisplay(Display*);
-extern int		drawlsetrefresh(uint32_t, int, void*, void*);
-
-/*
- * Predefined 
- */
-extern	uint8_t	defontdata[];
-extern	int		sizeofdefont;
-extern	Point		ZP;
-extern	Rectangle	ZR;
-
-/*
- * Set up by initdraw()
- */
-extern	Display	*display;
-extern	Font		*font;
-extern	Image	*screen;
-extern	Screen	*_screen;
-extern	int	_cursorfd;
-extern	int	_drawdebug;	/* set to 1 to see errors from flushimage */
-extern	void	_setdrawop(Display*, Drawop);
-
-#define	BGSHORT(p)		(((p)[0]<<0) | ((p)[1]<<8))
-#define	BGLONG(p)		((BGSHORT(p)<<0) | (BGSHORT(p+2)<<16))
-#define	BPSHORT(p, v)		((p)[0]=(v), (p)[1]=((v)>>8))
-#define	BPLONG(p, v)		(BPSHORT(p, (v)), BPSHORT(p+2, (v)>>16))
-
-/*
- * Compressed image file parameters and helper routines
- */
-#define	NMATCH	3		/* shortest match possible */
-#define	NRUN	(NMATCH+31)	/* longest match possible */
-#define	NMEM	1024		/* window size */
-#define	NDUMP	128		/* maximum length of dump */
-#define	NCBLOCK	6000		/* size of compressed blocks */
-extern	void	_twiddlecompressed(uint8_t*, int);
-extern	int	_compblocksize(Rectangle, int);
-
-/* XXX backwards helps; should go */
-extern	uint32_t	drawld2chan[];
-extern	void		drawsetdebug(int);
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif

+ 0 - 95
sys/include/ape/errno.h

@@ -1,95 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __ERRNO
-#define __ERRNO
-#pragma lib "/$M/lib/ape/libap.a"
-
-extern int errno;
-
-#define EDOM	1000
-#define ERANGE	1001
-#define EPLAN9	1002
-
-#ifdef _POSIX_SOURCE
-
-#define E2BIG	1
-#define EACCES	2
-#define	EAGAIN	3
-#define EBADF	4
-#define EBUSY	5
-#define ECHILD	6
-#define EDEADLK	7
-#define EEXIST	8
-#define EFAULT	9
-#define EFBIG	10
-#define EINTR	11
-#define EINVAL	12
-#define EIO	13
-#define EISDIR	14
-#define EMFILE	15
-#define EMLINK	16
-#define ENAMETOOLONG	17
-#define ENFILE	18
-#define ENODEV	19
-#define ENOENT	20
-#define ENOEXEC	21
-#define ENOLCK	22
-#define ENOMEM	23
-#define ENOSPC	24
-#define ENOSYS	25
-#define ENOTDIR	26
-#define ENOTEMPTY	27
-#define ENOTTY	28
-#define ENXIO	29
-#define EPERM	30
-#define EPIPE	31
-#define EROFS	32
-#define ESPIPE	33
-#define ESRCH	34
-#define EXDEV	35
-
-/* bsd networking software */
-#define ENOTSOCK	36
-#define EPROTONOSUPPORT	37
-#define EPROTOTYPE	37	/* two names for 37 */
-#define ECONNREFUSED	38
-#define EAFNOSUPPORT	39
-#define ENOBUFS		40
-#define EOPNOTSUPP	41
-#define EADDRINUSE	42
-#define EDESTADDRREQ	43
-#define EMSGSIZE	44
-#define ENOPROTOOPT	45
-#define ESOCKTNOSUPPORT	46
-#define EPFNOSUPPORT	47
-#define EADDRNOTAVAIL	48
-#define ENETDOWN	49
-#define ENETUNREACH	50
-#define ENETRESET	51
-#define ECONNABORTED	52
-#define EISCONN		53
-#define ENOTCONN	54
-#define ESHUTDOWN	55
-#define ETOOMANYREFS	56
-#define ETIMEDOUT	57
-#define EHOSTDOWN	58
-#define EHOSTUNREACH	59
-#define EGREG		60
-
-/* These added in 1003.1b-1993 */
-#define ECANCELED	61
-#define EINPROGRESS	62
-
-/* from research unix */
-#define ETXTBSY		63
-
-#endif /* _POSIX_SOURCE */
-
-#endif /* __ERRNO */

+ 0 - 28
sys/include/ape/error.h

@@ -1,28 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __ERROR_H
-#define __ERROR_H
-#ifndef _RESEARCH_SOURCE
-   This header file is not defined in pure ANSI or POSIX
-#endif
-#pragma lib "/$M/lib/ape/libv.a"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern char *_progname;		/* program name */
-extern void _perror(char *);	/* perror but with _progname */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _ERROR_H */

+ 0 - 19
sys/include/ape/event.h

@@ -1,19 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef _PLAN9_SOURCE
-  This header file is an extension to ANSI/POSIX
-#endif
-
-#ifndef	__EVENT_H_
-#define	__EVENT_H_
-#include "/sys/include/event.h"
-
-#endif
-

+ 0 - 68
sys/include/ape/fcntl.h

@@ -1,68 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __FCNTL_H
-#define __FCNTL_H
-#ifndef _POSIX_SOURCE
-   This header file is not defined in pure ANSI
-#endif
-#pragma lib "/$M/lib/ape/libap.a"
-
-#include	<sys/types.h>
-
-#define	O_RDONLY 0
-#define	O_WRONLY 1
-#define	O_RDWR	 2
-#define O_ACCMODE	0x003
-#define O_NONBLOCK	0x004
-#define O_APPEND	0x008
-#define O_CREAT		0x100
-#define O_TRUNC		0x200
-#define O_EXCL		0x400
-#define O_NOCTTY	0x800
-#define O_DSYNC		0x1000
-#define	O_RSYNC		0x2000
-#define O_SYNC		0x4000
-
-#define	F_DUPFD		0	/* Duplicate fildes */
-#define	F_GETFD		1	/* Get fildes flags */
-#define	F_SETFD		2	/* Set fildes flags */
-#define	F_GETFL		3	/* Get file flags */
-#define	F_SETFL		4	/* Set file flags */
-#define	F_GETLK		5	/* Get file lock */
-#define	F_SETLK		6	/* Set file lock */
-#define	F_SETLKW	7	/* Set file lock and wait */
-
-#define FD_CLOEXEC	1
-
-struct flock {
-	int16_t	l_type;
-	int16_t	l_whence;
-	off_t	l_start;
-	off_t	l_len;
-	pid_t	l_pid;
-};
-
-#define F_RDLCK		1	/* shared or read lock */
-#define F_UNLCK		2	/* unlock */
-#define F_WRLCK		3	/* exclusive or write lock */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int fcntl(int, int, ...);
-extern int open(const char *, int, ...);
-extern int creat(const char *, mode_t);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 123
sys/include/ape/fmt.h

@@ -1,123 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef _PLAN9_SOURCE
-  This header file is an extension to ANSI/POSIX
-#endif
-
-#ifndef __FMT_H_
-#define __FMT_H_
-#pragma src "/sys/src/ape/lib/fmt"
-#pragma lib "/$M/lib/ape/libfmt.a"
-
-#include <u.h>
-
-/*
- * The authors of this software are Rob Pike and Ken Thompson.
- *              Copyright (c) 2002 by Lucent Technologies.
- * Permission to use, copy, modify, and distribute this software for any
- * purpose without fee is hereby granted, provided that this entire notice
- * is included in all copies of any software which is or includes a copy
- * or modification of this software and in all copies of the supporting
- * documentation for such software.
- * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTY.  IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE ANY
- * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
- * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
- */
-
-#include <stdarg.h>
-#include <utf.h>
-
-typedef struct Fmt	Fmt;
-struct Fmt{
-	unsigned char	runes;		/* output buffer is runes or chars? */
-	void	*start;			/* of buffer */
-	void	*to;			/* current place in the buffer */
-	void	*stop;			/* end of the buffer; overwritten if flush fails */
-	int	(*flush)(Fmt *);	/* called when to == stop */
-	void	*farg;			/* to make flush a closure */
-	int	nfmt;			/* num chars formatted so far */
-	va_list	args;			/* args passed to dofmt */
-	int	r;			/* % format Rune */
-	int	width;
-	int	prec;
-	unsigned long	flags;
-};
-
-enum{
-	FmtWidth	= 1,
-	FmtLeft		= FmtWidth << 1,
-	FmtPrec		= FmtLeft << 1,
-	FmtSharp	= FmtPrec << 1,
-	FmtSpace	= FmtSharp << 1,
-	FmtSign		= FmtSpace << 1,
-	FmtZero		= FmtSign << 1,
-	FmtUnsigned	= FmtZero << 1,
-	FmtShort	= FmtUnsigned << 1,
-	FmtLong		= FmtShort << 1,
-	FmtVLong	= FmtLong << 1,
-	FmtComma	= FmtVLong << 1,
-	FmtByte		= FmtComma << 1,
-	FmtLDouble	= FmtByte << 1,
-
-	FmtFlag		= FmtLDouble << 1
-};
-
-#ifdef	__cplusplus
-extern "C" { 
-#endif
-
-extern	int	print(char*, ...);
-extern	char*	seprint(char*, char*, char*, ...);
-extern	char*	vseprint(char*, char*, char*, va_list);
-extern	int	snprint(char*, int, char*, ...);
-extern	int	vsnprint(char*, int, char*, va_list);
-extern	char*	smprint(char*, ...);
-extern	char*	vsmprint(char*, va_list);
-extern	int	sprint(char*, char*, ...);
-extern	int	fprint(int, char*, ...);
-extern	int	vfprint(int, char*, va_list);
-
-extern	int	runesprint(Rune*, char*, ...);
-extern	int	runesnprint(Rune*, int, char*, ...);
-extern	int	runevsnprint(Rune*, int, char*, va_list);
-extern	Rune*	runeseprint(Rune*, Rune*, char*, ...);
-extern	Rune*	runevseprint(Rune*, Rune*, char*, va_list);
-extern	Rune*	runesmprint(char*, ...);
-extern	Rune*	runevsmprint(char*, va_list);
-
-extern	int	fmtfdinit(Fmt*, int, char*, int);
-extern	int	fmtfdflush(Fmt*);
-extern	int	fmtstrinit(Fmt*);
-extern	char*	fmtstrflush(Fmt*);
-extern	int	runefmtstrinit(Fmt*);
-
-extern	int	quotestrfmt(Fmt *f);
-extern	void	quotefmtinstall(void);
-extern	int	(*fmtdoquote)(int);
-
-
-extern	int	fmtinstall(int, int (*)(Fmt*));
-extern	int	dofmt(Fmt*, char*);
-extern	int	fmtprint(Fmt*, char*, ...);
-extern	int	fmtvprint(Fmt*, char*, va_list);
-extern	int	fmtrune(Fmt*, int);
-extern	int	fmtstrcpy(Fmt*, char*);
-
-extern	double	fmtstrtod(const char *, char **);
-extern	double	fmtcharstod(int(*)(void*), void*);
-
-extern	void	werrstr(const char*, ...);
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif

+ 0 - 35
sys/include/ape/grp.h

@@ -1,35 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __GRP
-#define __GRP
-#ifndef _POSIX_SOURCE
-   This header file is not defined in pure ANSI
-#endif
-#pragma lib "/$M/lib/ape/libap.a"
-#include <sys/types.h>
-
-struct	group {
-	char	*gr_name;
-	gid_t	gr_gid;
-	char	**gr_mem;
-};
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern struct group *getgrgid(gid_t);
-extern struct group *getgrnam(const char *);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 32
sys/include/ape/inttypes.h

@@ -1,32 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef _SUSV2_SOURCE
-#error "inttypes.h is SUSV2"
-#endif
-
-#ifndef _INTTYPES_H_
-#define _INTTYPES_H_ 1
-
-typedef int _intptr_t;
-typedef unsigned int _uintptr_t;
-
-
-typedef char int8_t;
-typedef int16_t int16_t;
-typedef int int32_t;
-typedef long long int64_t;
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned int uint32_t;
-typedef unsigned long long uint64_t;
-typedef _intptr_t intptr_t;
-typedef _uintptr_t uintptr_t;
-
-#endif

+ 0 - 15
sys/include/ape/keyboard.h

@@ -1,15 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef _PLAN9_SOURCE
-  This header file is an extension to ANSI/POSIX
-#endif
-
-#include "/sys/include/keyboard.h"
-

+ 0 - 87
sys/include/ape/lib9.h

@@ -1,87 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __LIB9_H
-#define __LIB9_H
-#if !defined(_RESEARCH_SOURCE) && !defined(_PLAN9_SOURCE)
-    This header file is an extension to ANSI/POSIX
-#endif
-#pragma lib "/$M/lib/ape/lib9.a"
-
-#include <u.h>		/* ick; need Rune defined below */
-
-#define	MORDER	0x0003	/* mask for bits defining order of mounting */
-#define	MREPL	0x0000	/* mount replaces object */
-#define	MBEFORE	0x0001	/* mount goes before others in union directory */
-#define	MAFTER	0x0002	/* mount goes after others in union directory */
-#define	MCREATE	0x0004	/* permit creation in mounted directory */
-#define MRECOV	0x0008	/* perform recovery if mount channel is lost */
-#define MCACHE	0x0010	/* cache some data */
-#define	MMASK	0x0007	/* all bits on */
-
-#define	FORKPG		1
-#define	FORKEG		2
-#define	FORKFD		4
-
-#define	SG_RONLY	0040	/* read only */
-#define	SG_CEXEC	0100	/* detach on exec */
-
-enum
-{
-	RFNAMEG		= (1<<0),
-	RFENVG		= (1<<1),
-	RFFDG		= (1<<2),
-	RFNOTEG		= (1<<3),
-	RFPROC		= (1<<4),
-	RFMEM		= (1<<5),
-	RFNOWAIT	= (1<<6),
-	RFCNAMEG	= (1<<10),
-	RFCENVG		= (1<<11),
-	RFCFDG		= (1<<12),
-	RFREND		= (1<<13)
-};
-
-extern char *argv0;
-#define	ARGBEGIN	for((argv0||(argv0=*argv)),argv++,argc--;\
-			    argv[0] && argv[0][0]=='-' && argv[0][1];\
-			    argc--, argv++) {\
-				char *_args, *_argt;\
-				Rune _argc;\
-				_args = &argv[0][1];\
-				if(_args[0]=='-' && _args[1]==0){\
-					argc--; argv++; break;\
-				}\
-				_argc = 0;\
-				while(*_args && (_args += chartorune(&_argc, _args)))\
-				switch(_argc)
-#define	ARGEND		SET(_argt);USED(_argt,_argc,_args);}USED(argv, argc);
-#define	ARGF()		(_argt=_args, _args="",\
-				(*_argt? _argt: argv[1]? (argc--, *++argv): 0))
-#define	EARGF(x)	(_argt=_args, _args="",\
-				(*_argt? _argt: argv[1]? (argc--, *++argv): ((x), abort(), (char*)0)))
-
-#define	ARGC()		_argc
-
-extern	int	errstr(char*, unsigned int);
-extern	int	bind(char*, char*, int);
-extern	int	mount(int, int, char*, int, char*);
-extern	int	unmount(char*, char*);
-extern	int	rfork(int);
-extern	int	segattach(int, char*, void*, unsigned long);
-extern	int	segbrk(void*, void*);
-extern	int	segdetach(void*);
-extern	int	segflush(void*, unsigned long);
-extern	int	segfree(void*, unsigned long);
-extern	unsigned long	rendezvous(unsigned long, unsigned long);
-extern	unsigned long	getfcr(void);
-extern	unsigned long	getfsr(void);
-extern	void		setfcr(unsigned long);
-extern	void		setfsr(unsigned long);
-
-#endif

+ 0 - 24
sys/include/ape/libl.h

@@ -1,24 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __LIBL_H
-#define __LIBL_H
-#ifndef _RESEARCH_SOURCE
-   This header file is not defined in ANSI or POSIX
-#endif
-#pragma lib "/$M/lib/ape/libl.a"
-
-extern int printable(int);
-extern void allprint(int8_t);
-extern int yyracc(int);
-extern int yyreject(void);
-extern void yyless(int);
-extern int yywrap(void);
-
-#endif /* __LIBV_L */

+ 0 - 29
sys/include/ape/libnet.h

@@ -1,29 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __LIBNET_H
-#define __LIBNET_H
-#ifndef _NET_EXTENSION
-   This header file is not defined in ANSI or POSIX
-#endif
-#pragma lib "/$M/lib/ape/libnet.a"
-
-#define NETPATHLEN 40
-
-extern	int	accept(int, char*);
-extern	int	announce(char*, char*);
-extern	int	dial(char*, char*, char*, int*);
-extern	int	hangup(int);
-extern	int	listen(char*, char*);
-extern	char*	netmkaddr(char*, char*, char*);
-extern	int	reject(int, char*, char *);
-
-extern char    dialerrstr[64];
-
-#endif /* __LIBNET_H */

+ 0 - 436
sys/include/ape/libsec.h

@@ -1,436 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef _PLAN9_SOURCE
-  This header file is an extension to ANSI/POSIX
-#endif
-
-#ifndef __LIBSEC_H_
-#define __LIBSEC_H_
-#pragma	src	"/sys/src/ape/lib/sec"
-#pragma	lib	"/$M/lib/ape/libsec.a"
-
-#ifndef _MPINT
-typedef struct mpint mpint;
-#endif
-
-/*
- * AES definitions
- */
-
-enum
-{
-	AESbsize=	16,
-	AESmaxkey=	32,
-	AESmaxrounds=	14
-};
-
-typedef struct AESstate AESstate;
-struct AESstate
-{
-	uint32_t	setup;
-	int	rounds;
-	int	keybytes;
-	uint	ctrsz;
-	uint8_t	key[AESmaxkey];			/* unexpanded key */
-	uint32_t	ekey[4*(AESmaxrounds + 1)];	/* encryption key */
-	uint32_t	dkey[4*(AESmaxrounds + 1)];	/* decryption key */
-	uint8_t	ivec[AESbsize];			/* initialization vector */
-	uint8_t	mackey[3 * AESbsize];		/* 3 XCBC mac 96 keys */
-};
-
-/* block ciphers */
-void	aes_encrypt(uint32_t rk[], int Nr, uint8_t pt[16],
-			uint8_t ct[16]);
-void	aes_decrypt(uint32_t rk[], int Nr, uint8_t ct[16],
-			uint8_t pt[16]);
-
-void	setupAESstate(AESstate *s, uint8_t key[], int keybytes,
-			  uint8_t *ivec);
-void	aesCBCencrypt(uint8_t *p, int len, AESstate *s);
-void	aesCBCdecrypt(uint8_t *p, int len, AESstate *s);
-void	aesCTRdecrypt(uint8_t *p, int len, AESstate *s);
-void	aesCTRencrypt(uint8_t *p, int len, AESstate *s);
-
-void	setupAESXCBCstate(AESstate *s);
-uint8_t*	aesXCBCmac(uint8_t *p, int len, AESstate *s);
-
-/*
- * Blowfish Definitions
- */
-
-enum
-{
-	BFbsize	= 8,
-	BFrounds= 16
-};
-
-/* 16-round Blowfish */
-typedef struct BFstate BFstate;
-struct BFstate
-{
-	uint32_t	setup;
-
-	uint8_t	key[56];
-	uint8_t	ivec[8];
-
-	uint32_t 	pbox[BFrounds+2];
-	uint32_t	sbox[1024];
-};
-
-void	setupBFstate(BFstate *s, uint8_t key[], int keybytes,
-			 uint8_t *ivec);
-void	bfCBCencrypt(uint8_t*, int, BFstate*);
-void	bfCBCdecrypt(uint8_t*, int, BFstate*);
-void	bfECBencrypt(uint8_t*, int, BFstate*);
-void	bfECBdecrypt(uint8_t*, int, BFstate*);
-
-/*
- * DES definitions
- */
-
-enum
-{
-	DESbsize=	8
-};
-
-/* single des */
-typedef struct DESstate DESstate;
-struct DESstate
-{
-	uint32_t	setup;
-	uint8_t	key[8];		/* unexpanded key */
-	uint32_t	expanded[32];	/* expanded key */
-	uint8_t	ivec[8];	/* initialization vector */
-};
-
-void	setupDESstate(DESstate *s, uint8_t key[8], uint8_t *ivec);
-void	des_key_setup(uint8_t[8], uint32_t[32]);
-void	block_cipher(uint32_t*, uint8_t*, int);
-void	desCBCencrypt(uint8_t*, int, DESstate*);
-void	desCBCdecrypt(uint8_t*, int, DESstate*);
-void	desECBencrypt(uint8_t*, int, DESstate*);
-void	desECBdecrypt(uint8_t*, int, DESstate*);
-
-/* for backward compatibility with 7-byte DES key format */
-void	des56to64(uint8_t *k56, uint8_t *k64);
-void	des64to56(uint8_t *k64, uint8_t *k56);
-void	key_setup(uint8_t[7], uint32_t[32]);
-
-/* triple des encrypt/decrypt orderings */
-enum {
-	DES3E=		0,
-	DES3D=		1,
-	DES3EEE=	0,
-	DES3EDE=	2,
-	DES3DED=	5,
-	DES3DDD=	7
-};
-
-typedef struct DES3state DES3state;
-struct DES3state
-{
-	uint32_t	setup;
-	uint8_t	key[3][8];		/* unexpanded key */
-	uint32_t	expanded[3][32];	/* expanded key */
-	uint8_t	ivec[8];		/* initialization vector */
-};
-
-void	setupDES3state(DES3state *s, uint8_t key[3][8], uint8_t *ivec);
-void	triple_block_cipher(uint32_t keys[3][32], uint8_t*, int);
-void	des3CBCencrypt(uint8_t*, int, DES3state*);
-void	des3CBCdecrypt(uint8_t*, int, DES3state*);
-void	des3ECBencrypt(uint8_t*, int, DES3state*);
-void	des3ECBdecrypt(uint8_t*, int, DES3state*);
-
-/*
- * digests
- */
-
-enum
-{
-	SHA1dlen=	20,	/* SHA digest length */
-	SHA2_224dlen=	28,	/* SHA-224 digest length */
-	SHA2_256dlen=	32,	/* SHA-256 digest length */
-	SHA2_384dlen=	48,	/* SHA-384 digest length */
-	SHA2_512dlen=	64,	/* SHA-512 digest length */
-	MD4dlen=	16,	/* MD4 digest length */
-	MD5dlen=	16,	/* MD5 digest length */
-	AESdlen=	16,	/* TODO: see rfc */
-
-	Hmacblksz	= 64,	/* in bytes; from rfc2104 */
-};
-
-typedef struct DigestState DigestState;
-struct DigestState
-{
-	uint64_t	len;
-	union {
-		uint32_t	state[8];
-		uint64_t	bstate[8];
-	};
-	uint8_t	buf[256];
-	int	blen;
-	char	malloced;
-	char	seeded;
-};
-typedef struct DigestState SHAstate;	/* obsolete name */
-typedef struct DigestState SHA1state;
-typedef struct DigestState SHA2_224state;
-typedef struct DigestState SHA2_256state;
-typedef struct DigestState SHA2_384state;
-typedef struct DigestState SHA2_512state;
-typedef struct DigestState MD5state;
-typedef struct DigestState MD4state;
-typedef struct DigestState AEShstate;
-
-DigestState*	md4(uint8_t*, uint32_t, uint8_t*, DigestState*);
-DigestState*	md5(uint8_t*, uint32_t, uint8_t*, DigestState*);
-DigestState*	sha1(uint8_t*, uint32_t, uint8_t*, DigestState*);
-DigestState*	sha2_224(uint8_t*, uint32_t, uint8_t*, DigestState*);
-DigestState*	sha2_256(uint8_t*, uint32_t, uint8_t*, DigestState*);
-DigestState*	sha2_384(uint8_t*, uint32_t, uint8_t*, DigestState*);
-DigestState*	sha2_512(uint8_t*, uint32_t, uint8_t*, DigestState*);
-DigestState*	aes(uint8_t*, uint32_t, uint8_t*, DigestState*);
-DigestState*	hmac_x(uint8_t *p, uint32_t len, uint8_t *key,
-			   uint32_t klen,
-			uint8_t *digest, DigestState *s,
-			DigestState*(*x)(uint8_t*, uint32_t, uint8_t*, DigestState*),
-			int xlen);
-DigestState*	hmac_md5(uint8_t*, uint32_t, uint8_t*, uint32_t,
-			     uint8_t*,
-			     DigestState*);
-DigestState*	hmac_sha1(uint8_t*, uint32_t, uint8_t*, uint32_t,
-			      uint8_t*,
-			      DigestState*);
-DigestState*	hmac_sha2_224(uint8_t*, uint32_t, uint8_t*, uint32_t,
-				  uint8_t*, DigestState*);
-DigestState*	hmac_sha2_256(uint8_t*, uint32_t, uint8_t*, uint32_t,
-				  uint8_t*, DigestState*);
-DigestState*	hmac_sha2_384(uint8_t*, uint32_t, uint8_t*, uint32_t,
-				  uint8_t*, DigestState*);
-DigestState*	hmac_sha2_512(uint8_t*, uint32_t, uint8_t*, uint32_t,
-				  uint8_t*, DigestState*);
-DigestState*	hmac_aes(uint8_t*, uint32_t, uint8_t*, uint32_t,
-			     uint8_t*,
-			     DigestState*);
-char*		md5pickle(MD5state*);
-MD5state*	md5unpickle(char*);
-char*		sha1pickle(SHA1state*);
-SHA1state*	sha1unpickle(char*);
-
-/*
- * random number generation
- */
-void	genrandom(uint8_t *buf, int nbytes);
-void	prng(uint8_t *buf, int nbytes);
-uint32_t	fastrand(void);
-uint32_t	nfastrand(uint32_t);
-
-/*
- * primes
- */
-void	genprime(mpint *p, int n, int accuracy); /* generate n-bit probable prime */
-void	gensafeprime(mpint *p, mpint *alpha, int n, int accuracy); /* prime & generator */
-void	genstrongprime(mpint *p, int n, int accuracy); /* generate n-bit strong prime */
-void	DSAprimes(mpint *q, mpint *p, uint8_t seed[SHA1dlen]);
-int	probably_prime(mpint *n, int nrep);	/* miller-rabin test */
-int	smallprimetest(mpint *p);  /* returns -1 if not prime, 0 otherwise */
-
-/*
- * rc4
- */
-typedef struct RC4state RC4state;
-struct RC4state
-{
-	 uint8_t	state[256];
-	 uint8_t	x;
-	 uint8_t	y;
-};
-
-void	setupRC4state(RC4state*, uint8_t*, int);
-void	rc4(RC4state*, uint8_t*, int);
-void	rc4skip(RC4state*, int);
-void	rc4back(RC4state*, int);
-
-/*
- * rsa
- */
-typedef struct RSApub RSApub;
-typedef struct RSApriv RSApriv;
-typedef struct PEMChain PEMChain;
-
-/* public/encryption key */
-struct RSApub
-{
-	mpint	*n;	/* modulus */
-	mpint	*ek;	/* exp (encryption key) */
-};
-
-/* private/decryption key */
-struct RSApriv
-{
-	RSApub	pub;
-
-	mpint	*dk;	/* exp (decryption key) */
-
-	/* precomputed values to help with chinese remainder theorem calc */
-	mpint	*p;
-	mpint	*q;
-	mpint	*kp;	/* dk mod p-1 */
-	mpint	*kq;	/* dk mod q-1 */
-	mpint	*c2;	/* (inv p) mod q */
-};
-
-struct PEMChain{
-	PEMChain*next;
-	uint8_t	*pem;
-	int	pemlen;
-};
-
-RSApriv*	rsagen(int nlen, int elen, int rounds);
-RSApriv*	rsafill(mpint *n, mpint *e, mpint *d, mpint *p, mpint *q);
-mpint*		rsaencrypt(RSApub *k, mpint *in, mpint *out);
-mpint*		rsadecrypt(RSApriv *k, mpint *in, mpint *out);
-RSApub*		rsapuballoc(void);
-void		rsapubfree(RSApub*);
-RSApriv*	rsaprivalloc(void);
-void		rsaprivfree(RSApriv*);
-RSApub*		rsaprivtopub(RSApriv*);
-RSApub*		X509toRSApub(uint8_t*, int, char*, int);
-RSApriv*	asn1toRSApriv(uint8_t*, int);
-void		asn1dump(uint8_t *der, int len);
-uint8_t*		decodePEM(char *s, char *type, int *len,
-				  char **new_s);
-PEMChain*	decodepemchain(char *s, char *type);
-uint8_t*		X509gen(RSApriv *priv, char *subj,
-				uint32_t valid[2],
-			      int *certlen);
-uint8_t*		X509req(RSApriv *priv, char *subj, int *certlen);
-char*		X509verify(uint8_t *cert, int ncert, RSApub *pk);
-void		X509dump(uint8_t *cert, int ncert);
-
-/*
- * elgamal
- */
-typedef struct EGpub EGpub;
-typedef struct EGpriv EGpriv;
-typedef struct EGsig EGsig;
-
-/* public/encryption key */
-struct EGpub
-{
-	mpint	*p;	/* modulus */
-	mpint	*alpha;	/* generator */
-	mpint	*key;	/* (encryption key) alpha**secret mod p */
-};
-
-/* private/decryption key */
-struct EGpriv
-{
-	EGpub	pub;
-	mpint	*secret;	/* (decryption key) */
-};
-
-/* signature */
-struct EGsig
-{
-	mpint	*r, *s;
-};
-
-EGpriv*		eggen(int nlen, int rounds);
-mpint*		egencrypt(EGpub *k, mpint *in, mpint *out);	/* deprecated */
-mpint*		egdecrypt(EGpriv *k, mpint *in, mpint *out);
-EGsig*		egsign(EGpriv *k, mpint *m);
-int		egverify(EGpub *k, EGsig *sig, mpint *m);
-EGpub*		egpuballoc(void);
-void		egpubfree(EGpub*);
-EGpriv*		egprivalloc(void);
-void		egprivfree(EGpriv*);
-EGsig*		egsigalloc(void);
-void		egsigfree(EGsig*);
-EGpub*		egprivtopub(EGpriv*);
-
-/*
- * dsa
- */
-typedef struct DSApub DSApub;
-typedef struct DSApriv DSApriv;
-typedef struct DSAsig DSAsig;
-
-/* public/encryption key */
-struct DSApub
-{
-	mpint	*p;	/* modulus */
-	mpint	*q;	/* group order, q divides p-1 */
-	mpint	*alpha;	/* group generator */
-	mpint	*key;	/* (encryption key) alpha**secret mod p */
-};
-
-/* private/decryption key */
-struct DSApriv
-{
-	DSApub	pub;
-	mpint	*secret;	/* (decryption key) */
-};
-
-/* signature */
-struct DSAsig
-{
-	mpint	*r, *s;
-};
-
-DSApriv*	dsagen(DSApub *opub);	/* opub not checked for consistency! */
-DSAsig*		dsasign(DSApriv *k, mpint *m);
-int		dsaverify(DSApub *k, DSAsig *sig, mpint *m);
-DSApub*		dsapuballoc(void);
-void		dsapubfree(DSApub*);
-DSApriv*	dsaprivalloc(void);
-void		dsaprivfree(DSApriv*);
-DSAsig*		dsasigalloc(void);
-void		dsasigfree(DSAsig*);
-DSApub*		dsaprivtopub(DSApriv*);
-DSApriv*	asn1toDSApriv(uint8_t*, int);
-
-/*
- * TLS
- */
-typedef struct Thumbprint{
-	struct Thumbprint *next;
-	uint8_t	sha1[SHA1dlen];
-} Thumbprint;
-
-typedef struct TLSconn{
-	char	dir[40];	/* connection directory */
-	uint8_t	*cert;	/* certificate (local on input, remote on output) */
-	uint8_t	*sessionID;
-	int	certlen;
-	int	sessionIDlen;
-	int	(*trace)(char*fmt, ...);
-	PEMChain*chain;	/* optional extra certificate evidence for servers to present */
-	char	*sessionType;
-	uint8_t	*sessionKey;
-	int	sessionKeylen;
-	char	*sessionConst;
-} TLSconn;
-
-/* tlshand.c */
-int tlsClient(int fd, TLSconn *c);
-int tlsServer(int fd, TLSconn *c);
-
-/* thumb.c */
-Thumbprint* initThumbprints(char *ok, char *crl);
-void	freeThumbprints(Thumbprint *ok);
-int	okThumbprint(uint8_t *sha1, Thumbprint *ok);
-
-/* readcert.c */
-uint8_t	*readcert(char *filename, int *pcertlen);
-PEMChain*readcertchain(char *filename);
-
-#endif

+ 0 - 48
sys/include/ape/libv.h

@@ -1,48 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __LIBV_H
-#define __LIBV_H
-#ifndef _RESEARCH_SOURCE
-   This header file is not defined in ANSI or POSIX
-#endif
-#pragma lib "/$M/lib/ape/libv.a"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern void	srand(unsigned int);
-extern int	rand(void);
-extern int	nrand(int);
-extern int32_t	lrand(void);
-extern double	frand(void);
-
-extern char	*getpass(char *);
-extern int	tty_echoon(int);
-extern int	tty_echooff(int);
-
-extern int	min(int, int);
-extern int	max(int, int);
-
-extern void	_perror(char *);
-extern char	*_progname;
-
-extern int	nap(int);
-
-extern char	*setfields(char *);
-extern int	getfields(char *, char **, int);
-extern int	getmfields(char *, char **, int);
-
-
-#ifdef __cplusplus
-};
-#endif
-
-#endif /* __LIBV_H */

+ 0 - 96
sys/include/ape/limits.h

@@ -1,96 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __LIMITS
-#define __LIMITS
-/* 8 bit chars (signed), 16 bit shorts, 32 bit ints/longs */
-
-#define CHAR_BIT	8
-#define MB_LEN_MAX	4
-
-#define UCHAR_MAX	0xff
-#define USHRT_MAX	0xffff
-#define UINT_MAX	0xffffffffU
-#define ULONG_MAX	0xffffffffUL
-
-#define CHAR_MAX	SCHAR_MAX
-#define SCHAR_MAX	0x7f
-#define SHRT_MAX	0x7fff
-#define INT_MAX		0x7fffffff
-#define LONG_MAX	0x7fffffffL
-
-#define CHAR_MIN	SCHAR_MIN
-#define SCHAR_MIN	(-SCHAR_MAX-1)
-#define SHRT_MIN	(-SHRT_MAX-1)
-#define INT_MIN		(-INT_MAX-1)
-#define LONG_MIN	(-LONG_MAX-1)
-
-#ifdef _POSIX_SOURCE
-
-#define _POSIX_AIO_LISTIO_MAX	2
-#define _POSIX_AIO_MAX			1
-#define _POSIX_ARG_MAX			4096
-#define _POSIX_CHILD_MAX		6
-#define	_POSIX_CLOCKRES_MIN		20000000
-#define	_POSIX_DELAYTIMER_MAX	32
-#define _POSIX_LINK_MAX			8
-#define _POSIX_MAX_CANON		255
-#define _POSIX_MAX_INPUT		255
-#define _POSIX_MQ_OPEN_MAX		8
-#define	_POSIX_MQ_PRIO_MAX		32
-#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_RTSIG_MAX		8
-#define	_POSIX_SEM_NSEMS_MAX	256
-#define	_POSIX_SEM_VALUE_MAX	32767
-#define	_POSIX_SIGQUEUE_MAX		32
-#define _POSIX_SSIZE_MAX		32767
-#define _POSIX_STREAM_MAX		8
-#define	_POSIX_TIMER_MAX		32
-#define _POSIX_TZNAME_MAX		3
-
-
-/* pedagogy: those that standard allows omitting are commented out */
-/*#define AIO_LIST_MAX _POSIX_AIO_LIST_MAX */
-/*#define AIO_MAX _POSIX_AIO_MAX */
-/*#define AIO_PRIO_DELTA_MAX 0 */
-/*#define ARG_MAX _POSIX_ARG_MAX */
-/*#define CHILD_MAX _POSIX_CHILD_MAX */
-/*#define DELAYTIMER_MAX _POSIX_DELAYTIMER_MAX */
-/*#define LINK_MAX _POSIX_LINK_MAX */
-/*#define MAX_CANON _POSIX_MAX_CANON */
-/*#define MAX_INPUT _POSIX_MAX_INPUT */
-/*#define MQ_OPEN_MAX _POSIX_MQ_OPEN_MAX */
-/*#define MQ_PRIO_MAX _POSIX_MQ_PRIO_MAX */
-/*#define NAME_MAX _POSIX_NAME_MAX */
-#define NGROUPS_MAX 10
-/*#define OPEN_MAX _POSIX_OPEN_MAX */
-/*#define PAGESIZE 1 */
-#define PASS_MAX	64
-/*#define PATH_MAX _POSIX_PATH_MAX */
-/*#define PIPE_BUF _POSIX_PIPE_BUF */
-/*#define RTSIG_MAX _POSIX_RTSIG_MAX */
-/*#define SEM_NSEMS_MAX _POSIX_SEM_NSEMS_MAX */
-/*#define SEM_VALUE_MAX _POSIX_SEM_VALUE_MAX */
-/*#define SIGQUEUE_MAX _POSIX_SIGQUEUE_MAX */
-#define SSIZE_MAX LONG_MAX
-/*#define STREAM_MAX _POSIX_STREAM_MAX */
-/*#define TIMER_MAX _POSIX_TIMER_MAX */
-#define TZNAME_MAX _POSIX_TZNAME_MAX
-
-#ifdef _LIMITS_EXTENSION
-/* some things are just too big for pedagogy (X!) */
-#include <sys/limits.h>
-#endif
-#endif /* _POSIX_SOURCE */
-
-#endif /* __LIMITS */

+ 0 - 55
sys/include/ape/locale.h

@@ -1,55 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __LOCALE
-#define __LOCALE
-#pragma lib "/$M/lib/ape/libap.a"
-
-#include <stddef.h>
-
-#define LC_ALL		0
-#define LC_COLLATE	1
-#define LC_CTYPE	2
-#define LC_MONETARY	3
-#define LC_NUMERIC	4
-#define LC_TIME		5
-
-struct lconv {
-	char *decimal_point;
-	char *thousands_sep;
-	char *grouping;
-	char *int_curr_symbol;
-	char *currency_symbol;
-	char *mon_decimal_point;
-	char *mon_thousands_sep;
-	char *mon_grouping;
-	char *positive_sign;
-	char *negative_sign;
-	char int_frac_digits;
-	char frac_digits;
-	char p_cs_precedes;
-	char p_sep_by_space;
-	char n_cs_precedes;
-	char n_sep_by_space;
-	char p_sign_posn;
-	char n_sign_posn;
-};
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern char *setlocale(int, const char *);
-extern struct lconv *localeconv(void);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __LOCALE */

+ 0 - 39
sys/include/ape/lock.h

@@ -1,39 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#if !defined(_RESEARCH_SOURCE) && !defined(_PLAN9_SOURCE)
-   This header file is an extension of ANSI/POSIX
-#endif
-
-#ifndef __LOCK_H
-#define __LOCK_H
-#pragma lib "/$M/lib/ape/libap.a"
-
-#include <u.h>
-
-typedef struct
-{
-	int32_t	key;
-	int32_t	sem;
-} Lock;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern	void	lock(Lock*);
-extern	void	unlock(Lock*);
-extern	int	canlock(Lock*);
-extern	int	tas(int*);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 15
sys/include/ape/mouse.h

@@ -1,15 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef _PLAN9_SOURCE
-  This header file is an extension to ANSI/POSIX
-#endif
-
-#include "/sys/include/mouse.h"
-

+ 0 - 162
sys/include/ape/mp.h

@@ -1,162 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef _PLAN9_SOURCE
-  This header file is an extension to ANSI/POSIX
-#endif
-
-#ifndef __LIBMP_H_
-#define __LIBMP_H_
-
-#pragma	src	"/sys/src/ape/lib/mp"
-#pragma	lib	"/$M/lib/ape/libmp.a"
-
-typedef unsigned int	mpdigit;	/* from /$objtype/include/u.h */
-
-#define _MPINT 1
-
-/*
- * the code assumes mpdigit to be at least an int
- * mpdigit must be an atomic type.  mpdigit is defined
- * in the architecture specific u.h
- */
-
-typedef struct mpint mpint;
-
-struct mpint
-{
-	int	sign;	/* +1 or -1 */
-	int	size;	/* allocated digits */
-	int	top;	/* significant digits */
-	mpdigit	*p;
-	char	flags;
-};
-
-enum
-{
-	MPstatic=	0x01,
-	Dbytes=		sizeof(mpdigit),	/* bytes per digit */
-	Dbits=		Dbytes*8		/* bits per digit */
-};
-
-/* allocation */
-void	mpsetminbits(int n);	/* newly created mpint's get at least n bits */
-mpint*	mpnew(int n);		/* create a new mpint with at least n bits */
-void	mpfree(mpint *b);
-void	mpbits(mpint *b, int n);	/* ensure that b has at least n bits */
-void	mpnorm(mpint *b);		/* dump leading zeros */
-mpint*	mpcopy(mpint *b);
-void	mpassign(mpint *old, mpint *new);
-
-/* random bits */
-mpint*	mprand(int bits, void (*gen)(uint8_t*, int), mpint *b);
-
-/* conversion */
-mpint*	strtomp(char*, char**, int, mpint*);	/* ascii */
-int	mpfmt(Fmt*);
-char*	mptoa(mpint*, int, char*, int);
-mpint*	letomp(uint8_t*, uint, mpint*);	/* byte array, little-endian */
-int	mptole(mpint*, uint8_t*, uint, uint8_t**);
-mpint*	betomp(uint8_t*, uint, mpint*);	/* byte array, little-endian */
-int	mptobe(mpint*, uint8_t*, uint, uint8_t**);
-uint	mptoui(mpint*);			/* unsigned int */
-mpint*	uitomp(uint, mpint*);
-int	mptoi(mpint*);			/* int */
-mpint*	itomp(int, mpint*);
-uint64_t	mptouv(mpint*);			/* unsigned vlong */
-mpint*	uvtomp(uint64_t, mpint*);
-int64_t	mptov(mpint*);			/* vlong */
-mpint*	vtomp(int64_t, mpint*);
-
-/* divide 2 digits by one */
-void	mpdigdiv(mpdigit *dividend, mpdigit divisor, mpdigit *quotient);
-
-/* in the following, the result mpint may be */
-/* the same as one of the inputs. */
-void	mpadd(mpint *b1, mpint *b2, mpint *sum);	/* sum = b1+b2 */
-void	mpsub(mpint *b1, mpint *b2, mpint *diff);	/* diff = b1-b2 */
-void	mpleft(mpint *b, int shift, mpint *res);	/* res = b<<shift */
-void	mpright(mpint *b, int shift, mpint *res);	/* res = b>>shift */
-void	mpmul(mpint *b1, mpint *b2, mpint *prod);	/* prod = b1*b2 */
-void	mpexp(mpint *b, mpint *e, mpint *m, mpint *res);	/* res = b**e mod m */
-void	mpmod(mpint *b, mpint *m, mpint *remainder);	/* remainder = b mod m */
-
-/* quotient = dividend/divisor, remainder = dividend % divisor */
-void	mpdiv(mpint *dividend, mpint *divisor,  mpint *quotient, mpint *remainder);
-
-/* return neg, 0, pos as b1-b2 is neg, 0, pos */
-int	mpcmp(mpint *b1, mpint *b2);
-
-/* extended gcd return d, x, and y, s.t. d = gcd(a,b) and ax+by = d */
-void	mpextendedgcd(mpint *a, mpint *b, mpint *d, mpint *x, mpint *y);
-
-/* res = b**-1 mod m */
-void	mpinvert(mpint *b, mpint *m, mpint *res);
-
-/* bit counting */
-int	mpsignif(mpint*);	/* number of sigificant bits in mantissa */
-int	mplowbits0(mpint*);	/* k, where n = 2**k * q for odd q */
-
-/* well known constants */
-extern mpint	*mpzero, *mpone, *mptwo;
-
-/* sum[0:alen] = a[0:alen-1] + b[0:blen-1] */
-/* prereq: alen >= blen, sum has room for alen+1 digits */
-void	mpvecadd(mpdigit *a, int alen, mpdigit *b, int blen, mpdigit *sum);
-
-/* diff[0:alen-1] = a[0:alen-1] - b[0:blen-1] */
-/* prereq: alen >= blen, diff has room for alen digits */
-void	mpvecsub(mpdigit *a, int alen, mpdigit *b, int blen, mpdigit *diff);
-
-/* p[0:n] += m * b[0:n-1] */
-/* prereq: p has room for n+1 digits */
-void	mpvecdigmuladd(mpdigit *b, int n, mpdigit m, mpdigit *p);
-
-/* p[0:n] -= m * b[0:n-1] */
-/* prereq: p has room for n+1 digits */
-int	mpvecdigmulsub(mpdigit *b, int n, mpdigit m, mpdigit *p);
-
-/* p[0:alen*blen-1] = a[0:alen-1] * b[0:blen-1] */
-/* prereq: alen >= blen, p has room for m*n digits */
-void	mpvecmul(mpdigit *a, int alen, mpdigit *b, int blen, mpdigit *p);
-
-/* sign of a - b or zero if the same */
-int	mpveccmp(mpdigit *a, int alen, mpdigit *b, int blen);
-
-/* divide the 2 digit dividend by the one digit divisor and stick in quotient */
-/* we assume that the result is one digit - overflow is all 1's */
-void	mpdigdiv(mpdigit *dividend, mpdigit divisor, mpdigit *quotient);
-
-/* playing with magnitudes */
-int	mpmagcmp(mpint *b1, mpint *b2);
-void	mpmagadd(mpint *b1, mpint *b2, mpint *sum);	/* sum = b1+b2 */
-void	mpmagsub(mpint *b1, mpint *b2, mpint *sum);	/* sum = b1+b2 */
-
-/* chinese remainder theorem */
-typedef struct CRTpre	CRTpre;		/* precomputed values for converting */
-					/*  twixt residues and mpint */
-typedef struct CRTres	CRTres;		/* residue form of an mpint */
-
-#pragma incomplete CRTpre
-
-struct CRTres
-{
-	int	n;		/* number of residues */
-	mpint	*r[1];		/* residues */
-};
-
-CRTpre*	crtpre(int, mpint**);			/* precompute conversion values */
-CRTres*	crtin(CRTpre*, mpint*);			/* convert mpint to residues */
-void	crtout(CRTpre*, CRTres*, mpint*);	/* convert residues to mpint */
-void	crtprefree(CRTpre*);
-void	crtresfree(CRTres*);
-
-
-#pragma	varargck	type	"B"	mpint*
-#endif

+ 0 - 130
sys/include/ape/netdb.h

@@ -1,130 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __NETDB_H__
-#define __NETDB_H__
-
-#ifndef _BSD_EXTENSION
-    This header file is an extension to ANSI/POSIX
-#endif
-
-#pragma lib "/$M/lib/ape/libbsd.a"
-
-/*-
- * Copyright (c) 1980, 1983, 1988 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that: (1) source distributions retain this entire copyright
- * notice and comment, and (2) distributions including binaries display
- * the following acknowledgement:  ``This product includes software
- * developed by the University of California, Berkeley and its contributors''
- * in the documentation or other materials provided with the distribution
- * and in all advertising materials mentioning features or use of this
- * software. Neither the name of the University nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- *	@(#)netdb.h	5.11 (Berkeley) 5/21/90
- */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Structures returned by network data base library.  All addresses are
- * supplied in host order, and returned in network order (suitable for
- * use in system calls).
- */
-struct	hostent {
-	char	*h_name;	/* official name of host */
-	char	**h_aliases;	/* alias list */
-	int	h_addrtype;	/* host address type */
-	int	h_length;	/* length of address */
-	char	**h_addr_list;	/* list of addresses from name server */
-#define	h_addr	h_addr_list[0]	/* address, for backward compatiblity */
-};
-
-/*
- * Assumption here is that a network number
- * fits in 32 bits -- probably a poor one.
- */
-struct	netent {
-	char		*n_name;	/* official name of net */
-	char		**n_aliases;	/* alias list */
-	int		n_addrtype;	/* net address type */
-	unsigned long	n_net;		/* network # */
-};
-
-struct	servent {
-	char	*s_name;	/* official service name */
-	char	**s_aliases;	/* alias list */
-	int	s_port;		/* port # */
-	char	*s_proto;	/* protocol to use */
-};
-
-struct	protoent {
-	char	*p_name;	/* official protocol name */
-	char	**p_aliases;	/* alias list */
-	int	p_proto;	/* protocol # */
-};
-
-/* from 4.0 RPCSRC */
-struct rpcent {
-	char	*r_name;	/* name of server for this rpc program */
-	char	**r_aliases;	/* alias list */
-	int	r_number;	/* rpc program number */
-};
-
-extern struct hostent	*gethostbyname(const char *),
-			*gethostbyaddr(const void *, int, int),
-			*gethostent(void);
-extern struct netent	*getnetbyname(const char *),
-			*getnetbyaddr(int32_t, int),
-			*getnetent(void);
-extern struct servent	*getservbyname(const char *, const char *),
-			*getservbyport(int, const char *),
-			*getservent(void);
-extern struct protoent	*getprotobyname(const char *),
-			*getprotobynumber(int),
-			*getprotoent(void);
-extern struct rpcent	*getrpcbyname(const char *), 
-			*getrpcbynumber(int), 
-			*getrpcent(void);
-extern void sethostent(int),  endhostent(void),
-	    setnetent(int),   endnetent(void),
-	    setservent(int),  endservent(void),
-	    setprotoent(int), endprotoent(void),
-	    setrpcent(int),   endrpcent(void);
-
-/*
- * Error return codes from gethostbyname() and gethostbyaddr()
- * (left in extern int h_errno).
- */
-extern int h_errno;
-extern void herror(const char *);
-extern char *hstrerror(int);
-
-#define	HOST_NOT_FOUND	1 /* Authoritative Answer Host not found */
-#define	TRY_AGAIN	2 /* Non-Authoritive Host not found, or SERVERFAIL */
-#define	NO_RECOVERY	3 /* Non recoverable errors, FORMERR, REFUSED, NOTIMP */
-#define	NO_DATA		4 /* Valid name, no data record of requested type */
-#define	NO_ADDRESS	NO_DATA		/* no address, look for MX record */
-
-#define __HOST_SVC_NOT_AVAIL 99		/* libc internal use only */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !__NETDB_H__ */

+ 0 - 156
sys/include/ape/netinet/in.h

@@ -1,156 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __netinet_in__
-#define __netinet_in__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Copyright (c) 1982, 1986, 1990 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution is only permitted until one year after the first shipment
- * of 4.4BSD by the Regents.  Otherwise, redistribution and use in source and
- * binary forms are permitted provided that: (1) source distributions retain
- * this entire copyright notice and comment, and (2) distributions including
- * binaries display the following acknowledgement:  This product includes
- * software developed by the University of California, Berkeley and its
- * contributors'' in the documentation or other materials provided with the
- * distribution and in all advertising materials mentioning features or use
- * of this software.  Neither the name of the University nor the names of
- * its contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- *	@(#)in.h	7.10 (Berkeley) 6/28/90 plus MULTICAST 1.1
- */
-
-/*
- * Constants and structures defined by the internet system,
- * Per RFC 790, September 1981.
- */
-
-/*
- * Protocols
- */
-#define	IPPROTO_IP		0		/* dummy for IP */
-#define	IPPROTO_ICMP		1		/* control message protocol */
-#define	IPPROTO_GGP		3		/* gateway^2 (deprecated) */
-#define	IPPROTO_TCP		6		/* tcp */
-#define	IPPROTO_EGP		8		/* exterior gateway protocol */
-#define	IPPROTO_PUP		12		/* pup */
-#define	IPPROTO_UDP		17		/* user datagram protocol */
-#define	IPPROTO_IDP		22		/* xns idp */
-#define	IPPROTO_TP		29 		/* tp-4 w/ class negotiation */
-#define	IPPROTO_EON		80		/* ISO cnlp */
-
-#define	IPPROTO_RAW		255		/* raw IP packet */
-#define	IPPROTO_MAX		256
-
-
-/*
- * Local port number conventions:
- * Ports < IPPORT_RESERVED are reserved for
- * privileged processes (e.g. root).
- * Ports > IPPORT_USERRESERVED are reserved
- * for servers, not necessarily privileged.
- */
-#define	IPPORT_RESERVED		1024
-#define	IPPORT_USERRESERVED	5000
-
-/*
- * Internet address (a structure for historical reasons)
- */
-struct in_addr {
-	unsigned long s_addr;
-};
-
-/*
- * Definitions of bits in internet address integers.
- * On subnets, the decomposition of addresses to host and net parts
- * is done according to subnet mask, not the masks here.
- */
-#define	IN_CLASSA(i)		(((int32_t)(i) & 0x80000000) == 0)
-#define	IN_CLASSA_NET		0xff000000
-#define	IN_CLASSA_NSHIFT	24
-#define	IN_CLASSA_HOST		0x00ffffff
-#define	IN_CLASSA_MAX		128
-
-#define	IN_CLASSB(i)		(((int32_t)(i) & 0xc0000000) == 0x80000000)
-#define	IN_CLASSB_NET		0xffff0000
-#define	IN_CLASSB_NSHIFT	16
-#define	IN_CLASSB_HOST		0x0000ffff
-#define	IN_CLASSB_MAX		65536
-
-#define	IN_CLASSC(i)		(((int32_t)(i) & 0xe0000000) == 0xc0000000)
-#define	IN_CLASSC_NET		0xffffff00
-#define	IN_CLASSC_NSHIFT	8
-#define	IN_CLASSC_HOST		0x000000ff
-
-#define	IN_CLASSD(i)		(((int32_t)(i) & 0xf0000000) == 0xe0000000)
-#define	IN_MULTICAST(i)		IN_CLASSD(i)
-
-#define	IN_EXPERIMENTAL(i)	(((int32_t)(i) & 0xe0000000) == 0xe0000000)
-#define	IN_BADCLASS(i)		(((int32_t)(i) & 0xf0000000) == 0xf0000000)
-
-#define	INADDR_ANY		(unsigned long)0x00000000
-#define	INADDR_BROADCAST	(unsigned long)0xffffffff	/* must be masked */
-#define INADDR_NONE		(unsigned long)0xffffffff	/* -1 return */
-
-#define	IN_LOOPBACKNET		127			/* official! */
-
-/*
- * Socket address, internet style.
- */
-struct sockaddr_in {
-	int16_t	sin_family;
-	unsigned short	sin_port;
-	struct	in_addr sin_addr;
-	char	sin_zero[8];
-};
-
-/*
- * Structure used to describe IP options.
- * Used to store options internally, to pass them to a process,
- * or to restore options retrieved earlier.
- * The ip_dst is used for the first-hop gateway when using a source route
- * (this gets put into the header proper).
- */
-struct ip_opts {
-	struct	in_addr ip_dst;		/* first hop, 0 w/o src rt */
-	char	ip_opts[40];		/* actually variable in size */
-};
-
-/*
- * Options for use with [gs]etsockopt at the IP level.
- * First word of comment is data type; bool is stored in int.
- */
-#define	IP_OPTIONS	1	/* buf/ip_opts; set/get IP per-packet options */
-#define	IP_HDRINCL	7	/* int; header is included with data (raw) */
-#define	IP_TOS		8	/* int; IP type of service and precedence */
-#define	IP_TTL		9	/* int; IP time to live */
-
-extern unsigned long	ntohl(unsigned long x);
-extern unsigned short	ntohs(unsigned short x);
-extern unsigned long	htonl(unsigned long x);
-extern unsigned short	htons(unsigned short x);
-extern unsigned long	inet_addr(char*);
-extern char*		inet_ntoa(struct in_addr);
-extern unsigned long	nptohl(void*);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __netinet_in__ */

+ 0 - 9
sys/include/ape/netinet/tcp.h

@@ -1,9 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-

+ 0 - 37
sys/include/ape/pwd.h

@@ -1,37 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __PWD
-#define __PWD
-#ifndef _POSIX_SOURCE
-   This header file is not defined in pure ANSI
-#endif
-#pragma lib "/$M/lib/ape/libap.a"
-#include <sys/types.h>
-
-struct passwd {
-	char	*pw_name;
-	uid_t	pw_uid;
-	gid_t	pw_gid;
-	char	*pw_dir;
-	char	*pw_shell;
-};
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern struct passwd *getpwuid(uid_t);
-extern struct passwd *getpwnam(const char *);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 50
sys/include/ape/qlock.h

@@ -1,50 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef _PLAN9_SOURCE
-  This header file is an extension to ANSI/POSIX
-#endif
-
-#ifndef __QLOCK_H_
-#define __QLOCK_H_
-#pragma lib "/$M/lib/ape/lib9.a"
-
-#include <u.h>
-#include <lock.h>
-
-typedef struct QLp QLp;
-struct QLp
-{
-	int	inuse;
-	QLp	*next;
-	char	state;
-};
-
-typedef
-struct QLock
-{
-	Lock	lock;
-	int	locked;
-	QLp	*head;
-	QLp 	*tail;
-} QLock;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern	void	qlock(QLock*);
-extern	void	qunlock(QLock*);
-extern	int	canqlock(QLock*);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 86
sys/include/ape/regexp.h

@@ -1,86 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __REGEXP_H
-#define __REGEXP_H
-#ifndef _REGEXP_EXTENSION
-    This header file is an extension to ANSI/POSIX
-#endif
-#pragma lib "/$M/lib/ape/libregexp.a"
-
-#ifdef	UTF
-#define	Runeself	0xA0
-#else
-#define	Runeself	0
-#endif
-
-typedef struct Resub		Resub;
-typedef struct Reclass		Reclass;
-typedef struct Reinst		Reinst;
-typedef struct Reprog		Reprog;
-
-/*
- *	Sub expression matches
- */
-struct Resub{
-	union
-	{
-		char *sp;
-		wchar_t *rsp;
-	} s;
-	union
-	{
-		char *ep;
-		wchar_t *rep;
-	} e;
-};
-
-/*
- *	character class, each pair of rune's defines a range
- */
-struct Reclass{
-	wchar_t	*end;
-	wchar_t	spans[64];
-};
-
-/*
- *	Machine instructions
- */
-struct Reinst{
-	int	type;			/* < 0200 ==> literal, otherwise action */
-	union	{
-		Reclass	*cp;		/* class pointer */
-		wchar_t	r;		/* character */
-		int	subid;		/* sub-expression id for RBRA and LBRA */
-		Reinst	*right;		/* right child of OR */
-	} r;
-	union {	/* regexp relies on these two being in the same union */
-		Reinst *left;		/* left child of OR */
-		Reinst *next;		/* next instruction for CAT & LBRA */
-	} l;
-};
-
-/*
- *	Reprogram definition
- */
-struct Reprog{
-	Reinst	*startinst;	/* start pc */
-	Reclass	class[16];	/* .data */
-	Reinst	firstinst[5];	/* .text */
-};
-
-extern Reprog	*regcomp(char*);
-extern Reprog	*regcomplit(char*);
-extern Reprog	*regcompnl(char*);
-extern void	regerror(char*);
-extern int	regexec(Reprog*, char*, Resub*, int);
-extern void	regsub(char*, char*, int, Resub*, int);
-extern int	rregexec(Reprog*, wchar_t*, Resub*, int);
-extern void	rregsub(wchar_t*, wchar_t*, int, Resub*, int);
-#endif

+ 0 - 43
sys/include/ape/select.h

@@ -1,43 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __SELECT_H
-#define __SELECT_H
-#ifndef _BSD_EXTENSION
-    This header file is an extension to ANSI/POSIX
-#endif
-#pragma lib "/$M/lib/ape/libap.a"
-
-#ifndef _FD_SET_T
-#define _FD_SET_T
-/* BSD select, and adjunct types and macros */
-
-/* assume 96 fds is sufficient for fdset size */
-
-typedef struct fd_set {
-	int32_t fds_bits[3];
-} fd_set;
-
-#define FD_SET(n,p)	((p)->fds_bits[(n)>>5] |= (1 << ((n) &0x1f)))
-#define FD_CLR(n,p)	((p)->fds_bits[(n)>>5] &= ~(1 << ((n) &0x1f)))
-#define FD_ISSET(n,p)	((p)->fds_bits[(n)>>5] & (1 << ((n) &0x1f)))
-#define FD_ZERO(p)	((p)->fds_bits[0] =0, (p)->fds_bits[1] =0, (p)->fds_bits[2] =0)
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int select(int, fd_set*, fd_set*, fd_set*, struct timeval *);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 35
sys/include/ape/setjmp.h

@@ -1,35 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __SETJMP_H
-#define __SETJMP_H
-#pragma lib "/$M/lib/ape/libap.a"
-
-typedef int jmp_buf[10];
-#ifdef _POSIX_SOURCE
-typedef int sigjmp_buf[10];
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int setjmp(jmp_buf);
-extern void longjmp(jmp_buf, int);
-
-#ifdef _POSIX_SOURCE
-extern int sigsetjmp(sigjmp_buf, int);
-extern void siglongjmp(sigjmp_buf, int);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __SETJMP_H */

+ 0 - 104
sys/include/ape/signal.h

@@ -1,104 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __SIGNAL_H
-#define __SIGNAL_H
-#pragma lib "/$M/lib/ape/libap.a"
-
-typedef int sig_atomic_t;
-
-/*
- * We don't give arg types for signal handlers, in spite of ANSI requirement
- * that it be 'int' (the signal number), because some programs need an
- * additional context argument.  So the real type of signal handlers is
- *      void handler(int sig, char *, struct Ureg *)
- * where the char * is the Plan 9 message and Ureg is defined in <ureg.h>
- */
-#define SIG_DFL ((void (*)())0)
-#define SIG_ERR ((void (*)())-1)
-#define SIG_IGN ((void (*)())1)
-
-#define	SIGHUP	1	/* hangup */
-#define	SIGINT	2	/* interrupt */
-#define	SIGQUIT	3	/* quit */
-#define	SIGILL	4	/* illegal instruction (not reset when caught)*/
-#define SIGABRT 5	/* used by abort */
-#define	SIGFPE	6	/* floating point exception */
-#define	SIGKILL	7	/* kill (cannot be caught or ignored) */
-#define	SIGSEGV	8	/* segmentation violation */
-#define	SIGPIPE	9	/* write on a pipe with no one to read it */
-#define	SIGALRM	10	/* alarm clock */
-#define	SIGTERM	11	/* software termination signal from kill */
-#define	SIGUSR1	12	/* user defined signal 1 */
-#define	SIGUSR2	13	/* user defined signal 2 */
-#define	SIGBUS	14	/* bus error */
-
-/* The following symbols must be defined, but the signals needn't be supported */
-#define SIGCHLD	15	/* child process terminated or stopped */
-#define SIGCONT 16	/* continue if stopped */
-#define SIGSTOP 17	/* stop */
-#define SIGTSTP	18	/* interactive stop */
-#define SIGTTIN	19	/* read from ctl tty by member of background */
-#define SIGTTOU	20	/* write to ctl tty by member of background */
-
-#ifdef _BSD_EXTENSION
-#define NSIG 21
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern void (*signal(int, void (*)()))();
-extern int raise(int);
-
-#ifdef __cplusplus
-}
-#endif
-
-#ifdef _POSIX_SOURCE
-
-typedef int32_t sigset_t;
-struct sigaction {
-	void		(*sa_handler)();
-	sigset_t	sa_mask;
-	int		sa_flags;
-};
-/* values for sa_flags */
-#define SA_NOCLDSTOP	1
-
-/* first argument to sigprocmask */
-#define SIG_BLOCK	1
-#define SIG_UNBLOCK	2
-#define SIG_SETMASK	3
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef __TYPES_H
-extern int kill(pid_t, int);
-#endif
-extern int sigemptyset(sigset_t *);
-extern int sigfillset(sigset_t *);
-extern int sigaddset(sigset_t *, int);
-extern int sigdelset(sigset_t *, int);
-extern int sigismember(const sigset_t *, int);
-extern int sigaction(int, const struct sigaction *, struct sigaction *);
-extern int sigprocmask(int, sigset_t *, sigset_t *);
-extern int sigpending(sigset_t *);
-extern int sigsuspend(const sigset_t *);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _POSIX_SOURCE */
-
-#endif /* __SIGNAL_H */

+ 0 - 34
sys/include/ape/stddef.h

@@ -1,34 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __STDDEF_H
-#define __STDDEF_H
-
-#ifndef NULL
-#ifdef __cplusplus
-#define NULL 0
-#else
-#define NULL ((void*)0)
-#endif
-#endif
-#ifndef offsetof
-#define offsetof(ty,mem) ((size_t) &(((ty *)0)->mem))
-#endif
-
-typedef long ptrdiff_t;
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef unsigned long size_t;
-#endif
-#ifndef _WCHAR_T
-#define _WCHAR_T
-typedef unsigned short wchar_t;
-#endif
-
-#endif /* __STDDEF_H */

+ 0 - 166
sys/include/ape/stdio.h

@@ -1,166 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef	_STDIO_H_
-#define	_STDIO_H_
-#pragma lib "/$M/lib/ape/libap.a"
-
-/*
- * pANS stdio.h
- */
-#include <stdarg.h>
-#include <stddef.h>
-#include <sys/types.h>
-/*
- * According to X3J11, there is only one i/o buffer
- * and it must not be occupied by both input and output data.
- *	If rp<wp, we must have state==RD and
- *	if wp<rp, we must have state==WR, so that getc and putc work correctly.
- *	On open, rp, wp and buf are set to 0, so first getc or putc will call _IO_getc
- *	or _IO_putc, which will allocate the buffer.
- *	If setvbuf(., ., _IONBF, .) is called, bufl is set to 0 and
- *	buf, rp and wp are pointed at unbuf.
- *	If setvbuf(., ., _IOLBF, .) is called, _IO_putc leaves wp and rp pointed at the
- *	end of the buffer so that it can be called on each putc to check whether it's got
- *	a newline.  This nonsense is in order to avoid impacting performance of the other
- *	buffering modes more than necessary -- putting the test in putc adds many
- *	instructions that are wasted in non-_IOLBF mode:
- *	#define putc(c, f)	(_IO_ctmp=(c),\
- *				(f)->wp>=(f)->rp || (f)->flags&LINEBUF && _IO_ctmp=='\n'\
- *					?_IO_putc(_IO_ctmp, f)\
- *					:*(f)->wp++=_IO_ctmp)
- *				
- */
-typedef struct{
-	int fd;		/* UNIX file pointer */
-	char flags;	/* bits for must free buffer on close, line-buffered */
-	char state;	/* last operation was read, write, position, error, eof */
-	char *buf;	/* pointer to i/o buffer */
-	char *rp;	/* read pointer (or write end-of-buffer) */
-	char *wp;	/* write pointer (or read end-of-buffer) */
-	char *lp;	/* actual write pointer used when line-buffering */
-	size_t bufl;	/* actual length of buffer */
-	char unbuf[1];	/* tiny buffer for unbuffered io (used for ungetc?) */
-}FILE;
-typedef long long fpos_t;
-#ifndef NULL
-#ifdef __cplusplus
-#define NULL 0
-#else
-#define NULL ((void*)0)
-#endif
-#endif
-/*
- * Third arg of setvbuf
- */
-#define	_IOFBF	1			/* block-buffered */
-#define	_IOLBF	2			/* line-buffered */
-#define	_IONBF	3			/* unbuffered */
-#define	BUFSIZ	4096			/* size of setbuf buffer */
-#define	EOF	(-1)			/* returned on end of file */
-#define	FOPEN_MAX	90		/* max files open */
-#define	FILENAME_MAX	BUFSIZ		/* silly filename length */
-#define	L_tmpnam	20		/* sizeof "/tmp/abcdefghij9999 */
-#define	L_cuserid	32		/* maximum size user name */
-#define	L_ctermid	32		/* size of name of controlling tty */
-#define	SEEK_CUR	1
-#define	SEEK_END	2
-#define	SEEK_SET	0
-#define	TMP_MAX		64		/* very hard to set correctly */
-#define	stderr	(&_IO_stream[2])
-#define	stdin	(&_IO_stream[0])
-#define	stdout	(&_IO_stream[1])
-#define	_IO_CHMASK	0377		/* mask for 8 bit characters */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int remove(const char *);
-extern int rename(const char *, const char *);
-extern FILE *tmpfile(void);
-extern char *tmpnam(char *);
-extern int fclose(FILE *);
-extern int fflush(FILE *);
-extern FILE *fopen(const char *, const char *);
-extern FILE *freopen(const char *, const char *, FILE *);
-extern void setbuf(FILE *, char *);
-extern int setvbuf(FILE *, char *, int, size_t);
-extern int fprintf(FILE *, const char *, ...);
-extern int fscanf(FILE *, const char *, ...);
-extern int printf(const char *, ...);
-extern int scanf(const char *, ...);
-extern int sprintf(char *, const char *, ...);
-
-/*
- * NB: C99 now *requires *snprintf to return the number of characters
- * that would have been written, had there been room.
- */
-extern int snprintf(char *, size_t, const char *, ...);
-extern int vsnprintf(char *, size_t, const char *, va_list);
-
-extern int sscanf(const char *, const char *, ...);
-extern int vfprintf(FILE *, const char *, va_list);
-extern int vprintf(const char *, va_list);
-extern int vsprintf(char *, const char *, va_list);
-extern int vfscanf(FILE *, const char *, va_list);
-extern int fgetc(FILE *);
-extern char *fgets(char *, int, FILE *);
-extern int fputc(int, FILE *);
-extern int fputs(const char *, FILE *);
-extern int getc(FILE *);
-#define	getc(f)	((f)->rp>=(f)->wp?_IO_getc(f):*(f)->rp++&_IO_CHMASK)
-extern int _IO_getc(FILE *f);
-extern int getchar(void);
-#define	getchar()	getc(stdin)
-extern char *gets(char *);
-extern int putc(int, FILE *);
-#define	putc(c, f) ((f)->wp>=(f)->rp?_IO_putc(c, f):(*(f)->wp++=c)&_IO_CHMASK)
-extern int _IO_putc(int, FILE *);
-extern int putchar(int);
-#define	putchar(c)	putc(c, stdout)
-extern int puts(const char *);
-extern int ungetc(int, FILE *);
-extern size_t fread(void *, size_t, size_t, FILE *);
-extern size_t fwrite(const void *, size_t, size_t, FILE *);
-extern int fgetpos(FILE *, fpos_t *);
-extern int fseek(FILE *, int32_t, int);
-extern int fseeko(FILE *, off_t, int);
-extern int fsetpos(FILE *, const fpos_t *);
-extern int32_t ftell(FILE *);
-extern off_t ftello(FILE *);
-extern void rewind(FILE *);
-extern void clearerr(FILE *);
-extern int feof(FILE *);
-extern int ferror(FILE *);
-extern void perror(const char *);
-extern FILE _IO_stream[FOPEN_MAX];
-
-#ifdef _POSIX_SOURCE
-extern int fileno(FILE *);
-extern FILE* fdopen(int, const char*);
-extern char *ctermid(char *);
-#endif
-
-#ifdef _REENTRANT_SOURCE
-extern char *tmpnam_r(char *);
-extern char *ctermid_r(char *);
-#endif
-
-#ifdef _BSD_EXTENSION
-#pragma lib "/$M/lib/ape/libbsd.a"
-extern FILE *popen(char *, char *);
-extern int	pclose(FILE *);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 64
sys/include/ape/stdlib.h

@@ -1,64 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __STDLIB_H
-#define __STDLIB_H
-#pragma lib "/$M/lib/ape/libap.a"
-
-#include <stddef.h>
-
-#define EXIT_FAILURE 1
-#define EXIT_SUCCESS 0
-#define MB_CUR_MAX 4
-#define RAND_MAX 32767
-
-typedef struct { int quot, rem; } div_t;
-typedef struct { int32_t quot, rem; } ldiv_t;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern double atof(const char *);
-extern int atoi(const char *);
-extern long int atol(const char *);
-extern long long atoll(const char *);
-extern double strtod(const char *, char **);
-extern long int strtol(const char *, char **, int);
-extern unsigned long int strtoul(const char *, char **, int);
-extern long long int strtoll(const char *, char **, int);
-extern unsigned long long int strtoull(const char *, char **, int);
-extern int rand(void);
-extern void srand(unsigned int seed);
-extern void *calloc(size_t, size_t);
-extern void free(void *);
-extern void *malloc(size_t);
-extern void *realloc(void *, size_t);
-extern void abort(void);
-extern int atexit(void (*func)(void));
-extern void exit(int);
-extern char *getenv(const char *);
-extern int system(const char *);
-extern void *bsearch(const void *, const void *, size_t, size_t, int (*)(const void *, const void *));
-extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
-extern int abs(int);
-extern div_t div(int, int);
-extern long int labs(long int);
-extern ldiv_t ldiv(long int, long int);
-extern int mblen(const char *, size_t);
-extern int mbtowc(wchar_t *, const char *, size_t);
-extern int wctomb(char *, wchar_t);
-extern size_t mbstowcs(wchar_t *, const char *, size_t);
-extern size_t wcstombs(char *, const wchar_t *, size_t);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __STDLIB_H */

+ 0 - 58
sys/include/ape/string.h

@@ -1,58 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __STRING_H_
-#define __STRING_H_
-#pragma lib "/$M/lib/ape/libap.a"
-
-#include <stddef.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern void *memcpy(void *, const void *, size_t);
-extern void* memccpy(void*, void*, int, size_t);
-extern void *memmove(void *, const void *, size_t);
-extern char *strcpy(char *, const char *);
-extern char *strncpy(char *, const char *, size_t);
-extern char *strcat(char *, const char *);
-extern char *strncat(char *, const char *, size_t);
-extern int memcmp(const void *, const void *, size_t);
-extern int strcmp(const char *, const char *);
-extern int strcoll(const char *, const char *);
-extern char* strdup(char*);
-extern int strncmp(const char *, const char *, size_t);
-extern size_t strxfrm(char *, const char *, size_t);
-extern void *memchr(const void *, int, size_t);
-extern char *strchr(const char *, int);
-extern size_t strcspn(const char *, const char *);
-extern char *strpbrk(const char *, const char *);
-extern char *strrchr(const char *, int);
-extern size_t strspn(const char *, const char *);
-extern char *strstr(const char *, const char *);
-extern char *strtok(char *, const char *);
-extern void *memset(void *, int, size_t);
-extern char *strerror(int);
-extern size_t strlen(const char *);
-
-#ifdef _REENTRANT_SOURCE
-extern char *strerror_r(int, const char *, int);
-extern char *strtok_r(char *, const char *, char **);
-#endif
-
-#ifdef _BSD_EXTENSION
-#include <bsd.h>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 31
sys/include/ape/sys/ioctl.h

@@ -1,31 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __IOCTL_H__
-#define __IOCTL_H__
-
-#ifndef _BSD_EXTENSION
-    This header file is an extension to ANSI/POSIX
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* FIONREAD: return number of bytes readable in *(long*)arg */
-#define FIONREAD 1
-
-int ioctl(int, unsigned long, void*);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* !__IOCTL_H__ */

+ 0 - 37
sys/include/ape/sys/limits.h

@@ -1,37 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-/*
-	local limits
-*/
-
-#undef	ARG_MAX
-#define	ARG_MAX		16384
-#undef	CHILD_MAX
-#define	CHILD_MAX	75
-#undef	OPEN_MAX
-#define	OPEN_MAX	96
-#undef	LINK_MAX
-#define	LINK_MAX	1
-#undef	PATH_MAX
-#define	PATH_MAX	1023
-#undef	NAME_MAX
-#define	NAME_MAX	PATH_MAX
-#undef	NGROUPS_MAX
-#define	NGROUPS_MAX	32
-#undef	MAX_CANON
-#define	MAX_CANON	1023
-#undef	MAX_INPUT
-#define	MAX_INPUT	1023
-#undef	PIPE_BUF
-#define	PIPE_BUF	8192
-
-#define	_POSIX_SAVED_IDS		1
-#define	_POSIX_CHOWN_RESTRICTED		1
-#define	_POSIX_NO_TRUNC			1

+ 0 - 27
sys/include/ape/sys/param.h

@@ -1,27 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __PARAM_H__
-#define __PARAM_H__
-
-#ifndef _BSD_EXTENSION
-    This header file is an extension to ANSI/POSIX
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define NOFILES_MAX 100
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !__PARAM_H__ */

+ 0 - 27
sys/include/ape/sys/pty.h

@@ -1,27 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-/*
- * Pty support
- */
-#ifndef __SYS_PTY_H__
-#define __SYS_PTY_H__
-
-#ifndef _BSD_EXTENSION
-    This header file is an extension to ANSI/POSIX
-#endif
-
-#pragma lib "/$M/lib/ape/libbsd.a"
-
-int8_t*	ptsname(int);
-int8_t*	ptmname(int);
-
-int	_getpty(void);
-
-#endif /* !__SYS_UIO_H__ */

+ 0 - 38
sys/include/ape/sys/resource.h

@@ -1,38 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __RESOURCE_H__
-#define __RESOURCE_H__
-
-#ifndef _BSD_EXTENSION
-    This header file is an extension to ANSI/POSIX
-#endif
-
-struct rusage {
-	struct timeval ru_utime;	/* user time used */
-	struct timeval ru_stime;	/* system time used */
-	int32_t	ru_maxrss;		/* max resident set size */
-#define	ru_first	ru_ixrss
-	int32_t	ru_ixrss;		/* integral shared memory size */
-	int32_t	ru_idrss;		/* integral unshared data " */
-	int32_t	ru_isrss;		/* integral unshared stack " */
-	int32_t	ru_minflt;		/* page reclaims */
-	int32_t	ru_majflt;		/* page faults */
-	int32_t	ru_nswap;		/* swaps */
-	int32_t	ru_inblock;		/* block input operations */
-	int32_t	ru_oublock;		/* block output operations */
-	int32_t	ru_msgsnd;		/* messages sent */
-	int32_t	ru_msgrcv;		/* messages received */
-	int32_t	ru_nsignals;		/* signals received */
-	int32_t	ru_nvcsw;		/* voluntary context switches */
-	int32_t	ru_nivcsw;		/* involuntary " */
-#define	ru_last		ru_nivcsw
-};
-
-#endif /* !__RESOURCE_H__ */

+ 0 - 43
sys/include/ape/sys/select.h

@@ -1,43 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __SELECT_H
-#define __SELECT_H
-#ifndef _BSD_EXTENSION
-    This header file is an extension to ANSI/POSIX
-#endif
-#pragma lib "/$M/lib/ape/libap.a"
-
-#ifndef _FD_SET_T
-#define _FD_SET_T
-/* BSD select, and adjunct types and macros */
-
-/* assume 96 fds is sufficient for fdset size */
-
-typedef struct fd_set {
-	int32_t fds_bits[3];
-} fd_set;
-
-#define FD_SET(n,p)	((p)->fds_bits[(n)>>5] |= (1 << ((n) &0x1f)))
-#define FD_CLR(n,p)	((p)->fds_bits[(n)>>5] &= ~(1 << ((n) &0x1f)))
-#define FD_ISSET(n,p)	((p)->fds_bits[(n)>>5] & (1 << ((n) &0x1f)))
-#define FD_ZERO(p)	((p)->fds_bits[0] =0, (p)->fds_bits[1] =0, (p)->fds_bits[2] =0)
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int select(int, fd_set*, fd_set*, fd_set*, struct timeval *);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 205
sys/include/ape/sys/socket.h

@@ -1,205 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __SYS_SOCKET_H__
-#define __SYS_SOCKET_H__
-
-#ifndef _BSD_EXTENSION
-    This header file is an extension to ANSI/POSIX
-#endif
-
-#pragma lib "/$M/lib/ape/libbsd.a"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Copyright (c) 1982,1985, 1986 Regents of the University of California.
- * All rights reserved.  The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
- *
- *	@(#)socket.h	7.1 (Berkeley) 6/4/86
- */
-
-/*
- * Definitions related to sockets: types, address families, options.
- */
-
-/*
- * Types
- */
-#define	SOCK_STREAM	1		/* stream socket */
-#define	SOCK_DGRAM	2		/* datagram socket */
-#define	SOCK_RAW	3		/* raw-protocol interface */
-#define	SOCK_RDM	4		/* reliably-delivered message */
-#define	SOCK_SEQPACKET	5		/* sequenced packet stream */
-
-/*
- * Option flags per-socket.
- */
-#ifdef HAVE_SOCK_OPTS
-#define	SO_DEBUG	0x0001		/* turn on debugging info recording */
-#define	SO_ACCEPTCONN	0x0002		/* socket has had listen() */
-#define	SO_REUSEADDR	0x0004		/* allow local address reuse */
-#define	SO_KEEPALIVE	0x0008		/* keep connections alive */
-#define	SO_DONTROUTE	0x0010		/* just use interface addresses */
-#define	SO_BROADCAST	0x0020		/* permit sending of broadcast msgs */
-#define	SO_USELOOPBACK	0x0040		/* bypass hardware when possible */
-#define	SO_LINGER	0x0080		/* linger on close if data present */
-#define	SO_OOBINLINE	0x0100		/* leave received OOB data in line */
-#endif
-
-/*
- * Additional options, not kept in so_options.
- */
-#define SO_SNDBUF	0x1001		/* send buffer size */
-#define SO_RCVBUF	0x1002		/* receive buffer size */
-#define SO_SNDLOWAT	0x1003		/* send low-water mark */
-#define SO_RCVLOWAT	0x1004		/* receive low-water mark */
-#define SO_SNDTIMEO	0x1005		/* send timeout */
-#define SO_RCVTIMEO	0x1006		/* receive timeout */
-#define	SO_ERROR	0x1007		/* get error status and clear */
-#define	SO_TYPE		0x1008		/* get socket type */
-
-/*
- * Structure used for manipulating linger option.
- */
-struct	linger {
-	int	l_onoff;		/* option on/off */
-	int	l_linger;		/* linger time */
-};
-
-/*
- * Level number for (get/set)sockopt() to apply to socket itself.
- */
-#define	SOL_SOCKET	0xffff		/* options for socket level */
-
-/*
- * Address families.
- * XTP really is not an address family, but is included here to take
- * up space, because other AF_ entries are numerically equal to their
- * PF_ counterparts.
- */
-#define	AF_UNSPEC	0		/* unspecified */
-#define	AF_UNIX		1		/* local to host (pipes, portals) */
-#define	AF_INET		2		/* internetwork: UDP, TCP, etc. */
-#define	AF_IMPLINK	3		/* arpanet imp addresses */
-#define	AF_PUP		4		/* pup protocols: e.g. BSP */
-#define	AF_CHAOS	5		/* mit CHAOS protocols */
-#define	AF_NS		6		/* XEROX NS protocols */
-#define	AF_ISO		7		/* ISO protocols */
-#define	AF_OSI		AF_ISO
-#define	AF_ECMA		8		/* european computer manufacturers */
-#define	AF_DATAKIT	9		/* datakit protocols */
-#define	AF_CCITT	10		/* CCITT protocols, X.25 etc */
-#define	AF_SNA		11		/* IBM SNA */
-#define AF_DECnet	12		/* DECnet */
-#define AF_DLI		13		/* DEC Direct data link interface */
-#define AF_LAT		14		/* LAT */
-#define	AF_HYLINK	15		/* NSC Hyperchannel */
-#define	AF_APPLETALK	16		/* Apple Talk */
-#define	AF_ROUTE	17		/* Internal Routing Protocol */
-#define	AF_LINK		18		/* Link layer interface */
-#define	pseudo_AF_XTP	19		/* eXpress Transfer Protocol (no AF) */
-#define AF_INET6	24		/* IP version 6 */
-#define	AF_MAX		30
-
-/*
- * Structure used by kernel to store most
- * addresses.
- */
-struct sockaddr {
-	unsigned short	sa_family;	/* address family */
-	char	sa_data[108];
-};
-
-/*
- * Structure used by kernel to pass protocol
- * information in raw sockets.
- */
-struct sockproto {
-	unsigned short	sp_family;		/* address family */
-	unsigned short	sp_protocol;		/* protocol */
-};
-
-/*
- * Protocol families, same as address families for now.
- */
-#define	PF_UNSPEC	AF_UNSPEC
-#define	PF_UNIX		AF_UNIX
-#define	PF_INET		AF_INET
-#define	PF_IMPLINK	AF_IMPLINK
-#define	PF_PUP		AF_PUP
-#define	PF_CHAOS	AF_CHAOS
-#define	PF_NS		AF_NS
-#define	PF_ISO		AF_ISO
-#define	PF_OSI		AF_ISO
-#define	PF_ECMA		AF_ECMA
-#define	PF_DATAKIT	AF_DATAKIT
-#define	PF_CCITT	AF_CCITT
-#define	PF_SNA		AF_SNA
-#define PF_DECnet	AF_DECnet
-#define PF_DLI		AF_DLI
-#define PF_LAT		AF_LAT
-#define	PF_HYLINK	AF_HYLINK
-#define	PF_APPLETALK	AF_APPLETALK
-#define	PF_ROUTE	AF_ROUTE
-#define	PF_LINK		AF_LINK
-#define	PF_XTP		pseudo_AF_XTP	/* really just proto family, no AF */
-#define	PF_INET6	AF_INET6
-
-#define	PF_MAX		AF_MAX
-
-/*
- * Maximum queue length specifiable by listen.
- */
-#define	SOMAXCONN	5
-
-/*
- * Message header for recvmsg and sendmsg calls.
- */
-struct msghdr {
-	char	*msg_name;		/* optional address */
-	int	msg_namelen;		/* size of address */
-	struct	iovec *msg_iov;		/* scatter/gather array */
-	int	msg_iovlen;		/* # elements in msg_iov */
-	char	*msg_accrights;		/* access rights sent/received */
-	int	msg_accrightslen;
-};
-
-#define	MSG_OOB		0x1		/* process out-of-band data */
-#define	MSG_PEEK	0x2		/* peek at incoming message */
-#define	MSG_DONTROUTE	0x4		/* send without using routing tables */
-
-#define	MSG_MAXIOVLEN	16
-
-extern int accept(int, void *, int *);
-extern int bind(int, void *, int);
-extern int connect(int, void *, int);
-extern int getpeername(int, void *, int *);
-extern int getsockname(int, void *, int *);
-extern int getsockopt(int, int, int, void *, int *);
-extern int setsockopt(int, int, int, void *, int);
-extern int listen(int, int);
-extern int recv(int, void *, int, int);
-extern int recvfrom(int, void *, int, int, void *, int *);
-extern int recvmsg(int, struct msghdr *, int);
-extern int send(int, void *, int, int);
-extern int sendto(int, void *, int, int, void *, int);
-extern int sendmsg(int, struct msghdr *, int);
-extern int shutdown(int, int);
-extern int socket(int, int, int);
-extern int socketpair(int, int, int, int *);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !__SYS_SOCKET_H__ */

+ 0 - 93
sys/include/ape/sys/stat.h

@@ -1,93 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __STAT_H
-#define __STAT_H
-
-#ifndef __TYPES_H
-#include <sys/types.h>
-#endif
-
-#pragma lib "/$M/lib/ape/libap.a"
-
-/*
- * stat structure, used by stat(2) and fstat(2)
- */
-struct	stat {
-	dev_t	st_dev;
-	ino_t	st_ino;
-	mode_t 	st_mode;
-	nlink_t	st_nlink;
-	uid_t 	st_uid;
-	gid_t 	st_gid;
-	off_t	st_size;
-	time_t	st_atime;
-	time_t	st_mtime;
-	time_t	st_ctime;
-};
-
-#define	S__MASK		     0170000
-#ifdef _RESEARCH_SOURCE
-#define S_ISLNK(m)	(((m)&S__MASK) == 0120000)
-#endif
-#define S_ISREG(m)	(((m)&S__MASK) == 0100000)
-#define S_ISDIR(m)	(((m)&S__MASK) == 0040000)
-#define S_ISCHR(m)	(((m)&S__MASK) == 0020000)
-#define S_ISBLK(m)	(((m)&S__MASK) == 0060000)
-#define S_ISFIFO(m)	(((m)&S__MASK) == 0010000)
-
-#define	S_ISUID	04000		/* set user id on execution */
-#define	S_ISGID	02000		/* set group id on execution */
-#define	S_IRWXU	00700		/* read, write, execute: owner */
-#define	S_IRUSR	00400		/* read permission: owner */
-#define	S_IWUSR	00200		/* write permission: owner */
-#define	S_IXUSR	00100		/* execute permission: owner */
-#define	S_IRWXG	00070		/* read, write, execute: group */
-#define	S_IRGRP	00040		/* read permission: group */
-#define	S_IWGRP	00020		/* write permission: group */
-#define	S_IXGRP	00010		/* execute permission: group */
-#define	S_IRWXO	00007		/* read, write, execute: other */
-#define	S_IROTH	00004		/* read permission: other */
-#define	S_IWOTH	00002		/* write permission: other */
-#define	S_IXOTH	00001		/* execute permission: other */
-
-#ifdef _BSD_EXTENSION
-#define S_IFMT S__MASK
-#define S_IFDIR 0040000
-#define S_IFCHR 0020000
-#define S_IFBLK 0060000
-#define S_IFREG 0100000
-#define S_IFIFO 0010000
-#define S_IFLNK 0120000
-#define S_IFSOCK S_IFIFO
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern mode_t umask(mode_t);
-extern int mkdir(const char *, mode_t);
-extern int mkfifo(const char *, mode_t);
-extern int stat(const char *, struct stat *);
-extern int fstat(int, struct stat *);
-extern int chmod(const char *, mode_t);
-
-#ifdef _BSD_EXTENSION
-#pragma lib "/$M/lib/ape/libbsd.a"
-extern int	lstat(char *, struct stat *);
-extern int	symlink(char *, char *);
-extern int	readlink(char *, char*, int);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 31
sys/include/ape/sys/time.h

@@ -1,31 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __SYSTIME_H
-#define __SYSTIME_H
-#pragma lib "/$M/lib/ape/libap.a"
-
-#ifndef __TIMEVAL__
-#define __TIMEVAL__
-struct timeval {
-	int32_t	tv_sec;
-	int32_t	tv_usec;
-};
-
-#ifdef _BSD_EXTENSION
-struct timezone {
-	int	tz_minuteswest;
-	int	tz_dsttime;
-};
-#endif
-#endif /* __TIMEVAL__ */
-
-extern int gettimeofday(struct timeval *, struct timezone *);
-
-#endif /* __SYSTIME_H */

+ 0 - 36
sys/include/ape/sys/times.h

@@ -1,36 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __TIMES_H
-#define __TIMES_H
-#pragma lib "/$M/lib/ape/libap.a"
-
-#ifndef _CLOCK_T
-#define _CLOCK_T
-typedef int32_t clock_t;
-#endif
-
-struct tms {
-	clock_t	tms_utime;
-	clock_t	tms_stime;
-	clock_t	tms_cutime;
-	clock_t	tms_cstime;
-};
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-clock_t times(struct tms *);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 55
sys/include/ape/sys/types.h

@@ -1,55 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __TYPES_H
-#define __TYPES_H
-
-#pragma lib "/$M/lib/ape/libap.a"
-typedef	unsigned short	ino_t;
-typedef	unsigned short	dev_t;
-typedef	long long		off_t;
-typedef unsigned short	mode_t;
-typedef int16_t		uid_t;
-typedef int16_t		gid_t;
-typedef int16_t		nlink_t;
-typedef int		pid_t;
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef unsigned long size_t;
-#endif
-#ifndef _SSIZE_T
-#define _SSIZE_T
-typedef long ssize_t;
-#endif
-
-#ifndef _TIME_T
-#define _TIME_T
-typedef int32_t time_t;
-#endif
-
-#ifdef _BSD_EXTENSION
-#ifndef _CADDR_T
-#define _CADDR_T
-typedef char * caddr_t;
-#endif
-#ifndef _FD_SET_T
-#define _FD_SET_T
-/* also cf <select.h> */
-typedef struct fd_set {
-	int32_t fds_bits[3];
-} fd_set;
-#define FD_SET(n,p)	((p)->fds_bits[(n)>>5] |= (1 << ((n) &0x1f)))
-#define FD_CLR(n,p)	((p)->fds_bits[(n)>>5] &= ~(1 << ((n) &0x1f)))
-#define FD_ISSET(n,p)	((p)->fds_bits[(n)>>5] & (1 << ((n) &0x1f)))
-#define FD_ZERO(p)	((p)->fds_bits[0] =0, (p)->fds_bits[1] =0, (p)->fds_bits[2] =0)
-#endif
-#endif
-
-#endif /* __TYPES_H */

+ 0 - 43
sys/include/ape/sys/uio.h

@@ -1,43 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __SYS_UIO_H__
-#define __SYS_UIO_H__
-
-#ifndef _BSD_EXTENSION
-    This header file is an extension to ANSI/POSIX
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#pragma lib "/$M/lib/ape/libbsd.a"
-
-/*
- * Copyright (c) 1982, 1986 Regents of the University of California.
- * All rights reserved.  The Berkeley software License Agreement
- * specifies the terms and conditions for redistribution.
- *
- *	@(#)uio.h	7.1 (Berkeley) 6/4/86
- */
-
-struct iovec {
-	char	*iov_base;
-	int	iov_len;
-};
-
-extern int writev(int, struct iovec*, int);
-extern int readv(int, struct iovec*, int);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !__SYS_UIO_H__ */

+ 0 - 35
sys/include/ape/sys/un.h

@@ -1,35 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-/*
- * Copyright (c) 1982, 1986 Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley.  The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- *	@(#)un.h	7.3 (Berkeley) 6/27/88
- */
-
-/*
- * Definitions for UNIX IPC domain.
- */
-struct	sockaddr_un {
-	int16_t	sun_family;		/* AF_UNIX */
-	char	sun_path[108];		/* path name (gag) */
-};

+ 0 - 32
sys/include/ape/sys/utsname.h

@@ -1,32 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __UTSNAME
-#define __UTSNAME
-#pragma lib "/$M/lib/ape/libap.a"
-
-struct utsname {
-	char	*sysname;
-	char	*nodename;
-	char	*release;
-	char	*version;
-	char	*machine;
-};
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-int uname(struct utsname *);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 44
sys/include/ape/sys/wait.h

@@ -1,44 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __WAIT_H
-#define __WAIT_H
-#pragma lib "/$M/lib/ape/libap.a"
-
-/* flag bits for third argument of waitpid */
-#define WNOHANG		0x1
-#define WUNTRACED	0x2
-
-/* macros for examining status returned */
-#ifndef WIFEXITED
-#define WIFEXITED(s)	(((s) & 0xFF) == 0)
-#define WEXITSTATUS(s)	((s>>8)&0xFF)
-#define WIFSIGNALED(s)	(((s) & 0xFF) != 0)
-#define WTERMSIG(s)	((s) & 0xFF)
-#define WIFSTOPPED(s)	(0)
-#define WSTOPSIG(s)	(0)
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-pid_t wait(int *);
-pid_t waitpid(pid_t, int *, int);
-#ifdef _BSD_EXTENSION
-struct rusage;
-pid_t wait3(int *, int, struct rusage *);
-pid_t wait4(pid_t, int *, int, struct rusage *);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

+ 0 - 141
sys/include/ape/termios.h

@@ -1,141 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#pragma lib "/$M/lib/ape/libap.a"
-/* input modes */
-#define BRKINT	0x001
-#define ICRNL	0x002
-#define IGNBRK	0x004
-#define IGNCR	0x008
-#define IGNPAR	0x010
-#define INLCR	0x020
-#define INPCK	0x040
-#define ISTRIP	0x080
-#define IXOFF	0x100
-#define IXON	0x200
-#define PARMRK	0x400
-
-/* output modes: ONLCR, TAB3 are an extension to POSIX! */
-#define	OPOST	0000001
-#define	OLCUC	0000002
-#define	ONLCR	0000004
-#define	OCRNL	0000010
-#define	ONOCR	0000020
-#define	ONLRET	0000040
-#define	OFILL	0000100
-#define	OFDEL	0000200
-#define	NLDLY	0000400
-#define	NL0	0
-#define	NL1	0000400
-#define	CRDLY	0003000
-#define	CR0	0
-#define	CR1	0001000
-#define	CR2	0002000
-#define	CR3	0003000
-#define	TABDLY	0014000
-#define	TAB0	0
-#define	TAB1	0004000
-#define	TAB2	0010000
-#define	TAB3	0014000
-#define	BSDLY	0020000
-#define	BS0	0
-#define	BS1	0020000
-#define	VTDLY	0040000
-#define	VT0	0
-#define	VT1	0040000
-#define	FFDLY	0100000
-#define	FF0	0
-#define	FF1	0100000
-
-/* control modes */
-#define CLOCAL	0x001
-#define CREAD	0x002
-#define CSIZE	0x01C
-#define CS5	0x004
-#define CS6	0x008
-#define CS7	0x00C
-#define CS8	0x010
-#define CSTOPB	0x020
-#define HUPCL	0x040
-#define PARENB	0x080
-#define PARODD	0x100
-
-/* local modes */
-#define ECHO	0x001
-#define ECHOE	0x002
-#define ECHOK	0x004
-#define ECHONL	0x008
-#define ICANON	0x010
-#define IEXTEN	0x020
-#define ISIG	0x040
-#define NOFLSH	0x080
-#define TOSTOP	0x100
-
-/* control characters */
-#define VEOF	0
-#define VEOL	1
-#define VERASE	2
-#define VINTR	3
-#define VKILL	4
-#define VMIN	5
-#define VQUIT	6
-#define VSUSP	7
-#define VTIME	8
-#define VSTART	9
-#define VSTOP	10
-#define NCCS	11
-
-/* baud rates */
-#define B0	0
-#define B50	1
-#define B75	2
-#define B110	3
-#define B134	4
-#define B150	5
-#define B200	6
-#define B300	7
-#define B600	8
-#define B1200	9
-#define B1800	10
-#define B2400	11
-#define B4800	12
-#define B9600	13
-#define B19200	14
-#define B38400	15
-
-/* optional actions for tcsetattr */
-#define TCSANOW	  1
-#define TCSADRAIN 2
-#define TCSAFLUSH 3
-
-typedef unsigned long tcflag_t;
-typedef unsigned long speed_t;
-typedef unsigned char cc_t;
-
-struct termios {
-	tcflag_t	c_iflag;	/* input modes */
-	tcflag_t	c_oflag;	/* output modes */
-	tcflag_t	c_cflag;	/* control modes */
-	tcflag_t	c_lflag;	/* local modes */
-	cc_t		c_cc[NCCS];	/* control characters */
-};
-
-extern speed_t cfgetospeed(const struct termios *);
-extern int cfsetospeed(struct termios *, speed_t);
-extern speed_t cfgetispeed(const struct termios *);
-extern int cfsetispeed(struct termios *, speed_t);
-extern int tcgetattr(int, struct termios *);
-extern int tcsetattr(int, int, const struct termios *);
-#ifdef __TYPES_H
-extern pid_t tcgetpgrp(int);
-extern int tcsetpgrp(int, pid_t);
-#endif
-extern int tcdrain(int);
-extern int tcflush(int, int);
-extern int tcflow(int, int);

+ 0 - 74
sys/include/ape/time.h

@@ -1,74 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __TIME_H
-#define __TIME_H
-#pragma lib "/$M/lib/ape/libap.a"
-
-#include <stddef.h>
-
-#define CLOCKS_PER_SEC 1000
-
-/* obsolsecent, but required */
-#define CLK_TCK CLOCKS_PER_SEC
-
-#ifndef _CLOCK_T
-#define _CLOCK_T
-typedef int32_t clock_t;
-#endif
-#ifndef _TIME_T
-#define _TIME_T
-typedef int32_t time_t;
-#endif
-
-struct tm {
-	int	tm_sec;
-	int	tm_min;
-	int	tm_hour;
-	int	tm_mday;
-	int	tm_mon;
-	int	tm_year;
-	int	tm_wday;
-	int	tm_yday;
-	int	tm_isdst;
-};
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern clock_t clock(void);
-extern double difftime(time_t, time_t);
-extern time_t mktime(struct tm *);
-extern time_t time(time_t *);
-extern char *asctime(const struct tm *);
-extern char *ctime(const time_t *);
-extern struct tm *gmtime(const time_t *);
-extern struct tm *localtime(const time_t *);
-extern size_t strftime(char *, size_t, const char *, const struct tm *);
-
-#ifdef _REENTRANT_SOURCE
-extern struct tm *gmtime_r(const time_t *, struct tm *);
-extern struct tm *localtime_r(const time_t *, struct tm *);
-extern char *ctime_r(const time_t *, char *);
-#endif
-
-#ifdef _POSIX_SOURCE
-extern void tzset(void);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#ifdef _POSIX_SOURCE
-extern char *tzname[2];
-#endif
-
-#endif /* __TIME_H */

+ 0 - 28
sys/include/ape/u.h

@@ -1,28 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __U_H
-#define __U_H
-#ifndef _PLAN9_SOURCE
-   This header file is an extension to ANSI/POSIX
-#endif
-
-#define nil		((void*)0)
-typedef	unsigned short	ushort;
-typedef	unsigned char	uchar;
-typedef unsigned long	ulong;
-typedef unsigned int	uint;
-typedef   signed char	schar;
-typedef	long long	vlong;
-typedef	unsigned long long uvlong;
-typedef	unsigned int		Rune;
-typedef 	union FPdbleword FPdbleword;
-typedef	char*	p9va_list;
-
-#endif

+ 0 - 177
sys/include/ape/unistd.h

@@ -1,177 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef	__UNISTD_H
-#define	__UNISTD_H
-#ifndef _POSIX_SOURCE
-   This header file is not defined in pure ANSI
-#endif
-#pragma lib "/$M/lib/ape/libap.a"
-
-#define _POSIX_VERSION	199309L
-#define _POSIX_ASYNC_IO -1
-#define _POSIX_CHOWN_RESTRICTED 1
-#define _POSIX_NO_TRUNC 1
-#define _POSIX_PRIO_IO -1
-#define _POSIX_SYNC_IO -1
-#define _POSIX_VDISABLE -1
-
-#ifndef _SIZE_T
-#define _SIZE_T
-typedef unsigned long size_t;
-#endif
-#ifndef _SSIZE_T
-#define _SSIZE_T
-typedef long ssize_t;
-#endif
-#ifndef NULL
-#ifndef NULL
-#ifdef __cplusplus
-#define NULL 0
-#else
-#define NULL ((void*)0)
-#endif
-#endif
-#endif
-
-/* access */
-#define	R_OK		4
-#define	W_OK		2
-#define	X_OK		1
-#define	F_OK		0	/* test for existence */
-
-/* lockf */
-#define	F_ULOCK		0	/* unlock a previously locked region */
-#define	F_LOCK		1	/* lock a region for exclusive use */
-#define	F_TLOCK		2	/* test and lock a region for exclusive use */
-#define	F_TEST		3	/* test a region for a previous lock */
-
-/* lseek */
-#ifndef SEEK_SET		/* also defined in stdio.h */
-#define	SEEK_SET	0
-#define	SEEK_CUR	1
-#define	SEEK_END	2
-#endif
-
-/* sysconf argument */
-#define	_SC_ARG_MAX		1	/* max chars in args to exec */
-#define	_SC_CHILD_MAX		2	/* max child process per process */
-#define	_SC_CLK_TCK		3	/* number of clock() units per second */
-#define	_SC_NGROUPS_MAX		4	/* max supplementary groups per process */
-#define	_SC_OPEN_MAX		5
-#define _SC_STREAM_MAX		6
-#define _SC_TZNAME_MAX		7
-#define	_SC_JOB_CONTROL		8	/* posix job control */
-#define	_SC_SAVED_IDS		9	/* saved suid/sgid per process */
-#define	_SC_VERSION		10	/* this version */
-#define _SC_LOGIN_NAME_MAX	11	/* max length of a login name */
-
-/* pathconf argument */
-#define _PC_LINK_MAX		1
-#define _PC_MAX_CANON		2
-#define _PC_MAX_INPUT		3
-#define _PC_NAME_MAX		4
-#define _PC_PATH_MAX		5
-#define _PC_PIPE_BUF		6
-#define _PC_CHOWN_RESTRICTED	7
-#define _PC_NO_TRUNC		8
-#define _PC_VDISABLE		9
-
-/* standard filenos */
-#define STDIN_FILENO		0
-#define STDOUT_FILENO		1
-#define STDERR_FILENO		2
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* process primitives */
-extern int execl(const char *, const char *, ...);
-extern int execv(const char *, const char **);
-extern int execle(const char *, const char *, const char *,  ...);
-extern int execve(const char *, const char **, const char **);
-extern int execlp(const char *, const char *, ...);
-extern int execvp(const char *, const char **);
-extern void _exit(int);
-extern unsigned int alarm(unsigned int);
-extern int pause(void);
-extern unsigned int sleep(unsigned int);
-#ifdef __TYPES_H
-extern pid_t fork(void);
-#endif
-
-/* process environment */
-extern char *getlogin(void);
-extern char *cuserid(char *);
-extern char *ttyname(int);
-extern int isatty(int);
-extern int32_t sysconf(int);
-#ifdef __TYPES_H
-extern pid_t getpid(void);
-extern pid_t getppid(void);
-extern uid_t getuid(void);
-extern uid_t geteuid(void);
-extern gid_t getgid(void);
-extern gid_t getegid(void);
-extern int setuid(uid_t);
-extern int setgid(gid_t);
-extern int getgroups(int, gid_t *);
-extern pid_t getpgrp(void);
-extern int setpgid(pid_t, pid_t);
-extern pid_t setsid(void);
-#endif
-
-/* files and directories */
-extern int chdir(const char *);
-extern int link(const char *, const char *);
-extern char *getcwd(char *, size_t);
-extern int unlink(const char *);
-extern int rmdir(const char *);
-extern int rename(const char *, const char *);
-extern int access(const char *, int);
-extern int32_t pathconf(const char *, int);
-extern int32_t fpathconf(int, int);
-#ifdef __TYPES_H
-extern int chown(const char *, uid_t, gid_t);
-#endif
-
-/* input and output primitives */
-extern int pipe(int *);
-extern int dup(int);
-extern int dup2(int, int);
-extern int close(int);
-extern ssize_t read(int, void *, size_t);
-extern ssize_t write(int, const void *, size_t);
-#ifdef __TYPES_H
-extern int ftruncate(int, off_t);
-extern off_t lseek(int, off_t, int);
-#endif
-
-/* device- and class-specific functions */
-#ifdef __TYPES_H
-extern pid_t tcgetpgrp(int);
-extern int tcsetpgrp(int, pid_t);
-#endif
-
-#ifdef _REENTRANT_SOURCE
-extern char *getlogin_r(char *, int);
-#endif
-
-/* berkeley specific functions */
-#ifdef _BSD_EXTENSION
-#include <bsd.h>
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif

+ 0 - 70
sys/include/ape/utf.h

@@ -1,70 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef _UTF_H_
-#define _UTF_H_ 1
-#pragma lib "/$M/lib/ape/libutf.a"
-#pragma src "/sys/src/ape/lib/utf"
-
-#if defined(__cplusplus)
-extern "C" { 
-#endif
-
-typedef unsigned int Rune;	/* 32 bits */
-
-enum
-{
-	UTFmax		= 4,		/* maximum bytes per rune */
-	Runesync	= 0x80,		/* cannot represent part of a UTF sequence (<) */
-	Runeself	= 0x80,		/* rune and UTF sequences are the same (<) */
-	Runeerror	= 0xFFFD,	/* decoding error in UTF */
-	Runemax		= 0x10FFFF,	/* 21-bit rune */
-};
-
-/*
- * rune routines
- */
-extern	int	runetochar(char*, Rune*);
-extern	int	chartorune(Rune*, char*);
-extern	int	runelen(int32_t);
-extern	int	runenlen(Rune*, int);
-extern	int	fullrune(char*, int);
-extern	int	utflen(char*);
-extern	int	utfnlen(char*, int32_t);
-extern	char*	utfrune(char*, int32_t);
-extern	char*	utfrrune(char*, int32_t);
-extern	char*	utfutf(char*, char*);
-extern	char*	utfecpy(char*, char*, char*);
-
-extern	Rune*	runestrcat(Rune*, Rune*);
-extern	Rune*	runestrchr(Rune*, Rune);
-extern	int	runestrcmp(Rune*, Rune*);
-extern	Rune*	runestrcpy(Rune*, Rune*);
-extern	Rune*	runestrncpy(Rune*, Rune*, int32_t);
-extern	Rune*	runestrecpy(Rune*, Rune*, Rune*);
-extern	Rune*	runestrdup(Rune*);
-extern	Rune*	runestrncat(Rune*, Rune*, int32_t);
-extern	int	runestrncmp(Rune*, Rune*, int32_t);
-extern	Rune*	runestrrchr(Rune*, Rune);
-extern	int32_t	runestrlen(Rune*);
-extern	Rune*	runestrstr(Rune*, Rune*);
-
-extern	Rune	tolowerrune(Rune);
-extern	Rune	totitlerune(Rune);
-extern	Rune	toupperrune(Rune);
-extern	int	isalpharune(Rune);
-extern	int	islowerrune(Rune);
-extern	int	isspacerune(Rune);
-extern	int	istitlerune(Rune);
-extern	int	isupperrune(Rune);
-
-#if defined(__cplusplus)
-}
-#endif
-#endif

+ 0 - 31
sys/include/ape/utime.h

@@ -1,31 +0,0 @@
-/*
- * This file is part of the UCB release of Plan 9. It is subject to the license
- * terms in the LICENSE file found in the top-level directory of this
- * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
- * part of the UCB release of Plan 9, including this file, may be copied,
- * modified, propagated, or distributed except according to the terms contained
- * in the LICENSE file.
- */
-
-#ifndef __UTIME_H
-#define __UTIME_H
-
-#pragma lib "/$M/lib/ape/libap.a"
-
-struct utimbuf
-{
-	time_t actime;
-	time_t modtime;
-};
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int utime(const char *, const struct utimbuf *);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif