=================================================================== RCS file: /cvs/texi2mdoc/extern.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -p -r1.28 -r1.29 --- texi2mdoc/extern.h 2015/03/12 04:24:19 1.28 +++ texi2mdoc/extern.h 2015/03/12 10:44:34 1.29 @@ -1,4 +1,4 @@ -/* $Id: extern.h,v 1.28 2015/03/12 04:24:19 kristaps Exp $ */ +/* $Id: extern.h,v 1.29 2015/03/12 10:44:34 kristaps Exp $ */ /* * Copyright (c) 2015 Kristaps Dzonsons * @@ -85,6 +85,10 @@ enum texicmd { TEXICMD_DEFINDEX, TEXICMD_DEFMAC, TEXICMD_DEFMACX, + TEXICMD_DEFOP, + TEXICMD_DEFOPX, + TEXICMD_DEFOPT, + TEXICMD_DEFOPTX, TEXICMD_DEFTP, TEXICMD_DEFTPX, TEXICMD_DEFTYPEFN, @@ -379,7 +383,7 @@ struct teximacro { */ struct texiterm { char *term; - size_t chapter; + ssize_t chapter; }; /* @@ -393,13 +397,19 @@ struct texidex { size_t indexsz; }; +struct texinode { + char *name; + ssize_t up; + ssize_t prev; + ssize_t next; +}; + /* * The main parse structure. * This keeps any necessary information handy. */ struct texi { const char *chapters; /* are we splitting chapters */ - size_t chapnum; /* current chapter node */ char **dirs; /* texi directories */ size_t dirsz; /* number of texi directories */ FILE *outfile; /* current output stream */ @@ -421,8 +431,10 @@ struct texi { size_t macrosz; /* entries in macros */ char *copying; /* the @copying block */ size_t copyingsz; /* length of @copying */ - char **nodes; - size_t nodesz; + 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 complexity is required to accomodate for mdoc(7). @@ -460,6 +472,7 @@ void parsefile(struct texi *, const char *, int); int parselinearg(struct texi *, size_t *); void parseeoln(struct texi *, size_t *); void parseto(struct texi *, size_t *, const char *); +void parsesingle(struct texi *, size_t *); void texiabort(struct texi *, const char *) __attribute__((noreturn)); @@ -469,6 +482,7 @@ enum texicmd 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 *, ...) __attribute__((format(printf, 2, 3))) __attribute__((noreturn));