Move handy macros to global header file, useful when binding keys.

This commit is contained in:
Joachim Nilsson 2011-01-06 10:41:07 +01:00
parent c59c62951f
commit 088dc1d1b2
2 changed files with 8 additions and 6 deletions

View File

@ -21,6 +21,14 @@
#ifndef __EDITLINE_H__ #ifndef __EDITLINE_H__
#define __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. */ /* Command status codes. */
typedef enum { typedef enum {
CSdone, CSeof, CSmove, CSdispatch, CSstay, CSsignal CSdone, CSeof, CSmove, CSdispatch, CSstay, CSsignal

View File

@ -33,12 +33,6 @@
#define EL_STDOUT 1 #define EL_STDOUT 1
#define NO_ARG (-1) #define NO_ARG (-1)
#define DEL 127 #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 " #define SEPS "\"#$&'()*:;<=>?[\\]^`{|}~\n\t "
/* /*