diff options
| -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;  } | 
