version 1.3, 2008/12/04 11:25:29 |
version 1.16, 2008/12/10 17:31:57 |
|
|
#ifndef ML_H |
#ifndef ML_H |
#define ML_H |
#define ML_H |
|
|
|
#include "private.h" |
|
|
|
#define COLUMNS 72 |
|
#define INDENT_SZ 4 |
|
#define INDENT(x) ((x) > MAXINDENT ? MAXINDENT : (x)) |
|
#define MAXINDENT 10 |
|
|
struct md_mlg; |
struct md_mlg; |
|
|
enum md_ns { |
enum md_ns { |
|
|
MD_NS_HEAD, |
MD_NS_HEAD, |
MD_NS_BODY, |
MD_NS_BODY, |
MD_NS_INLINE, |
MD_NS_INLINE, |
MD_NS_DEFAULT, |
MD_NS_DEFAULT |
}; |
}; |
|
|
typedef int (*ml_begin)(struct md_mbuf *, const struct md_args *, |
enum ml_scope { |
const struct tm *, const char *, const char *, |
ML_OPEN, |
const char *, const char *); |
ML_CLOSE |
typedef int (*ml_end)(struct md_mbuf *, |
}; |
const struct md_args *); |
|
typedef ssize_t (*ml_endtag)(struct md_mbuf *, |
|
const struct md_args *, enum md_ns, int); |
|
typedef ssize_t (*ml_begintag)(struct md_mbuf *, |
|
const struct md_args *, enum md_ns, int, |
|
const int *, const char **); |
|
|
|
|
struct ml_args { |
|
const struct md_args *args; |
|
const struct md_rbuf *rbuf; |
|
struct md_mbuf *mbuf; |
|
int section; |
|
void *data; |
|
}; |
|
|
|
struct ml_cbs { |
|
int (*ml_begin)(struct ml_args *, const struct tm *, |
|
const char *, const char *, |
|
enum roffmsec, enum roffvol); |
|
int (*ml_end)(struct ml_args *, const struct tm *, |
|
const char *, const char *, |
|
enum roffmsec, enum roffvol); |
|
ssize_t (*ml_beginstring)(struct ml_args *, |
|
const char *, size_t); |
|
ssize_t (*ml_endstring)(struct ml_args *, |
|
const char *, size_t); |
|
ssize_t (*ml_endtag)(struct ml_args *, enum md_ns, int); |
|
ssize_t (*ml_begintag)(struct ml_args *, enum md_ns, int, |
|
const int *, const char **); |
|
int (*ml_alloc)(void **); |
|
void (*ml_free)(void *); |
|
}; |
|
|
__BEGIN_DECLS |
__BEGIN_DECLS |
|
|
|
int ml_putstring(struct md_mbuf *, |
|
const char *, size_t *); |
int ml_nputstring(struct md_mbuf *, |
int ml_nputstring(struct md_mbuf *, |
const char *, size_t, size_t *); |
const char *, size_t, size_t *); |
int ml_nputs(struct md_mbuf *, |
int ml_nputs(struct md_mbuf *, |
Line 53 int ml_putchars(struct md_mbuf *, |
|
Line 81 int ml_putchars(struct md_mbuf *, |
|
|
|
struct md_mlg *mlg_alloc(const struct md_args *, |
struct md_mlg *mlg_alloc(const struct md_args *, |
const struct md_rbuf *, struct md_mbuf *, |
const struct md_rbuf *, struct md_mbuf *, |
ml_begintag, ml_endtag, ml_begin, ml_end); |
const struct ml_cbs *); |
int mlg_exit(struct md_mlg *, int); |
int mlg_exit(struct md_mlg *, int); |
int mlg_line(struct md_mlg *, char *); |
int mlg_line(struct md_mlg *, char *); |
|
|
|
int ml_tagput(struct md_mbuf *, |
|
enum ml_scope, const char *, size_t *); |
|
|
__END_DECLS |
__END_DECLS |
|
|