From e1b7e7d467e18ae3996ac620836966cdf1771517 Mon Sep 17 00:00:00 2001 From: Hugh Barney Date: Sun, 26 Mar 2017 17:59:15 +0100 Subject: [PATCH] added #define E_NAME etc, to enable faster customisation (eg renaming editor for a different project). --- zep.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/zep.c b/zep.c index e571c50..7467b5f 100644 --- a/zep.c +++ b/zep.c @@ -14,6 +14,10 @@ #include #include +#define E_NAME "zep" +#define E_VERSION "v1.2" +#define E_LABEL "Zep:" + #define B_MODIFIED 0x01 /* modified buffer */ #define MSGLINE (LINES-1) #define CHUNK 8096L @@ -97,7 +101,7 @@ void fatal(char *msg) refresh(); endwin(); noraw(); - printf("\nzep v1.1: %s\n", msg); + printf("\n" E_NAME " " E_VERSION ": %s\n", msg); exit(1); } @@ -374,7 +378,7 @@ void modeline(buffer_t *bp) standout(); move(bp->w_top + bp->w_rows, 0); mch = ((bp->b_flags & B_MODIFIED) ? '*' : '='); - sprintf(temp, "=%c Zep: == %s ", mch, bp->b_fname); + sprintf(temp, "=%c " E_LABEL " == %s ", mch, bp->b_fname); addstr(temp); for (i = strlen(temp) + 1; i <= COLS; i++) @@ -715,7 +719,7 @@ keymap_t keymap[] = { int main(int argc, char **argv) { - if (argc != 2) fatal("usage: zep filename\n"); + if (argc != 2) fatal("usage: " E_NAME " filename\n"); initscr(); raw();