From 088dc1d1b2337954097afaf52829171f3cad17e1 Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Thu, 6 Jan 2011 10:41:07 +0100 Subject: [PATCH] Move handy macros to global header file, useful when binding keys. --- include/editline.h | 8 ++++++++ src/editline.c | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/include/editline.h b/include/editline.h index 7d1afe5..faa0214 100644 --- a/include/editline.h +++ b/include/editline.h @@ -21,6 +21,14 @@ #ifndef __EDITLINE_H__ #define __EDITLINE_H__ +/* Handy macros when binding keys. */ +#define CTL(x) ((x) & 0x1F) +#define ISCTL(x) ((x) && (x) < ' ') +#define UNCTL(x) ((x) + 64) +#define META(x) ((x) | 0x80) +#define ISMETA(x) ((x) & 0x80) +#define UNMETA(x) ((x) & 0x7F) + /* Command status codes. */ typedef enum { CSdone, CSeof, CSmove, CSdispatch, CSstay, CSsignal diff --git a/src/editline.c b/src/editline.c index 45a17f5..5220e65 100644 --- a/src/editline.c +++ b/src/editline.c @@ -33,12 +33,6 @@ #define EL_STDOUT 1 #define NO_ARG (-1) #define DEL 127 -#define CTL(x) ((x) & 0x1F) -#define ISCTL(x) ((x) && (x) < ' ') -#define UNCTL(x) ((x) + 64) -#define META(x) ((x) | 0x80) -#define ISMETA(x) ((x) & 0x80) -#define UNMETA(x) ((x) & 0x7F) #define SEPS "\"#$&'()*:;<=>?[\\]^`{|}~\n\t " /*