Annotation of mandoc/regs.h, Revision 1.5
1.5 ! schwarze 1: /* $Id: regs.h,v 1.4 2010/07/03 16:02:12 schwarze Exp $ */
1.1 kristaps 2: /*
3: * Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv>
1.5 ! schwarze 4: * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
1.1 kristaps 5: *
6: * Permission to use, copy, modify, and distribute this software for any
7: * purpose with or without fee is hereby granted, provided that the above
8: * copyright notice and this permission notice appear in all copies.
9: *
10: * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11: * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12: * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13: * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14: * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15: * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16: * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17: */
18: #ifndef REGS_H
19: #define REGS_H
20:
21: __BEGIN_DECLS
22:
23: enum regs {
24: REG_nS = 0, /* nS */
25: REG__MAX
26: };
27:
1.3 kristaps 28: struct reg {
29: int set; /* whether set or not */
30: union {
31: unsigned u; /* unsigned integer */
32: } v;
33: };
34:
35: /*
36: * Registers are non-scoped state. These can be manipulated directly in
37: * libroff or indirectly in libman or libmdoc by macros. These should
38: * be implemented sparingly (we are NOT roffdoc!) and documented fully
39: * in roff.7.
40: */
1.1 kristaps 41: struct regset {
1.3 kristaps 42: struct reg regs[REG__MAX];
1.1 kristaps 43: };
1.4 schwarze 44:
45: char *roff_setstr(const char *, const char *);
46: char *roff_getstr(const char *);
47: char *roff_getstrn(const char *, size_t);
48: void roff_freestr(void);
1.1 kristaps 49:
50: __END_DECLS
51:
52: #endif /*!REGS_H*/
CVSweb