version 1.22, 2015/03/01 13:39:51 |
version 1.30, 2018/11/13 08:45:29 |
|
|
# endif |
# endif |
#endif |
#endif |
|
|
|
#define HAVE_INDEX 1 |
|
|
/* |
/* |
* This defines each one of the Texinfo commands that we understand. |
* This defines each one of the Texinfo commands that we understand. |
* Obviously this only refers to native commands; overriden names are a |
* Obviously this only refers to native commands; overriden names are a |
|
|
TEXICMD_AT, |
TEXICMD_AT, |
TEXICMD_AUTHOR, |
TEXICMD_AUTHOR, |
TEXICMD_B, |
TEXICMD_B, |
|
TEXICMD_BACKSLASH, |
TEXICMD_BANG, |
TEXICMD_BANG, |
TEXICMD_BULLET, |
TEXICMD_BULLET, |
TEXICMD_BYE, |
TEXICMD_BYE, |
|
|
TEXICMD_DEFINDEX, |
TEXICMD_DEFINDEX, |
TEXICMD_DEFMAC, |
TEXICMD_DEFMAC, |
TEXICMD_DEFMACX, |
TEXICMD_DEFMACX, |
|
TEXICMD_DEFOP, |
|
TEXICMD_DEFOPX, |
|
TEXICMD_DEFOPT, |
|
TEXICMD_DEFOPTX, |
TEXICMD_DEFTP, |
TEXICMD_DEFTP, |
TEXICMD_DEFTPX, |
TEXICMD_DEFTPX, |
TEXICMD_DEFTYPEFN, |
TEXICMD_DEFTYPEFN, |
|
|
TEXICMD_TITLEFONT, |
TEXICMD_TITLEFONT, |
TEXICMD_TITLEPAGE, |
TEXICMD_TITLEPAGE, |
TEXICMD_TOP, |
TEXICMD_TOP, |
|
TEXICMD_TPINDEX, |
TEXICMD_U, |
TEXICMD_U, |
TEXICMD_UBARACCENT, |
TEXICMD_UBARACCENT, |
TEXICMD_UDOTACCENT, |
TEXICMD_UDOTACCENT, |
|
|
TEXICMD_VERBATIM, |
TEXICMD_VERBATIM, |
TEXICMD_VERBATIMINCLUDE, |
TEXICMD_VERBATIMINCLUDE, |
TEXICMD_VINDEX, |
TEXICMD_VINDEX, |
|
TEXICMD_VRINDEX, |
TEXICMD_VSKIP, |
TEXICMD_VSKIP, |
TEXICMD_VTABLE, |
TEXICMD_VTABLE, |
TEXICMD_W, |
TEXICMD_W, |
Line 368 struct teximacro { |
|
Line 377 struct teximacro { |
|
}; |
}; |
|
|
/* |
/* |
|
* A term is a word in an index. |
|
* For example "@cindex foo" adds the term "foo" to the "cp" index. |
|
* This occurs within a chapter ("nodes" in struct texi) |
|
*/ |
|
struct texiterm { |
|
char *term; |
|
ssize_t chapter; |
|
}; |
|
|
|
/* |
|
* Index tables. |
|
* These have a two or three letter name (usually) and any number of |
|
* terms that are associated with it. |
|
*/ |
|
struct texidex { |
|
char *name; |
|
struct texiterm *index; |
|
size_t indexsz; |
|
}; |
|
|
|
struct texinode { |
|
char *name; |
|
ssize_t up; |
|
ssize_t prev; |
|
ssize_t next; |
|
}; |
|
|
|
/* |
* The main parse structure. |
* The main parse structure. |
* This keeps any necessary information handy. |
* This keeps any necessary information handy. |
*/ |
*/ |
struct texi { |
struct texi { |
const char *chapters; /* are we splitting chapters */ |
const char *chapters; /* are we splitting chapters */ |
size_t chapnum; |
|
char **dirs; /* texi directories */ |
char **dirs; /* texi directories */ |
size_t dirsz; /* number of texi directories */ |
size_t dirsz; /* number of texi directories */ |
FILE *outfile; |
FILE *outfile; /* current output stream */ |
/* |
/* |
* Run-time parameters. |
* Run-time parameters. |
*/ |
*/ |
|
|
size_t valstackpos; /* position in valstack */ |
size_t valstackpos; /* position in valstack */ |
char *title; /* title of document */ |
char *title; /* title of document */ |
char *subtitle; /* subtitle of document */ |
char *subtitle; /* subtitle of document */ |
|
char *date; /* date of document */ |
int secoffs; /* see sectioner() */ |
int secoffs; /* see sectioner() */ |
char **indexs; /* @defindex indices */ |
struct texidex *indexs; /* index entries */ |
size_t indexsz; /* entries in indexs */ |
size_t indexsz; /* entries in indexs */ |
struct texivalue *vals; /* @value entries */ |
struct texivalue *vals; /* @value entries */ |
size_t valsz; /* entries in vals */ |
size_t valsz; /* entries in vals */ |
struct teximacro *macros; /* @macro entries */ |
struct teximacro *macros; /* @macro entries */ |
size_t macrosz; /* entries in macros */ |
size_t macrosz; /* entries in macros */ |
|
char *copying; /* the @copying block */ |
|
size_t copyingsz; /* length of @copying */ |
|
struct texinode *nodecache; /* index of node names */ |
|
size_t nodecachesz; /* nodes in nodecache */ |
|
size_t nodesz; /* parsing node (sequential) */ |
|
ssize_t nodecur; /* parsing node (cache position) */ |
/* |
/* |
* The following control what we output to the screen. |
* The following control what we output to the screen. |
* The complexity is required to accomodate for mdoc(7). |
* The complexity is required to accomodate for mdoc(7). |
|
|
int seenvs; /* newline has been Pp'd */ |
int seenvs; /* newline has been Pp'd */ |
int ign; /* if >0, don't print anything */ |
int ign; /* if >0, don't print anything */ |
int literal; /* if >0, literal context */ |
int literal; /* if >0, literal context */ |
|
int uppercase; /* if >0, uppercase */ |
}; |
}; |
|
|
#define BUF(_p) ((_p)->files[(_p)->filepos - 1].map) |
#define BUF(_p) ((_p)->files[(_p)->filepos - 1].map) |
Line 429 void parsefile(struct texi *, const char *, int); |
|
Line 473 void parsefile(struct texi *, const char *, int); |
|
int parselinearg(struct texi *, size_t *); |
int parselinearg(struct texi *, size_t *); |
void parseeoln(struct texi *, size_t *); |
void parseeoln(struct texi *, size_t *); |
void parseto(struct texi *, size_t *, const char *); |
void parseto(struct texi *, size_t *, const char *); |
|
void parsesingle(struct texi *, size_t *); |
|
|
void texiabort(struct texi *, const char *) |
void texiabort(struct texi *, const char *) |
__attribute__((noreturn)); |
__attribute__((noreturn)); |
|
|
texicmd(const struct texi *, size_t, size_t *, struct teximacro **); |
texicmd(const struct texi *, size_t, size_t *, struct teximacro **); |
enum texicmd |
enum texicmd |
peekcmd(const struct texi *, size_t); |
peekcmd(const struct texi *, size_t); |
|
enum texicmd |
|
peeklinecmd(const struct texi *, size_t); |
|
ssize_t texicache(struct texi *, const char *, size_t); |
void texierr(struct texi *, const char *, ...) |
void texierr(struct texi *, const char *, ...) |
__attribute__((format(printf, 2, 3))) |
__attribute__((format(printf, 2, 3))) |
__attribute__((noreturn)); |
__attribute__((noreturn)); |
Line 446 void teximacroclose(struct texi *); |
|
Line 494 void teximacroclose(struct texi *); |
|
void teximacroopen(struct texi *, const char *); |
void teximacroopen(struct texi *, const char *); |
void teximdocopen(struct texi *, size_t *); |
void teximdocopen(struct texi *, size_t *); |
void teximdocclose(struct texi *, int); |
void teximdocclose(struct texi *, int); |
|
void texindex(struct texi *, const char *, |
|
size_t, const char *, size_t); |
|
void texindex_add(struct texi *, const char *, size_t); |
void texipunctuate(struct texi *, size_t *); |
void texipunctuate(struct texi *, size_t *); |
void texiputbuf(struct texi *p, size_t, size_t); |
void texiputbuf(struct texi *p, size_t, size_t); |
void texiputchar(struct texi *p, char); |
void texiputchar(struct texi *p, char); |