From eb3942e15700f3f4f61b4e46917ae8fbe614e524 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Sun, 19 May 2024 00:42:48 +0200 Subject: Lout 3.41. http://jeffreykingston.id.au/lout/lout-3.41.tar.gz --- externs.h | 52 ++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 8 deletions(-) (limited to 'externs.h') diff --git a/externs.h b/externs.h index 4b1fc0e..8ea7f69 100644 --- a/externs.h +++ b/externs.h @@ -1,7 +1,7 @@ /*@externs.h:External Declarations:Directories and file conventions@**********/ /* */ -/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.39) */ -/* COPYRIGHT (C) 1991, 2008 Jeffrey H. Kingston */ +/* THE LOUT DOCUMENT FORMATTING SYSTEM (VERSION 3.41) */ +/* COPYRIGHT (C) 1991, 2023 Jeffrey H. Kingston */ /* */ /* Jeffrey H. Kingston (jeff@it.usyd.edu.au) */ /* School of Information Technologies */ @@ -285,7 +285,7 @@ If you're compiling this, you've got the wrong settings in the makefile! #define BOOLEAN unsigned #define FALSE 0 #define TRUE 1 -#define bool(x) (x ? AsciiToFull("TRUE") : AsciiToFull("FALSE") ) +#define bool_show(x) (x ? AsciiToFull("TRUE") : AsciiToFull("FALSE") ) #define CHILD 0 #define PARENT 1 #define COLM 0 @@ -1620,7 +1620,7 @@ typedef union rec FIRST_UNION ou1; SECOND_UNION ou2; THIRD_UNION ou3; - FULL_CHAR ostring[4]; + FULL_CHAR ostring[]; } os1; struct closure_type /* all fields of CLOSURE, both as token and object */ @@ -2661,7 +2661,7 @@ typedef struct back_end_rec { } #define NewWord(x, typ, len, pos) \ -{ zz_size = sizeof(struct word_type) - 4 + ((len)+1)*sizeof(FULL_CHAR); \ +{ zz_size = sizeof(struct word_type) + ((len)+1) * sizeof(FULL_CHAR); \ /* NB the following line RESETS zz_size */ \ GetMem(zz_hold, ceiling(zz_size, sizeof(ALIGN)), pos); \ checkmem(zz_hold, typ); \ @@ -2764,14 +2764,50 @@ typedef struct back_end_rec { #define LastUp(x) pred(x, PARENT) #define PrevUp(x) pred(x, PARENT) -#define Child(y, link) \ +/* *** moved to child.h +static OBJECT ZZChild(OBJECT link) +{ + OBJECT y; + for( y = pred(link, PARENT); type(y) == LINK; y = pred(y, PARENT) ); + return y; +} + +#define Child(y, link) ((y) = ZZChild(link)) +*** */ + +/* *** for( y = pred(link, PARENT); type(y) == LINK; y = pred(y, PARENT) ) +*** */ + +/* *** moved to count_child.h +static OBJECT ZZCountChild(OBJECT link, int *i) +{ + OBJECT y; + for(y=pred(link, PARENT), (*i)=1; type(y)==LINK; y = pred(y, PARENT), (*i)++); + return y; +} + +#define CountChild(y, link, i) ((y) = ZZCountChild(link, &(i))) +*** */ -#define CountChild(y, link, i) \ +/* *** for( y=pred(link, PARENT), i=1; type(y)==LINK; y = pred(y, PARENT), i++ ) +*** */ + +/* *** moved to parent.h +static OBJECT ZZParent(OBJECT link) +{ + OBJECT y; + for( y = pred(link, CHILD); type(y) == LINK; y = pred(y, CHILD) ); + return y; +} + +#define Parent(y, link) ((y) = ZZParent(link)) +*** */ -#define Parent(y, link) \ +/* *** for( y = pred(link, CHILD); type(y) == LINK; y = pred(y, CHILD) ) +*** */ /*@::UpDim(), DownDim(), Link(), DeleteLink(), etc.@**************************/ -- cgit