diff options
author | Norbert Preining <norbert@preining.info> | 2020-09-20 03:03:26 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2020-09-20 03:03:26 +0000 |
commit | 1f457376b478257b88d4a857f5ec1b6155442dd7 (patch) | |
tree | 2a06a60551dea362cf8cb0cb0ba66c78608717c4 /support/dktools/dk4strmo08.ctr | |
parent | ac690ca29ad5bf8a5203a65fd6252f7b564f4727 (diff) |
CTAN sync 202009200303
Diffstat (limited to 'support/dktools/dk4strmo08.ctr')
-rw-r--r-- | support/dktools/dk4strmo08.ctr | 42 |
1 files changed, 37 insertions, 5 deletions
diff --git a/support/dktools/dk4strmo08.ctr b/support/dktools/dk4strmo08.ctr index 02929a7042..b1880c47f1 100644 --- a/support/dktools/dk4strmo08.ctr +++ b/support/dktools/dk4strmo08.ctr @@ -2,7 +2,7 @@ copyright owner = Dirk Krause copyright year = 2015-xxxx -license = bsd +SPDX-License-Identifier: BSD-3-Clause @@ -15,7 +15,21 @@ license = bsd CRT on Windows: Not used. */ +#ifndef DK4CONF_H_INCLUDED +#if DK4_BUILDING_DKTOOLS4 +#include "dk4conf.h" +#else +#include <dktools-4/dk4conf.h> +#endif +#endif + +#ifndef DK4STRM_H_INCLUDED +#if DK4_BUILDING_DKTOOLS4 #include "dk4strm.h" +#else +#include <dktools-4/dk4strm.h> +#endif +#endif #ifdef __cplusplus extern "C" { @@ -49,12 +63,26 @@ dk4stream_c08_puts(dk4_stream_t *strm, const char *txt, int ie, dk4_er_t *erp); %% module +#include "dk4conf.h" #include "dk4strm.h" +#include "dk4strmo08.h" #include "dk4strmo32.h" #include "dk4enc.h" #include "dk4ansi.h" #include "dk4utf8.h" +#if DK4_HAVE_ASSERT_H +#ifndef ASSERT_H_INCLUDED +#include <assert.h> +#define ASSERT_H_INCLUDED 1 +#endif +#endif + + +$!trace-include + + + int dk4stream_c08_puts(dk4_stream_t *strm, const char *txt, int ie, dk4_er_t *erp) { @@ -63,11 +91,15 @@ dk4stream_c08_puts(dk4_stream_t *strm, const char *txt, int ie, dk4_er_t *erp) int back = 0; char c; unsigned char uc; +#if DK4_USE_ASSERT + assert(NULL != strm); + assert(NULL != txt); +#endif if ((NULL != strm) && (NULL != txt)) { if (0 != ((strm->fl) & DK4_STREAM_WRITE)) { switch (ie) { - case DK4_ENCODING_ASCII: - case DK4_ENCODING_ANSI: + case DK4_ENCODING_PLAIN: + case DK4_ENCODING_WIN1252: case DK4_ENCODING_UTF8: { if (strm->oenc == ie) { @@ -79,7 +111,7 @@ dk4stream_c08_puts(dk4_stream_t *strm, const char *txt, int ie, dk4_er_t *erp) } } else { switch (ie) { - case DK4_ENCODING_ASCII: { + case DK4_ENCODING_PLAIN: { back = 1; while (('\0' != *txt) && (1 == back)) { c = *(txt++); @@ -90,7 +122,7 @@ dk4stream_c08_puts(dk4_stream_t *strm, const char *txt, int ie, dk4_er_t *erp) } } } break; - case DK4_ENCODING_ANSI: { + case DK4_ENCODING_WIN1252: { back = 1; while (('\0' != *txt) && (1 == back)) { if (0 != dk4ansi_decode(&c32, (unsigned char)(*(txt++)))) { |