version 1.9, 2008/11/26 21:42:59 |
version 1.29, 2008/12/04 19:31:57 |
|
|
#ifndef PRIVATE_H |
#ifndef PRIVATE_H |
#define PRIVATE_H |
#define PRIVATE_H |
|
|
/* Input buffer (input read into buffer, then filled when empty). */ |
#include <time.h> |
|
|
struct md_rbuf { |
struct md_rbuf { |
int fd; /* Open descriptor. */ |
int fd; /* Open descriptor. */ |
char *name; /* Name of file. */ |
char *name; /* Name of file. */ |
|
|
size_t line; /* Current line number. */ |
size_t line; /* Current line number. */ |
}; |
}; |
|
|
/* Output buffer (output buffered until full, then flushed). */ |
|
struct md_mbuf { |
struct md_mbuf { |
int fd; /* Open descriptor. */ |
int fd; /* Open descriptor. */ |
char *name; /* Name of file. */ |
char *name; /* Name of file. */ |
|
|
size_t pos; /* Position in buffer. */ |
size_t pos; /* Position in buffer. */ |
}; |
}; |
|
|
|
#define ROFFTok_Sp_A 0 |
|
#define ROFFTok_Sp_B 1 |
|
#define ROFFTok_Sp_F 2 |
|
#define ROFFTok_Sp_N 3 |
|
#define ROFFTok_Sp_R 4 |
|
#define ROFFTok_Sp_T 5 |
|
#define ROFFTok_Sp_V 6 |
|
#define ROFFTok_Space 7 |
|
#define ROFFTok_Null 8 |
|
#define ROFFTok_Hyphen 9 |
|
#define ROFFTok_Em 10 |
|
#define ROFFTok_En 11 |
|
#define ROFFTok_Ge 12 |
|
#define ROFFTok_Le 13 |
|
#define ROFFTok_Rquote 14 |
|
#define ROFFTok_Lquote 15 |
|
#define ROFFTok_Uparrow 16 |
|
#define ROFFTok_Acute 17 |
|
#define ROFFTok_Grave 18 |
|
#define ROFFTok_Pi 19 |
|
#define ROFFTok_Ne 20 |
|
#define ROFFTok_Lt 21 |
|
#define ROFFTok_Gt 22 |
|
#define ROFFTok_Plusmin 23 |
|
#define ROFFTok_Infty 24 |
|
#define ROFFTok_Bar 25 |
|
#define ROFFTok_Nan 26 |
|
#define ROFFTok_Quote 27 |
|
#define ROFFTok_Sp_0 28 |
|
#define ROFFTok_Slash 29 |
|
#define ROFFTok_MAX 30 |
|
|
#define ROFF___ 0 |
#define ROFF___ 0 |
#define ROFF_Dd 1 |
#define ROFF_Dd 1 |
#define ROFF_Dt 2 |
#define ROFF_Dt 2 |
Line 137 struct md_mbuf { |
|
Line 169 struct md_mbuf { |
|
#define ROFF_Fc 97 |
#define ROFF_Fc 97 |
#define ROFF_Oo 98 |
#define ROFF_Oo 98 |
#define ROFF_Oc 99 |
#define ROFF_Oc 99 |
#define ROFF_MAX 100 |
#define ROFF_Bk 100 |
|
#define ROFF_Ek 101 |
|
#define ROFF_Bt 102 |
|
#define ROFF_Hf 103 |
|
#define ROFF_Fr 104 |
|
#define ROFF_Ud 105 |
|
#define ROFF_MAX 106 |
|
|
#define ROFF_Split 0 |
#define ROFF_Split 0 |
#define ROFF_Nosplit 1 |
#define ROFF_Nosplit 1 |
Line 197 struct md_mbuf { |
|
Line 235 struct md_mbuf { |
|
#define ROFF_susv2 55 |
#define ROFF_susv2 55 |
#define ROFF_susv3 56 |
#define ROFF_susv3 56 |
#define ROFF_svid4 57 |
#define ROFF_svid4 57 |
#define ROFF_ARGMAX 58 |
#define ROFF_Filled 58 |
|
#define ROFF_Words 59 |
|
#define ROFF_ARGMAX 60 |
|
|
|
#define ROFF_MAXLINEARG 32 |
|
|
extern const char *const *toknames; |
extern const char *const *toknames; |
extern const char *const *tokargnames; |
extern const char *const *tokargnames; |
|
|
/* FIXME: have a md_roff with all necessary parameters. */ |
enum roffmsg { ROFF_WARN, ROFF_ERROR }; |
|
|
/* FIXME: have roffbegin and roffend for doc head/foot. */ |
|
|
|
struct roffcb { |
struct roffcb { |
int (*roffhead)(void); |
void (*roffmsg)(void *, enum roffmsg, |
int (*rofftail)(void); |
const char *, const char *, char *); |
int (*roffin)(int, int *, char **); |
int (*roffhead)(void *, const struct tm *, const char *, |
int (*roffout)(int); |
const char *, const char *, const char *); |
int (*roffblkin)(int); |
int (*rofftail)(void *); |
int (*roffblkout)(int); |
int (*roffdata)(void *, int, const char *, char *); |
|
int (*roffin)(void *, int, int *, char **); |
|
int (*roffout)(void *, int); |
|
int (*roffblkin)(void *, int, int *, char **); |
|
int (*roffblkout)(void *, int); |
|
int (*roffblkheadin)(void *, int, int *, char **); |
|
int (*roffblkheadout)(void *, int); |
|
int (*roffblkbodyin)(void *, int, int *, char **); |
|
int (*roffblkbodyout)(void *, int); |
|
int (*roffspecial)(void *, int, int *, char **, char **); |
}; |
}; |
|
|
|
struct rofftree; |
|
|
__BEGIN_DECLS |
__BEGIN_DECLS |
|
|
typedef void (*(*md_init)(const struct md_args *, |
typedef void (*(*md_init)(const struct md_args *, |
struct md_mbuf *, const struct md_rbuf *)); |
struct md_mbuf *, const struct md_rbuf *)); |
typedef int (*md_line)(void *, char *, size_t); |
typedef int (*md_line)(void *, char *); |
typedef int (*md_exit)(void *, int); |
typedef int (*md_exit)(void *, int); |
|
|
void *md_init_html4_strict(const struct md_args *, |
void *md_init_html(const struct md_args *, |
struct md_mbuf *, const struct md_rbuf *); |
struct md_mbuf *, const struct md_rbuf *); |
int md_line_html4_strict(void *, char *, size_t); |
int md_line_html(void *, char *); |
int md_exit_html4_strict(void *, int); |
int md_exit_html(void *, int); |
|
|
void *md_init_dummy(const struct md_args *, |
void *md_init_xml(const struct md_args *, |
struct md_mbuf *, const struct md_rbuf *); |
struct md_mbuf *, const struct md_rbuf *); |
int md_line_dummy(void *, char *, size_t); |
int md_line_xml(void *, char *); |
int md_exit_dummy(void *, int); |
int md_exit_xml(void *, int); |
|
|
int md_buf_puts(struct md_mbuf *, const char *, size_t); |
int md_buf_puts(struct md_mbuf *, const char *, size_t); |
int md_buf_putchar(struct md_mbuf *, char); |
int md_buf_putchar(struct md_mbuf *, char); |
int md_buf_putstring(struct md_mbuf *, const char *); |
int md_buf_putstring(struct md_mbuf *, const char *); |
|
|
struct rofftree; |
struct rofftree *roff_alloc(const struct roffcb *, void *); |
|
int roff_engine(struct rofftree *, char *); |
struct rofftree *roff_alloc(const struct md_args *, |
|
struct md_mbuf *, const struct md_rbuf *, |
|
const struct roffcb *); |
|
int roff_engine(struct rofftree *, char *, size_t); |
|
int roff_free(struct rofftree *, int); |
int roff_free(struct rofftree *, int); |
|
|
|
int rofftok_scan(const char *, int *); |
|
|
__END_DECLS |
__END_DECLS |
|
|