diff options
| author | hiddenalpha.ch | 2026-07-26 11:57:12 +0200 |
|---|---|---|
| committer | hiddenalpha.ch | 2026-07-26 11:57:12 +0200 |
| commit | 8c643e9b7df0a269fd3cd7c2c0be22d5c5a13498 (patch) | |
| tree | 550e4e10d9a2e44f4dbb25501657217513cdc664 /include | |
| parent | 007b23db8e6e57da59e0821dea3c95508c0f7003 (diff) | |
| download | Qntan-8c643e9b7df0a269fd3cd7c2c0be22d5c5a13498.tar.gz Qntan-8c643e9b7df0a269fd3cd7c2c0be22d5c5a13498.zip | |
Add `HshIdx.swap()`
Diffstat (limited to 'include')
| -rw-r--r-- | include/qntan/Qntan.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/qntan/Qntan.h b/include/qntan/Qntan.h index d5e77a7..1dcb005 100644 --- a/include/qntan/Qntan.h +++ b/include/qntan/Qntan.h @@ -831,7 +831,7 @@ struct Qntan_HshIdx { size_t (*getCnt)( struct Qntan_HshIdx** ); /* Returns number of objects currently present in this collection. */ - int (*addIfNew)( struct Qntan_HshIdx**, void*elm ); + int (*addIfNew)( struct Qntan_HshIdx**, void*elm, int idx ); /* Returns 0 if 'elm' got copied into the hashtable. * Returns '-EEXIST' (yep, negated) if 'elm' already exists. Nothing got * copied anywhere. @@ -842,6 +842,12 @@ struct Qntan_HshIdx { * Returns 1 if found object got copied to 'ptrToDst'. The element itelf * will swill be present in the table. */ + int (*swap)( struct Qntan_HshIdx**, void*elm, void*ptrToDst, int idx ); + /* Returns 0 if 'elm' got copied into the hashtable. + * Returns 1 is similar to 'Return 0'. BUT: a matching element did already + * exist and this old element now got swapped into 'ptrToDst'. + * Returns negative values to indicate errors. + */ }; |
