Refactored code. - sam - An updated version of the sam text editor. | |
git clone git://vernunftzentrum.de/sam.git | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 3faf10fec3196e42b6ca31cd216091d73475944a | |
parent b35dd50b6d5109038206f309278a4759f582e99e | |
Author: Rob King <[email protected]> | |
Date: Tue, 4 Oct 2016 11:17:05 -0500 | |
Refactored code. | |
Diffstat: | |
include/libc.h | 21 --------------------- | |
include/u.h | 8 ++++++++ | |
libXg/Makefile | 2 +- | |
libXg/arith.c | 1 - | |
libXg/balloc.c | 1 - | |
libXg/bitblt.c | 1 - | |
libXg/border.c | 1 - | |
libXg/bscreenrect.c | 1 - | |
libXg/clipr.c | 1 - | |
libXg/cursorset.c | 1 - | |
libXg/cursorswitch.c | 1 - | |
libXg/gcs.c | 1 - | |
libXg/getrect.c | 1 - | |
libXg/gwin.c | 1 - | |
libXg/ldconvert.c | 1 - | |
libXg/menuhit.c | 1 - | |
libXg/rectclip.c | 1 - | |
libXg/rune.c | 1 - | |
libXg/string.c | 1 - | |
libXg/texture.c | 1 - | |
libXg/wrbitmap.c | 1 - | |
libXg/xtbinit.c | 1 - | |
libframe/Makefile | 2 +- | |
libframe/frbox.c | 1 - | |
libframe/frdraw.c | 1 - | |
libframe/frinit.c | 1 - | |
libframe/frinsert.c | 1 - | |
libframe/frptofchar.c | 1 - | |
libframe/frselect.c | 1 - | |
libframe/frstr.c | 1 - | |
libframe/frutil.c | 1 - | |
sam/Makefile | 4 ++-- | |
sam/sam.h | 1 - | |
samterm/Makefile | 2 +- | |
samterm/flayer.c | 1 - | |
samterm/io.c | 1 - | |
samterm/main.c | 1 - | |
samterm/menu.c | 1 - | |
samterm/mesg.c | 1 - | |
samterm/rasp.c | 1 - | |
samterm/scroll.c | 1 - | |
samterm/unix.c | 1 - | |
42 files changed, 13 insertions(+), 62 deletions(-) | |
--- | |
diff --git a/include/libc.h b/include/libc.h | |
@@ -1,21 +0,0 @@ | |
-/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
- | |
- /* Plan 9 C library interface */ | |
- | |
- | |
-#include <u.h> | |
- | |
-#define utflen(s) (mbstowcs(NULL, (s), 0)) | |
-#define fullrune(s, n) (mbtowc(NULL, (s), (n)) >= 0) | |
-#define runetochar(s, r) (wctomb((s), (r))) | |
-#define runelen(r) (wctomb(NULL, (r))) | |
- | |
-/* | |
- * new rune routines | |
- */ | |
-int chartorune(wchar_t*, char*); | |
- | |
-/* | |
- * Miscellaneous functions | |
- */ | |
-void notify (void); | |
diff --git a/include/u.h b/include/u.h | |
@@ -12,3 +12,11 @@ | |
#include <unistd.h> | |
#include <wchar.h> | |
#include <wctype.h> | |
+ | |
+#define utflen(s) (mbstowcs(NULL, (s), 0)) | |
+#define fullrune(s, n) (mbtowc(NULL, (s), (n)) >= 0) | |
+#define runetochar(s, r) (wctomb((s), (r))) | |
+#define runelen(r) (wctomb(NULL, (r))) | |
+ | |
+int chartorune(wchar_t *, char *); | |
+void notify(void); | |
diff --git a/libXg/Makefile b/libXg/Makefile | |
@@ -47,4 +47,4 @@ $(LIB): $(OBJS) | |
$(LIB)(%.o): %.o | |
-$(OBJS): ../include/libg.h libgint.h ../include/libc.h | |
+$(OBJS): ../include/libg.h libgint.h | |
diff --git a/libXg/arith.c b/libXg/arith.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
Point | |
diff --git a/libXg/balloc.c b/libXg/balloc.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include "libgint.h" | |
diff --git a/libXg/bitblt.c b/libXg/bitblt.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include "libgint.h" | |
diff --git a/libXg/border.c b/libXg/border.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
extern uint64_t _borderpixel; | |
diff --git a/libXg/bscreenrect.c b/libXg/bscreenrect.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include "libgint.h" | |
diff --git a/libXg/clipr.c b/libXg/clipr.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include "libgint.h" | |
diff --git a/libXg/cursorset.c b/libXg/cursorset.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include "libgint.h" | |
diff --git a/libXg/cursorswitch.c b/libXg/cursorswitch.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include "libgint.h" | |
diff --git a/libXg/gcs.c b/libXg/gcs.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include "libgint.h" | |
diff --git a/libXg/getrect.c b/libXg/getrect.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include "libgint.h" | |
diff --git a/libXg/gwin.c b/libXg/gwin.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include <stdio.h> | |
#include <X11/IntrinsicP.h> | |
diff --git a/libXg/ldconvert.c b/libXg/ldconvert.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include "libgint.h" | |
diff --git a/libXg/menuhit.c b/libXg/menuhit.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include "libgint.h" | |
diff --git a/libXg/rectclip.c b/libXg/rectclip.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
int rectclip(Rectangle *rp, Rectangle b) /* first by reference, second … | |
diff --git a/libXg/rune.c b/libXg/rune.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <string.h> | |
#define UNICODE_REPLACEMENT_CHAR 0xfffd | |
diff --git a/libXg/string.c b/libXg/string.c | |
@@ -1,7 +1,6 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <string.h> | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include "libgint.h" | |
diff --git a/libXg/texture.c b/libXg/texture.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include "libgint.h" | |
diff --git a/libXg/wrbitmap.c b/libXg/wrbitmap.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include "libgint.h" | |
#include <X11/Intrinsic.h> | |
diff --git a/libXg/xtbinit.c b/libXg/xtbinit.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include <stdio.h> | |
#include <string.h> | |
diff --git a/libframe/Makefile b/libframe/Makefile | |
@@ -37,4 +37,4 @@ nuke: clean | |
install: $(LIB) | |
-$(OBJ): ../include/u.h ../include/libc.h ../include/frame.h | |
+$(OBJ): ../include/u.h ../include/frame.h | |
diff --git a/libframe/frbox.c b/libframe/frbox.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include <frame.h> | |
diff --git a/libframe/frdraw.c b/libframe/frdraw.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include <frame.h> | |
diff --git a/libframe/frinit.c b/libframe/frinit.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include <frame.h> | |
diff --git a/libframe/frinsert.c b/libframe/frinsert.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include <frame.h> | |
diff --git a/libframe/frptofchar.c b/libframe/frptofchar.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include <frame.h> | |
diff --git a/libframe/frselect.c b/libframe/frselect.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include <frame.h> | |
diff --git a/libframe/frstr.c b/libframe/frstr.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include <frame.h> | |
diff --git a/libframe/frutil.c b/libframe/frutil.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include <frame.h> | |
diff --git a/sam/Makefile b/sam/Makefile | |
@@ -52,10 +52,10 @@ install: sam | |
mkdir -p $(SAMDIR) | |
cp sam $(SAMDIR)/$(RSAMNAME) | |
-$(OBJ): sam.h ../include/u.h ../include/libc.h errors.h mesg.h | |
+$(OBJ): sam.h ../include/u.h errors.h mesg.h | |
cmd.o: parse.h | |
xec.o: parse.h | |
-unix.o: sam.h ../include/u.h ../include/libc.h errors.h mesg.h | |
+unix.o: sam.h ../include/u.h errors.h mesg.h | |
$(CC) -c $(CFLAGS) unix.c | |
diff --git a/sam/sam.h b/sam/sam.h | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include "errors.h" | |
/* | |
diff --git a/samterm/Makefile b/samterm/Makefile | |
@@ -35,4 +35,4 @@ clean: | |
install: samterm | |
cp samterm $(SAMTERM) | |
-$(OBJ): samterm.h flayer.h ../include/frame.h ../include/libg.h ../incl… | |
+$(OBJ): samterm.h flayer.h ../include/frame.h ../include/libg.h ../incl… | |
diff --git a/samterm/flayer.c b/samterm/flayer.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include <frame.h> | |
#include "flayer.h" | |
diff --git a/samterm/io.c b/samterm/io.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include <frame.h> | |
#include "flayer.h" | |
diff --git a/samterm/main.c b/samterm/main.c | |
@@ -1,7 +1,6 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include <frame.h> | |
#include <unistd.h> | |
diff --git a/samterm/menu.c b/samterm/menu.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include <frame.h> | |
#include "flayer.h" | |
diff --git a/samterm/mesg.c b/samterm/mesg.c | |
@@ -1,7 +1,6 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <string.h> | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include <frame.h> | |
#include "flayer.h" | |
diff --git a/samterm/rasp.c b/samterm/rasp.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include <frame.h> | |
#include "flayer.h" | |
diff --git a/samterm/scroll.c b/samterm/scroll.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include <frame.h> | |
#include "flayer.h" | |
diff --git a/samterm/unix.c b/samterm/unix.c | |
@@ -1,6 +1,5 @@ | |
/* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
#include <u.h> | |
-#include <libc.h> | |
#include <libg.h> | |
#include <frame.h> | |
#include "flayer.h" |