summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-05 21:40:09 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-05 21:40:09 -0400
commit972845e2ecba5a46e33ad25934399d50bd63bdca (patch)
tree8c3345ce83dd920b1fde82cb5526dbddf09d94b9 /src
parent68eb1285777f3ee373b1e0e95771f21325659349 (diff)
feat: Function to write tags by themselvesHEADmain
Added a function to write tags by themselves as a shorthand since writing tags only is useful.
Diffstat (limited to 'src')
-rw-r--r--src/libMatfile.abin0 -> 2600 bytes
-rwxr-xr-xsrc/libMatfile.so.1.1bin0 -> 33824 bytes
-rw-r--r--src/matfile.c14
-rw-r--r--src/matfile.obin0 -> 2336 bytes
4 files changed, 13 insertions, 1 deletions
diff --git a/src/libMatfile.a b/src/libMatfile.a
new file mode 100644
index 0000000..89a3b80
--- /dev/null
+++ b/src/libMatfile.a
Binary files differ
diff --git a/src/libMatfile.so.1.1 b/src/libMatfile.so.1.1
new file mode 100755
index 0000000..a09e26d
--- /dev/null
+++ b/src/libMatfile.so.1.1
Binary files differ
diff --git a/src/matfile.c b/src/matfile.c
index c6da630..85af901 100644
--- a/src/matfile.c
+++ b/src/matfile.c
@@ -32,8 +32,16 @@ bool write_header(FILE *file) {
return (status == sizeof(header));
}
+bool write_tag(FILE *file, mTag_t tag) {
+ if (file == NULL) {
+ return false;
+ }
+
+ return (fwrite((const void *)&tag, 1, sizeof(tag), file) == sizeof(tag));
+}
+
bool write_data(FILE *file, const mData_t data) {
- if (data.data == NULL) {
+ if (data.data == NULL || file == NULL) {
return false;
}
@@ -51,6 +59,10 @@ bool write_data(FILE *file, const mData_t data) {
}
bool write_small_data(FILE *file, const mSmallData_t data) {
+ if (file == NULL) {
+ return false;
+ }
+
const size_t w = fwrite((const void *)&data, 1, sizeof(data), file);
return (w == sizeof(data));
diff --git a/src/matfile.o b/src/matfile.o
new file mode 100644
index 0000000..e437d4d
--- /dev/null
+++ b/src/matfile.o
Binary files differ