Commit Graph

224 Commits

Author SHA1 Message Date
ee27935aab add vcpkg.json, and modify ci.yaml to improve usage vcpkg
Now we utilise storing dependencies in `vcpkg.json`, we can use this to
more easily install the dependencies.
Furthermore, we moved cloning vcpkg to `checkout`, which creates clones
with `--depth=1` by default.
2025-08-13 16:00:51 +02:00
51a05f2d7c seperate json from the yaml column, to use tabs instead of spaces 2025-08-13 12:23:54 +02:00
ebd5b6b430 rewrite the style guide 2025-08-13 12:21:07 +02:00
2e7932a70c add a section about general code information 2025-08-13 12:21:07 +02:00
37181a299c write a note 2025-08-13 12:21:07 +02:00
41828c6ea7 modify line about british spelling 2025-08-13 12:19:19 +02:00
f0e6aa38c7 seperate out general good C practice from the style guide 2025-08-13 12:19:17 +02:00
54428e72f9 fix: tests were still using types.h, rather than intdef.h 2025-08-13 12:19:17 +02:00
75008c6ca8 add comment to explain sar test 2025-08-13 12:19:15 +02:00
7ef32c06ea add libarchive to the dependencies.
library for handling archives, like gzip, xz, zstd, et cetera.
This'll be crucial later on.
2025-08-10 23:24:55 +02:00
5c57a77ad4 remove types.h, and start using intdef.h 2025-08-08 12:37:31 +02:00
bdf4d7b22b remove atrb_* macros for the attributes, and replace with single-word, all uppercase versions.
improves briefity, and reduces confusion.
2025-08-08 12:30:59 +02:00
114a7d4ea5 implement nbt_nextcompound
this is still flawed, due to recursion and there being a better way.
Just gotta find it.
2025-08-08 12:27:46 +02:00
e287f6034f add copyright information to nbt.c 2025-08-07 13:49:50 +02:00
0e00cb2d54 remove non-functional code 2025-08-07 13:23:47 +02:00
c3fc688c35 remove nbt_proc and replace it with nbt_initproc
we're moving towards that the user will handle most of the looping and
data feed.
So the use of these functions is no longer intended, becides, they
weren't being maintained whilst the parameters changed, causing the
portion of code to lag behind.
I'd rather rewrite code than have to prune old, unused code.
2025-08-07 13:23:33 +02:00
4871a19695 update README to include (some) planned features 2025-08-07 13:02:08 +02:00
2d33255ce8 remove release CI status indicator, since it won't hold any value 2025-08-07 13:02:08 +02:00
066e1c0049 remove nbt_isprim function, because it never really served any purpose.' 2025-08-07 13:02:08 +02:00
1052dcaac9 add functions for incrementing to the next tag 2025-08-07 13:01:27 +02:00
f952268152 fix: the + unary operator does not add 1, but just specifies intent.
I was very mistaken, and I feel like an idiot.
2025-08-07 13:00:09 +02:00
4b2404e903 move utility functions upwards to keep the logical order 2025-08-07 13:00:09 +02:00
ff7598a7e3 rework attributes to be a bit safer and more logical.
we are targeting GNU extensions, GNU attributes are a part of that.
added aliases for the new attribute names (name as all caps = shorter
due to `atrb_` prefix)
The aliases are likely to be removed in a later commit
2025-07-31 11:27:57 +02:00
e472d9c251 rename types.h to intdef.h and replace types.h with a symlink.
`intdef.h` is more clear in the purpose that it describes, rather than
`types`, `types` is too generic.
Note: floating points are still defined in this header, I imagine this
to be removed later, alongside the compatibility symlink.
2025-07-31 11:27:57 +02:00
d70888f9fb remove __attribute__((fallthrough)) from all that do not require it. Replace with // fall through in some places for readability 2025-07-24 16:32:41 +02:00
6dbf034ba1 add marker so I remember to add this back in 2025-07-24 16:29:03 +02:00
1ea37b6e86 fix: there is no need to let the compilation continue if it fails.
it actually makes it less easy to locate errors.
2025-07-24 16:29:03 +02:00
f3273ed5d0 fix: include my endian.h in nbt.h 2025-07-24 16:29:03 +02:00
6ccb55de8b remove unused function nbt_cmpstr, since we're performing this check directly now. 2025-07-24 16:29:03 +02:00
69dc174ff2 remove nbt_arrlen function 2025-07-24 16:29:03 +02:00
58d0dd01e2 move nbt_strlen to nbt.h, and rename to nbt_namelen 2025-07-24 16:29:03 +02:00
4005163d61 fix: use atrb_pure for functions reading global state 2025-07-24 16:29:03 +02:00
8964a1a563 fix: atrb for when _MSC_VER is defined did not have parameters 2025-07-24 16:29:03 +02:00
f0c5408c51 fix: error.h should exit with EXIT_FAILURE, rather than 1 2025-07-24 16:29:03 +02:00
1d5df8df0a apply new formatting rules to the whole project 2025-07-24 16:29:03 +02:00
cdf13b7529 change qualifier alignment to be left again 2025-07-24 16:28:25 +02:00
13e1ceddfc update nbt_proc function, still inoperable 2025-07-24 16:28:25 +02:00
333417dadd add funciton for data loading/processing 2025-07-24 16:28:25 +02:00
fd8db02e77 modify the array bytelength function to get the bytelength of a single tag. 2025-07-24 16:28:25 +02:00
2daeb9823c add a function to get an NBT array bytelength 2025-07-23 14:55:24 +02:00
4e1cd68c38 semantic fix, use explicit fallthrough
GCC was complaining, and I didn't have a valid counter argument.
2025-07-23 14:07:06 +02:00
501c623f01 rename nbt_prim_tagsize to nbt_primsize, for consistency. 2025-07-23 13:00:53 +02:00
65ee7c5b55 add a function for checking whether a tag is primitive or not
mainly for niche uses
2025-07-23 13:00:53 +02:00
5d7c244c8f optimise switch of nbt_prim_tagsize
had duplicate switch branches, which wastes binary size.
2025-07-23 13:00:53 +02:00
9fd920908e move nbt_prim_tagsize to header, since it's a pretty useful funciton. 2025-07-23 13:00:53 +02:00
8102dd6a71 fix: markdown footnote now uses correct format 2025-07-23 13:00:53 +02:00
ac3be7e8ab add link time optimalisation flag to makefile 2025-07-23 11:38:06 +02:00
6c2f51929b write a function for skipping to the next NBT tag
including a function for acquireing the array size, and bytesize of a
tag.
2025-07-18 10:29:08 +02:00
ee1811a3a5 rewrite endian header to not interfere with the endian system header.
the system header is inconsistently available across platforms.
This header provides the same functionality for less of the cost,
overriding the system macros.
2025-07-18 10:29:08 +02:00
db76d6992b add function for comparing an NBT string with a C string 2025-07-15 13:51:23 +02:00