about summary refs log tree commit diff stats
path: root/src/include
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-07-25 15:10:40 +0200
committerptitSeb <sebastien.chev@gmail.com>2024-07-25 15:10:40 +0200
commita8784eff9f40ca284cb03ae30a93287ea635ba91 (patch)
treec8fdf11d077d76c3a21dd7b5dd49f7baef987e02 /src/include
parentb26ae5886ddc7d0d84595fb5b94878f50d488d42 (diff)
downloadbox64-a8784eff9f40ca284cb03ae30a93287ea635ba91.tar.gz
box64-a8784eff9f40ca284cb03ae30a93287ea635ba91.zip
[RCFILE] Added support for generic names in RCFiles
Diffstat (limited to 'src/include')
-rw-r--r--src/include/khash.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/include/khash.h b/src/include/khash.h
index 9d20a0e6..823757bf 100644
--- a/src/include/khash.h
+++ b/src/include/khash.h
@@ -556,6 +556,21 @@ static kh_inline khint_t __ac_Wang_hash(khint_t key)
   @abstract     Iterate over the entries in the hash table
   @param  h     Pointer to the hash table [khash_t(name)*]
   @param  kvar  Variable to which key will be assigned
+  @param  vvar  Variable to which value will be assigned
+  @param  code  Block of code to execute
+ */
+#define kh_foreach_ref(h, kvar, rvar, code) { khint_t __i;	\
+	for (__i = kh_begin(h); __i != kh_end(h); ++__i) {		\
+		if (!kh_exist(h,__i)) continue;						\
+		(kvar) = kh_key(h,__i);								\
+		(rvar) = &kh_val(h,__i);							\
+		code;												\
+	} }
+
+/*! @function
+  @abstract     Iterate over the entries in the hash table
+  @param  h     Pointer to the hash table [khash_t(name)*]
+  @param  kvar  Variable to which key will be assigned
   @param  code  Block of code to execute
  */
 #define kh_foreach_key(h, kvar, code) { khint_t __i;           	\