summaryrefslogtreecommitdiffstats
path: root/src/cc4group.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/cc4group.h')
-rw-r--r--src/cc4group.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/cc4group.h b/src/cc4group.h
index 4bcec34..25f3c53 100644
--- a/src/cc4group.h
+++ b/src/cc4group.h
@@ -180,6 +180,12 @@ typedef bool (*CC4Group_WriteCallback)(const void* const data, size_t const size
typedef void (*CC4Group_WarningCallback)(const CC4Group* const group, const char* const format, ...);
+// callback type for entry name matching
+// must return 0 on match, non-zero otherwise
+// query is the querying string passed in by the application, name is the candidate name
+// query will be path-components of the actually queried path, determined by '/'
+typedef int (*CC4Group_EntryNameMatchingCallback)(const char* query, const char* name);
+
// this is the main API struct of cc4group
// it contains all available methods and constants
typedef struct {
@@ -225,6 +231,12 @@ typedef struct {
// this will affect all groups in any state
void (*setWarningCallback)(const CC4Group_WarningCallback callback);
+ // sets the global entry name comparison callback
+ // strcmp is the default callback; it can be restored by calling setEntryNameMatchingCallback with callback as NULL
+ // NOTE: this is a static method (i.e. it is used without any object)
+ // this will affect all groups in any state
+ void (*setEntryNameMatchingCallback)(const CC4Group_EntryNameMatchingCallback callback);
+
// allocates and initializes a new group object, like the operator new
// NULL may be returned if the memory allocation (malloc) fails; in this case errno contains additional error information
@@ -468,3 +480,4 @@ extern CC4Group_API cc4group;
#undef new
#undef delete
#endif
+