diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2017-02-23 16:52:35 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2017-02-24 09:55:32 +0100 |
| commit | f2090b4b13c13711e6e1b9d3a7cde2cf5f121efe (patch) | |
| tree | 0deb128262b23ef103e3160ddc3f8064b2307956 /vis.h | |
| parent | 615a2c403833f0db591d56c5406dae23ca711777 (diff) | |
| download | vis-f2090b4b13c13711e6e1b9d3a7cde2cf5f121efe.tar.gz vis-f2090b4b13c13711e6e1b9d3a7cde2cf5f121efe.tar.xz | |
vis: make help texts optional to produce a smaller binary
$ ./configure --disable-help
shrinks the binary by about 20K on a x86_64 system.
Diffstat (limited to 'vis.h')
| -rw-r--r-- | vis.h | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -14,6 +14,20 @@ typedef struct Win Win; #include "text-regex.h" #include "libutf.h" +#ifndef CONFIG_HELP +#define CONFIG_HELP 1 +#endif + +#if CONFIG_HELP +#define VIS_HELP_DECL(x) x +#define VIS_HELP_USE(x) x +#define VIS_HELP(x) (x), +#else +#define VIS_HELP_DECL(x) +#define VIS_HELP_USE(x) NULL +#define VIS_HELP(x) +#endif + /* simplify utility renames by distribution packagers */ #ifndef VIS_MENU #define VIS_MENU "vis-menu" @@ -66,7 +80,7 @@ typedef const char *KeyActionFunction(Vis*, const char *keys, const Arg*); typedef struct { /* a KeyAction can be bound to a key binding */ const char *name; /* aliases can refer to this action by means of a pseudo key <name> */ - const char *help; /* short (one line) human readable description, displayed by :help */ + VIS_HELP_DECL(const char *help;) /* short (one line) human readable description, displayed by :help */ KeyActionFunction *func; /* action implementation */ Arg arg; /* additional arguments which will be passed as to func */ } KeyAction; |
