From 3da36abba778bbb6f652585d4c8d476dcee854a4 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Wed, 25 Feb 2009 12:09:20 +0000 Subject: Added "termpair" for symmetric flag-setting. --- term.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'term.h') diff --git a/term.h b/term.h index 444423ed..c51ee48d 100644 --- a/term.h +++ b/term.h @@ -1,4 +1,4 @@ -/* $Id: term.h,v 1.5 2009/02/24 16:16:45 kristaps Exp $ */ +/* $Id: term.h,v 1.6 2009/02/25 12:09:20 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -40,11 +40,27 @@ struct termp { char *buf; }; +struct termpair { + int type; +#define TERMPAIR_FLAG (1 << 0) + union { + int flag; + } data; +}; + +#define TERMPAIR_SETFLAG(p, fl) \ + do { \ + (p)->data.flag = (fl); \ + (p)->type = TERMPAIR_FLAG; \ + } while (0) + struct termact { int (*pre)(struct termp *, + struct termpair *, const struct mdoc_meta *, const struct mdoc_node *); void (*post)(struct termp *, + struct termpair *, const struct mdoc_meta *, const struct mdoc_node *); }; -- cgit v1.2.3