URI: 
       tBuild Unix-friendly versions directly from library. - plan9port - [fork] Plan 9 from user space
  HTML git clone git://src.adamsgaard.dk/plan9port
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
   DIR commit aa738614530c1525b2337a3812d238b9776d51f0
   DIR parent 63dd44c8ca13354de84c4da659454526ec6750db
  HTML Author: rsc <devnull@localhost>
       Date:   Mon,  1 Mar 2004 19:36:29 +0000
       
       Build Unix-friendly versions directly from library.
       
       Diffstat:
         A unix/Makefile                       |       7 +++++++
         A unix/NOTICE.bio                     |      40 +++++++++++++++++++++++++++++++
         A unix/NOTICE.fmt                     |      19 +++++++++++++++++++
         A unix/NOTICE.mk                      |      40 +++++++++++++++++++++++++++++++
         A unix/NOTICE.regexp                  |      19 +++++++++++++++++++
         A unix/NOTICE.utf                     |      19 +++++++++++++++++++
         A unix/README                         |       2 ++
         A unix/fmt.h                          |     106 ++++++++++++++++++++++++++++++
         A unix/make/Make.Darwin-PowerMacinto… |       6 ++++++
         A unix/make/Make.FreeBSD-386          |       7 +++++++
         A unix/make/Make.HP-UX-9000           |       6 ++++++
         A unix/make/Make.Linux-386            |       7 +++++++
         A unix/make/Make.NetBSD-386           |       7 +++++++
         A unix/make/Make.OSF1-alpha           |       6 ++++++
         A unix/make/Make.SunOS-sun4u          |       2 ++
         A unix/make/Make.SunOS-sun4u-cc       |       6 ++++++
         A unix/make/Make.SunOS-sun4u-gcc      |       6 ++++++
         A unix/make/Makefile.BOT              |      47 +++++++++++++++++++++++++++++++
         A unix/make/Makefile.CMD              |       5 +++++
         A unix/make/Makefile.LIB              |       4 ++++
         A unix/make/Makefile.MID              |      41 +++++++++++++++++++++++++++++++
         A unix/make/Makefile.TOP              |      20 ++++++++++++++++++++
         A unix/make/Makefile.bio              |      38 +++++++++++++++++++++++++++++++
         A unix/make/Makefile.fmt              |      64 +++++++++++++++++++++++++++++++
         A unix/make/Makefile.mk               |      45 +++++++++++++++++++++++++++++++
         A unix/make/Makefile.regexp           |      35 +++++++++++++++++++++++++++++++
         A unix/make/Makefile.utf              |      41 +++++++++++++++++++++++++++++++
         A unix/mkfile                         |      52 +++++++++++++++++++++++++++++++
         A unix/mkfile.bio                     |      42 +++++++++++++++++++++++++++++++
         A unix/mkfile.fmt                     |      45 +++++++++++++++++++++++++++++++
         A unix/mkfile.mk                      |      39 +++++++++++++++++++++++++++++++
         A unix/mkfile.regexp                  |      44 +++++++++++++++++++++++++++++++
         A unix/mkfile.utf                     |      42 +++++++++++++++++++++++++++++++
         A unix/utf.h                          |      57 +++++++++++++++++++++++++++++++
       
       34 files changed, 966 insertions(+), 0 deletions(-)
       ---
   DIR diff --git a/unix/Makefile b/unix/Makefile
       t@@ -0,0 +1,7 @@
       +all:
       +        for i in libutf libfmt libbio libregexp mk
       +        do
       +                (cd $i; make)
       +        done
       +        ls -l mk/mk
       +
   DIR diff --git a/unix/NOTICE.bio b/unix/NOTICE.bio
       t@@ -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.
   DIR diff --git a/unix/NOTICE.fmt b/unix/NOTICE.fmt
       t@@ -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>.
       +
   DIR diff --git a/unix/NOTICE.mk b/unix/NOTICE.mk
       t@@ -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.
   DIR diff --git a/unix/NOTICE.regexp b/unix/NOTICE.regexp
       t@@ -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>.
       +
   DIR diff --git a/unix/NOTICE.utf b/unix/NOTICE.utf
       t@@ -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>.
       +
   DIR diff --git a/unix/README b/unix/README
       t@@ -0,0 +1,2 @@
       +This software was packaged for Unix by Russ Cox.
       +Please send comments to rsc@swtch.com.
   DIR diff --git a/unix/fmt.h b/unix/fmt.h
       t@@ -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
   DIR diff --git a/unix/make/Make.Darwin-PowerMacintosh b/unix/make/Make.Darwin-PowerMacintosh
       t@@ -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
   DIR diff --git a/unix/make/Make.FreeBSD-386 b/unix/make/Make.FreeBSD-386
       t@@ -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
   DIR diff --git a/unix/make/Make.HP-UX-9000 b/unix/make/Make.HP-UX-9000
       t@@ -0,0 +1,6 @@
       +CC=cc
       +CFLAGS=-O -c -Ae -I.
       +O=o
       +AR=ar
       +ARFLAGS=rvc
       +NAN=nan64.$O
   DIR diff --git a/unix/make/Make.Linux-386 b/unix/make/Make.Linux-386
       t@@ -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
   DIR diff --git a/unix/make/Make.NetBSD-386 b/unix/make/Make.NetBSD-386
       t@@ -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
   DIR diff --git a/unix/make/Make.OSF1-alpha b/unix/make/Make.OSF1-alpha
       t@@ -0,0 +1,6 @@
       +CC=cc
       +CFLAGS+=-g -c -I.
       +O=o
       +AR=ar
       +ARFLAGS=rvc
       +NAN=nan64.$O
   DIR diff --git a/unix/make/Make.SunOS-sun4u b/unix/make/Make.SunOS-sun4u
       t@@ -0,0 +1,2 @@
       +include Make.SunOS-sun4u-$(CC)
       +NAN=nan64.$O
   DIR diff --git a/unix/make/Make.SunOS-sun4u-cc b/unix/make/Make.SunOS-sun4u-cc
       t@@ -0,0 +1,6 @@
       +CC=cc
       +CFLAGS+=-g -c -I. -O
       +O=o
       +AR=ar
       +ARFLAGS=rvc
       +NAN=nan64.$O
   DIR diff --git a/unix/make/Make.SunOS-sun4u-gcc b/unix/make/Make.SunOS-sun4u-gcc
       t@@ -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
   DIR diff --git a/unix/make/Makefile.BOT b/unix/make/Makefile.BOT
       t@@ -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
   DIR diff --git a/unix/make/Makefile.CMD b/unix/make/Makefile.CMD
       t@@ -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
       +
       +
   DIR diff --git a/unix/make/Makefile.LIB b/unix/make/Makefile.LIB
       t@@ -0,0 +1,4 @@
       +$(LIB): $(OFILES)
       +        $(AR) $(ARFLAGS) $(LIB) $(OFILES)
       +
       +NUKEFILES+=$(LIB)
   DIR diff --git a/unix/make/Makefile.MID b/unix/make/Makefile.MID
       t@@ -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)
       +
   DIR diff --git a/unix/make/Makefile.TOP b/unix/make/Makefile.TOP
       t@@ -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=
       +
   DIR diff --git a/unix/make/Makefile.bio b/unix/make/Makefile.bio
       t@@ -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
       +
   DIR diff --git a/unix/make/Makefile.fmt b/unix/make/Makefile.fmt
       t@@ -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
       +
   DIR diff --git a/unix/make/Makefile.mk b/unix/make/Makefile.mk
       t@@ -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
       +
   DIR diff --git a/unix/make/Makefile.regexp b/unix/make/Makefile.regexp
       t@@ -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
       +
   DIR diff --git a/unix/make/Makefile.utf b/unix/make/Makefile.utf
       t@@ -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)
       +
   DIR diff --git a/unix/mkfile b/unix/mkfile
       t@@ -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
       +
   DIR diff --git a/unix/mkfile.bio b/unix/mkfile.bio
       t@@ -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
   DIR diff --git a/unix/mkfile.fmt b/unix/mkfile.fmt
       t@@ -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
   DIR diff --git a/unix/mkfile.mk b/unix/mkfile.mk
       t@@ -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
   DIR diff --git a/unix/mkfile.regexp b/unix/mkfile.regexp
       t@@ -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
   DIR diff --git a/unix/mkfile.utf b/unix/mkfile.utf
       t@@ -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
       +
   DIR diff --git a/unix/utf.h b/unix/utf.h
       t@@ -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