summaryrefslogtreecommitdiffstats
path: root/src/cc4group.h
diff options
context:
space:
mode:
authorMarkus Mittendrein <git@maxmitti.tk>2018-08-18 23:11:02 +0200
committerMarkus Mittendrein <git@maxmitti.tk>2018-08-18 23:33:27 +0200
commit4338534c9cdacf98c310ab625a1d17988dde1949 (patch)
tree213b60d796a33efeb2649fbadb6dff62ab7d8ff2 /src/cc4group.h
parent88552afbb4b41b6f859e7051cc0e4b0efbecea78 (diff)
downloadcc4group-4338534c9cdacf98c310ab625a1d17988dde1949.tar.gz
cc4group-4338534c9cdacf98c310ab625a1d17988dde1949.zip
Add possibility to leave data ownership to the caller of setEntryData and remove possibility to specify entry data with createFile
Diffstat (limited to 'src/cc4group.h')
-rw-r--r--src/cc4group.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/cc4group.h b/src/cc4group.h
index ef3a55d..aab776c 100644
--- a/src/cc4group.h
+++ b/src/cc4group.h
@@ -80,9 +80,10 @@ typedef struct {
bool (*createDirectory)(CC4Group* const this, const char* const path);
// ownership of the data is taken by the group
- bool (*createFile)(CC4Group* const this, const char* const path, void* const data, size_t const size);
- // ownership of the data is taken by the group
- bool (*setEntryData)(const CC4Group* const this, const char* const entryPath, void* const data, size_t const size);
+ bool (*createFile)(CC4Group* const this, const char* const path);
+ // ownership of the data is taken by the group if freeData is true
+ // if freeData is false, the caller must guarantee that the pointer is valid as long as it is used in the group (i.e. until the pointer is changed through another call to setEntryData or the group is destructed)
+ bool (*setEntryData)(CC4Group* const this, const char* const entryPath, const void* const data, size_t const size, bool const freeData);
} const CC4Group_API;
#ifndef CC4GROUP_DYNAMIC_LOAD