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/dk4a85e.ctr | |
parent | ac690ca29ad5bf8a5203a65fd6252f7b564f4727 (diff) |
CTAN sync 202009200303
Diffstat (limited to 'support/dktools/dk4a85e.ctr')
-rw-r--r-- | support/dktools/dk4a85e.ctr | 55 |
1 files changed, 52 insertions, 3 deletions
diff --git a/support/dktools/dk4a85e.ctr b/support/dktools/dk4a85e.ctr index 82421cc1d8..f3e26669e5 100644 --- a/support/dktools/dk4a85e.ctr +++ b/support/dktools/dk4a85e.ctr @@ -2,7 +2,7 @@ copyright owner = Dirk Krause copyright year = 2015-xxxx -license = bsd +SPDX-License-Identifier: BSD-3-Clause @@ -31,9 +31,29 @@ dk4a85_enc_output() to obtain the text characters for the final bytes. */ +#ifndef DK4CONF_H_INCLUDED +#if DK4_BUILDING_DKTOOLS4 #include "dk4conf.h" +#else +#include <dktools-4/dk4conf.h> +#endif +#endif + +#ifndef DK4ERROR_H_INCLUDED +#if DK4_BUILDING_DKTOOLS4 #include "dk4error.h" +#else +#include <dktools-4/dk4error.h> +#endif +#endif + +#ifndef DK4EDSTM_H_INCLUDED +#if DK4_BUILDING_DKTOOLS4 #include "dk4edstm.h" +#else +#include <dktools-4/dk4edstm.h> +#endif +#endif @@ -116,7 +136,10 @@ dk4a85_enc_finish(dk4_a85_enc_t *enc, dk4_er_t *erp); */ int dk4a85_enc_output( - const char **dptr, size_t *szptr, dk4_a85_enc_t *enc, dk4_er_t *erp + const char **dptr, + size_t *szptr, + dk4_a85_enc_t const *enc, + dk4_er_t *erp ); #ifdef __cplusplus @@ -125,6 +148,15 @@ dk4a85_enc_output( %% module +#include "dk4conf.h" + +#if DK4_HAVE_ASSERT_H +#ifndef ASSERT_H_INCLUDED +#include <assert.h> +#define ASSERT_H_INCLUDED 1 +#endif +#endif + #include "dk4a85e.h" #include "dk4edstm.h" #include "dk4mem.h" @@ -147,6 +179,9 @@ static const unsigned long dk4a85e_pow_85[] = { void dk4a85_enc_init(dk4_a85_enc_t *enc, int az, dk4_er_t *erp) { +#if DK4_USE_ASSERT + assert(NULL != enc); +#endif if (NULL != enc) { DK4_MEMRES(enc, sizeof(dk4_a85_enc_t)); enc->ob[5] = '\0'; @@ -166,6 +201,9 @@ dk4a85_enc_add(dk4_a85_enc_t *enc, unsigned char input, dk4_er_t *erp) unsigned long val; unsigned long v1; int back = DK4_EDSTM_ERROR; +#if DK4_USE_ASSERT + assert(NULL != enc); +#endif if (NULL != enc) { back = DK4_EDSTM_ACCEPT; enc->ib[enc->ci] = input; @@ -213,6 +251,9 @@ dk4a85_enc_finish(dk4_a85_enc_t *enc, dk4_er_t *erp) unsigned long v1; int back = DK4_EDSTM_ERROR; $? "+ dk4a85_enc_finish" +#if DK4_USE_ASSERT + assert(NULL != enc); +#endif if (NULL != enc) { if (0 == enc->ci) { back = DK4_EDSTM_ACCEPT; @@ -327,10 +368,18 @@ dk4a85_enc_finish(dk4_a85_enc_t *enc, dk4_er_t *erp) int dk4a85_enc_output( - const char **dptr, size_t *szptr, dk4_a85_enc_t *enc, dk4_er_t *erp + const char **dptr, + size_t *szptr, + dk4_a85_enc_t const *enc, + dk4_er_t *erp ) { int back = 0; +#if DK4_USE_ASSERT + assert(NULL != enc); + assert(NULL != dptr); + assert(NULL != szptr); +#endif if ((NULL != dptr) && (NULL != szptr) && (NULL != enc)) { *dptr = &(enc->ob[0]); *szptr = enc->os; |