summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/qntan/Qntan.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/qntan/Qntan.h b/include/qntan/Qntan.h
index e159546..d5e77a7 100644
--- a/include/qntan/Qntan.h
+++ b/include/qntan/Qntan.h
@@ -73,6 +73,7 @@ struct Qntan_FileSystem_Dirent;
struct Qntan_FileSystem;
struct Qntan_FourierTransform;
struct Qntan_Process;
+struct Qntan_HshIdx;
struct Qntan_HshTbl;
struct Qntan_HshTbl_Cursor;
struct Qntan_Socket;
@@ -819,6 +820,39 @@ struct Qntan_Process {
+struct Qntan_HshIdx {
+ /* An n-dimensional HashTable. Where as many properties as wanted
+ * can be used to index into the table.
+ * BUT: ONLY the 1st index is considered to be unique (for
+ * consistency reasons, only ONE index can be used to decide if an
+ * object already exists for exmaple. Allowing multiple would cause
+ * conflicts as soon indexes disagree in such a case).
+ */
+ size_t (*getCnt)( struct Qntan_HshIdx** );
+ /* Returns number of objects currently present in this collection.
+ */
+ int (*addIfNew)( struct Qntan_HshIdx**, void*elm );
+ /* Returns 0 if 'elm' got copied into the hashtable.
+ * Returns '-EEXIST' (yep, negated) if 'elm' already exists. Nothing got
+ * copied anywhere.
+ * Returns negative values to indicate errors.
+ */
+ int (*get)( struct Qntan_HshIdx**, void*srch, void*ptrToDst, int idx );
+ /* Returns 0 if there's no object matching 'srch'.
+ * Returns 1 if found object got copied to 'ptrToDst'. The element itelf
+ * will swill be present in the table.
+ */
+};
+
+
+
+
+
+
+
+
+
+
struct Qntan_HshTbl {
/**/
int (*swap)( struct Qntan_HshTbl**, void*elm, void*ptrToDst );