diff --git a/src/HeaderParser.c b/src/HeaderParser.c index d0171ad..07dedb3 100644 --- a/src/HeaderParser.c +++ b/src/HeaderParser.c @@ -370,6 +370,8 @@ HeaderParse(Stream * stream, HeaderExpr * expr) strcmp(word, "elif") == 0 || strcmp(word, "error") == 0) { + int pC; + Free(word); expr->data.text[i] = ' '; i++; @@ -394,8 +396,7 @@ HeaderParse(Stream * stream, HeaderExpr * expr) return; } - /* TODO: Handle backslash escapes */ - if (c == '\n') + if (c == '\n' && pC != '\\') { expr->data.text[i] = '\0'; expr->state.lineNo++; @@ -406,6 +407,8 @@ HeaderParse(Stream * stream, HeaderExpr * expr) expr->data.text[i] = c; i++; } + + pC = c; } } else if (strcmp(word, "else") == 0 || diff --git a/src/include/Int.h b/src/include/Int.h index d937629..2b29bac 100644 --- a/src/include/Int.h +++ b/src/include/Int.h @@ -24,6 +24,35 @@ #ifndef TELODENDRIA_INT_H #define TELODENDRIA_INT_H +/*** + * @Nm Int + * @Nd Fixed-width integer types. + * @Dd April 27 2023 + * + * This header provides cross-platform, fixed-width integer types. + * Specifically, it uses preprocessor magic to define the following + * types: + * .Bl -bullet -offset indent + * .It + * Int8 and UInt8 + * .It + * Int16 and UInt16 + * .It + * Int32 and UInt32 + * .El + * .Pp + * Note that there is no 64-bit integer type, because the ANSI C + * standard makes no guarantee that such a type will exist, even + * though it does on most platforms. + * .Pp + * The reason Telodendria provides its own header for this is + * because ANSI C does not define fixed-width types, and while it + * should be safe to rely on C99 fixed-width types in most cases, + * there may be cases where even that is not possible. + * + * @ignore-typedefs + */ + #include #define BIT64_MAX 18446744073709551615 diff --git a/tools/bin/td b/tools/bin/td index 022675d..2993d7c 100644 --- a/tools/bin/td +++ b/tools/bin/td @@ -108,6 +108,22 @@ setsubst() { rm "$SED" } +recipe_docs() { + mkdir -p build/man/man3 + + for header in $(find src -name '*.h'); do + basename=$(basename "$header") + man=$(echo "build/man/man3/$basename" | sed -e 's/\.h$/\.3/') + + if [ $(mod_time "$header") -ge $(mod_time "$man") ]; then + echo "DOC $basename" + if ! hdoc -D Os=Telodendria -i "$header" -o "$man"; then + exit 1 + fi + fi + done +} + # Build the source code, and generate the 'build/telodendria' # binary. recipe_build() { @@ -292,7 +308,6 @@ recipe_release() { # really picky about how patches look, but this is how we like them # best. Makes them easy to read. recipe_patch() { - # If the user has not set their MXID, try to deduce one from # their system. if [ -z "$MXID" ]; then diff --git a/tools/src/hdoc.c b/tools/src/hdoc.c index 74fb530..96613f6 100644 --- a/tools/src/hdoc.c +++ b/tools/src/hdoc.c @@ -242,6 +242,11 @@ main(int argc, char **argv) } break; case HP_TYPEDEF: + if (HashMapGet(registers, "ignore-typedefs")) + { + break; + } + if (!isDocumented) { StreamPrintf(StreamStderr(),