summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rw-r--r--changelog.md5
-rw-r--r--include/u8c.h36
-rw-r--r--include/u8c/ver.h2
-rw-r--r--src/u8c/init.c2
-rw-r--r--src/u8c/vprint.c2
-rw-r--r--test.c20
-rw-r--r--txttolit.c2
8 files changed, 28 insertions, 42 deletions
diff --git a/Makefile b/Makefile
index 30dfdc0..bfbaa89 100644
--- a/Makefile
+++ b/Makefile
@@ -31,7 +31,6 @@ SRCS = \
src/u8c/vfmt.c \
src/u8c/vprint.c
HDRS = \
- include/u8c.h \
include/u8c/col.h \
include/u8c/dbgprint.h \
include/u8c/debug.h \
diff --git a/changelog.md b/changelog.md
index 1a61bd7..afb4049 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,3 +1,8 @@
+# 3
+
+* Remove `include/u8c.h`.
+* Fix minor errors.
+
# 2
* Move PKGBUILD to seperate project.
diff --git a/include/u8c.h b/include/u8c.h
deleted file mode 100644
index 8a11dd5..0000000
--- a/include/u8c.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- Copyright 2021 Gabriel Jensen
-
- This file is part of u8c.
-
- u8c is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
-
- u8c is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- See the GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License along with u8c.
-
- If not, see <https://www.gnu.org/licenses/>.
-*/
-/* Import this header to declare every single thing from u8c. */
-/* Expect long compile time. */
-# include <u8c/col.h>
-# include <u8c/dbgprint.h>
-# include <u8c/debug.h>
-# include <u8c/end.h>
-# include <u8c/fmt.h>
-# include <u8c/fmttyp.h>
-# include <u8c/geterr.h>
-# include <u8c/init.h>
-# include <u8c/print.h>
-# include <u8c/println.h>
-# include <u8c/SIZE_C.h>
-# include <u8c/thrdsafe.h>
-# include <u8c/u32cp.h>
-# include <u8c/u32sz.h>
-# include <u8c/u8dec.h>
-# include <u8c/u8enc.h>
-# include <u8c/ver.h>
-# include <u8c/vfmt.h>
-# include <u8c/vprint.h>
diff --git a/include/u8c/ver.h b/include/u8c/ver.h
index 3c07ec6..31835f8 100644
--- a/include/u8c/ver.h
+++ b/include/u8c/ver.h
@@ -16,5 +16,5 @@
/* Version */
# if !defined(u8c_ver)
# include <stdint.h>
-# define u8c_ver (UINT64_C(0x2))
+# define u8c_ver (UINT64_C(0x3))
# endif
diff --git a/src/u8c/init.c b/src/u8c/init.c
index 0f752ce..f2d171d 100644
--- a/src/u8c/init.c
+++ b/src/u8c/init.c
@@ -26,7 +26,7 @@
# if defined(u8c_bethrdsafe)
# include <threads.h>
# endif
-extern uint_least8_t u8c_init(void) {
+uint_least8_t u8c_init(void) {
# if defined(u8c_bethrdsafe)
if(mtx_init(&u8c_errlock,mtx_plain) == thrd_error) {
return UINT8_C(0x2);
diff --git a/src/u8c/vprint.c b/src/u8c/vprint.c
index fcbafe4..d5241b7 100644
--- a/src/u8c/vprint.c
+++ b/src/u8c/vprint.c
@@ -33,7 +33,7 @@ uint_least8_t u8c_vprint(FILE * _fp,uint_least32_t * _msg,va_list _args) {
u8c_u8enc(&str1sz,&str1,str0);
assert(str1sz > SIZE_C(0x0));
if(fwrite(str1,sizeof(uint_least8_t),str1sz - SIZE_C(0x1),_fp) < str1sz - SIZE_C(0x1)) {
- u8c_seterr((uint_least32_t[]){UINT32_C(0x75),UINT32_C(0x38),UINT32_C(0x63),UINT32_C(0x5F),UINT32_C(0x70),UINT32_C(0x72),UINT32_C(0x69),UINT32_C(0x6E),UINT32_C(0x74),UINT32_C(0x76),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_printv: fwrite: Unable to write to stdout. */
+ 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);
}
free(str0);
diff --git a/test.c b/test.c
index 70569d9..2812909 100644
--- a/test.c
+++ b/test.c
@@ -4,7 +4,25 @@
# include <stdio.h>
# include <stdlib.h>
# include <threads.h>
-# include <u8c.h>
+# include <u8c/col.h>
+# include <u8c/dbgprint.h>
+# include <u8c/debug.h>
+# include <u8c/end.h>
+# include <u8c/fmt.h>
+# include <u8c/fmttyp.h>
+# include <u8c/geterr.h>
+# include <u8c/init.h>
+# include <u8c/print.h>
+# include <u8c/println.h>
+# include <u8c/SIZE_C.h>
+# include <u8c/thrdsafe.h>
+# include <u8c/u32cp.h>
+# include <u8c/u32sz.h>
+# include <u8c/u8dec.h>
+# include <u8c/u8enc.h>
+# include <u8c/ver.h>
+# include <u8c/vfmt.h>
+# include <u8c/vprint.h>
static void testmsg(char const * fmt,...) {
va_list args;
va_start(args,fmt);
diff --git a/txttolit.c b/txttolit.c
index f22ca69..c3db377 100644
--- a/txttolit.c
+++ b/txttolit.c
@@ -12,7 +12,7 @@
int main(void) {
u8c_init();
size_t u32sz = SIZE_C(0x0);
- uint_least32_t * u32 = U"u8c_u32cp: Unable to allocate resources."; /* Place string here. */
+ uint_least32_t * u32 = U"Hello there."; /* Place string here. */
u8c_u32sz(&u32sz,u32);
printf("Arrray:\n{");
for(size_t n = SIZE_C(0x0);n < u32sz;n += SIZE_C(0x1)) {