summaryrefslogtreecommitdiff
path: root/main.c (follow)
Commit message (Collapse)AuthorAge
* Revamp of the Halibut error handling mechanism.Simon Tatham2012-08-29
| | | | | | | | | | | | | | | | I'm not quite sure why I ever thought it was a good idea to have a central variadic error() function taking an integer error code followed by some list of arguments that depend on that code. It now seems obvious to me that it's a much more sensible idea to have a separate function per error, so that we can check at compile time that the arguments to each error call are of the right number and type! So I've done that instead. A side effect is that the errors are no longer formatted into a fixed-size buffer before going to stderr, so I can remove all the %.200s precautions in the format strings. [originally from svn r9639]
* Enable Halibut to read a .but file from standard input, by supplyingSimon Tatham2009-10-24
| | | | | | the special filename '-'. [originally from svn r8728]
* Add a --list-fonts option, since getting PostScript names out of TrueTypeBen Harris2007-02-13
| | | | | | fonts is difficult. [originally from svn r7281]
* Display the "breaks" flag when generating a debugging dump.Ben Harris2006-05-06
| | | | [originally from svn r6653]
* Revert to "C" locale for LC_NUMERIC, so that PDFs won't be corruptedSimon Tatham2005-11-13
| | | | | | by the use of a comma as a decimal separator. [originally from svn r6456]
* Add a `--list-charsets' option to Halibut to enumerate canonical names of knownJacob Nevins2005-02-18
| | | | | | | | | character sets. (Also make libcharset `return_in_enum' values saner.) [originally from svn r5341] [this svn revision also touched charset,filter,timber]
* Changes/additions to input character set handling:Jacob Nevins2005-02-17
| | | | | | | | | | | | | | | | | - After discussion with Simon, change the default input charset back to ASCII, rather than trying to work it out from the locale, for the sake of promoting .but file portability. - Add a new command-line option "--input-charset=csname", which overrides the ASCII default for all input files (since there's no other way to use a non-ASCII-compatible input file). - Output a warning if -Cinput-charset:foo is specified that it has no effect. - Update the docs to match all this. Also try to clarify some other things in this area that caught me out. [originally from svn r5332]
* Switch the memory allocation macros from the Halibut onesSimon Tatham2004-06-12
| | | | | | | | | | | | | (mknew/mknewa/resize) to the PuTTY ones (snew/snewn/sresize). snewn and mknewa have their arguments opposite ways round; this may make the change initially painful but in the long term will free me of a nasty context switch every time I move between codebases. Also sresize takes an explicit type operand which is used to cast the return value from realloc, thus enforcing that it must be correct, and arranging that if anyone tries to compile Halibut with a C++ compiler there should be a lot less pain. [originally from svn r4276]
* Initial checkin of the shiny new rewritten-from-scratch HTML backSimon Tatham2004-06-12
| | | | | | | | | | | | | | | | | | end. There's a lot more _potentiality_ for new features than there are actual new features just yet, but future highlights include: configurable flavour of HTML (3.2, 4, XHTML Transitional or Strict), proper character set support (this is half way there already), and more flexible allocation of sections between multiple HTML files. Meanwhile, immediate benefits include correct handling of special characters within `author' and `description' strings, omission of the filename part in hyperlinks within the same HTML file (in particular, this means a single output file is now totally independent of its filename), and hyperlinks to the index from the top-level contents page (I'm amazed nobody has complained at the lack of this yet!). There are no doubt some shiny new bugs as well, but I'll never find them unless people start using the thing... [originally from svn r4275]
* Instead of traversing a list of paragraphs, mark_attr_ends() nowSimon Tatham2004-04-22
| | | | | | | | | merely traverses a list of words, and main() takes responsibility for applying it to each paragraph in the document. This is so that it can _also_ be applied to the display form of each index entry, which Jacob spotted wasn't previously being done. [originally from svn r4117]
* bk_text and bk_info both need to know the on-screen width ofSimon Tatham2004-04-22
| | | | | | | | | | | | characters in order to wrap and align them properly. Therefore, they should be using wcwidth(). So here are a couple of wrappers on wcwidth(), one which filters out the Unicode characters not representable in the target charset, and one which converts _from_ a charset to Unicode before calling wcwidth(). bk_text and bk_info should now align correctly even in the face of unsupported characters and Japanese. [originally from svn r4116]
* Support the locale-supplied character set where appropriate. It'sSimon Tatham2004-04-22
| | | | | | | | | | used for converting command-line -C directives into Unicode; it's used for outputting Unicode strings to stderr in error messages; and it's used as the default character set for input files (although I'd be inclined to recommend everyone use \cfg{input-charset} in all their source files to ensure their portability). [originally from svn r4114]
* Ahem. Fix stupid string handling error in new command-line configSimon Tatham2004-04-20
| | | | | | mechanism. [originally from svn r4103]
* Infrastructure changes for character set support. ustrtoa,Simon Tatham2004-04-20
| | | | | | | | | | | ustrfroma, utoa_dup and ufroma_dup now take a charset parameter, and also have a variety of subtly distinct forms. Also, when a \cfg directive is seen in the input file, the precise octet strings for each parameter are kept in their original form as well as being translated into Unicode, so that when they represent filenames they can be used verbatim. [originally from svn r4097]
* Support for \cfg{input-charset}. Input files can now be in ASCII,Simon Tatham2004-04-19
| | | | | | | 8859-*, UTF-8, or a variety of more fun encodings including various multibyte ones. [originally from svn r4095]
* Initial work on PS and PDF output. Because these two backends shareSimon Tatham2004-04-13
| | | | | | | | | | | | | | | | | | | an enormous amount of preprocessing and differ only in their final output form, I've introduced a new type of layer called a `pre-backend' (bk_paper.c is one). This takes all the information passed to a normal backend and returns an arbitrary void *, which is cached by the front end and passed on to any backend(s) which state a desire for the output of that particular pre-backend. Thus, all the page layout is done only once, and the PS and PDF backends process the same data structures into two output files. Note that these backends are _very_ unfinished; all sorts of vital things such as section numbers, list markers, and title formatting are missing, the paragraph justification doesn't quite work, and advanced stuff like indexes and PDF interactive features haven't even been started. But this basic framework generates valid output files and is a good starting point, so I'm checking it in. [originally from svn r4058]
* Info backend now takes care to avoid magic characters in node namesSimon Tatham2004-04-10
| | | | | | | | | | and index terms (the Info format doesn't like them). In the course of this I've had to introduce some infrastructure for carrying a filepos forward from the definition of every RHS index term so that a particular backend can provide a usefully localised report of which index term had a problem. [originally from svn r4051]
* Added an info(1) backend, which constructs .info files directlySimon Tatham2004-04-09
| | | | | | | without going through the .texi source stage. A few things left to do, notably documentation, but the basics all seem to be there. [originally from svn r4047]
* Arrange a mechanism whereby each backend can be passed a filenameSimon Tatham2004-04-01
| | | | | | | | | from its command-line option (`--text=foo.txt') and automatically convert it into one or more notional \cfg directives. In the HTML case this mechanism enables single-file mode as well as setting the filename. [originally from svn r4018]
* Add the -C command-line option, which allows arbitrary \cfgSimon Tatham2004-03-31
| | | | | | directives to be supplied on the Halibut command line. [originally from svn r4013]
* Make a start on command-line options. Here I introduce --text,Simon Tatham2004-03-31
| | | | | | | --html, --winhelp and --man (plus spelling variations :-), which allow you to choose to run only a subset of backends. [originally from svn r4012]
* Man-page back end for Halibut. Also, a couple of additional markupSimon Tatham2004-03-23
| | | | | | | | | features commonly used in man pages: (a) the ability to nest paragraph breaks, code paragraphs and other lists inside list items, and (b) description lists as normally used in man pages to describe command-line options. [originally from svn r3954]
* Rename Buttress to Halibut. I _think_ I've caught everything in this pass.Simon Tatham2002-08-05
| | | | [originally from svn r1800]
* Keywords are now collected using a B-tree rather than an array withSimon Tatham2001-12-14
| | | | | | | | heapsort. This makes the code much simpler for a start, but the main reason is so that we can spot duplicate keywords as we go along rather than having to wait until the end of input processing. [originally from svn r1489]
* This update should bring the Windows Help back end up toSimon Tatham2001-12-04
| | | | | | | near-complete functionality. All that's missing now is indexing and horizontal rules. [originally from svn r1449]
* Most of a Windows Help back end now appears to work. Missing areSimon Tatham2001-12-04
| | | | | | | | | | hierarchical topic navigation (menus at the bottom of non-leaf topics, and the Up button) and index support; also I want to give users the ability to specify context IDs for particular topics. Oh, and I haven't found a plausible way to express a horizontal rule in either .RTF or .HLP format. But everything else appears to be there. [originally from svn r1447]
* Enforce proper ordering of heading levels: specifically, ensure theSimon Tatham2001-10-25
| | | | | | | | | | user doesn't skip a heading level (\H before any \C or \A, or \S straight after \C with no intervening \H). The precise criterion is that when creating section a.b.c.d, sections a.b.c, a.b and a should already exist. This ensures the section tree really is a properly formed tree with no missing nodes. [originally from svn r1329]
* Initial checkin of xhtml backend.James Aylett2000-12-21
| | | | [originally from svn r828]
* Macros; \- for nonbreaking hyphenSimon Tatham1999-10-24
| | | | [originally from svn r252]
* Introduce word types for attributed spaces, so backends can distinguishSimon Tatham1999-10-22
| | | | | | between emphasis _like_ _this_ and _like this_ [originally from svn r245]
* First backend! Text output now pretty much works.Simon Tatham1999-10-20
| | | | [originally from svn r240]
* Further development; mid-end index handling pretty much there!Simon Tatham1999-10-18
| | | | [originally from svn r238]
* Further development: index work, phase ISimon Tatham1999-10-16
| | | | [originally from svn r237]
* Redo memory allocation to use mknew macroSimon Tatham1999-09-02
| | | | [originally from svn r214]
* Further development; bibliographies seem to workSimon Tatham1999-08-15
| | | | [originally from svn r200]
* More development; not nearly finished yetSimon Tatham1999-08-09
| | | | [originally from svn r193]
* Further development work. Parser nearly finishedSimon Tatham1999-07-31
| | | | [originally from svn r187]
* Initial checkin of skeleton application. About to start reading filesSimon Tatham1999-01-30
[originally from svn r22]