├── contrib ├── kpv │ ├── src │ │ └── lib │ │ │ └── sfio │ │ │ ├── Stdio_b │ │ │ ├── Bkup │ │ │ ├── ast54.sym │ │ │ └── stdio.def │ │ │ ├── features │ │ │ ├── stdio_lcl │ │ │ └── iffeio │ │ │ ├── Stdio_bm │ │ │ ├── run │ │ │ └── Makefile │ │ │ ├── Makestate.sh │ │ │ ├── Sfio_dc │ │ │ ├── Makefile │ │ │ └── sfdchdr.h │ │ │ ├── NOTICE │ │ │ ├── Stdio_s │ │ │ ├── Makefile │ │ │ ├── stdfgetc.c │ │ │ └── stdgetc.c │ │ │ ├── NOTES │ │ │ ├── _sfslen.c │ │ │ ├── _sfeof.c │ │ │ ├── _sfgetc.c │ │ │ ├── _sfllen.c │ │ │ ├── _sfdlen.c │ │ │ └── _sferror.c │ └── NOTICE ├── libbio │ ├── Make.SunOS-sun4u │ ├── Make.OSF1-alpha │ ├── Make.HP-UX-9000 │ ├── Make.SunOS-i86pc │ ├── Make.SunOS-sun4u-cc │ ├── bfildes.c │ ├── README │ ├── Make.Linux-power │ ├── Make.Linux-ppc64 │ ├── Make.SunOS-sun4u-gcc │ ├── Make.IRIX64-IP27 │ ├── Make.Darwin-PowerMacintosh │ ├── Make.Linux-386 │ ├── Make.Linux-x86_64 │ ├── Make.CYGWIN_NT-5.2-386 │ ├── Make.Darwin-386 │ ├── Make.FreeBSD-386 │ ├── Make.NetBSD-386 │ ├── Make.OpenBSD-386 │ ├── Make.FreeBSD-amd64 │ ├── bprint.c │ ├── bputc.c │ ├── bbuffered.c │ ├── lib9.h │ ├── bputrune.c │ ├── boffset.c │ ├── bgetd.c │ ├── bflush.c │ ├── bwrite.c │ ├── bvprint.c │ ├── bgetrune.c │ ├── bread.c │ ├── bcat.c │ ├── bgetc.c │ └── bseek.c ├── libfmt │ ├── Make.SunOS-sun4u │ ├── Make.OSF1-alpha │ ├── Make.HP-UX-9000 │ ├── Make.SunOS-i86pc │ ├── Make.SunOS-sun4u-cc │ ├── nan.h │ ├── README │ ├── Make.Linux-power │ ├── Make.Linux-ppc64 │ ├── Make.SunOS-sun4u-gcc │ ├── Make.IRIX64-IP27 │ ├── test2.c │ ├── Make.Darwin-PowerMacintosh │ ├── Make.Linux-386 │ ├── Make.Linux-x86_64 │ ├── Make.CYGWIN_NT-5.2-386 │ ├── Make.Darwin-386 │ ├── Make.FreeBSD-386 │ ├── Make.NetBSD-386 │ ├── Make.OpenBSD-386 │ ├── Make.FreeBSD-amd64 │ ├── plan9.h │ ├── fmtlock.c │ ├── errfmt.c │ ├── fmtstr.c │ ├── runefmtstr.c │ ├── print.c │ ├── smprint.c │ ├── fprint.c │ ├── test3.c │ ├── NOTICE │ ├── seprint.c │ ├── snprint.c │ ├── runesmprint.c │ ├── runesprint.c │ ├── runeseprint.c │ ├── runesnprint.c │ ├── vfprint.c │ ├── fmtfdflush.c │ ├── fmtrune.c │ ├── vseprint.c │ ├── vsnprint.c │ ├── runevseprint.c │ ├── runevsnprint.c │ ├── nan64.c │ ├── sprint.c │ ├── fmtfd.c │ ├── fmtprint.c │ ├── fmtvprint.c │ ├── test.c │ └── dorfmt.c ├── libutf │ ├── Make.SunOS-sun4u │ ├── Make.OSF1-alpha │ ├── Make.HP-UX-9000 │ ├── Make.SunOS-i86pc │ ├── Make.SunOS-sun4u-cc │ ├── README │ ├── Make.Linux-power │ ├── Make.Linux-ppc64 │ ├── Make.SunOS-sun4u-gcc │ ├── Make.IRIX64-IP27 │ ├── Make.Darwin-PowerMacintosh │ ├── Make.Linux-386 │ ├── Make.Linux-x86_64 │ ├── Make.CYGWIN_NT-5.2-386 │ ├── Make.Darwin-386 │ ├── Make.FreeBSD-386 │ ├── Make.NetBSD-386 │ ├── Make.OpenBSD-386 │ ├── Make.FreeBSD-amd64 │ ├── plan9.h │ ├── utfdef.h │ ├── runestrlen.c │ ├── runestrcat.c │ ├── runestrcpy.c │ ├── runestrrchr.c │ ├── NOTICE │ ├── runestrdup.c │ ├── runestrecpy.c │ ├── runestrncat.c │ ├── runestrchr.c │ ├── runestrcmp.c │ ├── runestrncpy.c │ ├── utflen.c │ ├── runestrncmp.c │ ├── utfecpy.c │ ├── utfnlen.c │ ├── utfutf.c │ ├── utfrune.c │ ├── runestrstr.c │ ├── utfrrune.c │ └── utf.h ├── mk │ ├── Make.SunOS-sun4u │ ├── Make.HP-UX-9000 │ ├── Make.OSF1-alpha │ ├── Make.SunOS-i86pc │ ├── Make.SunOS-sun4u-cc │ ├── README │ ├── Make.Linux-power │ ├── Make.Linux-ppc64 │ ├── Make.SunOS-sun4u-gcc │ ├── Make.IRIX64-IP27 │ ├── Make.Darwin-PowerMacintosh │ ├── Make.Linux-386 │ ├── Make.Linux-x86_64 │ ├── Make.CYGWIN_NT-5.2-386 │ ├── Make.Darwin-386 │ ├── Make.NetBSD-386 │ ├── Make.FreeBSD-386 │ ├── Make.FreeBSD-amd64 │ ├── Make.OpenBSD-386 │ ├── sys.h │ ├── var.c │ ├── job.c │ ├── match.c │ ├── arc.c │ ├── shell.c │ ├── bufblock.c │ └── file.c ├── libregexp │ ├── Make.SunOS-sun4u │ ├── Make.OSF1-alpha │ ├── Make.HP-UX-9000 │ ├── Make.SunOS-i86pc │ ├── Make.SunOS-sun4u-cc │ ├── README │ ├── Make.Linux-power │ ├── Make.Linux-ppc64 │ ├── Make.SunOS-sun4u-gcc │ ├── Make.IRIX64-IP27 │ ├── Make.Darwin-PowerMacintosh │ ├── lib9.h │ ├── Make.Linux-386 │ ├── Make.Linux-x86_64 │ ├── Make.CYGWIN_NT-5.2-386 │ ├── Make.Darwin-386 │ ├── Make.FreeBSD-386 │ ├── Make.FreeBSD-amd64 │ ├── Make.NetBSD-386 │ ├── Make.OpenBSD-386 │ ├── regerror.c │ ├── test2.c │ ├── NOTICE │ ├── test.c │ ├── regsub.c │ └── rregsub.c ├── gre │ ├── egerror.c │ ├── io.h │ ├── egparen.c │ ├── egpos.c │ ├── libc.h │ ├── egcw.c │ ├── mkfile │ ├── getopt.c │ ├── eglit.c │ ├── deansify.awk │ ├── re.c │ ├── egcanon.c │ └── retest.c ├── xfm │ ├── README │ ├── include │ │ ├── startup.im │ │ └── mkfile │ ├── master.mk │ ├── lib │ │ ├── utconst.h │ │ ├── ut_time.h │ │ └── parse.h │ ├── hfm │ │ ├── fmrconst.h │ │ └── fmrglob.h │ ├── rfm │ │ ├── rfm_const.h │ │ ├── fmdummy.c │ │ ├── fmdump.c │ │ └── fmignore.c │ ├── mkfile │ ├── tfm │ │ └── fmtable.c │ └── pfm │ │ └── fmdummy.c ├── fettle │ ├── mkfile │ ├── fettle.rb │ └── check.rb ├── tail │ ├── Makefile │ ├── mkfile │ └── README └── README ├── .gitignore ├── README.md ├── potoroo ├── lib │ ├── addressbook │ ├── ng_argv0.c │ ├── ng_verbose.c │ ├── ng_dummy_man2.c │ ├── ningaui.h │ ├── ng_dummy_man.c │ ├── no_ast.c │ └── ng_tokenise.h ├── tape │ └── rdvol.c ├── pinkpages │ └── cartulary.static ├── srcmgt │ └── mkfile ├── tool │ ├── crontab_base.ningaui │ └── pstree.ksh ├── repmgr │ └── repmgrb.h └── cluster │ └── mkfile └── LICENSE /contrib/kpv/src/lib/sfio/Stdio_b/Bkup: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /contrib/kpv/src/lib/sfio/features/stdio_lcl: -------------------------------------------------------------------------------- 1 | lcl stdio 2 | -------------------------------------------------------------------------------- /contrib/libbio/Make.SunOS-sun4u: -------------------------------------------------------------------------------- 1 | include Make.SunOS-sun4u-$(CC) 2 | NAN=nan64.$O 3 | -------------------------------------------------------------------------------- /contrib/libfmt/Make.SunOS-sun4u: -------------------------------------------------------------------------------- 1 | include Make.SunOS-sun4u-$(CC) 2 | NAN=nan64.$O 3 | -------------------------------------------------------------------------------- /contrib/libutf/Make.SunOS-sun4u: -------------------------------------------------------------------------------- 1 | include Make.SunOS-sun4u-$(CC) 2 | NAN=nan64.$O 3 | -------------------------------------------------------------------------------- /contrib/mk/Make.SunOS-sun4u: -------------------------------------------------------------------------------- 1 | include Make.SunOS-sun4u-$(CC) 2 | NAN=nan64.$O 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a 3 | *.so 4 | *.ps 5 | *.pdf 6 | __panoptic.mk 7 | HDEPEND* 8 | -------------------------------------------------------------------------------- /contrib/libregexp/Make.SunOS-sun4u: -------------------------------------------------------------------------------- 1 | include Make.SunOS-sun4u-$(CC) 2 | NAN=nan64.$O 3 | -------------------------------------------------------------------------------- /contrib/libbio/Make.OSF1-alpha: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS+=-g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libfmt/Make.OSF1-alpha: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS+=-g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libutf/Make.OSF1-alpha: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS+=-g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/mk/Make.HP-UX-9000: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS=-O -c -Ae -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/mk/Make.OSF1-alpha: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS+=-g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libbio/Make.HP-UX-9000: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS=-O -c -Ae -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libfmt/Make.HP-UX-9000: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS=-O -c -Ae -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libregexp/Make.OSF1-alpha: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS+=-g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libutf/Make.HP-UX-9000: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS=-O -c -Ae -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/mk/Make.SunOS-i86pc: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS += -g -c -I. -O 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/mk/Make.SunOS-sun4u-cc: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS += -g -c -I. -O 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libbio/Make.SunOS-i86pc: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS += -g -c -I. -O 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libbio/Make.SunOS-sun4u-cc: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS += -g -c -I. -O 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libfmt/Make.SunOS-i86pc: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS += -g -c -I. -O 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libfmt/Make.SunOS-sun4u-cc: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS += -g -c -I. -O 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libregexp/Make.HP-UX-9000: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS=-O -c -Ae -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libregexp/Make.SunOS-i86pc: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS += -g -c -I. -O 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libutf/Make.SunOS-i86pc: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS += -g -c -I. -O 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libutf/Make.SunOS-sun4u-cc: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS += -g -c -I. -O 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ningaui 2 | Commodity cluster infrastructure management software 3 | 4 | Please see the plain README for now. 5 | -------------------------------------------------------------------------------- /contrib/libregexp/Make.SunOS-sun4u-cc: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFLAGS += -g -c -I. -O 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/kpv/src/lib/sfio/features/iffeio: -------------------------------------------------------------------------------- 1 | iff SFSTDIO 2 | cat{ 3 | #include "FEATURE/common" 4 | #include "FEATURE/stdio.lcl" 5 | }end 6 | -------------------------------------------------------------------------------- /contrib/libbio/bfildes.c: -------------------------------------------------------------------------------- 1 | #include "lib9.h" 2 | #include 3 | 4 | int 5 | Bfildes(Biobuf *bp) 6 | { 7 | 8 | return bp->fid; 9 | } 10 | -------------------------------------------------------------------------------- /contrib/libfmt/nan.h: -------------------------------------------------------------------------------- 1 | extern double __NaN(void); 2 | extern double __Inf(int); 3 | extern int __isNaN(double); 4 | extern int __isInf(double, int); 5 | -------------------------------------------------------------------------------- /contrib/kpv/src/lib/sfio/Stdio_bm/run: -------------------------------------------------------------------------------- 1 | for i in 1 2 3 4 5 6 7 8 9 2 | do t.stdio > time.stdio$i 3 | t.binary > time.binary$i 4 | t.sfio > time.sfio$i 5 | done 6 | -------------------------------------------------------------------------------- /contrib/libbio/README: -------------------------------------------------------------------------------- 1 | This software was packaged for Unix by Russ Cox. 2 | Please send comments to rsc@swtch.com. 3 | 4 | http://swtch.com/plan9port/unix 5 | 6 | -------------------------------------------------------------------------------- /contrib/libfmt/README: -------------------------------------------------------------------------------- 1 | This software was packaged for Unix by Russ Cox. 2 | Please send comments to rsc@swtch.com. 3 | 4 | http://swtch.com/plan9port/unix 5 | 6 | -------------------------------------------------------------------------------- /contrib/libutf/README: -------------------------------------------------------------------------------- 1 | This software was packaged for Unix by Russ Cox. 2 | Please send comments to rsc@swtch.com. 3 | 4 | http://swtch.com/plan9port/unix 5 | 6 | -------------------------------------------------------------------------------- /contrib/mk/README: -------------------------------------------------------------------------------- 1 | This software was packaged for Unix by Russ Cox. 2 | Please send comments to rsc@swtch.com. 3 | 4 | http://swtch.com/plan9port/unix 5 | 6 | -------------------------------------------------------------------------------- /contrib/libregexp/README: -------------------------------------------------------------------------------- 1 | This software was packaged for Unix by Russ Cox. 2 | Please send comments to rsc@swtch.com. 3 | 4 | http://swtch.com/plan9port/unix 5 | 6 | -------------------------------------------------------------------------------- /contrib/mk/Make.Linux-power: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/mk/Make.Linux-ppc64: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/mk/Make.SunOS-sun4u-gcc: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS += -Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libbio/Make.Linux-power: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libbio/Make.Linux-ppc64: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libbio/Make.SunOS-sun4u-gcc: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS += -Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libfmt/Make.Linux-power: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libfmt/Make.Linux-ppc64: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libfmt/Make.SunOS-sun4u-gcc: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS += -Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libregexp/Make.Linux-power: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libregexp/Make.Linux-ppc64: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libutf/Make.Linux-power: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libutf/Make.Linux-ppc64: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libutf/Make.SunOS-sun4u-gcc: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS += -Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/mk/Make.IRIX64-IP27: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | C_FLAGS = $(CFLAGS) -Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libbio/Make.IRIX64-IP27: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | C_FLAGS = $(CFLAGS) -Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libfmt/Make.IRIX64-IP27: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | C_FLAGS = $(CFLAGS) -Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libregexp/Make.SunOS-sun4u-gcc: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS += -Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/libutf/Make.IRIX64-IP27: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | C_FLAGS = $(CFLAGS) -Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/kpv/src/lib/sfio/Makestate.sh: -------------------------------------------------------------------------------- 1 | if test "`cat Make.state`" != "$1" 2 | then rm *.o Stdio_b/*.o Stdio_s/*.o Sfio_f/*.o 3 | fi >/dev/null 2>&1 4 | echo "$1" > Make.state 5 | exit 0 6 | -------------------------------------------------------------------------------- /contrib/libfmt/test2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int 6 | main(int argc, char **argv) 7 | { 8 | print("%020.10d\n", 100); 9 | } 10 | -------------------------------------------------------------------------------- /contrib/libregexp/Make.IRIX64-IP27: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | C_FLAGS = $(CFLAGS) -Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/gre/egerror.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "re.h" 3 | 4 | void 5 | re_error(char *s) 6 | { 7 | fprintf(stderr, "pattern error: %s\n", s); 8 | exit(1); 9 | /* NOTREACHED */ 10 | } 11 | -------------------------------------------------------------------------------- /contrib/libbio/Make.Darwin-PowerMacintosh: -------------------------------------------------------------------------------- 1 | CC=$(GLMK_CC) 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I${PREFIX}/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O 7 | -------------------------------------------------------------------------------- /contrib/mk/Make.Darwin-PowerMacintosh: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CC=$(GLMK_CC) 3 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I${PREFIX}/include 4 | O=o 5 | AR=ar 6 | ARFLAGS=rvc 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libfmt/Make.Darwin-PowerMacintosh: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CC=$(GLMK_CC) 3 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I${PREFIX}/include 4 | O=o 5 | AR=ar 6 | ARFLAGS=rvc 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libutf/Make.Darwin-PowerMacintosh: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CC=$(GLMK_CC) 3 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I${PREFIX}/include 4 | O=o 5 | AR=ar 6 | ARFLAGS=rvc 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libregexp/Make.Darwin-PowerMacintosh: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CC=$(GLMK_CC) 3 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I${PREFIX}/include 4 | O=o 5 | AR=ar 6 | ARFLAGS=rvc 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libregexp/lib9.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #define exits(x) exit(x && *x ? 1 : 0) 8 | 9 | #define nil 0 10 | 11 | -------------------------------------------------------------------------------- /contrib/mk/Make.Linux-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libbio/Make.Linux-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libfmt/Make.Linux-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libutf/Make.Linux-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/mk/Make.Linux-x86_64: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libbio/Make.Linux-x86_64: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libfmt/Make.Linux-x86_64: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libregexp/Make.Linux-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libregexp/Make.Linux-x86_64: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libutf/Make.Linux-x86_64: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/mk/Make.CYGWIN_NT-5.2-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libbio/Make.CYGWIN_NT-5.2-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libfmt/Make.CYGWIN_NT-5.2-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libregexp/Make.CYGWIN_NT-5.2-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libutf/Make.CYGWIN_NT-5.2-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /potoroo/lib/addressbook: -------------------------------------------------------------------------------- 1 | # this is a nick-name to email address mapping used by ng_mailer 2 | # it also supports mailing lists 3 | # format of entries is either 4 | # nickname user@domain 5 | # + list-name nickname nickname nickname .... 6 | 7 | -------------------------------------------------------------------------------- /contrib/mk/Make.Darwin-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/mk/Make.NetBSD-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libbio/Make.Darwin-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libbio/Make.FreeBSD-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libbio/Make.NetBSD-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libbio/Make.OpenBSD-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libfmt/Make.Darwin-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libfmt/Make.FreeBSD-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libfmt/Make.NetBSD-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libfmt/Make.OpenBSD-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libutf/Make.Darwin-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libutf/Make.FreeBSD-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libutf/Make.NetBSD-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libutf/Make.OpenBSD-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/mk/Make.FreeBSD-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/mk/Make.FreeBSD-amd64: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/mk/Make.OpenBSD-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libbio/Make.FreeBSD-amd64: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libfmt/Make.FreeBSD-amd64: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libregexp/Make.Darwin-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libregexp/Make.FreeBSD-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libregexp/Make.FreeBSD-amd64: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libregexp/Make.NetBSD-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libregexp/Make.OpenBSD-386: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libutf/Make.FreeBSD-amd64: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFLAGS+=-Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -O2 -g -c -I. -I$(PREFIX)/include 3 | O=o 4 | AR=ar 5 | ARFLAGS=rvc 6 | NAN=nan64.$O # default, can be overriden by Make.$(SYSNAME) 7 | NAN=nan64.$O 8 | -------------------------------------------------------------------------------- /contrib/libbio/bprint.c: -------------------------------------------------------------------------------- 1 | #include "lib9.h" 2 | #include 3 | 4 | int 5 | Bprint(Biobuf *bp, char *fmt, ...) 6 | { 7 | int n; 8 | va_list arg; 9 | 10 | va_start(arg, fmt); 11 | n = Bvprint(bp, fmt, arg); 12 | va_end(arg); 13 | return n; 14 | } 15 | -------------------------------------------------------------------------------- /contrib/libregexp/regerror.c: -------------------------------------------------------------------------------- 1 | #include "lib9.h" 2 | #include "regexp9.h" 3 | 4 | void 5 | regerror(char *s) 6 | { 7 | char buf[132]; 8 | 9 | strcpy(buf, "regerror: "); 10 | strcat(buf, s); 11 | strcat(buf, "\n"); 12 | write(2, buf, strlen(buf)); 13 | exits("regerr"); 14 | } 15 | -------------------------------------------------------------------------------- /contrib/xfm/README: -------------------------------------------------------------------------------- 1 | 2 | This version of {X}fm is included as it was a part of the original 3 | Ningaui opensource release, but has not been maintained. It will 4 | still support the Ningaui code, however {X}fm is maintained in a 5 | separate github repository and should be pulled, built and installed 6 | from there if at all possible. 7 | -------------------------------------------------------------------------------- /contrib/libbio/bputc.c: -------------------------------------------------------------------------------- 1 | #include "lib9.h" 2 | #include 3 | 4 | int 5 | Bputc(Biobuf *bp, int c) 6 | { 7 | int i; 8 | 9 | for(;;) { 10 | i = bp->ocount; 11 | if(i) { 12 | bp->ebuf[i++] = c; 13 | bp->ocount = i; 14 | return 0; 15 | } 16 | if(Bflush(bp) == Beof) 17 | break; 18 | } 19 | return Beof; 20 | } 21 | -------------------------------------------------------------------------------- /contrib/fettle/mkfile: -------------------------------------------------------------------------------- 1 | # 2 | 3 | liblist=check.rb lex.rb parse.rb route.rb vrml.rb world.rb 4 | 5 | INSTALL = fettle m2 6 | LIB_INSTALL = $liblist 7 | ALL = 8 | 9 | GLMK_NOSOURCES = 1 10 | 11 | <$NG_SRC/panoptic.mk 12 | NUKE = $NUKE $ALL 13 | 14 | regress: 15 | # for now, just see if the rack defn compiles 16 | m2 < rack.cve0 | fettle > temp 17 | -------------------------------------------------------------------------------- /contrib/kpv/src/lib/sfio/Stdio_bm/Makefile: -------------------------------------------------------------------------------- 1 | CC= $(GLMK_CC) 2 | 3 | all : t.sfio t.stdio t.binary 4 | 5 | t.sfio : stdiobm.c 6 | $(CC) -O -I.. -I../Stdio_s stdiobm.c ../libsfio.a -o t.sfio 7 | 8 | t.stdio : stdiobm.c 9 | $(CC) -O stdiobm.c -o t.stdio 10 | 11 | t.binary : stdiobm.c 12 | $(CC) -O stdiobm.c ../Stdio_b/libstdio.a ../libsfio.a -o t.binary 13 | -------------------------------------------------------------------------------- /contrib/tail/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Date: 05 Oct 2005 3 | 4 | CC=gcc 5 | CFLAGS= 6 | IFLAGS= -I. 7 | 8 | all: tac 9 | 10 | 11 | clean: 12 | rm -f *.o tac 13 | 14 | 15 | # tail with the -r option as default (no forward ability at all) so that it works on linux too 16 | tac: reverse.o tac.o misc.o read.o 17 | $(CC) $(IFLAGS) $(CFLAGS) -o tac tac.o reverse.c misc.c read.o 18 | -------------------------------------------------------------------------------- /contrib/xfm/include/startup.im: -------------------------------------------------------------------------------- 1 | .if ! imbed 2 | .gv e NG_SRC src_dir 3 | .dv imbed &{src_dir}/include 4 | .fi 5 | 6 | .if hfm 7 | .im &{imbed}/hfmstart.im 8 | .ei 9 | .if pfm 10 | .im &{imbed}/pfmstart.im 11 | .ei 12 | .if rfm 13 | .im &{imbed}/rfmstart.im 14 | .ei 15 | .if tfm 16 | .im &{imbed}/tfmstart.im 17 | .fi 18 | .fi 19 | .fi 20 | .fi 21 | 22 | -------------------------------------------------------------------------------- /contrib/libbio/bbuffered.c: -------------------------------------------------------------------------------- 1 | #include "lib9.h" 2 | #include 3 | 4 | int 5 | Bbuffered(Biobuf *bp) 6 | { 7 | switch(bp->state) { 8 | case Bracteof: 9 | case Bractive: 10 | return -bp->icount; 11 | 12 | case Bwactive: 13 | return bp->bsize + bp->ocount; 14 | 15 | case Binactive: 16 | return 0; 17 | } 18 | fprint(2, "Bbuffered: unknown state %d\n", bp->state); 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /contrib/libbio/lib9.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #define OREAD O_RDONLY 10 | #define OWRITE O_WRONLY 11 | 12 | #define OCEXEC 0 13 | #define ORCLOSE 0 14 | #define OTRUNC 0 15 | 16 | 17 | #define nil ((void*)0) 18 | 19 | typedef long long vlong; 20 | typedef unsigned long long uvlong; 21 | -------------------------------------------------------------------------------- /contrib/libbio/bputrune.c: -------------------------------------------------------------------------------- 1 | #include "lib9.h" 2 | #include 3 | #include 4 | 5 | int 6 | Bputrune(Biobuf *bp, long c) 7 | { 8 | Rune rune; 9 | char str[4]; 10 | int n; 11 | 12 | rune = c; 13 | if(rune < Runeself) { 14 | Bputc(bp, rune); 15 | return 1; 16 | } 17 | n = runetochar(str, &rune); 18 | if(n == 0) 19 | return Bbad; 20 | if(Bwrite(bp, str, n) != n) 21 | return Beof; 22 | return n; 23 | } 24 | -------------------------------------------------------------------------------- /contrib/libregexp/test2.c: -------------------------------------------------------------------------------- 1 | #include "lib9.h" 2 | #include 3 | 4 | 5 | main(int ac, char **av) 6 | { 7 | Resub rs[10]; 8 | Reprog *p; 9 | char *s; 10 | int i; 11 | 12 | p = regcomp("[^a-z]"); 13 | s = "\n"; 14 | if(regexec(p, s, rs, 10)) 15 | print("%s %lux %lux %lux\n", s, s, rs[0].sp, rs[0].ep); 16 | s = "0"; 17 | if(regexec(p, s, rs, 10)) 18 | print("%s %lux %lux %lux\n", s, s, rs[0].sp, rs[0].ep); 19 | exit(0); 20 | } 21 | -------------------------------------------------------------------------------- /contrib/libbio/boffset.c: -------------------------------------------------------------------------------- 1 | #include "lib9.h" 2 | #include 3 | 4 | off_t 5 | Boffset(Biobuf *bp) 6 | { 7 | off_t n; 8 | 9 | switch(bp->state) { 10 | default: 11 | fprint(2, "Boffset: unknown state %d\n", bp->state); 12 | n = Beof; 13 | break; 14 | 15 | case Bracteof: 16 | case Bractive: 17 | n = bp->offset + bp->icount; 18 | break; 19 | 20 | case Bwactive: 21 | n = bp->offset + (bp->bsize + bp->ocount); 22 | break; 23 | } 24 | return n; 25 | } 26 | -------------------------------------------------------------------------------- /contrib/gre/io.h: -------------------------------------------------------------------------------- 1 | #ifndef EPR 2 | 3 | #ifdef USE_STDIO 4 | #define PR printf( 5 | #define EPR fprintf(stderr, 6 | #define SPR sprintf( 7 | #define WR(b,n) fwrite(b, 1, n, stdout) 8 | #define FLUSH fflush(stdout) 9 | #else 10 | #include 11 | extern int fprint(int, char*, ...); 12 | extern int sprint(char*, char*, ...); 13 | 14 | #define PR fprint(1, 15 | #define EPR fprint(2, 16 | #define SPR sprint( 17 | #define WR(b,n) write(1, b, (long)(n)) 18 | #define FLUSH Fflush(1) 19 | #endif 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /contrib/kpv/src/lib/sfio/Stdio_b/ast54.sym: -------------------------------------------------------------------------------- 1 | _Sfextern data 2 | _sfdlen 3 | _sffilbuf 4 | _sfflsbuf 5 | _sfllen 6 | _sfmode 7 | _sfputd 8 | _sfputl 9 | _sfputm 10 | _sfputu 11 | _sftype 12 | _stdgets 13 | sfclose 14 | sfclrlock 15 | sfmutex 16 | sfnew 17 | sfopen 18 | sfpopen 19 | sfpurge 20 | sfputr 21 | sfread 22 | sfseek 23 | sfset 24 | sfsetbuf 25 | sfsprintf 26 | sfsync 27 | sfstderr data 28 | sfstdin data 29 | sfstdout data 30 | sftmp 31 | sfungetc 32 | sfvprintf 33 | sfvscanf 34 | sfvsprintf 35 | sfvsscanf 36 | sfwrite 37 | -------------------------------------------------------------------------------- /contrib/libbio/bgetd.c: -------------------------------------------------------------------------------- 1 | #include "lib9.h" 2 | #include 3 | 4 | struct bgetd 5 | { 6 | Biobuf* b; 7 | int eof; 8 | }; 9 | 10 | static int 11 | Bgetdf(void *vp) 12 | { 13 | int c; 14 | struct bgetd *bg = vp; 15 | 16 | c = Bgetc(bg->b); 17 | if(c == Beof) 18 | bg->eof = 1; 19 | return c; 20 | } 21 | 22 | int 23 | Bgetd(Biobuf *bp, double *dp) 24 | { 25 | double d; 26 | struct bgetd b; 27 | 28 | b.b = bp; 29 | b.eof = 0; 30 | d = fmtcharstod(Bgetdf, &b); 31 | if(b.eof) 32 | return -1; 33 | Bungetc(bp); 34 | *dp = d; 35 | return 1; 36 | } 37 | -------------------------------------------------------------------------------- /contrib/tail/mkfile: -------------------------------------------------------------------------------- 1 | # 2 | # Date: 05 Oct 2005 3 | 4 | INSTALL = tac 5 | ALL = tac 6 | 7 | GLMK_NOSOURCES = 1 8 | <$NG_SRC/panoptic.mk 9 | NUKE = $NUKE $ALL 10 | 11 | # we do NOT want to reference ast*.h files so trim the -I list to next to nothing 12 | IFLAGS = -I. 13 | 14 | # tail does not compile on linux 15 | tail:: forward.o reverse.o tail.o misc.o read.o 16 | $CC $IFLAGS $CFLAGS -o $target $prereq $lib_ref 17 | 18 | # tail with the -r option as default (no forward ability at all) so that it works on linux too 19 | tac:: reverse.o tac.o misc.o read.o 20 | $CC $IFLAGS $CFLAGS -o $target $prereq # $lib_ref 21 | -------------------------------------------------------------------------------- /contrib/mk/sys.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #define OREAD O_RDONLY 13 | #define OWRITE O_WRONLY 14 | #define ORDWR O_RDWR 15 | #define nil 0 16 | #define nelem(x) (sizeof(x)/sizeof((x)[0])) 17 | #define seek lseek 18 | #define remove unlink 19 | #define exits(x) exit(x && *(char*)x ? 1 : 0) 20 | #define USED(x) if(x){}else 21 | #define create(name, mode, perm) open(name, mode|O_CREAT, perm) 22 | #define ERRMAX 256 23 | -------------------------------------------------------------------------------- /contrib/libbio/bflush.c: -------------------------------------------------------------------------------- 1 | #include "lib9.h" 2 | #include 3 | 4 | int 5 | Bflush(Biobuf *bp) 6 | { 7 | int n, c; 8 | 9 | switch(bp->state) { 10 | case Bwactive: 11 | n = bp->bsize+bp->ocount; 12 | if(n == 0) 13 | return 0; 14 | c = write(bp->fid, bp->bbuf, n); 15 | if(n == c) { 16 | bp->offset += n; 17 | bp->ocount = -bp->bsize; 18 | return 0; 19 | } 20 | bp->state = Binactive; 21 | bp->ocount = 0; 22 | break; 23 | 24 | case Bracteof: 25 | bp->state = Bractive; 26 | 27 | case Bractive: 28 | bp->icount = 0; 29 | bp->gbuf = bp->ebuf; 30 | return 0; 31 | } 32 | return Beof; 33 | } 34 | -------------------------------------------------------------------------------- /contrib/README: -------------------------------------------------------------------------------- 1 | 2 | This directory contains software which was pulled as third party, 3 | publically available, source or was contributed by other members 4 | of AT&T Labs Research directly to the Ningaui project: 5 | 6 | fettle - Andrew Hume's machine room rack design software 7 | gre - A grep replacement 8 | kpv - Phong Vo, David Korn, Glen Fowler's sfio 9 | mk - Andrew Hume's Make replacement 10 | libbio - mk support 11 | libfmt - mk support 12 | libregexp - mk support 13 | libutf - mk support 14 | tail - Specialised tail utility 15 | xfm - E. Scott Daniels' document formatting utilities 16 | (more recent versions should be used and are available on github) 17 | -------------------------------------------------------------------------------- /contrib/libutf/plan9.h: -------------------------------------------------------------------------------- 1 | /* 2 | * compiler directive on Plan 9 3 | */ 4 | #ifndef USED 5 | #define USED(x) if(x);else 6 | #endif 7 | 8 | /* 9 | * easiest way to make sure these are defined 10 | */ 11 | #define uchar _utfuchar 12 | #define ushort _utfushort 13 | #define uint _utfuint 14 | #define ulong _utfulong 15 | typedef unsigned char uchar; 16 | typedef unsigned short ushort; 17 | typedef unsigned int uint; 18 | typedef unsigned long ulong; 19 | 20 | /* 21 | * nil cannot be ((void*)0) on ANSI C, 22 | * because it is used for function pointers 23 | */ 24 | #undef nil 25 | #define nil 0 26 | 27 | #undef nelem 28 | #define nelem(x) (sizeof (x)/sizeof (x)[0]) 29 | 30 | -------------------------------------------------------------------------------- /contrib/xfm/master.mk: -------------------------------------------------------------------------------- 1 | # Master file included by all mkfiles in subdirs to set up common crap 2 | 3 | # We modified this to fit the ningaui environment. If we suck in a fresh copy 4 | # of XFM we will need to change it. 5 | 6 | gflag = -g 7 | 8 | MKSHELL = `echo ${GLMK_SHELL:-ksh}` 9 | CC = `if ${GLMK_CC:-gcc} --help >/dev/null 2>&1; then echo ${GLMK_CC:-gcc}; else echo cc; fi ` 10 | IFLAGS = 11 | CFLAGS = $gflag 12 | LFLAGS = 13 | 14 | NUKE = *.o *.a 15 | 16 | # the & meta character does not match / and this IS important! 17 | &: &.o 18 | $CC $IFLAGS $CFLAGS -o $target $prereq $LFLAGS 19 | 20 | &.o: &.c 21 | $CC $IFLAGS $CFLAGS -c $stem.c 22 | 23 | all:V: $ALL 24 | 25 | nuke: 26 | rm -f $NUKE 27 | 28 | -------------------------------------------------------------------------------- /contrib/gre/egparen.c: -------------------------------------------------------------------------------- 1 | #include "re.h" 2 | #include "lre.h" 3 | #include "hdr.h" 4 | 5 | static int egparen(Expr *e); 6 | 7 | int 8 | re_paren(re_re *re) 9 | { 10 | return egparen(re->root); 11 | } 12 | 13 | static int 14 | egparen(Expr *e) 15 | { 16 | if(e == 0) 17 | return(0); 18 | switch(e->type) 19 | { 20 | case Null: 21 | case Literal: 22 | case Dot: 23 | case Carat: 24 | case Dollar: 25 | case Backref: 26 | case Compcharclass: 27 | case Charclass: 28 | break; 29 | case Cat: 30 | case Alternate: 31 | return(egparen(e->l)+egparen(e->r)); 32 | case Star: 33 | case Plus: 34 | case Quest: 35 | case EOP: 36 | return(egparen(e->l)); 37 | case Group: 38 | return(1+egparen(e->l)); 39 | } 40 | return(0); 41 | } 42 | -------------------------------------------------------------------------------- /contrib/mk/var.c: -------------------------------------------------------------------------------- 1 | #include "mk.h" 2 | 3 | void 4 | setvar(char *name, void *value) 5 | { 6 | symlook(name, S_VAR, value)->value = value; 7 | symlook(name, S_MAKEVAR, (void*)""); 8 | } 9 | 10 | static void 11 | print1(Symtab *s) 12 | { 13 | Word *w; 14 | 15 | Bprint(&bout, "\t%s=", s->name); 16 | for (w = (Word *) s->value; w; w = w->next) 17 | Bprint(&bout, "'%s'", w->s); 18 | Bprint(&bout, "\n"); 19 | } 20 | 21 | void 22 | dumpv(char *s) 23 | { 24 | Bprint(&bout, "%s:\n", s); 25 | symtraverse(S_VAR, print1); 26 | } 27 | 28 | char * 29 | shname(char *a) 30 | { 31 | Rune r; 32 | int n; 33 | 34 | while (*a) { 35 | n = chartorune(&r, a); 36 | if (!WORDCHR(r)) 37 | break; 38 | a += n; 39 | } 40 | return a; 41 | } 42 | -------------------------------------------------------------------------------- /contrib/libbio/bwrite.c: -------------------------------------------------------------------------------- 1 | #include "lib9.h" 2 | #include 3 | 4 | long 5 | Bwrite(Biobuf *bp, void *ap, long count) 6 | { 7 | long c; 8 | unsigned char *p; 9 | int i, n, oc; 10 | 11 | p = ap; 12 | c = count; 13 | oc = bp->ocount; 14 | 15 | while(c > 0) { 16 | n = -oc; 17 | if(n > c) 18 | n = c; 19 | if(n == 0) { 20 | if(bp->state != Bwactive) 21 | return Beof; 22 | i = write(bp->fid, bp->bbuf, bp->bsize); 23 | if(i != bp->bsize) { 24 | bp->state = Binactive; 25 | return Beof; 26 | } 27 | bp->offset += i; 28 | oc = -bp->bsize; 29 | continue; 30 | } 31 | memmove(bp->ebuf+oc, p, n); 32 | oc += n; 33 | c -= n; 34 | p += n; 35 | } 36 | bp->ocount = oc; 37 | return count-c; 38 | } 39 | -------------------------------------------------------------------------------- /contrib/libbio/bvprint.c: -------------------------------------------------------------------------------- 1 | #include "lib9.h" 2 | #include 3 | 4 | static int 5 | fmtBflush(Fmt *f) 6 | { 7 | Biobuf *bp; 8 | 9 | bp = f->farg; 10 | bp->ocount = (char*)f->to - (char*)f->stop; 11 | if(Bflush(bp) < 0) 12 | return 0; 13 | f->stop = bp->ebuf; 14 | f->to = (char*)f->stop + bp->ocount; 15 | f->start = f->to; 16 | return 1; 17 | } 18 | 19 | int 20 | Bvprint(Biobuf *bp, char *fmt, va_list arg) 21 | { 22 | int n; 23 | Fmt f; 24 | 25 | f.runes = 0; 26 | f.stop = bp->ebuf; 27 | f.start = (char*)f.stop + bp->ocount; 28 | f.to = f.start; 29 | f.flush = fmtBflush; 30 | f.farg = bp; 31 | f.nfmt = 0; 32 | n = fmtvprint(&f, fmt, arg); 33 | bp->ocount = (char*)f.to - (char*)f.stop; 34 | return n; 35 | } 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /contrib/kpv/src/lib/sfio/Stdio_b/stdio.def: -------------------------------------------------------------------------------- 1 | LIBRARY STDIO 2 | EXPORTS 3 | _cleanup 4 | _doprnt 5 | _doscan 6 | _filbuf 7 | _flsbuf 8 | clearerr 9 | fclose 10 | fdopen 11 | feof 12 | ferror 13 | fflush 14 | fgetc 15 | fgetpos 16 | fgets 17 | fileno 18 | flockfile 19 | fopen 20 | fprintf 21 | fpurge 22 | fputc 23 | fputs 24 | fread 25 | freopen 26 | fscanf 27 | fseek 28 | fsetpos 29 | ftell 30 | ftrylockfile 31 | funlockfile 32 | fwrite 33 | getc 34 | getchar 35 | gets 36 | getw 37 | pclose 38 | popen 39 | printf 40 | putc 41 | putchar 42 | puts 43 | putw 44 | rewind 45 | scanf 46 | setbuf 47 | setbuffer 48 | setlinebuf 49 | setvbuf 50 | snprintf 51 | sprintf 52 | sscanf 53 | tmpfile 54 | ungetc 55 | vfprintf 56 | vfscanf 57 | vprintf 58 | vscanf 59 | vsnprintf 60 | vsprintf 61 | vsscanf 62 | -------------------------------------------------------------------------------- /contrib/libutf/utfdef.h: -------------------------------------------------------------------------------- 1 | /* 2 | * compiler directive on Plan 9 3 | */ 4 | #ifndef USED 5 | #define USED(x) if(x);else 6 | #endif 7 | 8 | /* 9 | * easiest way to make sure these are defined 10 | */ 11 | #define uchar _fmtuchar 12 | #define ushort _fmtushort 13 | #define uint _fmtuint 14 | #define ulong _fmtulong 15 | #define vlong _fmtvlong 16 | #define uvlong _fmtuvlong 17 | typedef unsigned char uchar; 18 | typedef unsigned short ushort; 19 | typedef unsigned int uint; 20 | typedef unsigned long ulong; 21 | typedef unsigned long long uvlong; 22 | typedef long long vlong; 23 | 24 | /* 25 | * nil cannot be ((void*)0) on ANSI C, 26 | * because it is used for function pointers 27 | */ 28 | #undef nil 29 | #define nil 0 30 | 31 | #undef nelem 32 | #define nelem ((void*)0) 33 | 34 | -------------------------------------------------------------------------------- /contrib/libfmt/plan9.h: -------------------------------------------------------------------------------- 1 | /* 2 | * compiler directive on Plan 9 3 | */ 4 | #ifndef USED 5 | #define USED(x) if(x);else 6 | #endif 7 | 8 | /* 9 | * easiest way to make sure these are defined 10 | */ 11 | #define uchar _fmtuchar 12 | #define ushort _fmtushort 13 | #define uint _fmtuint 14 | #define ulong _fmtulong 15 | #define vlong _fmtvlong 16 | #define uvlong _fmtuvlong 17 | typedef unsigned char uchar; 18 | typedef unsigned short ushort; 19 | typedef unsigned int uint; 20 | typedef unsigned long ulong; 21 | typedef unsigned long long uvlong; 22 | typedef long long vlong; 23 | 24 | /* 25 | * nil cannot be ((void*)0) on ANSI C, 26 | * because it is used for function pointers 27 | */ 28 | #undef nil 29 | #define nil 0 30 | 31 | #undef nelem 32 | #define nelem(x) (sizeof (x)/sizeof (x)[0]) 33 | 34 | -------------------------------------------------------------------------------- /contrib/xfm/include/mkfile: -------------------------------------------------------------------------------- 1 | # include -- these are imbed files (.im) that are used to 2 | # support self contained documentation in ningaui/gecko code 3 | # 4 | 5 | # must be set in EVERY mkfile AND in master.mk -- erk. 6 | MKSHELL = `echo ${GLMK_SHELL:-ksh}` 7 | 8 | # these must be set before master is pulled in 9 | # 10 | ALL = 11 | INSTALL = 12 | LIB_INSTALL = hfmstart.im scd_start.im startup.im tfmstart.im pfmstart.im 13 | SCDSRC = 14 | 15 | gflag = 16 | 17 | < ../master.mk 18 | 19 | NUKE = $NUKE $ALL 20 | PKG_LIB= `echo ${PKG_LIB:-$NG_ROOT/lib}` 21 | 22 | # install in the source/include directory 23 | precompile:V: 24 | set -x 25 | for x in $LIB_INSTALL 26 | do 27 | cp $x $NG_SRC/include/ 28 | done 29 | 30 | install:V: 31 | for x in $LIB_INSTALL 32 | do 33 | cp $x $PKG_LIB/ 34 | done 35 | 36 | -------------------------------------------------------------------------------- /contrib/mk/job.c: -------------------------------------------------------------------------------- 1 | #include "mk.h" 2 | 3 | Job * 4 | newjob(Rule *r, Node *nlist, char *stem, char **match, Word *pre, Word *npre, Word *tar, Word *atar) 5 | { 6 | register Job *j; 7 | 8 | j = (Job *)Malloc(sizeof(Job)); 9 | j->r = r; 10 | j->n = nlist; 11 | j->stem = stem; 12 | j->match = match; 13 | j->p = pre; 14 | j->np = npre; 15 | j->t = tar; 16 | j->at = atar; 17 | j->nproc = -1; 18 | j->next = 0; 19 | return(j); 20 | } 21 | 22 | void 23 | dumpj(char *s, Job *j, int all) 24 | { 25 | Bprint(&bout, "%s\n", s); 26 | while(j){ 27 | Bprint(&bout, "job@%ld: r=%ld n=%ld stem='%s' nproc=%d\n", 28 | j, j->r, j->n, j->stem, j->nproc); 29 | Bprint(&bout, "\ttarget='%s' alltarget='%s' prereq='%s' nprereq='%s'\n", 30 | wtos(j->t, ' '), wtos(j->at, ' '), wtos(j->p, ' '), wtos(j->np, ' ')); 31 | j = all? j->next : 0; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /contrib/fettle/fettle.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/ruby 2 | 3 | require 'world' 4 | require 'parse' 5 | require 'check' 6 | require 'route' 7 | require 'vrml' 8 | 9 | t = Token.new 10 | t.next 11 | things = Hash.new 12 | defns = Hash.new 13 | 14 | parse(t, defns, things) 15 | if t.nerrors > 0 16 | puts "#{t.nerrors} parse errors; exiting" 17 | exit(1) 18 | end 19 | 20 | if !post_parse(defns, things) 21 | puts "semantic parse errors found; exiting" 22 | exit(1) 23 | end 24 | 25 | if !check_phys(defns, things) 26 | puts "failed physical consistency checks; exiting" 27 | exit(1) 28 | end 29 | 30 | if !check_wire(defns, things) 31 | puts "failed wiring consistency checks; exiting" 32 | exit(1) 33 | end 34 | 35 | cables = Cable.new(defns) 36 | wire_route(defns, things, cables) 37 | wire_summary(defns, things, cables) 38 | 39 | vrml_output(defns, things, cables) 40 | -------------------------------------------------------------------------------- /contrib/libbio/bgetrune.c: -------------------------------------------------------------------------------- 1 | #include "lib9.h" 2 | #include 3 | #include 4 | 5 | long 6 | Bgetrune(Biobuf *bp) 7 | { 8 | int c, i; 9 | Rune rune; 10 | char str[4]; 11 | 12 | c = Bgetc(bp); 13 | if(c < Runeself) { /* one char */ 14 | bp->runesize = 1; 15 | return c; 16 | } 17 | str[0] = c; 18 | 19 | for(i=1;;) { 20 | c = Bgetc(bp); 21 | if(c < 0) 22 | return c; 23 | str[i++] = c; 24 | 25 | if(fullrune(str, i)) { 26 | bp->runesize = chartorune(&rune, str); 27 | while(i > bp->runesize) { 28 | Bungetc(bp); 29 | i--; 30 | } 31 | return rune; 32 | } 33 | } 34 | } 35 | 36 | int 37 | Bungetrune(Biobuf *bp) 38 | { 39 | 40 | if(bp->state == Bracteof) 41 | bp->state = Bractive; 42 | if(bp->state != Bractive) 43 | return Beof; 44 | bp->icount -= bp->runesize; 45 | bp->runesize = 0; 46 | return 1; 47 | } 48 | -------------------------------------------------------------------------------- /contrib/kpv/src/lib/sfio/Sfio_dc/Makefile: -------------------------------------------------------------------------------- 1 | # makefile for discipline functions 2 | # 3 | # Written by Kiem-Phong Vo 4 | 5 | # Compiler and flags to use 6 | LIBTYPE= 7 | CXFLAGS= -D_USE_LARGEFILES -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 8 | CCMODE= -O 9 | CCFLAGS= -I. -I.. $(CCMODE) $(LIBTYPE) $(CXFLAGS) 10 | AR= ar 11 | CC= $(GLMK_CC) 12 | 13 | # sfdisc 14 | HDRS= sfdchdr.h sfdisc.h 15 | SRCS= sfdcdio.c sfdcdos.c sfdcfilter.c sfdclzw.c sfdcseekable.c sfdcslow.c \ 16 | sfdcsubstream.c sfdctee.c sfdcunion.c sfdcgzip.c 17 | OBJS= sfdcdio.o sfdcdos.o sfdcfilter.o sfdclzw.o sfdcseekable.o sfdcslow.o \ 18 | sfdcsubstream.o sfdctee.o sfdcunion.o sfdcgzip.o 19 | 20 | .c.o: 21 | $(CC) -c $(CCFLAGS) $*.c 22 | 23 | must: $(OBJS) 24 | 25 | 3dupdate: 26 | cp Makefile $(HDRS) $(SRCS) ... 27 | 28 | clean: 29 | -(rm $(OBJS); exit 0) >/dev/null 2>&1 30 | -------------------------------------------------------------------------------- /contrib/libbio/bread.c: -------------------------------------------------------------------------------- 1 | #include "lib9.h" 2 | #include 3 | 4 | long 5 | Bread(Biobuf *bp, void *ap, long count) 6 | { 7 | long c; 8 | unsigned char *p; 9 | int i, n, ic; 10 | 11 | p = ap; 12 | c = count; 13 | ic = bp->icount; 14 | 15 | while(c > 0) { 16 | n = -ic; 17 | if(n > c) 18 | n = c; 19 | if(n == 0) { 20 | if(bp->state != Bractive) 21 | break; 22 | i = read(bp->fid, bp->bbuf, bp->bsize); 23 | if(i <= 0) { 24 | bp->state = Bracteof; 25 | if(i < 0) 26 | bp->state = Binactive; 27 | break; 28 | } 29 | bp->gbuf = bp->bbuf; 30 | bp->offset += i; 31 | if(i < bp->bsize) { 32 | memmove(bp->ebuf-i, bp->bbuf, i); 33 | bp->gbuf = bp->ebuf-i; 34 | } 35 | ic = -i; 36 | continue; 37 | } 38 | memmove(p, bp->ebuf+ic, n); 39 | c -= n; 40 | ic += n; 41 | p += n; 42 | } 43 | bp->icount = ic; 44 | return count-c; 45 | } 46 | -------------------------------------------------------------------------------- /contrib/libbio/bcat.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "bio.h" 3 | 4 | Biobuf bout; 5 | 6 | void 7 | bcat(Biobuf *b, char *name) 8 | { 9 | char buf[1000]; 10 | int n; 11 | 12 | while((n = Bread(b, buf, sizeof buf)) > 0){ 13 | if(Bwrite(&bout, buf, n) < 0) 14 | fprint(2, "writing during %s: %r\n", name); 15 | } 16 | if(n < 0) 17 | fprint(2, "reading %s: %r\n", name); 18 | } 19 | 20 | int 21 | main(int argc, char **argv) 22 | { 23 | int i; 24 | Biobuf b, *bp; 25 | Fmt fmt; 26 | 27 | Binit(&bout, 1, O_WRONLY); 28 | Bfmtinit(&fmt, &bout); 29 | fmtprint(&fmt, "hello, world\n"); 30 | Bfmtflush(&fmt); 31 | 32 | if(argc == 1){ 33 | Binit(&b, 0, O_RDONLY); 34 | bcat(&b, ""); 35 | }else{ 36 | for(i=1; i 15 | #include 16 | #include "plan9.h" 17 | #include "utf.h" 18 | 19 | long 20 | runestrlen(Rune *s) 21 | { 22 | 23 | return runestrchr(s, 0) - s; 24 | } 25 | -------------------------------------------------------------------------------- /contrib/libfmt/fmtlock.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include "plan9.h" 16 | #include "fmt.h" 17 | #include "fmtdef.h" 18 | 19 | void 20 | __fmtlock(void) 21 | { 22 | } 23 | 24 | void 25 | __fmtunlock(void) 26 | { 27 | } 28 | -------------------------------------------------------------------------------- /contrib/mk/match.c: -------------------------------------------------------------------------------- 1 | #include "mk.h" 2 | 3 | int 4 | match(char *name, char *template, char *stem, Shell *sh) 5 | { 6 | Rune r; 7 | int n; 8 | 9 | while(*name && *template){ 10 | n = chartorune(&r, template); 11 | if (PERCENT(r)) 12 | break; 13 | while (n--) 14 | if(*name++ != *template++) 15 | return 0; 16 | } 17 | if(!PERCENT(*template)) 18 | return 0; 19 | n = strlen(name)-strlen(template+1); 20 | if (n < 0) 21 | return 0; 22 | if (strcmp(template+1, name+n)) 23 | return 0; 24 | strncpy(stem, name, n); 25 | stem[n] = 0; 26 | if(*template == '&') 27 | return !sh->charin(stem, "./"); 28 | return 1; 29 | } 30 | 31 | void 32 | subst(char *stem, char *template, char *dest) 33 | { 34 | Rune r; 35 | char *s; 36 | int n; 37 | 38 | while(*template){ 39 | n = chartorune(&r, template); 40 | if (PERCENT(r)) { 41 | template += n; 42 | for (s = stem; *s; s++) 43 | *dest++ = *s; 44 | } else 45 | while (n--) 46 | *dest++ = *template++; 47 | } 48 | *dest = 0; 49 | } 50 | -------------------------------------------------------------------------------- /contrib/libutf/runestrcat.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "utf.h" 18 | 19 | Rune* 20 | runestrcat(Rune *s1, Rune *s2) 21 | { 22 | 23 | runestrcpy(runestrchr(s1, 0), s2); 24 | return s1; 25 | } 26 | -------------------------------------------------------------------------------- /contrib/libutf/runestrcpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "utf.h" 18 | 19 | Rune* 20 | runestrcpy(Rune *s1, Rune *s2) 21 | { 22 | Rune *os1; 23 | 24 | os1 = s1; 25 | while(*s1++ = *s2++) 26 | ; 27 | return os1; 28 | } 29 | -------------------------------------------------------------------------------- /contrib/mk/arc.c: -------------------------------------------------------------------------------- 1 | #include "mk.h" 2 | 3 | Arc * 4 | newarc(Node *n, Rule *r, char *stem, Resub *match) 5 | { 6 | Arc *a; 7 | 8 | a = (Arc *)Malloc(sizeof(Arc)); 9 | a->n = n; 10 | a->r = r; 11 | a->stem = strdup(stem); 12 | rcopy(a->match, match, NREGEXP); 13 | a->next = 0; 14 | a->flag = 0; 15 | a->prog = r->prog; 16 | return(a); 17 | } 18 | 19 | void 20 | dumpa(char *s, Arc *a) 21 | { 22 | char buf[1024]; 23 | 24 | Bprint(&bout, "%sArc@%p: n=%p r=%p flag=0x%x stem='%s'", 25 | s, a, a->n, a->r, a->flag, a->stem); 26 | if(a->prog) 27 | Bprint(&bout, " prog='%s'", a->prog); 28 | Bprint(&bout, "\n"); 29 | 30 | if(a->n){ 31 | snprint(buf, sizeof(buf), "%s ", (*s == ' ')? s:""); 32 | dumpn(buf, a->n); 33 | } 34 | } 35 | 36 | void 37 | nrep(void) 38 | { 39 | Symtab *sym; 40 | Word *w; 41 | 42 | sym = symlook("NREP", S_VAR, 0); 43 | if(sym){ 44 | w = (Word *) sym->value; 45 | if (w && w->s && *w->s) 46 | nreps = atoi(w->s); 47 | } 48 | if(nreps < 1) 49 | nreps = 1; 50 | if(DEBUG(D_GRAPH)) 51 | Bprint(&bout, "nreps = %d\n", nreps); 52 | } 53 | -------------------------------------------------------------------------------- /contrib/libfmt/errfmt.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include 17 | #include "plan9.h" 18 | #include "fmt.h" 19 | #include "fmtdef.h" 20 | 21 | int 22 | __errfmt(Fmt *f) 23 | { 24 | char *s; 25 | 26 | s = strerror(errno); 27 | return fmtstrcpy(f, s); 28 | } 29 | -------------------------------------------------------------------------------- /contrib/libfmt/fmtstr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "fmt.h" 18 | #include "fmtdef.h" 19 | 20 | char* 21 | fmtstrflush(Fmt *f) 22 | { 23 | if(f->start == nil) 24 | return nil; 25 | *(char*)f->to = '\0'; 26 | return (char*)f->start; 27 | } 28 | -------------------------------------------------------------------------------- /contrib/libfmt/runefmtstr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "fmt.h" 18 | #include "fmtdef.h" 19 | 20 | Rune* 21 | runefmtstrflush(Fmt *f) 22 | { 23 | if(f->start == nil) 24 | return nil; 25 | *(Rune*)f->to = '\0'; 26 | return f->start; 27 | } 28 | -------------------------------------------------------------------------------- /contrib/gre/egpos.c: -------------------------------------------------------------------------------- 1 | #include "re.h" 2 | #include "lre.h" 3 | #include "hdr.h" 4 | 5 | #ifndef POSSTEP 6 | #define POSSTEP (8*1024) 7 | #endif 8 | 9 | void 10 | eg_posinit(re_re *r) 11 | { 12 | if(r->nposalloc <= 0) 13 | r->nposalloc = POSSTEP; 14 | r->posbase = (int *)egmalloc(r->nposalloc*sizeof(int), "posbase"); 15 | if (!r->posbase) 16 | return; 17 | r->posnext = 0; 18 | } 19 | 20 | void 21 | eg_posset(re_re *r) 22 | { 23 | r->posreset = r->posnext; 24 | } 25 | 26 | eg_posalloc(re_re *r, int n) 27 | { 28 | register j; 29 | 30 | if(n < 0){ 31 | r->posnext = r->posreset; 32 | return(-1); 33 | } 34 | j = r->posnext; 35 | r->posnext += n; 36 | if(r->posnext >= r->nposalloc){ 37 | while((r->nposalloc < r->posnext) && (r->nposalloc < 256*1024)) 38 | r->nposalloc *= 2; 39 | if(r->nposalloc < r->posnext){ 40 | r->nposalloc = (r->posnext+POSSTEP-1)/POSSTEP; 41 | r->nposalloc *= POSSTEP; 42 | } 43 | r->posbase = (int *)egrealloc((char *)r->posbase, r->nposalloc*sizeof(int), "posbase"); 44 | if (!r->posbase) 45 | return(-1); 46 | } 47 | return(j); 48 | } 49 | -------------------------------------------------------------------------------- /contrib/libfmt/print.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include "plan9.h" 16 | #include "fmt.h" 17 | #include "fmtdef.h" 18 | 19 | int 20 | print(char *fmt, ...) 21 | { 22 | int n; 23 | va_list args; 24 | 25 | va_start(args, fmt); 26 | n = vfprint(1, fmt, args); 27 | va_end(args); 28 | return n; 29 | } 30 | -------------------------------------------------------------------------------- /contrib/libfmt/smprint.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include "plan9.h" 16 | #include "fmt.h" 17 | #include "fmtdef.h" 18 | 19 | char* 20 | smprint(char *fmt, ...) 21 | { 22 | va_list args; 23 | char *p; 24 | 25 | va_start(args, fmt); 26 | p = vsmprint(fmt, args); 27 | va_end(args); 28 | return p; 29 | } 30 | -------------------------------------------------------------------------------- /contrib/kpv/src/lib/sfio/NOTICE: -------------------------------------------------------------------------------- 1 | 2 | /******************************************************************************** 3 | * This product contains certain software code or other information * 4 | * ("AT&T Software") proprietary to AT&T Corp. ("AT&T"). * 5 | * The AT&T Software is provided to you "AS IS". YOU ASSUME TOTAL * 6 | * RESPONSIBILITY AND RISK FOR USE OF THE AT&T SOFTWARE. * 7 | * AT&T DOES NOT MAKE, AND EXPRESSLY DISCLAIMS, ANY EXPRESS OR * 8 | * IMPLIED WARRANTIES OF ANY KIND WHATSOEVER, INCLUDING, * 9 | * WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY OR * 10 | * FITNESS FOR A PARTICULAR PURPOSE, WARRANTIES OF TITLE OR * 11 | * NON-INFRINGEMENT OF ANY INTELLECTUAL PROPERTY RIGHTS, * 12 | * ANY WARRANTIES ARISING BY USAGE OF TRADE, COURSE OF DEALING OR * 13 | * COURSE OF PERFORMANCE, OR ANY WARRANTY THAT THE AT&T SOFTWARE * 14 | * IS "ERROR FREE" OR WILL MEET YOUR REQUIREMENTS. * 15 | * * 16 | * All rights reserved. AT&T is a registered trademark of AT&T Corp. * 17 | ********************************************************************************/ 18 | 19 | -------------------------------------------------------------------------------- /contrib/libfmt/fprint.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include "plan9.h" 16 | #include "fmt.h" 17 | #include "fmtdef.h" 18 | 19 | int 20 | fprint(int fd, char *fmt, ...) 21 | { 22 | int n; 23 | va_list args; 24 | 25 | va_start(args, fmt); 26 | n = vfprint(fd, fmt, args); 27 | va_end(args); 28 | return n; 29 | } 30 | -------------------------------------------------------------------------------- /contrib/libfmt/test3.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | void 6 | test(char *fmt, ...) 7 | { 8 | va_list arg; 9 | char fmtbuf[100], stdbuf[100]; 10 | 11 | va_start(arg, fmt); 12 | vsnprint(fmtbuf, sizeof fmtbuf, fmt, arg); 13 | va_end(arg); 14 | 15 | va_start(arg, fmt); 16 | vsnprint(stdbuf, sizeof stdbuf, fmt, arg); 17 | va_end(arg); 18 | 19 | if(strcmp(fmtbuf, stdbuf) != 0) 20 | print("fmt %s: fmt=\"%s\" std=\"%s\"\n", fmt, fmtbuf, stdbuf); 21 | 22 | print("fmt %s: %s\n", fmt, fmtbuf); 23 | } 24 | 25 | 26 | int 27 | main(int argc, char *argv[]) 28 | { 29 | test("%f", 3.14159); 30 | test("%f", 3.14159e10); 31 | test("%f", 3.14159e-10); 32 | 33 | test("%e", 3.14159); 34 | test("%e", 3.14159e10); 35 | test("%e", 3.14159e-10); 36 | 37 | test("%g", 3.14159); 38 | test("%g", 3.14159e10); 39 | test("%g", 3.14159e-10); 40 | 41 | test("%g", 2e25); 42 | test("%.18g", 2e25); 43 | 44 | test("%2.18g", 1.0); 45 | test("%2.18f", 1.0); 46 | test("%f", 3.1415927/4); 47 | 48 | test("%20.10d", 12345); 49 | test("%0.10d", 12345); 50 | 51 | return 0; 52 | } 53 | -------------------------------------------------------------------------------- /contrib/libregexp/NOTICE: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software is Rob Pike. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE ANY 11 | * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | 15 | This is a Unix port of the Plan 9 regular expression library. 16 | 17 | Please send comments about the packaging 18 | to Russ Cox . 19 | 20 | 21 | ---- 22 | 23 | This software is also made available under the Lucent Public License 24 | version 1.02; see http://plan9.bell-labs.com/plan9dist/license.html 25 | 26 | -------------------------------------------------------------------------------- /contrib/libutf/runestrrchr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "utf.h" 18 | 19 | Rune* 20 | runestrrchr(Rune *s, Rune c) 21 | { 22 | Rune *r; 23 | 24 | if(c == 0) 25 | return runestrchr(s, 0); 26 | r = 0; 27 | while(s = runestrchr(s, c)) 28 | r = s++; 29 | return r; 30 | } 31 | -------------------------------------------------------------------------------- /contrib/libfmt/NOTICE: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE ANY 11 | * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | 15 | This is a Unix port of the Plan 9 formatted I/O package. 16 | 17 | Please send comments about the packaging 18 | to Russ Cox . 19 | 20 | 21 | ---- 22 | 23 | This software is also made available under the Lucent Public License 24 | version 1.02; see http://plan9.bell-labs.com/plan9dist/license.html 25 | 26 | -------------------------------------------------------------------------------- /contrib/libfmt/seprint.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include "plan9.h" 16 | #include "fmt.h" 17 | #include "fmtdef.h" 18 | 19 | char* 20 | seprint(char *buf, char *e, char *fmt, ...) 21 | { 22 | char *p; 23 | va_list args; 24 | 25 | va_start(args, fmt); 26 | p = vseprint(buf, e, fmt, args); 27 | va_end(args); 28 | return p; 29 | } 30 | -------------------------------------------------------------------------------- /contrib/libutf/NOTICE: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE ANY 11 | * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | 15 | This is a Unix port of the Plan 9 formatted I/O package. 16 | 17 | Please send comments about the packaging 18 | to Russ Cox . 19 | 20 | 21 | ---- 22 | 23 | This software is also made available under the Lucent Public License 24 | version 1.02; see http://plan9.bell-labs.com/plan9dist/license.html 25 | 26 | -------------------------------------------------------------------------------- /contrib/libfmt/snprint.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include "plan9.h" 16 | #include "fmt.h" 17 | #include "fmtdef.h" 18 | 19 | int 20 | snprint(char *buf, int len, char *fmt, ...) 21 | { 22 | int n; 23 | va_list args; 24 | 25 | va_start(args, fmt); 26 | n = vsnprint(buf, len, fmt, args); 27 | va_end(args); 28 | return n; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /contrib/libfmt/runesmprint.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "fmt.h" 18 | #include "fmtdef.h" 19 | 20 | Rune* 21 | runesmprint(char *fmt, ...) 22 | { 23 | va_list args; 24 | Rune *p; 25 | 26 | va_start(args, fmt); 27 | p = runevsmprint(fmt, args); 28 | va_end(args); 29 | return p; 30 | } 31 | -------------------------------------------------------------------------------- /contrib/libutf/runestrdup.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include 17 | #include "plan9.h" 18 | #include "utf.h" 19 | 20 | Rune* 21 | runestrdup(Rune *s) 22 | { 23 | Rune *ns; 24 | 25 | ns = malloc(sizeof(Rune)*(runestrlen(s) + 1)); 26 | if(ns == 0) 27 | return 0; 28 | 29 | return runestrcpy(ns, s); 30 | } 31 | -------------------------------------------------------------------------------- /contrib/kpv/src/lib/sfio/Stdio_s/Makefile: -------------------------------------------------------------------------------- 1 | # makefile for stdio-source compatibility code 2 | # 3 | # Written by Kiem-Phong Vo 4 | 5 | # Compiler and flags to use 6 | LIBTYPE= 7 | AR= ar 8 | CC= $(GLMK_CC) 9 | CXFLAGS= -D_USE_LARGEFILES -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 10 | CCMODE= -O 11 | CCFLAGS= -I. -I.. $(CCMODE) $(LIBTYPE) $(CXFLAGS) 12 | 13 | HDRS= stdio.h 14 | SRCS= stdfgetc.c stdfprintf.c stdfputc.c stdfscanf.c stdgetc.c stdgets.c \ 15 | stdgetw.c stdfdopen.c stdprintf.c stdputc.c stdputw.c stdscanf.c \ 16 | stdsprintf.c stdsetvbuf.c stdfopen.c stdfreopen.c stdpopen.c stdtmpfile.c \ 17 | stdfwrite.c stdfread.c stdfflush.c 18 | 19 | OBJS= stdfgetc.o stdfprintf.o stdfputc.o stdfscanf.o stdgetc.o stdgets.o \ 20 | stdgetw.o stdfdopen.o stdprintf.o stdputc.o stdputw.o stdscanf.o \ 21 | stdsprintf.o stdsetvbuf.o stdfopen.o stdfreopen.o stdpopen.o stdtmpfile.o \ 22 | stdfwrite.o stdfread.o stdfflush.o 23 | 24 | .c.o: 25 | $(CC) -c $(CCFLAGS) $*.c 26 | 27 | must: $(OBJS) 28 | 29 | 3dupdate: 30 | cp Makefile $(HDRS) $(SRCS) ... 31 | 32 | clean: 33 | -(rm $(OBJS); exit 0) >/dev/null 2>&1 34 | -------------------------------------------------------------------------------- /contrib/gre/libc.h: -------------------------------------------------------------------------------- 1 | /* system calls */ 2 | extern unsigned alarm(); 3 | extern void nap(), pause(); 4 | extern char *sbrk(); 5 | extern void exit(), _exit(); 6 | extern long lseek(); 7 | extern void nice(); 8 | extern void profil(); 9 | extern unsigned long settod(); 10 | extern void sync(); 11 | extern long time(); 12 | 13 | /* libc et al */ 14 | extern long lcm(); 15 | extern double atof(), strtod(); 16 | extern long atol(); 17 | extern char *crypt(); 18 | extern char *ctime(); 19 | extern char *ecvt(), *fcvt(), *gcvt(); 20 | extern char *galloc(); 21 | extern char *getenv(); 22 | extern char *getlogin(); 23 | extern char *getpass(); 24 | extern char *getwd(), *getcwd(); 25 | extern char *malloc(), *realloc(), *calloc(); 26 | extern char *memcpy(), *memchr(), *memccpy(), *memset(), *memmove(); 27 | extern char *mktemp(); 28 | extern double frand(); 29 | extern char *setfields(); 30 | extern char *strcpy(), *strncpy(), *strcat(), *strncat(), *strchr(), *strrchr(); 31 | extern char *strpbrk(), *strtok(), *strdup(); 32 | extern int atoi(); 33 | extern char *tgetstr(), tgoto(); 34 | extern char *ttyname(), *cttyname(); 35 | 36 | #define NONEXIT 33 37 | -------------------------------------------------------------------------------- /contrib/libfmt/runesprint.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "fmt.h" 18 | #include "fmtdef.h" 19 | 20 | int 21 | runesprint(Rune *buf, char *fmt, ...) 22 | { 23 | int n; 24 | va_list args; 25 | 26 | va_start(args, fmt); 27 | n = runevsnprint(buf, 256, fmt, args); 28 | va_end(args); 29 | return n; 30 | } 31 | -------------------------------------------------------------------------------- /contrib/libutf/runestrecpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "utf.h" 18 | 19 | Rune* 20 | runestrecpy(Rune *s1, Rune *es1, Rune *s2) 21 | { 22 | if(s1 >= es1) 23 | return s1; 24 | 25 | while(*s1++ = *s2++){ 26 | if(s1 == es1){ 27 | *--s1 = '\0'; 28 | break; 29 | } 30 | } 31 | return s1; 32 | } 33 | -------------------------------------------------------------------------------- /contrib/libfmt/runeseprint.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "fmt.h" 18 | #include "fmtdef.h" 19 | 20 | Rune* 21 | runeseprint(Rune *buf, Rune *e, char *fmt, ...) 22 | { 23 | Rune *p; 24 | va_list args; 25 | 26 | va_start(args, fmt); 27 | p = runevseprint(buf, e, fmt, args); 28 | va_end(args); 29 | return p; 30 | } 31 | -------------------------------------------------------------------------------- /contrib/libutf/runestrncat.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "utf.h" 18 | 19 | Rune* 20 | runestrncat(Rune *s1, Rune *s2, long n) 21 | { 22 | Rune *os1; 23 | 24 | os1 = s1; 25 | s1 = runestrchr(s1, 0); 26 | while(*s1++ = *s2++) 27 | if(--n < 0) { 28 | s1[-1] = 0; 29 | break; 30 | } 31 | return os1; 32 | } 33 | -------------------------------------------------------------------------------- /contrib/libfmt/runesnprint.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "fmt.h" 18 | #include "fmtdef.h" 19 | 20 | int 21 | runesnprint(Rune *buf, int len, char *fmt, ...) 22 | { 23 | int n; 24 | va_list args; 25 | 26 | va_start(args, fmt); 27 | n = runevsnprint(buf, len, fmt, args); 28 | va_end(args); 29 | return n; 30 | } 31 | 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Unless otherwise specfied in a source module, the following license applies: 3 | 4 | /* 5 | * ======================================================================== v1.0/0a157 6 | * 7 | * This software is part of the AT&T Ningaui distribution 8 | * 9 | * Copyright (c) 2001-2009 by AT&T Intellectual Property. All rights reserved 10 | * AT&T and the AT&T logo are trademarks of AT&T Intellectual Property. 11 | * 12 | * Ningaui software is licensed under the Common Public 13 | * License, Version 1.0 by AT&T Intellectual Property. 14 | * 15 | * A copy of the License is available at 16 | * http://www.opensource.org/licenses/cpl1.0.txt 17 | * 18 | * Information and Software Systems Research 19 | * AT&T Labs 20 | * Florham Park, NJ 21 | * 22 | * 23 | * 24 | * ======================================================================== 0a229 25 | */ 26 | 27 | 28 | Any opensource code which was reused by Ningaui has been done so within the terms of 29 | the original license. These license(s) are included with the code where it was 30 | reused, and in any other form which is stipulated by the individual license. 31 | -------------------------------------------------------------------------------- /contrib/libutf/runestrchr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "utf.h" 18 | 19 | Rune* 20 | runestrchr(Rune *s, Rune c) 21 | { 22 | Rune c0 = c; 23 | Rune c1; 24 | 25 | if(c == 0) { 26 | while(*s++) 27 | ; 28 | return s-1; 29 | } 30 | 31 | while(c1 = *s++) 32 | if(c1 == c0) 33 | return s-1; 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /contrib/libbio/bgetc.c: -------------------------------------------------------------------------------- 1 | #include "lib9.h" 2 | #include 3 | 4 | int 5 | Bgetc(Biobuf *bp) 6 | { 7 | int i; 8 | 9 | loop: 10 | i = bp->icount; 11 | if(i != 0) { 12 | bp->icount = i+1; 13 | return bp->ebuf[i]; 14 | } 15 | if(bp->state != Bractive) { 16 | if(bp->state == Bracteof) 17 | bp->state = Bractive; 18 | return Beof; 19 | } 20 | /* 21 | * get next buffer, try to keep Bungetsize 22 | * characters pre-catenated from the previous 23 | * buffer to allow that many ungets. 24 | */ 25 | memmove(bp->bbuf-Bungetsize, bp->ebuf-Bungetsize, Bungetsize); 26 | i = read(bp->fid, bp->bbuf, bp->bsize); 27 | bp->gbuf = bp->bbuf; 28 | if(i <= 0) { 29 | bp->state = Bracteof; 30 | if(i < 0) 31 | bp->state = Binactive; 32 | return Beof; 33 | } 34 | if(i < bp->bsize) { 35 | memmove(bp->ebuf-i-Bungetsize, bp->bbuf-Bungetsize, i+Bungetsize); 36 | bp->gbuf = bp->ebuf-i; 37 | } 38 | bp->icount = -i; 39 | bp->offset += i; 40 | goto loop; 41 | } 42 | 43 | int 44 | Bungetc(Biobuf *bp) 45 | { 46 | 47 | if(bp->state == Bracteof) 48 | bp->state = Bractive; 49 | if(bp->state != Bractive) 50 | return Beof; 51 | bp->icount--; 52 | return 1; 53 | } 54 | -------------------------------------------------------------------------------- /contrib/libutf/runestrcmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "utf.h" 18 | 19 | int 20 | runestrcmp(Rune *s1, Rune *s2) 21 | { 22 | Rune c1, c2; 23 | 24 | for(;;) { 25 | c1 = *s1++; 26 | c2 = *s2++; 27 | if(c1 != c2) { 28 | if(c1 > c2) 29 | return 1; 30 | return -1; 31 | } 32 | if(c1 == 0) 33 | return 0; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /contrib/libutf/runestrncpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "utf.h" 18 | 19 | Rune* 20 | runestrncpy(Rune *s1, Rune *s2, long n) 21 | { 22 | int i; 23 | Rune *os1; 24 | 25 | os1 = s1; 26 | for(i = 0; i < n; i++) 27 | if((*s1++ = *s2++) == 0) { 28 | while(++i < n) 29 | *s1++ = 0; 30 | return os1; 31 | } 32 | return os1; 33 | } 34 | -------------------------------------------------------------------------------- /contrib/libutf/utflen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "utf.h" 18 | 19 | int 20 | utflen(char *s) 21 | { 22 | int c; 23 | long n; 24 | Rune rune; 25 | 26 | n = 0; 27 | for(;;) { 28 | c = *(uchar*)s; 29 | if(c < Runeself) { 30 | if(c == 0) 31 | return n; 32 | s++; 33 | } else 34 | s += chartorune(&rune, s); 35 | n++; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /contrib/xfm/lib/utconst.h: -------------------------------------------------------------------------------- 1 | /* 2 | * --------------------------------------------------------------------------- 3 | * This source code is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * If this code is modified and/or redistributed, please retain this 9 | * header, as well as any other 'flower-box' headers, that are 10 | * contained in the code in order to give credit where credit is due. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * Please use this URL to review the GNU General Public License: 18 | * http://www.gnu.org/licenses/gpl.txt 19 | * --------------------------------------------------------------------------- 20 | */ 21 | 22 | /* ---- DEPRECATED -- - indclude ut.h ---- */ 23 | 24 | 25 | 26 | #define TRUE 1 27 | #define FALSE 0 28 | #define EOS '\000' 29 | 30 | -------------------------------------------------------------------------------- /contrib/libbio/bseek.c: -------------------------------------------------------------------------------- 1 | #include "lib9.h" 2 | #include 3 | 4 | off_t 5 | Bseek(Biobuf *bp, off_t offset, int base) 6 | { 7 | vlong n, d; 8 | int bufsz; 9 | 10 | switch(bp->state) { 11 | default: 12 | fprint(2, "Bseek: unknown state %d\n", bp->state); 13 | return Beof; 14 | 15 | case Bracteof: 16 | bp->state = Bractive; 17 | bp->icount = 0; 18 | bp->gbuf = bp->ebuf; 19 | 20 | case Bractive: 21 | n = offset; 22 | if(base == 1) { 23 | n += Boffset(bp); 24 | base = 0; 25 | } 26 | 27 | /* 28 | * try to seek within buffer 29 | */ 30 | if(base == 0) { 31 | d = n - Boffset(bp); 32 | bufsz = bp->ebuf - bp->gbuf; 33 | if(-bufsz <= d && d <= bufsz){ 34 | bp->icount += d; 35 | if(d >= 0) { 36 | if(bp->icount <= 0) 37 | return n; 38 | } else { 39 | if(bp->ebuf - bp->gbuf >= -bp->icount) 40 | return n; 41 | } 42 | } 43 | } 44 | 45 | /* 46 | * reset the buffer 47 | */ 48 | n = lseek(bp->fid, n, base); 49 | bp->icount = 0; 50 | bp->gbuf = bp->ebuf; 51 | break; 52 | 53 | case Bwactive: 54 | Bflush(bp); 55 | n = lseek(bp->fid, offset, base); 56 | break; 57 | } 58 | bp->offset = n; 59 | return n; 60 | } 61 | -------------------------------------------------------------------------------- /contrib/libregexp/test.c: -------------------------------------------------------------------------------- 1 | #include "lib9.h" 2 | #include 3 | 4 | struct x 5 | { 6 | char *re; 7 | char *s; 8 | Reprog *p; 9 | }; 10 | 11 | struct x t[] = { 12 | { "^[^!@]+$", "/bin/upas/aliasmail '&'", 0 }, 13 | { "^local!(.*)$", "/mail/box/\\1/mbox", 0 }, 14 | { "^plan9!(.*)$", "\\1", 0 }, 15 | { "^helix!(.*)$", "\\1", 0 }, 16 | { "^([^!]+)@([^!@]+)$", "\\2!\\1", 0 }, 17 | { "^(uk\\.[^!]*)(!.*)$", "/bin/upas/uk2uk '\\1' '\\2'", 0 }, 18 | { "^[^!]*\\.[^!]*!.*$", "inet!&", 0 }, 19 | { "^\xE2\x98\xBA$", "smiley", 0 }, 20 | { "^(coma|research|pipe|pyxis|inet|hunny|gauss)!(.*)$", "/mail/lib/qmail '\\s' 'net!\\1' '\\2'", 0 }, 21 | { "^.*$", "/mail/lib/qmail '\\s' 'net!research' '&'", 0 }, 22 | { 0, 0, 0 }, 23 | }; 24 | 25 | main(int ac, char **av) 26 | { 27 | Resub rs[10]; 28 | char dst[128]; 29 | int n; 30 | struct x *tp; 31 | 32 | for(tp = t; tp->re; tp++) 33 | tp->p = regcomp(tp->re); 34 | 35 | 36 | for(tp = t; tp->re; tp++){ 37 | print("%s VIA %s", av[1], tp->re); 38 | memset(rs, 0, sizeof rs); 39 | if(regexec(tp->p, av[1], rs, 10)){ 40 | regsub(tp->s, dst, sizeof dst, rs, 10); 41 | print(" sub %s -> %s", tp->s, dst); 42 | } 43 | print("\n"); 44 | } 45 | exit(0); 46 | } 47 | -------------------------------------------------------------------------------- /contrib/libutf/runestrncmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "utf.h" 18 | 19 | int 20 | runestrncmp(Rune *s1, Rune *s2, long n) 21 | { 22 | Rune c1, c2; 23 | 24 | while(n > 0) { 25 | c1 = *s1++; 26 | c2 = *s2++; 27 | n--; 28 | if(c1 != c2) { 29 | if(c1 > c2) 30 | return 1; 31 | return -1; 32 | } 33 | if(c1 == 0) 34 | break; 35 | } 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /contrib/libfmt/vfprint.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include "plan9.h" 16 | #include "fmt.h" 17 | #include "fmtdef.h" 18 | 19 | int 20 | vfprint(int fd, char *fmt, va_list args) 21 | { 22 | Fmt f; 23 | char buf[256]; 24 | int n; 25 | 26 | fmtfdinit(&f, fd, buf, sizeof(buf)); 27 | VA_COPY(f.args,args); 28 | n = dofmt(&f, fmt); 29 | VA_END(f.args); 30 | if(n > 0 && __fmtFdFlush(&f) == 0) 31 | return -1; 32 | return n; 33 | } 34 | -------------------------------------------------------------------------------- /potoroo/tape/rdvol.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ======================================================================== v1.0/0a157 3 | * 4 | * This software is part of the AT&T Ningaui distribution 5 | * 6 | * Copyright (c) 2001-2009 by AT&T Intellectual Property. All rights reserved 7 | * AT&T and the AT&T logo are trademarks of AT&T Intellectual Property. 8 | * 9 | * Ningaui software is licensed under the Common Public 10 | * License, Version 1.0 by AT&T Intellectual Property. 11 | * 12 | * A copy of the License is available at 13 | * http://www.opensource.org/licenses/cpl1.0.txt 14 | * 15 | * Information and Software Systems Research 16 | * AT&T Labs 17 | * Florham Park, NJ 18 | * 19 | * Send questions, comments via email to ningaui_support@research.att.com. 20 | * 21 | * 22 | * ======================================================================== 0a229 23 | */ 24 | 25 | -------------------------------------------------------------------------------- /contrib/xfm/lib/ut_time.h: -------------------------------------------------------------------------------- 1 | /* 2 | * --------------------------------------------------------------------------- 3 | * This source code is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * If this code is modified and/or redistributed, please retain this 9 | * header, as well as any other 'flower-box' headers, that are 10 | * contained in the code in order to give credit where credit is due. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * Please use this URL to review the GNU General Public License: 18 | * http://www.gnu.org/licenses/gpl.txt 19 | * --------------------------------------------------------------------------- 20 | */ 21 | /* ---- DEPRECATED --- use ut.h --- */ 22 | 23 | 24 | 25 | 26 | #define TIME_EPOCH 1997 27 | #define SEC_DAY 86400 28 | #define SEC_YEAR 31536000 29 | #define SEC_HR 3600 30 | -------------------------------------------------------------------------------- /contrib/libutf/utfecpy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "utf.h" 18 | 19 | char* 20 | utfecpy(char *to, char *e, char *from) 21 | { 22 | char *end; 23 | 24 | if(to >= e) 25 | return to; 26 | end = memccpy(to, from, '\0', e - to); 27 | if(end == nil){ 28 | end = e-1; 29 | while(end>to && (*--end&0xC0)==0x80) 30 | ; 31 | *end = '\0'; 32 | }else{ 33 | end--; 34 | } 35 | return end; 36 | } 37 | -------------------------------------------------------------------------------- /contrib/libfmt/fmtfdflush.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "fmt.h" 18 | #include "fmtdef.h" 19 | 20 | /* 21 | * generic routine for flushing a formatting buffer 22 | * to a file descriptor 23 | */ 24 | int 25 | __fmtFdFlush(Fmt *f) 26 | { 27 | int n; 28 | 29 | n = (char*)f->to - (char*)f->start; 30 | if(n && write((int)f->farg, f->start, n) != n) 31 | return 0; 32 | f->to = f->start; 33 | return 1; 34 | } 35 | -------------------------------------------------------------------------------- /contrib/xfm/hfm/fmrconst.h: -------------------------------------------------------------------------------- 1 | /* 2 | * --------------------------------------------------------------------------- 3 | * This source code is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * If this code is modified and/or redistributed, please retain this 9 | * header, as well as any other 'flower-box' headers, that are 10 | * contained in the code in order to give credit where credit is due. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * Please use this URL to review the GNU General Public License: 18 | * http://www.gnu.org/licenses/gpl.txt 19 | * --------------------------------------------------------------------------- 20 | */ 21 | #define RF_PAR 0x01 /* rfm only flags */ 22 | #define RF_RUNNCHG 0x02 /* running item has changed */ 23 | #define RF_SBREAK 0x04 /* section break has occurred sinc flush */ 24 | -------------------------------------------------------------------------------- /contrib/gre/egcw.c: -------------------------------------------------------------------------------- 1 | #include "re.h" 2 | #include "lre.h" 3 | #include "hdr.h" 4 | 5 | static altlist(Expr*, unsigned char *); 6 | static word(Expr*, unsigned char*); 7 | static re_cw *pat; 8 | 9 | re_cw * 10 | re_recw(re_re *r, unsigned char *map) 11 | { 12 | unsigned char buf[20000]; 13 | register Expr *e, *root = r->root; 14 | 15 | if(root->type != EOP) 16 | return(0); 17 | if(root->l->type != Cat) 18 | return(0); 19 | if(root->l->l->type != Star) 20 | return(0); 21 | if(root->l->l->l->type != Dot) 22 | return(0); 23 | e = root->l->r; 24 | pat = re_cwinit(map); 25 | if(altlist(e, buf) == 0) 26 | return(0); 27 | re_cwcomp(pat); 28 | return(pat); 29 | } 30 | 31 | static 32 | altlist(Expr *e, unsigned char *buf) 33 | { 34 | if(e->type == Alternate) 35 | return(altlist(e->l, buf) && altlist(e->r, buf)); 36 | return(word(e, buf)); 37 | } 38 | 39 | static unsigned char *p; 40 | 41 | static 42 | word(Expr *e, unsigned char *buf) 43 | { 44 | if(buf) 45 | p = buf; 46 | if(e->type == Cat){ 47 | if(word(e->l, (unsigned char *)0) == 0) 48 | return(0); 49 | if(word(e->r, (unsigned char *)0) == 0) 50 | return(0); 51 | } else if(e->type == Literal) 52 | *p++ = e->lit; 53 | else 54 | return(0); 55 | if(buf) 56 | re_cwadd(pat, buf, p); 57 | return(1); 58 | } 59 | 60 | -------------------------------------------------------------------------------- /contrib/gre/mkfile: -------------------------------------------------------------------------------- 1 | # mkfile 27 Jun 2005 2 | 3 | INSTALL = gre 4 | ALL = gre 5 | 6 | GLMK_NOSOURCES = 1 7 | <$NG_SRC/panoptic.mk 8 | NUKE = $NUKE $ALL 9 | 10 | # we need to eliinate anything that panoptic puts on that might reference nglib etc. 11 | CFLAGS = $CFLAGS -DMEMMOVE -DUSE_STDIO 12 | IFLAGS = -I. 13 | LFLAGS = 14 | 15 | verify: 16 | printf -- " $CFLAGS" 17 | 18 | 19 | # contrib things must NOT reference ningaui lib things! 20 | #lib_needs = $libng 21 | #lib_depends = ${lib_needs:%=$NG_SRC/stlib/lib%.a} # full paths for the dependancy list 22 | #lib_ref = -L$NG_SRC/stlib ${lib_needs:%=-l%} -L $AST/lib -last # references for (g)cc command 23 | #lib_ref = -L$AST/lib -last # references for (g)cc command 24 | 25 | 26 | gre:: main.c dofgrep.o dogre.o fns.o buffer.o cw.o bm.o eg.o egcomp.o eglit.o egpos.o egstate.o egcw.o egbr.o egmatch.o egcanon.o 27 | $CC $IFLAGS $CFLAGS -o $target $prereq # $lib_ref $last_ref 28 | 29 | retest:: retest.c eg.o egcomp.o eglit.o egpos.o egstate.o egcanon.o egcw.o egbr.o egmatch.o re.c cw.o 30 | $CC $IFLAGS $CFLAGS -o $target $prereq $lib_ref $last_ref 31 | 32 | regress: 33 | rm -f buffer.o; nmake -K CMD_CCFLAGS="-DBUFSIZE=500" gre retest 34 | cd regress.d; make GRE=../gre RETEST=../retest 35 | rm -f buffer.o gre retest 36 | -------------------------------------------------------------------------------- /contrib/libutf/utfnlen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "utf.h" 18 | 19 | int 20 | utfnlen(char *s, long m) 21 | { 22 | int c; 23 | long n; 24 | Rune rune; 25 | char *es; 26 | 27 | es = s + m; 28 | for(n = 0; s < es; n++) { 29 | c = *(uchar*)s; 30 | if(c < Runeself){ 31 | if(c == '\0') 32 | break; 33 | s++; 34 | continue; 35 | } 36 | if(!fullrune(s, es-s)) 37 | break; 38 | s += chartorune(&rune, s); 39 | } 40 | return n; 41 | } 42 | -------------------------------------------------------------------------------- /contrib/libfmt/fmtrune.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "fmt.h" 18 | #include "fmtdef.h" 19 | 20 | int 21 | fmtrune(Fmt *f, int r) 22 | { 23 | Rune *rt; 24 | char *t; 25 | int n; 26 | 27 | if(f->runes){ 28 | rt = (Rune*)f->to; 29 | FMTRCHAR(f, rt, f->stop, r); 30 | f->to = rt; 31 | n = 1; 32 | }else{ 33 | t = (char*)f->to; 34 | FMTRUNE(f, t, f->stop, r); 35 | n = t - (char*)f->to; 36 | f->to = t; 37 | } 38 | f->nfmt += n; 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /contrib/libfmt/vseprint.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include "plan9.h" 16 | #include "fmt.h" 17 | #include "fmtdef.h" 18 | 19 | char* 20 | vseprint(char *buf, char *e, char *fmt, va_list args) 21 | { 22 | Fmt f; 23 | 24 | if(e <= buf) 25 | return nil; 26 | f.runes = 0; 27 | f.start = buf; 28 | f.to = buf; 29 | f.stop = e - 1; 30 | f.flush = 0; 31 | f.farg = nil; 32 | f.nfmt = 0; 33 | VA_COPY(f.args,args); 34 | dofmt(&f, fmt); 35 | VA_END(f.args); 36 | *(char*)f.to = '\0'; 37 | return (char*)f.to; 38 | } 39 | 40 | -------------------------------------------------------------------------------- /contrib/xfm/rfm/rfm_const.h: -------------------------------------------------------------------------------- 1 | /* 2 | * --------------------------------------------------------------------------- 3 | * This source code is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * If this code is modified and/or redistributed, please retain this 9 | * header, as well as any other 'flower-box' headers, that are 10 | * contained in the code in order to give credit where credit is due. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * Please use this URL to review the GNU General Public License: 18 | * http://www.gnu.org/licenses/gpl.txt 19 | * --------------------------------------------------------------------------- 20 | */ 21 | /* constants that are unique just to rfm */ 22 | 23 | #define RF_PAR 0x01 /* rfm only flags */ 24 | #define RF_RUNNCHG 0x02 /* running item has changed */ 25 | #define RF_SBREAK 0x04 /* section break has occurred sinc flush */ 26 | -------------------------------------------------------------------------------- /contrib/gre/getopt.c: -------------------------------------------------------------------------------- 1 | #include "re.h" 2 | #include "lre.h" 3 | #include "hdr.h" 4 | 5 | #define ERR(str, chr) if(opterr){fprint(2, "%s%s%c\n", argv[0], str, chr);} 6 | #define EOF -1 7 | #define NULL 0 8 | int opterr = 1; 9 | int optind = 1; 10 | int optopt; 11 | char *optarg; 12 | 13 | int 14 | getopt(int argc, char **argv, char *opts) 15 | { 16 | static int sp = 1; 17 | register c; 18 | register char *cp; 19 | 20 | if (sp == 1) 21 | if (optind >= argc || 22 | argv[optind][0] != '-' || argv[optind][1] == '\0') 23 | return EOF; 24 | else if (strcmp(argv[optind], "--") == NULL) { 25 | optind++; 26 | return EOF; 27 | } 28 | optopt = c = argv[optind][sp]; 29 | if (c == ':' || (cp=strchr(opts, c)) == NULL) { 30 | ERR (": illegal option -- ", c); 31 | if (argv[optind][++sp] == '\0') { 32 | optind++; 33 | sp = 1; 34 | } 35 | return '?'; 36 | } 37 | if (*++cp == ':') { 38 | if (argv[optind][sp+1] != '\0') 39 | optarg = &argv[optind++][sp+1]; 40 | else if (++optind >= argc) { 41 | ERR (": option requires an argument -- ", c); 42 | sp = 1; 43 | return '?'; 44 | } else 45 | optarg = argv[optind++]; 46 | sp = 1; 47 | } else { 48 | if (argv[optind][++sp] == '\0') { 49 | sp = 1; 50 | optind++; 51 | } 52 | optarg = NULL; 53 | } 54 | return c; 55 | } 56 | -------------------------------------------------------------------------------- /contrib/libfmt/vsnprint.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "fmt.h" 18 | #include "fmtdef.h" 19 | 20 | int 21 | vsnprint(char *buf, int len, char *fmt, va_list args) 22 | { 23 | Fmt f; 24 | 25 | if(len <= 0) 26 | return -1; 27 | f.runes = 0; 28 | f.start = buf; 29 | f.to = buf; 30 | f.stop = buf + len - 1; 31 | f.flush = 0; 32 | f.farg = nil; 33 | f.nfmt = 0; 34 | VA_COPY(f.args,args); 35 | dofmt(&f, fmt); 36 | VA_END(f.args); 37 | *(char*)f.to = '\0'; 38 | return (char*)f.to - buf; 39 | } 40 | -------------------------------------------------------------------------------- /contrib/libfmt/runevseprint.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "fmt.h" 18 | #include "fmtdef.h" 19 | 20 | Rune* 21 | runevseprint(Rune *buf, Rune *e, char *fmt, va_list args) 22 | { 23 | Fmt f; 24 | 25 | if(e <= buf) 26 | return nil; 27 | f.runes = 1; 28 | f.start = buf; 29 | f.to = buf; 30 | f.stop = e - 1; 31 | f.flush = nil; 32 | f.farg = nil; 33 | f.nfmt = 0; 34 | VA_COPY(f.args,args); 35 | dofmt(&f, fmt); 36 | VA_END(f.args); 37 | *(Rune*)f.to = '\0'; 38 | return (Rune*)f.to; 39 | } 40 | 41 | -------------------------------------------------------------------------------- /contrib/libfmt/runevsnprint.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "fmt.h" 18 | #include "fmtdef.h" 19 | 20 | int 21 | runevsnprint(Rune *buf, int len, char *fmt, va_list args) 22 | { 23 | Fmt f; 24 | 25 | if(len <= 0) 26 | return -1; 27 | f.runes = 1; 28 | f.start = buf; 29 | f.to = buf; 30 | f.stop = buf + len - 1; 31 | f.flush = nil; 32 | f.farg = nil; 33 | f.nfmt = 0; 34 | VA_COPY(f.args,args); 35 | dofmt(&f, fmt); 36 | VA_END(f.args); 37 | *(Rune*)f.to = '\0'; 38 | return (Rune*)f.to - buf; 39 | } 40 | -------------------------------------------------------------------------------- /potoroo/lib/ng_argv0.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ======================================================================== v1.0/0a157 3 | * 4 | * This software is part of the AT&T Ningaui distribution 5 | * 6 | * Copyright (c) 2001-2009 by AT&T Intellectual Property. All rights reserved 7 | * AT&T and the AT&T logo are trademarks of AT&T Intellectual Property. 8 | * 9 | * Ningaui software is licensed under the Common Public 10 | * License, Version 1.0 by AT&T Intellectual Property. 11 | * 12 | * A copy of the License is available at 13 | * http://www.opensource.org/licenses/cpl1.0.txt 14 | * 15 | * Information and Software Systems Research 16 | * AT&T Labs 17 | * Florham Park, NJ 18 | * 19 | * Send questions, comments via email to ningaui_support@research.att.com. 20 | * 21 | * 22 | * ======================================================================== 0a229 23 | */ 24 | 25 | #include 26 | #include "ningaui.h" 27 | 28 | /* added initialisation for mac */ 29 | char *argv0 = NULL; 30 | -------------------------------------------------------------------------------- /potoroo/lib/ng_verbose.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ======================================================================== v1.0/0a157 3 | * 4 | * This software is part of the AT&T Ningaui distribution 5 | * 6 | * Copyright (c) 2001-2009 by AT&T Intellectual Property. All rights reserved 7 | * AT&T and the AT&T logo are trademarks of AT&T Intellectual Property. 8 | * 9 | * Ningaui software is licensed under the Common Public 10 | * License, Version 1.0 by AT&T Intellectual Property. 11 | * 12 | * A copy of the License is available at 13 | * http://www.opensource.org/licenses/cpl1.0.txt 14 | * 15 | * Information and Software Systems Research 16 | * AT&T Labs 17 | * Florham Park, NJ 18 | * 19 | * Send questions, comments via email to ningaui_support@research.att.com. 20 | * 21 | * 22 | * ======================================================================== 0a229 23 | */ 24 | 25 | #include 26 | #include "ningaui.h" 27 | 28 | /* added initialisation for mac */ 29 | int verbose = 0; 30 | -------------------------------------------------------------------------------- /contrib/libfmt/nan64.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 64-bit IEEE not-a-number routines. 3 | * This is big/little-endian portable assuming that 4 | * the 64-bit doubles and 64-bit integers have the 5 | * same byte ordering. 6 | */ 7 | 8 | #include "plan9.h" 9 | #include "fmt.h" 10 | #include "fmtdef.h" 11 | 12 | #if defined (__APPLE__) || (__powerpc__) 13 | #define _NEEDLL 14 | #endif 15 | 16 | static uvlong uvnan = ((uvlong)0x7FF00000<<32)|0x00000001; 17 | static uvlong uvinf = ((uvlong)0x7FF00000<<32)|0x00000000; 18 | static uvlong uvneginf = ((uvlong)0xFFF00000<<32)|0x00000000; 19 | 20 | double 21 | __NaN(void) 22 | { 23 | uvlong *p; 24 | 25 | /* gcc complains about "return *(double*)&uvnan;" */ 26 | p = &uvnan; 27 | return *(double*)p; 28 | } 29 | 30 | int 31 | __isNaN(double d) 32 | { 33 | uvlong x; 34 | double *p; 35 | 36 | p = &d; 37 | x = *(uvlong*)p; 38 | return (ulong)(x>>32)==0x7FF00000 && !__isInf(d, 0); 39 | } 40 | 41 | double 42 | __Inf(int sign) 43 | { 44 | uvlong *p; 45 | 46 | if(sign < 0) 47 | p = &uvinf; 48 | else 49 | p = &uvneginf; 50 | return *(double*)p; 51 | } 52 | 53 | int 54 | __isInf(double d, int sign) 55 | { 56 | uvlong x; 57 | double *p; 58 | 59 | p = &d; 60 | x = *(uvlong*)p; 61 | if(sign == 0) 62 | return x==uvinf || x==uvneginf; 63 | else if(sign > 0) 64 | return x==uvinf; 65 | else 66 | return x==uvneginf; 67 | } 68 | -------------------------------------------------------------------------------- /contrib/libutf/utfutf.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "utf.h" 18 | 19 | 20 | /* 21 | * Return pointer to first occurrence of s2 in s1, 22 | * 0 if none 23 | */ 24 | char* 25 | utfutf(char *s1, char *s2) 26 | { 27 | char *p; 28 | long f, n1, n2; 29 | Rune r; 30 | 31 | n1 = chartorune(&r, s2); 32 | f = r; 33 | if(f <= Runesync) /* represents self */ 34 | return strstr(s1, s2); 35 | 36 | n2 = strlen(s2); 37 | for(p=s1; p=utfrune(p, f); p+=n1) 38 | if(strncmp(p, s2, n2) == 0) 39 | return p; 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /contrib/xfm/hfm/fmrglob.h: -------------------------------------------------------------------------------- 1 | /* 2 | * --------------------------------------------------------------------------- 3 | * This source code is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * If this code is modified and/or redistributed, please retain this 9 | * header, as well as any other 'flower-box' headers, that are 10 | * contained in the code in order to give credit where credit is due. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * Please use this URL to review the GNU General Public License: 18 | * http://www.gnu.org/licenses/gpl.txt 19 | * --------------------------------------------------------------------------- 20 | */ 21 | int rflags = RF_SBREAK; /* global rfm only flags */ 22 | int col_gutter = 0; /* current column gutter */ 23 | 24 | int *table_stack[100]; /* info about each table */ 25 | int ts_index = 0; 26 | 27 | int max_obuf = 256; /* allows user to someday control size of output buf */ 28 | -------------------------------------------------------------------------------- /contrib/gre/eglit.c: -------------------------------------------------------------------------------- 1 | #include "re.h" 2 | #include "lre.h" 3 | #include "hdr.h" 4 | 5 | static void traverse(Expr *); 6 | 7 | #define MAXLIT 256 /* is plenty big enough */ 8 | static unsigned char tmp[MAXLIT], best[MAXLIT]; 9 | static unsigned char *p; 10 | static int bestlen; 11 | #define START { p = tmp ; } 12 | #define ADD(c) { if(p >= &tmp[MAXLIT]) p--; *p++ = c; } 13 | #define FINISH { ADD(0) if((p-tmp) > bestlen) memmove((char *)best, (char *)tmp, bestlen = p-tmp); } 14 | 15 | re_lit(re_re *r, unsigned char **b, unsigned char **e) 16 | { 17 | bestlen = 0; 18 | START 19 | traverse(r->root); 20 | FINISH 21 | if(bestlen < 3) 22 | return(0); 23 | *b = best; 24 | *e = best+bestlen-1; 25 | return(1); 26 | } 27 | 28 | static void 29 | traverse(register Expr *e) 30 | { 31 | switch(e->type) 32 | { 33 | case Literal: 34 | ADD(e->lit) 35 | break; 36 | case Charclass: 37 | if((int)e->l == 1) 38 | ADD(*(char *)e->r) 39 | else { 40 | FINISH 41 | START 42 | } 43 | break; 44 | case Cat: 45 | traverse(e->l); 46 | traverse(e->r); 47 | break; 48 | case Plus: 49 | traverse(e->l); 50 | FINISH /* can't go on past a + */ 51 | START /* but we can start with one! */ 52 | traverse(e->l); 53 | break; 54 | case EOP: 55 | FINISH 56 | START 57 | traverse(e->l); 58 | break; 59 | default: 60 | FINISH 61 | START 62 | break; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /contrib/libutf/utfrune.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "utf.h" 18 | 19 | char* 20 | utfrune(char *s, long c) 21 | { 22 | long c1; 23 | Rune r; 24 | int n; 25 | 26 | if(c < Runesync) /* not part of utf sequence */ 27 | return strchr(s, c); 28 | 29 | for(;;) { 30 | c1 = *(uchar*)s; 31 | if(c1 < Runeself) { /* one byte rune */ 32 | if(c1 == 0) 33 | return 0; 34 | if(c1 == c) 35 | return s; 36 | s++; 37 | continue; 38 | } 39 | n = chartorune(&r, s); 40 | if(r == c) 41 | return s; 42 | s += n; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /contrib/libutf/runestrstr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "utf.h" 18 | 19 | /* 20 | * Return pointer to first occurrence of s2 in s1, 21 | * 0 if none 22 | */ 23 | Rune* 24 | runestrstr(Rune *s1, Rune *s2) 25 | { 26 | Rune *p, *pa, *pb; 27 | int c0, c; 28 | 29 | c0 = *s2; 30 | if(c0 == 0) 31 | return s1; 32 | s2++; 33 | for(p=runestrchr(s1, c0); p; p=runestrchr(p+1, c0)) { 34 | pa = p; 35 | for(pb=s2;; pb++) { 36 | c = *pb; 37 | if(c == 0) 38 | return p; 39 | if(c != *++pa) 40 | break; 41 | } 42 | } 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /contrib/libutf/utfrrune.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "utf.h" 18 | 19 | char* 20 | utfrrune(char *s, long c) 21 | { 22 | long c1; 23 | Rune r; 24 | char *s1; 25 | 26 | if(c < Runesync) /* not part of utf sequence */ 27 | return strrchr(s, c); 28 | 29 | s1 = 0; 30 | for(;;) { 31 | c1 = *(uchar*)s; 32 | if(c1 < Runeself) { /* one byte rune */ 33 | if(c1 == 0) 34 | return s1; 35 | if(c1 == c) 36 | s1 = s; 37 | s++; 38 | continue; 39 | } 40 | c1 = chartorune(&r, s); 41 | if(r == c) 42 | s1 = s; 43 | s += c1; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /contrib/libfmt/sprint.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "fmt.h" 18 | #include "fmtdef.h" 19 | 20 | int 21 | sprint(char *buf, char *fmt, ...) 22 | { 23 | int n; 24 | uint len; 25 | va_list args; 26 | 27 | len = 1<<30; /* big number, but sprint is deprecated anyway */ 28 | /* 29 | * on PowerPC, the stack is near the top of memory, so 30 | * we must be sure not to overflow a 32-bit pointer. 31 | */ 32 | if(buf+len < buf) 33 | len = -(uint)buf-1; 34 | 35 | va_start(args, fmt); 36 | n = vsnprint(buf, len, fmt, args); 37 | va_end(args); 38 | return n; 39 | } 40 | -------------------------------------------------------------------------------- /contrib/libregexp/regsub.c: -------------------------------------------------------------------------------- 1 | #include "lib9.h" 2 | #include "regexp9.h" 3 | 4 | /* substitute into one string using the matches from the last regexec() */ 5 | extern void 6 | regsub(char *sp, /* source string */ 7 | char *dp, /* destination string */ 8 | int dlen, 9 | Resub *mp, /* subexpression elements */ 10 | int ms) /* number of elements pointed to by mp */ 11 | { 12 | char *ssp, *ep; 13 | int i; 14 | 15 | ep = dp+dlen-1; 16 | while(*sp != '\0'){ 17 | if(*sp == '\\'){ 18 | switch(*++sp){ 19 | case '0': 20 | case '1': 21 | case '2': 22 | case '3': 23 | case '4': 24 | case '5': 25 | case '6': 26 | case '7': 27 | case '8': 28 | case '9': 29 | i = *sp-'0'; 30 | if(mp[i].s.sp != 0 && mp!=0 && ms>i) 31 | for(ssp = mp[i].s.sp; 32 | ssp < mp[i].e.ep; 33 | ssp++) 34 | if(dp < ep) 35 | *dp++ = *ssp; 36 | break; 37 | case '\\': 38 | if(dp < ep) 39 | *dp++ = '\\'; 40 | break; 41 | case '\0': 42 | sp--; 43 | break; 44 | default: 45 | if(dp < ep) 46 | *dp++ = *sp; 47 | break; 48 | } 49 | }else if(*sp == '&'){ 50 | if(mp[0].s.sp != 0 && mp!=0 && ms>0) 51 | if(mp[0].s.sp != 0) 52 | for(ssp = mp[0].s.sp; 53 | ssp < mp[0].e.ep; ssp++) 54 | if(dp < ep) 55 | *dp++ = *ssp; 56 | }else{ 57 | if(dp < ep) 58 | *dp++ = *sp; 59 | } 60 | sp++; 61 | } 62 | *dp = '\0'; 63 | } 64 | -------------------------------------------------------------------------------- /contrib/mk/shell.c: -------------------------------------------------------------------------------- 1 | #include "mk.h" 2 | 3 | static Shell *shells[] = { 4 | &shshell, 5 | &kshshell, 6 | &rcshell 7 | }; 8 | 9 | Shell *shellt; 10 | Word *shellcmd; 11 | 12 | typedef struct Shellstack Shellstack; 13 | struct Shellstack 14 | { 15 | Shell *t; 16 | Word *w; 17 | Shellstack *next; 18 | }; 19 | 20 | Shellstack *shellstack; 21 | 22 | char* 23 | setshell(Word *w) 24 | { 25 | int i; 26 | 27 | if(w->s == nil) 28 | return "shell name not found on line"; 29 | 30 | for(i=0; imatchname(w->s)) 32 | break; 33 | if(i == nelem(shells)) 34 | return "cannot determine shell type"; 35 | shellt = shells[i]; 36 | shellcmd = w; 37 | return nil; 38 | } 39 | 40 | void 41 | initshell(void) 42 | { 43 | shellcmd = stow(shells[0]->name); 44 | shellt = shells[0]; 45 | setvar("MKSHELL", shellcmd); 46 | } 47 | 48 | void 49 | pushshell(void) 50 | { 51 | Shellstack *s; 52 | 53 | /* save */ 54 | s = Malloc(sizeof *s); 55 | s->t = shellt; 56 | s->w = shellcmd; 57 | s->next = shellstack; 58 | shellstack = s; 59 | 60 | initshell(); /* reset to defaults */ 61 | } 62 | 63 | void 64 | popshell(void) 65 | { 66 | Shellstack *s; 67 | 68 | if(shellstack == nil){ 69 | fprint(2, "internal shellstack error\n"); 70 | Exit(); 71 | } 72 | 73 | s = shellstack; 74 | shellstack = s->next; 75 | shellt = s->t; 76 | shellcmd = s->w; 77 | setvar("MKSHELL", shellcmd); 78 | free(s); 79 | } 80 | -------------------------------------------------------------------------------- /contrib/libregexp/rregsub.c: -------------------------------------------------------------------------------- 1 | #include "lib9.h" 2 | #include "regexp9.h" 3 | 4 | /* substitute into one string using the matches from the last regexec() */ 5 | extern void 6 | rregsub(Rune *sp, /* source string */ 7 | Rune *dp, /* destination string */ 8 | int dlen, 9 | Resub *mp, /* subexpression elements */ 10 | int ms) /* number of elements pointed to by mp */ 11 | { 12 | Rune *ssp, *ep; 13 | int i; 14 | 15 | ep = dp+(dlen/sizeof(Rune))-1; 16 | while(*sp != '\0'){ 17 | if(*sp == '\\'){ 18 | switch(*++sp){ 19 | case '0': 20 | case '1': 21 | case '2': 22 | case '3': 23 | case '4': 24 | case '5': 25 | case '6': 26 | case '7': 27 | case '8': 28 | case '9': 29 | i = *sp-'0'; 30 | if(mp[i].s.rsp != 0 && mp!=0 && ms>i) 31 | for(ssp = mp[i].s.rsp; 32 | ssp < mp[i].e.rep; 33 | ssp++) 34 | if(dp < ep) 35 | *dp++ = *ssp; 36 | break; 37 | case '\\': 38 | if(dp < ep) 39 | *dp++ = '\\'; 40 | break; 41 | case '\0': 42 | sp--; 43 | break; 44 | default: 45 | if(dp < ep) 46 | *dp++ = *sp; 47 | break; 48 | } 49 | }else if(*sp == '&'){ 50 | if(mp[0].s.rsp != 0 && mp!=0 && ms>0) 51 | if(mp[0].s.rsp != 0) 52 | for(ssp = mp[0].s.rsp; 53 | ssp < mp[0].e.rep; ssp++) 54 | if(dp < ep) 55 | *dp++ = *ssp; 56 | }else{ 57 | if(dp < ep) 58 | *dp++ = *sp; 59 | } 60 | sp++; 61 | } 62 | *dp = '\0'; 63 | } 64 | -------------------------------------------------------------------------------- /contrib/xfm/lib/parse.h: -------------------------------------------------------------------------------- 1 | /* 2 | * --------------------------------------------------------------------------- 3 | * This source code is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * If this code is modified and/or redistributed, please retain this 9 | * header, as well as any other 'flower-box' headers, that are 10 | * contained in the code in order to give credit where credit is due. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * Please use this URL to review the GNU General Public License: 18 | * http://www.gnu.org/licenses/gpl.txt 19 | * --------------------------------------------------------------------------- 20 | */ 21 | /* constants needed by parse.c or functions that call vreplace */ 22 | 23 | #define VRF_CONSTBUF 0 /* dummy flag - return string in static buffer */ 24 | #define VRF_NEWBUF 0x01 /* create a new buffer */ 25 | #define VRF_NORECURSE 0x02 /* no recursive expansion */ 26 | 27 | #define F_PARMS 0x01 /* internal flag - expand parms first */ 28 | 29 | char *vreplace( Sym_tab *st, int namespace, char *sbuf, char vsym, char esym, char psym, int flags ); 30 | -------------------------------------------------------------------------------- /contrib/libfmt/fmtfd.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "fmt.h" 18 | #include "fmtdef.h" 19 | 20 | /* 21 | * public routine for final flush of a formatting buffer 22 | * to a file descriptor; returns total char count. 23 | */ 24 | int 25 | fmtfdflush(Fmt *f) 26 | { 27 | if(__fmtFdFlush(f) <= 0) 28 | return -1; 29 | return f->nfmt; 30 | } 31 | 32 | /* 33 | * initialize an output buffer for buffered printing 34 | */ 35 | int 36 | fmtfdinit(Fmt *f, int fd, char *buf, int size) 37 | { 38 | f->runes = 0; 39 | f->start = buf; 40 | f->to = buf; 41 | f->stop = buf + size; 42 | f->flush = __fmtFdFlush; 43 | f->farg = (void*)fd; 44 | f->nfmt = 0; 45 | return 0; 46 | } 47 | -------------------------------------------------------------------------------- /potoroo/lib/ng_dummy_man2.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ======================================================================== v1.0/0a157 3 | * 4 | * This software is part of the AT&T Ningaui distribution 5 | * 6 | * Copyright (c) 2001-2009 by AT&T Intellectual Property. All rights reserved 7 | * AT&T and the AT&T logo are trademarks of AT&T Intellectual Property. 8 | * 9 | * Ningaui software is licensed under the Common Public 10 | * License, Version 1.0 by AT&T Intellectual Property. 11 | * 12 | * A copy of the License is available at 13 | * http://www.opensource.org/licenses/cpl1.0.txt 14 | * 15 | * Information and Software Systems Research 16 | * AT&T Labs 17 | * Florham Park, NJ 18 | * 19 | * Send questions, comments via email to ningaui_support@research.att.com. 20 | * 21 | * 22 | * ======================================================================== 0a229 23 | */ 24 | 25 | 26 | /* dummy secondary man page for those that do not overtly include one */ 27 | /* necessary as ARGBEGIN will reference ng_show_man which wants this */ 28 | /* see also dummy_man.c as it defines the default primary man page */ 29 | char *_man2_text[] = { (char *) 0 }; 30 | -------------------------------------------------------------------------------- /contrib/gre/deansify.awk: -------------------------------------------------------------------------------- 1 | # De-ANSI-fy C programs 2 | 3 | # change void* to char * 4 | { gsub(/void *\*/, "char *") } 5 | 6 | # remove args from function declarations and typedefs 7 | # assume one per line (fitting on one line) 8 | 9 | /^[a-zA-Z0-9_]+.*\([^(]*\);.*/ { 10 | if($0 !~ /^print\(/ && $0 !~ /^fprint\(/ && $0 !~ /^if\(/) { 11 | sub(/\([^(]*\);/, "();") 12 | print 13 | next 14 | } 15 | } 16 | 17 | # change function definition headers to old-style 18 | # function definition headers on one line, ending with ')', 19 | # with the return type (if not omitted) on previous line 20 | # assume no parentheses inside arg list 21 | 22 | /^[a-zA-Z0-9_]+\(.*\)$/ { 23 | st = index($0, "(") + 1 24 | n = length($0) - st 25 | rawargs = substr($0, st, n) 26 | printf("%s(", substr($0, 1, st-2)) 27 | if( rawargs == "void" ) { 28 | printf(")\n"); 29 | next 30 | } 31 | nargs = split(rawargs, args, ", *") 32 | for(i = 1; i <= nargs; i++){ 33 | if(! match(args[i], /[a-zA-Z0-9_]+ *$/)){ 34 | if(! match(args[i], /[a-zA-Z0-9_]+\[.*\]$/)) 35 | id = "OOPS" 36 | else { 37 | id = substr(args[i], RSTART) 38 | sub(/\[.*\]/, "", id) 39 | } 40 | } else 41 | id = substr(args[i], RSTART, RLENGTH) 42 | printf("%s", id) 43 | if(i < nargs) printf(", ") 44 | } 45 | printf(")\n") 46 | for(i = 1; i <= nargs; i++) 47 | printf("\t%s;\n", args[i]) 48 | next 49 | } 50 | 51 | # remove pragmas 52 | 53 | /^#[ ]*pragma/ { next } 54 | 55 | # just print remaining lines 56 | { print } 57 | -------------------------------------------------------------------------------- /contrib/libfmt/fmtprint.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "fmt.h" 18 | #include "fmtdef.h" 19 | 20 | /* 21 | * format a string into the output buffer 22 | * designed for formats which themselves call fmt, 23 | * but ignore any width flags 24 | */ 25 | int 26 | fmtprint(Fmt *f, char *fmt, ...) 27 | { 28 | va_list va; 29 | int n; 30 | 31 | f->flags = 0; 32 | f->width = 0; 33 | f->prec = 0; 34 | VA_COPY(va, f->args); 35 | VA_END(f->args); 36 | va_start(f->args, fmt); 37 | n = dofmt(f, fmt); 38 | va_end(f->args); 39 | f->flags = 0; 40 | f->width = 0; 41 | f->prec = 0; 42 | VA_COPY(f->args,va); 43 | VA_END(va); 44 | if(n >= 0) 45 | return 0; 46 | return n; 47 | } 48 | 49 | -------------------------------------------------------------------------------- /potoroo/lib/ningaui.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ======================================================================== v1.0/0a157 3 | * 4 | * This software is part of the AT&T Ningaui distribution 5 | * 6 | * Copyright (c) 2001-2009 by AT&T Intellectual Property. All rights reserved 7 | * AT&T and the AT&T logo are trademarks of AT&T Intellectual Property. 8 | * 9 | * Ningaui software is licensed under the Common Public 10 | * License, Version 1.0 by AT&T Intellectual Property. 11 | * 12 | * A copy of the License is available at 13 | * http://www.opensource.org/licenses/cpl1.0.txt 14 | * 15 | * Information and Software Systems Research 16 | * AT&T Labs 17 | * Florham Park, NJ 18 | * 19 | * Send questions, comments via email to ningaui_support@research.att.com. 20 | * 21 | * 22 | * ======================================================================== 0a229 23 | */ 24 | 25 | #ifndef _ningaui_h 26 | #define _ningaui_h 1 27 | 28 | #include 29 | #include 30 | 31 | #ifndef SKIP_AST_COMMON 32 | #include 33 | #endif 34 | #include "ng_basic.h" 35 | #include "ng_config.h" 36 | #include "ng_lib.h" 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /contrib/xfm/mkfile: -------------------------------------------------------------------------------- 1 | # 2 | # This mkfile is a wrapper that allows us to leave the stuff that 3 | # XFM provides alone. 4 | 5 | ## must be set in EVERY mkfile AND in master.mk -- erk. 6 | MKSHELL = `echo ${GLMK_SHELL:-ksh}` 7 | 8 | # these must be set before master is pulled in 9 | # 10 | ALL = 11 | INSTALL = 12 | SCDSRC = 13 | LIB_INSTALL = 14 | CLASS_INSTALL = 15 | ROOT_INSTALL = 16 | EXPORT = mkfile 17 | 18 | gflag = -g 19 | 20 | IFLAGS = -I. -I ../lib -I ../rfm 21 | 22 | PKG_ROOT = `echo ${PKG_ROOT:-$NG_ROOT}` 23 | PKG_LIB = $PKG_ROOT/lib 24 | PKG_BIN = $PKG_ROOT/bin 25 | 26 | # build and then install in the source .bin directory for other compiles to use 27 | precompile:V: allxfm 28 | set -x 29 | (cd include; mk precompile) 30 | cp rfm/rfm $NG_SRC/.bin/rfm 31 | cp hfm/hfm $NG_SRC/.bin/hfm 32 | cp pfm/pfm $NG_SRC/.bin/pfm 33 | cp tfm/tfm $NG_SRC/.bin/tfm 34 | 35 | install:V: allxfm 36 | (cd include; mk install) 37 | cp rfm/rfm $PKG_ROOT/bin/rfm 38 | cp hfm/hfm $PKG_ROOT/bin/hfm 39 | cp pfm/pfm $PKG_ROOT/bin/pfm 40 | cp tfm/tfm $PKG_ROOT/bin/tfm 41 | ls -al $PKG_ROOT/bin/*fm 42 | 43 | 44 | nuke:V: 45 | ( cd afileio; mk nuke ) 46 | ( cd lib; mk nuke ) 47 | ( cd rfm; mk nuke ) 48 | ( cd hfm; mk nuke ) 49 | ( cd pfm; mk nuke ) 50 | ( cd tfm; mk nuke ) 51 | 52 | allxfm:V: 53 | echo "afileio" 54 | ( cd afileio; mk ) 55 | echo "lib" 56 | ( cd lib; mk ) 57 | echo "rfm" 58 | ( cd rfm; mk ) 59 | echo "hfm" 60 | ( cd hfm; mk ) 61 | echo "pfm" 62 | ( cd pfm; mk ) 63 | echo "tfm" 64 | ( cd tfm; mk ) 65 | 66 | -------------------------------------------------------------------------------- /contrib/libfmt/fmtvprint.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "fmt.h" 18 | #include "fmtdef.h" 19 | 20 | 21 | /* 22 | * format a string into the output buffer 23 | * designed for formats which themselves call fmt, 24 | * but ignore any width flags 25 | */ 26 | int 27 | fmtvprint(Fmt *f, char *fmt, va_list args) 28 | { 29 | va_list va; 30 | int n; 31 | 32 | f->flags = 0; 33 | f->width = 0; 34 | f->prec = 0; 35 | VA_COPY(va,f->args); 36 | VA_END(f->args); 37 | VA_COPY(f->args,args); 38 | n = dofmt(f, fmt); 39 | f->flags = 0; 40 | f->width = 0; 41 | f->prec = 0; 42 | VA_END(f->args); 43 | VA_COPY(f->args,va); 44 | VA_END(va); 45 | if(n >= 0) 46 | return 0; 47 | return n; 48 | } 49 | 50 | -------------------------------------------------------------------------------- /contrib/tail/README: -------------------------------------------------------------------------------- 1 | 5 October 2005 2 | 3 | We have taken the tail command from FreeBSD and ripped out all 4 | of the forward function to implement our version of toc. It only 5 | accepts -[n]n [file] as parms. 6 | 7 | The reason we must do this is that forward.c depends on BSD kernel 8 | events and those dont exist under Linux, or Sun (And Ive not even 9 | tried SGI). 10 | 11 | Its never easy. 12 | 13 | Then we get to solaris which seems to have no support for err() warn() 14 | family of functions. So, Ive implemented a small set of dummies 15 | that indicate an error and abort as is needed and let the user know 16 | that something bad happened, but because the system does not support 17 | the functions they will not know exactly what went wrong. 18 | 19 | 20 | 12/30/2005 21 | Seems that Irix has the same issues with err/warn funcitons. Maybe its 22 | just that they are old. Who knows, but we cope. 23 | 24 | ----------------- original plan; aborted because Linux sucks ------------- 25 | This is tail from the FreeBSD src tools. It is being used 26 | nearly unchanged and is included because the tail with Linux 27 | does not support the -r option that several of our tools 28 | require. 29 | 30 | The tool is built with mk, but the original make file, 31 | and other source files from */usr.bin/tail have been kept 32 | here for reference should we need it. 33 | 34 | Small modifications needed to make the tool compile under 35 | O/Ss other than FreeBSD: 36 | 1) The __FBSDID macro must be ifdeffed out if not 37 | compiling on FreeBSD 38 | 39 | -------------------------------------------------------------------------------- /potoroo/pinkpages/cartulary.static: -------------------------------------------------------------------------------- 1 | 2 | # ======================================================================== v1.0/0a157 3 | # 4 | # This software is part of the AT&T Ningaui distribution 5 | # 6 | # Copyright (c) 2001-2009 by AT&T Intellectual Property. All rights reserved 7 | # AT&T and the AT&T logo are trademarks of AT&T Intellectual Property. 8 | # 9 | # Ningaui software is licensed under the Common Public 10 | # License, Version 1.0 by AT&T Intellectual Property. 11 | # 12 | # A copy of the License is available at 13 | # http://www.opensource.org/licenses/cpl1.0.txt 14 | # 15 | # Information and Software Systems Research 16 | # AT&T Labs 17 | # Florham Park, NJ 18 | # 19 | # Send questions, comments via email to ningaui_support@research.att.com. 20 | # 21 | # 22 | # ======================================================================== 0a229 23 | 24 | 25 | # ------------- static values from cartulary.static ------------- 26 | export LANG="C" 27 | export PRI_ALERT="1" # ng_log message priority constants 28 | export PRI_CRIT="2" 29 | export PRI_CRITICAL="2" 30 | export PRI_ERROR="3" 31 | export PRI_INFO="6" 32 | export PRI_NOTICE="5" 33 | export PRI_WARN="4" 34 | # --------------------------------------------------------------- 35 | -------------------------------------------------------------------------------- /contrib/gre/re.c: -------------------------------------------------------------------------------- 1 | #include "re.h" 2 | #include "lre.h" 3 | #include "hdr.h" 4 | 5 | re_re * 6 | re_recomp(char *b, char *e, unsigned char *map) 7 | { 8 | return(egprep(greparse, (unsigned char *)b, (unsigned char *)e, map, 1)); 9 | } 10 | 11 | re_reexec(re_re *pat, char *b, char *e, char *match[10][2]) 12 | { 13 | unsigned char *mb[10], *me[10], **rb, **re; 14 | int n, i; 15 | 16 | if(match) 17 | rb = mb, re = me; 18 | else 19 | rb = re = 0; 20 | n = eg_match(pat, (unsigned char *)b, (unsigned char *)e, rb, re); 21 | if(match) 22 | for(i = 0; i < 10; i++){ 23 | match[i][0] = (char *)mb[i]; 24 | match[i][1] = (char *)me[i]; 25 | } 26 | return(n); 27 | } 28 | 29 | static void 30 | freeexpr(register Expr *e) 31 | { 32 | switch(e->type) 33 | { 34 | case Literal: 35 | case Dot: 36 | case Carat: 37 | case Dollar: 38 | if(e->follow) 39 | free((char *)e->follow); 40 | break; 41 | case Compcharclass: 42 | case Charclass: 43 | free((char *)e->r); 44 | break; 45 | case Cat: 46 | case Alternate: 47 | freeexpr(e->l); 48 | freeexpr(e->r); 49 | break; 50 | case Star: 51 | case Plus: 52 | case Quest: 53 | case Group: 54 | case EOP: 55 | freeexpr(e->l); 56 | break; 57 | case Backref: 58 | default: 59 | break; 60 | } 61 | } 62 | 63 | void 64 | re_refree(re_re *re) 65 | { 66 | if(re == 0) 67 | return; 68 | if(re->posbase) 69 | free((char *)re->posbase); 70 | if(re->root) 71 | freeexpr(re->root); 72 | if(re->ptr) 73 | free((char *)re->ptr); 74 | if(re->states) 75 | free((char *)re->states); 76 | /* leave br alone for now; it is hard to get right */ 77 | free((char *)re); 78 | } 79 | -------------------------------------------------------------------------------- /contrib/xfm/tfm/fmtable.c: -------------------------------------------------------------------------------- 1 | /* 2 | * --------------------------------------------------------------------------- 3 | * This source code is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * If this code is modified and/or redistributed, please retain this 9 | * header, as well as any other 'flower-box' headers, that are 10 | * contained in the code in order to give credit where credit is due. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * Please use this URL to review the GNU General Public License: 18 | * http://www.gnu.org/licenses/gpl.txt 19 | * --------------------------------------------------------------------------- 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #include "../lib/symtab.h" /* our utilities/tools */ 31 | #include "../afileio/afidefs.h" 32 | 33 | 34 | #include "fmconst.h" /* constant definitons */ 35 | #include "rfm_const.h" 36 | 37 | 38 | #include "fmcmds.h" 39 | #include "fmstruct.h" /* structure definitions */ 40 | #include "fmproto.h" 41 | 42 | /* 43 | tables are not supported in tfm at the moment 44 | */ 45 | -------------------------------------------------------------------------------- /potoroo/lib/ng_dummy_man.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ======================================================================== v1.0/0a157 3 | * 4 | * This software is part of the AT&T Ningaui distribution 5 | * 6 | * Copyright (c) 2001-2009 by AT&T Intellectual Property. All rights reserved 7 | * AT&T and the AT&T logo are trademarks of AT&T Intellectual Property. 8 | * 9 | * Ningaui software is licensed under the Common Public 10 | * License, Version 1.0 by AT&T Intellectual Property. 11 | * 12 | * A copy of the License is available at 13 | * http://www.opensource.org/licenses/cpl1.0.txt 14 | * 15 | * Information and Software Systems Research 16 | * AT&T Labs 17 | * Florham Park, NJ 18 | * 19 | * Send questions, comments via email to ningaui_support@research.att.com. 20 | * 21 | * 22 | * ======================================================================== 0a229 23 | */ 24 | 25 | /* dummy man page for those that do not overtly include one */ 26 | /* necessary as ARGBEGIN will reference ng_show_man which wants this */ 27 | char *_man_text[] = { 28 | "Error!", 29 | "Sorry, but no manual page for this programme was created or included", 30 | "during compilation. Try the HTML site.", 31 | " ___________________________________________________________________", 32 | (char *) 0 33 | }; 34 | 35 | -------------------------------------------------------------------------------- /contrib/gre/egcanon.c: -------------------------------------------------------------------------------- 1 | #include "re.h" 2 | #include "lre.h" 3 | #include "hdr.h" 4 | 5 | #define DEBUG 6 | 7 | static Expr **proot; 8 | 9 | #define PURE(e) (!(e)->backref && !(e)->parens) 10 | #define PROC(kid) if(ee = proc(kid)){ ee->parent = (kid)->parent; free((char *)kid); kid = ee; } 11 | 12 | static Expr * 13 | proc(Expr *e) 14 | { 15 | Expr *ee; 16 | 17 | if(e->type == Cat){ 18 | if(PURE(e->l)){ 19 | if(proot){ 20 | *proot = eg_newexpr(Cat, 0, *proot, e->l); 21 | return((ee = proc(e->r))? ee:e->r); 22 | } else 23 | proot = &e->l; 24 | } else { 25 | PROC(e->l) 26 | } 27 | if(PURE(e->r)){ 28 | if(proot){ 29 | *proot = eg_newexpr(Cat, 0, *proot, e->r); 30 | return(e->l); 31 | } else 32 | proot = &e->r; 33 | } else { 34 | PROC(e->r) 35 | } 36 | return(0); 37 | } 38 | proot = 0; 39 | switch(e->type) 40 | { 41 | case Alternate: 42 | PROC(e->l) 43 | proot = 0; 44 | PROC(e->r) 45 | break; 46 | case Star: 47 | case Plus: 48 | case Quest: 49 | case EOP: 50 | case Group: 51 | PROC(e->l) 52 | break; 53 | } 54 | proot = 0; 55 | return(0); 56 | } 57 | 58 | void 59 | egcanon(Expr *e) 60 | { 61 | #ifdef DEBUG 62 | char before[EPRINTSIZE], after[EPRINTSIZE]; 63 | #endif 64 | 65 | #ifdef DEBUG 66 | eg_epr(e, before, 0); 67 | if(TRACE(3)){ 68 | PR "egcanon(%s):\n", before); 69 | } 70 | #endif 71 | proot = 0; 72 | if(!PURE(e)) 73 | proc(e); 74 | #ifdef DEBUG 75 | eg_epr(e, after, 0); 76 | if(TRACE(3)){ 77 | PR "egcanon returns %s\n", after); 78 | } 79 | if(strcmp(before, after)){ 80 | EPR "URK! egcanon did not preserve!\nbefore=%s\n after=%s\n", before, after); 81 | exit(1); 82 | } 83 | #endif 84 | } 85 | -------------------------------------------------------------------------------- /contrib/gre/retest.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "re.h" 4 | 5 | int suckline(char *, int); 6 | 7 | main(int argc, char **argv) 8 | { 9 | re_re *r; 10 | char *s; 11 | char text[4096], pat[4096]; 12 | unsigned char map[256]; 13 | FILE *exprs[1024]; 14 | char *match[10][2]; 15 | int n, i, bufc; 16 | extern re_debug; 17 | 18 | for(n = 0; n < 256; n++) 19 | map[n] = n; 20 | for(;;){ 21 | if(suckline(text, sizeof text)) 22 | break; 23 | if(suckline(pat, sizeof pat)) 24 | break; 25 | printf("searching for '%s' in '%s'\n", pat, text); 26 | r = re_recomp(pat, pat+strlen(pat), map); 27 | if(r == 0) 28 | continue; 29 | if(re_reexec(r, text, text+strlen(text), match)){ 30 | printf("matched:"); 31 | for(i = 0; i < 10; i++) 32 | if(match[i][0]){ 33 | printf(" G%d='", i); 34 | fwrite(match[i][0], 1, match[i][1]-match[i][0], stdout); 35 | putchar('\''); 36 | } 37 | putchar('\n'); 38 | } else 39 | printf("no match\n"); 40 | re_refree(r); 41 | } 42 | exit(0); 43 | } 44 | 45 | void 46 | re_error(char *s) 47 | { 48 | fprintf(stderr, "pattern error: %s\n", s); 49 | /* NOTREACHED */ 50 | } 51 | 52 | char buf[4096]; 53 | char *bp = buf; 54 | char *ep = buf; 55 | 56 | int 57 | get1(void) 58 | { 59 | if(bp >= ep){ 60 | int n; 61 | 62 | n = read(0, buf, sizeof buf); 63 | if(n <= 0) 64 | return(-1); 65 | bp = buf; 66 | ep = buf+n; 67 | } 68 | return(*(unsigned char *)bp++); 69 | } 70 | 71 | int 72 | suckline(char *s, int n) 73 | { 74 | int c; 75 | 76 | while(n-- > 0){ 77 | if((c = get1()) < 0) 78 | return(1); 79 | if(c == '\n') 80 | break; 81 | *s++ = c; 82 | } 83 | *s = 0; 84 | return(0); 85 | } 86 | -------------------------------------------------------------------------------- /contrib/xfm/pfm/fmdummy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * --------------------------------------------------------------------------- 3 | * This source code is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * If this code is modified and/or redistributed, please retain this 9 | * header, as well as any other 'flower-box' headers, that are 10 | * contained in the code in order to give credit where credit is due. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * Please use this URL to review the GNU General Public License: 18 | * http://www.gnu.org/licenses/gpl.txt 19 | * --------------------------------------------------------------------------- 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #include "../lib/symtab.h" /* our utilities/tools */ 31 | #include "../afileio/afidefs.h" 32 | 33 | 34 | #include "fmconst.h" /* constant definitons */ 35 | #include "rfm_const.h" 36 | 37 | 38 | #include "fmcmds.h" 39 | #include "fmstruct.h" /* structure definitions */ 40 | #include "fmproto.h" 41 | 42 | UTdspace( ) { return( 0 ); } 43 | KPmget( ) { return( 0 ); } 44 | KPget( ) { return( 0 ); } 45 | KBstatus( ) { return( 0 ); } 46 | 47 | -------------------------------------------------------------------------------- /contrib/xfm/rfm/fmdummy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * --------------------------------------------------------------------------- 3 | * This source code is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * If this code is modified and/or redistributed, please retain this 9 | * header, as well as any other 'flower-box' headers, that are 10 | * contained in the code in order to give credit where credit is due. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * Please use this URL to review the GNU General Public License: 18 | * http://www.gnu.org/licenses/gpl.txt 19 | * --------------------------------------------------------------------------- 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #include "../lib/symtab.h" /* our utilities/tools */ 31 | #include "../afileio/afidefs.h" 32 | 33 | 34 | #include "fmconst.h" /* constant definitons */ 35 | #include "rfm_const.h" 36 | 37 | 38 | #include "fmcmds.h" 39 | #include "fmstruct.h" /* structure definitions */ 40 | #include "fmproto.h" 41 | 42 | UTdspace( ) { return( 0 ); } 43 | KPmget( ) { return( 0 ); } 44 | KPget( ) { return( 0 ); } 45 | KBstatus( ) { return( 0 ); } 46 | 47 | -------------------------------------------------------------------------------- /contrib/libfmt/test.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include 17 | #include "plan9.h" 18 | #include "fmt.h" 19 | #include "fmtdef.h" 20 | 21 | int 22 | main(int argc, char *argv[]) 23 | { 24 | quotefmtinstall(); 25 | print("hello world\n"); 26 | print("x: %x\n", 0x87654321); 27 | print("u: %u\n", 0x87654321); 28 | print("d: %d\n", 0x87654321); 29 | print("s: %s\n", "hi there"); 30 | print("q: %q\n", "hi i'm here"); 31 | print("c: %c\n", '!'); 32 | print("g: %g %g %g\n", 3.14159, 3.14159e10, 3.14159e-10); 33 | print("e: %e %e %e\n", 3.14159, 3.14159e10, 3.14159e-10); 34 | print("f: %f %f %f\n", 3.14159, 3.14159e10, 3.14159e-10); 35 | print("smiley: %C\n", (Rune)0x263a); 36 | print("%g %.18g\n", 2e25, 2e25); 37 | print("%2.18g\n", 1.0); 38 | print("%2.18f\n", 1.0); 39 | print("%f\n", 3.1415927/4); 40 | print("%d\n", 23); 41 | print("%i\n", 23); 42 | print("%0.10d\n", 12345); 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /potoroo/lib/no_ast.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ======================================================================== v1.0/0a157 3 | * 4 | * This software is part of the AT&T Ningaui distribution 5 | * 6 | * Copyright (c) 2001-2009 by AT&T Intellectual Property. All rights reserved 7 | * AT&T and the AT&T logo are trademarks of AT&T Intellectual Property. 8 | * 9 | * Ningaui software is licensed under the Common Public 10 | * License, Version 1.0 by AT&T Intellectual Property. 11 | * 12 | * A copy of the License is available at 13 | * http://www.opensource.org/licenses/cpl1.0.txt 14 | * 15 | * Information and Software Systems Research 16 | * AT&T Labs 17 | * Florham Park, NJ 18 | * 19 | * Send questions, comments via email to ningaui_support@research.att.com. 20 | * 21 | * 22 | * ======================================================================== 0a229 23 | */ 24 | 25 | /* 26 | This is a special work round to get these three functions into 27 | a second library. These funcitons are compiled without ast/sfio 28 | references to support repmgrbt (threaded). They are placed into 29 | libng_noast-g.a during precompile. We have to 30 | do it this way or nmake has fits and tries to use the same .o for 31 | each library (go figure!) 32 | */ 33 | #define SANS_AST 1 34 | #include "ng_testport.c" 35 | #include "ng_read.c" 36 | #include "ng_rx.c" 37 | #include "ng_serv.c" 38 | -------------------------------------------------------------------------------- /potoroo/lib/ng_tokenise.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ======================================================================== v1.0/0a157 3 | * 4 | * This software is part of the AT&T Ningaui distribution 5 | * 6 | * Copyright (c) 2001-2009 by AT&T Intellectual Property. All rights reserved 7 | * AT&T and the AT&T logo are trademarks of AT&T Intellectual Property. 8 | * 9 | * Ningaui software is licensed under the Common Public 10 | * License, Version 1.0 by AT&T Intellectual Property. 11 | * 12 | * A copy of the License is available at 13 | * http://www.opensource.org/licenses/cpl1.0.txt 14 | * 15 | * Information and Software Systems Research 16 | * AT&T Labs 17 | * Florham Park, NJ 18 | * 19 | * Send questions, comments via email to ningaui_support@research.att.com. 20 | * 21 | * 22 | * ======================================================================== 0a229 23 | */ 24 | 25 | /* 26 | ---------------------------------------------------------------------------------- 27 | things for the tokeniser - moved out of ng_lib.h to prevent need to include sfio.h 28 | ---------------------------------------------------------------------------------- 29 | */ 30 | 31 | 32 | extern char **ng_readtokens( Sfio_t *f, char sep, char esc, char **reuse, int *count ); /* ng_token.c routines */ 33 | extern char **ng_tokenise( char *b, char sep, char esc, char **reuse, int *count ); 34 | 35 | -------------------------------------------------------------------------------- /contrib/mk/bufblock.c: -------------------------------------------------------------------------------- 1 | #include "mk.h" 2 | 3 | static Bufblock *freelist; 4 | #define QUANTA 4096 5 | 6 | Bufblock * 7 | newbuf(void) 8 | { 9 | Bufblock *p; 10 | 11 | if (freelist) { 12 | p = freelist; 13 | freelist = freelist->next; 14 | } else { 15 | p = (Bufblock *) Malloc(sizeof(Bufblock)); 16 | p->start = Malloc(QUANTA*sizeof(*p->start)); 17 | p->end = p->start+QUANTA; 18 | } 19 | p->current = p->start; 20 | *p->start = 0; 21 | p->next = 0; 22 | return p; 23 | } 24 | 25 | void 26 | freebuf(Bufblock *p) 27 | { 28 | p->next = freelist; 29 | freelist = p; 30 | } 31 | 32 | void 33 | growbuf(Bufblock *p) 34 | { 35 | int n; 36 | Bufblock *f; 37 | char *cp; 38 | 39 | n = p->end-p->start+QUANTA; 40 | /* search the free list for a big buffer */ 41 | for (f = freelist; f; f = f->next) { 42 | if (f->end-f->start >= n) { 43 | memcpy(f->start, p->start, p->end-p->start); 44 | cp = f->start; 45 | f->start = p->start; 46 | p->start = cp; 47 | cp = f->end; 48 | f->end = p->end; 49 | p->end = cp; 50 | f->current = f->start; 51 | break; 52 | } 53 | } 54 | if (!f) { /* not found - grow it */ 55 | p->start = Realloc(p->start, n); 56 | p->end = p->start+n; 57 | } 58 | p->current = p->start+n-QUANTA; 59 | } 60 | 61 | void 62 | bufcpy(Bufblock *buf, char *cp, int n) 63 | { 64 | 65 | while (n--) 66 | insert(buf, *cp++); 67 | } 68 | 69 | void 70 | insert(Bufblock *buf, int c) 71 | { 72 | 73 | if (buf->current >= buf->end) 74 | growbuf(buf); 75 | *buf->current++ = c; 76 | } 77 | 78 | void 79 | rinsert(Bufblock *buf, Rune r) 80 | { 81 | int n; 82 | 83 | n = runelen(r); 84 | if (buf->current+n > buf->end) 85 | growbuf(buf); 86 | runetochar(buf->current, &r); 87 | buf->current += n; 88 | } 89 | -------------------------------------------------------------------------------- /contrib/mk/file.c: -------------------------------------------------------------------------------- 1 | #include "mk.h" 2 | 3 | /* table-driven version in bootes dump of 12/31/96 */ 4 | 5 | long 6 | mtime(char *name) 7 | { 8 | return mkmtime(name); 9 | } 10 | 11 | long 12 | timeof(char *name, int force) 13 | { 14 | Symtab *sym; 15 | long t; 16 | 17 | if(utfrune(name, '(')) 18 | return atimeof(force, name); /* archive */ 19 | 20 | if(force) 21 | return mtime(name); 22 | 23 | 24 | sym = symlook(name, S_TIME, 0); 25 | if (sym) 26 | return (long) sym->value; /* uggh */ 27 | 28 | t = mtime(name); 29 | if(t == 0) 30 | return 0; 31 | 32 | symlook(name, S_TIME, (void*)t); /* install time in cache */ 33 | return t; 34 | } 35 | 36 | void 37 | touch(char *name) 38 | { 39 | Bprint(&bout, "touch(%s)\n", name); 40 | if(nflag) 41 | return; 42 | 43 | if(utfrune(name, '(')) 44 | atouch(name); /* archive */ 45 | else if(chgtime(name) < 0) { 46 | fprint(2, "%s: %r\n", name); 47 | Exit(); 48 | } 49 | } 50 | 51 | void 52 | delete(char *name) 53 | { 54 | if(utfrune(name, '(') == 0) { /* file */ 55 | if(remove(name) < 0) 56 | fprint(2, "remove %s: %r\n", name); 57 | } else 58 | fprint(2, "hoon off; mk can'tdelete archive members\n"); 59 | } 60 | 61 | void 62 | timeinit(char *s) 63 | { 64 | long t; 65 | char *cp; 66 | Rune r; 67 | int c, n; 68 | 69 | t = time(0); 70 | while (*s) { 71 | cp = s; 72 | do{ 73 | n = chartorune(&r, s); 74 | if (r == ' ' || r == ',' || r == '\n') 75 | break; 76 | s += n; 77 | } while(*s); 78 | c = *s; 79 | *s = 0; 80 | symlook(strdup(cp), S_TIME, (void *)t)->value = (void *)t; 81 | if (c) 82 | *s++ = c; 83 | while(*s){ 84 | n = chartorune(&r, s); 85 | if(r != ' ' && r != ',' && r != '\n') 86 | break; 87 | s += n; 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /potoroo/srcmgt/mkfile: -------------------------------------------------------------------------------- 1 | 2 | # ======================================================================== v1.0/0a157 3 | # 4 | # This software is part of the AT&T Ningaui distribution 5 | # 6 | # Copyright (c) 2001-2009 by AT&T Intellectual Property. All rights reserved 7 | # AT&T and the AT&T logo are trademarks of AT&T Intellectual Property. 8 | # 9 | # Ningaui software is licensed under the Common Public 10 | # License, Version 1.0 by AT&T Intellectual Property. 11 | # 12 | # A copy of the License is available at 13 | # http://www.opensource.org/licenses/cpl1.0.txt 14 | # 15 | # Information and Software Systems Research 16 | # AT&T Labs 17 | # Florham Park, NJ 18 | # 19 | # Send questions, comments via email to ningaui_support@research.att.com. 20 | # 21 | # 22 | # ======================================================================== 0a229 23 | 24 | 25 | # mkfile: 27 June 2005 26 | # Mods: 27 | # 28 Aug 2006 (sd) : added things to support release. 28 | 29 | MKSHELL=ksh 30 | 31 | PKG_PREFIX=ng_ 32 | htmlcat = srcmgt 33 | 34 | INSTALL = ng_sm_fetch ng_sm_replace ng_sm_new ng_sm_stat ng_sm_tag ng_sm_mkenv ng_sm_mkpkg \ 35 | ng_sm_build ng_sm_del ng_sm_autobuild ng_sm_publish ng_sm_history ng_sm_mkpkg_ast ng_make\ 36 | ng_sm_copyright ng_sm_fingerprint ng_sm_build_ast 37 | 38 | <$NG_SRC/panoptic.mk 39 | 40 | precompile:V: 41 | cp ng_make.ksh $NG_SRC/.bin/ng_make.ksh 42 | 43 | -------------------------------------------------------------------------------- /contrib/kpv/src/lib/sfio/NOTES: -------------------------------------------------------------------------------- 1 | Wed May 28 21:51:59 EDT 2003 2 | Change terror.h and the runtest script in Sfio_t to strictly 3 | use Sfio functions when running regression tests. Previously, 4 | sprintf and vsprintf from Stdio were used. This causes linkage 5 | problems on some architecture. 6 | 7 | 8 | Sat Jun 21 09:36:05 EDT 2003 9 | sfsetbuf.c was changed to take a hint from sfsetbuf(f,f,blksz). 10 | blksz is used for aligning disk block boundary while reading data to 11 | optimize data transfer from disk (eg, via direct I/O). blksz can be 12 | at most f->size/2 so that data movement in buffer can be optimized. 13 | blksz should also be a power-of-2 for optimal disk seeks. 14 | 15 | features/common was changed so that the executable test to generate 16 | va_copy(), etc. will not dump core on certain platforms. 17 | 18 | Fri Aug 22 17:00:51 EDT 2003 19 | sfmove() was fixed so that record definition is done via sfgetr(). 20 | This clears up issue with partial records being multiply handled 21 | in different sfmove() calls. 22 | 23 | sfasprintf and sfvasprintf were added to reflect the new Stdio functions. 24 | 25 | Fix the use of argv.c and argv.i when processing %c in sfvprintf(). 26 | 27 | Prototypes of *printf and *scanf functions were changed to return ssize_t 28 | instead of int. This breaks compatibility with Stdio but in some sense is 29 | more correct. 30 | 31 | Mon May 9 14:58:49 EDT 2005 32 | Note that sfsync() raise the exception SFSYNC twice when SF_IOCHECK is on. 33 | The first time with arg 1 before synchronization and the second time with 34 | arg 0, after synchronization. In this way, data squirelled away in disciplines 35 | can be flushed out as needed. This is needed in the Vczip program. 36 | -------------------------------------------------------------------------------- /contrib/xfm/rfm/fmdump.c: -------------------------------------------------------------------------------- 1 | /* 2 | * --------------------------------------------------------------------------- 3 | * This source code is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * If this code is modified and/or redistributed, please retain this 9 | * header, as well as any other 'flower-box' headers, that are 10 | * contained in the code in order to give credit where credit is due. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * Please use this URL to review the GNU General Public License: 18 | * http://www.gnu.org/licenses/gpl.txt 19 | * --------------------------------------------------------------------------- 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #include "../lib/symtab.h" /* our utilities/tools */ 31 | #include "../afileio/afidefs.h" 32 | 33 | 34 | #include "fmconst.h" /* constant definitons */ 35 | #include "rfm_const.h" 36 | 37 | 38 | #include "fmcmds.h" 39 | #include "fmstruct.h" /* structure definitions */ 40 | #include "fmproto.h" 41 | 42 | fmdump( char *ptr ) 43 | { 44 | int i; 45 | 46 | printf( "%04x: ", ptr ); 47 | for( i = 0; i < 16; i++ ) 48 | printf( "%02x ", (unsigned char) *ptr++ ); 49 | printf( "\n" ); 50 | } 51 | -------------------------------------------------------------------------------- /contrib/libutf/utf.h: -------------------------------------------------------------------------------- 1 | #ifndef _UTF_H_ 2 | #define _UTF_H_ 1 3 | #if defined(__cplusplus) 4 | extern "C" { 5 | #endif 6 | 7 | typedef unsigned short Rune; /* 16 bits */ 8 | 9 | enum 10 | { 11 | UTFmax = 3, /* maximum bytes per rune */ 12 | Runesync = 0x80, /* cannot represent part of a UTF sequence (<) */ 13 | Runeself = 0x80, /* rune and UTF sequences are the same (<) */ 14 | Runeerror = 0x80, /* decoding error in UTF */ 15 | }; 16 | 17 | /* Edit .+1,/^$/ | cfn $PLAN9/src/lib9/utf/?*.c | grep -v static |grep -v __ */ 18 | int chartorune(Rune *rune, char *str); 19 | int fullrune(char *str, int n); 20 | int isalpharune(Rune c); 21 | int islowerrune(Rune c); 22 | int isspacerune(Rune c); 23 | int istitlerune(Rune c); 24 | int isupperrune(Rune c); 25 | int runelen(long c); 26 | int runenlen(Rune *r, int nrune); 27 | Rune* runestrcat(Rune *s1, Rune *s2); 28 | Rune* runestrchr(Rune *s, Rune c); 29 | int runestrcmp(Rune *s1, Rune *s2); 30 | Rune* runestrcpy(Rune *s1, Rune *s2); 31 | Rune* runestrdup(Rune *s) ; 32 | Rune* runestrecpy(Rune *s1, Rune *es1, Rune *s2); 33 | long runestrlen(Rune *s); 34 | Rune* runestrncat(Rune *s1, Rune *s2, long n); 35 | int runestrncmp(Rune *s1, Rune *s2, long n); 36 | Rune* runestrncpy(Rune *s1, Rune *s2, long n); 37 | Rune* runestrrchr(Rune *s, Rune c); 38 | Rune* runestrstr(Rune *s1, Rune *s2); 39 | int runetochar(char *str, Rune *rune); 40 | Rune tolowerrune(Rune c); 41 | Rune totitlerune(Rune c); 42 | Rune toupperrune(Rune c); 43 | char* utfecpy(char *to, char *e, char *from); 44 | int utflen(char *s); 45 | int utfnlen(char *s, long m); 46 | char* utfrrune(char *s, long c); 47 | char* utfrune(char *s, long c); 48 | char* utfutf(char *s1, char *s2); 49 | 50 | #if defined(__cplusplus) 51 | } 52 | #endif 53 | #endif 54 | -------------------------------------------------------------------------------- /potoroo/tool/crontab_base.ningaui: -------------------------------------------------------------------------------- 1 | 2 | # ======================================================================== v1.0/0a157 3 | # 4 | # This software is part of the AT&T Ningaui distribution 5 | # 6 | # Copyright (c) 2001-2009 by AT&T Intellectual Property. All rights reserved 7 | # AT&T and the AT&T logo are trademarks of AT&T Intellectual Property. 8 | # 9 | # Ningaui software is licensed under the Common Public 10 | # License, Version 1.0 by AT&T Intellectual Property. 11 | # 12 | # A copy of the License is available at 13 | # http://www.opensource.org/licenses/cpl1.0.txt 14 | # 15 | # Information and Software Systems Research 16 | # AT&T Labs 17 | # Florham Park, NJ 18 | # 19 | # Send questions, comments via email to ningaui_support@research.att.com. 20 | # 21 | # 22 | # ======================================================================== 0a229 23 | 24 | 25 | # crontable installed for the ningaui user id. 26 | # 27 | # Most scheduled jobs for ningaui should be put into a rota controlfile. 28 | # This file is installed into $NG_ROOT/lib at system start and _ROOT_PATH_ 29 | # is fixed to be the correct path for NG_ROOT on the local node. 30 | # 31 | # machines like smaug dont support */5 32 | # 1 Oct 2001 : changed to every 5 min to assist with log trimming 33 | 0,5,10,15,20,25,30,35,40,45,50,55 * * * * NG_ROOT=_ROOT_PATH_ _ROOT_PATH_/bin/ksh _ROOT_PATH_/bin/ng_rota >>_ROOT_PATH_/site/log/rota 2>&1 34 | -------------------------------------------------------------------------------- /contrib/kpv/src/lib/sfio/Sfio_dc/sfdchdr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * ************************************************************************ 4 | * * * 5 | * * This software is part of the ast package * 6 | * * Copyright (c) 1985-2008 AT&T Intellectual Property * 7 | * * and is licensed under the * 8 | * * Common Public License, Version 1.0 * 9 | * * by AT&T Intellectual Property * 10 | * * * 11 | * * A copy of the License is available at * 12 | * * http://www.opensource.org/licenses/cpl1.0.txt * 13 | * * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * 14 | * * * 15 | * * Information and Software Systems Research * 16 | * * AT&T Research * 17 | * * Florham Park NJ * 18 | * * * 19 | * * Glenn Fowler * 20 | * * David Korn * 21 | * * Phong Vo * 22 | * * * 23 | * ************************************************************************ 24 | */ 25 | #ifndef _SFDCHDR_H 26 | #define _SFDCHDR_H 1 27 | 28 | #include "sfhdr.h" 29 | #include 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /potoroo/tool/pstree.ksh: -------------------------------------------------------------------------------- 1 | # 2 | # ======================================================================== v1.0/0a157 3 | # 4 | # This software is part of the AT&T Ningaui distribution 5 | # 6 | # Copyright (c) 2001-2009 by AT&T Intellectual Property. All rights reserved 7 | # AT&T and the AT&T logo are trademarks of AT&T Intellectual Property. 8 | # 9 | # Ningaui software is licensed under the Common Public 10 | # License, Version 1.0 by AT&T Intellectual Property. 11 | # 12 | # A copy of the License is available at 13 | # http://www.opensource.org/licenses/cpl1.0.txt 14 | # 15 | # Information and Software Systems Research 16 | # AT&T Labs 17 | # Florham Park, NJ 18 | # 19 | # Send questions, comments via email to ningaui_support@research.att.com. 20 | # 21 | # 22 | # ======================================================================== 0a229 23 | 24 | 25 | ps -ef | awk 'BEGIN { target = '$1' } 26 | { 27 | x = $0; sub(".*:...", "", x); cmd[$2] = x 28 | parent[$2] = $3 29 | } 30 | function par(x, s, indent, goo){ 31 | if(parent[x]+0 > 0) indent = par(parent[x], " ") 32 | else indent = "" 33 | goo = indent 34 | if(s != " "){ 35 | goo = indent 36 | gsub(".", s, goo) 37 | } 38 | print goo x " " cmd[x] 39 | return indent " " 40 | } 41 | function sib(x, indent){ 42 | for(i in parent) if(parent[i] == x){ 43 | print indent i " " cmd[i] 44 | sib(i, indent " ") 45 | } 46 | } 47 | END { 48 | x = par(target, ">") 49 | sib(target, x) 50 | }' 51 | -------------------------------------------------------------------------------- /contrib/kpv/NOTICE: -------------------------------------------------------------------------------- 1 | NOTICE: 2 | The following copyright statement applies to all files in this directory 3 | and any subdirectory. Additional copyright statements contained within 4 | any file are also applicable to the file in addition to this. 5 | 6 | 7 | /*********************************************************************** 8 | * * 9 | * This software is part of the ast package * 10 | * Copyright (c) 1985-2008 AT&T Intellectual Property * 11 | * and is licensed under the * 12 | * Common Public License, Version 1.0 * 13 | * by AT&T Intellectual Property * 14 | * * 15 | * A copy of the License is available at * 16 | * http://www.opensource.org/licenses/cpl1.0.txt * 17 | * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * 18 | * * 19 | * Information and Software Systems Research * 20 | * AT&T Research * 21 | * Florham Park NJ * 22 | * * 23 | * Glenn Fowler * 24 | * David Korn * 25 | * Phong Vo * 26 | * * 27 | ***********************************************************************/ 28 | 29 | -------------------------------------------------------------------------------- /potoroo/repmgr/repmgrb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ======================================================================== v1.0/0a157 3 | * 4 | * This software is part of the AT&T Ningaui distribution 5 | * 6 | * Copyright (c) 2001-2009 by AT&T Intellectual Property. All rights reserved 7 | * AT&T and the AT&T logo are trademarks of AT&T Intellectual Property. 8 | * 9 | * Ningaui software is licensed under the Common Public 10 | * License, Version 1.0 by AT&T Intellectual Property. 11 | * 12 | * A copy of the License is available at 13 | * http://www.opensource.org/licenses/cpl1.0.txt 14 | * 15 | * Information and Software Systems Research 16 | * AT&T Labs 17 | * Florham Park, NJ 18 | * 19 | * Send questions, comments via email to ningaui_support@research.att.com. 20 | * 21 | * 22 | * ======================================================================== 0a229 23 | */ 24 | 25 | #define NCON 10 26 | 27 | typedef struct Con { 28 | int fd; 29 | struct Con *next; 30 | } Con; 31 | 32 | typedef struct { 33 | int serv_fd; 34 | pthread_t thread; 35 | pthread_t con[NCON]; 36 | pthread_mutex_t lock; 37 | Chunk *top; 38 | Chunk *last; 39 | Con *cons; 40 | } Input_block; 41 | extern Chunk *getchunk(Input_block *); 42 | extern void putchunk(Input_block *, char *, int); 43 | extern void putcon(Input_block *, int); 44 | extern int getcon(Input_block *); 45 | 46 | #define P() pthread_mutex_lock(&i->lock) 47 | #define V() pthread_mutex_unlock(&i->lock) 48 | 49 | extern void *con_thread(void *); 50 | -------------------------------------------------------------------------------- /contrib/libfmt/dorfmt.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The authors of this software are Rob Pike and Ken Thompson. 3 | * Copyright (c) 2002 by Lucent Technologies. 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose without fee is hereby granted, provided that this entire notice 6 | * is included in all copies of any software which is or includes a copy 7 | * or modification of this software and in all copies of the supporting 8 | * documentation for such software. 9 | * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 10 | * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE 11 | * ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY 12 | * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. 13 | */ 14 | #include 15 | #include 16 | #include "plan9.h" 17 | #include "fmt.h" 18 | #include "fmtdef.h" 19 | 20 | /* format the output into f->to and return the number of characters fmted */ 21 | 22 | int 23 | dorfmt(Fmt *f, const Rune *fmt) 24 | { 25 | Rune *rt, *rs; 26 | int r; 27 | char *t, *s; 28 | int nfmt; 29 | 30 | nfmt = f->nfmt; 31 | for(;;){ 32 | if(f->runes){ 33 | rt = f->to; 34 | rs = f->stop; 35 | while((r = *fmt++) && r != '%'){ 36 | FMTRCHAR(f, rt, rs, r); 37 | } 38 | f->nfmt += rt - (Rune *)f->to; 39 | f->to = rt; 40 | if(!r) 41 | return f->nfmt - nfmt; 42 | f->stop = rs; 43 | }else{ 44 | t = f->to; 45 | s = f->stop; 46 | while((r = *fmt++) && r != '%'){ 47 | FMTRUNE(f, t, f->stop, r); 48 | } 49 | f->nfmt += t - (char *)f->to; 50 | f->to = t; 51 | if(!r) 52 | return f->nfmt - nfmt; 53 | f->stop = s; 54 | } 55 | 56 | fmt = __fmtdispatch(f, (Rune*)fmt, 1); 57 | if(fmt == nil) 58 | return -1; 59 | } 60 | return 0; /* not reached */ 61 | } 62 | -------------------------------------------------------------------------------- /contrib/kpv/src/lib/sfio/_sfslen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * ************************************************************************ 4 | * * * 5 | * * This software is part of the ast package * 6 | * * Copyright (c) 1985-2008 AT&T Intellectual Property * 7 | * * and is licensed under the * 8 | * * Common Public License, Version 1.0 * 9 | * * by AT&T Intellectual Property * 10 | * * * 11 | * * A copy of the License is available at * 12 | * * http://www.opensource.org/licenses/cpl1.0.txt * 13 | * * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * 14 | * * * 15 | * * Information and Software Systems Research * 16 | * * AT&T Research * 17 | * * Florham Park NJ * 18 | * * * 19 | * * Glenn Fowler * 20 | * * David Korn * 21 | * * Phong Vo * 22 | * * * 23 | * ************************************************************************ 24 | */ 25 | #include "sfhdr.h" 26 | 27 | #undef sfslen 28 | 29 | #if __STD_C 30 | ssize_t sfslen(void) 31 | #else 32 | ssize_t sfslen() 33 | #endif 34 | { 35 | return __sf_slen(); 36 | } 37 | -------------------------------------------------------------------------------- /contrib/xfm/rfm/fmignore.c: -------------------------------------------------------------------------------- 1 | /* 2 | * --------------------------------------------------------------------------- 3 | * This source code is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * If this code is modified and/or redistributed, please retain this 9 | * header, as well as any other 'flower-box' headers, that are 10 | * contained in the code in order to give credit where credit is due. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * Please use this URL to review the GNU General Public License: 18 | * http://www.gnu.org/licenses/gpl.txt 19 | * --------------------------------------------------------------------------- 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | #include "../lib/symtab.h" /* our utilities/tools */ 31 | #include "../afileio/afidefs.h" 32 | 33 | 34 | #include "fmconst.h" /* constant definitons */ 35 | #include "rfm_const.h" 36 | 37 | 38 | #include "fmcmds.h" 39 | #include "fmstruct.h" /* structure definitions */ 40 | #include "fmproto.h" 41 | 42 | /* 43 | Mnemonic: FMingnore 44 | Abstract: Ignores any other tokens until a newline (or simulated newline) 45 | Author: E. Scott Daniels 46 | */ 47 | void FMignore( ) 48 | { 49 | char *ptr; 50 | 51 | while( FMgetparm( &ptr ) > 0 ); /* skip all parms on the line */ 52 | } 53 | -------------------------------------------------------------------------------- /contrib/kpv/src/lib/sfio/Stdio_s/stdfgetc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * ************************************************************************ 4 | * * * 5 | * * This software is part of the ast package * 6 | * * Copyright (c) 1985-2008 AT&T Intellectual Property * 7 | * * and is licensed under the * 8 | * * Common Public License, Version 1.0 * 9 | * * by AT&T Intellectual Property * 10 | * * * 11 | * * A copy of the License is available at * 12 | * * http://www.opensource.org/licenses/cpl1.0.txt * 13 | * * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * 14 | * * * 15 | * * Information and Software Systems Research * 16 | * * AT&T Research * 17 | * * Florham Park NJ * 18 | * * * 19 | * * Glenn Fowler * 20 | * * David Korn * 21 | * * Phong Vo * 22 | * * * 23 | * ************************************************************************ 24 | */ 25 | #include "stdio_s.h" 26 | 27 | #if __STD_C 28 | int _stdfgetc(FILE* f) 29 | #else 30 | int _stdfgetc(f) 31 | FILE* f; 32 | #endif 33 | { 34 | return f ? sfgetc(f) : -1; 35 | } 36 | -------------------------------------------------------------------------------- /contrib/kpv/src/lib/sfio/Stdio_s/stdgetc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * ************************************************************************ 4 | * * * 5 | * * This software is part of the ast package * 6 | * * Copyright (c) 1985-2008 AT&T Intellectual Property * 7 | * * and is licensed under the * 8 | * * Common Public License, Version 1.0 * 9 | * * by AT&T Intellectual Property * 10 | * * * 11 | * * A copy of the License is available at * 12 | * * http://www.opensource.org/licenses/cpl1.0.txt * 13 | * * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * 14 | * * * 15 | * * Information and Software Systems Research * 16 | * * AT&T Research * 17 | * * Florham Park NJ * 18 | * * * 19 | * * Glenn Fowler * 20 | * * David Korn * 21 | * * Phong Vo * 22 | * * * 23 | * ************************************************************************ 24 | */ 25 | #include "stdio_s.h" 26 | 27 | #if __STD_C 28 | int _stdgetc(FILE* f) 29 | #else 30 | int _stdgetc(f) 31 | FILE* f; 32 | #endif 33 | { 34 | return f ? _std_getc(f) : -1; 35 | } 36 | -------------------------------------------------------------------------------- /potoroo/cluster/mkfile: -------------------------------------------------------------------------------- 1 | 2 | # ======================================================================== v1.0/0a157 3 | # 4 | # This software is part of the AT&T Ningaui distribution 5 | # 6 | # Copyright (c) 2001-2009 by AT&T Intellectual Property. All rights reserved 7 | # AT&T and the AT&T logo are trademarks of AT&T Intellectual Property. 8 | # 9 | # Ningaui software is licensed under the Common Public 10 | # License, Version 1.0 by AT&T Intellectual Property. 11 | # 12 | # A copy of the License is available at 13 | # http://www.opensource.org/licenses/cpl1.0.txt 14 | # 15 | # Information and Software Systems Research 16 | # AT&T Labs 17 | # Florham Park, NJ 18 | # 19 | # Send questions, comments via email to ningaui_support@research.att.com. 20 | # 21 | # 22 | # ======================================================================== 0a229 23 | 24 | 25 | # install_confg removed 4/18 -- dont need /ningaui/scripts stuff any more 26 | # 27 Nov 2004 (sd) - Removed ldr things from install list 27 | # 12 May 2005 (sd) - Setme and mac_addr.db removed from install list 28 | # 28 Jun 2005 (sd) - conversion to mk 29 | # These things were deprecated -- see Makefile for history: 30 | # mac.db 31 | # ldr_announce, ldr_rcv 32 | # 25 Aug 2006 (sd) : prep for software release (HBD_RMH) 33 | # -------------------------------------------------------------------------------- 34 | 35 | SCDSRC = 36 | ALL = 37 | INSTALL = ng_node_stat ng_rcv_node_stat ng_node_summary 38 | 39 | < $NG_SRC/panoptic.mk 40 | 41 | -------------------------------------------------------------------------------- /contrib/kpv/src/lib/sfio/_sfeof.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * ************************************************************************ 4 | * * * 5 | * * This software is part of the ast package * 6 | * * Copyright (c) 1985-2008 AT&T Intellectual Property * 7 | * * and is licensed under the * 8 | * * Common Public License, Version 1.0 * 9 | * * by AT&T Intellectual Property * 10 | * * * 11 | * * A copy of the License is available at * 12 | * * http://www.opensource.org/licenses/cpl1.0.txt * 13 | * * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * 14 | * * * 15 | * * Information and Software Systems Research * 16 | * * AT&T Research * 17 | * * Florham Park NJ * 18 | * * * 19 | * * Glenn Fowler * 20 | * * David Korn * 21 | * * Phong Vo * 22 | * * * 23 | * ************************************************************************ 24 | */ 25 | #include "sfhdr.h" 26 | 27 | #undef sfeof 28 | 29 | #if __STD_C 30 | int sfeof(reg Sfio_t* f) 31 | #else 32 | int sfeof(f) 33 | reg Sfio_t* f; 34 | #endif 35 | { 36 | return __sf_eof(f); 37 | } 38 | -------------------------------------------------------------------------------- /contrib/kpv/src/lib/sfio/_sfgetc.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * ************************************************************************ 4 | * * * 5 | * * This software is part of the ast package * 6 | * * Copyright (c) 1985-2008 AT&T Intellectual Property * 7 | * * and is licensed under the * 8 | * * Common Public License, Version 1.0 * 9 | * * by AT&T Intellectual Property * 10 | * * * 11 | * * A copy of the License is available at * 12 | * * http://www.opensource.org/licenses/cpl1.0.txt * 13 | * * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * 14 | * * * 15 | * * Information and Software Systems Research * 16 | * * AT&T Research * 17 | * * Florham Park NJ * 18 | * * * 19 | * * Glenn Fowler * 20 | * * David Korn * 21 | * * Phong Vo * 22 | * * * 23 | * ************************************************************************ 24 | */ 25 | #include "sfhdr.h" 26 | 27 | #undef sfgetc 28 | 29 | #if __STD_C 30 | int sfgetc(reg Sfio_t* f) 31 | #else 32 | int sfgetc(f) 33 | reg Sfio_t* f; 34 | #endif 35 | { 36 | return __sf_getc(f); 37 | } 38 | -------------------------------------------------------------------------------- /contrib/kpv/src/lib/sfio/_sfllen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * ************************************************************************ 4 | * * * 5 | * * This software is part of the ast package * 6 | * * Copyright (c) 1985-2008 AT&T Intellectual Property * 7 | * * and is licensed under the * 8 | * * Common Public License, Version 1.0 * 9 | * * by AT&T Intellectual Property * 10 | * * * 11 | * * A copy of the License is available at * 12 | * * http://www.opensource.org/licenses/cpl1.0.txt * 13 | * * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * 14 | * * * 15 | * * Information and Software Systems Research * 16 | * * AT&T Research * 17 | * * Florham Park NJ * 18 | * * * 19 | * * Glenn Fowler * 20 | * * David Korn * 21 | * * Phong Vo * 22 | * * * 23 | * ************************************************************************ 24 | */ 25 | #include "sfhdr.h" 26 | 27 | #undef sfllen 28 | 29 | #if __STD_C 30 | int sfllen(reg Sflong_t v) 31 | #else 32 | int sfllen(v) 33 | reg Sflong_t v; 34 | #endif 35 | { 36 | return __sf_llen(v); 37 | } 38 | -------------------------------------------------------------------------------- /contrib/kpv/src/lib/sfio/_sfdlen.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * ************************************************************************ 4 | * * * 5 | * * This software is part of the ast package * 6 | * * Copyright (c) 1985-2008 AT&T Intellectual Property * 7 | * * and is licensed under the * 8 | * * Common Public License, Version 1.0 * 9 | * * by AT&T Intellectual Property * 10 | * * * 11 | * * A copy of the License is available at * 12 | * * http://www.opensource.org/licenses/cpl1.0.txt * 13 | * * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * 14 | * * * 15 | * * Information and Software Systems Research * 16 | * * AT&T Research * 17 | * * Florham Park NJ * 18 | * * * 19 | * * Glenn Fowler * 20 | * * David Korn * 21 | * * Phong Vo * 22 | * * * 23 | * ************************************************************************ 24 | */ 25 | #include "sfhdr.h" 26 | 27 | #undef sfdlen 28 | 29 | #if __STD_C 30 | int sfdlen(reg Sfdouble_t v) 31 | #else 32 | int sfdlen(v) 33 | reg Sfdouble_t v; 34 | #endif 35 | { 36 | return __sf_dlen(v); 37 | } 38 | -------------------------------------------------------------------------------- /contrib/kpv/src/lib/sfio/_sferror.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * ************************************************************************ 4 | * * * 5 | * * This software is part of the ast package * 6 | * * Copyright (c) 1985-2008 AT&T Intellectual Property * 7 | * * and is licensed under the * 8 | * * Common Public License, Version 1.0 * 9 | * * by AT&T Intellectual Property * 10 | * * * 11 | * * A copy of the License is available at * 12 | * * http://www.opensource.org/licenses/cpl1.0.txt * 13 | * * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) * 14 | * * * 15 | * * Information and Software Systems Research * 16 | * * AT&T Research * 17 | * * Florham Park NJ * 18 | * * * 19 | * * Glenn Fowler * 20 | * * David Korn * 21 | * * Phong Vo * 22 | * * * 23 | * ************************************************************************ 24 | */ 25 | #include "sfhdr.h" 26 | 27 | #undef sferror 28 | 29 | #if __STD_C 30 | int sferror(reg Sfio_t* f) 31 | #else 32 | int sferror(f) 33 | reg Sfio_t* f; 34 | #endif 35 | { 36 | return __sf_error(f); 37 | } 38 | --------------------------------------------------------------------------------