diff options
Diffstat (limited to 'src/cc4group.h')
| -rw-r--r-- | src/cc4group.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cc4group.h b/src/cc4group.h index a6dcd37..82eddf6 100644 --- a/src/cc4group.h +++ b/src/cc4group.h @@ -63,6 +63,12 @@ typedef struct { CC4Group_TmpMemoryStrategy Auto; } const TmpMemoryStrategies; + struct { + int Take; // cc4group will free the data when its not needed anymore; e.g. in the destructor or when setting the file's data again + int Copy; // cc4group will copy the data to use it + int Reference; // cc4group will use the data as is (i.e. store the pointer and use it); the caller must guarantee it's validity throughout the groups lifetime (or until the file's data is set to a new pointer) + } const MemoryManagement; + void (*setTmpMemoryStrategy)(const CC4Group_TmpMemoryStrategy strategy); // group metadata handling @@ -83,7 +89,7 @@ typedef struct { 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); + bool (*setEntryData)(CC4Group* const this, const char* const entryPath, const void* const data, size_t const size, int const memoryManagementMode); } const CC4Group_API; #ifndef CC4GROUP_DYNAMIC_LOAD |
