-/* $Id: term.h,v 1.6 2009/02/25 12:09:20 kristaps Exp $ */
+/* $Id: term.h,v 1.12 2009/03/01 13:06:49 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
#define TERMP_NOBREAK (1 << 4) /* No break after flush. */
#define TERMP_LITERAL (1 << 5) /* Literal words. */
#define TERMP_IGNDELIM (1 << 6) /* Delims like regulars. */
+#define TERMP_NONOSPACE (1 << 7) /* No space (no autounset). */
char *buf;
};
struct termpair {
+ struct termpair *ppair;
int type;
#define TERMPAIR_FLAG (1 << 0)
- union {
- int flag;
- } data;
+ int flag;
+ size_t offset;
+ size_t rmargin;
+ int count;
};
-#define TERMPAIR_SETFLAG(p, fl) \
+#define TERMPAIR_SETFLAG(termp, p, fl) \
do { \
- (p)->data.flag = (fl); \
- (p)->type = TERMPAIR_FLAG; \
+ assert(! (TERMPAIR_FLAG & (p)->type)); \
+ (termp)->flags |= (fl); \
+ (p)->flag = (fl); \
+ (p)->type |= TERMPAIR_FLAG; \
} while (0)
struct termact {