=================================================================== RCS file: /cvs/texi2mdoc/extern.h,v retrieving revision 1.25 retrieving revision 1.27 diff -u -p -r1.25 -r1.27 --- texi2mdoc/extern.h 2015/03/03 15:04:24 1.25 +++ texi2mdoc/extern.h 2015/03/11 12:51:41 1.27 @@ -1,4 +1,4 @@ -/* $Id: extern.h,v 1.25 2015/03/03 15:04:24 kristaps Exp $ */ +/* $Id: extern.h,v 1.27 2015/03/11 12:51:41 kristaps Exp $ */ /* * Copyright (c) 2015 Kristaps Dzonsons * @@ -32,6 +32,8 @@ # endif #endif +#define HAVE_INDEX 1 + /* * This defines each one of the Texinfo commands that we understand. * Obviously this only refers to native commands; overriden names are a @@ -275,6 +277,7 @@ enum texicmd { TEXICMD_TITLEFONT, TEXICMD_TITLEPAGE, TEXICMD_TOP, + TEXICMD_TPINDEX, TEXICMD_U, TEXICMD_UBARACCENT, TEXICMD_UDOTACCENT, @@ -293,6 +296,7 @@ enum texicmd { TEXICMD_VERBATIM, TEXICMD_VERBATIMINCLUDE, TEXICMD_VINDEX, + TEXICMD_VRINDEX, TEXICMD_VSKIP, TEXICMD_VTABLE, TEXICMD_W, @@ -369,6 +373,17 @@ struct teximacro { }; /* + * 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; + char **index; + size_t indexsz; +}; + +/* * The main parse structure. * This keeps any necessary information handy. */ @@ -377,7 +392,7 @@ struct texi { size_t chapnum; /* current chapter node */ char **dirs; /* texi directories */ size_t dirsz; /* number of texi directories */ - FILE *outfile; + FILE *outfile; /* current output stream */ /* * Run-time parameters. */ @@ -388,12 +403,14 @@ struct texi { char *title; /* title of document */ char *subtitle; /* subtitle of document */ int secoffs; /* see sectioner() */ - char **indexs; /* @defindex indices */ + struct texidex *indexs; /* index entries */ size_t indexsz; /* entries in indexs */ struct texivalue *vals; /* @value entries */ size_t valsz; /* entries in vals */ struct teximacro *macros; /* @macro entries */ size_t macrosz; /* entries in macros */ + char *copying; /* the @copying block */ + size_t copyingsz; /* length of @copying */ /* * The following control what we output to the screen. * The complexity is required to accomodate for mdoc(7). @@ -438,6 +455,8 @@ enum texicmd texicmd(const struct texi *, size_t, size_t *, struct teximacro **); enum texicmd peekcmd(const struct texi *, size_t); +enum texicmd + peeklinecmd(const struct texi *, size_t); void texierr(struct texi *, const char *, ...) __attribute__((format(printf, 2, 3))) __attribute__((noreturn)); @@ -448,6 +467,9 @@ void teximacroclose(struct texi *); void teximacroopen(struct texi *, const char *); void teximdocopen(struct texi *, size_t *); 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 texiputbuf(struct texi *p, size_t, size_t); void texiputchar(struct texi *p, char);