From e62b33025aa7174b4aafb1d89a6c178e9ceaf291 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 12 Apr 2004 08:33:15 +0000 Subject: [PATCH] Double yikes! I meant to check in just biblio.c, but instead I checked in all my just-started PS and PDF framework. I'm backing that lot back out until it actually does something. Ahem. git-svn-id: svn://svn.tartarus.org/sgt/halibut@4057 cda61777-01e9-0310-a592-d414129be87e --- Makefile | 2 +- bk_info.c | 5 +++-- bk_man.c | 7 +++---- bk_paper.c | 20 ------------------- bk_pdf.c | 18 ----------------- bk_ps.c | 18 ----------------- bk_text.c | 3 +-- bk_whlp.c | 4 +--- bk_xhtml.c | 4 +--- halibut.h | 27 +++++-------------------- help.c | 2 -- main.c | 66 +++++++++++++------------------------------------------------- 12 files changed, 28 insertions(+), 148 deletions(-) delete mode 100644 bk_paper.c delete mode 100644 bk_pdf.c delete mode 100644 bk_ps.c diff --git a/Makefile b/Makefile index f3b59e0..3802c58 100644 --- a/Makefile +++ b/Makefile @@ -100,7 +100,7 @@ SRC := ../ MODULES := main malloc ustring error help licence version misc tree234 MODULES += input keywords contents index style biblio -MODULES += bk_text bk_xhtml bk_whlp bk_man bk_info bk_paper bk_ps bk_pdf +MODULES += bk_text bk_xhtml bk_whlp bk_man bk_info MODULES += winhelp OBJECTS := $(addsuffix .o,$(MODULES)) diff --git a/bk_info.c b/bk_info.c index 7ed8799..23f8628 100644 --- a/bk_info.c +++ b/bk_info.c @@ -119,7 +119,7 @@ paragraph *info_config_filename(char *filename) } void info_backend(paragraph *sourceform, keywordlist *keywords, - indexdata *idx, void *unused) { + indexdata *idx) { paragraph *p; infoconfig conf; word *prefix, *body, *wp; @@ -140,7 +140,8 @@ void info_backend(paragraph *sourceform, keywordlist *keywords, int width = 70, listindentbefore = 1, listindentafter = 3; int indent_code = 2, index_width = 40; - IGNORE(unused); + IGNORE(keywords); /* we don't happen to need this */ + IGNORE(idx); /* or this */ conf = info_configure(sourceform); diff --git a/bk_man.c b/bk_man.c index 60157fa..a773b60 100644 --- a/bk_man.c +++ b/bk_man.c @@ -94,14 +94,13 @@ paragraph *man_config_filename(char *filename) #define QUOTE_QUOTES 2 /* quote double quotes by doubling them */ void man_backend(paragraph *sourceform, keywordlist *keywords, - indexdata *idx, void *unused) { + indexdata *idx) { paragraph *p; FILE *fp; manconfig conf; - IGNORE(unused); - IGNORE(keywords); - IGNORE(idx); + IGNORE(keywords); /* we don't happen to need this */ + IGNORE(idx); /* or this */ conf = man_configure(sourceform); diff --git a/bk_paper.c b/bk_paper.c deleted file mode 100644 index 81661bf..0000000 --- a/bk_paper.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Paper printing pre-backend for Halibut. - * - * This module does all the processing common to both PostScript - * and PDF output: selecting fonts, line wrapping and page breaking - * in accordance with font metrics, laying out the contents and - * index pages, generally doing all the page layout. After this, - * bk_ps.c and bk_pdf.c should only need to do linear translations - * into their literal output format. - */ - -#include "halibut.h" - -void *paper_pre_backend(paragraph *sourceform, keywordlist *keywords, - indexdata *idx) { - /* - * FIXME - */ - return "hello, world"; -} diff --git a/bk_pdf.c b/bk_pdf.c deleted file mode 100644 index 42a0018..0000000 --- a/bk_pdf.c +++ /dev/null @@ -1,18 +0,0 @@ -/* - * PDF backend for Halibut - */ - -#include "halibut.h" - -paragraph *pdf_config_filename(char *filename) -{ - return NULL; -} - -void pdf_backend(paragraph *sourceform, keywordlist *keywords, - indexdata *idx, void *unused) { - /* - * FIXME - */ - printf("[pdf] %p = %s\n", unused, unused); -} diff --git a/bk_ps.c b/bk_ps.c deleted file mode 100644 index 37bc07e..0000000 --- a/bk_ps.c +++ /dev/null @@ -1,18 +0,0 @@ -/* - * PostScript backend for Halibut - */ - -#include "halibut.h" - -paragraph *ps_config_filename(char *filename) -{ - return NULL; -} - -void ps_backend(paragraph *sourceform, keywordlist *keywords, - indexdata *idx, void *unused) { - /* - * FIXME - */ - printf("[ps] %p = %s\n", unused, unused); -} diff --git a/bk_text.c b/bk_text.c index 0c2ce2c..fdb1055 100644 --- a/bk_text.c +++ b/bk_text.c @@ -209,7 +209,7 @@ paragraph *text_config_filename(char *filename) } void text_backend(paragraph *sourceform, keywordlist *keywords, - indexdata *idx, void *unused) { + indexdata *idx) { paragraph *p; textconfig conf; word *prefix, *body, *wp; @@ -219,7 +219,6 @@ void text_backend(paragraph *sourceform, keywordlist *keywords, int nesting, nestindent; int indentb, indenta; - IGNORE(unused); IGNORE(keywords); /* we don't happen to need this */ IGNORE(idx); /* or this */ diff --git a/bk_whlp.c b/bk_whlp.c index 9655b1f..9575673 100644 --- a/bk_whlp.c +++ b/bk_whlp.c @@ -72,7 +72,7 @@ paragraph *whlp_config_filename(char *filename) } void whlp_backend(paragraph *sourceform, keywordlist *keywords, - indexdata *idx, void *unused) { + indexdata *idx) { WHLP h; char *filename, *cntname; paragraph *p, *lastsect; @@ -83,8 +83,6 @@ void whlp_backend(paragraph *sourceform, keywordlist *keywords, indexentry *ie; int done_contents_topic = FALSE; - IGNORE(unused); - h = state.h = whlp_new(); state.keywords = keywords; state.idx = idx; diff --git a/bk_xhtml.c b/bk_xhtml.c index 439f9f9..5a10137 100644 --- a/bk_xhtml.c +++ b/bk_xhtml.c @@ -744,15 +744,13 @@ static void xhtml_free_file(xhtmlfile* xfile) * Main function. */ void xhtml_backend(paragraph *sourceform, keywordlist *in_keywords, - indexdata *in_idx, void *unused) + indexdata *in_idx) { /* int i;*/ indexentry *ientry; int ti; xhtmlsection *xsect; - IGNORE(unused); - sourceparas = sourceform; conf = xhtml_configure(sourceform); keywords = in_keywords; diff --git a/halibut.h b/halibut.h index da7a845..fd93408 100644 --- a/halibut.h +++ b/halibut.h @@ -422,48 +422,31 @@ struct userstyle_Tag { /* * bk_text.c */ -void text_backend(paragraph *, keywordlist *, indexdata *, void *); +void text_backend(paragraph *, keywordlist *, indexdata *); paragraph *text_config_filename(char *filename); /* * bk_xhtml.c */ -void xhtml_backend(paragraph *, keywordlist *, indexdata *, void *); +void xhtml_backend(paragraph *, keywordlist *, indexdata *); paragraph *xhtml_config_filename(char *filename); /* * bk_whlp.c */ -void whlp_backend(paragraph *, keywordlist *, indexdata *, void *); +void whlp_backend(paragraph *, keywordlist *, indexdata *); paragraph *whlp_config_filename(char *filename); /* * bk_man.c */ -void man_backend(paragraph *, keywordlist *, indexdata *, void *); +void man_backend(paragraph *, keywordlist *, indexdata *); paragraph *man_config_filename(char *filename); /* * bk_info.c */ -void info_backend(paragraph *, keywordlist *, indexdata *, void *); +void info_backend(paragraph *, keywordlist *, indexdata *); paragraph *info_config_filename(char *filename); -/* - * bk_paper.c - */ -void *paper_pre_backend(paragraph *, keywordlist *, indexdata *); - -/* - * bk_ps.c - */ -void ps_backend(paragraph *, keywordlist *, indexdata *, void *); -paragraph *ps_config_filename(char *filename); - -/* - * bk_pdf.c - */ -void pdf_backend(paragraph *, keywordlist *, indexdata *, void *); -paragraph *pdf_config_filename(char *filename); - #endif diff --git a/help.c b/help.c index 8104006..3762a30 100644 --- a/help.c +++ b/help.c @@ -12,8 +12,6 @@ static char *helptext[] = { " --winhelp[=filename] generate Windows Help output", " --man[=filename] generate man page output", " --info[=filename] generate GNU info output", - " --ps[=filename] generate PostScript output", - " --pdf[=filename] generate PDF output", " -Cfoo:bar:baz append \\cfg{foo}{bar}{baz} to input", " --precise report column numbers in error messages", " --help display this text", diff --git a/main.c b/main.c index 24e6077..4dec663 100644 --- a/main.c +++ b/main.c @@ -11,29 +11,20 @@ static void dbg_prtsource(paragraph *sourceform); static void dbg_prtwordlist(int level, word *w); static void dbg_prtkws(keywordlist *kws); -static const struct pre_backend { - void *(*func)(paragraph *, keywordlist *, indexdata *); - int bitfield; -} pre_backends[] = { - {paper_pre_backend, 0x0001} -}; - static const struct backend { char *name; - void (*func)(paragraph *, keywordlist *, indexdata *, void *); + void (*func)(paragraph *, keywordlist *, indexdata *); paragraph *(*filename)(char *filename); - int bitfield, prebackend_bitfield; + int bitfield; } backends[] = { - {"text", text_backend, text_config_filename, 0x0001, 0}, - {"xhtml", xhtml_backend, xhtml_config_filename, 0x0002, 0}, - {"html", xhtml_backend, xhtml_config_filename, 0x0002, 0}, - {"hlp", whlp_backend, whlp_config_filename, 0x0004, 0}, - {"whlp", whlp_backend, whlp_config_filename, 0x0004, 0}, - {"winhelp", whlp_backend, whlp_config_filename, 0x0004, 0}, - {"man", man_backend, man_config_filename, 0x0008, 0}, - {"info", info_backend, info_config_filename, 0x0010, 0}, - {"ps", ps_backend, ps_config_filename, 0x0020, 0x0001}, - {"pdf", pdf_backend, pdf_config_filename, 0x0040, 0x0001}, + {"text", text_backend, text_config_filename, 0x0001}, + {"xhtml", xhtml_backend, xhtml_config_filename, 0x0002}, + {"html", xhtml_backend, xhtml_config_filename, 0x0002}, + {"hlp", whlp_backend, whlp_config_filename, 0x0004}, + {"whlp", whlp_backend, whlp_config_filename, 0x0004}, + {"winhelp", whlp_backend, whlp_config_filename, 0x0004}, + {"man", man_backend, man_config_filename, 0x0008}, + {"info", info_backend, info_config_filename, 0x0010}, }; int main(int argc, char **argv) { @@ -43,10 +34,9 @@ int main(int argc, char **argv) { int errs; int reportcols; int debug; - int backendbits, prebackbits; + int backendbits; int k, b; paragraph *cfg, *cfg_tail; - void *pre_backend_data[16]; /* * Set up initial (default) parameters. @@ -94,9 +84,7 @@ int main(int argc, char **argv) { assert(opt[0] == '-'); for (k = 0; k < (int)lenof(backends); k++) if (!strcmp(opt+1, backends[k].name)) { -printf("%d\n", backendbits); backendbits |= backends[k].bitfield; -printf("%d\n", backendbits); if (val) { paragraph *p = backends[k].filename(val); assert(p); @@ -243,7 +231,6 @@ printf("%d\n", backendbits); infiles[nfiles++] = p; } } -printf("%d\n", backendbits); if (errs) exit(EXIT_FAILURE); @@ -320,40 +307,13 @@ printf("%d\n", backendbits); } /* - * Select and run the pre-backends. - */ - prebackbits = 0; - for (k = 0; k < (int)lenof(backends); k++) - if (backendbits == 0 || (backendbits & backends[k].bitfield)) - prebackbits |= backends[k].prebackend_bitfield; - for (k = 0; k < (int)lenof(pre_backends); k++) - if (prebackbits & pre_backends[k].bitfield) { - assert(k < (int)lenof(pre_backend_data)); - pre_backend_data[k] = - pre_backends[k].func(sourceform, keywords, idx); - } - - /* * Run the selected set of backends. */ -printf("%d\n", backendbits); for (k = b = 0; k < (int)lenof(backends); k++) if (b != backends[k].bitfield) { b = backends[k].bitfield; - if (backendbits == 0 || (backendbits & b)) { - void *pbd = NULL; - int pbb = backends[k].prebackend_bitfield; - int m; - - for (m = 0; m < (int)lenof(pre_backends); m++) - if (pbb & pre_backends[m].bitfield) { - assert(m < (int)lenof(pre_backend_data)); - pbd = pre_backend_data[m]; - break; - } - - backends[k].func(sourceform, keywords, idx, pbd); - } + if (backendbits == 0 || (backendbits & b)) + backends[k].func(sourceform, keywords, idx); } free_para_list(sourceform); -- 2.11.0