From 38fed8995810bd2856fe10752c0c8effad1e8845 Mon Sep 17 00:00:00 2001 From: crc Date: Mon, 21 Sep 2020 17:51:59 +0000 Subject: [PATCH] housekeeping: rename some files in tools; remove an unused toolchain item FossilOrigin-Name: 599c6411b356ab939ed2951167ba937158b2e7944eef1e4cab9bf7979166f012 --- Makefile | 8 +- tools/injectimage-js.c | 115 --------------------- tools/{embedimage.c => retro-embedimage.c} | 0 tools/{extend.c => retro-extend.c} | 0 tools/{unu.py => retro-unu.py} | 0 5 files changed, 4 insertions(+), 119 deletions(-) delete mode 100644 tools/injectimage-js.c rename tools/{embedimage.c => retro-embedimage.c} (100%) rename tools/{extend.c => retro-extend.c} (100%) rename tools/{unu.py => retro-unu.py} (100%) diff --git a/Makefile b/Makefile index 7c97f89..80e2f46 100644 --- a/Makefile +++ b/Makefile @@ -100,11 +100,11 @@ bin/retro-describe: tools/retro-describe.retro doc/words.tsv cat tools/retro-describe.retro doc/words.tsv >bin/retro-describe chmod +x bin/retro-describe -bin/retro-embedimage: tools/embedimage.c - $(CC) $(OPTIONS) $(CFLAGS) $(LDFLAGS) -o $@ tools/embedimage.c +bin/retro-embedimage: tools/retro-embedimage.c + $(CC) $(OPTIONS) $(CFLAGS) $(LDFLAGS) -o $@ tools/retro-embedimage.c -bin/retro-extend: tools/extend.c - $(CC) $(OPTIONS) $(CFLAGS) $(LDFLAGS) -o $@ tools/extend.c +bin/retro-extend: tools/retro-extend.c + $(CC) $(OPTIONS) $(CFLAGS) $(LDFLAGS) -o $@ tools/retro-extend.c bin/retro-muri: tools/retro-muri.c $(CC) $(OPTIONS) $(CFLAGS) $(LDFLAGS) -o $@ tools/retro-muri.c diff --git a/tools/injectimage-js.c b/tools/injectimage-js.c deleted file mode 100644 index 38a07f3..0000000 --- a/tools/injectimage-js.c +++ /dev/null @@ -1,115 +0,0 @@ -/* ____ ____ ______ ____ ___ - || \\ || | || | || \\ // \\ - ||_// ||== || ||_// (( )) - || \\ ||___ || || \\ \\_// - a personal, minimalistic forth - - This loads an image file and generates a C formatted - output. It's used to create the `image.c` that gets - linked into `rre`. - - Copyright (c) 2016-2019 Charles Childers -*/ - -#include -#include -#include -#include -#include - -#ifndef BIT64 -#define CELL int32_t -#define CELL_MIN INT_MIN + 1 -#define CELL_MAX INT_MAX - 1 -#else -#define CELL int64_t -#define CELL_MIN LLONG_MIN + 1 -#define CELL_MAX LLONG_MAX - 1 -#endif - -#define KiB * 1024 -CELL memory[128 KiB]; -char source[16 KiB]; - -void read_line(FILE *file, char *line_buffer) { - int ch, count; - if (file == NULL || line_buffer == NULL) - { - printf("Error: file or line buffer pointer is null."); - exit(1); - } - ch = getc(file); - count = 0; - while ((ch != '\n') && (ch != EOF)) { - line_buffer[count] = ch; - count++; - ch = getc(file); - } - line_buffer[count] = '\0'; -} - -CELL ngaLoadImage(char *imageFile) { - FILE *fp; - CELL imageSize; - long fileLen; - if ((fp = fopen(imageFile, "rb")) != NULL) { - /* Determine length (in cells) */ - fseek(fp, 0, SEEK_END); - fileLen = ftell(fp) / sizeof(CELL); - rewind(fp); - /* Read the file into memory */ - imageSize = fread(&memory, sizeof(CELL), fileLen, fp); - fclose(fp); - } - else { - printf("Unable to find the ngaImage!\n"); - exit(1); - } - return imageSize; -} - -void extract(char *fname, int32_t size) { - char *buffer = (char *)source; - FILE *fp; - int32_t i; - int32_t n; - - fp = fopen(fname, "r"); - if (fp == NULL) - return; - while (!feof(fp)) { - read_line(fp, buffer); - if (strcmp(buffer, "<<>>") == 0) { - i = 0; - n = 0; - while (i < size) { - n++; - if (n == 20) { - printf("\n"); - n = 0; - } - if (i+1 < size) - printf("%d,", memory[i]); - else - printf("%d\n", memory[i]); - i++; - } - } else { - printf("%s\n", buffer); - } - } - fclose(fp); -} - -int main(int argc, char **argv) { - int32_t size = 0; - - if (argc == 2) - size = ngaLoadImage(argv[1]); - else - size = ngaLoadImage("ngaImage"); - - extract("interface/alternates/retro12.html", size); - - exit(0); -} diff --git a/tools/embedimage.c b/tools/retro-embedimage.c similarity index 100% rename from tools/embedimage.c rename to tools/retro-embedimage.c diff --git a/tools/extend.c b/tools/retro-extend.c similarity index 100% rename from tools/extend.c rename to tools/retro-extend.c diff --git a/tools/unu.py b/tools/retro-unu.py similarity index 100% rename from tools/unu.py rename to tools/retro-unu.py