yodl-4.04.00/args/0000755000175000017500000000000014066072154012553 5ustar frankfrankyodl-4.04.00/args/args.ih0000644000175000017500000000024014066072154014025 0ustar frankfrank#include "args.h" #include #include #include #include #include "../message/message.h" #include "../new/new.h" yodl-4.04.00/args/argsoptarg.c0000644000175000017500000000033514066072154015071 0ustar frankfrank#include "args.ih" char const *args_optarg(int optchar) { register char const *opt = string_str(&args.d_option); register char const *pos = strchr(opt, optchar); return pos ? args.d_optarg[pos - opt] : 0; } yodl-4.04.00/args/argsoptint.c0000644000175000017500000000047714066072154015121 0ustar frankfrank#include "args.ih" int args_optint(int optchar) { register char const *arg = args_optarg(optchar); int value; if (!arg || sscanf (arg, "%d", &value) < 1) { message_show(MSG_ERR); message("No (int) argument with `-%c'", (char)optchar); return FAILED; } return value; } yodl-4.04.00/args/argsmultiarg.c0000644000175000017500000000272714066072154015430 0ustar frankfrank#include "args.ih" static char *str; static int option; // The full string is a string containing all the single-letter options that // were specified. E.g., DDvD if -D -D -v -D was specified. When called with a // non-0 argument str and searchStr are (re)initialized to the beginning of // the string. Then, and at each subsequent call using a zero-arg the saved // opchar is searched from where searchStr points. Following this search // searchStr is incremented, unless it points to the option string's 0-byte // The location of the optchar in str is then used as index in the array of // args.d_optarg, returning the associated value. char const *args_multiarg(int optchar) { if (optchar) // new option: { if (!str) str = (char *)string_str(&args.d_option); // use full string option = optchar; // save the option char } register char *pos = strchr(str, option); if (pos) { size_t idx = pos - str; *pos = ' '; // this option has now // been processed. return args.d_optarg[idx]; // return optionstr. } return PFAILED; // or return PFAILED // in which case there was // no option argument } yodl-4.04.00/args/argsarg.c0000644000175000017500000000041714066072154014347 0ustar frankfrank#include "args.ih" char const *args_arg(size_t idx) { if (idx >= args_nArgs() && message_show(MSG_ERR)) message("%u: argument bounds exceeded (n = %u)", (unsigned)idx, (unsigned)args_nArgs()); return args.d_argv[idx + args.d_optind]; } yodl-4.04.00/args/args.h0000644000175000017500000000605314066072154013664 0ustar frankfrank#ifndef INCLUDED_ARGS_H_ #define INCLUDED_ARGS_H_ #include #include "../root/root.h" /* Provide args_construct with the optionstring for getopt() and a pointer to long-options structs, terminating in a final element of 0's. */ typedef struct { char const *d_name; int d_type; unsigned char d_value; } LongOption; extern int args_data; char const *args_arg(size_t idx); /* 0: 1st arg not counting */ /* argv[0] */ void args_construct(int argc, char **argv, char *options, LongOption const *long_options); // P.M.: args_destruct /* get the next occurrence */ /* of a series of optargs */ /* to get the next one, */ /* give optarg 0 */ /* return value 0: no arg */ /* PFAILED: no (more) */ char const *args_multiarg(int optchar); /* optchars specified */ char const *args_optarg(int optchar); /* 0: no such option */ /* or value of option */ int args_optint(int optchar); /* int value of option */ /* optchar or FAILED and */ /* error message */ /* Internal Arg use only. Not used outside of this directory functions, needed here to allow proper compilation of the static inline functions below */ #include "../string/string.h" typedef struct { String d_option; /* all option characters encountered */ char **d_optarg; /* all option arguments, or 0-pointers */ /* the location of the option values */ /* matches the index of the corresponding */ /* character in d_option */ char **d_argv; int d_argc; char *d_home; char *d_programName; char *d_initial_dir; bool d_ok; int d_optind; } Args; extern Args args; /* public interface continues from here */ static inline char const *args_home() { return args.d_home ? args.d_home : NULL; } static inline char const *args_initial_dir() { return args.d_initial_dir; } static inline size_t args_nArgs() { return args.d_argc - args.d_optind; } static inline bool args_ok() { return args.d_ok; } static inline bool args_option(int optchar) { return strchr(string_str(&args.d_option), optchar) != NULL; } static inline bool args_options(char const *optchars) { return string_find_first_of(&args.d_option, optchars) != UFAILED; } static inline char const *args_programName() { return args.d_programName; } #endif yodl-4.04.00/args/argsconstruct.c0000644000175000017500000000375714066072154015634 0ustar frankfrank#include "args.ih" void args_construct(int argc, char **argv, char *options, LongOption const *longOption) { char *cp; size_t nopt; struct option *long_option; size_t nlong = 0; if (!longOption) long_option = new_calloc(1, sizeof(struct option)); else { while (longOption[nlong++].d_name) ; long_option = new_memory(nlong, sizeof(struct option)); for (nopt = 0; nopt < nlong; nopt++) { long_option[nopt].name = longOption[nopt].d_name; long_option[nopt].has_arg = longOption[nopt].d_type; long_option[nopt].flag = 0; long_option[nopt].val = longOption[nopt].d_value; } } memset(&args, 0, sizeof(Args)); string_construct(&args.d_option, 0); args.d_argv = argv; args.d_argc = argc; if ((cp = getenv("home")) || (cp = getenv("HOME"))) /* set home */ args.d_home = new_str(cp); args.d_programName = basename(argv[0]); /* set programname */ args.d_initial_dir = new_getcwd(); /* set initial dir. */ args.d_ok = true; nopt = 0; while (true) { int optchar = getopt_long(args.d_argc, args.d_argv, options, long_option, NULL); switch (optchar) { default: string_addchar(&args.d_option, optchar); new_size(&args.d_optarg, nopt + 1, nopt, sizeof(char *)); args.d_optarg[nopt++] = optarg ? new_str(optarg) : 0; // FALLING THROUGH case 'l': continue; /* at `while(true)' */ case '?': args.d_ok = false; /* stop processing at failure */ break; case EOF: args.d_optind = optind; break; } break; /* leave `while(true)' */ } free(long_option); } yodl-4.04.00/args/adata.c0000644000175000017500000000023414066072154013770 0ustar frankfrank#include "args.ih" int args_data = 0; /* to ensure linkage via argsconstruct.c */ Args args; /* initialized to 0 by the compiler */ yodl-4.04.00/AUTHORS.txt0000644000175000017500000000143314066072154013506 0ustar frankfrank AUTHORS - who did what on Yodl? This file lists authors of Yodl, in alphabetical order. o Frank Brokken , Original and current (2004- ) author. o Kees de Bruin , Html- and various other fixes. o Jan Nieuwenhuizen , http://www.xs4all.nl/~jantien/ Main author and maintainer. o Karel Kubat , http://www.icce.rug.nl/karel/karel.html Original author and brainfather. Likes to receive postcards: Karel Kubat Rietveldlaan 37 9731 MJ Groningen The Netherlands o Jeffrey B. Reed , Windows-nt, StepMake fixes. o Paulo da Silva Little contribu- tion for internationalization. yodl-4.04.00/build0000755000175000017500000001522314755317165012660 0ustar frankfrank#!/usr/bin/icmake -t. #include "VERSION" #include "INSTALL.im" // Use the next one to see what parser/p_parse() does //#define COPT "-O2 -Wall -DEBUG" #define COPT "-O2 -Wall -fdiagnostics-color=never " // -Werror" #define STD_CONVERSIONS "html latex man txt xml" #define ECHO_REQUEST 1 // uncomment to show the full gcc commands when compiling // #define ECHO_COMPILE string CLASSES; string g_lopt; string g_copt; string g_cwd; string g_wip = "tmp/wip"; // no slash here string g_install = "tmp/install"; // no slash here int g_compiled; int g_nClasses; list g_classes; #include "icmake/run" #include "icmake/md" #include "icmake/clean" #include "icmake/stdcpp" #include "icmake/stdcompile" #include "icmake/compilerss" #include "icmake/builtins" #include "icmake/program" #include "icmake/buildmacros" #include "icmake/manualmacrolist" #include "icmake/macros" #include "icmake/man" #include "icmake/manual" #include "icmake/install" #include "icmake/gitlab" string setOpt(string install_im, string envvar) { list optvar; string ret; optvar = getenv(envvar); if (optvar[0] == "1") ret = optvar[1]; else ret = install_im; return ret; } void main(int argc, list argv) { string arg1; echo(ECHO_REQUEST); g_cwd = chdir("."); g_copt = setOpt(COPT + " -g", "CFLAGS"); #ifdef PROFILING g_copt = COPT + " -pg"; g_lopt = "-pg"; #endif g_lopt = setOpt(g_lopt, "LDFLAGS"); #ifdef EXTENSIVE_OPTIONS g_copt = "-O0 -g3 -ansi -pedantic -fno-common -pipe -W -Wall -Wcast-align" " -Wcast-qual -Wconversion -Wformat=2 -Winline -Wnested-externs" " -Wpointer-arith -Wshadow -Wstrict-prototypes -Wundef " "-Wno-unused-parameter -Waggregate-return -Wnested-externs"; #endif setLocations(); if ( STD_INCLUDE[0] != "/" || BIN[0] != "/" || MAN[0] != "/" || DOC[0] != "/" || DOCDOC[0] != "/" ) { printf("Check INSTALL.im: BIN, DOC, DOCDOC, MAN, STD_INCLUDE, " "must be absolute paths\n"); exit(1); } arg1 = argv[1]; if (arg1 == "clean" || arg1 == "distclean") cleanupExit(); md(g_install + " " + g_wip); // g_include = " -I.:" + g_install + STD_INCLUDE + ":" + g_wip; echo(OFF); run("rm -f " + g_wip + "/release.yo " + g_wip + "/config.h"); echo(ON); fprintf(g_wip + "/release.yo", "SUBST(_CurVers_)(", VERSION, ")\n", "SUBST(_CurYrs_)(", YEARS, ")\n", "manttquoted(1)\n"); fprintf(g_wip + "/config.h", "#define STD_INCLUDE \"", STD_INCLUDE, "\"\n" "#define VERSION \"" VERSION "\"\n" "#define YEARS \"" YEARS "\"\n" "#define YODL_BIN \"", BIN, "\"\n" ); if (arg1 == "programs") programsExit(argv[2]); // icmake/program if ( arg1 == "yodl" || arg1 == "yodlpost" || arg1 == "yodlverbinsert" || arg1 == "yodlstriproff" || arg1 == "yodl2whatever" || arg1 == "programs" ) programExit(arg1, argv[2]); // requires 'build programs' if (arg1 == "macros") // run before 'build man', etc. macrosExit(); if (arg1 == "man") manExit(argv[2]); if (arg1 == "manual") manualExit("", argv[2]); if (arg1 == "html") manualExit("html", argv[2]); if (arg1 == "latex") manualExit("latex", argv[2]); // Debian package construction // .gz compresses the man-pages // defines .gz links to // man1/yodlconverters.1.gz if (arg1 == "install") installExit(argv[2], argv[3]); // icmake/install if (arg1 == "gitlab") gitlab(); printf("Usage: build action\n" "Where `action' is one of:\n" " (dist)clean: clean up\n" " programs [strip]: build the programs\n" " yodl [strip]: only build `yodl'\n" " yodlpost [strip]: only build `yodlpost'\n" " yodlverbinsert [strip]: only build `yodlverbinsert'\n" " yodlstriproff: only build `yodlstriproff\n" " yodl2whatever: only build `yodl2whatever\n" " macros: (re)build the standard yodl macros\n" " run `build programs' first, run `build macros'\n" " before any of the following document-creating " " commands\n" " man [path]: (re)build the man-pages, optionally specify: " "path\n" " manual [path]: (re)build the manual, optionally specify: path\n" " html [path]: (re)build the html version of the manual\n" " (after 'manual' or 'macros')\n" " latex [path]: (re)build the latex version of the manual\n" " (after 'manual' or 'macros')\n" " install programs WHERE: install the programs under WHERE\n" " install yodl WHERE: install yodl under WHERE\n" " install yodlpost WHERE: install yodlpost under WHERE\n" " install yodlverbinsert WHERE: install yodlverbinsert under WHERE\n" " install yodlstriproff WHERE: install yodlstriproff under WHERE\n" " install yodl2whatever WHERE: install yodl2whatever c.s. under " "WHERE\n" " install macros WHERE: install the macros under WHERE\n" " install man WHERE: install the man-pages under WHERE\n" " install mandeb WHERE: install the man-pages for Debian\n" " under WHERE\n" " install manual WHERE: install the manual under WHERE\n" " install docs WHERE: install additional docs under " "WHERE\n" " gitlab - prepare gitlab's web-pages update\n" " (internal use only)\n" "`strip': the program(s) will be stripped,\n" "`path': yodl is located in $PATH (otherwise just-built programs " "are used).\n" ); exit(0); } yodl-4.04.00/builtin/0000755000175000017500000000000014066072154013265 5ustar frankfrankyodl-4.04.00/builtin/builtinsetaction.c0000644000175000017500000000031414066072154017007 0ustar frankfrank#include "builtin.ih" void (*builtin_setAction(Builtin *builtin, void (*action)(void)))(void) { void (*old_action)(void) = builtin->d_action; builtin->d_action = action; return old_action; } yodl-4.04.00/builtin/builtin.ih0000644000175000017500000000011414066072154015251 0ustar frankfrank#include "builtin.h" #include "../string/string.h" #include "../new/new.h" yodl-4.04.00/builtin/builtincopy.c0000644000175000017500000000033314066072154015771 0ustar frankfrank#include "builtin.ih" Builtin *builtin_copy(Builtin const *builtin) { Builtin *copy = new_memory(1, sizeof(Builtin)); copy->d_name = builtin->d_name; copy->d_action = builtin->d_action; return copy; } yodl-4.04.00/builtin/builtininsert.c0000644000175000017500000000076514066072154016334 0ustar frankfrank#include "builtin.ih" void builtin_insert(HashMap *symtab, Builtin *builtin) { while (builtin->d_name) { hashmap_insert ( symtab, hashitem_new_destructor(BUILTIN, builtin->d_name, builtin, root_nop) ); builtin++; } } /* yodl/pramble -> builtin_insert. The table is builtin_array, defined in (from here:) ../../tmp/wip/builtins.def. That table merely associates builtin function names with builtin functions. */ yodl-4.04.00/builtin/builtin.h0000644000175000017500000000076214066072154015111 0ustar frankfrank#ifndef INCLUDED_BUILTIN_H_ #define INCLUDED_BUILTIN_H_ #include "../hashmap/hashmap.h" typedef struct { char const *d_name; void (*d_action)(void); } Builtin; Builtin *builtin_copy(Builtin const *builtin); void builtin_insert(HashMap *symtab, Builtin *builtin); char const *builtin_name(Builtin const *builtin); void (*builtin_setAction(Builtin *builtin, void (*)(void)))(void); static inline void builtin_call(Builtin *builtin) { (*builtin->d_action)(); } #endif yodl-4.04.00/builtin.yo0000644000175000017500000001467714066072154013655 0ustar frankfrankFunctions: `E' indicates that the argument is evaluated and then I: inserted into the input media, O: inserted into the output media, P: printed verb( - I ATEXIT - at the end of the input, the argument is pushed onto the input for evaluation - O CHAR - the character is inserted into the current output media - O COUNTERVALUE - the countervalue is inserted into the output media E P ERROR - input is parsed by eval, and then printed E I EVAL - the argument is parsed and its output is collected in a string, which is then inserted into the input. - O FILENAME - the current filename is inserted into the output media. E P FPUTS - the 1st argument is parsed by eval and then appended to the file given as its second arg. - I IFBUILTIN - the argument matching the condition is pushed onto the input. All other if-builtins are handled similarly - I INCLUDEFILE - the parsing of the current file is suspended, and parsing switches to the new file. Once completed, parsing continues at the suspended file. Begin and End of file are separators. INCLUDELIT = INCLUDENOEXPAND - O NOEXPAND - the argument is scanned, and only CHAR() calls are interpreted. The produced characters are inserted into the output media. - O NOEXPANDINCLUDE - combination of NOEXPAND() and INCLUDEFILE(): the file is inserted into the output media, honoring CHAR() calls. If that's not appropriate push an empty character table before doing NOEXPANDINCLUDE() - O NOEXPANDPATHINCLUDE - like NOEXPANDINCLUDE(), but the Yodl insert path is followed to find the indicated file. - O NOTRANS - the currently active character table is suppressed, and the argument is inserted literally into the output media. - O OUTBASE - the basename (filename) of the currently parsed input file is inserted into the output stream. Other out* builtins are handled similarly. - I PIPETHROUGH - the output of a process is inserted into the input media. - I SYMBOLVALUE - the value of the symbol is inserted into the input media. E P TYPEOUT - the argument is evaluated and sent to the standard error stream. E O UPPERCASE - the argument is evaluated, then transformed to uppercase and subsequently inserted into the output media. - O USECOUNTER - the incremented countervalue is inserted into the output media. E P WARNING like TYPEOUT. WRITEOUT = FPUTS ) Functions reinserting information into the input media: verb( - I ATEXIT - at the end of the input, the argument is pushed onto the input for evaluation E I EVAL - the argument is parsed and its output is collected in a string, which is then inserted into the input. - I IFBUILTIN - the argument matching the condition is pushed onto the input. All other if-builtins are handled similarly - I INCLUDEFILE - the parsing of the current file is suspended, and parsing switches to the new file. Once completed, parsing continues at the suspended file. Begin and End of file are separators. - I PIPETHROUGH - the output of a process is inserted into the input media. - I SYMBOLVALUE - the value of the symbol is inserted into the input media. ) Functions directly inserting into the output media: verb( - O CHAR - the character is inserted into the current output media - O COUNTERVALUE - the countervalue is inserted into the output media - O FILENAME - the current filename is inserted into the output media. - O NOEXPAND - the argument is scanned, and only CHAR() calls are interpreted. The produced characters are inserted into the output media. - O NOEXPANDINCLUDE - combination of NOEXPAND() and INCLUDEFILE(): the file is inserted into the output media, honoring CHAR() calls. If that's not appropriate push an empty character table before doing NOEXPANDINCLUDE() - O NOEXPANDPATHINCLUDE - like NOEXPANDINCLUDE(), but the Yodl insert path is followed to find the indicated file. - O NOTRANS - the currently active character table is suppressed, and the argument is inserted literally into the output media. - O OUTBASE - the basename (filename) of the currently parsed input file is inserted into the output stream. Other out* builtins are handled similarly. E O UPPERCASE - the argument is evaluated, then transformed to uppercase and subsequently inserted into the output media. - O USECOUNTER - the incremented countervalue is inserted into the output media. ) When information is inserted into the output media, the output media selector may target the output stream or a string: which one will be used depends on the builtin: E.g, tt(EVAL()) (and tt(parser_eval()), which is called by it) writes to a string, the default output target is a stream. Independently of the output target, character tables may be used. Chartables may be suppressed, by tt(CHAR()) and tt(NOTRANS()), or simply not required. Depending on the situation, the input selector will use or not use character tables. As an example: assume the following macros are defined: verb( A() -> NOTRANS(<) B() -> NOTRANS(>) C() -> NOTRANS(/>) D() -> A()strong+B()hi+A()strong+C() ) the call tt(D()) will be handled as follows (each line represents a string-push ending in EOF which is interpreted as a separator: verb( D() -> A()strong+B()hi+A()strong+C() NOTRANS(<)strong+B()hi+A()strong+C() output: < strong+B()hi+A()strong+C() output: strong B()hi+A()strong+C() NOTRANS(>)hi+A()strong+C() output: > hi+A()strong+C() output: hi (etc) ) yodl-4.04.00/changelog0000644000175000017500000011320214755347150013476 0ustar frankfrankyodl (4.04.00) * Requires gcc >= 15.0.1: uses the new C standard defining type bool. * Removed -q from yodl's build script * Converted chartables using extented ascii characters to UTF-8 using iconv -f ISO-8859-15 -t UTF-8 < input.txt > output.txt * The yodlconverters(1) man-page is now yodlconverters(7) * The 'build' script now contains '/ #define ECHO_COMPILE'. Uncomment it to show the full gcc commands. By default only the names of the compiled files are shown. -- Frank B. Brokken Tue, 18 Feb 2025 19:38:28 +0100 yodl (4.03.02) * Removed superfluous .tar.gz extensions from the man-pages -- Frank B. Brokken Fri, 22 Jan 2021 13:36:57 +0100 yodl (4.03.01) * Fixed many typos (thanks to the list provided by https://fossies.org/linux/misc/yodl-4.02.02.tar.bz2/codespell.html (Jens.Schleusener)) -- Frank B. Brokken Fri, 22 Jan 2021 12:56:03 +0100 yodl (4.03.00) * New option -V for yodlverbinsert avoids embedding its output in a verb( ... ) macro. -- Frank B. Brokken Sat, 26 Sep 2020 10:01:54 +0200 yodl (4.02.02) * Yodlverbinsert's -N option appends verb('s closing ) to the last line of the verbatim text, preventing an extra blank line at the end. The description of the verb(...) macro in yodlmacros(7) advises on how to prevent extra blank lines when using the verb(...) macros in Yodl text. -- Frank B. Brokken Mon, 18 Nov 2019 09:50:13 +0100 yodl (4.02.01) * Migrated from Github to Gitlab -- Frank B. Brokken Mon, 25 Jun 2018 11:00:29 +0200 yodl (4.02.00) * End-of-line comment is now available as the triplet \//. Following \// all subsequent characters on its line as well as initial blanks on the next line are skipped. * Added Yodl builtin commands SUBSTR and STRLEN * Added the evalsymbol() macro, assigning a value to a symbol using EVAL. * Added the nbsp() macro, writing a non-breaking space character * Added the manttquoted() macro, optionally embedding arguments of tt macros in quotes. * Redesigned yodlverbinsert, which now also concatenates multiple identically marked sections. * Added scripts/newmacros primarily used when designing multiple new .raw macro definition files. * Added the macro `tbl' (and support macros `tr, tc, tnc, ta, tnac, tao,' `tline', and `twrap') as alternative to `table' (and support macros). The `tbl' macro extends `table', and simplifies defining tables. * SETCOUNTER and ADDTOCOUNTER's second arguments may be additive expressions (not containing blanks spaces). -- Frank B. Brokken Thu, 28 Dec 2017 11:10:26 +0100 yodl (4.01.00) * Fixed flaw in handling the LaTex chartable's SUBST(--) definition and occurrences of -- in, e.g., letteradmin.raw. * The LaTeX specific way of handling two dashes is available, outside of NOEXPAND environments as used by, e.g., the verb() and tt() macros, is available through the new `dashes()' macro. * New macros ttbegin() and ttend() can be used to fine-tune how text set in teletype font is handled, in particular in LaTeX conversions. -- Frank B. Brokken Thu, 08 Jun 2017 08:56:15 +0200 yodl (4.00.00) * Added builtin functions PUSHSUBST and POPSUBST, as well as the (internally used) builtin function XXSUBST. * Removed old macros and builtin commands, obsoleted since Yodl 2.00.00. (see also the manual section `what's new in 4.00.00'). * The predefined macro `verb(...)' now starts with PUSHSUBST(0) and ends with POPSUBST: SUBST definitions are not interpreted anymore inside a 'verb()' macro (SUBST definitions were already ignored in files inserted by the NOEXAPAND(PATH)INCLUDE builtin commands). * The original definition of the `verb(...)' macro remains available in the new predefined macro `verborg(...)'. * The contents of the previously defined ./src directory was moved to Yodl's base directory. * The formerly used ./src directory's contents are now immediately at yodl's base directory; ./src has been removed. * The contents of the formerly used ./yo subdirectory of ./manual are now in ./manual; ./yo has been removed. * All README files are now at Yodl's base directory. * In LaTeX conversions the -- sequence is now defined in a SUBST definition in macros/yodl/chartables/latex.tables.yo as SUBST(--)(+NOTRANS(-{}-{})) due to which text like `operator--()' now clearly shows the two minus characters (single minus chars are OK, and cannot be translated, because LaTeX sometimes uses them in expressions like `\cline{1-4}'). * Documentation was updated. -- Frank B. Brokken Sat, 03 Jun 2017 17:40:21 +0200 yodl (3.10.00) * Memory leaks reported by Hanno B\"ock on Feb 4, 2016, were fixed in this release. -- Frank B. Brokken Mon, 29 May 2017 08:22:56 +0200 yodl (3.09.00) * Redefined some elements in the standard LaTeX translation table: no-argument macros like '|' = "\\textbar" received an empty parameter box ("\\textbar{}") to avoid subsequent blanks being consumed by LaTex. Cf., https://tex.stackexchange.com/questions/31091/space-after-latex-commands * Added a new macro `tableatt' using the attributes specified at the last `attrib' macro call to set html-attributes for the html `' tag. -- Frank B. Brokken Tue, 23 May 2017 12:25:36 +0200 yodl (3.08.02) * Reorganized the yodl-manpage macro (macros/rawmacros/manpage.raw): man-pages can now be converted to roff, html, and plain text format. References to the todl manual page format in Yodl's user guide and man-pages were updated accordingly. * The reorganization also fixes a bug in the manpage html conversion, due to which manpages started with three document opening sections, and weren't properly terminated by markups. -- Frank B. Brokken Sun, 29 Jan 2017 13:27:26 +0100 yodl (3.08.01) * The multiple options handling bug emerged in another context (zsh documentation, reported by Axel Beckert). The option handling implementation required some additional fine-tuning: realized in this release. -- Frank B. Brokken Sat, 07 May 2016 20:59:50 +0530 yodl (3.08.00) * Fixed a bug in handling multiply options of identical types (e.g., -D, -D). The bug was hidden in args/argsmultiargs.c but sheer accidentally has never shown itself. Now fixed. * The usage info now also shows the std. copyright notice, writes its information to the std. output stream, and returns 0 to the operating system. * Fixed an XXfigurecounter increment occurring too early in the figure.raw macro. -- Frank B. Brokken Sat, 30 Apr 2016 18:22:23 +0530 yodl (3.07.01) * Hanno B\"ock reported an invalid memory read found by the address sanitizer (using -fsanitize=address). Fixed in this release. The address santizer also reported some memory leaks which are not nice, but their fix will probably take some more time. * The -l (--live-data) is no longer used. -l or --live-data specifications can still be specified, but are completely ignored. Starting with this version SYSTEM and PIPETHROUGH commands are unconditionally accepted (i.e., they are handled as if the previously defined option -l3 had been specified). * Added internal counter XXattribstacksize, and redefined the meaning of the attrib() macro. The attrib() macro now pushes attributes, and pops them when available at the next macro(s) supporting attrib. User-defined macros can call insertattrib() to insert the attribute on top of the attribute stack. * Added macro 'attribinsert()' inserting and popping the topmost element on the attribute stack. Nothing happens if the attribute stack is empty. * Added macro 'attribclear()' emptying the attribute stack. * Added macro verbinsert(1), calling yodlverbinsert with ARG1 passed to yodlverbinsert. * Several macros were considered deprecated for already a very long time: these macros are: endcenter, enddit, endeit, endit, endmenu, endtable enumerate, htmlbodyopt, itemize, menu, mit, node startcenter, startdit, starteit, startit, startmenu, and starttable. Their documentation has been removed from the yodlmacros(7) man-page, and they will be removed from the set of predefined macros at the next minor version upgrade. * The XXfigurecounter counter was initialized to 1 to have the number of the next figure available when calling figure(), to be used in, e.g., an 'alt="..."' attribute. * The yodlverbinsert(1) program now supports nesting of labeled sections. See the yodlverbinsert man-page. -- Frank B. Brokken Fri, 22 Apr 2016 14:54:04 +0530 yodl (3.06.00) * The title, author, date and affiliation elements in html document headers have received CSS id selectors (respectively 'title', 'author', 'date' and 'affiliation') which can be used to tune the way these elements are displayed. * In html conversions, to follow xhtml requirements, elements without a closing element (like
) are provided with an end-slash (e.g.,
). * Fixed the plainhtml macro: it now generates html text. * Converted to gitlab -- Frank B. Brokken Mon, 07 Dec 2015 22:21:36 +0100 yodl (3.05.01) * The chartables defined in latex.tables.yo now surround <, > and * characters by $s (e.g., $<$), preventing LaTeX from processing them in a special way (e.g., forming ligatures like one character for >>). * Added the file `required' listing the non-standard software that is required to build yodl and its user guide -- Frank B. Brokken Tue, 19 May 2015 19:28:26 +0200 yodl (3.05.00) * Html conversion by default uses html5, and generates html5 type html pages, several macros were adapted accordingly. * New macros (use `man yodlmacros' for their definitions): attrib htmlheadfile htmlstyle nohtmlfive nohtmlimgstyle sethtmlmetacharset * Modified macros: @counters @symbols center dit endcenter figure htmlbodyopt - deprecated htmlheadopt htmlstylesheet itdesc notocclearpage sc startcenter strong tt * the `build' script no longer maintains 'stamp' files: build macros, build manual and build man commands result in rerunning the command. All macro-constructions, including the creation of the macro-list, are now concentrated in 'build macros'. -- Frank B. Brokken Sat, 03 Jan 2015 22:33:55 +0100 yodl (3.04.00) * The redef() and redefinemacro() descriptions missed the name of the macro to be redefined: they require 3 instead of 2 args. * The yodlverbinsert program is now C++, and supports -a: process all lines and -n: prefix lines by numbers. Yodlverbinsert ignores initial and trailing blank lines. * Removed some compiler warnings, among which a strange statement in parser/pbeginnested.cc, where pp->d_insert was assigned a value within the condition of a conditional assignment. See the difference between the git-commit at Tue Sep 23 09:45:29 2014 +0200 and the next commit. -- Frank B. Brokken Wed, 24 Sep 2014 20:01:42 +0200 yodl (3.03.0) * Reorganized the macro-construction because of a persistent xlatin1.tex bug (see 3.02.1's changelog entry). The macros for man- and manual-pages are now constructed under tmp/wip, so they can't conflict anymore with the distribution macros which are constructed under tmp/install. The xlatin1.bug was observed intermittently, making its fix kind of difficult. * Added the file icmake/README explaining the steps/elements of the macro construction process. -- Frank B. Brokken Wed, 09 Oct 2013 12:47:12 +0200 yodl (3.02.1) * Repaired recurrent bug, fixed since yodl 2.14.4, about missing local-path location specification in scripts/createmacros causing xlatin1.tex to be included as ./xlatin1.tex. * Modified Yodl's build script's 'build sf' mode yodl (3.02.0) * Repaired failing `return to parent directory' after INCLUDEFILE bug, intermittently observed th txt-files. -- Frank B. Brokken Tue, 21 May 2013 09:39:58 +0200 yodl (3.01.0) * Re-implemented l_chdir in src/lexer/lchdir.c and new_getcwd in src/new/getcwd.c following compilation problems on GNU-hurd, as reported by Svante Signell * Yodl's build script now honors CFLAGS en LDFLAGS environment variables. * Repaired some inconsistencies in the INSTALL.txt file * The yodl2whatever script sets the path to the yodl binaries as configured unless the YODL_BIN environment variable has been set, in which case that environment variable' value is used as the path prefix when calling yodl programs. * Added 'build sf' to create the files to be uploaded to sourceforge. This function is for Internal Use Only * Renamed the 'sourceforge' directory to 'sf' -- Frank B. Brokken Sun, 10 Mar 2013 12:37:45 +0100 yodl (3.00.0) * When including files the included file's directory path becomes the cwd. This results in file-inclusion handling like C's #include directive. Previously the cwd remained fixed, causing problems if the same files are included for different documents where these included files themselves also include files. The -L (--legacy-include) option can be specified to prevent the change of working directory (and thus to revert to the original handling of includefile specifications. * The includefile macro no longer defines a label equal to its argument just before the file is included. Instead the macro lincludefile can be used, which provides more control of the label that is defined, if required. The added benefit is a *much* smaller .idx file, resulting in faster processing. * The recognition of filenames no longer favors files without extensions above files having the .yo extension. Files to be included are supposed to have a .yo (=DEFAULT_EXT) extension (using (l)includefile), but the extension does not have to be explicitly specified. Only if no file having the DEFAULT_EXT is found the file is attempted as specified. * Single-line functions whose addresses are not required are now inline -- Frank B. Brokken Sun, 07 Nov 2010 17:18:05 +0100 yodl (2.15.2) * Added macro cellsline to set multiple horizontal lines in one table row. * Bug fix in yodlverbinsert (confused markers provided as command-line argument with markers to which additional characters were appended appearing in scanned files). -- Frank B. Brokken Fri, 12 Mar 2010 10:50:13 +0100 yodl (2.15.1) * Added a chartable translation to macros/yodl/chartables/man.tables.yo: in man-pages the - character is by default interpreted as hyphen, not as minus. The chartable now defines '-' = "\\-" turning - characters into man-page minus characters. Forced hyphens can be written as manpagecommand(\CHAR(40)hy) * Added scripts/hrefnotmpinstall (href no tmp/install) removing tmp/install hyperlinks from html-version of the manual: given yodl.html, the manual pages now link locally to each other. -- Frank B. Brokken Mon, 27 Jul 2009 11:32:35 +0200 yodl (2.15.0) * Detected a bug! Lines starting with + characters (like +NOTRANS, but also \'e since those constructions are substituted by +NOTRANS... sequences) were not properly converted: the + appeared in the output. Caused by p_handledefaultnewline, separating the + from its trailing chars. Repaired by testing for an initial +, followed by adding what's trailing if found. * The yodlbuiltin man-page (not appearing in the distribution) is now added. * The subscript and superscript macro descriptions were improved. -- Frank B. Brokken Thu, 16 Jul 2009 22:38:57 +0200 yodl (2.14.4) * Missing local-path location specification in scripts/createmacros caused xlatin1.tex to be included as ./xlatin1.tex. Now repaired. * Yodl2whatever's --intermediate option didn't accept a (file) argument. Now repaired. -- Frank B. Brokken Wed, 13 May 2009 11:38:42 +0200 yodl (2.14.3) * Tony Mancill and George Danchev discovered a flaw in the build script: it used previously installed macro files. Now repaired: Installation should run fine on a system not yet supporting Yodl. -- Frank B. Brokken Mon, 27 Apr 2009 20:56:33 +0200 yodl (2.14.2) * Yodl2whatever uses `eval' to call yodl. Without this --define options are not properly recognized * Build script completely rewritten * Added striproff as the script `yodlstriproff', and renamed the manpage accordingly -- Frank B. Brokken Wed, 15 Apr 2009 19:58:05 +0200 yodl (2.14.1) * Build script allows separate construction of program, man pages and manual, using the standard installation path or the binaries constructed from the source package -- Frank B. Brokken Sat, 21 Mar 2009 09:08:58 +0100 yodl (2.14.0) * Character tables now accept hexadecimal and octal constants in their double quoted character redefinition strings. * Double and single quotes appearing in man-page texts are now handled properly: the double quote is set as \(dq\& and the single quote as \(dq\& * All Yodl manual pages refer to all remaining Yodl manual pages * Several warnings generated by cppcheck on `src/verbinsert.c' were fixed. One remains, which turns out to be a cppcheck false positive. -- Frank B. Brokken Sun, 15 Mar 2009 13:11:08 +0100 yodl (2.13.2) * yodl2whatever did not remove intermediate files when no post processing was required. Now repaired. -- Frank B. Brokken Fri, 24 Oct 2008 15:04:10 +0200 yodl (2.13.1) * yodl2whatever no longer supports the --unique-output and --path option. Instead, communication between yodl and yodlpost is handled through temporary files created by mktemp(1). The temporary files will be removed following the yodl conversion. The yodl2whatever script offers the --intermediate=filename option to allow users to keep the intermediate files. yodl (2.12.2) * TEMPORARY MODIFICATION: manual construction will not rebuild the yodl.pdf file to circumvent a bug in ps2pdf on some architectures. The manual/pdf directory will not be cleaned by `build clean'. To force the construction of the yodl.pdf file call `build manual pdf' in the ./manual directory immediately following the call of `build manual'. yodl (2.12.1) * Introducing a subversion number: major.minor.subversion. * yodlpost's `#define BLOCK_POSTQUEUE' is replaced by an `-l ' option, by default using `-l 1000', allowing large(r) lines in index-files to be processed. The old BLOCK_POSTQUEUE value was set at 500. * All symbols starting with _ were renamed to symbols from which the _ was removed. * Repaired the [nl]subsubsect() macro that did not typeset a proper section heading in html files. It does so now. yodl (2.11) * repaired src/yodl/gramuppercase.c src/yodl/grampushmacro.c src/yodl/gramdefinemacro.c in which addresses of size_t variables were passed to functions expecting addresses of ints comparable modifications to yodl/src/yodlpost/handlexmltocentry.c yodl/src/yodlpost/handlehtmltocentry.c yodl/src/yodlpost/handlexmltoc.c yodl/src/yodlpost/handletxttocentry.c * The hm_pjw function in hashmap/hmpjw.c uses a different procedure to determine the most significant nibble, producing the same hashvalues as the previous version. -- Frank B. Brokken Mon, 12 Mar 2007 20:28:34 +0100 yodl (2.10) * repaired scores of compilation warnings in the sources detected by Daniel Richard G. while compiling for the amd64. * Changed the organization of the Stack: it now consists of unions, allowing for cast-less storage and retrieval of various types. With it comes a slight reorganization of the code: the Media struct, till now defined in the lexer.ih file has its struct defined separately in src/mediastruct in order to allow Stack access to it. See src/HIERARCHY for an overview. * Moved l_media functions from lexer to new class Media, required for the new Stack organization * The src/build script contains #defines allowing extensive compilation tests (as suggested by Daniel Richard G.) as well as compilations for gprof, the GNU profiler. Running the profiler after building the yodl manual shows that currently no clear speedup-targets exist. * The appendix() macro now creates html chapters starting at 1, as suggested by Karel Kubat. * The yodl2whatever script now handles versions of the getopt(1) program that can't handle long options. They still can't be handled, but the script now doesn't break. Long options defined for the script itself are still recognized (--no-warnings, --tmp, --unique-output). * Some systems (Notably: Mac OSX) apparently don't support the getline() function, used in the verbinsert program. Verbinsert now contains its own version: `y_getline()' * Added the euro() macro setting the euro symbol. * Removed the ./debian subdirectory which does not belong to the Yodl package itself. The Debian packaging files can be obtained from, e.g., https://svn.openfmi.net/debian-addons-bg/yodl * Changed unsigned into size_t where appropriate. yodl (2.04a) * repaired definition of lchapter.raw, which put the label, rather than the chapter's title in the document's contents. -- Frank B. Brokken Tue, 05 Sep 2006 16:32:08 +0200 yodl (2.04) From patches offered by Colin Watson: * gcc's printf format checking features is used where available. * Memory properly freed on error path in construct_tocentry. * Reuse of va_list in string_vformat is fixed; the correct way to do this is to va_copy it first, although this requires some care regarding portability. Additional modification: * The generic `yodl2whatever' has been given two more options to allow users to prevent file-collisions when the same user calls yodl to process a document while another invocation of yodl by that user is still running: --tmp=: By default, the temporary file is written in the /tmp directory. Specify an alternate directory using --tmp = path-to-alternate-tmp-directory --unique-output: By default, yodl will use a temporary output file that is rewritten at each new yodl-invocation. If that's not what you want, specify the --unique-output flag, which will use the process-id as part of the temporary output file. This file is NOT removed when the yodl-conversion fails. The yodl2whatever man-page is modified accordingly. yodl (2.03) * Added the program `yodlverbinsert', placing the contents of a `labeled section' from some text file (usually a C or C++ source) in a verb() macro, writing the generated verb() command to the standard output stream. Updated the user guide accordingly and added a manual page: `man yodlverbinsert' gives details and examples. yodl (2.02) unstable; urgency=low * Following suggestions by Karel Kubat, several data files were modified: global variables are initialized to prevent compilation problems. Also, Karel's contrib/build.pl script was modified by Karel. I changed the initialization of the $config{TOPLEVEL_VERSION} so that it first tries to read the current toplevel version from the src/config.h file, to promote version synchronization. Some minor changes to macro files were made, and several superfluous files were removed from the distribution. Adapted several debian-files, updating the standards and debhelper versions, removed debian/ from the .orig archive and added an upstream changelog file, keeping this file for future Debian changes only. The initial version of the upstream-changelog file is this file: Yodl's debian/changelog until (including) version 2.02. Disregard the comment in version 2.01.03 about plans to discontinue icmake. Icmake's build script will be kept and will remain to be yodl's main build-tool. Many functions used in the src/build script have been rebuilt, resulting in the removal of many system-function calls and thus increasing its speed of execution. Compilation warnings in src/subst/substaction.c and src/process/pparent.c were solved. -- Frank B. Brokken Wed, 23 Aug 2006 10:42:12 +0200 yodl (2.01.03) unstable; urgency=low * The XXtocclearpage symbol, used by the tocclearpage() and notocclearpage() macros, was erroneously defined for the HTML converter instead of the LaTeX converter. Also, the macro tocclearpage() did not assign a non-empty value to the XXtocclearpage macro, so the macro had no effect. Added the file yodl/debian/compat Following suggestions by Karel Kubat, macros/rawmacros/footnote.raw was modified for HTML-usage. With the HTML converter a non-breakable space is inserted before the (parenthesized) footnote-text. A `contrib' directory is created below /usr/share/doc/yodl. Currently it contains a perl-script `build.pl' that may be used to create the yodl-package. It is not maintained by me (Frank), but was supplied by Karel Kubat. Note that it does not update the program version, but uses a hard-coded version as set by the script. Karel (karel@e-tunity.com) should be contacted for any questions related to this script. Furthermore, the dependency on `icmake' will probably be removed from Yodl in the near future: I'm planning to standardize the package building using a series of generic shell-scripts, which may render the build.pl script obsolete as well. The build-script will now install in yodl/yodl/debian/yodl instead of yodl/yodl/debian/tmp -- Frank B. Brokken Mon, 13 Mar 2006 20:53:23 +0100 yodl (2.01.02) unstable; urgency=low * Changed the lsect(), lsubsect(), lsubsubsect(), sect(), subsect() and subsubsect() macros (for html and xml use) since the l...() macros set the lastnumber value too late. New XX...sect[Counter].raw files were defined to factorize common parts. The l...sect() macros now first set the next section number, and then define a label. Finally the section code is inserted. The ...sect() macros set the counter, followed by the section's code. Furthermore, added n-tilde and N-tilde definitions to chartables. Note the change of my e-mail address: it's now @rug.nl, instead of @rc.rug.nl -- Frank B. Brokken Fri, 29 Jul 2005 14:38:57 +0200 yodl (2.01.01) unstable; urgency=low * Ai, another leftover from the previous bug-repair: if the suspected macro call was already part of the set if supected macros calls the already read open parentheses wasn't pushed back. It's now repaired. Also, followed Karel's suggestion to do system("rm -rf bin/* libyodl.a */o/*"); in yodl/src/build, rather than just -f, in order to removed any CVS directories that might be there as well. Since this part should not contain any useful info for CVS it shouldn't matter that CVS is removed. -- Frank B. Brokken Thu, 20 Jan 2005 08:23:11 +0100 yodl (2.01.00) unstable; urgency=low * Forced subdir creation at manual construction (in yodl/manual: html/ latex/ pdf/ ps/ txt/), as suggested by Karel Kubat Repaired a bug in the man-page construction in yodlpost: handle_ignore_ws didn't ignore multiple white lines. Repaired by adding appropriate test Repaired a bug in yodl itself: -w flag eats initial openparen of parenthesized list. Not specifying -w doesn't. Repaired by pushing back an open-parenthesis after recognizing a suspected user macro which doesn't turn out to be a user macro in src/parser/pnousermacro.c. See the comments in that source for details. -- Frank B. Brokken Tue, 14 Dec 2004 20:50:53 +0100 yodl (2.00.06) unstable; urgency=low * Repaired dangling links of yodl2XXX.1.gz manpages -- Frank B. Brokken Sat, 6 Nov 2004 14:53:37 +0100 yodl (2.00.05) unstable; urgency=low * Minor repairs of txt-conversion em() and bf() macros -- Frank B. Brokken Wed, 13 Oct 2004 16:35:16 +0200 yodl (2.00.04) unstable; urgency=low * Added .../macros/rawmacros/xxsetmandocumentheader.raw, provided by Karel Kubat allowing man-conversions for article, books, report, etc; Added new counter XXused to indicate that a list has been used in XML mode, adapted related macros accordingly; Repaired several inconsistencies in enumeration()/itemization(), following Karel's hints; Repaired references to xml-skeletons, which were consistently expected in /usr/share/yodl rather than in /usr/share/yodl/xml/ -- Frank B. Brokken Wed, 29 Sep 2004 23:15:06 +0200 yodl (2.00.03) unstable; urgency=low * yodlpost/handleignorews.cc: called file_copy2offset(src, dest, offset) rather than file_copy2offset(dest, src, offset). Happened only here. Added some comment to file_copy2offset() itself, and repaired itemization() and enumeration() macros. Added minor modifications to macros/build and manual/yo/manual.yo. -- Frank B. Brokken Mon, 27 Sep 2004 21:06:12 +0200 yodl (2.00.02) unstable; urgency=low * - Added the standard htmlstylesheet() and htmlheadopt() macros to be used in the html converter to add, respectively, a stylesheet or any option into the head of html files. - Modified yodl2whatever to deduct the default output filename from the last specified .yo file -- Frank B. Brokken Fri, 24 Sep 2004 12:53:20 +0200 yodl (2.00.01) unstable; urgency=low * eit() in the text-converter did not properly handle the XXenumcounter -- Frank B. Brokken Tue, 21 Sep 2004 15:09:58 +0200 yodl (2.00) unstable; urgency=low * Complete rewrite. See the manual for the modifications. Old yodl-sources will usually require minor modifications -- Frank B. Brokken Tue, 31 Aug 2004 11:37:28 +0200 yodl (1.31.18-7) unstable; urgency=low * In the lexer, if we've stepped back over all pre-pushed input, ensure that future pushes reallocate the buffer rather than underrunning (closes: #203599). * Check policy up to 3.5.6: no changes required. Work is needed on compiler options for later versions. -- Colin Watson Mon, 29 Sep 2003 08:23:03 +0100 yodl (1.31.18-6) unstable; urgency=low * Simply remove root-owned out/dummy.dep files in the clean target rather than trying to chown them to $LOGNAME, which doesn't work under pbuilder (closes: #189620). * Use '%option noyywrap' rather than the messy local definition of yywrap(), which doesn't build properly with current flex. * Remove src/yodl2html-post/parser.c on clean to avoid bizarre build failures (thanks, Daniel Schepler). -- Colin Watson Fri, 2 May 2003 09:21:08 +0100 yodl (1.31.18-5) unstable; urgency=low * Reinstate URL in control file, as it's useful for people browsing http://packages.debian.org/ (thanks, Oohara Yuuma). * Remove some cruft from debian/rules. * Use dh_installinfo rather than the incorrect code in debian/postinst and debian/prerm (which looked at /usr/info!). -- Colin Watson Mon, 11 Nov 2002 20:34:34 +0000 yodl (1.31.18-4) unstable; urgency=low * Remove URL/authors from control file (should just be in copyright file). -- Colin Watson Tue, 16 Jul 2002 00:37:11 +0100 yodl (1.31.18-3) unstable; urgency=low * Make startit() and endit() correctly generate
    rather than
    (thanks, Frank B. Brokken). * Update Frank's e-mail address. -- Colin Watson Sun, 6 Jan 2002 15:25:22 +0000 yodl (1.31.18-2) unstable; urgency=low * New maintainer (closes: #111032). * Reintroducing package to unstable because five packages build-depend on it. When those packages migrate to a different documentation system, yodl may safely be removed. * Unexport NAME in debian/rules; the Hurd sets it, which confuses stepmake (closes: #111019, #111085). * ' generates \&' rather than \' for groff -man output, as \' is an acute accent, not an apostrophe (thanks, Matt Kraai; closes: #51258). * Recommend python rather than python1.5. yodl seems to work fine with newer versions of python, and python1.5 wouldn't have worked because it doesn't provide /usr/bin/python. * Add build-dependencies. * Policy version 3.2.1. -- Colin Watson Thu, 22 Nov 2001 20:09:33 +0000 yodl (1.31.18-1.1) unstable; urgency=low * Non Maintainer Upload. * Package is orphaned, setting Maintainer to Debian QA Group. * Apply patch from James Troup to fix build issues. (Closes: #119172) * Fix Python Recommends. (Closes: #119204) * Fix all lintian errors. (Fix changelog, strip binaries, remove INSTALL.txt) * Remove dh_suidregister from debian/rules. -- Steve Kowalik Mon, 12 Nov 2001 12:10:11 +1100 yodl (1.31.18-1) unstable; urgency=low * New maintainer * New upstream version -- Scott Hanson Sat, 4 Dec 1999 10:56:51 +0100 yodl (1.31.16-1) unstable; urgency=low * New upstream release. * Partially upgraded to standards version 3.0.1: - Updated copyright to point to /usr/share/common-licenses - First step towards FHS-compliance: Man and info pages are now installed under /usr/share. -- Anthony Fok Wed, 25 Aug 1999 02:41:38 -0600 yodl (1.31.11-1) unstable; urgency=low * New upstream release. * Re-added Yodl info page and added doc-base support. -- Anthony Fok Wed, 17 Mar 1999 00:47:31 -0700 yodl (1.31.10-1) unstable; urgency=low * New upstream release. * [debian/control]: Updated to Standards-Version: 2.5.0.0 * [debian/copyright]: Updated the address to the upstream FTP site. * Various minor clean-ups. -- Anthony Fok Sat, 13 Feb 1999 14:09:47 -0700 yodl (1.31.7-1) frozen unstable; urgency=low * New upstream release, mostly bugfixes. * Tweaked debian/rules aclocal.m4 (hence configure) to make sure that yodl is compiled with optimization "-O2" turned on. * s/-mgs/-ms/g in config.make.in and yodlconverters.yo.in because Debian's groff only has -ms, not -mgs. * [debian/control]: Recommends: groff. -- Anthony Fok Thu, 12 Nov 1998 03:04:58 -0700 yodl (1.31.6-1) unstable; urgency=low * [Documentation/GNUmakefile]: Removed "texinfo" that was added to "default:" in Debian's yodl_1.31.2-1 because the NEWS file says "don't make texinfo by default" in Yodl 1.31.4, and otherwise the build process fails, most likely my fault. :-) * [debian/rules]: Now, in the "clean:" target, runs either "find . -user root | xargs -r chown $$SUDO_USER.$$SUDO_GID" or "find . -user root | xargs -r chown $$LOGNAME" to deal with all those root-owned "out/*" files generated during a "sudo debian/rules clean" run. Thanks to Roman Hodek for reporting a similar problem with the lilypond package. :-) * Removed postinst and prerm and adjusted debian/GNUmakefile accordingly, as Yodl's info files are not built or installed for this release. * [debian/control]: Oops! Forgot to add dependencies! :-) Added "Depends: ${shlibs:Depends}" and "Recommends: python-base (>= 1.5.1)". -- Anthony Fok Sat, 10 Oct 1998 14:47:05 -0600 yodl (1.31.2-1) unstable; urgency=low * New upstream release. * Applied patch 1.31.2.jbr1: - src/yodl/grampipethrough.c: A popen _must_ be closed with a pclose _not_ a fclose. Pipes were never getting closed on Windows NT cygnus. * [Documentation/GNUmakefile]: Added "texinfo" to "default:", otherwise Documentation/out/yodl.info* would not be built and "make install" would complain. * [debian/postinst,debian/prerm]: Added calls to install-info. * [Documentation/links.yo]: The e-mail address and command for subscribing to the Yodl Mailing List was wrong. Fixed. -- Anthony Fok Tue, 8 Sep 1998 05:08:54 -0600 yodl (1.31.0-1) unstable; urgency=low * Initial upload to Debian's FTP server. * Minor revisions in config.make.in and debian/rules. * Note that this package was created by Yodl and lilypond's co-author, Jan Nieuwenhuizen . He did all the Debianization work for me. I am so amazed! All I am doing now is uploading it. Thanks a lot, Jan! :-) -- Anthony Fok Wed, 12 Aug 1998 12:52:18 -0600 yodl (1.30.0.pre9-2) unstable; urgency=low * support for 'make deb' target -- Jan Nieuwenhuizen Fri, 3 Jul 1998 17:53:37 +0200 yodl (1.30.0.pre9-1) unstable; urgency=low * Initial Release (copied from lilypond-0.1.71-1) -- Jan Nieuwenhuizen Fri, 3 Jul 1998 17:33:37 +0200 Local variables: mode: debian-changelog End: yodl-4.04.00/CHANGES0000644000175000017500000005054314066072154012621 0ustar frankfrank**** 2.00 Yodl version 2.00 is the result of a complete rebuild. It differs from the previous (1.31) version in the following aspects: - Added the following new commands: ADDTOSYMBOL - adds text to a symbol's value DEFINESYMBOLVALUE - defines a symbol and its initial value DELETECOUNTER - opposite from NEWCOUNTER: removes an existing IFBUILTIN - checks whether the argument is a builtin macro IFCOUNTER - checks whether the argument is a defined counter IFEQUAL - checks whether two numerical values are equal IFGREATER - checks whether the first numerical value exceeds the second numerical value IFMACRO - checks whether the argument is a defined macro IFSMALLER - checks whether the first numerical value is smaller than the second numerical value IFSYMBOL - checks whether the argument is a defined symbol PATHINCLUDELIT - includes literally a file found in the XXincludepath path POPCOUNTER - pops a previously pushed countervalue POPMACRO - pops a previously pushed macrodefinition POPSYMBOL - pops a previously pushed symbolvalue PUSHCOUNTER - pushes the current value of a counter, initilaizes the active counter to 0 PUSHCOUNTERVALUE - pushes the current value of a counter, initilaizes the active counter to any value PUSHMACRO - pushes the current definition of a macro, activates a local redefinition PUSHSYMBOL - pushes the current value of a symbol, initializing the active value to an empty string. SETSYMBOL - assigns a new value to a symbol SYMBOLVALUE - returns the value of a symbol as text. - The following commands are now obsolete: ENDDEF - DECWSLEVEL should be used INCLUDELIT - NOEXPANDINCLUDE should be used STARTDEF - INCWSLEVEL should be used NEWCOUNTER - DEFINECOUNTER should be used UNDEFINEMACRO - DELETEMACRO should be used WRITEOUT - FPUTS should be used - Several macros are now deprecated. Alternatives are suggested in the `man yodlmacros' manpage. A (possibly non-exhaustive) list of deprecated macros is: enddit() endeit() endit() endmenu() endtable() enumerate(list) itemize(list) menu(list) mit() node(previous)(this)(next)(up) startcenter() startdit() starteit() startit() startmenu() starttable(nColumns)(LaTexAllignment) - XXincludePath - Symbol installed by Yodl itself, but modifiable by the user: It holds the value of the current :-separated list of directories that are visited (sequentially) by the INCLUDEFILE command. XXincludePath may contain $HOME, which will be replaced by the user's home directory if the `home' or `HOME' environment variable is defined. It may also contain $STD_INCLUDE, which will be replaced by the compilation defined standard include path. The standard includepath may be overruled by either (in that order) the command line switch -I or the YODL_INCLUDE_PATH environment variable. By default, the current directory is added to the standard include path. When -I or YODL_INCLUDE_PATH is used, the current directory must be mentioned explicitly. The individual directories need not be terminated by a /-character. In the distributed .deb archive, the standard directory is defined as /usr/share/yodl (prefixed by the current working directory). - Initial blank lines in the generated document are suppressed by default. - Command line argument -D also allows the assignment of an initial value to a symbol - Command line argument -P is now -p, the previously defined -p argument is now -n (--max-nested-files), defining the maximum number of nested files yodl will process. - Command line argument -r (--max-replacements) defines the maximum number of macro and/or subst replacements accepted between consecutive characters read from file(s). - All assignents to counters (SETCOUNTER, ADDTOCOUNTER, etc.) not only accept numerical arguments, but also counter names. - Rewrote several awkwardly coded macros, using the new SYMBOL and COUNTER facilities - Added experimental, very limited, xml support to help me generating xml for the horrible `webplatform' of the university of Groningen. But at least Yodl now offers xml support as well. - Changed Yodl's name expansion. From `Yet Oneother Document Language' to: Your Own Document Language That's MUCH better, isn't it? - Upgraded most of the documentation accordingly - Separated yodl-macro files for the various formats. While this might not strictly be necessary, I feel this is better than using big fat generic macro definition files which are bloated with `whenhtml(), whentxt()' macros. I introduced a generic frame, mentioning the macros that must at least be defined by the individual formats. - Internally, the software was VASTLY reorganized. I feel that a lot of C-code doesn't benefit from approaches that have become quite natural for C++ programmers. I had the choice to either rewrite Yodl to a C++ program or to reprogram Yodl in the line of C++, but still using C. I opted for the latter. So, now the src/lib section contains `object-like' function families, like `countermap_...()' handling all counte-related operations, `textvector_...()', handling all text-vector like operations, and other. Other functions reveived minor modifications. E.g., xrealloc() now requires you to specify both the number of elements and the size of the elements. By doing so, it is sheer impossible to overlook the fact that you have to specify the size of the elements, thus preventing the allocation of chars when, e.g., ints are required. - An old inconvenience was removed: line number counting is now using natural numbers, starting at 1, rather than line indices, starting at 0. - All over the place my old email address is still mentioned. Discard it, and as of now, use: "Frank B. Brokken" - The post processing is now performed by the program `yodlpost'. This program again used Design Patterns originally developed for object oriented contexts, resulting in an program that is easy to maintain. modify and expand. - The basic conversion formats now supported are html, latex, man, and text. Xml support is experimental, other formats are no longer supported, mainly because my personal unfamiliarity with the format (texinfo), or because the format appears to be somewhat obsolete (sgml). - Added a Yodl document type `letter', intended to be used with the `brief.cls' LaTeX documentclass - Yodl 2.00 converts documents much faster than earlier versions. ******** 1.31.18 - bf: texinfo: use @ref iso @xref - texinfo: bind() - bf: info - texinfo: table() row() cell() - sm: 81 - bf: internal html links (AARGH) * disabled checking for libgen's weird type of basename () * don't use libgen's broken basename () - 2texinfo: url-> uref iso url - New macros for internationalization added (Paulo da Silva) - html table with new characters (Paulo da Silva) ******** 1.31.17 - 2man: verb*() fixed - 2texinfo fixes: @top, Toplevel, \input texinfo - 2tely: mudela() -> @mudela - 2texinfo: nicer handling of weird nodenames ... NOT: see comment in yodl2texinfo-post.py: urg ******** 1.31.16 - bf: warning/sgml Forgot to send these patches as well (albert chin) - IRIX has snprintf and vsnprintf but you never check for these functions in configure. You redefine them in src/lib/libc-extensions.c - Need to include if linking with -lgen ******* 1.31.15 - embarrassing bug + ugly fix: macros > 8kB - sm79: aix empty sed script fix ******** 1.31.14 - yodl2ms*: no adjustment (thanks: *W Nienhuys) ******** 1.31.13 - sm77 - bf's: yodl2texinfo-post.py - bf: .spec file: include yodl2texinfo-post - IRIX: check for basename in libgen - man/man7 fix ********* 1.31.12 - sm 74 - removed C++ comments 1.31.11 - hsearch turned off - included hsearch glibc sources: manually install libhsearch, for easy profiling - debian fixes (Anthony Fok) - sm 71 - max size of hashtables set in config.hh.in - bf: yodl2msps etc, use groff (or ditroff) iso troff - bf: only include libintl if HAVE_GETTEXT - smarter builtin lookup - use hash table: speed drops by factor 2 :-( - bf: strup call to basename (thanks, Nick Glencross) 1.31.10 - bf: yodl2texinfo: (no) missing xrefs - bf: mudela mode ********* 1.31.9 - moved ftp site: ftp://ftp.lilypond.org/pub/yodl - fixed ms/man table support, see: yodl2msless Documentation/test/table.yo | striproff - bf: ms/man output: use tbl preprocessor - stepmake 67, check for tbl, gmake - bf: latex email, url - bf: yodl2msps.sh ********* 1.31.8 - stepmake 63 - slashed o/O: \/o \/O (Stephan Petersen) - debian fixes by Anthony - bf: installscript comments in scripts - bf: use tmac.s iso tmac.gs (GNU s): troff -ms - bf: scripts: replaced ${word%%pattern} with sed script urg, urg: all these flavours of /bin/sh et al. ********* 1.31.7 - remove ugly empty lines, with uniq... - installable stepmake pl57..59 - fixed first time build again for msless - (re)added manpage yodlmacros.7 - bf's: macrodoc - bf's: shared doc sections - latex char translations (thanks, Adrian) 1.31.6.hwn1 - don't append \\NoLilyFooter to lilypond output (?) 1.31.6.hwn1 - don't put configure stuff in doco ********* 1.31.6 - urg: texinfo only: manpage, macrolist commented-out - bf: yodl2texinfo `\\` - sm 52, fixing striproff install 1.31.5.hwn1 - bf: spec 1.31.5.jbr1 - aclocal.m4,stepmake/aclocal.m4: allow developer to select which python - stepmake/bin/release.py: call package-diff.py with the same executable as release.py ********** 1.31.5 - latex: don't use math version of '*' - drop \tt front from special latex chars - process bin dir later - bf: bin/exe links - latex:code revisited (ta, adrian) 1.31.4.jbr1 - scripts/yodl2manless: slipped a \ - src/yodl/grampipethrough.c: ... the anticipation is killing Jan ;) - Fixed initialization error in NT hack. ********** 1.31.4 - don't make texinfo by default - latex code(%{) fix reverted (duh) - website fixes - gif -> png - website - embedded mudela 1.31.3.jbr1 - bin/GNUmakefile: added (DOTEXE) and - rejected: fix relative path to ../src/out ********* 1.31.3 - bf's: yodl2texinfo-post - fixed latex code(%{) (thanks Adrian) - new macro: setlatexverbchar() - sm 49 - macro doc fixes - renamed output-commands to format-macros - striproff for roff'd txt formatting (yodl2msless x | striproff) - junked bash stuff from scripts/* - 2less fixes - (experimental...) pipethrough really pipes, thanks JBR - took debian/control,copyright changes to *.in source files 1.31.2.jbr2 -src/yodl/message.c: va_end is doesn't do much on a lot of platforms, but it is proper. -src/yodl/grampipethrough.c: Major NT hack. The popen on NT seems to be leaking process slots. With this patch I can at least build lilypond tutorial. -src/scripts/yodl2whatever: pass -v as switch to yodl to enable debugging 1.31.2.af1 - debian fixes 1.31.2.jbr1 - src/yodl/grampipethrough.c: A popen _must_ be closed with a pclose _not_ a fclose. Pipes were never getting closed on Windows NT cygnus. 1.31.2.jcn1 - sm 47 - texinfo fix *********** 1.31.2 - texinfo doc - stepmake 46 - disabled all xrefs in texinfo (makeinfo doesn't forgive human mistakes) 1.31.jcn1 - all texinfo doco - bf' texinfo: tt(), subsubsubsect(), quotation() - texinfo helper macros: nodename, nodetext, nodeprefix - yodl2texinfo-post.py - junked old scripts - < hacking at yodl2texinfo > - stepmake 44 (bedankt, lieverd) 1.31.1.jbr1 - aclocal.m4,stepmake/aclocal.m4,stepmake/stepmake/Variables.make: Install command scheme that supports UNIX, UNIX cross-compile and Windows-NT ********* 1.31.1 - BASH -> SHELL - declare realloc/malloc/free after make-3.75 1.31.0.hwn1 - stepmake .41 1.31.0 - Major release - rpm, zip doco list fixes 1.30.18 - bf: mudela use book-init iso init (HWN) - digicash.com -> cs.uu - website fixes - revised ANNOUNCE, AUTHORS.yo ********* 1.30.17 - bf: OUTDIR - top of web, - fixes: mudela fine counter 1.30.16 - bf's: fine counter - checking mudela diff ******** 1.30.15 - bf's website - added hw's yodl page - janneke@gnu.org - mudela: reset fine counter - (step)make fixes - shared-mudela: irix echo fix - latex bf's: ~ \ < > (HWN) ********* 1.30.14 - handier versioning: major release will be 1.31.0 - ANNOUNCE draft - \Tex \LaTeX fixes (HW+JC) - latex: file() fix (HWN) - verbosity switch for yodl2whatever (HWN) - ps-to-gifs fix (HWN) - bf: bash-2.x empty info install - (step)make fixes - html PARAGRAPH: changed "


    " to "

    ": a single "

    " should be the right thing to appear in such cases, as "


    " adds too much vertical whitespace to a text (SP) - bf: toc html ********* 1.30.pre13 - bf: real simple and obvious silly enumcounter fix - bf's: website - lily's Documentation layout - bf: spec - stepmake uses just-built yodl too 1.30.0.pre12 - doco fixes - currbase alloc (JBR) 1.30.0.pre11 - -d, --definemacro=NAME=EXPANSION\n" (HWN) ********* 1.30.0.pre10 - bf: yodl2dvi (KDB) - world.xpm - bf: yodl.yo.in: latexpackage()() - bf: yodl2xless - bf: latex2.yo.in -> latex2.yodoc.in ********* 1.30.0.pre9 - bf: spec assumes cwd in PATH (KDB) - latex2e support: * \xx to \textxx{ }; \em to \emph{ } * yodl2latex converts to latex2e * yodl2tex and latex2 depreciated - dpkg-shlibdeps: warning: unknown output from ldd on `debian/tmp/usr/bin/yodlfixlabels': ` libc.so.6 => /lib/libc.so.6 (0x40005000)' - binary releases: * make deb * dpkg 1.4.0.23.2 * debhelper 0.96 * /usr/bin/db_*: remove -p from install options (urg) * make rpm * make zip - try at debian package: /bin/bash: dh_testdir: command not found - bf: html: Previous/Next chapter links - bf: label() - {c,f,v,k,p,t}index(), makeindex() macros - configure/make ********* 1.30.0.pre8 - BASH is not required for yodl scripts - bf: absolute include path (KDB) - lots of (step)make fixes ********* 1.30.0.pre7 - bf: garbled error messages - doco fixes - YODL -> Yodl - various stepmake updates - run yodl from sourcetree - check for TROFF - changed ld order to support gettext with ecgs compiler (JBR) - stepmake fixes ******** 1.30.0.pre6 - doco additions and fixes - libc-extensions - check for dirname/basename - make website - Documentation fixes: * yodl.yo -> yodl.yo.in fixed silly install-excerpt hack * replaced legalese.yo with copying.yo - dropped old scripts - bf: don't check for c++ - dropped obsolete submissions - do put nchapters in html toc - more latex-mimic macros: * appendix() After issuing 'appendix()', 'chapter(foo) chapter(bar)' looks like: Appendix A: foo Appendix B: bar * cite() * sc() - don't catch failure signals: rather dump core - allow CHAR(a+b) (e.g.: CHAR(65+foo_counter) ******** 1.30.0.pre5 - bf: xpm typos - included pl 1.23, where relevant: [OLD] * Minor code changes. Yodl now also compiles under cygwin32 (a mini-Unix under Windows 95, yech). [OLD] * The define TMPDIR didn't get passed down from the top level Makefile into the source tree. Fixed. * Several warnings in the C compilation fixed. * Nesting implemented in enumerate() lists up to 3 levels deep. * the umlaut fix - added some macros: * ellipsis() * TeX() LaTeX() * rangle(), langle(), * sups(1), subs(1) * bind(1): bind(figure)ref(fig:one) -> figure~\ref{fig:one} * nop(1): nop(bla)footnote(foo) * includeverbatim(file): real verbatim include 1.30.0.pre4 - bf: yodl2html-post: don't prefix links with dirname - bf: tag htmlnewfile - added (OUT)FILENAME builtins ... - sanified some warning/error messages - bf: included getop1.c - mudela.yodoc.in: handle mudela in 2tex and 2html - added DOEXPAND as builtin macro (urg) - htmlnewfile fixes (KDB) - added verbpipe(2) - bf: silly str_short in pipethrough ? - bf's: doc typos - small macro fixes - fix: aux-macros: .TAGSTART. .TAGEND. in html (XXinternallabel) ?... - added [n]paragraph(1) - atvariables - bf: scripts: make uninstall 1.30.0.pre3 - doos-dist fixes - doos compile fixes - Documentation/AUTHORS.yo - distribute Documentation/man/out/* - yodl: --version - yodl: warranty message - yodl: long options - yodl: automated list of builtin macros - fixed config.h dependency 1.30.0.pre2 - bf's: macros + @@ substs 1.30.0.pre1 - NEWS - mudela(2) (Temporarily, will be gone in next pl) - StepMakification - yodl2texinfo: don't use (rather new) @uref command 1.22.kdb1 - configurable TOC header - use

    iso
      for HTML tags in TOC - added lref() macro - small changes in de HTML generation for descriptions - bf's: missing continuation marks - fix in table.yo file in submissions for LaTeX 1.30.0.pre0 - checked with LilyPond pl 73 website. - added TODO - rehacked builtin macro declaration and access. - ran indent, to be able to do simplest things like - grep "^foo_do_this" *.c - (perhaps bit too soon...?) - Karel votes Yes! 1.22.jcn4 - rpm dist fix (must revise make/install system too). 1.22.jcn3 - set-up really stupid web-page. - fixed silly copyright notice, added GNU GPL - better fixes as soon as we have long options. - bf: yodl.spec 1.22.jcn2 - First LilyPond info page generated form texinfo output - bf: yodl2html-post: closing invalid file - Added yodl.spec to .makedist - fixed .makedist - Added make-target tar (which is really dist) - bf: make clean - aliased ls to '/bin/ls -a' :-) - Added some macros: * code(text) * endmenu() * file(text) * lurl(locator) * menu(list) * metaCOMMENT(text) * metalC(line of text) * mit(item) * node(previous)(this)(next)(up) * nemail(name)(address) * startmenu() - bf: shared.yo.in: missing " - Added preliminary Texinfo support (nodes and menus to be done by hand, for now). * lib/yodl/texinfo.yo.in * lib/yodl/chartables/texinfo.tables.yo 1.22.jcn1 - Added $prefix to Makefile. - Added yodl.spec. yodl-4.04.00/chartab/0000755000175000017500000000000014066072154013223 5ustar frankfrankyodl-4.04.00/chartab/chartabapply.c0000644000175000017500000000035214066072154016041 0ustar frankfrank#include "chartab.ih" String *chartab_apply(char const *txt) { register String *sp = string_new(0); while (*txt) string_addstr(sp, chartab.d_active[*(unsigned char const *)txt++]); return sp; } yodl-4.04.00/chartab/cdata.c0000644000175000017500000000025514066072154014445 0ustar frankfrank#include "chartab.ih" int chartab_data = 0; /* to ensure linkage via chartabconstruct.c */ Chartab chartab; /* Initialized to 0 by the compiler */ yodl-4.04.00/chartab/ctconstruct.c0000644000175000017500000000065014066072154015743 0ustar frankfrank#include "chartab.ih" static char std_char[2]; /* initially: 1 to 1 mapping of chars */ char **ct_construct(char *table) { char **chartable = new_memory(256, sizeof(char *)); size_t idx; for (idx = 0; idx < 256; idx++) /* set table to defaults */ { std_char[0] = idx; chartable[idx] = new_str(std_char); } ct_parse_table(chartable, table); return chartable; } yodl-4.04.00/chartab/chartabuse.c0000644000175000017500000000123614066072154015512 0ustar frankfrank#include "chartab.ih" /* Method: push active (if requested), reset active Then at popping: reset active to tos() pop stack */ Result chartab_use(HashMap *symtab, char const *name, bool push) { register StackValue stValue; if (push) { stValue.u_charpp = chartab.d_active; stack_push(&chartab.d_chartab_st, stValue); } if (!*name) chartab.d_active = NULL; else { HashItem *item = hashmap_find(symtab, name, CHARTABLE); if (item == PFAILED) return FAILED; chartab.d_active = (char **)hashitem_value(item); } return SUCCESS; } yodl-4.04.00/chartab/chartabinsert.c0000644000175000017500000000046214066072154016222 0ustar frankfrank#include "chartab.ih" Result chartab_insert(HashMap *symtab, char const *name, char *table) { return hashmap_insert ( symtab, hashitem_new_destructor(CHARTABLE, name, ct_construct(table), ct_destroy) ); } yodl-4.04.00/chartab/ctdestroy.c0000644000175000017500000000046214066072154015411 0ustar frankfrank#include "chartab.ih" void ct_destroy(void *table) { register char **cpp = (char **)table; register size_t idx; for (idx = 0; idx < 256; idx++) /* free elements */ free(*cpp++); free(table); /* free the table itself */ } yodl-4.04.00/chartab/chartabfind.c0000644000175000017500000000032714066072154015636 0ustar frankfrank#include "chartab.ih" Result chartab_find(char const **ctab) { if (ctab == (char const **)chartab.d_active) return SUCCESS; return stack_contains(&chartab.d_chartab_st, ctab) ? SUCCESS : FAILED; } yodl-4.04.00/chartab/ctstring.c0000644000175000017500000000056114066072154015226 0ustar frankfrank#include "chartab.ih" char *ct_string(char const *str) { String string; string_construct(&string, 0); while (*str) { size_t increment = 1; string_addchar ( &string, (*str == '\\') ? (int)ct_ascii(str, &increment) : *str ); str += increment; } return string_release(&string); } yodl-4.04.00/chartab/chartabpop.c0000644000175000017500000000060614066072154015514 0ustar frankfrank#include "chartab.ih" /* Pushing method: push active reset active Then here, at popping: reset active to tos() pop stack */ Result chartab_pop() { if (!stack_size(&chartab.d_chartab_st)) return FAILED; chartab.d_active = stack_tos(&chartab.d_chartab_st)->u_charpp; stack_pop(&chartab.d_chartab_st); return SUCCESS; } yodl-4.04.00/chartab/ctparsetable.c0000644000175000017500000001006014066072154016035 0ustar frankfrank#include "chartab.ih" /* See also chatab_construct() for the description of d_regex_hex and d_regex_oct. character tables consist of lines, each line containing a 'x' = "redef" phrase. The problem here is, of course, that we MUST have the newlines. So, we MUST make sure that the WS level, not using -k, doesn't kill our newlines. This is realized by yodl/gramdefinechartable.c by calling parser_push_ws_level() and parser_pop_ws_level(). One match is described by: match: 1 23 (count match by parenthesis number) \s*'(\\?.)'\s*=\s*"(((\\.)|[^"])*)" 1111 22222 3333 55555555 4444444444444 \s: [[:space:]] 1: maybe backslash, then any char within stringquotes 2: backslash, then any char 3: no double quote 4: (2) or (3), as often as required The 'x' part may contain escape sequences: '(\.|)' or '\.' The "redef" part may contain escape sequences "([^"]|\.)*" */ typedef enum { REGEX_HEX, REGEX_PLAIN, REGEX_OCT } REGEX_TYPE; static regmatch_t pmatch[5]; void ct_parse_table(char **table, register char *arg) { int idx; size_t key = 0; /* to prevent `may be used initialized' warning */ /* produced by some compilers */ while (*arg) /* Process `arg' */ { REGEX_TYPE regex_type; unsigned uns_key; register char *chartext; /* Match the next element in `arg' */ /* 5: max 5 subexpressions, 0: no flags */ if (!regexec(&chartab.d_regex, arg, 5, pmatch, 0)) regex_type = REGEX_PLAIN; else if (!regexec(&chartab.d_regex_oct, arg, 5, pmatch, 0)) regex_type = REGEX_OCT; else if (!regexec(&chartab.d_regex_hex, arg, 5, pmatch, 0)) regex_type = REGEX_HEX; else { if (message_show(MSG_ERR)) message("DEFINECHARTABLE: Entry `%s' not recognized", string_short(arg)); if (!(arg = strchr(arg, '\n'))) /* find next definition */ return; arg++; /* skip \n */ continue; /* retry at the next one */ } /* Got a match. Terminate the matched elements */ arg[pmatch[1].rm_eo] = 0; /* terminate matched char */ arg[pmatch[3].rm_eo] = 0; /* terminate matched string */ chartext = arg + pmatch[1].rm_so; /* Convert the matched character text to a char (key) value */ switch (regex_type) { case REGEX_HEX: sscanf(chartext, "%x", &uns_key); key = uns_key; break; case REGEX_OCT: sscanf(chartext, "%o", &uns_key); key = uns_key; if (key > 0xff) { if (message_show(MSG_ERR)) message("DEFINECHARTABLE: Character value `\\%s' " "exceeds 0%o (255)", chartext, 255); arg += pmatch[0].rm_eo + 1; continue; /* retry at the next one */ } break; case REGEX_PLAIN: { size_t dummy = 0; /* not used by ct_ascii */ key = ct_ascii(chartext, &dummy); } break; } if (message_show(MSG_INFO)) message("chartab[%s] = `%s'", chartext, arg + pmatch[3].rm_so); free(table[key]); table[key] = ct_string(arg + pmatch[3].rm_so); arg += pmatch[0].rm_eo + 1; } idx = strspn(arg, " \t\n"); if (arg[idx]) if (message_show(MSG_ERR)) message("DEFINECHARTABLE: Illegal table contents `%s'", string_short(arg + idx)); } yodl-4.04.00/chartab/chartabconstruct.c0000644000175000017500000000471014066072154016742 0ustar frankfrank#include "chartab.ih" /* The regular expression of chartab-elements consists of the following parts: "[[:space:]]*" - start with optional whitespace "'((\\\\)?.)'" - followed by one character between single quotes, optionally preceded by a backslash "[[:space:]]*" - followed by optional white space "=" - and an '=' sign "[[:space:]]*" - followed by optional white space "\"(((\\\\.)|[^\"])*)\"" - followed by any series of chars, each optionally preceded by a \, enclosed in double string quotes d_regex_oct is identical to d_regex, but has the character expression "'\\\\([0-7]{3})'" - three octal digits preceded by a \, surrounded by single quotes. Example: '\123' d_regex_hex is identical to d_regex, but has the character expression "'0x([0-9a-fA-F]{2})'" - 0x followed by 2 hex digits, surrounded by single quotes. Example: '0xab' */ void chartab_construct() { if ( regcomp ( &chartab.d_regex, "[[:space:]]*" "'((\\\\)?.)'" "[[:space:]]*" "=" "[[:space:]]*" "\"(((\\\\.)|[^\"])*)\"" , REG_EXTENDED | REG_NEWLINE ) || regcomp ( &chartab.d_regex_oct, "[[:space:]]*" "'\\\\([0-7]{3})'" "[[:space:]]*" "=" "[[:space:]]*" "\"(((\\\\.)|[^\"])*)\"" , REG_EXTENDED | REG_NEWLINE ) || regcomp ( &chartab.d_regex_hex, "[[:space:]]*" "'0x([0-9a-fA-F]{2})'" "[[:space:]]*" "=" "[[:space:]]*" "\"(((\\\\.)|[^\"])*)\"" , REG_EXTENDED | REG_NEWLINE ) ) if (message_show(MSG_EMERG)) message("Chartab_construct(): regcomp() failed"); stack_construct(&chartab.d_chartab_st, NULL); } yodl-4.04.00/chartab/chartab.ih0000644000175000017500000000055414066072154015155 0ustar frankfrank#include "chartab.h" #include #include #include #include "../message/message.h" #include "../new/new.h" size_t ct_ascii(char const *ch, size_t *increment); char **ct_construct(char *table); void ct_destroy(void *); void ct_parse_table(char **chartab, char *table); char *ct_string(char const *str); yodl-4.04.00/chartab/chartab.h0000644000175000017500000000501714066072154015003 0ustar frankfrank#ifndef INCLUDED_CHARTAB_H_ #define INCLUDED_CHARTAB_H_ #include #include #include "../root/root.h" #include "../stack/stack.h" #include "../hashmap/hashmap.h" #include "../string/string.h" /* Character tables are defined as arrays of 256 char *s and stored by name in the symbol table. In d_chartab_st the addresses of the tables are stored, stackwise, while d_active is always set to the stack's top to speed up chartable access. There is no default character table. If the default is requested, NULL is pushed on the stack. */ typedef struct { Stack d_chartab_st; /* pointers to stacked character tables */ char **d_active; /* currently active character table NULL if */ /* the default (1:1) chartab is active */ regex_t d_regex; /* compiled regular expression */ regex_t d_regex_oct; /* compiled regular expression (octal char) */ regex_t d_regex_hex; /* compiled regular expression (hex char) */ } Chartab; extern int chartab_data; /* to ensure linkage via chartabconstruct.c */ void chartab_construct(void); // PM: chartab_destruct String *chartab_apply(char const *txt); /* returns transformed text */ /* MUST have active chartab */ Result chartab_find(char const **chartab); Result chartab_insert(HashMap *symtab, char const *name, char *table); Result chartab_pop(void); /* pop the most recent chartab */ /* activate the previous one */ /* push and activate the named */ /* chartab, or no chartab for */ /* an empty string */ Result chartab_use(HashMap *symtab, char const *name, bool pushIsTrue); /* Internal Chartab use only. Not used outside of this directory functions, needed here to allow proper compilation of the static inline functions below */ extern Chartab chartab; /* there's only one chartab */ /* storage */ /* public interface continues from here */ static inline char const **chartab_active() /* returns active chartab or 0 */ { return (char const **)chartab.d_active; } static inline bool chartab_isActive() { return chartab.d_active != NULL; } #endif yodl-4.04.00/chartab/ctascii.c0000644000175000017500000000202314066072154015003 0ustar frankfrank#include "chartab.ih" size_t ct_ascii(char const *ch, size_t *skip) { size_t ret; if (*ch != '\\') return (unsigned char)*ch; ++*skip; switch (ch[1]) { case 'a': return '\a'; case 'b': return '\b'; case 'f': return '\f'; case 'n': return '\n'; case 'r': return '\r'; case 't': return '\t'; case 'v': return '\v'; case 'x': case 'X': if (isdigit(ch[3]) && isdigit(ch[4])) { sscanf(ch + 2, "%2zx", &ret); *skip = 4; return ret; } return (unsigned char)ch[1]; case '0': case '1': if (strchr("01234567", ch[2]) && strchr("01234567", ch[3])) { sscanf(ch + 1, "%3zo", &ret); *skip = 4; return ret; } //FALLING THROUGH default: return (unsigned char)ch[1]; } } yodl-4.04.00/config.h0000644000175000017500000000212314066072154013233 0ustar frankfrank#ifndef _INCLUDED_CONFIG_H_ #define _INCLUDED_CONFIG_H_ #include "tmp/wip/config.h" /* For the "INCLUDEFILE(filename)" macro and for filenames on the command line, yodl will supply a default extension (if needed). */ #define DEFAULT_EXT ".yo" /* Parsing and re-parsing can lead to endless loops, e.g., if a macro or subst definition is eventually expanded to itself. The same may happen when a file includes itself. To allow YODL to detect these situations, the following two configuration defines were defined: DEFAULT_MAX_NESTED_FILES defines the default maximum number of nested files that YODL will process, DEFAULT_MAX_REPLACEMENTS defines the default maximum number of macro- or subst- expansions x 10,000 that are accepted between characters that were actually read from file. If either limit is exceeded, YODL aborts. Both defaults are run-time configurable using command-line flags. No replacement limit is enforced when it is set to 0. */ #define DEFAULT_MAX_NESTED_FILES 20 #define DEFAULT_MAX_REPLACEMENTS 1 #endif yodl-4.04.00/contrib/0000755000175000017500000000000014066072154013257 5ustar frankfrankyodl-4.04.00/contrib/build.pl0000644000175000017500000004375214066072154014726 0ustar frankfrank#!/usr/bin/perl # This script should be run from contrib's parent directory. I.e., you should # call it as `perl contrib/build.pl'. use strict; # Configuration: default values, unless overruled by the environment. # ------------------------------------------------------------------- my %config = ( CC => 'gcc', CFLAGS => '-c -Wall -Werror -g', STD_INCLUDE => '/usr/share/yodl', MAN_DIR => '/usr/share/man', DOC_DIR => '/usr/share/doc/yodl', YODL_BIN => '/usr/bin', STD_CONVERSIONS => 'html latex man txt xml', MANUAL_FORMATS => 'html txt pdf ps', ); # Some of the dirs created in the build. Not all of them tho.. my @doc_dirs = ('manual/html', 'manual/latex', 'manual/man', 'manual/pdf', 'manual/ps', 'manual/txt', 'manual/dvi'); # The manual pages and their sections. my %man_map = (yodl => 1, yodlpost => 1, yodlverbinsert => 1, yodlconverters => 1, yodlmanpage => 7, yodlletter => 7, yodlmacros => 7, yodlbuiltins => 7 ); # Initialization # -------------- # The key TOPLEVEL_VERSION is read from the file src/config.h # to ensure proper version-synchronization. open (my $if, "src/config.h") or die ("Cannot read the file src/config.h: $!\n"); foreach (<$if>) { if ( /#define\s+TOPLEVEL_VERSION\s\"(\S+)\"/) { $config{TOPLEVEL_VERSION} = $1; print ("Top level version ID: ", $config{TOPLEVEL_VERSION}, "\n"); last; } } close ($if); my $cc = getconf ('CC'); my $cflags = getconf ('CFLAGS'); my $toplevel_version = getconf ('TOPLEVEL_VERSION'); my $std_include = getconf ('STD_INCLUDE'); my $yodl_bin = getconf ('YODL_BIN'); my $std_conversions = getconf ('STD_CONVERSIONS'); my $manual_formats = getconf ('MANUAL_FORMATS'); my $man_dir = getconf ('MAN_DIR'); my $doc_dir = getconf ('DOC_DIR'); $cflags .= " -DTOPLEVEL_VERSION=\"$toplevel_version\"" . " -DSTD_INCLUDE=\"$std_include\""; # [KK 2006-03-15] The following isn't necessary anymore. I rewrote # the sources to use stdlib.h (more POSIX-y anyway) # $cflags .= # " -DNO_MALLOC_H" unless (findheader ('malloc.h')); # Helpers # ------- my @_warnings; sub warning ($) { my $msg = shift; print STDERR ($msg, "\n"); push (@_warnings, $msg); } sub getconf ($) { my $var = shift; my $val; if ($ENV{$var}) { $val = $ENV{$var}; } elsif ($config{$var}) { $val = $config{$var}; } else { die ("Configuration for $var could not be obtained!\n"); } $config{$var} = $val; return ($val); } sub dirtree { foreach my $dir (@_) { my @subs = split (/\//, $dir); for (my $i = 0; $i <= $#subs; $i++) { my $sofar = ''; for (my $j = 0; $j <= $i; $j++) { $sofar .= $subs[$j]; $sofar .= '/'; } next if (-d $sofar); mkdir ($sofar) or die ("Cannot create dir $sofar: $!\n"); } } } sub run ($) { my $cmd = shift; $cmd =~ s{"}{\\"}g; print (" $cmd\n"); my $ret = system ($cmd); die ("[$cmd] has failed, code $ret\n") if ($ret); } sub findbin ($) { my $bin = shift; foreach my $d (split /:/, $ENV{PATH}) { return ("$d/$bin") if (-x "$d/$bin"); } return (undef); } sub findheader ($) { my $h = shift; foreach my $d ('/usr/include', '/usr/local/include') { return ("$d/$h") if (-f "$d/$h"); } return (undef); } sub newer ($$) { my ($a, $b) = @_; return (1) unless (-f $b); return (1) if ( (stat($a))[9] > (stat($b))[9] ); return (0); } sub sourcecompile ($) { my $dir = shift; my $headershown = 0; my @src = glob ("$dir/*.c"); return if ($#src == -1); if (! -d "$dir/o") { mkdir ("$dir/o") or die ("Cannot make dir $dir/o: $!\n"); } foreach my $c (@src) { my $run = 0; my $o = $c; $o =~ s{.*/}{}; $o =~ s{\.c}{.o}; $o = "$dir/o/$o"; $run++ if (newer ($c, $o)); next unless ($run); print ("Compiling in: $dir\n") unless ($headershown++); print (" $c -> $o\n"); run ("$cc $cflags $c -o $o"); } } sub collectlibs () { my @dirs = glob ('src/*/o'); my %libmap; foreach my $d (@dirs) { my @obj = glob ("$d/*.o"); next if ($#obj == -1); my $libname = 'src/libyodlrss.a'; $libname = 'src/libyodl.a' if ($d =~ m{src/yodl/o}); $libname = 'src/libyodlpost.a' if ($d =~ m{src/yodlpost/o}); if (defined ($libmap{$libname})) { my @present = @{ $libmap{$libname} }; push (@present, @obj); $libmap{$libname} = [ @present ]; } else { $libmap{$libname} = [ @obj ]; } } foreach my $l (keys (%libmap)) { my @obj = @{ $libmap{$l} }; my @new; foreach my $o (@obj) { push (@new, $o) if (newer ($o, $l)); } next if ($#new == -1); print ("Library $l: @new\n"); run ("ar rs $l @new"); run ("ranlib $l"); } } sub makebinarysimple ($) { my $bin = shift; my $base = $bin; $base =~ s{^yodl}{}; my $obj = "src/$base/o/$base.o"; my $dst = "src/bin/$bin"; if (newer ($obj, $dst)) { print ("Creating (simple) binary: $dst\n"); run ("$cc -o $dst $obj"); } } sub makebinarybylibs ($) { my $bin = shift; my $run = 0; $run++ if (newer ("src/lib$bin.a", "src/bin/$bin")); $run++ if (newer ('src/libyodlrss.a', "src/bin/$bin")); return unless ($run); print ("Creating binary: $bin (src/bin/$bin)\n"); dirtree ("src/bin"); run ("$cc -o src/bin/$bin -Lsrc -l$bin -lyodlrss"); } sub makeyodlversion ($) { my $versionfile = shift; open (my $of, ">$versionfile") or die ("Cannot write $versionfile: $!\n"); print $of ("DEFINESYMBOL(XXyodlVersion)($toplevel_version)\n"); close ($of); } sub patch ($$) { my ($inname, $outname) = @_; return if (newer ($outname, $inname)); print ("Patching $inname (-> $outname)\n"); open (my $if, $inname) or die ("Cannot read $inname: $!\n"); open (my $of, ">$outname") or die ("Cannot write $outname: $!\n"); while (my $line = <$if>) { foreach my $k (keys (%config)) { $line =~ s{\@$k\@}{$config{$k}}g; } print $of ($line); } close ($if); close ($of); } sub makestdconversions () { foreach my $conv (split (/ +/, $std_conversions)) { patch ("macros/in/$conv.in", "macros/yodl/$conv.yo"); } } sub makerawmacros () { foreach my $conv (split (/ +/, $std_conversions)) { collectrawmacros ("macros/rawmacros/*.raw", "macros/yodl/std.$conv.yo", $conv); } } sub parserawfile ($$) { my ($raw, $target) = @_; my $copy = 1; my $recognized = 0; my $closed = 1; my $printed = 0; my $wslines = 0; my $ret; open (my $if, $raw) or die ("Cannot read raw macro file $raw: $!\n"); while (my $line = <$if>) { chomp ($line); if ($line =~ /^<.*$target.*>\s*$/) { $copy = 1; $closed = 0; $recognized = 1; } elsif ($line =~ /^<>\s*$/) { $copy = 1; $closed = 1; $recognized = 0; } elsif ($line =~ /^\s*$/) { $closed = 0; $copy = !$recognized; } elsif ($line =~ /^<[^>]+>\s*$/) { $closed = 0; $copy = 0; } elsif ($copy) { if ($line =~ /^\s*$/) { $wslines++ if ($printed); next; } while ($wslines) { $ret .= "\n"; $wslines--; } $ret .= "$line\n"; $printed = 1; } # print ("$closed [$line]\n"); } close ($if); die ("\nNo closing <> in raw macro file $raw\n") unless ($closed); return ($ret); } sub collectrawmacros ($$$) { my ($rawmask, $output, $format) = @_; my @rawfiles = glob ($rawmask); die ("Failed to list raw files (mask $rawmask)\n") if ($#rawfiles == -1); my $make = 0; foreach my $r (@rawfiles) { $make++ if (newer ($r, $output)); } return unless ($make); print ("Generating standard macros for format $format "); open (my $of, ">$output.tmp") or die ("Cannot write $output.tmp: $!\n"); print $of ("INCWSLEVEL()\n", "DEFINESYMBOL($format)()\n"); foreach my $r (@rawfiles) { print ("."); print $of (parserawfile ($r, $format)); } print $of ("DECWSLEVEL()\n"); close ($of); patch ("$output.tmp", $output); unlink ("$output.tmp"); print ("\n Generated.\n"); } sub makemacrodocs ($) { my $dest = shift; my @raw = glob ('macros/rawmacros/*.raw'); my $make = 0; foreach my $r (@raw) { $make++ if (newer ($r, $dest)); } return unless ($make); print ("Generating raw macros documentation\n"); open (my $of, ">$dest") or die ("Cannot write $dest: $!\n"); foreach my $r (@raw) { open (my $if, $r) or die ("Cannot read $r: $!\n"); my $active = 0; while (my $line = <$if>) { chomp ($line); if ($line =~ /^\s*/) { $active++; } elsif ($line =~ /^<.*>\s*/) { $active = 0; } elsif ($active) { print $of ($line, "\n"); } } close ($if); die ("Unterminated in $r\n") if ($active); } close ($of); } sub build_docformat ($) { my $format = shift; my $dest = "manual/$format/yodl.$format"; # Do we need to make it? my $make = 0; foreach my $yo (glob ('manual/*.yo'), glob ('manual/converters/*.yo'), glob ('manual/intro/*.yo'), glob ('manual/technical/*.yo')) { if (newer ($yo, $dest)) { $make++; last; } } return (1) unless ($make); # First yodl generation. Must be from within the manual/ subdir. # Applies to output formats latex, html, txt, man. if ($format eq 'latex' or $format eq 'html' or $format eq 'txt' or $format eq 'man') { print ("\nGenerating $format manual ($dest)\n"); chdir ('manual/') or die ("Cannot access manual/: $!\n"); run ("../../src/bin/yodl -DXXMACROPATH=. ". "-I.:../../macros/yodl -oout $format " . "manual"); if ($format ne 'latex') { run ("../../src/bin/yodlpost out.idx out yodl.$format"); run ("mv yodl*$format ../$format/"); } else { rename ('out', "../$format/yodl.$format") or die ("Cannot move yodl.$format out of manual/ ", "to manual/$format/yodl.$format: $!\n"); } unlink ('out', 'out.idx') or die ("Cannot unlink temporary files: $!\n"); chdir ('../..'); return (1); } # DVI generation. Must occur from manual/latex because # ../../macros/yodl/xlatin.tex gets sourced. if ($format eq 'dvi') { if (! build_docformat ('latex')) { warning ("Cannot generate manual in DVI format."); return (0); } if (! findbin ('latex')) { warning ("Application `latex' not found. " . "Cannot generate manual in LaTeX format."); return (0); } chdir ('manual/latex') or die ("Cannot access manual/latex: $!\n"); run ('latex yodl.latex'); run ('latex yodl.latex'); run ('latex yodl.latex'); chdir ('../..'); rename ('manual/latex/yodl.dvi', 'manual/dvi/yodl.dvi') or die ("Cannot move yodl.dvi from manual/latex ", "into manual/dvi/: $!\n"); return (1); } # Postscript if ($format eq 'ps') { if (!build_docformat ('dvi')) { warning ("Cannot generate manual in PostScript format."); return (0); } if (! findbin ('dvips')) { warning ("Application `dvips' not found. " . "Cannot generate manual in PostScript format."); return (0); } run ('dvips -o manual/ps/yodl.ps manual/dvi/yodl.dvi'); return (1); } # PDF if ($format eq 'pdf') { if (! build_docformat ('latex')) { warning ("Cannot generate manual in PDF format."); return (0); } # First we try via pdflatex. if (findbin ('pdflatex')) { # The pdflatex run must be from manual/latex, 'cuz xlatin1.tex # gets sourced as ../../macros/yodl/xlatin.tex chdir ('manual/latex') or die ("Cannot access manual/latex: $!\n"); run ('pdflatex yodl.latex'); run ('pdflatex yodl.latex'); run ('pdflatex yodl.latex'); chdir ('../..'); rename ('manual/latex/yodl.pdf', 'manual/pdf/yodl.pdf') or die ("Cannot move manuals/latex/yodl.pdf to ", "manuals/pdf: $!\n"); return (1); } # We don't seem to have pdflatex. Let's try PS -> ps2pdf. if (! make_docformat ('ps')) { warning ("Cannot generate manual in PDF format."); return (0); } if (! findbin ('ps2pdf')) { warning ("Application `ps2pdf' not found. " . "Cannot generate manual in PDF format."); return (0); } run ('ps2pdf manual/ps/yodl.ps manual/pdf/yodl.pdf'); return (1); } # All others... die ("Manual generation for format `$format' not (yet) implemented!\n"); } sub make_documentation () { # Make sure we have the destination dirs. dirtree (@doc_dirs); # Do all formats. foreach my $format (split / +/, $manual_formats) { build_docformat ($format); } } sub make_man () { foreach my $page (keys (%man_map)) { my $nr = $man_map{$page}; dirtree ("man/$nr"); my $src = "man/$page.in"; my $yo = "man/$page.yo"; my $man = "man/$nr/$page.$nr"; next if (newer ($man, $src)); print ("Generating manpage $man from $src\n"); patch ($src, $yo); chdir ("man") or die ("Cannot access man/: $!\n"); run ("../src/bin/yodl -DXXMACROPATH=. -I.:../macros/yodl -oout " . "man $page.yo"); run ("../src/bin/yodlpost out.idx out $nr/$page.$nr"); unlink ('out', 'out.idx', $yo) or die ("Cannot unlink temporary files: $!\n"); chdir ('..'); } } sub make_software () { # Compilation. foreach my $srcdir (glob ("src/*")) { next unless (-d $srcdir); sourcecompile ($srcdir); } # Collect into libraries. collectlibs (); # Create binaries makebinarybylibs ('yodl'); makebinarybylibs ('yodlpost'); makebinarysimple ('yodlverbinsert'); # In the macros/yodl dir, create yodlversion.yo makeyodlversion ('macros/yodl/yodlversion.yo'); # Prepare the list of raw macros. makemacrodocs('manual/macros/macrolist.yo'); # Standard conversion macros. makestdconversions (); makerawmacros (); } sub glob_unlink { foreach my $mask (@_) { foreach my $file (glob ($mask)) { unlink ($file) or die ("Cannot unlink $file: $!\n"); } } } sub clean_software () { if (-f 'manual/macros/macrolist.yo') { unlink ('manual/macros/macrolist.yo') or die ("Cannot unlink manual/macros/macrolist.yo: $!\n"); } glob_unlink ('macros/yodl/*.yo', 'src/libyodl*', 'src/bin/yodl*'); if (-d 'src/bin') { rmdir ('src/bin') or die ("Cannot unlink src/bin: $!\n"); } foreach my $odir (glob ('src/*/o')) { next unless (-d $odir); glob_unlink ("$odir/*.o"); rmdir ($odir) or die ("Cannot unlink $odir: $!\n"); } } sub clean_documentation () { foreach my $d (@doc_dirs) { next unless (-d $d); glob_unlink ("$d/*"); rmdir ("$d") or die ("Cannot unlink dir $d: $!\n"); } } sub clean_man () { foreach my $nr (values (%man_map)) { my $dir = "man/$nr"; next unless (-d $dir); glob_unlink ("$dir/*"); rmdir ($dir) or die ("Cannot unlink dir $dir: $!\n"); } foreach my $f (glob ("man/*.yo")) { unlink ($f) or die ("Cannot unlink $f: $!\n"); } } sub make () { make_software(); make_man(); make_documentation(); } sub clean () { clean_software(); clean_man(); clean_documentation(); } my $_install_depth = 0; sub install ($$) { my ($a, $dst) = @_; die ("Install depth exceeded (error in build.pl script)\n") if ($_install_depth++ > 100); if (! -d $dst) { print ("Creating install directory `$dst'\n"); dirtree ($dst); } if (-f $a and newer ($a, $dst)) { print ("Installing file $a -> $dst/$a\n"); if (-x $a) { run ("install -s $a $dst"); } else { run ("cp $a $dst"); } } elsif (-d $a) { print ("Installing directory $a/ -> $dst/\n"); run ("(cd $a; tar --exclude .svn --exclude CVS -c -f - .) | " . "(cd $dst; tar xf -)"); } else { my @list = glob ($a); die ("Installation failure, $a fails to yield a list\n") if ($#list == -1); foreach my $l (@list) { install ($l, $dst); } } $_install_depth--; } sub install_software() { make_software(); install ('src/bin/yodl*', $yodl_bin); install ('macros/yodl', $std_include); } sub install_man () { make_man(); foreach my $nr (values (%man_map)) { install ("man/$nr", "$man_dir/man$nr"); } } sub install_documentation () { make_documentation(); foreach my $format (split (/ +/, $manual_formats)) { install ("manual/$format/*", $doc_dir); } } # Main starts here # ---------------- select (STDERR); $| = 1; select (STDOUT); $| = 1; my $selector = $ARGV[0]; if ($selector eq 'make-software') { make_software(); } elsif ($selector eq 'make-man') { make_man(); } elsif ($selector eq 'make-documentation') { make_documentation(); } elsif ($selector eq 'make') { make_software(); make_man(); make_documentation(); } elsif ($selector eq 'install-software') { install_software(); } elsif ($selector eq 'install-man') { install_man(); } elsif ($selector eq 'install-documentation') { install_documentation(); } elsif ($selector eq 'install') { install_software(); install_man(); install_documentation(); } elsif ($selector eq 'clean-software') { clean_software(); } elsif ($selector eq 'clean-man') { clean_man(); } elsif ($selector eq 'clean-documentation') { clean_documentation(); } elsif ($selector eq 'clean') { clean_software(); clean_man(); clean_documentation(); } else { die <<"ENDUSAGE"; You must supply an argument: make-software - build the software locally make-man - build the manpages (`software' required) make-documentation - build the docs (`software' required) make - the three above install-software - install software to $yodl_bin install-man - install manpages to $man_dir install-documentation - install docs to $doc_dir install - the three above clean-software - clean up from target `make-software' clean-man - clean up from target `make-man' clean-documentation - clean up from target `make-documentation' clean - the three above ENDUSAGE } # Show collected warnings. if ($#_warnings > -1) { print STDERR ("\nWARNINGS:\n"); foreach my $w (@_warnings) { print STDERR (" $w\n"); } } yodl-4.04.00/counter/0000755000175000017500000000000014066072154013276 5ustar frankfrankyodl-4.04.00/counter/counterhasvalue.c0000644000175000017500000000037214066072154016654 0ustar frankfrank#include "counter.ih" bool counter_has_value(int *valuePtr, HashItem *item) { Stack *sp = (Stack *)hashitem_value(item); if (sp == PFAILED || !stack_size(sp)) return false; *valuePtr = stack_tos(sp)->u_int; return true; } yodl-4.04.00/counter/coconstruct.c0000644000175000017500000000047114066072154016012 0ustar frankfrank#include "counter.ih" Stack *co_construct(int value) { Stack *counter = (Stack *)new_memory(1, sizeof(Stack)); register StackValue stValue; stack_construct(counter, 0); /* just values, nothing allocated */ stValue.u_int = value; stack_push(counter, stValue); return counter; } yodl-4.04.00/counter/counteradd.c0000644000175000017500000000041014066072154015565 0ustar frankfrank#include "counter.ih" void counter_add(HashItem *item, int value) { Stack *sp = co_sp(item, true); if (sp != PFAILED) { register StackValue stValue = *stack_tos(sp); stValue.u_int += value; stack_assign(sp, stValue); } } yodl-4.04.00/counter/counterinsert.c0000644000175000017500000000045514066072154016352 0ustar frankfrank#include "counter.ih" Result counter_insert(HashMap *symtab, char const *key, int value) { return hashmap_insert ( symtab, hashitem_new_destructor(COUNTER, key, co_construct(value), stack_destruct) ); } yodl-4.04.00/counter/cosp.c0000644000175000017500000000076414066072154014415 0ustar frankfrank#include "counter.ih" Stack *co_sp(HashItem *item, bool errOnFailure) { Stack *sp; if (item == PFAILED) { if (errOnFailure) if (message_show(MSG_ERR)) message("Missing counter stack"); return PFAILED; } if (stack_size(sp = (Stack *)hashitem_value(item))) return sp; if (errOnFailure) if (message_show(MSG_ERR)) message("No stacked value for counter `%s'", hashitem_key(item)); return PFAILED; } yodl-4.04.00/counter/countertext.c0000644000175000017500000000025614066072154016031 0ustar frankfrank#include "counter.ih" static char valueText[40]; char const *counter_text(HashItem *item) { snprintf(valueText, 40, "%d", counter_value(item)); return valueText; } yodl-4.04.00/counter/counterset.c0000644000175000017500000000036514066072154015641 0ustar frankfrank#include "counter.ih" void counter_set(HashItem *item, int value) { Stack *sp = co_sp(item, true); if (sp != PFAILED) { register StackValue stValue; stValue.u_int = value; stack_assign(sp, stValue); } } yodl-4.04.00/counter/counter.h0000644000175000017500000000107714066072154015133 0ustar frankfrank#ifndef INCLUDED_COUNTER_H_ #define INCLUDED_COUNTER_H_ #include "../root/root.h" #include "../hashmap/hashmap.h" void counter_add(HashItem *item, int add); /* err if no counter */ bool counter_has_value(int *valuePtr, HashItem *item); Result counter_insert(HashMap *symtab, char const *key, int value); void counter_set(HashItem *item, int value); /* err if no counter */ char const *counter_text(HashItem *item); /* returns static buffer */ int counter_value(HashItem *item); /* err if no stack/item */ #endif yodl-4.04.00/counter/counter.ih0000644000175000017500000000032214066072154015274 0ustar frankfrank#include "counter.h" #include #include "../stack/stack.h" #include "../message/message.h" #include "../new/new.h" Stack *co_construct(int value); Stack *co_sp(HashItem *item, bool errOnFailure); yodl-4.04.00/counter/countervalue.c0000644000175000017500000000022614066072154016156 0ustar frankfrank#include "counter.ih" int counter_value(HashItem *item) { Stack *sp = co_sp(item, true); return sp == PFAILED ? 0 : stack_tos(sp)->u_int; } yodl-4.04.00/file/0000755000175000017500000000000014066072154012536 5ustar frankfrankyodl-4.04.00/file/filermextension.c0000644000175000017500000000076214066072154016122 0ustar frankfrank#include "file.ih" char *file_rmExtension(char const *path) { register char *ext; register char *cp = strrchr(path, '/'); ext = strrchr(cp ? cp : path, '.'); /* find last . */ if (!ext) /* none found: return path */ return new_str(path); cp = new_str(path); /* copy the path */ cp[ext - path] = 0; /* cut at the last . */ return cp; } yodl-4.04.00/file/ffullname.c0000644000175000017500000000037214066072154014655 0ustar frankfrank#include "file.ih" void f_fullname(String *fullname, String const *filename) { if (args_home()) string_replace(fullname, "$HOME", args_home()); string_addcharOnce(fullname, '/'); string_addstr(fullname, string_str(filename)); } yodl-4.04.00/file/file.h0000644000175000017500000000347614066072154013640 0ustar frankfrank#ifndef INCLUDED_FILE_H_ #define INCLUDED_FILE_H_ #include #include "../hashmap/hashmap.h" void file_append(FILE *dest, char const *path); /* dest must be open */ char *file_basename(char const *path); void file_copy2offset(FILE *dest, FILE *src, long src_end); char *file_dirname(char const *path); /* extension: extension (without .) */ char *file_extension(char const *path); /* Full pathname of `filename' is returned as allocated string */ /* or NULL if no file was found. The path defined by the */ /* XXincludePath symbol and the default extension (.yo) are */ /* used when searching for `filename' */ /* When returning a pathname, the file can be read. */ /* $HOME in the spec. is replaced by the caller's home dir. */ /* (if available from the $HOME or $home environment vars) */ char *file_fullpath(HashMap *symtab, char const *filename); /* rmExtension: new string without ext. */ char *file_rmExtension(char const *path); /* NULL: couldn't open `name' in the indicated mode ("r", "w") */ /* otherwise a FILE* for the requested file. */ FILE *file_open(char const *name, char const *mode); /* Internal File use only. Not used outside of this directory, needed here to allow proper compilation of the static inline functions below */ #include "../symbol/symbol.h" /* public interface continues from here */ /* NULL: no XXincludePath defined */ static inline char const *file_includePath(HashMap *symtab) { return symbol_value(hashmap_find(symtab, "XXincludePath", SYMBOL)); } #endif yodl-4.04.00/file/filecopy2offset.c0000644000175000017500000000367114066072154016014 0ustar frankfrank#include "file.ih" void file_copy2offset(FILE *dest, FILE *src, long src_end) { register char *buffer = new_memory(BLOCK_FILE, sizeof(char)); long tocopy = src_end - ftell(src); if (tocopy <= 0) /* program may have eaten */ { /* some bytes, yet */ int nread; if (src_end != EOF) /* not copy to EOF ? */ { free(buffer); return; /* then done */ } while (true) { nread = fread(buffer, 1, BLOCK_FILE, src); if (nread <= 0) { free(buffer); return; } fwrite(buffer, (size_t)nread, 1, dest); } } while /* All until last BLOCK */ ( tocopy > BLOCK_FILE /* more than 1 block waits */ && /* AND */ fread(buffer, BLOCK_FILE, 1, src) == 1 /* we read 1 block */ && /* AND */ fwrite(buffer, BLOCK_FILE, 1, dest) == 1/* we wrote 1 block */ ) tocopy -= BLOCK_FILE; if /* copy the last block */ ( tocopy <= BLOCK_FILE /* at most 1 block waits */ && /* AND */ /* we read the req'd chars */ fread(buffer, (size_t)tocopy, 1, src) == 1 && /* AND */ /* we wrote the req'd chars */ fwrite(buffer, (size_t)tocopy, 1, dest) == 1 ) { free(buffer); return; } message_show(MSG_ALERT); message("file_copy2offset() r/w error"); } yodl-4.04.00/file/fsearchpath.c0000644000175000017500000000301614066072154015172 0ustar frankfrank#include "file.ih" char *f_search_path(char const *request, String *fname, char const *path) { char *local_path = new_str(path); char *path_element = strtok(local_path, ":"); char *ret = NULL; while (path_element) { Result result; String currentName; if (message_show(MSG_NOTICE)) message("Trying to open `%s/%s'", path_element, request); if (*path_element != '.') /* not relative path element */ string_construct(¤tName, path_element); else { char *cp = new_getcwd(); string_construct(¤tName, cp); free(cp); string_addstr(¤tName, path_element); } f_fullname(¤tName, fname); result = f_opt_extension(¤tName); ret = new_str(string_str(¤tName)); string_destruct(¤tName); if (result == SUCCESS) { if (message_show(MSG_INFO)) message("File `%s' is read as `%s'", request, ret); break; } if (message_show(MSG_NOTICE)) message("File `%s' is not found as `%s[%s]'", request, ret, DEFAULT_EXT); free(ret); if (!(path_element = strtok(NULL, ":"))) { if (message_show(MSG_NOTICE)) message("Can't find `%s[%s]'", request, DEFAULT_EXT); ret = NULL; } } free(local_path); string_destruct(fname); return ret; } yodl-4.04.00/file/fileappend.c0000644000175000017500000000023614066072154015012 0ustar frankfrank#include "file.ih" void file_append(FILE *dest, char const *path) { FILE *f = file_open(path, "r"); file_copy2offset(dest, f, EOF); fclose(f); } yodl-4.04.00/file/file.ih0000644000175000017500000000120114066072154013771 0ustar frankfrank#include "file.h" #include "../config.h" #include #include #include #include #include #include "../new/new.h" #include "../message/message.h" #include "../string/string.h" #include "../args/args.h" #define BLOCK_FILE 1000 char *f_as_is(char const *request, String *fname); void f_fullname(String *fullname, String const *filename); bool f_isReadable(String const *name); Result f_opt_extension(String *name); char *f_search_path(char const *request, String *name, char const *path); char const *f_dotExtension(char const *filename); // 0 if no dot extension yodl-4.04.00/file/fileopen.c0000644000175000017500000000057114066072154014506 0ustar frankfrank#include "file.ih" FILE *file_open(char const *name, char const *mode) { FILE *file; if (!strcmp (name, "-")) /* stdin/out? */ return *mode == 'r' ? stdin : stdout; if (!(file = fopen(name, mode))) if (message_show(MSG_CRIT)) message("Can't %s `%s'", *mode == 'r' ? "read" : "write", name); return file; } yodl-4.04.00/file/filedirname.c0000644000175000017500000000025214066072154015160 0ustar frankfrank#include "file.ih" char *file_dirname(char const *path) { char *cp; char *ret; ret = new_str(dirname(cp = new_str(path))); free(cp); return ret; } yodl-4.04.00/file/fisreadable.c0000644000175000017500000000055114066072154015144 0ustar frankfrank#include "file.ih" bool f_isReadable(String const *name) { struct stat statbuf; char const *nm = string_str(name); return !stat(nm, &statbuf) /* `name' exists */ && S_ISREG(statbuf.st_mode) /* and is a regular file */ && access(nm, R_OK) == 0; /* and is readable by the Yodl process */ } yodl-4.04.00/file/fileextension.c0000644000175000017500000000046614066072154015564 0ustar frankfrank#include "file.ih" char *file_extension(char const *path) { register char const *ext = f_dotExtension(path); return !ext++ || strlen(ext) == 0 ? /* none found: return 0 */ 0 : new_str(ext); /* or return the extension */ } yodl-4.04.00/file/filefullpath.c0000644000175000017500000000114214066072154015357 0ustar frankfrank#include "file.ih" char *file_fullpath(HashMap *symtab, char const *filename) { String fname; char const *includePath; if (message_show(MSG_NOTICE)) message("Looking for file `%s'", filename); string_construct(&fname, filename); includePath = file_includePath(symtab); return *filename == '/' || !includePath ? /* absolute path, or no */ f_as_is(filename, &fname) /* include path */ : f_search_path(filename, &fname, /* or search the path */ includePath); } yodl-4.04.00/file/filebasename.c0000644000175000017500000000025414066072154015316 0ustar frankfrank#include "file.ih" char *file_basename(char const *path) { char *cp; char *ret; ret = new_str(basename(cp = new_str(path))); free(cp); return ret; } yodl-4.04.00/file/fdotextension.c0000644000175000017500000000030214066072154015566 0ustar frankfrank#include "file.ih" char const *f_dotExtension(char const *path) { register char const *slash = strrchr(path, '/'); return strrchr(slash ? slash : path, '.'); /* find last . */ } yodl-4.04.00/file/fasis.c0000644000175000017500000000073614066072154014015 0ustar frankfrank#include "file.ih" char *f_as_is(char const *request, String *fname) { char *str; if (f_opt_extension(fname) == SUCCESS) { str = new_str(string_str(fname)); if (message_show(MSG_INFO)) message("`%s' is read as `%s'", request, str); } else { str = NULL; if (message_show(MSG_NOTICE)) message("`./%s[%s] is not readable", request, DEFAULT_EXT); } string_destruct(fname); return str; } yodl-4.04.00/file/foptextension.c0000644000175000017500000000212114066072154015603 0ustar frankfrank#include "file.ih" /* if {name} has a .yo extension by itself or if a file {name}.yo exists, then use that file. Otherwise if the file {name} exists, use that file Otherwise report failure */ Result f_opt_extension(String *name) { register char const *ext = f_dotExtension(string_str(name)); if ( ext && strcmp(ext, DEFAULT_EXT) == 0 /* the extension is DEFAULT_EXT */ && f_isReadable(name) /* and a readable file */ ) return SUCCESS; /* then {name} is readable */ String orgName; string_construct(&orgName, string_str(name)); string_addstr(name, DEFAULT_EXT); /* try our default extension */ if (f_isReadable(name)) /* Readable: then OK */ { string_destruct(&orgName); return SUCCESS; } string_swallow(name, &orgName); /* Reset the name to the original */ /* and see if that one can be read */ return f_isReadable(name) ? SUCCESS : FAILED; } yodl-4.04.00/hashitem/0000755000175000017500000000000014066072154013421 5ustar frankfrankyodl-4.04.00/hashitem/hashitemchangekey.c0000644000175000017500000000024714066072154017251 0ustar frankfrank#include "hashitem.ih" void hashitem_changekey(register HashItem *hashitem, char const *newkey) { free(hashitem->d_key); hashitem->d_key = new_str(newkey); } yodl-4.04.00/hashitem/hashitem.h0000644000175000017500000000475214066072154015404 0ustar frankfrank#ifndef INCLUDED_HASHITEM_H_ #define INCLUDED_HASHITEM_H_ #include "../root/root.h" /* ========================================================================= `private' functions are called hi_...() and are declared in hashitem.ih. A corresponding approach is followed for other structs, mentioned below. public functions are called hashitem...() */ typedef struct { SymbolType d_type; /* type of symbol */ char *d_key; /* ascii-z */ void *d_value; /* points to the value */ void (*d_destructor)(void *); /* knows how to destroy d_value */ } HashItem; HashItem *hashitem_new_destructor(SymbolType type, char const *key, void *value, void (*destructor)(void *)); HashItem *hashitem_new(char const *key, SymbolType type); void hashitem_delete(HashItem **hashitem); void hashitem_changekey(HashItem *hashitem, char const *key); Result hashitem_pop(HashItem *item); void hashitem_set(HashItem *item, void *value, void (*destructor)(void *)); /* Internal HashItem use only. Not used outside of this directory, needed here to allow proper compilation of the static inline functions below */ #include /* public interface continues from here */ static inline char const *hashitem_key(HashItem const *item) { return item->d_key; } static inline void hashitem_setType(register HashItem *item, SymbolType type) { item->d_type = type; } /* caller may not free */ /* the returned info */ /* modifying its contents */ /* is ok */ static inline void *hashitem_value(register HashItem *item) { return item != PFAILED ? item->d_value : PFAILED; } static inline SymbolType hashitem_fullType(register HashItem *item) { return item == PFAILED ? UNDEFINED_SYMBOL : item->d_type; } static inline bool hashitem_iskeytype(HashItem const *hashitem, char const *key, SymbolType type) { return (hashitem->d_type & type) && !strcmp(hashitem->d_key, key); } static inline SymbolType hashitem_type(register HashItem *item) { return item == PFAILED ? UNDEFINED_SYMBOL : (item->d_type & ANY); } #endif yodl-4.04.00/hashitem/hashitem.ih0000644000175000017500000000015414066072154015545 0ustar frankfrank#include "hashitem.h" #include "../new/new.h" #include "../stack/stack.h" #include "../message/message.h" yodl-4.04.00/hashitem/hashitemset.c0000644000175000017500000000030414066072154016100 0ustar frankfrank#include "hashitem.ih" void hashitem_set(register HashItem *item, void *value, void (*destructor)(void *)) { item->d_value = value; item->d_destructor = destructor; } yodl-4.04.00/hashitem/hashitemerase.c0000644000175000017500000000026514066072154016412 0ustar frankfrank#include "hashitem.ih" void hashitem_delete(register HashItem **item) { (*(*item)->d_destructor)((*item)->d_value); free((*item)->d_key); free(*item); *item = 0; } yodl-4.04.00/hashitem/hashitempop.c0000644000175000017500000000042414066072154016106 0ustar frankfrank#include "hashitem.ih" Result hashitem_pop(register HashItem *item) { register Stack *sp; if (item == PFAILED) return FAILED; sp = (Stack *)hashitem_value(item); if (!stack_size(sp)) return FAILED; stack_pop(sp); return SUCCESS; } yodl-4.04.00/hashitem/hashitemconstruct.c0000644000175000017500000000044314066072154017335 0ustar frankfrank#include "hashitem.ih" HashItem *hashitem_new_destructor(SymbolType type, char const *key, void *value, void (*destructor)(void *)) { register HashItem *ret = hashitem_new(key, type); hashitem_set(ret, value, destructor); return ret; } yodl-4.04.00/hashitem/hashitemnew.c0000644000175000017500000000041114066072154016075 0ustar frankfrank#include "hashitem.ih" HashItem *hashitem_new(char const *key, SymbolType type) { HashItem *ret = new_calloc(1, // strlen(key) + sizeof(HashItem)); ret->d_key = new_str(key); ret->d_type = type; return ret; } yodl-4.04.00/hashmap/0000755000175000017500000000000014066072154013240 5ustar frankfrankyodl-4.04.00/hashmap/hashmapfind.c0000644000175000017500000000044214066072154015666 0ustar frankfrank#include "hashmap.ih" /* Returns pointer to HashItem corresponding to searched element or PFAILED */ HashItem *hashmap_find(register HashMap *map, char const *key, SymbolType type) { size_t idx = hm_find_idx(map, key, type); return idx == UFAILED ? PFAILED : map->d_map[idx]; } yodl-4.04.00/hashmap/hashmap.ih0000644000175000017500000000130314066072154015200 0ustar frankfrank#include "hashmap.h" #include #include #include "../new/new.h" #include "../message/message.h" typedef enum { FREE = 0, ACTIVE = 1, REMOVED = ~0 } HashmapValue; #define asHashmapValue(x) ((x) == (void *)FREE ? FREE : \ (x) == (void *)REMOVED ? REMOVED : \ ACTIVE) void hm_expand(HashMap *symtab); void hm_reshuffle(HashMap *symtab); size_t hm_find(size_t *idx, HashItem **map, size_t size, char const *key); size_t hm_find_idx(HashMap *map, char const *key, SymbolType type); size_t hm_pjw(char const *key); yodl-4.04.00/hashmap/hmpjw.c0000644000175000017500000000067314066072154014537 0ustar frankfrank#include "hashmap.ih" /* returns hashvalue for the symboltable */ size_t hm_pjw(char const *key) { register size_t h = 0; register size_t g; while (*key) { h <<= 4; h += *key; /* set most significant nibble */ g = h & ~( (size_t)~0 >> 4 ); if (g) { h ^= g >> 8; h ^= g; } key++; } return h; } yodl-4.04.00/hashmap/hashmapdestroy.c0000644000175000017500000000034214066072154016436 0ustar frankfrank#include "hashmap.ih" void hashmap_destruct(register HashMap *map) { for (; map->d_size--; ) { if (map->d_map[map->d_size]) hashitem_delete(&map->d_map[map->d_size]); } free(map->d_map); } yodl-4.04.00/hashmap/hashmaptextof.c0000644000175000017500000000041214066072154016254 0ustar frankfrank#include "hashmap.ih" char const *hashmap_textOf(register HashMap *map, char const *key) { size_t idx = hm_find_idx(map, key, ANY); return (idx == UFAILED) ? "" : (char const *)hashitem_value(map->d_map[idx]); } yodl-4.04.00/hashmap/hashmapconstructtext.c0000644000175000017500000000047014066072154017700 0ustar frankfrank#include "hashmap.ih" void hashmap_constructText(HashMap *map, char const *(*ptr)[2]) { hashmap_construct(map); while ((*ptr)[0]) { hashmap_insert ( map, hashitem_new_destructor(CHARPTR, (*ptr)[0], new_str((*ptr)[1]), free) ); ptr++; } } yodl-4.04.00/hashmap/hmreshuffle.c0000644000175000017500000000125614066072154015720 0ustar frankfrank#include "hashmap.ih" void hm_reshuffle(register HashMap *symtab) { size_t newsize = symtab->d_size; size_t n; register HashItem **old = symtab->d_map; HashItem **new = new_calloc(newsize, sizeof(HashItem *)); for (n = 0; n < symtab->d_n; ++old) /* visit all OLD elements */ { /* Got one */ if (*old != (HashItem *)FREE && *old != (HashItem *)REMOVED) { size_t idx; if (hm_find(&idx, new, newsize, (*old)->d_key) == UFAILED) new[idx] = *old; ++n; } } free(symtab->d_map); symtab->d_map = new; } yodl-4.04.00/hashmap/hashmaprename.c0000644000175000017500000000110714066072154016214 0ustar frankfrank#include "hashmap.ih" HashItem *hashmap_rename(register HashMap *map, char const *name, char const *newName) { register HashItem *item; size_t currentIdx = hm_find_idx(map, name, MACRO | BUILTIN); size_t newIdx; if (currentIdx == UFAILED) return PFAILED; if (hm_find(&newIdx, map->d_map, map->d_size, newName) != UFAILED) return 0; hashitem_changekey(item = map->d_map[currentIdx], newName); map->d_map[newIdx] = item; map->d_map[currentIdx] = (void *)REMOVED; return item; } yodl-4.04.00/hashmap/hmfindidx.c0000644000175000017500000000160014066072154015353 0ustar frankfrank#include "hashmap.ih" /* Returns idx to HashItem corresponding to searched element or FAILED */ size_t hm_find_idx(register HashMap *map, char const *key, SymbolType type) { size_t prime = map->d_size; size_t hashValue = hm_pjw(key) % prime; size_t idx; if (!hashValue) /* make sure no initial hashvalue is 0, */ hashValue++; /* as that invalidates add the hash rehash */ idx = hashValue; while (1) { register HashItem *atIdx = map->d_map[idx]; switch (asHashmapValue(atIdx)) { case FREE: return UFAILED; case REMOVED: break; case ACTIVE: if (hashitem_iskeytype(atIdx, key, type)) return idx; break; } idx = (idx + hashValue) % prime; /* element in use: rehash */ } } yodl-4.04.00/hashmap/hashmapconstruct.c0000644000175000017500000000023414066072154016771 0ustar frankfrank#include "hashmap.ih" void hashmap_construct(register HashMap *map) { memset(map, 0, sizeof(HashMap)); map->d_prime_idx = 0; hm_expand(map); } yodl-4.04.00/hashmap/hmfind.c0000644000175000017500000000342214066072154014652 0ustar frankfrank#include "hashmap.ih" /* returns o idx of key if key was found In this case, the index of the key that was found is returned too. o FAILED, if not found. In this case, the index that can be used to store key is returned. The hashitem vector may not be completely filled up. `prime' must be a prime, indicating the size of the map-vector. */ size_t hm_find(size_t *idxPtr, register HashItem **map, size_t prime, char const *key) { size_t hashValue = hm_pjw(key) % prime; size_t returnValue = UFAILED; size_t idx; if (!hashValue) /* make sure no initial hashvalue is 0, */ hashValue++; /* as that invalidates add the hash rehash */ idx = hashValue; while (1) { register HashItem *atIdx = map[idx]; switch (asHashmapValue(atIdx)) { case FREE: *idxPtr = returnValue != UFAILED ? returnValue /* return returnValue if set */ : /* otherwise return idx */ idx; return UFAILED; /* indicate key not found */ case REMOVED: if (returnValue == UFAILED) /* returned index not yet set */ returnValue = idx; /* set it to REMOVED location */ break; case ACTIVE: /* return idx of matching keys */ if (!strcmp(key, atIdx->d_key)) return *idxPtr = idx; break; } /* element in use: rehash */ idx = (idx + hashValue) % prime; } } yodl-4.04.00/hashmap/hmexpand.c0000644000175000017500000000154714066072154015217 0ustar frankfrank#include "hashmap.ih" static size_t primes[] = { 0, /* not used, but immediately skipped by hm_expand() */ #if 0 97, /* the initial primes are not used. Normally we'll use */ 149, /* several hundreds of identifiers */ 191, 241, #endif 293, 347, 397, 491, 593, 691, 797, 907, 1009, 1201, 1409, 1601, 1801, 2003, 3001, 4001, 5003, 6007, 7001, 8009, 9001, 10007, 12007, 14009, 16001, 18013, 20011, }; void hm_expand(register HashMap *symtab) { if (++symtab->d_prime_idx == sizeof(primes) / sizeof(size_t)) if (message_show(MSG_EMERG)) message("hashmap_resize(): prime table exhausted\n"); symtab->d_size = primes[symtab->d_prime_idx]; hm_reshuffle(symtab); } yodl-4.04.00/hashmap/hashmaperase.c0000644000175000017500000000050414066072154016044 0ustar frankfrank#include "hashmap.ih" Result hashmap_erase(register HashMap *map, char const *name, SymbolType type) { register size_t idx = hm_find_idx(map, name, type); if (idx == UFAILED) return idx; hashitem_delete(&map->d_map[idx]); map->d_map[idx] = (void *)REMOVED; map->d_n--; return SUCCESS; } yodl-4.04.00/hashmap/hashmap.h0000644000175000017500000000421314066072154015032 0ustar frankfrank#ifndef INCLUDED_HASHMAP_H_ #define INCLUDED_HASHMAP_H_ /* ====================================================================== The hashtable contains a vector of pointers to hashitems. The hashItems are all freeable. HashItems know how to free themselves functions are called hashmap...() */ #include "../root/root.h" #include "../hashitem/hashitem.h" typedef struct { size_t d_size; /* physical size */ size_t d_n; /* actual n stored */ size_t d_prime_idx; /* currently used index in primetable */ HashItem **d_map; /* actual hashmap */ } HashMap; void hashmap_construct(HashMap *map); /* initialize from ptr, until *ptr == 0 */ void hashmap_constructText(HashMap *map, char const *(*ptr)[2]); void hashmap_destruct(HashMap *map); /* SUCCESS: Item is removed from the map */ Result hashmap_erase(HashMap *map, char const *key, SymbolType type); /* PFAILED if not found. */ HashItem *hashmap_find(HashMap *map, char const *key, SymbolType type); /* hashitem will be owned by map */ Result hashmap_insert(HashMap *map, HashItem *hashitem); void hashmap_keys(HashMap *map); /* display to stderr */ /* FAILED: no name MACRO/BUILTIN, NULL: */ /* newname already in use, otherwise: ok */ HashItem *hashmap_rename(HashMap *map, char const *name, char const *newname); /* returns text (or "") of key, but the */ /* hashitem's value must be a char * */ char const *hashmap_textOf(HashMap *map, char const *key); size_t hashmap_value(HashMap *map, size_t idx); /* type at map[idx]. idx must be valid */ static inline SymbolType hashmap_symboltype(register HashMap *map, size_t idx) { return hashitem_type(map->d_map[idx]); } #endif yodl-4.04.00/hashmap/hashmapinsert.c0000644000175000017500000000076614066072154016263 0ustar frankfrank#include "hashmap.ih" /* returns idx of inserted element or FAILED, if already inserted */ Result hashmap_insert(register HashMap *map, register HashItem *hashitem) { size_t idx; if (map->d_n * 100 > map->d_size * 70) hm_expand(map); if ( hm_find(&idx, map->d_map, map->d_size, hashitem_key(hashitem)) == UFAILED ) { map->d_map[idx] = hashitem; map->d_n++; return idx; } return FAILED; } yodl-4.04.00/hashmap/hashmapkeys.c0000644000175000017500000000121014066072154015713 0ustar frankfrank#include "hashmap.ih" void hashmap_keys(register HashMap *map) { size_t idx; fprintf(stderr, "There are %u active keys\n", (unsigned)map->d_n); for (idx = 0; idx < map->d_size; idx++) { register HashItem *atIdx = map->d_map[idx]; switch (asHashmapValue(atIdx)) { case FREE: continue; case REMOVED: fprintf(stderr, " %3u: \n", (unsigned)idx); break; case ACTIVE: fprintf(stderr, " %3u: `%s'\n", (unsigned)idx, atIdx->d_key); break; } } fputs("[completed]\n", stderr); } yodl-4.04.00/HIERARCHY0000644000175000017500000006307014066072154013066 0ustar frankfrankp_parlist_symbol can be simplified: only CHAR() is exec'ed in NOEXPAND(), NOEXPAND_EXEC can be kept, but several other definitions can be removed from root.h and parserconstruct.c root | message | new | +-------+-------+ | | string queue | | | media | | +---+-------+---+-------+ | | | | | | | | | +-------+ | | | | | subst args stack | | | | | | | hashitem | | | | | | | hashmap | | | | | | | +---+---+ | | | | | | | | symbol | | | | | | | | +-------+ | | | | | | | file | | | | | | +-------+ +-------+-------+-------+ | | | | | | | | lexer ostream chartab counter macro builtin | | | | | | | | +-------+-------+-------+-------+-------+-------+ | | process parser | | +-----------+-------+ | (yodl) Lexer: lexer_lex() returns next token (get matched text from lexer_text()). It calls l_lex() to retrieve the next character from the info waiting to be read l_lex(): calls l_nextchar() to obtain the next token, and appends all char-tokens to the lexer's matched text buffer. Potential compound symbols (words, numbers) are combined by l_compound() and then returned as TOKEN_PLAINCHAR or a compound token like TOKEN_IDENT. l_nextchar() calls l_get() to get the next character, and handles escape chars, including \ at eoln l_get() if there are no media, EOF is returned. If there are media then l_subst_get() will retrieve the next character, handling possible SUBST() definitions. At the end of the current input buffer (memory buffer or file) l_pop() is attempted to reactivate the previous buffer. If this succeeds, EOR is returned, otherwise EOF is returned. So, the lexer is not able to switch between truly nested media, as in EVAL() calls, but is able to switch between nested buffers resulting from replacing macro calls by their definitions. l_subst_get() calls l_media_get() to get the next char from the media. The next char is passed to subst_find() which is a Finite State Automaton (FSA) trying to match the longest subst. This may be done repeatedly, and eventually subst_text() will either return a substitution text, or the next plain character. A substitution text is pushed onto the lexer's media buffer. The next character returned is then the next one to appear at the lexer's media buffer. l_media_get() If the current active source of information is a file, it returns the next character from that file or EOF if no such char is available anymore. If the current active source is a memory buffer then the next char from the buffer is returned. If the buffer is empty EOF is returned. The media buffer is a circular, self-expanding Queue. -------------------------------------------------------------------------- The parser's standard mode of operation is to read and process the information which is read from its input media and generate its output to the output stream. Note that at this point all SUBSTitutions have already been performed. The parser's processing mode is altered in several situations: When a parameter list is encountered, i.e., when something between ( and ) is recognized as part of a builtin function or macro call, these parameter lists are processed individually. Within a parameter list itself, information is normally not interpreted. However, the parameter list may be pushed back on the lexer's input stack, in which case it can be interpreted. Under normal circumstances, a parameter list is read from its initial to its final character. Its surrounding parentheses are not considered part of the parameter list's contents. In order to realize this handling, p_handle_symbol() may be configured to recognize all MACRO and BUILTIN functions, only the EVAL() builtin function or no builtin functions or macros at all. The parser repeatedly requests tokens from the lexer, and will then call the corresponding handling function. For each token there is a corresponding handling function stored in an array of function pointers. Since these are pointers, they are highly configurable, and consequently, a stack can be used to activate a particular handling type merely by changing the pointers. These functions return bool values, with `false' indicating that the retrieval of tokens should be stopped. By default, all other tokens do p_handle_default, inserting the matched text into the output media. Also, TOKEN_UNKNOWN calls p_unknown_token(), doing an EMERG message, thus exiting. Other specific situations are handled by specific functions: Default outer-level processing: ------------------------------- The output medium in the default case is the output stream. The output function is p_insert_ostream, configured via the p_insert function pointer. TOKEN_EOF, - p_handle_default_eof returns false TOKEN_EOR - p_unexpected_eor TOKEN_SYMBOL, - p_handle_default_symbol handles macros and builtins TOKEN_NEWLINE, - p_handle_default_newline TOKEN_PLUS, - p_handle_default_plus Default Parameter list processing: ---------------------------------- The output medium is a String, d_string_ptr, with nested versions stored in the d_string_st. The output function is p_insert_string, writing to the d_string_ptr String. TOKEN_UNKNOWN, - p_unknown_token TOKEN_EOF, - p_handle_parlist_eof (MSG_EMERG) TOKEN_SYMBOL, - p_handle_parlist_symbol handles EVAL, NOTRANS, NOEXPAND in parameter lists TOKEN_OPENPAR, - p_handle_parlist_openpar handles open-parenhesis counting TOKEN_CLOSEPAR, - p_handle_parlist_closepar- handles close-paren counting: true indicates: back at 0-count Standard processing: -------------------- Recognize all macros and builtins, Output to the standard output media Implementation in parser_construct(): * d_handle is set to ps_handleSet[DEFAULT_SET] * d_insert is set to p_insert_ostream * d_chartab points to p_no_chartab. Parameter-list processing: -------------------------- Recognize EVAL, NOTRANS, NOEXPAND output media is String TRANS() and NOEXPAND() are copied, including keyword, to the output media Implementation: in parser_parlist(): * d_handle is saved, then set to ps_handleSet[PARLIST_SET] * builtin's NOEXPAND and NOTRANS function ptrs are set to p_insert_builtin * d_string_ptr is pushed to d_string_st, then assigned to new String * p_parse() is run: the parameter list is parsed * the saved elements are restored, and the produced string is returned. EVAL() processing: ------------------ The obtained parameter list is evaluated, using standard evaluations, and the evaluated text is inserted in the current output media. Implementation in gram_EVAL(): * parameter list is obtained * d_handle is saved, then set to ps_handleSet[DEFAULT_SET] * nested parsing and scanning is activated, using p_begin_nested() and lexer_begin_nested() * p_parse() is run: the parameter list is evaluated * the saved elements are restored, and the produced string is inserted into the output media NOEXPAND() processing: ---------------------- The parameter list is obtained without interpretation, and is inserted into the output media Implementation in gram_NOEXPAND(): * d_handle is saved, then set to ps_handleSet[NOEXPAND_SET] * the parameter list is obtained * the saved value are restored, and the obtained text is inserted into the output media NOTRANS() processing: --------------------- The currently active character table is suppressed, and NOEXPAND is executed. Then the suppressed character table is reactivated Implementation in gram_NOTRANS() * the currently active chartab is pushed, installing chartab 0 * the parameter list is obtained * the saved value are restored, and the obtained text is inserted into the output media * the currently active chartab is restored. Macro handling: --------------- The parameter lists are obtained. ARGxx occurrences in the macro's definition are replaced by the matching argument texts The thus modified text is inserted into the output media. ============================================================= The heart of Yodl is its parser. The parser processes the input and in the process calls its builtin and user defined macros. Here's what's happening when the parser recognizes a parameter list, builtin or a macro: parameter list: the list is grabbed, unaltered. macro: the arguments replace the parameters, and the thus modified definition is inserted back into the input: A() -> NOTRANS(<)B()NOTRANS(>) will result in new input: NOTRANS(<)B()NOTRANS(>) this will next: * handle NOTRANS(<) (see below) * reinsert B(), e.g. B() is: B() -> hello world * process hello, world, where the (end-of-record) is used to separate B()'s definition from what follows. Eventually is returned, marking the end of the input media. This, however might be a temporary EOF, at the end of a nested evaluation. * NOTRANS(>) is handled. builtins: Builtins need not generated output, like the definition of a macro. Only those producing output are mentioned below: special parameter lists: empty_parlist: The parameter list is collected, but must be empty. A WARNING is issued if not, but not an error. name_parlist: must be a name. The parameter list is collected, and taken `as-is' EVAL() calls are therefore not supported here and neither are CHARTABLE translations. number_parlist: must be a number or the name of a counter. The parameter list is collected and is then scanned for a value or the name of a counter. EVAL() calls are not supported here and neither are CHARTABLE translations. Both name- and number-parlists skip subsequent whitespace. (Nested) Parsing is done by: DEFAULT_SET process macros builtins, using current output medium. char interpretation if active output to ostream or current string SKIPWS_SET ignore all whitespace and EOR. the next non-ws symbol is returned nex EOF is error condition Parsing of parameter lists is done by: COLLECT_SET, read the parameter list's contents no char interpretation output to separate string INSERT_SET read the parameter list's contents no character interpretation output to currently active medium, no separate string. IGNORE_SET read the parameter list's contents no char interpretation ignore the output NOEXPAND_SET read the parameter list's contents char transformation if appropriate output to currently active medium, no separate string All other text is parsed by DEFAULT_SET. See parser/psetuphandlerset.c for details. Paragraph handling is done by parser/pparagraph.c. When multiple newlines were detected, p_paragraph() is called. If a PARAGRAPH macro has been defined, its expansion is evaluated, and the evaluated text is inserted into the output stream without any further CHAR() translation. While evaluating PARAGRAPH, recursive calls of PARAGRAPH are prevented, and any series of newlines generated by the PARAGRAPH itself are then inserted directly into the output stream. The newlines are also inserted into the output stream if the PARAGRAPH macro is not defined. ============================================================================ Functions: `E' indicates that the argument is evaluated and then I: inserted into the input media, O: inserted into the output media, P: printed ============================================================================ - I ATEXIT - at the end of the input, the argument is pushed onto the input for evaluation - O CHAR - the character is inserted into the current output media - O COUNTERVALUE - the countervalue is inserted into the output media E P ERROR - input is parsed by eval, and then printed E I EVAL - the argument is parsed and its output is collected in a string, which is then inserted into the input. - O FILENAME - the current filename is inserted into the output media. E P FPUTS - the 1st argument is parsed by eval and then appended to the file given as its second arg. - I IFBUILTIN - the argument matching the condition is pushed onto the input. All other if-builtins are handled similarly - I INCLUDEFILE - the parsing of the current file is suspended, and parsing switches to the new file. Once completed, parsing continues at the suspended file. Begin and End of file are separators. INCLUDELIT = INCLUDENOEXPAND - O NOEXPAND - the argument is scanned, and only CHAR() calls are interpreted. The produced characters are inserted into the output media. - O NOEXPANDINCLUDE - combination of NOEXPAND() and INCLUDEFILE(): the file is inserted into the output media, honoring CHAR() calls. If that's not appropriate push an empty character table before doing NOEXPANDINCLUDE() - O NOEXPANDPATHINCLUDE - like NOEXPANDINCLUDE(), but the Yodl insert path is followed to find the indicated file. - O NOTRANS - the currently active character table is suppressed, and the argument is inserted literally into the output media. - O OUTBASE - the basename (filename) of the currently parsed input file is inserted into the output stream. Other out* builtins are handled similarly. - I PIPETHROUGH - the output of a process is inserted into the input media. - I SYMBOLVALUE - the value of the symbol is inserted into the input media. E P TYPEOUT - the argument is evaluated and sent to the standard error stream. E O UPPERCASE - the argument is evaluated, then transformed to uppercase and subsequently inserted into the output media. - O USECOUNTER - the incremented countervalue is inserted into the output media. E P WARNING like TYPEOUT. WRITEOUT = FPUTS ----------------------------------------------------------------------- Functions reinserting information into the input media: - I ATEXIT - at the end of the input, the argument is pushed onto the input for evaluation E I EVAL - the argument is parsed and its output is collected in a string, which is then inserted into the input. - I IFBUILTIN - the argument matching the condition is pushed onto the input. All other if-builtins are handled similarly - I INCLUDEFILE - the parsing of the current file is suspended, and parsing switches to the new file. Once completed, parsing continues at the suspended file. Begin and End of file are separators. - I PIPETHROUGH - the output of a process is inserted into the input media. - I SYMBOLVALUE - the value of the symbol is inserted into the input media. ---------------------------------------------------------------------- Functions directly inserting into the output media: - O CHAR - the character is inserted into the current output media - O COUNTERVALUE - the countervalue is inserted into the output media - O FILENAME - the current filename is inserted into the output media. - O NOEXPAND - the argument is scanned, and only CHAR() calls are interpreted. The produced characters are inserted into the output media. - O NOEXPANDINCLUDE - combination of NOEXPAND() and INCLUDEFILE(): the file is inserted into the output media, honoring CHAR() calls. If that's not appropriate push an empty character table before doing NOEXPANDINCLUDE() - O NOEXPANDPATHINCLUDE - like NOEXPANDINCLUDE(), but the Yodl insert path is followed to find the indicated file. - O NOTRANS - the currently active character table is suppressed, and the argument is inserted literally into the output media. - O OUTBASE - the basename (filename) of the currently parsed input file is inserted into the output stream. Other out* builtins are handled similarly. E O UPPERCASE - the argument is evaluated, then transformed to uppercase and subsequently inserted into the output media. - O USECOUNTER - the incremented countervalue is inserted into the output media. ========================================================================= When information is inserted into the output media, the output media selector may target the output stream or a string: which one will be used depends on the builtin: E.g, EVAL() (and parser_eval(), which is called by it) writes to a string, the default output target is a stream. Independently of the output target, character tables may be used. Chartables may be suppressed, by CHAR() and NOTRANS(), or simply not required. Depending on the situation, the input selector will use or not use character tables. As an example: assume the following macros are defined: A() -> NOTRANS(<) B() -> NOTRANS(>) C() -> NOTRANS(/>) D() -> A()strong+B()hi+A()strong+C() the call D() will be handled as follows (each line represents a string-push ending in EOF which is interpreted as a separator: D() -> A()strong+B()hi+A()strong+C() NOTRANS(<)strong+B()hi+A()strong+C() output: < strong+B()hi+A()strong+C() output: strong B()hi+A()strong+C() NOTRANS(>)hi+A()strong+C() output: > hi+A()strong+C() output: hi (etc) ============================================================================= White space handling -------------------- OUTPUT: ------- When the white space level (controlled by INCWSLEVEL(), DECWSLEVEL(), PUSHWSLEVEL(x), POPWSLEVEL()) is unequal zero, output may only contain white space. If the ostream object detects non-whitespace output, it warns about the received non-whitespace text, and ignores it. This is primarily used to protect macro definitions from inadvertently outputting text. INPUT: ------ \ at the end of a line: ----------------------- The lexical scanner will consume all blanks following a final \ on a line of text. This includes empty lines, which is different from earlier versions of yodl, in which only the initial \n and subsequent blanks and tabs were consumed. Different too, is the feature that (when the white-space output level is non-zero) the lexer will automatically consume all white space starting at a newline. Consequently, no \ at eoln is required anymore when processing macros protected by INCWSLEVEL(). If this feature is not required, either temporarily push the whitespace level (PUSHWSLEVEL(0), or, in order to switch it off completely, provide the -k (keep whitespace) flag. MACRO EVALUATION: ----------------- The CHAR, NOTRANS, NOEXPAND, NOEXPANDINCLUDE and NOEXPANDPATHINCLUDE macros are evaluated as though the -k flag has been given. So, any whitespace appearing within these macros are output. The \ at eoln convention, however, is kept. In order to start a NOEXPAND() or NOTRANS() with a \, start its argument list with CHAR(\)\ (or, simply, write the \ as the first non-blank character at the next line): NOTRANS(\ \\ ) In order to define a macro in which white space should be taken seriously (e.g., in order to define a macro like XXnl() which should merely write a newline character to the output stream), consuming whitespace should temporarily be suppressed. So, the following will do so: PUSHWSLEVEL(0) DEFINEMACRO(XXnl)(0)(\ CHAR( )\ ) POPWSLEVEL() The PUSHWSLEVEL() suppresses the consumption of ws at the end of lines by the lexer, so the \n argument of CHAR() is recognized (and stored) as part of the macro's definition. Then, the former ws level is restored again. The \ at eoln are used to force the lexer to consume the ws which are not part of the macro's definition, but were inserted to enhance the macro's legibility. The CHAR() is used to prevent character table redefinitions of \n. There's no cure against \n SUBST() definitions, as the lexer never sees the SUBST() definitions. PARAGRAPH() is called if defined when multiple blanks were created in a row. To detect if PARAGRAPH() is called in a series, use the macro ifonlyblanks() This macro's first list is inserted if so, otherwise its second list is inserted. If necessary, define and request SYMBOLVALUE(XXparagraph) to obtain the actual string that triggered PARAGRAPH()'s call. ============================================================================= Organization of yodl2html-post: root | message | new | +-----+---+---+ | | | | | | lines string hashitem | | | | args hashmap | | | | +-------+ | | | file | | +-----+ | postqueue | yodl2html-post yodl-4.04.00/icmake/0000755000175000017500000000000014755317740013060 5ustar frankfrankyodl-4.04.00/icmake/stdcpp0000664000175000017500000000463314755310657014310 0ustar frankfranklist _inspect(string dstPrefix, list srcList, string library) { int idx; string ofile; string file; for (idx = listlen(srcList); idx--; ) { file = element(idx, srcList); ofile = dstPrefix + change_ext(file, "o"); // make o-filename // A file s must be recompiled if it's newer than its object // file o or newer than its target library l, or if neither o nor l // exist. // Since `a newer b' is true if a is newer than b, or if a exists and // b doesn't exist s must be compiled if s newer o and s newer l. // So, it doesn't have to be compiled if s older o or s older l. // redo if file has changed if (file older ofile || file older library) srcList -= (list)file; } return srcList; } list _inspect2(string dstPrefix, list srcList) { int idx; string ofile; string file; for (idx = listlen(srcList); idx--; ) { file = element(idx, srcList); ofile = dstPrefix + change_ext(file, "o"); // make o-filename // A file s must be recompiled if it's newer than its object // file o if (file older ofile) srcList -= (list)file; } return srcList; } // c_compile: compile all sources in `{srcDir}/{cfiles}', storing the object // files in {oDst}/filename.o void _c_compile(string oDst, list cfiles) { int idx; string compdest; string file; compdest = COMPILER + " -c -o " + oDst; #ifndef ECHO_COMPILE echo(OFF); #endif for (idx = listlen(cfiles); idx--; ) { file = cfiles[idx]; #ifndef ECHO_COMPILE printf << " " << file << '\n'; #endif g_compiled = 1; run(compdest + change_ext(file, "o") + " " + g_copt + " -c " + file); } echo(ON); } void std_cpp(string oDstDir, int prefix, string srcDir, string library) { list files; chdir(srcDir); oDstDir = "../" + oDstDir; md(oDstDir); oDstDir += "/" + (string)prefix; // make list of all files if (library == "") files = _inspect2(oDstDir, makelist("*.c")); else files = _inspect(oDstDir, makelist("*.c"), g_cwd + library); if (listlen(files)) { printf("Compiling sources in `" + srcDir + "'\n"); _c_compile(oDstDir, files); // compile files } chdir(g_cwd); } yodl-4.04.00/icmake/manualmacrolist0000644000175000017500000000127614066072154016174 0ustar frankfrank // manualMacroList creates the macros for the man- and manual-pages in // the file tmp/wip/macrolist.yo void manualMacroList() { list raw; int idx; chdir("macros/rawmacros"); raw = makelist("*.raw"); echo(OFF); run("rm -f ../../" + g_wip + "/macrolist.yo"); for (idx = 0; idx < listlen(raw); idx++) { // pick the documentation from the raw macros (delimited by the // and <> tags) and append it to macrolist.yo system("./startdoc.pl " + raw[idx] + " >> " "../../" + g_wip + "/macrolist.yo"); printf("."); } echo(ON); chdir(g_cwd); printf("\n"); } yodl-4.04.00/icmake/buildmacros0000644000175000017500000000415514066072154015304 0ustar frankfrank // base is the base location of the macros to build. // include path is the location where to find the macros // this should be ./ (local use, for man, manual) or STD_INCLUDE // // void buildMacros(string base, string includePath) void _configReplacements(string source, string base, string includePath) { source = change_ext(source, ""); run("scripts/configreplacements " + "macros/in/" + source + ".in " + base + source + ".yo " + includePath); } void _stdMacros(string base, string includePath) { list std; int idx; string conversion; std = strtok(STD_CONVERSIONS, " "); // the list of format-conversions // Create the std..yo files, providing scratch filename, // destination directory, requested format, and STD_INCLUDE path for (idx = listlen(std); idx--; ) run("scripts/stdmacros " + g_wip + "/scratch " + base + " " + std[idx] + " " + includePath); } // base is the base location of the macros to build. // include path is the location where to find the macros // this should be ./ (local use, for man, manual) or STD_INCLUDE void buildMacros(string base, string includePath) { list in; int idx; md(base); base += "/"; run("rm -rf " + base + "*"); // remove old build-location chdir("macros/in"); // location of the format-specific macro in = makelist("*.in"); // files, like html.yo chdir(g_cwd); for (idx = listlen(in); idx--; ) // set the config.h info and create the _configReplacements(in[idx], base, includePath); // format-specific // files _stdMacros(base, includePath); // create the std..yo files, // like std.man.yo run("cp -r macros/yodl/* " + base); // install chartables, xlatin1.tex // and xml/ files } yodl-4.04.00/icmake/man0000644000175000017500000000470514755315274013564 0ustar frankfrankvoid _man(string source, string nr, int usePath, string macroBase) { string manDst; string manHtmlDst; string nrs; string includes; nrs = (string)nr; manDst = g_install + MAN + "/man" + nrs + "/" + source + "." + nrs; manHtmlDst = g_wip + "/man/" + source + "." + nrs + ".html"; includes = " -I.:" + g_wip + ":" + macroBase; run("scripts/configreplacements " + "man/" + source + ".in " + g_wip + "/manyo.yo " + macroBase); // manyo.yo is the file to convert to a man-page if (usePath) // use yodl/yodlpost via yodl2man { putenv("YODL_BIN=" + g_cwd + g_install + BIN); run("yodl2man" + includes + " -o" + manDst + " " "manyo"); run("yodl2html" + includes + " -o" + manHtmlDst + " " "manyo"); } else { run(g_install + BIN + "/yodl" + includes + " -o" + g_wip + "/out man manyo"); run(g_install + BIN + "/yodlpost " + g_wip + "/out.idx " + g_wip + "/out " + manDst); run(g_install + BIN + "/yodl" + includes + " -o" + g_wip + "/outhtml html manyo"); run(g_install + BIN + "/yodlpost " + g_wip + "/outhtml.idx " + g_wip + "/outhtml " + manHtmlDst); } } void manExit(string path) { int usePath; string macroBase; usePath = path == "path"; macroBase = g_wip + "/macros"; // where to install the man-pages md(g_install + MAN + "/man1 " + g_install + MAN + "/man7"); md(g_wip + "/man"); // where to install the html man-pages _man("yodl", "1", usePath, macroBase); _man("yodlpost", "1", usePath, macroBase); _man("yodlverbinsert", "1", usePath, macroBase); _man("yodlstriproff", "1", usePath, macroBase); _man("yodlconverters", "7", usePath, macroBase); _man("yodlbuiltins", "7", usePath, macroBase); _man("yodlmanpage", "7", usePath, macroBase); _man("yodlletter", "7", usePath, macroBase); _man("yodlmacros", "7", usePath, macroBase); _man("yodltables", "7", usePath, macroBase); exit(0); } yodl-4.04.00/icmake/macros0000644000175000017500000000034014066072154014254 0ustar frankfrankvoid makeMacros() { buildMacros(g_install + STD_INCLUDE + "/", STD_INCLUDE); buildMacros(g_wip + "/macros", "./"); manualMacroList(); } void macrosExit() { makeMacros(); exit(0); } yodl-4.04.00/icmake/stdcompile0000644000175000017500000000116414755306032015140 0ustar frankfrankvoid _static_library(string ofiles, string library) { if (!exists(library) || g_compiled) { run("ar r " + library + " " + ofiles); run("ranlib " + library); run("rm " + ofiles); } } void makeLibrary(string oDstDir, string library) { int index; g_compiled = 0; md(oDstDir); // compile all files for (index = g_nClasses; index--; ) std_cpp(oDstDir, index, g_classes[index], library); // ./stdcpp // make the library _static_library(oDstDir + "/*.o", library); } yodl-4.04.00/icmake/builtins0000644000175000017500000000331214066072154014623 0ustar frankfrankvoid _remakebuiltins(list files, string builtinsDef) { string file; string dest; int cid; int idx; string gramH; gramH = g_wip + "/gram.h"; printf("rebuilding " + builtinsDef + " and " + gramH + "\n"); run("rm -f " + gramH + " " + builtinsDef); fprintf(gramH, "#ifndef GRAM_H_\n", "#define GRAM_H_\n" "/*\n" " Automatically generated by build\n" " Do not edit\n" "*/\n" ); fprintf(builtinsDef, "/*\n" " Automatically generated by build\n" " Do not edit\n" "*/\n" "#include \"gram.h\"\n" "Builtin builtin_array[] = \n" "{\n" ); for (idx = 0; idx < listlen(files); idx++) { dest = ""; file = change_ext(files[idx], ""); for (cid = 4; cid < strlen(file); cid++) dest += file[cid]; dest = strupr(dest); fprintf(gramH, " void gram_", dest, "(void);\n"); fprintf(builtinsDef, " {\"", dest, "\", gram_", dest, " },\n"); } fprintf(gramH, "#endif\n"); fprintf(builtinsDef, " { 0, 0 }\n" "};\n"); } void buildBuiltins() { string file; list files; int idx; string builtinsDef; builtinsDef = g_wip + "/builtins.def"; chdir("yodl"); files = makelist("gram*.c"); chdir(g_cwd); for (idx = 0; idx < listlen(files); idx++) { file = files[idx]; if ("yodl/" + file younger builtinsDef) { _remakebuiltins(files, builtinsDef); break; } } } yodl-4.04.00/icmake/clean0000644000175000017500000000011214066072154014047 0ustar frankfrankvoid cleanupExit() { run("rm -rf tmp verbinsert/tmp"); exit(0); } yodl-4.04.00/icmake/run0000644000175000017500000000036514755307103013603 0ustar frankfrankint g_dryrun; // set to 1 if envvar DRYRUN was set in main() void runP(int testValue, string cmd) { if (g_dryrun) printf(cmd, "\n"); else system(testValue, cmd); } void run(string cmd) { runP(P_CHECK, cmd); } yodl-4.04.00/icmake/md0000644000175000017500000000070714066072154013377 0ustar frankfrank// md: target should be a series of blank-delimited directories to be created // If an element is a whildcard, the directory will always be created, // using mkdir -p. // // uses: run() void md(string target) { int idx; list paths; string dir; paths = strtok(target, " "); for (idx = listlen(paths); idx--; ) { dir = element(idx, paths); if (!exists(dir)) run("mkdir -p " + dir); } } yodl-4.04.00/icmake/gitlab0000644000175000017500000000027514066072154014241 0ustar frankfrankvoid gitlab() { run("cp -r tmp/wip/release.yo tmp/wip/man " "tmp/install/usr/share/doc/yodl-doc ../../wip"); run("cp changelog ../../wip/changelog.txt"); exit(0); } yodl-4.04.00/icmake/compilerss0000644000175000017500000000066714755305745015176 0ustar frankfrankvoid compileRSS() { CLASSES += "args builtin chartab counter file hashitem hashmap " "lexer lines macro media message new ostream parser " "postqueue process queue root stack string strvector " "subst symbol "; g_classes = strtok(CLASSES, " "); // list of classes g_nClasses = listlen(g_classes); makeLibrary(g_wip + "/rss", g_wip + "/libyodl.a"); // ./stdcompile } yodl-4.04.00/icmake/manual0000644000175000017500000000365014066072154014254 0ustar frankfrankvoid _manual(string conversion, int usePath, string macroBase) { string includes; string manualDestination; includes = " -I.:" + g_wip + ":" + macroBase + ":manual"; manualDestination = g_install + DOCDOC; if (usePath) { putenv("YODL_BIN=" + g_cwd + g_install + BIN); run("yodl2" + conversion + includes + " -o" + manualDestination + " manual"); } else { run(g_install + BIN + "/yodl" + includes + " -o" + g_wip + "/out " + conversion + " manual"); if (conversion == "latex") run("mv " + g_wip + "/out " + g_install + DOCDOC + "/yodl.latex"); else { run(g_install + BIN + "/yodlpost " + g_wip + "/out.idx " + g_wip + "/out " + "yodl." + conversion); run("mv yodl*." + conversion + " " + manualDestination); } } if (conversion == "latex") { chdir(g_install + DOCDOC); runP(P_NOCHECK, "latex yodl.latex"); runP(P_NOCHECK, "latex yodl.latex"); run("latex yodl.latex"); run("rm yodl.aux yodl.log yodl.toc"); run("dvips -o yodl.ps yodl.dvi"); run("ps2pdf yodl.ps yodl.pdf"); chdir(g_cwd); } } void manualMayExit(string variant, string path, int doExit) // doExit == 0, then only html { int idx; int usePath; string macroBase; usePath = path == "path"; macroBase = g_wip + "/macros"; md(g_install + DOCDOC); if (variant != "latex") _manual("html", usePath, macroBase); if (doExit) { if (variant == "") _manual("txt", usePath, macroBase); if (variant != "html") _manual("latex", usePath, macroBase); exit(0); } } void manualExit(string variant, string path) { manualMayExit(variant, path, 1); } yodl-4.04.00/icmake/install0000644000175000017500000000551114755317740014453 0ustar frankfrankvoid _installYodl2(string where) { list conversions; int idx; conversions = strtok(STD_CONVERSIONS, " "); for (idx = listlen(conversions); idx--; ) run("ln -sf yodl2whatever " + where + BIN + "/yodl2" + conversions[idx]); run("chmod +x " + where + BIN + "/yodl2*"); } void _installYodlConverters(string where, int debian) { list conversions; int idx; conversions = (list)"whatever" + strtok(STD_CONVERSIONS, " "); string gzipped; if (debian == 1) gzipped = ".1.gz "; else gzipped = ".1 "; for (idx = listlen(conversions); idx--; ) run("ln -sf yodlconverters" + gzipped + where + MAN + "/man1/yodl2" + conversions[idx] + gzipped); } void installExit(string what, string where) { if (what == "programs") { md(where + BIN); run("cp " + g_install + BIN + "/* " + where + BIN); run("chmod +x " + where + BIN + "/yodlstriproff"); _installYodl2(where); exit(0); } if (what == "yodl") { md(where + BIN); run("cp " + g_install + BIN + "/yodl " + where + BIN); exit(0); } if (what == "yodlpost") { md(where + BIN); run("cp " + g_install + BIN + "/yodlpost " + where + BIN); exit(0); } if (what == "yodlverbinsert") { md(where + BIN); run("cp " + g_install + BIN + "/yodlverbinsert " + where + BIN); exit(0); } if (what == "yodlstriproff") { md(where + BIN); run("cp " + g_install + BIN + "/yodlstriproff " + where + BIN); run("chmod +x " + where + BIN + "/yodlstriproff"); exit(0); } if (what == "yodl2whatever") { md(where + BIN); run("cp " + g_install + BIN + "/yodl2whatever " + where + BIN); _installYodl2(where); exit(0); } int debian = 0; if (what == "mandeb") { debian = 1; what = "man"; } if (what == "man") { md(where + MAN); run("cp -r " + g_install + MAN + "/* " + where + MAN); _installYodlConverters(where, debian); // debian: .gz links to // yodlconverters.1.gz exit(0); } if (what == "manual") { md(where + DOCDOC); run("cp -r " + g_install + DOCDOC + "/* " + where + DOCDOC); run("cp AUTHORS.txt CHANGES changelog " + where + DOCDOC); exit(0); } if (what == "macros") { md(where + STD_INCLUDE); run("cp -r " + g_install + STD_INCLUDE + "/* " + where + STD_INCLUDE); exit(0); } if (what == "docs") { md(where + DOC); run("cp AUTHORS.txt CHANGES changelog " + where + DOC); exit(0); } } yodl-4.04.00/icmake/program0000644000175000017500000000424114755305717014454 0ustar frankfrankvoid _link(string program) { exec(COMPILER, "-o", g_install + BIN + "/" + program, g_wip + "/" + program + "/*.o", "-L" + g_wip, "-lyodl", g_lopt); } void _buildProgram(string program) { std_cpp(g_wip + "/" + program, 0, program, ""); _link(program); } void _programYodl() { buildBuiltins(); _buildProgram("yodl"); } void _programYodlpost() { _buildProgram("yodlpost"); } void _programYodlverbinsert() { string strip; if (strfind(g_lopt, "-s") != -1) strip = "-s"; chdir("verbinsert"); system("icmbuild"); chdir(".."); system("install " + strip + " verbinsert/tmp/bin/binary " + g_install + BIN + "/yodlverbinsert"); } void program(string target) { md(g_install + BIN); if (target == "programs" || target == "yodlstriproff") run("cp scripts/yodlstriproff " + g_install + BIN); if (target == "programs" || target == "yodl2whatever") run("scripts/configreplacements " + "scripts/yodl2whatever.in " + g_install + BIN + "/yodl2whatever " + g_install); if (target == "programs" || target == "yodlverbinsert") _programYodlverbinsert(); if ( target == "yodlstriproff" || target == "yodl2whatever" || target == "yodlverbinsert" ) return; compileRSS(); // ./compilerss if (target == "programs" || target == "yodl") _programYodl(); if (target == "programs" || target == "yodlpost") _programYodlpost(); } void programExit(string target, string strip) // build one program, { // called from main #ifndef PROFILING if (strip == "strip") g_lopt = "-s"; #endif program(target); exit(0); } void programsExit(string strip) // build all programs, { // called from main #ifndef PROFILING if (strip == "strip") g_lopt = "-s"; #endif program("programs"); exit(0); } yodl-4.04.00/INSTALL.im0000644000175000017500000000555614755312367013277 0ustar frankfrank// Uncomment the following #define if you want to use the following exensive // set of compilation options: // -O0 -g3 -ansi -pedantic -fno-common -pipe -W -Wall -Wcast-align // -Wcast-qual -Wconversion -Wformat=2 -Winline -Wnested-externs // -Wpointer-arith -Wshadow -Wstrict-prototypes -Wundef // -Wno-unused-parameter -Waggregate-return -Wnested-externs // //#define EXTENSIVE_OPTIONS // Alternatively, uncomment the following #define to compile the programs with // the -pg option, so that gprof can be used for profiling purposes. // If neither is defined, COPT is used (see build). // EXTENSIVE_OPTIONS takes priority over PROFILING. // //#define PROFILING string BASE; // BASE is the directory below which ALL yodl files will be stored. // For an operational non-Debian installation, you probably must be // `root', and BASE "/usr" or BASE "/usr/local" is suggested (see // below). `BASE' itself is not used outside of this file, so feel free to // define BIN, STD_INCLUDE, MAN, DOC, and DOCDOC (below) in any which way // you like. // However, make sure that BIN, STD_INCLUDE, MAN, DOC and DOCDOC all are // absolute paths string BIN; // the directory in which yodl will be stored string STD_INCLUDE; // STD_INCLUDE is the directory in which the skeleton files // will be stored string MAN; // MAN is the directory in which the manual page will be stored string DOC; // DOC is the directory in which all other documentation except for the // manual and examples will be stored string DOCDOC; // DOCDOC is the directory in which the manual and examples will be stored string COMPILER; // COMPILER specifies the compiler to use. yodl is coined as // belonging to the Debian `unstable' distribution, which may use a // different version of the compiler you currently have in your // system. E.g., in july 2006 the Debian `testing' version of the compiler // was 4.0.4, but the `unstable' version's compiler was 4.1.2. By defining // COMPILER with a specific version (e.g., COMPILER=g++-4.1) that // particular version can be used. The distributed definition uses the // `default' compiler version. string CXX; // CXX specifies the C++ compiler to use. //#define PROFILE "-pg" // Uncomment the above #define to construct a binary program that can be // used with the gprof profiler. When specified, no stripping is performed // at ./build program strip (see INSTALL) void setLocations() { BASE = "/usr"; // make sure that BIN, STD_INCLUDE, MAN, DOC and DOCDOC all are // absolute paths BIN = BASE + "/bin"; DOC = BASE + "/share/doc/yodl"; DOCDOC = BASE + "/share/doc/yodl-doc"; MAN = BASE + "/share/man"; STD_INCLUDE = BASE + "/share/yodl"; COMPILER = "gcc"; CXX = "g++"; } yodl-4.04.00/INSTALL.txt0000644000175000017500000001162614755312761013502 0ustar frankfrank Installing Yodl Below the original contents of the file INSTALL.txt follows. As of Yodl 2.01.00, Yodl is available from https:://fbb-git.gitlab.io/yodl/, or as a Debian linux package. To install Yodl as a binary package, the `dpkg' Debian package installer is the preferred program to use to install Yodl. If you want to install Yodl from its sources, download the source archive (yodl*.tar.gz), unpack it. If you want to compile Yodl yourself, you'll probably need Icmake. Icmake is available from http://icmake.sourceforge.net or as a Debian linux package. To install Yodl using icmake proceed as follows: 1. Define the appropriate locations in setLocations() (at the bottom) of INSTALL.im 2. then run: ./build programs ./build macros ./build man ./build manual NOTE: ./build programs must be first, ./build macros must be last, the other two are optional 3. then do (probably as root) (NOTE: `WHERE' (below) indicates the base directory under which you want to install the software. The paths in INSTALL.im refer to locations below WHERE. So, specifying WHERE as / will install under the system's root directory. All WHERE specifications must be identical). ./build install programs WHERE - e.g., ./build install programs / ./build install man WHERE ./build install man / ./build install manual WHERE ./build install manual / ./build install macros WHERE ./build install macros / ./build install docs WHERE ./build install docs / For `./build install ...' there are no ordering requirements but at the very least do ./build install programs WHERE - e.g., ./build install programs / ./build install macros WHERE ./build install macros / Frank B. Brokken f.b.brokken@rug.nl ============================================================================== Karel Kubat (karel@icce.rug.nl) and Jan Nieuwenhuizen (janneke@gnu.org) November 18, 1999 April 2016: =========== The following section is NOT up-to-date and NOT maintained anymore. It is kept for historical reasons. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Contents 1: Obtaining and installing Yodl 1.1: Configuring the yodl program 1.2: Installing the yodl program 1.2.1: Prerequisites for the installation The following information describes the Yodl package from the point of the system administrator. Issues such as the installation of the package are addressed here. 1: Obtaining and installing Yodl The Yodl program and the distributed macro package can be obtained at the ftp site ftp.lilypond.org in the direc- tory pub/yodl/development. Look for a file called yodl- X.Y.Z.tar.gz, where X.Y.Z is the highest version number. This is a gzipped archive containing all sources, documenta- tion and macro files. 1.1: Configuring the yodl program Once you unpack the archive, configure the sourcetree with a command that looks remotely like configure # Check out the bin/set-yo.sh script make make install The configuration process is quite versatile; it should run flawlessly to detect your system and its defaults. You may alter various settings, see configure --help. 1.2: Installing the yodl program Once configured, type make all to build everything. If everything went ok, you can do make install to install it. The executable, which is built as src/out/yodl is created and copied to a system-wide program directory. The macro package from macros/ is also placed in a public directory, which is /usr/local/share/yodl by default (you can change most directory names in the config- ure process). Furthermore, postprocessors and a number of shell scripts (drivers of the yodl program) are copied to your programs directory. 1.2.1: Prerequisites for the installation To successfully build and install the Yodl package, the following tools must be present: o A C compiler and run-time environment. A POSIX-compli- ant compiler, libraries and set of header files should work without problems. The GNU gcc compiler 2.7 and above should work without a flaw. o GNU make o Typical building programs, such as, install. Most Unixes will have these. o /bin/sh: a POSIX-compliant shell interpreter. The GNU shell interpreter bash works without problems. o A number of `standard' tools should be present: sed, grep, etc.. These tools must furthermore include the code generators bison and flex (yacc- and lex looka- likes) to generate the grammar parsers. The GNU implementations of these tools work like a charm. o A command that converts groff input into viewable for- mat. The default setting for this command is troff -Tascii -man. yodl-4.04.00/lexer/0000755000175000017500000000000014066072154012736 5ustar frankfrankyodl-4.04.00/lexer/lnextchar.c0000644000175000017500000000560114066072154015074 0ustar frankfrank#include "lexer.ih" void l_nextchar(register Lexer *lp) { register int ch = l_get(lp); // read from file or buffer // see below for a description while (ch == '\\') // a backslash { ch = l_get(lp); // get the next char if (ch == '/') { ch = l_get(lp); // inspect char beyond / if (ch == '/') // two // follow \: eoln comment { while ((ch = l_get(lp)) != '\n') // find the newline ; // and skip \n and } // blanks beyond else // one /, followed by whatever { l_unget(lp, ch); // unget it l_unget(lp, '/'); // unget the / lp->d_lastchar = '\\'; // and return the backslash return; } } else if (ch != '\n') // no newline beyond the backslash { l_unget(lp, ch); /* unget that char */ lp->d_lastchar = '\\'; /* and return \ */ return; } // skip ' ', '\t' after EOLN while ((ch = l_get(lp)) == ' ' || ch == '\t') ; } if /* not a backslash */ ( ch == '\n' /* got newline, */ && /* and: */ !lp->d_keep_ws /* ignore ws at the end */ ) { while (isspace(ch = l_get(lp))) ; /* skip until not a ws */ } lp->d_lastchar = ch; return; /* done: return the char. */ } /* Nextchar determines the next character returned by the lexer. While the current char is a backslash: if the next two chars are //, then all characters on the current line are skipped, until the final newline has been reached. This effectively turns \// into an eoln comment. else, if only one / is encountered, then the / and subsequent char are pushed back, and a backslash is returned. if the current char is not end-of-line then it's pushed back, and a backslash is returned. at this point an end-of-line char was seen, following \ or \//[^\n]* and all subsequent blank space chars (of the next line) are skipped. Now the loop continues at the top, maybe skipping another backslash or \//[^\n]* termineated line. When the loop ends, the next char (which may be a backslash) is returned. */ yodl-4.04.00/lexer/lpushlevel.c0000644000175000017500000000023214066072154015262 0ustar frankfrank#include "lexer.ih" void l_push_level(register Lexer *lp, register char const *str) { if (*str) l_push(lp, str, l_media_construct_memory); } yodl-4.04.00/lexer/lpush.c0000644000175000017500000000165514066072154014244 0ustar frankfrank#include "lexer.ih" void l_push(register Lexer *lp, char const *info, void (*constructor)(Media *, Lexer *, char const *)) { register StackValue stValue; stValue.u_voidp = new_calloc(1, sizeof(Media)); if (lp->d_media_ptr) media_save_state(lp->d_media_ptr); /* info and close/save */ /* info about current */ /* file (if any) */ (*constructor)(stValue.u_Media, lp, info); /* construct new media */ /* generates MSG_INFO */ stack_push(&lp->d_media_st, stValue); /* push new media info */ lp->d_media_ptr = stValue.u_Media; /* set tos pointer */ lp->d_lastchar = 0; /* something pushed, so */ /* end an EOF condition */ } yodl-4.04.00/lexer/llex.c0000644000175000017500000000170014066072154014044 0ustar frankfrank#include "lexer.ih" /* Return the next token The matched text is in lp->d_text Once d_lastchar is EOF it remains EOF until reset by lexer_end_eval() lexer_push_file pushes a filename and sets a new cwd l_pop reverts back to the previous path at EOR or at a file switch */ LEXER_TOKEN l_lex(register Lexer *lp) { l_nextchar(lp); /* determine the next char */ switch (lp->d_lastchar) { case EOF: return TOKEN_EOF; case EOR: return l_pop(lp) == SUCCESS ? TOKEN_EOR : TOKEN_EOF; case ' ': case '\t': return l_append(lp, TOKEN_SPACE); case '(': return l_append(lp, TOKEN_OPENPAR); case ')': return l_append(lp, TOKEN_CLOSEPAR); case '\n': return l_append(lp, TOKEN_NEWLINE); case '+': return l_append(lp, TOKEN_PLUS); default: return l_compound(lp); } } yodl-4.04.00/lexer/lsubstget.c0000644000175000017500000000572614066072154015130 0ustar frankfrank#include "lexer.ih" int l_subst_get(Lexer *lp) { register Media *mp = lp->d_media_ptr; register Subst *sp = lp->d_subst_ptr; while (true) { register char *cp; int ch = media_get(mp); if (!lp->d_useSubst) return ch; if (media_fgetc(mp)) lp->d_nreplacements = 0; switch (subst_action(sp, ch)) { case SUBST_CONTINUE: break; case SUBST_GETCHAR: if (*(cp = subst_get(sp))) media_push_front(mp, cp + 1); ch = *cp ? *(unsigned char *)cp : EOF; free(cp); return ch; case SUBST_SUBSTITUTION: if ( lp->d_maxreplacements && ++lp->d_nreplacements >= lp->d_maxreplacements ) l_max_replacements_exceeded(lp->d_maxreplacements); media_push_front(mp, cp = subst_get(sp)); free(cp); continue; } } } /* (lexer_lex -> l_lex -> l_nextchar -> l_get ->) l_subst_get -> media_get media_push_front Read the next character from the media and from the substitution Queue. Characters read from the media are matched against substitution sequences. If a substutution sequence is found, it is pushed in front of the substitution queue, and the input is read again. Eventually, no substitution will have occurred, and the first character on the subst-Q is returned. Assume A is replaced by B, and the input media contain Ax. Then the following will happen: -------------------------------------------------------------------- Subst ------------- result Media Buffer Queue comment -------------------------------------------------------------------- get media: A x subst.more() true x A buffer potential subst-sequence get media: x EOF A subst.more() true Bx A replaced by B get media: B EOF x subst.more(): false EOF Bx subst.get(): B EOF x returns B Next call: get media: x EOF EOF subst.more() false EOF x subst.get(): x EOF EOF returns x Next call: get media: EOF EOF EOF subst.more() false EOF EOF subst.get(): x EOF EOF returns EOF -------------------------------------------------------------------- */ yodl-4.04.00/lexer/lexerconstruct.c0000644000175000017500000000204014066072154016162 0ustar frankfrank#include "lexer.ih" /* Subst *d_subst_ptr - external subst-structure Stack d_empty_st - empty size_t d_empty_size - 0 bool d_keep_ws - false Stack d_media_st - empty void *d_media_ptr - NULL LEXER_TOKEN d_token - TOKEN_UNKNOWN int d_lastchar - 0 String d_text - empty string */ void lexer_construct(register Lexer *lp, Subst *sp) { memset(lp, 0, sizeof(Lexer)); string_construct(&lp->d_text, 0); lp->d_subst_ptr = sp; lp->d_useSubst = false; stack_construct(&lp->d_empty_st, NULL); /* stores values */ stack_construct(&lp->d_media_st, media_destructor); lp->d_maxdepth = args_option('n') ? args_optint('n') : DEFAULT_MAX_NESTED_FILES; lp->d_maxreplacements = 10000 * (args_option('r') ? args_optint('r') : DEFAULT_MAX_REPLACEMENTS); lp->d_chdirFun = args_option('L') ? l_noChdir : l_chdir; } yodl-4.04.00/lexer/lexer.h0000644000175000017500000001252214066072154014230 0ustar frankfrank#ifndef INCLUDED_LEXER_H_ #define INCLUDED_LEXER_H_ #include "../stack/stack.h" #include "../string/string.h" #include "../subst/subst.h" typedef enum /* Modify ldata.c when this enum is altered */ { /* ======================================== */ TOKEN_UNKNOWN, TOKEN_SYMBOL, TOKEN_TEXT, TOKEN_PLAINCHAR, /* formerly: anychar */ TOKEN_OPENPAR, TOKEN_CLOSEPAR, TOKEN_PLUS, /* it's semantics what we do with a +, not */ /* something for the lexer to worry about */ TOKEN_SPACE, /* Blanks should be at the end */ TOKEN_NEWLINE, TOKEN_EOR, /* end of record: ends pushed strings */ TOKEN_EOF, /* at the end of nested evaluations/eof */ SIZEOF_TOKEN /* Not a token, but counts the number of tokens */ } LEXER_TOKEN; /* When the lexer should read a file, a filename, lineno and offset are made available. Alternatively, when processing a file, a macro or other expandable item may be encountered. In that situation, the lexer may be requested to continue reading from memory (a C-string). */ typedef struct Lexer { Subst *d_subst_ptr; Stack d_empty_st; /* stack of media-stack indices at which */ /* the Lexer will consider the media */ /* stack empty. */ bool d_useSubst; /* if false, chars received fm media are */ /* directly returned by lexer_lex */ bool d_keep_ws; /* if true, newlines and blanks at the */ /* begin of lines are kept (not related to */ /* \EOLN handling */ size_t d_empty_size; /* size of the media stack where the media */ /* stack is considered empty. At this point */ /* popping is not allowed anymore, and EOF */ /* will consequently be returned. */ /* lexer_end_eval() is the only available */ /* facility to reset d_empty_size to a */ /* lower value */ Stack d_media_st; /* stack of media processed by the lexer */ void *d_media_ptr; /* points to top-element of media if def'd */ /* If the media stack is empty, d_media is */ /* NULL */ LEXER_TOKEN d_token; int d_lastchar; String d_text; /* matched text (reset at each token) */ size_t d_filedepth; /* number of nested files */ size_t d_maxdepth; /* maximum number of nested files */ size_t d_nreplacements;/* number of macro/subst replacements since */ /* last fgetc() call */ size_t d_maxreplacements; /* maximum allowed number of */ /* macro/subst replacements */ /* performs (no)chdir when switching files */ void (*d_chdirFun)(struct Lexer *, char const *); } Lexer; void lexer_construct(Lexer *lp, Subst *sp); // PM: lexer_destruct /* begin nested evaluation */ /* stack */ void lexer_begin_nested(Lexer *lp, char const *txt); void lexer_end_nested(Lexer *lp); /* restore evaluation stack */ /* after nesting */ char const *lexer_filename(Lexer *lp); LEXER_TOKEN lexer_lex(Lexer *lp); size_t lexer_lineno(Lexer *lp); void lexer_push_file(Lexer *lp, char const *filename); void lexer_push_str(Lexer *lp, char const *str); void lexer_unget_matched(Lexer *lp); static inline void lexer_set_keep_ws(register Lexer *lp, bool trueIsYes); static inline char const * lexer_text(register Lexer *lp); static inline LEXER_TOKEN lexer_token(register Lexer *lp); static inline char const * lexer_tokenName(LEXER_TOKEN token); static inline void lexer_useSubst(register Lexer *lp, bool useSubst); /* == end of interface section ============================================ */ /* Internal Lexer use only. Not used outside of this directory functions, needed here to allow proper compilation of the static inline functions below */ extern char *l_token_name[]; static inline void lexer_set_keep_ws(register Lexer *lp, bool trueIsYes) { lp->d_keep_ws = trueIsYes; } static inline char const *lexer_text(register Lexer *lp) { return string_str(&lp->d_text); } static inline LEXER_TOKEN lexer_token(register Lexer *lp) { return lp->d_token; } static inline char const *lexer_tokenName(LEXER_TOKEN token) { return l_token_name[token]; } static inline void lexer_useSubst(register Lexer *lp, bool useSubst) { lp->d_useSubst = useSubst; } #endif yodl-4.04.00/lexer/lexerpushstr.c0000644000175000017500000000115514066072154015654 0ustar frankfrank#include "lexer.ih" void lexer_push_str(register Lexer *lp, char const *str) { if (*str) { register Media *mp; /* max replacement exceed check removed in Yodl 4.00.00 */ mp = lp->d_media_ptr; if (!mp || media_isFile(mp)) l_push(lp, str, l_media_construct_memory); else { size_t length = strlen(str); if (isalpha(str[length - 1]) && isalpha(queue_peek(&mp->d_queue))) l_push(lp, str, l_media_construct_memory); else queue_push(&mp->d_queue, length, str); } } } yodl-4.04.00/lexer/lexer.ih0000644000175000017500000000365714066072154014412 0ustar frankfrank#include "lexer.h" #include #include #include // for realpath #include #include // for chdir #include "../config.h" #include "../args/args.h" #include "../new/new.h" #include "../file/file.h" #include "../media/media.h" /* This capitalizes on the fact that EOF == -1 */ #define EOR (-2) /* If the media struct stores a filename, d_memory is set to NULL If the media struct stores memory contents, d_memory is not NULL By inspecting the value of d_memory, it is determined whether we are processing a file or memory */ void l_media_construct_file(Media *mp, Lexer *, char const *pahtname); void l_media_construct_memory(Media *mp, Lexer *lp, char const *str); void l_max_replacements_exceeded(size_t max); LEXER_TOKEN l_append(Lexer *lp, LEXER_TOKEN token); void l_chdir(Lexer *lp, char const *pathname); void l_noChdir(Lexer *lp, char const *pathname); LEXER_TOKEN l_compound(Lexer *lp); int l_get(Lexer *lp); void l_getchar_message(Lexer *lp, char const *pushedback, int ch); LEXER_TOKEN l_handle_ident(Lexer *lp); LEXER_TOKEN l_handle_number(Lexer *lp); LEXER_TOKEN l_lex(Lexer *lp); void l_nextchar(Lexer *lp); Result l_pop(Lexer *lp); void l_push(Lexer *lp, char const *info, void (*constructor)(Media *, Lexer *, char const *)); int l_subst_get(Lexer *lp); void l_unget(Lexer *lp, int ch); void l_push_level(Lexer *lp, char const *txt); /* d_lastchar is identchar? */ static inline bool l_isIdentChar(register Lexer *lp) { return isalpha(lp->d_lastchar); /* very simple... */ } yodl-4.04.00/lexer/lmediaconstructmemory.c0000644000175000017500000000060414066072154017533 0ustar frankfrank#include "lexer.ih" void l_media_construct_memory(register Media *mp, register Lexer *lp, char const *str) { mp->d_isfile = false; mp->d_filename = new_str(lexer_filename(lp)); mp->d_lineno = lexer_lineno(lp); queue_construct(&mp->d_queue, str); if (message_show(MSG_INFO)) message("New memory media. Q at %p", &mp->d_queue); } yodl-4.04.00/lexer/ldata.c0000644000175000017500000000041514066072154014167 0ustar frankfrank#include "lexer.ih" char *l_token_name[] = { "TOKEN_UNKNOWN", "TOKEN_SYMBOL", "TOKEN_TEXT", "TOKEN_PLAINCHAR", "TOKEN_OPENPAR", "TOKEN_CLOSEPAR", "TOKEN_PLUS", "TOKEN_SPACE", "TOKEN_NEWLINE", "TOKEN_EOR", "TOKEN_EOF", }; yodl-4.04.00/lexer/lexerfilename.c0000644000175000017500000000042014066072154015716 0ustar frankfrank#include "lexer.ih" char const *lexer_filename(register Lexer *lp) { char const *filename; register Media *mp = lp->d_media_ptr; if (!mp) return ""; filename = media_filename(mp); return !strcmp(filename, "-") ? "stdin" : filename; } yodl-4.04.00/lexer/lmediaconstructfile.c0000644000175000017500000000200714066072154017141 0ustar frankfrank#include "lexer.ih" void l_media_construct_file(register Media *mp, register Lexer *lp, char const *pathname) { /* *mp is initialized to 0, so the queue is 0 as well: ok, since the queue's destructor can handle that */ mp->d_isfile = true; if (++lp->d_filedepth > lp->d_maxdepth) if (message_show(MSG_CRIT)) message("Max number of nested files (%u) exceeded at\n" "`%s'", (unsigned)lp->d_maxdepth, pathname); if (!pathname || !strcmp(pathname, "-")) /* no name, so it's stdin */ { mp->d_filename = new_str("stdin"); mp->d_file = stdin; message_setfilename(""); } else { mp->d_filename = new_str(pathname); mp->d_file = file_open(pathname, "r"); message_setfilename(pathname); message_setlineno(mp->d_lineno = 1); } queue_construct(&mp->d_queue, ""); if (message_show(MSG_INFO)) message("New file media."); } yodl-4.04.00/lexer/lexerlineno.c0000644000175000017500000000022514066072154015425 0ustar frankfrank#include "lexer.ih" size_t lexer_lineno(register Lexer *lp) { register Media *mp; return (mp = lp->d_media_ptr) ? media_lineno(mp) : 0; } yodl-4.04.00/lexer/lhandleident.c0000644000175000017500000000251114066072154015534 0ustar frankfrank#include "lexer.ih" /* We're not checking here anymore whether the perceived IDENT is a plain word, in which case it's a SYMBOL, or something special. This keeps the lexer simple, and leaves the more complex symtab handling to the parser, who should be the knowledgeable agent in semantic matters anyhow. An "xyz(" sequence is returned as "xyz", token SYMBOL (ungetting the ")"), a xyz. sequence is returned as a SYMBOL. "xyz(" may then be a BUILTIN or a MACRO or, after all, just plain TEXT. */ LEXER_TOKEN l_handle_ident(register Lexer *lp) { register int c; do /* at this point d_lastchar is */ { /* an identchar, so we proceed */ string_addchar(&lp->d_text, lp->d_lastchar); l_nextchar(lp); } while (l_isIdentChar(lp)); c = lp->d_lastchar; /* used below */ l_unget(lp, c); /* unget the char beyond the ident */ /* the close parentheses comments */ /* are to keep my emacs */ /* paren-matcher happy */ return c == '(' ? TOKEN_SYMBOL : TOKEN_TEXT; /* ) */ } yodl-4.04.00/lexer/lappend.c0000644000175000017500000000042414066072154014525 0ustar frankfrank#include "lexer.ih" /* Simply append lp->d_lastchar to the semantic buffer, and return the indicated token */ LEXER_TOKEN l_append(register Lexer *lp, LEXER_TOKEN token) { string_addchar(&lp->d_text, lp->d_lastchar); /* push back last one */ return token; } yodl-4.04.00/lexer/lunget.c0000644000175000017500000000076214066072154014405 0ustar frankfrank#include "lexer.ih" /* When ungetting, EOF doesn't have to be pushed back, since its EOF, and it can't be pushed back as a single character. Then, lexer_push_str() will end the EOF condition, if present. */ void l_unget(register Lexer *lp, int ch) { if (ch >= 0) /* do not unget EOR/EOF */ { if (message_mask() & MSG_DEBUG) l_getchar_message(lp, "Ungetting ", ch); media_unget_memory(lp->d_media_ptr, ch); } } yodl-4.04.00/lexer/lpop.c0000644000175000017500000000362514066072154014062 0ustar frankfrank#include "lexer.ih" /* This is the complement of l_push(). l_push() will push the active media on the media stack, and initialize media. lpop() is called to pop the topmost element of the media stack, to reactivate the then active media (if any), and to reassign d_media_ptr. This will succeed as long as the media stack size exceeds d_empty_size. We can't pop if that's initially the case, and so that would represent an internal failure. Yodl should not pop in those cases. If the stack is empty following the pop, then popping fails. Otherwise, the previously pushed media are reactivated. If there are any media available, d_media_ptr is set to the media stack's tos. */ static bool lastFailed = false; Result l_pop(register Lexer *lp) { bool oldFile = false; if (stack_size(&lp->d_media_st) == lp->d_empty_size) if (message_show(MSG_EMERG)) message("Attempt to pop empty media stack beyond element %u", (unsigned)lp->d_empty_size); if (media_isFile(lp->d_media_ptr)) /* remove stacked file */ { oldFile = true; lp->d_filedepth--; } stack_pop(&lp->d_media_st); /* remove the current media */ /* empty stack: no more media */ if (stack_size(&lp->d_media_st) == lp->d_empty_size) { lp->d_media_ptr = NULL; lastFailed = true; return FAILED; } /* reset lp->d_media_ptr to tos */ lp->d_media_ptr = stack_tos(&lp->d_media_st)->u_voidp; if (media_isFile(lp->d_media_ptr)) { if (oldFile || lastFailed) (*lp->d_chdirFun)(lp, media_filename(lp->d_media_ptr)); lastFailed = false; } else lastFailed = oldFile && !lastFailed; media_restore_state(lp->d_media_ptr); /* generates MSG_INFO */ return SUCCESS; } yodl-4.04.00/lexer/lexerbeginnested.c0000644000175000017500000000146514066072154016437 0ustar frankfrank#include "lexer.ih" /* When nested evaluation takes place, the current empty index of the media stack is pushed and d_empty is set to the current d_media_st size. An empty media stack has size 0, which is just before the first element to push. So, we'll set d_empty to the current size, and then push the string to evaluate. d_empty_size, therefore, is in the world of counts, not offsets. */ void lexer_begin_nested(register Lexer *lp, register char const *txt) { register StackValue stValue; stValue.u_size_t = lp->d_empty_size; stack_push(&lp->d_empty_st, stValue); lp->d_empty_size = stack_size(&lp->d_media_st); if (message_show(MSG_INFO)) message("Nested media begins at stack size %u", (unsigned)lp->d_empty_size); l_push_level(lp, txt); } yodl-4.04.00/lexer/lget.c0000644000175000017500000000375714066072154014051 0ustar frankfrank#include "lexer.ih" int l_get(register Lexer *lp) { register int ch; if (!lp->d_media_ptr) /* no more media */ return EOF; if ((ch = l_subst_get(lp)) == EOF) /* at the and of a */ ch = EOR; /* buffer: return EOR */ if (message_mask() & MSG_DEBUG) l_getchar_message(lp, "Getting", ch); /* maybe debug msg */ return ch; } /* Read the next character from the media. If there are no media, then EOF is returned anyway. Otherwise, a character is requested from the media. The obtained character, including EOF, is given to d_subst, which gets a chance to use it for a substitution. If substitute consumes the character, another char is requested from the media. While consuming characters, * d_subst may detect a substitution match, in which case the substitution + terminating character is pushed on to the media stack. So, following a successful match, the media will start to retrieve the substitution. * s_subst may consider the next character to be part of an ongoing substitution key-match, in which case it stores the char in an internal buffer, indicating that it has consumed the char. * s_subst may not consider the next character part of a known substitution. In that case the character is added to its internal buffer, the first char. of the buffer is returned, and the remaining chars are pushed on to the media stack. If there is no buffer, and the received character was EOF, EOF is returned. If d_subst returns an EOF char, l_pop() is called to reactivate any previously pushed media. If that succeeds, the loop continues at the request for another character from the media. If that fails, EOF is returned. */ yodl-4.04.00/lexer/lexerungetmatched.c0000644000175000017500000000050714066072154016614 0ustar frankfrank#include "lexer.ih" void lexer_unget_matched(register Lexer *lp) { register char const *cp = lexer_text(lp); if (*cp) /* only push non-empty strings */ { if (message_show(MSG_DEBUG)) message("pushing last matched `%s'", cp); lexer_push_str(lp, cp); } } yodl-4.04.00/lexer/lcompound.c0000644000175000017500000000041314066072154015100 0ustar frankfrank#include "lexer.ih" LEXER_TOKEN l_compound(register Lexer *lp) { if (l_isIdentChar(lp)) return l_handle_ident(lp); if (isdigit(lp->d_lastchar)) return l_handle_number(lp); return l_append(lp, TOKEN_PLAINCHAR); /* formerly: `any' */ } yodl-4.04.00/lexer/lchdir.c0000644000175000017500000000132414066072154014347 0ustar frankfrank#include "lexer.ih" void l_noChdir(Lexer *lp, char const *pathname) {} void l_chdir(Lexer *lp, char const *pathname) { // fprintf(stderr, "CHANGING WD\n"); char *resolved = realpath(media_filename(lp->d_media_ptr), NULL); if (resolved == NULL) out_of_memory(); *(strrchr(resolved, '/') + 1) = 0; if (chdir(resolved) != 0) { char const *prefix = NULL; if (message_show(MSG_CRIT)) prefix = "[Fatal] "; else if (message_show(MSG_WARNING)) prefix = ""; if (prefix != NULL) message("%s%s (%u): Can't chdir to `%s'", prefix, message_filename(), message_lineno(), resolved); } free(resolved); } yodl-4.04.00/lexer/lexerlex.c0000644000175000017500000000175114066072154014736 0ustar frankfrank#include "lexer.ih" LEXER_TOKEN lexer_lex(register Lexer *lp) { string_erase(&lp->d_text); /* use fresh semantic value */ lp->d_token = l_lex(lp); /* get the next token */ if (message_show(MSG_INFO)) message("lexer_lex() returns %s (= `%s')", l_token_name[lp->d_token], lexer_text(lp)); return lp->d_token; } /* As this function CLEARS the semantic buffer, make sure that it is only called by the parser. Otherwise, matched text will be overwritten while being constructed. lexer_lex() is the public interface to the lexer, returning the next available token. Once lexer_lex() returns EOF, it keeps doing so, unless it is reset by, e.g., lexer_end_eval(). lexer_lex -> l_lex -> l_nextchar -> l_get -> l_subst_get -> media_get media_push_front */ yodl-4.04.00/lexer/lmaxreplacementsexceeded.c0000644000175000017500000000030614066072154020134 0ustar frankfrank#include "lexer.ih" void l_max_replacements_exceeded(size_t max) { message_show(MSG_CRIT); message("Max number of macro/subst replacements (%u) exceeded\n", (unsigned)max); } yodl-4.04.00/lexer/lgetcharmessage.c0000644000175000017500000000046314066072154016243 0ustar frankfrank#include "lexer.ih" static char s_printChar[] = " (.)"; void l_getchar_message(register Lexer *lp, char const *preamble, int ch) { s_printChar[2] = ch; if (message_show(MSG_DEBUG)) message("%s char 0x%x%s", preamble, ch, isprint(ch) ? s_printChar : ""); } yodl-4.04.00/lexer/lexerpushfile.c0000644000175000017500000000026314066072154015762 0ustar frankfrank#include "lexer.ih" void lexer_push_file(register Lexer *lp, char const *pathname) { l_push(lp, pathname, l_media_construct_file); (*lp->d_chdirFun)(lp, pathname); } yodl-4.04.00/lexer/lhandlenumber.c0000644000175000017500000000063014066072154015721 0ustar frankfrank#include "lexer.ih" LEXER_TOKEN l_handle_number(register Lexer *lp) { do /* at this point d_lastchar is */ { /* a digit, so we may proceed */ string_addchar(&lp->d_text, lp->d_lastchar); l_nextchar(lp); } while (isdigit(lp->d_lastchar)); l_unget(lp, lp->d_lastchar); return TOKEN_TEXT; } yodl-4.04.00/lexer/lexerendnested.c0000644000175000017500000000405214066072154016114 0ustar frankfrank#include "lexer.ih" /* Beginning a new evaluation proceeded as follows: 1. d_empty_size was pushed 2. d_empty_size was set to the current d_media_st size 3. the string to evaluate was pushed. Ending an evaluation occurs in the reverse order: 3. the d_media_st is popped, and d_media is set to its top or NULL. 2. d_empty_size is set to the tos of d_empty_st, or to 0 if the stack is empty 1. d_empty_st is popped if it has any size However, since the popping is done by l_pop(), d_empty_size must be reduced first, as l_pop() won't pop to size d_empty_size. So, we will first reduce d_empty_size, and then call l_pop(). At this point the EOF state is left, by setting d_lastchar to 0. */ void lexer_end_nested(register Lexer *lp) { size_t oldempty = lp->d_empty_size; /* store the old bottom to */ /* be used below */ if (!stack_size(&lp->d_empty_st)) /* end-nested NEEDS a stack */ if (message_show(MSG_EMERG)) message("Lexer's evaluation stack exhausted"); /* reset to previous size */ lp->d_empty_size = stack_tos(&lp->d_empty_st)->u_size_t; stack_pop(&lp->d_empty_st); /* pop the previous size */ if (message_show(MSG_INFO)) message("Reducing nested media stack bottom from %u to %u", (unsigned)oldempty, (unsigned)lp->d_empty_size); if (oldempty == 0 && lp->d_empty_size == 0) /* no size change at the */ return; /* bottom. We're done */ /* No lpop(), since that's already done earlier by the lexer, producing the EOF condition for the nested evaluation */ /* reset lp->d_media_ptr to tos */ lp->d_media_ptr = stack_tos(&lp->d_media_st)->u_voidp; if (lp->d_media_ptr != PFAILED) media_restore_state(lp->d_media_ptr); /* generates MSG_INFO */ } yodl-4.04.00/LICENSE0000644000175000017500000010451514762012325012627 0ustar frankfrank GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . yodl-4.04.00/lines/0000755000175000017500000000000014066072154012731 5ustar frankfrankyodl-4.04.00/lines/lines.ih0000644000175000017500000000017714066072154014372 0ustar frankfrank#include "lines.h" #define LINES_BLOCK 20 #include "../root/root.h" #include "../new/new.h" #include "../string/string.h" yodl-4.04.00/lines/lines.h0000644000175000017500000000271614066072154014222 0ustar frankfrank#ifndef INCLUDED_LINES_H_ #define INCLUDED_LINES_H_ #include #include "../root/root.h" typedef struct { char **d_str; size_t d_size; size_t d_capacity; } Lines; static inline void lines_construct(Lines *lines); void lines_destruct(Lines *lines); /* Not yet implemented */ size_t lines_contains(Lines *lp, char const *target); /* FAILED or index */ size_t lines_find(char const *target, char const **arr, size_t arrsize); /* adds sprint-ed */ void lines_format(Lines *lines, char const *line, ...) ATTRIBUTE_FORMAT_PRINTF(2, 3); void lines_grab(Lines *lines, char *line); /* grabs line */ #include /* copies line */ static inline void lines_add(Lines *lines, char const *line) { lines_grab(lines, new_str(line)); } /* 0: not existing */ static inline char const *lines_at(register Lines *lines, size_t idx) { return idx >= lines->d_size ? 0 : lines->d_str[idx]; } static inline void lines_construct(Lines *lines) { memset(lines, 0, sizeof(Lines)); } static inline size_t lines_size(register Lines *lines) /* n lines stored */ { return lines->d_size; } #endif yodl-4.04.00/lines/linesfind.c0000644000175000017500000000045114066072154015050 0ustar frankfrank#include "lines.ih" size_t lines_find(char const *target, register char const **arr, size_t arrsize) { register char const **ptr = arr; arr[--arrsize] = target; while (strcmp(*ptr, target)) ptr++; return ptr == arr + arrsize ? FAILED : ptr - arr; } yodl-4.04.00/lines/linesgrab.c0000644000175000017500000000050414066072154015042 0ustar frankfrank#include "lines.ih" void lines_grab(register Lines *lp, char *line) /* grabs line */ { if (lp->d_size == lp->d_capacity) new_size(&lp->d_str, lp->d_capacity += LINES_BLOCK, lp->d_size, sizeof(char *)); lp->d_str[lp->d_size++] = line; } yodl-4.04.00/lines/linesdestroy.c0000644000175000017500000000026614066072154015625 0ustar frankfrank#include "lines.ih" void lines_destruct(register Lines *lp) { register char **end = lp->d_str + lp->d_size; while (end-- != lp->d_str) free(*end); free(lp); } yodl-4.04.00/lines/linesformat.c0000644000175000017500000000032114066072154015414 0ustar frankfrank#include "lines.ih" void lines_format(Lines *lines, char const *fmt, ...) { va_list list; size_t n; va_start(list, fmt); lines_grab(lines, string_vformat(&n, fmt, list)); va_end(list); } yodl-4.04.00/macro/0000755000175000017500000000000014066072154012720 5ustar frankfrankyodl-4.04.00/macro/macro.ih0000644000175000017500000000033614066072154014345 0ustar frankfrank#include "macro.h" #include #include "../new/new.h" #include "../hashitem/hashitem.h" #include "../message/message.h" Macro *mc_construct(char const *definition, size_t nargs); void mc_destroy(void *macro); yodl-4.04.00/macro/mcconstruct.c0000644000175000017500000000044714066072154015435 0ustar frankfrank#include "macro.ih" Macro *mc_construct(char const *definition, size_t nargs) { Macro *macro = (Macro *)new_memory(1, sizeof(Macro)); stack_construct(¯o->d_definition, free); stack_construct(¯o->d_arg, NULL); macro_push(macro, definition, nargs); return macro; } yodl-4.04.00/macro/macropop.c0000644000175000017500000000032314066072154014702 0ustar frankfrank#include "macro.ih" Result macro_pop(Macro *macro) { if (!stack_size(¯o->d_definition)) return FAILED; stack_pop(¯o->d_definition); stack_pop(¯o->d_arg); return SUCCESS; } yodl-4.04.00/macro/macropush.c0000644000175000017500000000046714066072154015074 0ustar frankfrank#include "macro.ih" Result macro_push(Macro *macro, char const *definition, size_t nargs) { register StackValue stValue; stValue.u_voidp = new_str(definition); stack_push(¯o->d_definition, stValue); stValue.u_size_t = nargs; stack_push(¯o->d_arg, stValue); return SUCCESS; } yodl-4.04.00/macro/mcdestroy.c0000644000175000017500000000025314066072154015075 0ustar frankfrank#include "macro.ih" void mc_destroy(void *macro) { stack_destruct(&((Macro *)macro)->d_definition); stack_destruct(&((Macro *)macro)->d_arg); free(macro); } yodl-4.04.00/macro/macroinsert.c0000644000175000017500000000053314066072154015413 0ustar frankfrank#include "macro.ih" Result macro_insert(HashMap *symtab, char const *name, char const *definition, size_t nargs) { return hashmap_insert ( symtab, hashitem_new_destructor(MACRO, name, mc_construct(definition, nargs), mc_destroy) ); } yodl-4.04.00/macro/macro.h0000644000175000017500000000361214066072154014174 0ustar frankfrank#ifndef INCLUDED_MACRO_H_ #define INCLUDED_MACRO_H_ #include "../hashmap/hashmap.h" #include "../stack/stack.h" /* ========================================================================= Macro holds the information about user defined macros processing nested files. Defining a macro means that its name is stored in the symboltable. If that succeeds, definitions and arguments may be defined. Renaming a macro means that the new name is stored in the symboltable and that the old name is removed from it. The new name will obtain as its symboltable-value the value of the old name. The symboltable holds indices into `macro'. Since Yodl doesn't run for extensive periods of time, removing a macro will not also shorten the corresponding macro's d_definition and d_arg structures. The appropriate elements, however, will be freed. functions are called macro_...() */ typedef struct { Stack d_definition; /* The definition stack: at a pushmacro */ /* a new definition will be pushed */ Stack d_arg; /* Each macro has its own stack of */ /* args. Local redefinitions of macros */ /* may thus define a different number */ /* of arguments. */ } Macro; Result macro_insert(HashMap *map, char const *name, char const *definition, size_t nargs); Result macro_pop(Macro *macro); /* Always SUCCESS, but macro must be valid ptr */ Result macro_push(Macro *macro, char const *definition, size_t nargs); static inline char const *macro_definition(Macro const *macro) { return stack_tos(¯o->d_definition)->u_charCp; } static inline size_t macro_nArgs(Macro const *macro) { return stack_tos(¯o->d_arg)->u_size_t; } #endif yodl-4.04.00/macros/0000755000175000017500000000000014066072154013103 5ustar frankfrankyodl-4.04.00/macros/yodl/0000755000175000017500000000000014066072154014052 5ustar frankfrankyodl-4.04.00/macros/yodl/xlatin1.tex0000644000175000017500000001256314066072154016163 0ustar frankfrank% % xlatin1.tex - installed with the Yodl macro tree, though it's not 'sec' % part of Yodl. Yodl just uses it to map accent characters, such as é, % to standard LaTeX \char stuff. % See below on copyright stuff etc. % Distributed with Yodl 1.32.00 % %% xlatin1.tex derived from $Id$ %% %% Interpret the full ISO Latin1 (8859-1) input character set for TeX. %% Copyright (c) 1991 Kristoffer Høgsbro Rose %% %% This file is distributed in the hope that it will be useful, but WITHOUT %% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or %% FITNESS FOR A PARTICULAR PURPOSE. %% %% NOTE: %% - Characters that require AMSFonts are marked %%AMS. %% - Characters that are undefined are marked %%Missing. %% - Lines that require TeX 3 are marked %%TeX3. \def\slashedfrac#1#2{\hbox{\kern.1em % \raise.5ex\hbox{\the\scriptfont0 #1}\kern-.11em % /\kern-.15em\lower.25ex\hbox{\the\scriptfont0 #2}}} \catcode`\¡=\active \chardef¡="3C \catcode`\¢=\active \def¢{$\not c$} \catcode`\£=\active \def£{{\it\$}} \catcode`\¤=\active %%Missing: `currency' \catcode`\¥=\active \def¥{\yen} %%AMS \catcode`\¦\active %%Missing: `split bar' \catcode`\§=\active \def§{\S} \catcode`\¨=\active \def¨{\"{\phantom{x}}} \catcode`\©=\active \def©{\copyright} %%AMS \catcode`\ª=\active %%Missing: `female gender' \catcode`\«=\active %%Missing: `left guillemot' \catcode`\¬=\active \mathchardef¬="023A \catcode`\­=\active \def­{\-} \catcode`\®=\active \def®{\circledR} %%AMS \catcode`\¯\active %%Missing: `overbar' \catcode`\°=\active \def°{^\circ} \catcode`\±=\active \mathchardef±="2206 \catcode`\²=\active \def²{^2} \catcode`\³=\active \def³{^3} \catcode`\´=\active \def´{\'{\phantom{x}}} \catcode`\µ=\active \mathchardefµ="0116 \catcode`\¶=\active \def¶{\P} \catcode`\·=\active \mathchardef·="2201 \catcode`\¸=\active \def¸{\c{\phantom{x}}} \catcode`\¹=\active \def¹{^1} \catcode`\º=\active %%Missing: `female gender' \catcode`\»=\active %%Missing: `right guillemot' \catcode`\¼=\active \def¼{\slashedfrac14} \catcode`\½=\active \def½{\slashedfrac12} \catcode`\¾=\active \def¾{\slashedfrac34} \catcode`\¿=\active \chardef¿="3E \catcode`\à=\active \defà{\`a} \catcode`\À=\active \defÀ{\`A} \uccode`\à=`\À \lccode`\À=`\à %%TeX3 \catcode`\á=\active \defá{\'a} \catcode`\Á=\active \defÁ{\'A} \uccode`\á=`\Á \lccode`\Á=`\á %%TeX3 \catcode`\â=\active \defâ{\^a} \catcode`\Â=\active \defÂ{\^A} \uccode`\â=`\Â \lccode`\Â=`\â %%TeX3 \catcode`\ã=\active \defã{\~a} \catcode`\Ã=\active \defÃ{\~A} \uccode`\ã=`\Ã \lccode`\Ã=`\ã %%TeX3 \catcode`\ä=\active \defä{\"a} \catcode`\Ä=\active \defÄ{\"A} \uccode`\ä=`\Ä \lccode`\Ä=`\ä %%TeX3 \catcode`\å=\active \defå{\aa} \catcode`\Å=\active \defÅ{\ifmmode\text\AA\else\AA\fi} \uccode`\å=`\Å \lccode`\Å=`\å %%TeX3 \catcode`\æ=\active \chardefæ="1A \catcode`\Æ=\active \chardefÆ="1D \uccode`\æ=`\Æ \lccode`\Æ=`\æ %%TeX3 \uccode"1A="1D \lccode"1D="1A \catcode`\ç=\active \defç{\c c} \catcode`\Ç=\active \defÇ{\c C} \uccode`\ç=`\Ç \lccode`\Ç=`\ç %%TeX3 \catcode`\è=\active \defè{\`e} \catcode`\È=\active \defÈ{\`E} \uccode`\è=`\È \lccode`\È=`\è %%TeX3 \catcode`\é=\active \defé{\'e} \catcode`\É=\active \defÉ{\'E} \uccode`\é=`\É \lccode`\É=`\é %%TeX3 \catcode`\ê=\active \defê{\^e} \catcode`\Ê=\active \defÊ{\^E} \uccode`\ê=`\Ê \lccode`\Ê=`\ê %%TeX3 \catcode`\ë=\active \defë{\"e} \catcode`\Ë=\active \defË{\"E} \uccode`\ë=`\Ë \lccode`\Ë=`\ë %%TeX3 \catcode`\ì=\active \defì{\`\i} \catcode`\Ì=\active \defÌ{\`I} \uccode`\ì=`\Ì \lccode`\Ì=`\ì %%TeX3 \catcode`\í=\active \defí{\'\i} \catcode`\Í=\active \defÍ{\'I} \uccode`\í=`\Í \lccode`\Í=`\í %%TeX3 \catcode`\î=\active \defî{\^\i} \catcode`\Î=\active \defÈ{\^I} \uccode`\î=`\Î \lccode`\Î=`\î %%TeX3 \catcode`\ï=\active \defï{\"\i} \catcode`\Ï=\active \defÏ{\"I} \uccode`\ï=`\Ï \lccode`\Ï=`\ï %%TeX3 \catcode`\Ð=\active %%Missing: `D-bar' \catcode`\ð=\active %%Missing. \uccode`\Ð=`\ð \lccode`\ð=`\Ð %%TeX3 \catcode`\ñ=\active \defñ={\~n} \catcode`\Ñ=\active \defÑ={\~N} \uccode`\ñ=`\Ñ \lccode`\Ñ=`\ñ %%TeX3 \catcode`\ò=\active \defò{\`o} \catcode`\Ò=\active \defÒ{\`O} \uccode`\ò=`\Ò \lccode`\Ò=`\ò %%TeX3 \catcode`\ó=\active \defó{\'o} \catcode`\Ó=\active \defÓ{\'O} \uccode`\ó=`\Ó \lccode`\Ó=`\ó %%TeX3 \catcode`\ô=\active \defô{\^o} \catcode`\Ô=\active \defÔ{\^O} \uccode`\ô=`\Ô \lccode`\Ô=`\ô %%TeX3 \catcode`\õ=\active \defõ{\^o} \catcode`\Õ=\active \defÕ{\^O} \uccode`\õ=`\Õ \lccode`\Õ=`\õ %%TeX3 \catcode`\ö=\active \defö{\"o} \catcode`\Ö=\active \defÖ{\"O} \uccode`\ö=`\Ö \lccode`\Ö=`\ö %%TeX3 \catcode`\ø=\active \chardefø="1C \catcode`\Ø=\active \chardefØ="1F \uccode`\ø=`\Ø \lccode`\Ø=`\ø %%TeX3 \uccode"1C="1F \lccode"1F="1C \catcode`\ù=\active \defù{\`u} \catcode`\Ù=\active \defÙ{\`U} \uccode`\ù=`\Ù \lccode`\Ù=`\ù %%TeX3 \catcode`\ú=\active \defú{\'u} \catcode`\Ú=\active \defÚ{\'U} \uccode`\ú=`\Ú \lccode`\Ú=`\ú %%TeX3 \catcode`\û=\active \defû{\^u} \catcode`\Û=\active \defÛ{\^U} \uccode`\û=`\Û \lccode`\Û=`\û %%TeX3 \catcode`\ü=\active \defü{\"u} \catcode`\Ü=\active \defÜ{\"U} \uccode`\ü=`\Ü \lccode`\Ü=`\ü %%TeX3 \catcode`\Ý=\active \defÝ{\'Y} \catcode`\ý=\active \defý{\'y} \uccode`\Ý=`\ý \lccode`\ý=`\Ý %%TeX3 \catcode`\ÿ=\active \defÿ{\"y} \catcode`\þ=\active %%Missing: `thorn' \catcode`\Þ=\active %%Missing: `Thorn' \uccode`\þ=`\Þ \lccode`\Þ=`\þ %%TeX3 \catcode`\ß=\active \defß{\ss} \catcode`\×=\active \mathchardef×="2202 \catcode`\÷=\active \mathchardef÷="2204 \endinput yodl-4.04.00/macros/yodl/chartables/0000755000175000017500000000000014073326017016160 5ustar frankfrankyodl-4.04.00/macros/yodl/chartables/man.tables.yo0000644000175000017500000000260614066072154020563 0ustar frankfrank COMMENT(*** Character translation tables. To force a hyphen, use manpagecommand(\CHAR(40)hy) ***) DEFINECHARTABLE(standard)( '\\' = "\\e" '-' = "\\-" '\'' = "\\\050cq\\&" '"' = "\\\050dq\\&" '.' = "\\&." ) COMMENT(*** Accent characters, leading to empty chars. ***) SUBST(\ss)(ss) SUBST(\'a)(a) SUBST(\`a)(a) SUBST(\"a)(a) SUBST(\^a)(a) SUBST(\~a)(a) SUBST(\oa)(a) SUBST(\'e)(e) SUBST(\`e)(e) SUBST(\"e)(e) SUBST(\^e)(e) SUBST(\~e)(e) SUBST(\oe)(e) SUBST(\'i)(i) SUBST(\`i)(i) SUBST(\"i)(i) SUBST(\^i)(i) SUBST(\~i)(i) SUBST(\oi)(i) SUBST(\~n)(n) SUBST(\'o)(o) SUBST(\`o)(o) SUBST(\"o)(o) SUBST(\^o)(o) SUBST(\~o)(o) SUBST(\oo)(o) SUBST(\/o)(o) SUBST(\'u)(u) SUBST(\`u)(u) SUBST(\"u)(u) SUBST(\^u)(u) SUBST(\~u)(u) SUBST(\ou)(u) SUBST(\'y)(y) SUBST(\`y)(y) SUBST(\"y)(y) SUBST(\^y)(y) SUBST(\~y)(y) SUBST(\oy)(y) SUBST(\'A)(A) SUBST(\`A)(A) SUBST(\"A)(A) SUBST(\^A)(A) SUBST(\~A)(A) SUBST(\oA)(A) SUBST(\'E)(E) SUBST(\`E)(E) SUBST(\"E)(E) SUBST(\^E)(E) SUBST(\~E)(E) SUBST(\oE)(E) SUBST(\'I)(I) SUBST(\`I)(I) SUBST(\"I)(I) SUBST(\^I)(I) SUBST(\~I)(I) SUBST(\oI)(I) SUBST(\~N)(N) SUBST(\'O)(O) SUBST(\`O)(O) SUBST(\"O)(O) SUBST(\^O)(O) SUBST(\~O)(O) SUBST(\oO)(O) SUBST(\/O)(O) SUBST(\'U)(U) SUBST(\`U)(U) SUBST(\"U)(U) SUBST(\^U)(U) SUBST(\~U)(U) SUBST(\oU)(U) SUBST(\'Y)(Y) SUBST(\`Y)(Y) SUBST(\"Y)(Y) SUBST(\^Y)(Y) SUBST(\~Y)(Y) SUBST(\oY)(Y) yodl-4.04.00/macros/yodl/chartables/txt.tables.yo0000644000175000017500000000220414066072154020621 0ustar frankfrank COMMENT(*** Accent characters, leading to empty chars. ***) SUBST(\ss)(ss) SUBST(\'a)(a) SUBST(\`a)(a) SUBST(\"a)(a) SUBST(\^a)(a) SUBST(\~a)(a) SUBST(\oa)(a) SUBST(\'e)(e) SUBST(\`e)(e) SUBST(\"e)(e) SUBST(\^e)(e) SUBST(\~e)(e) SUBST(\oe)(e) SUBST(\'i)(i) SUBST(\`i)(i) SUBST(\"i)(i) SUBST(\^i)(i) SUBST(\~i)(i) SUBST(\oi)(i) SUBST(\~n)(n) SUBST(\'o)(o) SUBST(\`o)(o) SUBST(\"o)(o) SUBST(\^o)(o) SUBST(\~o)(o) SUBST(\oo)(o) SUBST(\/o)(o) SUBST(\'u)(u) SUBST(\`u)(u) SUBST(\"u)(u) SUBST(\^u)(u) SUBST(\~u)(u) SUBST(\ou)(u) SUBST(\'y)(y) SUBST(\`y)(y) SUBST(\"y)(y) SUBST(\^y)(y) SUBST(\~y)(y) SUBST(\oy)(y) SUBST(\'A)(A) SUBST(\`A)(A) SUBST(\"A)(A) SUBST(\^A)(A) SUBST(\~A)(A) SUBST(\oA)(A) SUBST(\'E)(E) SUBST(\`E)(E) SUBST(\"E)(E) SUBST(\^E)(E) SUBST(\~E)(E) SUBST(\oE)(E) SUBST(\'I)(I) SUBST(\`I)(I) SUBST(\"I)(I) SUBST(\^I)(I) SUBST(\~I)(I) SUBST(\oI)(I) SUBST(\~N)(N) SUBST(\'O)(O) SUBST(\`O)(O) SUBST(\"O)(O) SUBST(\^O)(O) SUBST(\~O)(O) SUBST(\oO)(O) SUBST(\/O)(O) SUBST(\'U)(U) SUBST(\`U)(U) SUBST(\"U)(U) SUBST(\^U)(U) SUBST(\~U)(U) SUBST(\oU)(U) SUBST(\'Y)(Y) SUBST(\`Y)(Y) SUBST(\"Y)(Y) SUBST(\^Y)(Y) SUBST(\~Y)(Y) SUBST(\oY)(Y) yodl-4.04.00/macros/yodl/chartables/latex2.tables.yo0000644000175000017500000000600414066072154021203 0ustar frankfrank COMMENT(Depreciated. Backward latex (2) compatibility only.) COMMENT(*** Standard translation table. ***) DEFINECHARTABLE(standard)( '#' = "\\#" '$' = "\\$" '%' = "\\%" '_' = "\\_" '^' = "{\\tt\\^{ }}" '\\' = "{\\tt $\\backslash$}" '{' = "{\\tt\\{}" '}' = "{\\tt\\}}" '[' = "{\\tt{[}}" ']' = "{\\tt{]}}" '<' = "{\\tt $<$}" '>' = "{\\tt $>$}" '*' = "{\\tt $*$}" '&' = "{\\tt\\&}" '~' = "{\\tt\\~{ }}" '|' = "{\\tt$\\mid$}" ) COMMENT(*** Accent characters. *** Note: chars such as ü are handled by the xlatin1.tex conversion.) SUBST(\ss)(latexcommand(\ss{})) SUBST(\'a)(latexcommand(\'{a})) SUBST(\`a)(latexcommand(\`{a})) SUBST(\"a)(latexcommand(\"{a})) SUBST(\^a)(latexcommand(\^{a})) SUBST(\~a)(latexcommand(\~{a})) SUBST(\oa)(latexcommand({\aa})) SUBST(\'e)(latexcommand(\'{e})) SUBST(\`e)(latexcommand(\`{e})) SUBST(\"e)(latexcommand(\"{e})) SUBST(\^e)(latexcommand(\^{e})) SUBST(\~e)(latexcommand(\~{e})) SUBST(\oe)(latexcommand(\o{e})) SUBST(\'i)(latexcommand(\'{\i})) SUBST(\`i)(latexcommand(\`{\i})) SUBST(\"i)(latexcommand(\"{\i})) SUBST(\^i)(latexcommand(\^{\i})) SUBST(\~i)(latexcommand(\~{\i})) SUBST(\oi)(latexcommand(\o{\i})) SUBST(\'o)(latexcommand(\'{o})) SUBST(\`o)(latexcommand(\`{o})) SUBST(\"o)(latexcommand(\"{o})) SUBST(\^o)(latexcommand(\^{o})) SUBST(\~o)(latexcommand(\~{o})) SUBST(\oo)(latexcommand(\o{o})) SUBST(\/o)(latexcommand(\o{})) SUBST(\'u)(latexcommand(\'{u})) SUBST(\`u)(latexcommand(\`{u})) SUBST(\"u)(latexcommand(\"{u})) SUBST(\^u)(latexcommand(\^{u})) SUBST(\~u)(latexcommand(\~{u})) SUBST(\ou)(latexcommand(\o{u})) SUBST(\'y)(latexcommand(\'{y})) SUBST(\`y)(latexcommand(\`{y})) SUBST(\"y)(latexcommand(\"{y})) SUBST(\^y)(latexcommand(\^{y})) SUBST(\~y)(latexcommand(\~{y})) SUBST(\oy)(latexcommand(\o{y})) SUBST(\'A)(latexcommand(\'{A})) SUBST(\`A)(latexcommand(\`{A})) SUBST(\"A)(latexcommand(\"{A})) SUBST(\^A)(latexcommand(\^{A})) SUBST(\~A)(latexcommand(\~{A})) SUBST(\oA)(latexcommand({\AA})) SUBST(\'E)(latexcommand(\'{E})) SUBST(\`E)(latexcommand(\`{E})) SUBST(\"E)(latexcommand(\"{E})) SUBST(\^E)(latexcommand(\^{E})) SUBST(\~E)(latexcommand(\~{E})) SUBST(\oE)(latexcommand(\o{E})) SUBST(\'I)(latexcommand(\'{I})) SUBST(\`I)(latexcommand(\`{I})) SUBST(\"I)(latexcommand(\"{I})) SUBST(\^I)(latexcommand(\^{I})) SUBST(\~I)(latexcommand(\~{I})) SUBST(\oI)(latexcommand(\o{I})) SUBST(\'O)(latexcommand(\'{O})) SUBST(\`O)(latexcommand(\`{O})) SUBST(\"O)(latexcommand(\"{O})) SUBST(\^O)(latexcommand(\^{O})) SUBST(\~O)(latexcommand(\~{O})) SUBST(\oO)(latexcommand(\o{O})) SUBST(\/O)(latexcommand(\O{})) SUBST(\'U)(latexcommand(\'{U})) SUBST(\`U)(latexcommand(\`{U})) SUBST(\"U)(latexcommand(\"{U})) SUBST(\^U)(latexcommand(\^{U})) SUBST(\~U)(latexcommand(\~{U})) SUBST(\oU)(latexcommand(\o{U})) SUBST(\'Y)(latexcommand(\'{Y})) SUBST(\`Y)(latexcommand(\`{Y})) SUBST(\"Y)(latexcommand(\"{Y})) SUBST(\^Y)(latexcommand(\^{Y})) SUBST(\~Y)(latexcommand(\~{Y})) SUBST(\oY)(latexcommand(\o{Y})) yodl-4.04.00/macros/yodl/chartables/sgml.tables.yo0000644000175000017500000000477114066072154020757 0ustar frankfrank COMMENT(*** Default translation table. ALWAYS USED! ***) DEFINECHARTABLE(standard)( '&' = "&ero;" '*' = "*" '\\' = "\" '@' = "@" '$' = "$" '<' = "<" '>' = ">" '[' = "[" ']' = "]" '{' = "{" '}' = "}" '|' = "|" '#' = "#" '%' = "%" '"' = "&dquot;" ) DEFINECHARTABLE(list)( '&' = "&" ) COMMENT(*** Accent characters. ***) SUBST(\ss)(ss) SUBST(\'a)(CHAR(&)aacute;) SUBST(\`a)(CHAR(&)agrave;) SUBST(\"a)(CHAR(&)auml;) SUBST(\^a)(CHAR(&)acirc;) SUBST(\~a)(CHAR(&)atilde;) SUBST(\oa)(CHAR(&)aring;) SUBST(\'e)(CHAR(&)eacute;) SUBST(\`e)(CHAR(&)egrave;) SUBST(\"e)(CHAR(&)euml;) SUBST(\^e)(CHAR(&)ecirc;) SUBST(\~e)(CHAR(&)etilde;) SUBST(\oe)(CHAR(&)ering;) SUBST(\'i)(CHAR(&)iacute;) SUBST(\`i)(CHAR(&)igrave;) SUBST(\"i)(CHAR(&)iuml;) SUBST(\^i)(CHAR(&)icirc;) SUBST(\~i)(CHAR(&)itilde;) SUBST(\oi)(CHAR(&)iring;) SUBST(\~n)(CHAR(&)ntilde;) SUBST(\'o)(CHAR(&)oacute;) SUBST(\`o)(CHAR(&)ograve;) SUBST(\"o)(CHAR(&)ouml;) SUBST(\^o)(CHAR(&)ocirc;) SUBST(\~o)(CHAR(&)otilde;) SUBST(\oo)(CHAR(&)oring;) SUBST(\/o)(CHAR(&)oslash;) SUBST(\'u)(CHAR(&)uacute;) SUBST(\`u)(CHAR(&)ugrave;) SUBST(\"u)(CHAR(&)uuml;) SUBST(\^u)(CHAR(&)ucirc;) SUBST(\~u)(CHAR(&)utilde;) SUBST(\ou)(CHAR(&)uring;) SUBST(\'y)(CHAR(&)yacute;) SUBST(\`y)(CHAR(&)ygrave;) SUBST(\"y)(CHAR(&)yuml;) SUBST(\^y)(CHAR(&)ycirc;) SUBST(\~y)(CHAR(&)ytilde;) SUBST(\oy)(CHAR(&)yring;) SUBST(\'A)(CHAR(&)Aacute;) SUBST(\`A)(CHAR(&)Agrave;) SUBST(\"A)(CHAR(&)Auml;) SUBST(\^A)(CHAR(&)Acirc;) SUBST(\~A)(CHAR(&)Atilde;) SUBST(\oA)(CHAR(&)Aring;) SUBST(\'E)(CHAR(&)Eacute;) SUBST(\`E)(CHAR(&)Egrave;) SUBST(\"E)(CHAR(&)Euml;) SUBST(\^E)(CHAR(&)Ecirc;) SUBST(\~E)(CHAR(&)Etilde;) SUBST(\oE)(CHAR(&)Ering;) SUBST(\'I)(CHAR(&)Iacute;) SUBST(\`I)(CHAR(&)Igrave;) SUBST(\"I)(CHAR(&)Iuml;) SUBST(\^I)(CHAR(&)Icirc;) SUBST(\~I)(CHAR(&)Itilde;) SUBST(\oI)(CHAR(&)Iring;) SUBST(\~N)(CHAR(&)Ntilde;) SUBST(\'O)(CHAR(&)Oacute;) SUBST(\`O)(CHAR(&)Ograve;) SUBST(\"O)(CHAR(&)Ouml;) SUBST(\^O)(CHAR(&)Ocirc;) SUBST(\~O)(CHAR(&)Otilde;) SUBST(\oO)(CHAR(&)Oring;) SUBST(\/o)(CHAR(&)Oslash;) SUBST(\'U)(CHAR(&)Uacute;) SUBST(\`U)(CHAR(&)Ugrave;) SUBST(\"U)(CHAR(&)Uuml;) SUBST(\^U)(CHAR(&)Ucirc;) SUBST(\~U)(CHAR(&)Utilde;) SUBST(\oU)(CHAR(&)Uring;) SUBST(\'Y)(CHAR(&)Yacute;) SUBST(\`Y)(CHAR(&)Ygrave;) SUBST(\"Y)(CHAR(&)Yuml;) SUBST(\^Y)(CHAR(&)Ycirc;) SUBST(\~Y)(CHAR(&)Ytilde;) SUBST(\oY)(CHAR(&)Yring;) yodl-4.04.00/macros/yodl/chartables/html.tables.yo0000644000175000017500000000720014066072154020747 0ustar frankfrank COMMENT(*** Default translation table. ALWAYS USED! ***) DEFINECHARTABLE(standard)( '&' = "&" '<' = "<" '>' = ">" 'á' = "á" 'à' = "à" 'ä' = "ä" 'â' = "â" 'ã' = "ã" 'ç' = "ç" 'é' = "é" 'è' = "è" 'ë' = "ë" 'ê' = "ê" 'í' = "í" 'ì' = "ì" 'ï' = "ï" 'î' = "î" 'ó' = "ó" 'ò' = "ò" 'ö' = "ö" 'ô' = "ô" 'õ' = "õ" 'ú' = "ú" 'ù' = "ù" 'ü' = "ü" 'û' = "û" 'ÿ' = "ÿ" 'ý' = "ý" 'Á' = "Á" 'À' = "À" 'Â' = "Â" 'Ã' = "Ã" 'Ç' = "Ç" 'É' = "É" 'È' = "È" 'Ë' = "Ë" 'Ê' = "Ê" 'Í' = "Í" 'Ì' = "Ì" 'Ï' = "Ï" 'Î' = "Î" 'Ó' = "Ó" 'Ò' = "Ò" 'Ö' = "Ö" 'Ô' = "Ô" 'Õ' = "Õ" 'Ú' = "Ú" 'Ù' = "Ù" 'Ü' = "Ü" 'Û' = "Û" 'Ý' = "Ý" ) COMMENT(*** Ackzent characters. ***) SUBST(\ss)(+NOTRANS(ß)) SUBST(\'a)(+NOTRANS(á)) SUBST(\`a)(+NOTRANS(à)) SUBST(\"a)(+NOTRANS(ä)) SUBST(\^a)(+NOTRANS(â)) SUBST(\~a)(+NOTRANS(ã)) SUBST(\oa)(+NOTRANS(å)) SUBST(\'e)(+NOTRANS(é)) SUBST(\`e)(+NOTRANS(è)) SUBST(\"e)(+NOTRANS(ë)) SUBST(\^e)(+NOTRANS(ê)) SUBST(\~e)(+NOTRANS(&etilde;)) SUBST(\oe)(+NOTRANS(&ering;)) SUBST(\'i)(+NOTRANS(í)) SUBST(\`i)(+NOTRANS(ì)) SUBST(\"i)(+NOTRANS(ï)) SUBST(\^i)(+NOTRANS(î)) SUBST(\~i)(+NOTRANS(ĩ)) SUBST(\oi)(+NOTRANS(&iring;)) SUBST(\~n)(+NOTRANS(ñ)) SUBST(\'o)(+NOTRANS(ó)) SUBST(\`o)(+NOTRANS(ò)) SUBST(\"o)(+NOTRANS(ö)) SUBST(\^o)(+NOTRANS(ô)) SUBST(\~o)(+NOTRANS(õ)) SUBST(\oo)(+NOTRANS(&oring;)) SUBST(\/o)(+NOTRANS(ø)) SUBST(\'u)(+NOTRANS(ú)) SUBST(\`u)(+NOTRANS(ù)) SUBST(\"u)(+NOTRANS(ü)) SUBST(\^u)(+NOTRANS(û)) SUBST(\~u)(+NOTRANS(ũ)) SUBST(\ou)(+NOTRANS(ů)) SUBST(\'y)(+NOTRANS(ý)) SUBST(\`y)(+NOTRANS(&ygrave;)) SUBST(\"y)(+NOTRANS(ÿ)) SUBST(\^y)(+NOTRANS(ŷ)) SUBST(\~y)(+NOTRANS(&ytilde;)) SUBST(\oy)(+NOTRANS(&yring;)) SUBST(\'A)(+NOTRANS(Á)) SUBST(\`A)(+NOTRANS(À)) SUBST(\"A)(+NOTRANS(Ä)) SUBST(\^A)(+NOTRANS(Â)) SUBST(\~A)(+NOTRANS(Ã)) SUBST(\oA)(+NOTRANS(Å)) SUBST(\'E)(+NOTRANS(É)) SUBST(\`E)(+NOTRANS(È)) SUBST(\"E)(+NOTRANS(Ë)) SUBST(\^E)(+NOTRANS(Ê)) SUBST(\~E)(+NOTRANS(&Etilde;)) SUBST(\oE)(+NOTRANS(&Ering;)) SUBST(\'I)(+NOTRANS(Í)) SUBST(\`I)(+NOTRANS(Ì)) SUBST(\"I)(+NOTRANS(Ï)) SUBST(\^I)(+NOTRANS(Î)) SUBST(\~I)(+NOTRANS(Ĩ)) SUBST(\oI)(+NOTRANS(&Iring;)) SUBST(\~N)(+NOTRANS(Ñ)) SUBST(\'O)(+NOTRANS(Ó)) SUBST(\`O)(+NOTRANS(Ò)) SUBST(\"O)(+NOTRANS(Ö)) SUBST(\^O)(+NOTRANS(Ô)) SUBST(\~O)(+NOTRANS(Õ)) SUBST(\oO)(+NOTRANS(&Oring;)) SUBST(\/O)(+NOTRANS(Ø)) SUBST(\'U)(+NOTRANS(Ú)) SUBST(\`U)(+NOTRANS(Ù)) SUBST(\"U)(+NOTRANS(Ü)) SUBST(\^U)(+NOTRANS(Û)) SUBST(\~U)(+NOTRANS(Ũ)) SUBST(\oU)(+NOTRANS(Ů)) SUBST(\'Y)(+NOTRANS(Ý)) SUBST(\`Y)(+NOTRANS(&Ygrave;)) SUBST(\"Y)(+NOTRANS(Ÿ)) SUBST(\^Y)(+NOTRANS(Ŷ)) SUBST(\~Y)(+NOTRANS(&Ytilde;)) SUBST(\oY)(+NOTRANS(&Yring;)) yodl-4.04.00/macros/yodl/chartables/texinfo.tables.yo0000644000175000017500000000031114066072154021453 0ustar frankfrankCOMMENT(Texinfo by Jan Nieuwenhuizen ) COMMENT(*** Default translation table. ALWAYS USED! ***) DEFINECHARTABLE(standard)( '@' = "@@" '{' = "@{" '}' = "@}" ) yodl-4.04.00/macros/yodl/chartables/xml.tables.yo0000644000175000017500000000315214066072154020605 0ustar frankfrank COMMENT(*** Default translation table. ALWAYS USED! ***) DEFINECHARTABLE(standard)( '&' = "&" '<' = "<" '>' = ">" ) COMMENT(*** Accented characters. ***) SUBST(\ss)(ß) SUBST(\'a)(á) SUBST(\`a)(à) SUBST(\"a)(ä) SUBST(\^a)(â) SUBST(\~a)(ã) SUBST(\oa)(å) SUBST(\cedil)(ç) SUBST(\Cedil)(ç) SUBST(\'e)(é) SUBST(\`e)(è) SUBST(\"e)(ë) SUBST(\^e)(ê) SUBST(\~e)(e) SUBST(\oe)(æ) SUBST(\'i)(í) SUBST(\`i)(ì) SUBST(\"i)(ï) SUBST(\^i)(î) SUBST(\~i)(i) COMMENT(How to do the ĩ) SUBST(\oi)(i) COMMENT(How to do the &iring; ?) SUBST(\~n)(ñ) SUBST(\'o)(ó) SUBST(\`o)(ò) SUBST(\"o)(ö) SUBST(\^o)(ô) SUBST(\~o)(õ) SUBST(\oo)(o) COMMENT(How to do the &oring; ?) SUBST(\/o)(ø) COMMENT(How to do the ø ?) SUBST(\'u)(ú) SUBST(\`u)(ù) SUBST(\"u)(ü) SUBST(\^u)(û) SUBST(\~u)(u) COMMENT(How to do the ĩ) SUBST(\ou)(u) COMMENT(How to do the ů) SUBST(\'y)(ý) SUBST(\`y)(y) COMMENT(NOTRANS(&ygrave;)) SUBST(\"y)(ÿ) SUBST(\^y)(y) COMMENT(NOTRANS(ŷ)) SUBST(\~y)(y) COMMENT(NOTRANS(&ytilde;)) SUBST(\oy)(y) COMMENT(NOTRANS(&yring;)) SUBST(\'A)(Á) SUBST(\`A)(Á) SUBST(\"A)(Ä) SUBST(\^A)(Â) SUBST(\~A)(Ã) SUBST(\oA)(Å) SUBST(\'E)(É) SUBST(\`E)(È) SUBST(\"E)(Ë) SUBST(\^E)(Ê) SUBST(\~E)(E) SUBST(\oE)(Æ) SUBST(\'I)(Í) SUBST(\`I)(Ì) SUBST(\"I)(Ï) SUBST(\^I)(Î) SUBST(\~I)(I) SUBST(\oI)(I) SUBST(\'O)(Ó) SUBST(\`O)(Ò) SUBST(\"O)(Ö) SUBST(\^O)(Ô) SUBST(\~O)(Õ) SUBST(\oO)(Ø) SUBST(\/O)(Ø) SUBST(\~N)(Ñ) SUBST(\'U)(Ú) SUBST(\`U)(Ù) SUBST(\"U)(Ü) SUBST(\^U)(Û) SUBST(\~U)(U) SUBST(\oU)(U) SUBST(\'Y)(Ý) SUBST(\`Y)(Y) SUBST(\"Y)(Y) SUBST(\^Y)(Y) SUBST(\~Y)(Y) SUBST(\oY)(Y) yodl-4.04.00/macros/yodl/chartables/shell.tables.yo0000644000175000017500000000072414066072154021116 0ustar frankfrank COMMENT(*** Escape active chars ***) COMMENT( SUBST(\)(\\) SUBST(')(\') SUBST(")(\") SUBST(*)(\*) SUBST(`)(\`) SUBST(CHAR(C)HAR(40))(\CHAR(C)HAR(40)) SUBST(CHAR(C)HAR(41))(\CHAR(C)HAR(41)) SUBST([)(\[) SUBST(])(\]) ) COMMENT( CHAR(C)HAR(40) = \CHAR(C)HAR(40) CHAR(C)HAR(41) = \CHAR(C)HAR(41) ) DEFINECHARTABLE(shell)( '\' = "\\" ''' = "\'" '"' = "\"" '*' = "\*" '`' = "\`" '[' = "\[" ']' = "\]" '{' = "\{" '}' = "\}" ) yodl-4.04.00/macros/yodl/chartables/latex.tables.yo0000644000175000017500000000554714066072154021134 0ustar frankfrank COMMENT(*** Standard translation table. ***) DEFINECHARTABLE(standard)( '#' = "\\#" '$' = "\\$" '%' = "\\%" '_' = "\\_" '^' = "\\textasciicircum{}" '\\' = "\\textbackslash{}" '{' = "\\{" '}' = "\\}" '[' = "{[}" ']' = "{]}" '<' = "$<$" '>' = "$>$" '*' = "$*$" '&' = "\\&" '~' = "\\textasciitilde{}" '|' = "\\textbar{}" ) COMMENT(*** Accent characters. *** Note: chars such as ü are handled by the xlatin1.tex conversion. Note: can't use \ss{} for the latex conversion, since that will take us in an eternal loop: \ss being replaced by \ss{} -> \ss{}{} -> ... ) SUBST(\ss)(+NOTRANS(\s)NOTRANS(s{})) SUBST(\'a)(+NOTRANS(\'{a})) SUBST(\`a)(+NOTRANS(\`{a})) SUBST(\"a)(+NOTRANS(\"{a})) SUBST(\^a)(+NOTRANS(\^{a})) SUBST(\~a)(+NOTRANS(\~{a})) SUBST(\oa)(+NOTRANS({\aa})) SUBST(\'e)(+NOTRANS(\'{e})) SUBST(\`e)(+NOTRANS(\`{e})) SUBST(\"e)(+NOTRANS(\"{e})) SUBST(\^e)(+NOTRANS(\^{e})) SUBST(\~e)(+NOTRANS(\~{e})) SUBST(\oe)(+NOTRANS(\o{e})) SUBST(\'i)(+NOTRANS(\'{\i})) SUBST(\`i)(+NOTRANS(\`{\i})) SUBST(\"i)(+NOTRANS(\"{\i})) SUBST(\^i)(+NOTRANS(\^{\i})) SUBST(\~i)(+NOTRANS(\~{\i})) SUBST(\oi)(+NOTRANS(\o{\i})) SUBST(\~n)(+NOTRANS(\~{n})) SUBST(\'o)(+NOTRANS(\'{o})) SUBST(\`o)(+NOTRANS(\`{o})) SUBST(\"o)(+NOTRANS(\"{o})) SUBST(\^o)(+NOTRANS(\^{o})) SUBST(\~o)(+NOTRANS(\~{o})) SUBST(\oo)(+NOTRANS(\o{o})) SUBST(\/o)(+NOTRANS(\o{})) SUBST(\'u)(+NOTRANS(\'{u})) SUBST(\`u)(+NOTRANS(\`{u})) SUBST(\"u)(+NOTRANS(\"{u})) SUBST(\^u)(+NOTRANS(\^{u})) SUBST(\~u)(+NOTRANS(\~{u})) SUBST(\ou)(+NOTRANS(\o{u})) SUBST(\'y)(+NOTRANS(\'{y})) SUBST(\`y)(+NOTRANS(\`{y})) SUBST(\"y)(+NOTRANS(\"{y})) SUBST(\^y)(+NOTRANS(\^{y})) SUBST(\~y)(+NOTRANS(\~{y})) SUBST(\oy)(+NOTRANS(\o{y})) SUBST(\'A)(+NOTRANS(\'{A})) SUBST(\`A)(+NOTRANS(\`{A})) SUBST(\"A)(+NOTRANS(\"{A})) SUBST(\^A)(+NOTRANS(\^{A})) SUBST(\~A)(+NOTRANS(\~{A})) SUBST(\oA)(+NOTRANS({\AA})) SUBST(\'E)(+NOTRANS(\'{E})) SUBST(\`E)(+NOTRANS(\`{E})) SUBST(\"E)(+NOTRANS(\"{E})) SUBST(\^E)(+NOTRANS(\^{E})) SUBST(\~E)(+NOTRANS(\~{E})) SUBST(\oE)(+NOTRANS(\o{E})) SUBST(\'I)(+NOTRANS(\'{I})) SUBST(\`I)(+NOTRANS(\`{I})) SUBST(\"I)(+NOTRANS(\"{I})) SUBST(\^I)(+NOTRANS(\^{I})) SUBST(\~I)(+NOTRANS(\~{I})) SUBST(\oI)(+NOTRANS(\o{I})) SUBST(\~N)(+NOTRANS(\~{N})) SUBST(\'O)(+NOTRANS(\'{O})) SUBST(\`O)(+NOTRANS(\`{O})) SUBST(\"O)(+NOTRANS(\"{O})) SUBST(\^O)(+NOTRANS(\^{O})) SUBST(\~O)(+NOTRANS(\~{O})) SUBST(\oO)(+NOTRANS(\o{O})) SUBST(\/O)(+NOTRANS(\O{})) SUBST(\'U)(+NOTRANS(\'{U})) SUBST(\`U)(+NOTRANS(\`{U})) SUBST(\"U)(+NOTRANS(\"{U})) SUBST(\^U)(+NOTRANS(\^{U})) SUBST(\~U)(+NOTRANS(\~{U})) SUBST(\oU)(+NOTRANS(\o{U})) SUBST(\'Y)(+NOTRANS(\'{Y})) SUBST(\`Y)(+NOTRANS(\`{Y})) SUBST(\"Y)(+NOTRANS(\"{Y})) SUBST(\^Y)(+NOTRANS(\^{Y})) SUBST(\~Y)(+NOTRANS(\~{Y})) SUBST(\oY)(+NOTRANS(\o{Y})) SUBST(--)(+NOTRANS(-{}-{})) yodl-4.04.00/macros/yodl/xml/0000755000175000017500000000000014066072154014652 5ustar frankfrankyodl-4.04.00/macros/yodl/xml/rug-articlesummary.xml0000644000175000017500000000025314066072154021230 0ustar frankfrank

      yodl-4.04.00/macros/yodl/xml/rug-menubegin.xml0000644000175000017500000000104714066072154020142 0ustar frankfrank /_shared/status/published.xml <s:text>�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yodl-4.04.00/macros/yodl/xml/rug-articlebegin.xml���������������������������������������������������0000644�0001750�0001750�00000001455�14066072154�020624� 0����������������������������������������������������������������������������������������������������ustar �frank���������������������������frank������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" encoding="iso-8859-1" ?> <ga:generalArticle xmlns:ga="http://webplatform.rug.nl/_definition/classes/generalArticle" xmlns:java="http://xml.apache.org/xslt/java" xmlns:s="http://webplatform.rug.nl/_definition/shared/schemas/shared.xsd" xmlns:xalan="http://xml.apache.org/xalan" xmlns:xopus="http://www.xopus.org/xmlns/id" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://webplatform.rug.nl/_definition/classes/generalArticle http://webplatform.rug.nl:80/_definition/classes/generalArticle/classDefinition/generalArticle.xsd"> <s:status xmlns="http://webplatform.rug.nl/_definition/classes/generalArticle"> <s:ref type="path">/_shared/status/published.xml</s:ref> </s:status> <title xmlns="http://webplatform.rug.nl/_definition/classes/generalArticle"> <s:text> �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yodl-4.04.00/macros/yodl/xml/rug-nl-xhtmlbegin.xml��������������������������������������������������0000644�0001750�0001750�00000000122�14066072154�020732� 0����������������������������������������������������������������������������������������������������ustar �frank���������������������������frank������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<s:xhtmlBlock> <s:xhtml xml:lang="nl" xmlns="http://www.w3.org/1999/xhtml"> <div> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yodl-4.04.00/macros/yodl/xml/rug-nl-articleendtitle.xml���������������������������������������������0000644�0001750�0001750�00000000334�14066072154�021752� 0����������������������������������������������������������������������������������������������������ustar �frank���������������������������frank������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������</s:text> yodl-4.04.00/macros/yodl/xml/rug-xhtmlend.xml0000644000175000017500000000004214066072154020006 0ustar frankfrank yodl-4.04.00/macros/yodl/xml/rug-nl-menuend.xml0000644000175000017500000000064114066072154020232 0ustar frankfrank
      Feedback Reageer 536514 yodl-4.04.00/macros/yodl/xml/rug-nl-articlesummary.xml0000644000175000017500000000027214066072154021640 0ustar frankfrank

      yodl-4.04.00/macros/yodl/xml/rug-articleendtitle.xml0000644000175000017500000000031614066072154021343 0ustar frankfrank yodl-4.04.00/macros/yodl/xml/rug-menuendtitle.xml0000644000175000017500000000035114066072154020663 0ustar frankfrank yodl-4.04.00/macros/yodl/xml/rug-nl-menubegin.xml0000644000175000017500000000106514066072154020551 0ustar frankfrank /_shared/status/published.xml <s:text xml:lang="nl">���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yodl-4.04.00/macros/yodl/xml/rug-nl-articlebegin.xml������������������������������������������������0000644�0001750�0001750�00000001473�14066072154�021233� 0����������������������������������������������������������������������������������������������������ustar �frank���������������������������frank������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<?xml version="1.0" encoding="iso-8859-1" ?> <ga:generalArticle xmlns:ga="http://webplatform.rug.nl/_definition/classes/generalArticle" xmlns:java="http://xml.apache.org/xslt/java" xmlns:s="http://webplatform.rug.nl/_definition/shared/schemas/shared.xsd" xmlns:xalan="http://xml.apache.org/xalan" xmlns:xopus="http://www.xopus.org/xmlns/id" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://webplatform.rug.nl/_definition/classes/generalArticle http://webplatform.rug.nl:80/_definition/classes/generalArticle/classDefinition/generalArticle.xsd"> <s:status xmlns="http://webplatform.rug.nl/_definition/classes/generalArticle"> <s:ref type="path">/_shared/status/published.xml</s:ref> </s:status> <title xmlns="http://webplatform.rug.nl/_definition/classes/generalArticle"> <s:text xml:lang="nl"> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yodl-4.04.00/macros/yodl/xml/rug-menuend.xml��������������������������������������������������������0000644�0001750�0001750�00000000534�14066072154�017624� 0����������������������������������������������������������������������������������������������������ustar �frank���������������������������frank������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ <section/> <s:links> <s:linkGroup> <s:title> <s:text>Feedback</s:text> </s:title> <s:link> <s:internalLink> <s:ref type="id">536514</s:ref> </s:internalLink> </s:link> </s:linkGroup> </s:links> </folder> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������yodl-4.04.00/macros/yodl/xml/rug-xhtmlbegin.xml�����������������������������������������������������0000644�0001750�0001750�00000000104�14066072154�020323� 0����������������������������������������������������������������������������������������������������ustar �frank���������������������������frank������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������<s:xhtmlBlock> <s:xhtml xmlns="http://www.w3.org/1999/xhtml"> <div> ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yodl-4.04.00/macros/yodl/xml/rug-nl-xhtmlend.xml����������������������������������������������������0000644�0001750�0001750�00000000042�14066072154�020415� 0����������������������������������������������������������������������������������������������������ustar �frank���������������������������frank������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������</div> </s:xhtml> </s:xhtmlBlock> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yodl-4.04.00/macros/yodl/xml/rug-nl-menuendtitle.xml������������������������������������������������0000644�0001750�0001750�00000000351�14066072154�021272� 0����������������������������������������������������������������������������������������������������ustar �frank���������������������������frank������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ </s:text> yodl-4.04.00/macros/in/0000755000175000017500000000000014066072154013511 5ustar frankfrankyodl-4.04.00/macros/in/txt.in0000644000175000017500000000107314066072154014661 0ustar frankfrankINCWSLEVEL() IFSYMBOL(XXMACROPATH)()( PUSHSYMBOL(XXMACROPATH)(@STD_INCLUDE@) ) EVAL(INCLUDEFILE+CHAR(40)SYMBOLVALUE(XXMACROPATH)/yodlversion+CHAR(41)) TYPEOUT(Yodl2html SYMBOLVALUE(XXyodlVersion)) EVAL(INCLUDEFILE+CHAR(40)SYMBOLVALUE(XXMACROPATH)/std.txt+CHAR(41)) EVAL(INCLUDEFILE+CHAR(40)SYMBOLVALUE(XXMACROPATH)/chartables/txt.tables +CHAR(41)) COMMENT(DEFINESYMBOL(XXparagraph)()) DEFINEMACRO(PARAGRAPH)(0)(\ ifnewparagraph(\ XXnl()\ XXnl()\ )(\ )\ ) DECWSLEVEL() yodl-4.04.00/macros/in/html.in0000644000175000017500000000115214066072154015004 0ustar frankfrankINCWSLEVEL() IFSYMBOL(XXMACROPATH)()( PUSHSYMBOL(XXMACROPATH)(@STD_INCLUDE@) ) EVAL(INCLUDEFILE+CHAR(40)SYMBOLVALUE(XXMACROPATH)/yodlversion+CHAR(41)) TYPEOUT(Yodl2html SYMBOLVALUE(XXyodlVersion)) EVAL(INCLUDEFILE+CHAR(40)SYMBOLVALUE(XXMACROPATH)/std.html+CHAR(41)) EVAL(INCLUDEFILE+CHAR(40)SYMBOLVALUE(XXMACROPATH)/chartables/html.tables +CHAR(41)) USECHARTABLE(standard) COMMENT(DEFINESYMBOL(XXparagraph)()) DEFINEMACRO(PARAGRAPH)(0)(\ ifnewparagraph(\ XXnl()\ NOTRANS(

      )\ XXnl()\ )(\ )\ ) DECWSLEVEL() yodl-4.04.00/macros/in/yodlversion.in0000644000175000017500000000004714066072154016417 0ustar frankfrankDEFINESYMBOL(XXyodlVersion)(@VERSION@) yodl-4.04.00/macros/in/man.in0000644000175000017500000000137114066072154014616 0ustar frankfrankINCWSLEVEL() IFSYMBOL(XXMACROPATH)()( PUSHSYMBOL(XXMACROPATH)(@STD_INCLUDE@) ) EVAL(INCLUDEFILE+CHAR(40)SYMBOLVALUE(XXMACROPATH)/yodlversion+CHAR(41)) TYPEOUT(Yodl2man SYMBOLVALUE(XXyodlVersion)) ATEXIT(INTERNALINDEX(mandone)) INTERNALINDEX(set extension man) EVAL(INCLUDEFILE+CHAR(40)SYMBOLVALUE(XXMACROPATH)/std.man+CHAR(41)) EVAL(INCLUDEFILE+CHAR(40)SYMBOLVALUE(XXMACROPATH)/chartables/man.tables +CHAR(41)) USECHARTABLE(standard) COMMENT(DEFINESYMBOL(XXparagraph)()) DEFINEMACRO(PARAGRAPH)(0)(\ ifnewparagraph(\ IFZERO(XXinlist)(\ XXroffcmd(.PP)()()()\ )(\ XXroffcmd(.IP)()()()\ )\ )()\ ) POPSYMBOL(XXMACROPATH) DECWSLEVEL() yodl-4.04.00/macros/in/xml.in0000644000175000017500000000052114066072154014637 0ustar frankfrankINCWSLEVEL() INCLUDEFILE(@STD_INCLUDE@/yodlversion) TYPEOUT(Yodl2xml SYMBOLVALUE(XXyodlVersion)) INCLUDEFILE(@STD_INCLUDE@/std.xml) INCLUDEFILE(@STD_INCLUDE@/chartables/xml.tables) USECHARTABLE(standard) DEFINEMACRO(PARAGRAPH)(0)(\ ifnewparagraph(\ XXnl()\ XXmlbeginp()\ XXnl()\ )()\ ) DECWSLEVEL() yodl-4.04.00/macros/in/latex.in0000644000175000017500000000112214066072154015152 0ustar frankfrankINCWSLEVEL() IFSYMBOL(XXMACROPATH)()( PUSHSYMBOL(XXMACROPATH)(@STD_INCLUDE@) ) EVAL(INCLUDEFILE+CHAR(40)SYMBOLVALUE(XXMACROPATH)/yodlversion+CHAR(41)) TYPEOUT(Yodl2latex SYMBOLVALUE(XXyodlVersion)) EVAL(INCLUDEFILE+CHAR(40)SYMBOLVALUE(XXMACROPATH)/std.latex+CHAR(41)) EVAL(INCLUDEFILE+CHAR(40)SYMBOLVALUE(XXMACROPATH)/chartables/latex.tables +CHAR(41)) USECHARTABLE(standard) COMMENT(DEFINESYMBOL(XXparagraph)()) DEFINEMACRO(PARAGRAPH)(0)(\ ifnewparagraph(\ XXnl()\ XXnl()\ )()\ ) DECWSLEVEL() yodl-4.04.00/macros/rawmacros/0000755000175000017500000000000014066072154015101 5ustar frankfrankyodl-4.04.00/macros/rawmacros/xxstarttable.raw0000644000175000017500000000102314066072154020335 0ustar frankfrankDEFINEMACRO(XXstarttable)(2)(\ PUSHCOUNTER(XXtablewidth)(ARG1)\ NOTRANS(

    )\ NOTRANS(\begin{tabular}{)\ ARG2\ +NOTRANS(})\ NOTRANS(@multitable @columnfractions .45 .45)\ PUSHSYMBOL(XXroffcontents)()\ PUSHSYMBOL(XXroffalign)(ARG2)\ PUSHSYMBOL(XXtablealign)()\ XXroffcmd(.TS)()()()\ SYMBOLVALUE(XXrofftableoptions) tab+nop()(SYMBOLVALUE(XXrofftab));\ INTERNALINDEX(copy)\ XXmlIncBlock()\ NOTRANS(
    )\ <> XXnl()\ ) yodl-4.04.00/macros/rawmacros/quote.raw0000644000175000017500000000130614066072154016751 0ustar frankfrank macro(quote(text)) (Sets the text as a quotation. Usually, the text is indented, depending on the output format. In html the tt(attrib) macro is recognized by the tt(
    ) tag. ) <> DEFINEMACRO(quote)(1) ( XXtag(blockquote)\ ARG1\ +NOTRANS(
    )\ NOTRANS(\begin{quote}) ARG1 +NOTRANS(\end{quote})\ NOTRANS(@quotation)\ XXnl()\ ARG1\ +NOTRANS(@end quotation)\ XXnl()\ XXroffcmd(.RS)()(ARG1)(.RE) XXroffcmd(.IP)()(ARG1)(.PP)\ ARG1\ XXmlPushContext(nomarkup)\ NOTRANS(
    )\ ARG1\ +XXmlendp()\ NOTRANS(
    )\ XXmlPopContext()\ <> ) yodl-4.04.00/macros/rawmacros/xxsettocclearpage.raw0000644000175000017500000000023714066072154021343 0ustar frankfrank Set clearpage() directive after toc <> DEFINEMACRO(XXsettocclearpage)(0)(\ XXifnempty(XXtocclearpage) (\ clearpage()\ )\ ) yodl-4.04.00/macros/rawmacros/includeverbatim.raw0000644000175000017500000000045314066072154020773 0ustar frankfrank macro(includeverbatim(file)) (Include tt(file) into the output. No processing is done, tt(file) should be in preformatted form, e.g.: verb(whenhtml(includeverbatim(foo.html))) ) <> DEFINEMACRO(includeverbatim)(1)(\ PUSHCHARTABLE()\ NOEXPANDINCLUDE(ARG1)\ POPCHARTABLE()\ ) yodl-4.04.00/macros/rawmacros/xxstartdocument.raw0000644000175000017500000000256214066072154021075 0ustar frankfrank Start a document. Argument may be book, report, article or letter itemization( it() A book has parts, it() A report has chapters, written to different files, it() An article is just one file, only having sections. it() A letter has no further sectioning commands, just text. ) <> DEFINEMACRO(XXstartdocument)(1)(\ TYPEOUT(Yodl is processing a+nop()(n) ARG1)\ SETSYMBOL(XXdocumentclass)(ARG1)\ INTERNALINDEX(preset documenttype ARG1)\ NOTRANS(\documentclass)\ XXifnempty(XXlocaldocopts) (\ CHAR([)\ SYMBOLVALUE(XXlocaldocopts)\ +CHAR(])\ )\ CHAR({)\ SYMBOLVALUE(XXdocumentclass)\ CHAR(})\ XXnl()\ SYMBOLVALUE(XXlocalpackage)\ XXnl()\ NOTRANS(\usepackage[T1]{fontenc})\ XXnl()\ NOTRANS(\usepackage{makecell})\ XXnl()\ SYMBOLVALUE(XXsloppyhfuzz)\ XXnl()\ SYMBOLVALUE(XXusexlatin)\ XXnl()\ SYMBOLVALUE(XXownlayout)\ XXnl()\ SYMBOLVALUE(XXlocallayout)\ NOTRANS()\ XXnl()\ NOTRANS(
    )\ XXnl()\ ATEXIT(NOTRANS(
    ))\ INTERNALINDEX(preset documenttype ARG1)\ XXsymbolindex(XXxhtmlBegin)\ XXsymbolindex(XXxhtmlEnd)\ XXsymbolindex(XXarticleBegin)\ XXsymbolindex(XXarticleEndTitle)\ XXsymbolindex(XXarticleSummary)\ <> XXnl()\ ) yodl-4.04.00/macros/rawmacros/xxhtmlclass.raw0000644000175000017500000000071114066072154020165 0ustar frankfrank macro(XXhtmlclass(index)(alignment)) Returns the html-CSS class matching alignment[index]. Supported alignment characters are clr (center, left, right) and tb (top, bottom) <> DEFINEMACRO(XXhtmlclass)(2)(\ evalsymbol(XXsym)(SUBSTR(ARG2)(ARG1)(1))\ IFSTREQUAL(c)(XXsym)(XXtc )(\ IFSTREQUAL(l)(XXsym)(XXtl )(\ IFSTREQUAL(r)(XXsym)(XXtr )(\ IFSTREQUAL(t)(XXsym)(XXvt )(\ IFSTREQUAL(b)(XXsym)(XXvb )(\ )))))\ <> ) yodl-4.04.00/macros/rawmacros/mbox.raw0000644000175000017500000000034214066072154016560 0ustar frankfrank macro(mbox()) (Unbreakable box in LaTeX(). Other formats may have different opitions on our unbreakable boxex.) <> DEFINEMACRO(mbox)(1)(\ NOTRANS(\mbox{)\ ARG1\ +CHAR(})\ ARG1\ <> ) yodl-4.04.00/macros/rawmacros/xxaddntosymbol.raw0000644000175000017500000000073214066072154020675 0ustar frankfrank macro(XXaddntosymbol(symbol)(text)) Adds tt(text) tt(XXone) times to tt(symbol). Support function for addntosymbol(). It is only called by addntosymbol and it is assumed that XXx is set to the number of times text should be added to symbol by this function. <> DEFINEMACRO(XXaddntosymbol)(2)(\ XXifnzero(XXx)(\ ADDTOSYMBOL(ARG1)(ARG2)\ ADDTOCOUNTER(XXx)(-1)\ XXaddntosymbol(ARG1)(ARG2)\// recursive call for the next symbol )\ ) yodl-4.04.00/macros/rawmacros/getfigurestring.raw0000644000175000017500000000041014066072154021017 0ustar frankfrank macro(getfigurestring()) (Returns the string that defines a `figure' text, in captions or in the tt(fig()) macro. The string can be redefined using the tt(setfiguretext()) macro.) <> DEFINEMACRO(getfigurestring)(0)(\ SYMBOLVALUE(XXfigurestring)\ ) yodl-4.04.00/macros/rawmacros/nohtmlimgstyle.raw0000644000175000017500000000060114066072154020670 0ustar frankfrank macro(nohtmlimgstyle()) (By default html-pages specify+nl() tt(())nl() This macro suppresses this tt(img) CSS style specification. This macro is only active in the preamble and is only interpreted for html conversions. ) <> DEFINEMACRO(nohtmlimgstyle)(0)(\ SETCOUNTER(XXhtmlimgstyle)(0)\ <> ) yodl-4.04.00/macros/rawmacros/xxnl.raw0000644000175000017500000000021714066072154016605 0ustar frankfrank Literal newline in output, unexpanded, used to beautify. <> PUSHWSLEVEL(0)\ DEFINEMACRO(XXnl)(0)(\ CHAR( )\ )\ POPWSLEVEL() yodl-4.04.00/macros/rawmacros/sups.raw0000644000175000017500000000065214066072154016611 0ustar frankfrank macro(sups(text)) (Sets text in superscript in supporting formats In html the tt(attrib) macro is recognized by the tt() tag. For em(sub)scripting, the tt(subs) macro can be used. ) <> DEFINEMACRO(sups)(1)(\ XXtag(sup)\ ARG1\ +NOTRANS()\ NOTRANS()\ ARG1\ +NOTRANS()\ NOTRANS($^{)\ ARG1\ +NOTRANS(}$)\ ^ARG1\ <> ) yodl-4.04.00/macros/rawmacros/xxmlincblock.raw0000644000175000017500000000322714066072154020315 0ustar frankfrank macro(XXmlIncBlock()) (XXmlIncBlock begins an x-htmlblock. The macro is active only in xml conversion mode, as it is not called in other modes. Conversely, XXmlEndBlock ends an x-htmlblock and XXmlReduceBlock reduces (possibly closes) an x-htmlblock. Opening a block is realized by XXmlBeginBlock: 1. if no block is open, it is opened, and the XXblock counter is set to 1. 2. if the block is open, an error is produced. Closing a block using XXmlEndBlock is done as follows: 1. if XXblock is not 1, an error is reported 2. if XXblock is 1, it is reduced, and the end-block is inserted Beginning Nesting blocks may be realized by XXmlIncBlock: 1. if no block is open, an error is produced 2. if XXblock is 1, the block is closed and immediately opened thereafter, setting XXblock to 2. 3. if XXblock is at least 2, it is incremented Closing Nesting blocks may be realized by XXmlDecBlock: 1. if no block is open, an error is produced 2. if XXblock is 2, the block is closed and immediately opened thereafter, setting XXblock to 1. 3. if XXblock exceeds 2, it is decremented In normal documents: XXmlBeginBlock is called at the beginning, XXmlEndBlock is called at the end. XXmlEndBlock and XXmlBeginblcok is called around figures XXmlIncBlock and XXmlDecBlock are called around tables. ) <> DEFINEMACRO(XXmlIncBlock)(0)(\ IFZERO(XXblock)(\ ERROR(The xhtmlBlock is not yet open)\ )(\ IFEQUAL(XXblock)(1)(\ XXmlEndBlock()\ XXmlBeginBlock()\ SETCOUNTER(XXblock)(2)\ )(\ ADDTOCOUNTER(XXblock)(1))\ )\ ) <> yodl-4.04.00/macros/rawmacros/email.raw0000644000175000017500000000043414066072154016704 0ustar frankfrank macro(email(address)) (In HTML, this macro sets the tt(address) in a tt() locator. In other output formats, the tt(address) is sent to the output. The tt(email) macro is a special case of tt(url).) <> DEFINEMACRO(email)(1)(\ nemail(ARG1)(ARG1)\ ) yodl-4.04.00/macros/rawmacros/it.raw0000644000175000017500000000055014066072154016230 0ustar frankfrank macro(it()) (Indicates an item in an itemized list. Items in tt(it) macros are arguments of tt(itemization) macros.) <> DEFINEMACRO(it)(0)(\ NOTRANS(
  • )\ NOTRANS(\item )\ NOTRANS(@item )\ XXroffcmd(.IP)(o )()()\ NOTRANS(o )\ NOTRANS()\ XXmlBeginList()\ <> ) yodl-4.04.00/macros/rawmacros/xxsubsectcounter.raw0000644000175000017500000000064314066072154021247 0ustar frankfrank Defines the next sub-section counter. To be followed by the actual subsection defining code, possibly preceded by a label def, as in lsubsect() <> DEFINEMACRO(XXsubsectCounter)(0)(\ SETCOUNTER(XXsubsubsectcounter)(0)\ ADDTOCOUNTER(XXsubsectcounter)(1)\ XXsetlastnumber(\ XXchapternum()\ COUNTERVALUE(XXsectcounter).\ COUNTERVALUE(XXsubsectcounter)\ )\ ) yodl-4.04.00/macros/rawmacros/whenms.raw0000644000175000017500000000026614066072154017121 0ustar frankfrank macro(whenms(text)) (Sends tt(text) to the output when in MS conversion mode. The text is further expanded if necessary.) <> DEFINEMACRO(whenms)(1)(\ ARG1\ <> ) yodl-4.04.00/macros/rawmacros/attribclear.raw0000644000175000017500000000052414066072154020111 0ustar frankfrank macro(attribclear()) (Removes any existing contents from the attrib-stack. This macro is only active when converting to html ) <> DEFINEMACRO(attribclear)(0)(\ IFGREATER(XXattribstacksize)(0)\ (\ POPSYMBOL(XXattrib)\ ADDTOCOUNTER(XXattribstacksize)(-1)\ attribclear()\ )()\ <> ) yodl-4.04.00/macros/rawmacros/gettitlestring.raw0000644000175000017500000000050414066072154020663 0ustar frankfrank macro(gettitlestring()) (Expands to the string that defines the name of em(Title Information), by default em(TITLE INFORMATION). Can be redefined for national language support by tt(settitlestring()). Currently, it is relevant only for txt.) <> DEFINEMACRO(gettitlestring)(0)(\ SYMBOLVALUE(XXtitlestring)\ ) yodl-4.04.00/macros/rawmacros/xxifnzero.raw0000644000175000017500000000021014066072154017641 0ustar frankfrank Inserts value of ARG2 if ARG1 isn't zero <> DEFINEMACRO(XXifnzero)(2)(\ IFZERO(ARG1) ()(\ ARG2\ )\ ) yodl-4.04.00/macros/rawmacros/xxtlinefirst.raw0000644000175000017500000000031614066072154020357 0ustar frankfrank macro(XXtlineFirst(beginNr)(endNr) First tline call <> DEFINEMACRO(XXtlineFirst)(1)(\ NOTRANS(
  • )\ XXnl()\ <> PUSHCOUNTER(XXcol)(1)\// colnr specified by XXcol; ) yodl-4.04.00/macros/rawmacros/whenman.raw0000644000175000017500000000027214066072154017252 0ustar frankfrank macro(whenman(text)) (Sends tt(text) to the output when in MAN conversion mode. The text is further expanded if necessary.) <> DEFINEMACRO(whenman)(1)(\ ARG1\ <> ) yodl-4.04.00/macros/rawmacros/xxmlendp.raw0000644000175000017500000000040714066072154017454 0ustar frankfrank macro(XXmlendp()) (ends a paragraph. The macro is active only in xml conversion mode, as it is not called in other modes) <> DEFINEMACRO(XXmlendp)(0)(\ XXifnzero(XXp)\ ( SETCOUNTER(XXp)(0)\ NOTRANS(

    )\ )\ ) <> yodl-4.04.00/macros/rawmacros/xmlcommand.raw0000644000175000017500000000030614066072154017752 0ustar frankfrank macro(xmlcommand(cmd)) (Writes tt(cmd) to the output when converting to xml. The tt(cmd) is not further expanded by Yodl.) <> DEFINEMACRO(xmlcommand)(1)(\ NOTRANS(ARG1)\ <> ) yodl-4.04.00/macros/rawmacros/sgmlcommand.raw0000644000175000017500000000031214066072154020111 0ustar frankfrank macro(sgmlcommand(cmd)) (Writes tt(cmd) to the output when converting to sgml. The tt(cmd) is not further expanded by Yodl.) <> DEFINEMACRO(sgmlcommand)(1)(\ NOTRANS(ARG1)\ <> ) yodl-4.04.00/macros/rawmacros/sc.raw0000644000175000017500000000113114066072154016215 0ustar frankfrank macro(sc(text)) (Set tt(text) in the tt (code) font, using small caps. In html the tt(attrib) macro is not supported, while the code section is embedded in a tt(
    ) section. ) <> DEFINEMACRO(sc)(1)(\ NOTRANS(
    )\ UPPERCASE(ARG1)(0)\ NOTRANS(
    )\ NOTRANS(\textsc{)ARG1+CHAR(})\ NOTRANS()\ ARG1\ +NOTRANS()\ tt(UPPERCASE(ARG1)(0))\ NOTRANS(
    )\
        NOEXPAND(ARG1)\
        NOTRANS(
    )\ ARG1\ <> ) yodl-4.04.00/macros/rawmacros/setincludepath.raw0000644000175000017500000000111214066072154020623 0ustar frankfrank macro(setincludepath(name)) (Sets a new value of the include-path specification used when opening .yo files. A warning is issued when the path specification does not include a .: element. Note that the local directory may still be an element of the new include path, as the local directory may be the only or the last element of the specification. For these eventualities the new path specification is not checked.) <> DEFINEMACRO(setincludepath)(1)(\ IFSTRSUB(ARG1)(.:) ()(\ WARNING("No .: specification in ARG1))\ SETSYMBOL(XXincludePath)(ARG1)\ ) yodl-4.04.00/macros/rawmacros/setrofftableoptions.raw0000644000175000017500000000157514066072154021720 0ustar frankfrank macro(setrofftableoptions(optionlist)) (Set options used for man-conversion, as used by the tt(tbl) and tt(table) macros. By default no options are used. Multiple options should be separated by blanks. From the bf(tbl)(1) manpage, the following options are available: itemization( it() tt(center) Centers the table; default is left-justified. In the context of the tt(tbl) macro this is implied when the tt(tbl) macro is specified as argument of the tt(center) macro. it() tt(expand) Makes the table as wide as the current line length it() tt(box) Encloses the table in a box it() tt(allbox) Encloses each item of the table in a box ) See also tt(setrofftab) which is used to set the character separating items in a line of input data. ) <> DEFINEMACRO(setrofftableoptions)(1)(\ SETSYMBOL(XXrofftableoptions)(ARG1)\ <> ) yodl-4.04.00/macros/rawmacros/notableofcontents.raw0000644000175000017500000000052314066072154021343 0ustar frankfrank macro(notableofcontents()) (Prevents the generation of a table of contents. This is default in, e.g., tt(manpage) and tt(plainhtml) documents. When present, this option bf(must) appear before stating the document type with tt(article), tt(report) etc..) <> DEFINEMACRO(notableofcontents)(0)(\ SETSYMBOL(XXgeneratetoc)()\ ) yodl-4.04.00/macros/rawmacros/cindex.raw0000644000175000017500000000044214066072154017066 0ustar frankfrank macro(cindex()) (Generate an index entry for LaTex() or texinfo c-indices. Its argument is the index entry. See also the tt([fptv]index) macro.) <> DEFINEMACRO(cindex)(1)(\ NOTRANS(\index{)\ ARG1\ +CHAR(})\ NOTRANS(@cindex )\ ARG1 \ <> ) yodl-4.04.00/macros/rawmacros/notocclearpage.raw0000644000175000017500000000076314066072154020610 0ustar frankfrank macro(notocclearpage()) (With the LaTeX() converter, no tt(clearpage()) instruction is inserted immediately beyond the document's table of contents. The tt(clearpage()) instruction is default in all but the tt(article) document type. When present, must appear bf(before) stating the document type with tt(article), tt(book) or tt(report). With other converters than the LaTeX() converter, it is ignored.) <> DEFINEMACRO(notocclearpage)(0)(\ SETSYMBOL(XXtocclearpage)()\ <> ) yodl-4.04.00/macros/rawmacros/separator0000755000175000017500000000213314066072154017026 0ustar frankfrank#!/bin/bash target=$1 file=$2 copy=1 recognized=0 closed=1 printed=0 wslines=0 matches() { echo $line | grep $1 > /dev/null 2>&1 return $? } wslines() { [ $printed == 0 ] && return while [ $wslines -gt 0 ] ; do let wslines=$wslines-1 echo "" done } targetre=`echo "^<.*$target.*>[[:space:]]*$"` emptyre='^<>[[:space:]]*$' elsere='^[[:space:]]*$' otherre='^<[^>]*>[[:space:]]*$' blankre='^[[:space:]]*$' while : do read -r line || break if matches $targetre ; then copy=1 closed=0 recognized=1 elif matches $emptyre ; then copy=1 closed=1 recognized=0 elif matches $elsere ; then closed=0 let copy=!$recognized elif matches $otherre ; then closed=0 copy=0 elif [ $copy != 0 ] ; then if matches $blankre ; then [ $printed != 0 ] && let wslines=$wslines+1 continue fi wslines echo $line printed=1 fi done echo "" if [ $closed == 0 ] ; then echo "Maybe no closing tag <> in $file" >&2 fi yodl-4.04.00/macros/rawmacros/xxmlbeginlist.raw0000644000175000017500000000054414066072154020510 0ustar frankfrank begins an xml item. The macro is defined only in xml conversion mode, as it is not called in other modes. It closes a possibly open tag by calling XXmlEndList(), and then writes a
  • begin-tag and sets XXused to 1. <> DEFINEMACRO(XXmlBeginList)(0) (\ XXmlEndList()\ NOTRANS(
  • )\ SETCOUNTER(XXused)(1)\ ) <> yodl-4.04.00/macros/rawmacros/htmltag.raw0000644000175000017500000000132314066072154017253 0ustar frankfrank macro(htmltag(tagname)(start)) (Sets tt(tagname) as a HTML tag, enclosed by tt(<) and tt(>). When tt(start) is zero, the tt(tagname) is prefixed with tt(/). As not all html tags are available through predefined Yodl-macros (there are too many of them, some are used very infrequently, and you can easily define macros for the tags for which Yodl doesn't offer predefined ones), the tt(htmltag) macro can be used to handle your own set of macros. In html the tt(attrib) macro is supported. E.g., verb( attrib(title="World Health Organization")CHAR(\) htmltag(abbr)()WHO+htmltag(abbr)(0) ) ) <> DEFINEMACRO(htmltag)(2)(\ IFZERO(ARG2)(\ NOTRANS()\ )(\ XXtag(ARG1))\ ) yodl-4.04.00/macros/rawmacros/nl.raw0000644000175000017500000000047114066072154016227 0ustar frankfrank macro(nl()) (Forces a newline; i.e., breaks the current line in two.) <> DEFINEMACRO(nl)(0)(\ NOTRANS(\ \\ )\ NOTRANS(@* )\ NOTRANS(
    )\ XXroffcmd(.br)()()()\ NOTRANS(&nl;)\ XXnl()\ XXmlendp()\ XXmlbeginp()\ <> ) yodl-4.04.00/macros/rawmacros/npart.raw0000644000175000017500000000127014066072154016740 0ustar frankfrank macro(npart(title)) (Starts a part in a tt(book) document, but without numbering it and without entering the title of the part in the table of contents. In html tt(attrib) macro applies to the tt(

    ) tag. ) <> DEFINEMACRO(npart)(1)(\ XXtag(h1)\ getpartstring() \ ARG1\ +NOTRANS(

    ) NOTRANS(

    )\ getpartstring() \ ARG1\ +NOTRANS(

    ) NOTRANS(\part*{)\ ARG1\ +CHAR(})\ NOTRANS(@unnumbered )\ ARG1\ XXroffcmd(.SH)(NOTRANS(")getpartstring() ARG1+NOTRANS("))()()\ XXroffcmd(.SH)()(getpartstring() ARG1)(.PP)\ XXnl()\ getpartstring() \ ARG1\ +XXnl()\ <> ) yodl-4.04.00/macros/rawmacros/subs.raw0000644000175000017500000000056714066072154016600 0ustar frankfrank macro(subs(text)) (Sets text in subscript in supporting formats. In html the tt(attrib) macro is recognized by the tt() tag. For em(super)scripting, the tt(sups) macro can be used. ) <> DEFINEMACRO(subs)(1)(\ XXtag(sub)\ ARG1\ +NOTRANS()\ NOTRANS($_{)\ ARG1\ +NOTRANS(}$)\ _ARG1\ <> ) yodl-4.04.00/macros/rawmacros/setdatestring.raw0000644000175000017500000000053014066072154020472 0ustar frankfrank macro(setdatestring(name)) (Defines tt(name) as the `date information' string, by default em(DATE INFORMATION). E.g., after tt(setdatestring(DATA)), YODL outputs this portuguese string to describe the date information. Currently, it is relevant only for txt.) <> DEFINEMACRO(setdatestring)(1)(\ SETSYMBOL(XXdatestring)(ARG1)\ ) yodl-4.04.00/macros/rawmacros/tocclearpage.raw0000644000175000017500000000106014066072154020242 0ustar frankfrank macro(tocclearpage()) (With the LaTeX() converter, a tt(clearpage()) directive if inserted, immediately following the document's table of contents. This is already the default in all but the tt(article) document type, but it can be overruled by tt(notocclearpage()). When present, it must appear in the em(preamble); i.e., before the document type is stated with tt(article), tt(book) or tt(report). With other converters than the LaTeX() converter, it is ignored.) <> DEFINEMACRO(tocclearpage)(0)(\ SETSYMBOL(XXtocclearpage)(1)\ <> ) yodl-4.04.00/macros/rawmacros/nsubsubsect.raw0000644000175000017500000000110314066072154020147 0ustar frankfrank macro(nsubsubsect(title)) (Starts a non-numbered sub-sub section. In html tt(attrib) macro applies to the tt(

    ) tag. ) <> DEFINEMACRO(nsubsubsect)(1)(\ XXtag(p)NOTRANS()\ ARG1\ +NOTRANS(

    )\ NOTRANS(\subsubsection*{)\ ARG1\ +CHAR(})\ NOTRANS(@unnumberedsubsubsec )\ ARG1\ +CHAR(41)\ XXnl()\ ARG1\ +XXnl()\ XXroffcmd(.SH)(NOTRANS(")ARG1+NOTRANS("))()()\ XXroffcmd(.SH)()(ARG1)(.PP)\ NOTRANS(

    )\ ARG1\ +NOTRANS(

    )\ <> ) yodl-4.04.00/macros/rawmacros/xxtableofcontents.raw0000644000175000017500000000142714066072154021372 0ustar frankfrank Set table of contents directives in various formats, if XXtableofconents is not empty <> DEFINEMACRO(XXtableofcontents)(0)(\ IFSTREQUAL(XXgeneratetoc)()(\ NOTRANS(% no \tableofcontents generated) <> )(\ INTERNALINDEX(htmltoc gettocstring())\ XXnl()\ NOTRANS(\tableofcontents)\ XXnl()\ XXnl()\ gettocstring()\ XXnl()\ INTERNALINDEX(txttoc) XXnl()\ XXroffcmd(.SH)(Contents)()()\ INTERNALINDEX(mantoc)\ XXroffcmd(.SH)()(Contents)(.PP)\ INTERNALINDEX(mstoc)\ NOTRANS()\ XXnl()\ INTERNALINDEX(xmltoc gettocstring())\ XXnl()\ <> XXsettocclearpage()\ )\ ) yodl-4.04.00/macros/rawmacros/xxtblend.raw0000644000175000017500000000126614066072154017451 0ustar frankfrank XXtblend(contents) inserts 'contents', ends the table, pops the variables pushed by XXtblbegin <> DEFINEMACRO(XXtblend)(1)(\ ARG1\ +NOTRANS(
  • )\ POPSYMBOL(XXtablealign)\ +NOTRANS(\end{tabular})\ POPSYMBOL(XXtablealign)\ +INTERNALINDEX(drainws)\ SYMBOLVALUE(XXtablealign)\ NOTRANS(c.)\ XXnl()\ INTERNALINDEX(copy)\ SYMBOLVALUE(XXroffcontents)\ XXroffcmd()()()()\ XXroffcmd(.TE)()()()\ POPSYMBOL(XXrofftableoptions)\ POPSYMBOL(XXroffalign)\ POPSYMBOL(XXroffcontents)\ POPSYMBOL(XXtablealign)\ POPSYMBOL(XXalign)\ <> XXnl()\ POPCOUNTER(XXtablewidth)\ ) yodl-4.04.00/macros/rawmacros/enumeration.raw0000644000175000017500000000136114066072154020143 0ustar frankfrank macro(enumeration(list)) (tt(enumeration()) starts an enumerated list. Use tt(eit()) in the list to indicate items in the list.) <> DEFINEMACRO(enumeration)(1)(\ PUSHCOUNTER(XXenumcounter)(0)\ NOTRANS(
      )\ NOTRANS(\begin{enumerate})\ ADDTOCOUNTER(XXinlist)(1)\ NOTRANS(@enumerate i)\ NOTRANS()\ XXmlendp()\ NOTRANS(
        )\ PUSHCOUNTER(XXused)(0)\ <> ARG1\ +NOTRANS(
      )\ +NOTRANS(\end{enumerate})\ +ADDTOCOUNTER(XXinlist)(-1)\ +NOTRANS(
      )\ +NOTRANS(@end enumerate)\ +XXmlEndList()\ NOTRANS(
    )\ POPCOUNTER(XXused)\ <> POPCOUNTER(XXenumcounter)\ ) yodl-4.04.00/macros/rawmacros/attrib.raw0000644000175000017500000000353614066072154017110 0ustar frankfrank macro(attrib(text)) (In html, pushes tt(text) as an attribute for the next html tag supporting tt(attrib). E.g, to set a blue color and 30 pixel left-hand side margin for a section use verb( attrib(style="color:blue;margin-left:30px;")\ sect(Section name) ) This results in the html markup+nl() verb(

    Section name

    ) This macro is only effective with html conversions. It is applied in a stack-wise fashion: when multiple tt(attrib) calls are used, then the topmost attrib-string is added to the first macro calling the tt(attribinsert) macro, with subsequent macros using subsequent elements on the attrib-stack. Commonly used attributes are tt(id="idname"), expecting a tt(#idname) CSS label in either internal or external CSS specifications, or tt(style="spec") (as shown in the example). Example: when using verb( attrib(width = "100" height = "100") attrib(id = "#fig") figure(imgfile)(Caption)(IMG) ) then the tt(#id) attribute is applied to tt(
    ), and the tt(width) and tt(height) attributes are applied to tt(), which html markup is inserted by the tt(figure) macro. The tt(attrib) macro is supported by the following predefined macros (between parentheses the number of attribute strings that are inserted by these macros; if only 1 attribute string is inserted no number is shown): tt(bf cell cells center chapter code dashes dit em figure(3) file htmltag itdesc lchapter link lref lsect lsubsect lsubsubsect nchapter npart nsect nsubsect nsubsubsect paragraph part quote row sc sect strong subs subsect subsubsect subsubsubsect sups tableatt tbl tac tc tnac tnc tr tt ttbegin url verb verborg verbinclude). ) <> DEFINEMACRO(attrib)(1)(\ ADDTOCOUNTER(XXattribstacksize)(1)\ PUSHSYMBOL(XXattrib)(NOTRANS(ARG1))\ <> ) yodl-4.04.00/macros/rawmacros/xxtag.raw0000644000175000017500000000021414066072154016744 0ustar frankfrank Sets a html tag, possibly adding attributes <> DEFINEMACRO(XXtag)(1)(\ NOTRANS(<)ARG1 attribinsert()\ NOTRANS(>)\ )\ yodl-4.04.00/macros/rawmacros/label.raw0000644000175000017500000000075714066072154016704 0ustar frankfrank macro(label(labelname)) (Defines tt(labelname) as an anchor for a tt(link) command, or to stand for the last numbering of a section or figure in a tt(ref) command.) <> DEFINEMACRO(label)(1)(\ INTERNALINDEX(htmllabel ARG1)\ NOTRANS(\label{ARG1})\ INTERNALINDEX(node ARG1)\ COMMENT(INTERNALINDEX(label ARG1))\ NOTRANS(