diff options
author | KatolaZ <katolaz@freaknet.org> | 2019-07-23 16:57:25 +0100 |
---|---|---|
committer | KatolaZ <katolaz@freaknet.org> | 2019-07-23 16:57:25 +0100 |
commit | 3a8eeffc5b3ef3d23984913d841e3a0aa5f68e16 (patch) | |
tree | 9af1d966e1082fda849452a25ee02a463cae408f | |
parent | a64ca9d14f8c197398badad39148b794757742b2 (diff) |
add makefile
-rw-r--r-- | Makefile | 19 | ||||
-rw-r--r-- | TODO | 12 | ||||
-rw-r--r-- | config.mk | 10 | ||||
-rw-r--r-- | gramscii.c | 3 |
4 files changed, 40 insertions, 4 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9ce0381 --- /dev/null +++ b/Makefile @@ -0,0 +1,19 @@ +# gramscii - simple editor for ASCII box-and-arrow charts + +include config.mk + +SRC = gramscii.c + +all: options gramscii + +options: + @echo "-+- build options -+-" + @echo "PREFIX = $(PREFIX)" + @echo "CFLAGS = $(CFLAGS)" + @echo "CC = $(CC)" + @echo "-+-+-+-+-+-+-+-+-+-+-" + + +gramscii: + $(CC) $(CFLAGS) -o $@ $(SRC) + @@ -1,16 +1,18 @@ + optimize redraws (i.e., avoid to redraw if possible) - move configs in config.h -- add Makefile - change screen management (i.e., dynamic array of lines) -- get screen geometry - add action multiplier (e.g., "7h" moves left by 7 cols) - add scripting mode option ("-s"?) - add screen geometry option (-g 25x80?) - read file at point +- use [ENTER] to exit from text insert +- maybe move "text" mode to "t" +- implement ellipse - parse control characters - parse arrows (text-mode will allow movements as well) - (?) implement CTRL+G as abort (aside ESC) - add crop command (c) +- remove extra blanks until EOL when saving to file + visual selection - crop-to - yank/put @@ -20,9 +22,13 @@ - manage special chars (DEL/CANC) during text insert (also do not print unmanaged chars!) - allow scrolling (both vertical and horizontal) +- catch SIGWINCH and react appropriately (after scroll is + enabled) - auto-arrow 'A' (automatic end-char) -* allow the use of [ENTER] to confirm arrow, boxes, and text (useful +* get screen geometry +* allow the use of [ENTER] to confirm arrow, boxes (useful for scripting) +* add Makefile * change "g" command: - g-g (goto top-left) - g-G (goto bottom-right) diff --git a/config.mk b/config.mk new file mode 100644 index 0000000..49448a1 --- /dev/null +++ b/config.mk @@ -0,0 +1,10 @@ +NAME=gramscii +VERSION=0.1 + +PREFIX = /usr/local +BINDIR = $(PREFIX)/bin +MANDIR = $(PREFIX)share/man + +CFLAGS=-O3 -std=c90 -pedantic -Wall + +CC=cc @@ -633,7 +633,7 @@ void write_file(){ if (!fname[0] || force_new){ get_string("Write to: ", fname, 255); - if (f=fopen(fname, "r")){ + if ((f=fopen(fname, "r"))!=NULL){ if (!is_yes(get_key("File exists. Overwrite [y/n]?")) ){ fclose(f); return; @@ -851,4 +851,5 @@ int main(int argc, char *argv[]){ commands(); cleanup(0); + return 0; } |