diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/u8c/end.c | 4 | ||||
-rw-r--r-- | src/u8c/geterr.c | 7 | ||||
-rw-r--r-- | src/u8c/init.c | 2 | ||||
-rw-r--r-- | src/u8c/seterr.c | 4 | ||||
-rw-r--r-- | src/u8c/vprint.c | 8 |
5 files changed, 15 insertions, 10 deletions
diff --git a/src/u8c/end.c b/src/u8c/end.c index 8cd243d..af9661c 100644 --- a/src/u8c/end.c +++ b/src/u8c/end.c @@ -19,7 +19,7 @@ # include <stdint.h> # include <stdlib.h> # include <u8c/end.h> -# include <u8c/freeu32.h> +# include <u8c/u32free.h> # if defined(u8c_bethrdsafe) # include <threads.h> # endif @@ -30,7 +30,7 @@ uint_least8_t u8c_end(void) { # if defined(u8c_bethrdsafe) mtx_destroy(&u8c_errlock); # endif - u8c_freeu32(u8c_err); + u8c_u32free(u8c_err); u8c_stat = UINT8_C(0x1); return UINT8_C(0x0); } diff --git a/src/u8c/geterr.c b/src/u8c/geterr.c index d18f696..9f09327 100644 --- a/src/u8c/geterr.c +++ b/src/u8c/geterr.c @@ -18,12 +18,19 @@ # include <stddef.h> # include <stdint.h> # include <u8c/geterr.h> +# include <u8c/seterr.h> # include <u8c/u32cp.h> +# include <u8c/u8free.h> uint_least8_t u8c_geterr(size_t * const _sz,uint_least32_t const * * const _out) { + if(u8c_err == NULL) { + u8c_seterr((uint_least32_t[]){UINT32_C(0x0)}); + } # if defined(u8c_bethrdsafe) mtx_lock(&u8c_errlock); # endif u8c_u32cp(_sz,_out,u8c_err); + u8c_u8free(u8c_err); + u8c_err = NULL; # if defined(u8c_bethrdsafe) mtx_unlock(&u8c_errlock); # endif diff --git a/src/u8c/init.c b/src/u8c/init.c index e73272e..e13f15a 100644 --- a/src/u8c/init.c +++ b/src/u8c/init.c @@ -29,8 +29,6 @@ uint_least8_t u8c_init(void) { return UINT8_C(0x2); } # endif - /* Set default error message: */ - u8c_u32cp(NULL,&u8c_err,(uint_least32_t[]){UINT32_C(0x75),UINT32_C(0x38),UINT32_C(0x63),UINT32_C(0x5F),UINT32_C(0x69),UINT32_C(0x6E),UINT32_C(0x69),UINT32_C(0x74),UINT32_C(0x3A),UINT32_C(0x20),UINT32_C(0x44),UINT32_C(0x65),UINT32_C(0x66),UINT32_C(0x61),UINT32_C(0x75),UINT32_C(0x6C),UINT32_C(0x74),UINT32_C(0x20),UINT32_C(0x65),UINT32_C(0x72),UINT32_C(0x72),UINT32_C(0x6F),UINT32_C(0x72),UINT32_C(0x20),UINT32_C(0x6D),UINT32_C(0x65),UINT32_C(0x73),UINT32_C(0x73),UINT32_C(0x61),UINT32_C(0x67),UINT32_C(0x65),UINT32_C(0x2E),UINT32_C(0x0),}); /* u8c_init: Default error message. */ /* Set status: */ u8c_stat = UINT8_C(0x0); return UINT8_C(0x0); diff --git a/src/u8c/seterr.c b/src/u8c/seterr.c index 5796683..c500ff4 100644 --- a/src/u8c/seterr.c +++ b/src/u8c/seterr.c @@ -19,9 +19,9 @@ # include <stdint.h> # include <stdlib.h> # include <u8c/dbgprint.h> -# include <u8c/freeu32.h> # include <u8c/seterr.h> # include <u8c/u32cp.h> +# include <u8c/u32free.h> # if defined(u8c_bethrdsafe) # include <threads.h> # endif @@ -31,7 +31,7 @@ uint_least8_t u8c_seterr(uint_least32_t const * const _msg) { # if defined(u8c_bethrdsafe) mtx_lock(&u8c_errlock); # endif - u8c_freeu32(u8c_err); + u8c_u32free(u8c_err); u8c_u32cp(NULL,&u8c_err,_msg); # if defined(u8c_bethrdsafe) mtx_unlock(&u8c_errlock); diff --git a/src/u8c/vprint.c b/src/u8c/vprint.c index 2e418ca..503ca88 100644 --- a/src/u8c/vprint.c +++ b/src/u8c/vprint.c @@ -18,10 +18,10 @@ # include <stdint.h> # include <stdio.h> # include <stdlib.h> -# include <u8c/freeu32.h> -# include <u8c/freeu8.h> # include <u8c/seterr.h> +# include <u8c/u32free.h> # include <u8c/u8enc.h> +# include <u8c/u8free.h> # include <u8c/SIZE_C.h> # include <u8c/vfmt.h> # include <u8c/vprint.h> @@ -37,7 +37,7 @@ uint_least8_t u8c_vprint(FILE * _fp,uint_least32_t const * const _msg,va_list _a u8c_seterr((uint_least32_t[]){UINT32_C(0x75),UINT32_C(0x38),UINT32_C(0x63),UINT32_C(0x5F),UINT32_C(0x76),UINT32_C(0x70),UINT32_C(0x72),UINT32_C(0x69),UINT32_C(0x6E),UINT32_C(0x74),UINT32_C(0x3A),UINT32_C(0x20),UINT32_C(0x66),UINT32_C(0x77),UINT32_C(0x72),UINT32_C(0x69),UINT32_C(0x74),UINT32_C(0x65),UINT32_C(0x3A),UINT32_C(0x20),UINT32_C(0x55),UINT32_C(0x6E),UINT32_C(0x61),UINT32_C(0x62),UINT32_C(0x6C),UINT32_C(0x65),UINT32_C(0x20),UINT32_C(0x74),UINT32_C(0x6F),UINT32_C(0x20),UINT32_C(0x77),UINT32_C(0x72),UINT32_C(0x69),UINT32_C(0x74),UINT32_C(0x65),UINT32_C(0x20),UINT32_C(0x74),UINT32_C(0x6F),UINT32_C(0x20),UINT32_C(0x73),UINT32_C(0x74),UINT32_C(0x64),UINT32_C(0x6F),UINT32_C(0x75),UINT32_C(0x74),UINT32_C(0x2E),UINT32_C(0x0),}); /* u8c_vprint: fwrite: Unable to write to stdout. */ return UINT8_C(0x1); } - u8c_freeu32(str0); - u8c_freeu8(str1); + u8c_u32free(str0); + u8c_u8free(str1); return UINT8_C(0x0); } |