diff options
Diffstat (limited to 'unix')
34 files changed, 966 insertions, 0 deletions
diff --git a/unix/Makefile b/unix/Makefile new file mode 100644 index 00000000..5b32b55a --- /dev/null +++ b/unix/Makefile @@ -0,0 +1,7 @@ +all: + for i in libutf libfmt libbio libregexp mk + do + (cd $i; make) + done + ls -l mk/mk + diff --git a/unix/NOTICE.bio b/unix/NOTICE.bio new file mode 100644 index 00000000..6bd9c799 --- /dev/null +++ b/unix/NOTICE.bio @@ -0,0 +1,40 @@ +This copyright NOTICE applies to all files in this directory and +subdirectories, unless another copyright notice appears in a given +file or subdirectory. If you take code from this software to use in +other programs, you must somehow include with it an appropriate +copyright notice that includes the copyright notice and the other +notices above. + +This Computer Program is subject to Copyright owned by one or more Authors: + + Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. + Revisions Copyright © 2000-2003 Vita Nuova Holdings Limited (www.vitanuova.com). All rights reserved. + +Under a licence agreement with Lucent Technologies Inc. effective 1st March 2000, +Vita Nuova Holdings Limited has the right to determine (within a specified scope) +the form and content of sublicences for this software. + + Free-for-all Licence + +The associated software is hereby made available to Recipients with a +royalty-free licence for its use, reproduction, transfer +to other parties and amendment for any purpose not excluding +product development provided that any such use et cetera +shall be deemed to be acceptance of the following conditions: + + (1) Its Recipients shall ensure that this Notice + and all other copyright notices are reproduced + upon any copies or amended versions of it; + + (2) Any amended version of it shall be clearly marked to + show both the nature of and the organisation responsible + for the relevant amendment or amendments; + + (3) Its agreed onward transfer from a Recipient to another + party shall be deemed to be that party's acceptance of + these conditions; + + (4) the Authors give no warranty or assurance as to its + quality or suitability for any purpose and the Authors accept + no liability whatsoever in relation to any use to which + it may be put. diff --git a/unix/NOTICE.fmt b/unix/NOTICE.fmt new file mode 100644 index 00000000..685d1df5 --- /dev/null +++ b/unix/NOTICE.fmt @@ -0,0 +1,19 @@ +/* + * 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. +*/ + +This is a Unix port of the Plan 9 formatted I/O package. + +Please send comments about the packaging +to Russ Cox <rsc@swtch.com>. + diff --git a/unix/NOTICE.mk b/unix/NOTICE.mk new file mode 100644 index 00000000..6bd9c799 --- /dev/null +++ b/unix/NOTICE.mk @@ -0,0 +1,40 @@ +This copyright NOTICE applies to all files in this directory and +subdirectories, unless another copyright notice appears in a given +file or subdirectory. If you take code from this software to use in +other programs, you must somehow include with it an appropriate +copyright notice that includes the copyright notice and the other +notices above. + +This Computer Program is subject to Copyright owned by one or more Authors: + + Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. + Revisions Copyright © 2000-2003 Vita Nuova Holdings Limited (www.vitanuova.com). All rights reserved. + +Under a licence agreement with Lucent Technologies Inc. effective 1st March 2000, +Vita Nuova Holdings Limited has the right to determine (within a specified scope) +the form and content of sublicences for this software. + + Free-for-all Licence + +The associated software is hereby made available to Recipients with a +royalty-free licence for its use, reproduction, transfer +to other parties and amendment for any purpose not excluding +product development provided that any such use et cetera +shall be deemed to be acceptance of the following conditions: + + (1) Its Recipients shall ensure that this Notice + and all other copyright notices are reproduced + upon any copies or amended versions of it; + + (2) Any amended version of it shall be clearly marked to + show both the nature of and the organisation responsible + for the relevant amendment or amendments; + + (3) Its agreed onward transfer from a Recipient to another + party shall be deemed to be that party's acceptance of + these conditions; + + (4) the Authors give no warranty or assurance as to its + quality or suitability for any purpose and the Authors accept + no liability whatsoever in relation to any use to which + it may be put. diff --git a/unix/NOTICE.regexp b/unix/NOTICE.regexp new file mode 100644 index 00000000..ae29cdbc --- /dev/null +++ b/unix/NOTICE.regexp @@ -0,0 +1,19 @@ +/* + * The authors of this software is Rob Pike. + * 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. +*/ + +This is a Unix port of the Plan 9 regular expression library. + +Please send comments about the packaging +to Russ Cox <rsc@swtch.com>. + diff --git a/unix/NOTICE.utf b/unix/NOTICE.utf new file mode 100644 index 00000000..685d1df5 --- /dev/null +++ b/unix/NOTICE.utf @@ -0,0 +1,19 @@ +/* + * 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. +*/ + +This is a Unix port of the Plan 9 formatted I/O package. + +Please send comments about the packaging +to Russ Cox <rsc@swtch.com>. + diff --git a/unix/README b/unix/README new file mode 100644 index 00000000..0cba0f4d --- /dev/null +++ b/unix/README @@ -0,0 +1,2 @@ +This software was packaged for Unix by Russ Cox. +Please send comments to rsc@swtch.com. diff --git a/unix/fmt.h b/unix/fmt.h new file mode 100644 index 00000000..ec909322 --- /dev/null +++ b/unix/fmt.h @@ -0,0 +1,106 @@ + +/* + * 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. + */ + +#ifndef _FMTH_ +#define _FMTH_ 1 +#ifdef __cplusplus +extern "C" { +#endif + +#include <stdarg.h> + +#ifndef _UTFH_ +#include <utf.h> +#endif + +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 +}; + +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*); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/unix/make/Make.Darwin-PowerMacintosh b/unix/make/Make.Darwin-PowerMacintosh new file mode 100644 index 00000000..14b8d4e7 --- /dev/null +++ b/unix/make/Make.Darwin-PowerMacintosh @@ -0,0 +1,6 @@ +CC=gcc +CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I${PREFIX}/include +O=o +AR=ar +ARFLAGS=rvc +NAN=nan64.$O diff --git a/unix/make/Make.FreeBSD-386 b/unix/make/Make.FreeBSD-386 new file mode 100644 index 00000000..087ed3ab --- /dev/null +++ b/unix/make/Make.FreeBSD-386 @@ -0,0 +1,7 @@ +CC=gcc +CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include +O=o +AR=ar +ARFLAGS=rvc +NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) +NAN=nan64.$O diff --git a/unix/make/Make.HP-UX-9000 b/unix/make/Make.HP-UX-9000 new file mode 100644 index 00000000..edbdc111 --- /dev/null +++ b/unix/make/Make.HP-UX-9000 @@ -0,0 +1,6 @@ +CC=cc +CFLAGS=-O -c -Ae -I. +O=o +AR=ar +ARFLAGS=rvc +NAN=nan64.$O diff --git a/unix/make/Make.Linux-386 b/unix/make/Make.Linux-386 new file mode 100644 index 00000000..74b0252c --- /dev/null +++ b/unix/make/Make.Linux-386 @@ -0,0 +1,7 @@ +CC=gcc +CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. +O=o +AR=ar +ARFLAGS=rvc +NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) +NAN=nan64.$O diff --git a/unix/make/Make.NetBSD-386 b/unix/make/Make.NetBSD-386 new file mode 100644 index 00000000..087ed3ab --- /dev/null +++ b/unix/make/Make.NetBSD-386 @@ -0,0 +1,7 @@ +CC=gcc +CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include +O=o +AR=ar +ARFLAGS=rvc +NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) +NAN=nan64.$O diff --git a/unix/make/Make.OSF1-alpha b/unix/make/Make.OSF1-alpha new file mode 100644 index 00000000..3d45279b --- /dev/null +++ b/unix/make/Make.OSF1-alpha @@ -0,0 +1,6 @@ +CC=cc +CFLAGS+=-g -c -I. +O=o +AR=ar +ARFLAGS=rvc +NAN=nan64.$O diff --git a/unix/make/Make.SunOS-sun4u b/unix/make/Make.SunOS-sun4u new file mode 100644 index 00000000..c5fe67b8 --- /dev/null +++ b/unix/make/Make.SunOS-sun4u @@ -0,0 +1,2 @@ +include Make.SunOS-sun4u-$(CC) +NAN=nan64.$O diff --git a/unix/make/Make.SunOS-sun4u-cc b/unix/make/Make.SunOS-sun4u-cc new file mode 100644 index 00000000..829301de --- /dev/null +++ b/unix/make/Make.SunOS-sun4u-cc @@ -0,0 +1,6 @@ +CC=cc +CFLAGS+=-g -c -I. -O +O=o +AR=ar +ARFLAGS=rvc +NAN=nan64.$O diff --git a/unix/make/Make.SunOS-sun4u-gcc b/unix/make/Make.SunOS-sun4u-gcc new file mode 100644 index 00000000..5c415948 --- /dev/null +++ b/unix/make/Make.SunOS-sun4u-gcc @@ -0,0 +1,6 @@ +CC=gcc +CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c +O=o +AR=ar +ARFLAGS=rvc +NAN=nan64.$O diff --git a/unix/make/Makefile.BOT b/unix/make/Makefile.BOT new file mode 100644 index 00000000..ed00e301 --- /dev/null +++ b/unix/make/Makefile.BOT @@ -0,0 +1,47 @@ +.c.$O: + $(CC) $(CFLAGS) -I../libutf -I../libfmt -I../libbio -I../libregexp -I$(PREFIX)/include $*.c + +%.$O: %.c + $(CC) $(CFLAGS) -I../libutf -I../libfmt -I../libbio -I../libregexp -I$(PREFIX)/include $*.c + + +$(OFILES): $(HFILES) + +tgz: + rm -rf $(NAME)-$(VERSION) + mkdir $(NAME)-$(VERSION) + cp Makefile Make.* README LICENSE NOTICE *.[ch137] rpm.spec bundle.ports $(TGZFILES) $(NAME)-$(VERSION) + tar cf - $(NAME)-$(VERSION) | gzip >$(NAME)-$(VERSION).tgz + rm -rf $(NAME)-$(VERSION) + +clean: + rm -f $(OFILES) $(LIB) + +nuke: + rm -f $(OFILES) *.tgz *.rpm $(NUKEFILES) + +rpm: + make tgz + cp $(NAME)-$(VERSION).tgz /usr/src/RPM/SOURCES + rpm -ba rpm.spec + cp /usr/src/RPM/SRPMS/$(NAME)-$(VERSION)-1.src.rpm . + cp /usr/src/RPM/RPMS/i586/$(NAME)-$(VERSION)-1.i586.rpm . + scp *.rpm rsc@amsterdam.lcs.mit.edu:public_html/software + +PORTDIR=/usr/ports/$(PORTPLACE) + +ports: + make tgz + rm -rf $(PORTDIR) + mkdir $(PORTDIR) + cp $(NAME)-$(VERSION).tgz /usr/ports/distfiles + cat bundle.ports | (cd $(PORTDIR) && awk '$$1=="---" && $$3=="---" { ofile=$$2; next} {if(ofile) print >ofile}') + (cd $(PORTDIR); make makesum) + (cd $(PORTDIR); make) + (cd $(PORTDIR); /usr/local/bin/portlint) + rm -rf $(PORTDIR)/work + shar `find $(PORTDIR)` > ports.shar + (cd $(PORTDIR); tar cf - *) | gzip >$(NAME)-$(VERSION)-ports.tgz + scp *.tgz rsc@amsterdam.lcs.mit.edu:public_html/software + +.phony: all clean nuke install tgz rpm ports diff --git a/unix/make/Makefile.CMD b/unix/make/Makefile.CMD new file mode 100644 index 00000000..04cd1601 --- /dev/null +++ b/unix/make/Makefile.CMD @@ -0,0 +1,5 @@ + +$(TARG): $(OFILES) + $(CC) -o $(TARG) $(OFILES) -L$(PREFIX)/lib -L../libutf -L../libfmt -L../libbio -L../libregexp -lregexp9 -lbio -lfmt -lutf + + diff --git a/unix/make/Makefile.LIB b/unix/make/Makefile.LIB new file mode 100644 index 00000000..9ebf5606 --- /dev/null +++ b/unix/make/Makefile.LIB @@ -0,0 +1,4 @@ +$(LIB): $(OFILES) + $(AR) $(ARFLAGS) $(LIB) $(OFILES) + +NUKEFILES+=$(LIB) diff --git a/unix/make/Makefile.MID b/unix/make/Makefile.MID new file mode 100644 index 00000000..9c142d44 --- /dev/null +++ b/unix/make/Makefile.MID @@ -0,0 +1,41 @@ +LIB=libutf.a +VERSION=2.0 +PORTPLACE=devel/libutf +NAME=libutf + +OFILES=\ + rune.$O\ + runestrcat.$O\ + runestrchr.$O\ + runestrcmp.$O\ + runestrcpy.$O\ + runestrdup.$O\ + runestrlen.$O\ + runestrecpy.$O\ + runestrncat.$O\ + runestrncmp.$O\ + runestrncpy.$O\ + runestrrchr.$O\ + runestrstr.$O\ + runetype.$O\ + utfecpy.$O\ + utflen.$O\ + utfnlen.$O\ + utfrrune.$O\ + utfrune.$O\ + utfutf.$O\ + +HFILES=\ + utf.h\ + +all: $(LIB) + +install: $(LIB) + test -d $(PREFIX)/man/man3 || mkdir $(PREFIX)/man/man3 + install -c -m 0644 isalpharune.3 $(PREFIX)/man/man3/isalpharune.3 + install -c -m 0644 utf.7 $(PREFIX)/man/man7/utf.7 + install -c -m 0644 rune.3 $(PREFIX)/man/man3/rune.3 + install -c -m 0644 runestrcat.3 $(PREFIX)/man/man3/runestrcat.3 + install -c -m 0644 utf.h $(PREFIX)/include/utf.h + install -c -m 0644 $(LIB) $(PREFIX)/lib/$(LIB) + diff --git a/unix/make/Makefile.TOP b/unix/make/Makefile.TOP new file mode 100644 index 00000000..f6abc8c1 --- /dev/null +++ b/unix/make/Makefile.TOP @@ -0,0 +1,20 @@ + +# this works in gnu make +SYSNAME:=${shell uname} +OBJTYPE:=${shell uname -m | sed 's;i.86;386;; s;/.*;;; s; ;;g'} + +# this works in bsd make +SYSNAME!=uname +OBJTYPE!=uname -m | sed 's;i.86;386;; s;/.*;;; s; ;;g' + +# the gnu rules will mess up bsd but not vice versa, +# hence the gnu rules come first. + +include Make.$(SYSNAME)-$(OBJTYPE) + +PREFIX=/usr/local + +NUKEFILES= + +TGZFILES= + diff --git a/unix/make/Makefile.bio b/unix/make/Makefile.bio new file mode 100644 index 00000000..c27b7417 --- /dev/null +++ b/unix/make/Makefile.bio @@ -0,0 +1,38 @@ +LIB=libbio.a +VERSION=2.0 +PORTPLACE=devel/libbio +NAME=libbio + +OFILES=\ + bbuffered.$O\ + bfildes.$O\ + bflush.$O\ + bfmt.$O\ + bgetc.$O\ + bgetd.$O\ + bgetrune.$O\ + binit.$O\ + boffset.$O\ + bprint.$O\ + bputc.$O\ + bputrune.$O\ + brdline.$O\ + brdstr.$O\ + bread.$O\ + bseek.$O\ + bwrite.$O\ + +HFILES=\ + bio.h\ + +all: $(LIB) + +install: $(LIB) + test -d $(PREFIX)/man/man3 || mkdir $(PREFIX)/man/man3 + install -m 0644 bio.3 $(PREFIX)/man/man3/bio.3 + install -m 0644 bio.h $(PREFIX)/include + install -m 0644 $(LIB) $(PREFIX)/lib/$(LIB) + +bcat: bcat.$O $(LIB) + $(CC) -o bcat bcat.$O $(LIB) -L/usr/local/lib -lfmt -lutf + diff --git a/unix/make/Makefile.fmt b/unix/make/Makefile.fmt new file mode 100644 index 00000000..85e9455f --- /dev/null +++ b/unix/make/Makefile.fmt @@ -0,0 +1,64 @@ +LIB=libfmt.a +VERSION=2.0 +PORTPLACE=devel/libfmt +NAME=libfmt + +NUM=\ + charstod.$O\ + pow10.$O\ + +OFILES=\ + dofmt.$O\ + dorfmt.$O\ + errfmt.$O\ + fltfmt.$O\ + fmt.$O\ + fmtfd.$O\ + fmtfdflush.$O\ + fmtlock.$O\ + fmtprint.$O\ + fmtquote.$O\ + fmtrune.$O\ + fmtstr.$O\ + fmtvprint.$O\ + fprint.$O\ + print.$O\ + runefmtstr.$O\ + runeseprint.$O\ + runesmprint.$O\ + runesnprint.$O\ + runesprint.$O\ + runevseprint.$O\ + runevsmprint.$O\ + runevsnprint.$O\ + seprint.$O\ + smprint.$O\ + snprint.$O\ + sprint.$O\ + strtod.$O\ + vfprint.$O\ + vseprint.$O\ + vsmprint.$O\ + vsnprint.$O\ + $(NUM)\ + $(NAN)\ + +HFILES=\ + fmtdef.h\ + fmt.h\ + +all: $(LIB) + +install: $(LIB) + test -d $(PREFIX)/man/man3 || mkdir $(PREFIX)/man/man3 + install -m 0644 print.3 $(PREFIX)/man/man3/print.3 + install -m 0644 fmtinstall.3 $(PREFIX)/man/man3/fmtinstall.3 + install -m 0644 fmt.h $(PREFIX)/include/fmt.h + install -m 0644 $(LIB) $(PREFIX)/lib/$(LIB) + +$(NAN).$O: nan.h +strtod.$O: nan.h + +test: $(LIB) test.$O + $(CC) -o test test.$O $(LIB) -L$(PREFIX)/lib -lutf + diff --git a/unix/make/Makefile.mk b/unix/make/Makefile.mk new file mode 100644 index 00000000..f840b18e --- /dev/null +++ b/unix/make/Makefile.mk @@ -0,0 +1,45 @@ +TARG=mk +VERSION=2.0 +PORTPLACE=devel/mk +NAME=mk + +OFILES=\ + arc.$O\ + archive.$O\ + bufblock.$O\ + env.$O\ + file.$O\ + graph.$O\ + job.$O\ + lex.$O\ + main.$O\ + match.$O\ + mk.$O\ + parse.$O\ + recipe.$O\ + rule.$O\ + run.$O\ + sh.$O\ + shprint.$O\ + symtab.$O\ + var.$O\ + varsub.$O\ + word.$O\ + unix.$O\ + +HFILES=\ + mk.h\ + fns.h\ + +all: $(TARG) + +TGZFILES+=mk.pdf + +install: $(LIB) + test -d $(PREFIX)/man/man1 || mkdir $(PREFIX)/man/man1 + test -d $(PREFIX)/doc || mkdir $(PREFIX)/doc + install -m 0755 mk $(PREFIX)/bin/mk + cat mk.1 | sed 's;DOCPREFIX;$(PREFIX);g' >mk.1a + install -m 0644 mk.1a $(PREFIX)/man/man1/mk.1 + install -m 0644 mk.pdf $(PREFIX)/doc/mk.pdf + diff --git a/unix/make/Makefile.regexp b/unix/make/Makefile.regexp new file mode 100644 index 00000000..ec528bd4 --- /dev/null +++ b/unix/make/Makefile.regexp @@ -0,0 +1,35 @@ +LIB=libregexp9.a +VERSION=2.0 +PORTPLACE=devel/libregexp9 +NAME=libregexp9 + +OFILES=\ + regcomp.$O\ + regerror.$O\ + regexec.$O\ + regsub.$O\ + regaux.$O\ + rregexec.$O\ + rregsub.$O\ + rregaux.$O\ + +HFILES=\ + regexp9.h\ + regcomp.h\ + +all: $(LIB) + +install: $(LIB) + test -d $(PREFIX)/man/man3 || mkdir $(PREFIX)/man/man3 + test -d $(PREFIX)/man/man7 || mkdir $(PREFIX)/man/man7 + install -m 0644 regexp9.3 $(PREFIX)/man/man3/regexp9.3 + install -m 0644 regexp9.7 $(PREFIX)/man/man7/regexp9.7 + install -m 0644 $(LIB) $(PREFIX)/lib/$(LIB) + install -m 0644 regexp9.h $(PREFIX)/include/regexp9.h + +test: test.$O $(LIB) + $(CC) -o test test.$O $(LIB) -L/usr/local/lib -lfmt -lutf + +test2: test2.$O $(LIB) + $(CC) -o test2 test2.$O $(LIB) -L/usr/local/lib -lfmt -lutf + diff --git a/unix/make/Makefile.utf b/unix/make/Makefile.utf new file mode 100644 index 00000000..9c142d44 --- /dev/null +++ b/unix/make/Makefile.utf @@ -0,0 +1,41 @@ +LIB=libutf.a +VERSION=2.0 +PORTPLACE=devel/libutf +NAME=libutf + +OFILES=\ + rune.$O\ + runestrcat.$O\ + runestrchr.$O\ + runestrcmp.$O\ + runestrcpy.$O\ + runestrdup.$O\ + runestrlen.$O\ + runestrecpy.$O\ + runestrncat.$O\ + runestrncmp.$O\ + runestrncpy.$O\ + runestrrchr.$O\ + runestrstr.$O\ + runetype.$O\ + utfecpy.$O\ + utflen.$O\ + utfnlen.$O\ + utfrrune.$O\ + utfrune.$O\ + utfutf.$O\ + +HFILES=\ + utf.h\ + +all: $(LIB) + +install: $(LIB) + test -d $(PREFIX)/man/man3 || mkdir $(PREFIX)/man/man3 + install -c -m 0644 isalpharune.3 $(PREFIX)/man/man3/isalpharune.3 + install -c -m 0644 utf.7 $(PREFIX)/man/man7/utf.7 + install -c -m 0644 rune.3 $(PREFIX)/man/man3/rune.3 + install -c -m 0644 runestrcat.3 $(PREFIX)/man/man3/runestrcat.3 + install -c -m 0644 utf.h $(PREFIX)/include/utf.h + install -c -m 0644 $(LIB) $(PREFIX)/lib/$(LIB) + diff --git a/unix/mkfile b/unix/mkfile new file mode 100644 index 00000000..4f63a77a --- /dev/null +++ b/unix/mkfile @@ -0,0 +1,52 @@ +bio fmt mk regexp utf:V: + case $target in + mk) t=mk ;; + regexp) t=libregexp ;; + *) t=lib$target ;; + esac + mkdir $t || true + rm $t/* || true + cd $t + mk -f ../mkfile.$target + case $target in + bio) d=$PLAN9/src/$t;; + regexp) d=$PLAN9/src/$t;; + fmt) d=$PLAN9/src/lib9/$target ;; + utf) d=$PLAN9/src/lib9/$target ;; + mk) d=$PLAN9/src/cmd/mk ;; + esac + for i in `ls -p $d/*.c` + do + if [ ! -f $i ] + then + echo missing $i + fi + done + make + for i in `ls *.c` + do + if [ ! -f `echo $i | sed 's/.c$/.o/'` ] + then + echo not building $i + fi + done + cd .. + rm $t/* || true + cd $t + mk -f ../mkfile.$target + +lib%.tgz: + mk $stem + tar cf - lib$stem |gzip >lib$stem.tgz + +libregexp9.tgz: + mk regexp + tar cf - libregexp | gzip >libregexp9.tgz + +mk.tgz: + mk mk + tar cf - mk | gzip >mk.tgz + +mk-all.tgz: + tar cf - Makefile libutf libfmt libbio libregexp mk | gzip >mk-all.tgz + diff --git a/unix/mkfile.bio b/unix/mkfile.bio new file mode 100644 index 00000000..5e8cbc0a --- /dev/null +++ b/unix/mkfile.bio @@ -0,0 +1,42 @@ +MAKEALL=`{cd ../make; ls Make.*} +TARG=\ + $MAKEALL\ + NOTICE\ + README\ + Makefile\ + bio.3\ + bio.h\ + lib9.h\ + `{ls -p $PLAN9/src/libbio/*.c}\ + +all:V: $TARG + +%: $PLAN9/include/% + cp $prereq $target + +%: $PLAN9/src/libbio/% + cp $prereq $target + +%: $PLAN9/man/man1/% + cp $prereq $target + +%: $PLAN9/man/man3/% + cp $prereq $target + +%: $PLAN9/man/man7/% + cp $prereq $target + +lib9.h: $PLAN9/src/libbio/lib9.std.h + cp $prereq $target + +%: ../make/% + cp $prereq $target + +Makefile:D: ../make/Makefile.TOP ../make/Makefile.bio ../make/Makefile.LIB ../make/Makefile.BOT + cat $prereq >$target + +README: ../README + cp $prereq $target + +NOTICE: ../NOTICE.bio + cp $prereq $target diff --git a/unix/mkfile.fmt b/unix/mkfile.fmt new file mode 100644 index 00000000..13e97d68 --- /dev/null +++ b/unix/mkfile.fmt @@ -0,0 +1,45 @@ +MAKEALL=`{cd ../make; ls Make.*} +TARG=\ + $MAKEALL\ + NOTICE\ + README\ + Makefile\ + `{ls -p $PLAN9/src/lib9/fmt/*.c}\ + fmt.h\ + fmtdef.h\ + nan.h\ + +all:V: $TARG + +%: $PLAN9/include/% + cp $prereq $target + +%: $PLAN9/src/lib9/fmt/% + cp $prereq $target + +%: $PLAN9/man/man1/% + cp $prereq $target + +%: $PLAN9/man/man3/% + cp $prereq $target + +%: $PLAN9/man/man7/% + cp $prereq $target + +%: ../make/% + cp $prereq $target + +Makefile:D: ../make/Makefile.TOP ../make/Makefile.fmt ../make/Makefile.LIB ../make/Makefile.BOT + cat $prereq >$target + +README: ../README + cp $prereq $target + +NOTICE: ../NOTICE.fmt + cp $prereq $target + +fmt.h: ../fmt.h + cp $prereq $target + +fmt.c: $PLAN9/src/lib9/fmt/fmt.c + cat $prereq | sed "/'u',.*__flagfmt/ s/__flagfmt/__ifmt/" >$target diff --git a/unix/mkfile.mk b/unix/mkfile.mk new file mode 100644 index 00000000..6d650fe1 --- /dev/null +++ b/unix/mkfile.mk @@ -0,0 +1,39 @@ +MAKEALL=`{cd ../make; ls Make.*} +TARG=\ + $MAKEALL\ + NOTICE\ + README\ + Makefile\ + mk.1\ + mk.h\ + fns.h\ + `{ls -p $PLAN9/src/cmd/mk/*.c}\ + +all:V: $TARG + +%: $PLAN9/include/% + cp $prereq $target + +%: $PLAN9/src/cmd/mk/% + cp $prereq $target + +%: $PLAN9/man/man1/% + cp $prereq $target + +%: $PLAN9/man/man3/% + cp $prereq $target + +%: $PLAN9/man/man7/% + cp $prereq $target + +%: ../make/% + cp $prereq $target + +Makefile:D: ../make/Makefile.TOP ../make/Makefile.mk ../make/Makefile.CMD ../make/Makefile.BOT + cat $prereq >$target + +README: ../README + cp $prereq $target + +NOTICE: ../NOTICE.mk + cp $prereq $target diff --git a/unix/mkfile.regexp b/unix/mkfile.regexp new file mode 100644 index 00000000..de813087 --- /dev/null +++ b/unix/mkfile.regexp @@ -0,0 +1,44 @@ +MAKEALL=`{cd ../make; ls Make.*} +TARG=\ + $MAKEALL\ + NOTICE\ + README\ + Makefile\ + regexp9.3\ + regexp9.7\ + regexp9.h\ + regcomp.h\ + lib9.h\ + `{ls -p $PLAN9/src/libregexp/*.c}\ + +all:V: $TARG + +%: $PLAN9/include/% + cp $prereq $target + +%: $PLAN9/src/libregexp/% + cp $prereq $target + +%: $PLAN9/man/man1/% + cp $prereq $target + +%: $PLAN9/man/man3/% + cp $prereq $target + +%: $PLAN9/man/man7/% + cp $prereq $target + +%: ../make/% + cp $prereq $target + +Makefile:D: ../make/Makefile.TOP ../make/Makefile.regexp ../make/Makefile.LIB ../make/Makefile.BOT + cat $prereq >$target + +README: ../README + cp $prereq $target + +NOTICE: ../NOTICE.regexp + cp $prereq $target + +lib9.h: $PLAN9/src/libregexp/lib9.h + cp $prereq $target diff --git a/unix/mkfile.utf b/unix/mkfile.utf new file mode 100644 index 00000000..b611b5f0 --- /dev/null +++ b/unix/mkfile.utf @@ -0,0 +1,42 @@ +MAKEALL=`{cd ../make; ls Make.*} +TARG=\ + $MAKEALL\ + NOTICE\ + README\ + Makefile\ + `{ls -p $PLAN9/src/lib9/utf/*.c}\ + utf.h\ + utfdef.h\ + +all:V: $TARG + +%: $PLAN9/include/% + cp $prereq $target + +%: $PLAN9/src/lib9/utf/% + cp $prereq $target + +%: $PLAN9/man/man1/% + cp $prereq $target + +%: $PLAN9/man/man3/% + cp $prereq $target + +%: $PLAN9/man/man7/% + cp $prereq $target + +%: ../make/% + cp $prereq $target + +Makefile:D: ../make/Makefile.TOP ../make/Makefile.utf ../make/Makefile.LIB ../make/Makefile.BOT + cat $prereq >$target + +README: ../README + cp $prereq $target + +NOTICE: ../NOTICE.utf + cp $prereq $target + +utf.h: ../utf.h + cp $prereq $target + diff --git a/unix/utf.h b/unix/utf.h new file mode 100644 index 00000000..833d9d25 --- /dev/null +++ b/unix/utf.h @@ -0,0 +1,57 @@ +#ifndef _UTFH_ +#define _UTFH_ 1 +#ifdef __cplusplus +extern "C" { +#endif + +typedef unsigned short Rune; /* 16 bits */ + +enum +{ + UTFmax = 3, /* maximum bytes per rune */ + Runesync = 0x80, /* cannot represent part of a UTF sequence (<) */ + Runeself = 0x80, /* rune and UTF sequences are the same (<) */ + Runeerror = 0x80, /* decoding error in UTF */ +}; + +/* + * rune routines + */ +extern int runetochar(char*, Rune*); +extern int chartorune(Rune*, char*); +extern int runelen(long); +extern int runenlen(Rune*, int); +extern int fullrune(char*, int); +extern int utflen(char*); +extern int utfnlen(char*, long); +extern char* utfrune(char*, long); +extern char* utfrrune(char*, long); +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*, long); +extern Rune* runestrecpy(Rune*, Rune*, Rune*); +extern Rune* runestrdup(Rune*); +extern Rune* runestrncat(Rune*, Rune*, long); +extern int runestrncmp(Rune*, Rune*, long); +extern Rune* runestrrchr(Rune*, Rune); +extern long 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); + +#ifdef cplusplus +} +#endif +#endif |