-/* $Id: private.h,v 1.20 2008/11/30 21:41:35 kristaps Exp $ */
+/* $Id: private.h,v 1.30 2008/12/04 23:10:51 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
#ifndef PRIVATE_H
#define PRIVATE_H
-/* Input buffer (input read into buffer, then filled when empty). */
+#include <time.h>
+
struct md_rbuf {
int fd; /* Open descriptor. */
char *name; /* Name of file. */
size_t line; /* Current line number. */
};
-/* Output buffer (output buffered until full, then flushed). */
struct md_mbuf {
int fd; /* Open descriptor. */
char *name; /* Name of file. */
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_Dd 1
#define ROFF_Dt 2
#define ROFF_Oc 99
#define ROFF_Bk 100
#define ROFF_Ek 101
-#define ROFF_MAX 102
+#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_Nosplit 1
#define ROFF_Words 59
#define ROFF_ARGMAX 60
+#define ROFF_MAXLINEARG 32
+
extern const char *const *toknames;
extern const char *const *tokargnames;
struct roffcb {
void (*roffmsg)(void *, enum roffmsg,
const char *, const char *, char *);
- int (*roffhead)(void *);
+ int (*roffhead)(void *, const struct tm *, const char *,
+ const char *, const char *, const char *);
int (*rofftail)(void *);
+ int (*roffdata)(void *, int, const char *, char *);
int (*roffin)(void *, int, int *, char **);
- int (*roffdata)(void *, int, char *);
int (*roffout)(void *, int);
int (*roffblkin)(void *, int, int *, char **);
int (*roffblkout)(void *, int);
- int (*roffspecial)(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, const char *, char **);
};
+struct rofftree;
+
__BEGIN_DECLS
typedef void (*(*md_init)(const struct md_args *,
typedef int (*md_line)(void *, char *);
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 *);
-int md_line_html4_strict(void *, char *);
-int md_exit_html4_strict(void *, int);
+int md_line_html(void *, char *);
+int md_exit_html(void *, int);
void *md_init_xml(const struct md_args *,
struct md_mbuf *, const struct md_rbuf *);
int md_buf_putchar(struct md_mbuf *, 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 *);
int roff_free(struct rofftree *, int);
+int rofftok_scan(const char *, int *);
+
__END_DECLS
#endif /*!PRIVATE_H*/