diff options
| author | Andreas Politz <politza@hochschule-trier.de> | 2015-04-01 11:37:37 +0200 |
|---|---|---|
| committer | Andreas Politz <politza@hochschule-trier.de> | 2015-04-01 11:37:37 +0200 |
| commit | 8e3fe2bb7e0d555182eeba9e80ed58ec30ce6fef (patch) | |
| tree | 493a50a64c16f3d4275f20a90fdfdef16c655323 /server/epdfinfo.h | |
| parent | 40755bfad50a3070851bc4cb66211a5c3bfd1420 (diff) | |
Use a macro for declaring commands.
* server/epdfinfo.h (DEC_CMD, DEC_CMD2): New macros.
* server/epdfinfo.c (commands): Use macros.
Diffstat (limited to 'server/epdfinfo.h')
| -rw-r--r-- | server/epdfinfo.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/server/epdfinfo.h b/server/epdfinfo.h index 33efc05..1f81373 100644 --- a/server/epdfinfo.h +++ b/server/epdfinfo.h @@ -137,6 +137,15 @@ } \ } while (0) +/* Declare commands */ +#define DEC_CMD(name) \ + {#name, cmd_ ## name, cmd_ ## name ## _spec, \ + G_N_ELEMENTS (cmd_ ## name ## _spec)} + +#define DEC_CMD2(command, name) \ + {name, cmd_ ## command, cmd_ ## command ## _spec, \ + G_N_ELEMENTS (cmd_ ## command ## _spec)} + enum suffix_char { NONE, COLON, NEWLINE}; enum image_type { PPM, PNG }; |
