version 1.68, 2018/12/31 08:18:12 |
version 1.76, 2023/10/24 20:53:12 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
|
* Copyright (c) 2013-2015,2017-2020,2022 Ingo Schwarze <schwarze@openbsd.org> |
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2013,2014,2015,2017,2018 Ingo Schwarze <schwarze@openbsd.org> |
|
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the above |
* purpose with or without fee is hereby granted, provided that the above |
|
|
}; |
}; |
|
|
enum roff_tok { |
enum roff_tok { |
ROFF_br = 0, |
ROFF_br = 0, /* Beginning of roff(7) requests. */ |
ROFF_ce, |
ROFF_ce, |
ROFF_fi, |
ROFF_fi, |
ROFF_ft, |
ROFF_ft, |
|
|
ROFF_sp, |
ROFF_sp, |
ROFF_ta, |
ROFF_ta, |
ROFF_ti, |
ROFF_ti, |
ROFF_MAX, |
ROFF_MAX, /* End of requests that generate nodes. */ |
ROFF_ab, |
ROFF_ab, /* Requests only used during preprocessing. */ |
ROFF_ad, |
ROFF_ad, |
ROFF_af, |
ROFF_af, |
ROFF_aln, |
ROFF_aln, |
|
|
ROFF_writec, |
ROFF_writec, |
ROFF_writem, |
ROFF_writem, |
ROFF_xflag, |
ROFF_xflag, |
ROFF_cblock, |
ROFF_cblock, /* Block end marker "..". */ |
ROFF_RENAMED, |
ROFF_RENAMED, /* New name of a renamed request or macro. */ |
ROFF_USERDEF, |
ROFF_USERDEF, /* User defined macro. */ |
TOKEN_NONE, |
TOKEN_NONE, /* Undefined macro or text/tbl/eqn/comment node. */ |
MDOC_Dd, |
MDOC_Dd, /* Beginning of mdoc(7) macros. */ |
MDOC_Dt, |
MDOC_Dt, |
MDOC_Os, |
MDOC_Os, |
MDOC_Sh, |
MDOC_Sh, |
|
|
MDOC__Q, |
MDOC__Q, |
MDOC__U, |
MDOC__U, |
MDOC_Ta, |
MDOC_Ta, |
MDOC_MAX, |
MDOC_Tg, |
MAN_TH, |
MDOC_MAX, /* End of mdoc(7) macros. */ |
|
MAN_TH, /* Beginning of man(7) macros. */ |
MAN_SH, |
MAN_SH, |
MAN_SS, |
MAN_SS, |
MAN_TP, |
MAN_TP, |
|
|
MAN_UE, |
MAN_UE, |
MAN_MT, |
MAN_MT, |
MAN_ME, |
MAN_ME, |
MAN_MAX |
MAN_MR, |
|
MAN_MAX /* End of man(7) macros. */ |
}; |
}; |
|
|
/* |
/* |
Line 505 struct roff_node { |
|
Line 507 struct roff_node { |
|
struct mdoc_arg *args; /* BLOCK/ELEM */ |
struct mdoc_arg *args; /* BLOCK/ELEM */ |
union mdoc_data *norm; /* Normalized arguments. */ |
union mdoc_data *norm; /* Normalized arguments. */ |
char *string; /* TEXT */ |
char *string; /* TEXT */ |
|
char *tag; /* For less(1) :t and HTML id=. */ |
struct tbl_span *span; /* TBL */ |
struct tbl_span *span; /* TBL */ |
struct eqn_box *eqn; /* EQN */ |
struct eqn_box *eqn; /* EQN */ |
int line; /* Input file line number. */ |
int line; /* Input file line number. */ |
Line 521 struct roff_node { |
|
Line 524 struct roff_node { |
|
#define NODE_NOFILL (1 << 8) /* Fill mode switched off. */ |
#define NODE_NOFILL (1 << 8) /* Fill mode switched off. */ |
#define NODE_NOSRC (1 << 9) /* Generated node, not in input file. */ |
#define NODE_NOSRC (1 << 9) /* Generated node, not in input file. */ |
#define NODE_NOPRT (1 << 10) /* Shall not print anything. */ |
#define NODE_NOPRT (1 << 10) /* Shall not print anything. */ |
|
#define NODE_ID (1 << 11) /* Target for deep linking. */ |
|
#define NODE_HREF (1 << 12) /* Link to another place in this page. */ |
int prev_font; /* Before entering this node. */ |
int prev_font; /* Before entering this node. */ |
int aux; /* Decoded node data, type-dependent. */ |
int aux; /* Decoded node data, type-dependent. */ |
enum roff_tok tok; /* Request or macro ID. */ |
enum roff_tok tok; /* Request or macro ID. */ |
Line 548 struct roff_meta { |
|
Line 553 struct roff_meta { |
|
extern const char *const *roff_name; |
extern const char *const *roff_name; |
|
|
|
|
void deroff(char **, const struct roff_node *); |
int arch_valid(const char *, enum mandoc_os); |
|
void deroff(char **, const struct roff_node *); |
|
struct roff_node *roff_node_child(struct roff_node *); |
|
struct roff_node *roff_node_next(struct roff_node *); |
|
struct roff_node *roff_node_prev(struct roff_node *); |
|
int roff_node_transparent(struct roff_node *); |
|
int roff_tok_transparent(enum roff_tok); |