]> git.mdlowis.com Git - projs/tide.git/commitdiff
removed hl-cpp.c source
authorMichael D. Lowis <mike@mdlowis.com>
Fri, 25 Aug 2017 02:05:45 +0000 (22:05 -0400)
committerMichael D. Lowis <mike@mdlowis.com>
Fri, 25 Aug 2017 02:05:45 +0000 (22:05 -0400)
Makefile
hl-cpp.c [deleted file]

index cee84500b0b233874f21800ea5cbab1a8c4f5e67..f8a828131723a4ef1548fe4993180e10c0226a33 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 INCS = -Iinc/
 
-BINS = tide tfetch tctl pick xcpd hl-cpp
+BINS = tide tfetch tctl pick xcpd
 MAN1 = docs/tide.1 docs/pick.1 docs/picktag.1 docs/pickfile.1
 
 LIBEDIT_OBJS =     \
@@ -36,7 +36,7 @@ clean:
        find . \( -name '*.gcno' -o -name '*.gcda' \) -delete
        $(RM) $(BINS) $(TEST_BINS)
 
-install: 
+install:
        mkdir -p $(PREFIX)/bin
        cp -f tcmd $(PREFIX)/bin
        cp -f tfetch $(PREFIX)/bin
@@ -68,7 +68,6 @@ libedit.a: $(LIBEDIT_OBJS)
 tide: tide.o libedit.a
 pick: pick.o libedit.a
 xcpd: xcpd.o libedit.a
-hl-cpp: hl-cpp.o libedit.a
 tfetch: tfetch.o
 tctl: tctl.o libedit.a
 tests/libedit: tests/libedit.o tests/lib/buf.o tests/lib/utf8.o libedit.a
diff --git a/hl-cpp.c b/hl-cpp.c
deleted file mode 100644 (file)
index 365ce51..0000000
--- a/hl-cpp.c
+++ /dev/null
@@ -1,95 +0,0 @@
-#include <stdc.h>
-#include <utf.h>
-#include <edit.h>
-#include <unistd.h>
-#include <ctype.h>
-
-Buf GapBuffer;
-char RawBuffer[32768];
-char* CurrBeg = RawBuffer;
-char* CurrEnd = RawBuffer;
-size_t Pos;
-size_t End;
-
-int fetch_byte(void) {
-    if (CurrBeg >= CurrEnd) {
-        CurrBeg = CurrEnd = RawBuffer;
-        long nread = read(STDIN_FILENO, RawBuffer, sizeof(RawBuffer));
-        if (nread <= 0) exit( -nread );
-        CurrEnd += nread;
-    }
-    return *(CurrBeg++);
-}
-
-void recv_chunk(void) {
-    int chunksz = 0, bufpos = 0, byte;
-    while (!bufpos) {
-        /* read the size of the chunk first */
-        while (isdigit(byte = fetch_byte()))
-            chunksz = (chunksz * 10) + (byte - '0');
-        if (!chunksz) continue;
-        /* now read out the actual chunk and stuff it in the gap buffer */
-        for (; chunksz; chunksz--, bufpos++) {
-            size_t len = 0;
-            Rune r;
-            while (!utf8decode(&r, &len, fetch_byte()));
-            buf_insert(&GapBuffer, false, bufpos, r);
-        }
-    }
-    Pos = 0;
-    End = buf_end(&GapBuffer);
-}
-
-extern void init(void);
-extern void scan(void);
-
-int main(int argc, char** argv) {
-    init();
-    while (true) {
-        buf_init(&GapBuffer, NULL);
-        recv_chunk();
-        scan();
-        printf("0,0,0\n");
-        fflush(stdout);
-    }
-    return 0;
-}
-
-/******************************************************************************/
-
-#include <ctype.h>
-
-static int isalnum_(int c) { return (isalnum(c) || c == '_'); }
-static int isalpha_(int c) { return (isalpha(c) || c == '_'); }
-
-static int peekc(int i) {
-    if (Pos >= End) return '\n';
-    Rune r = buf_get(&GapBuffer, Pos+i);
-    return (r == RUNE_CRLF ? '\n' : (int)r);
-}
-
-static int takec(void) {
-    int c = peekc(0);
-    Pos++;
-    return c;
-}
-
-/******************************************************************************/
-
-void init(void) {
-
-}
-
-void scan(void) {
-    while (Pos < End) {
-        if (isalpha_(peekc(0))) {
-            size_t beg = Pos, end = Pos;
-            while (isalnum_(takec()))
-                end++;
-            printf("%d,%d,%d\n", (int)beg, (int)end, 0);
-        } else {
-            Pos++;
-        }
-    }
-}
-