123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302 |
- #ifndef _OBJC_LITTLE_HASHTABLE_H_
- #define _OBJC_LITTLE_HASHTABLE_H_
- #ifndef _OBJC_PRIVATE_H_
- # define OBJC_HASH_AVAILABILITY \
- __OSX_DEPRECATED(10.0, 10.1, "NXHashTable is deprecated") \
- __IOS_UNAVAILABLE __TVOS_UNAVAILABLE \
- __WATCHOS_UNAVAILABLE __BRIDGEOS_UNAVAILABLE
- #else
- # define OBJC_HASH_AVAILABILITY
- #endif
- #include <objc/objc.h>
- #include <stdint.h>
- #include <TargetConditionals.h>
- __BEGIN_DECLS
- typedef struct {
- uintptr_t (* _Nonnull hash)(const void * _Nullable info,
- const void * _Nullable data);
- int (* _Nonnull isEqual)(const void * _Nullable info,
- const void * _Nullable data1,
- const void * _Nullable data2);
- void (* _Nonnull free)(const void * _Nullable info,
- void * _Nullable data);
- int style;
- } NXHashTablePrototype;
-
- typedef struct {
- const NXHashTablePrototype * _Nonnull prototype OBJC_HASH_AVAILABILITY;
- unsigned count OBJC_HASH_AVAILABILITY;
- unsigned nbBuckets OBJC_HASH_AVAILABILITY;
- void * _Nullable buckets OBJC_HASH_AVAILABILITY;
- const void * _Nullable info OBJC_HASH_AVAILABILITY;
- } NXHashTable OBJC_HASH_AVAILABILITY;
-
-
- OBJC_EXPORT NXHashTable * _Nonnull
- NXCreateHashTableFromZone (NXHashTablePrototype prototype, unsigned capacity,
- const void * _Nullable info, void * _Nullable z)
- OBJC_HASH_AVAILABILITY;
- OBJC_EXPORT NXHashTable * _Nonnull
- NXCreateHashTable (NXHashTablePrototype prototype, unsigned capacity,
- const void * _Nullable info)
- OBJC_HASH_AVAILABILITY;
-
-
-
-
-
- OBJC_EXPORT void
- NXFreeHashTable (NXHashTable * _Nonnull table)
- OBJC_HASH_AVAILABILITY;
-
-
- OBJC_EXPORT void
- NXEmptyHashTable (NXHashTable * _Nonnull table)
- OBJC_HASH_AVAILABILITY;
-
- OBJC_EXPORT void
- NXResetHashTable (NXHashTable * _Nonnull table)
- OBJC_HASH_AVAILABILITY;
-
- OBJC_EXPORT BOOL
- NXCompareHashTables (NXHashTable * _Nonnull table1,
- NXHashTable * _Nonnull table2)
- OBJC_HASH_AVAILABILITY;
-
- OBJC_EXPORT NXHashTable * _Nonnull
- NXCopyHashTable (NXHashTable * _Nonnull table)
- OBJC_HASH_AVAILABILITY;
-
-
- OBJC_EXPORT unsigned
- NXCountHashTable (NXHashTable * _Nonnull table)
- OBJC_HASH_AVAILABILITY;
-
-
- OBJC_EXPORT int
- NXHashMember (NXHashTable * _Nonnull table, const void * _Nullable data)
- OBJC_HASH_AVAILABILITY;
-
-
- OBJC_EXPORT void * _Nullable
- NXHashGet (NXHashTable * _Nonnull table, const void * _Nullable data)
- OBJC_HASH_AVAILABILITY;
-
-
- OBJC_EXPORT void * _Nullable
- NXHashInsert (NXHashTable * _Nonnull table, const void * _Nullable data)
- OBJC_HASH_AVAILABILITY;
-
-
- OBJC_EXPORT void * _Nullable
- NXHashInsertIfAbsent (NXHashTable * _Nonnull table, const void * _Nullable data)
- OBJC_HASH_AVAILABILITY;
-
- OBJC_EXPORT void * _Nullable
- NXHashRemove (NXHashTable * _Nonnull table, const void * _Nullable data)
- OBJC_HASH_AVAILABILITY;
-
-
- typedef struct {int i; int j;} NXHashState OBJC_HASH_AVAILABILITY;
-
- OBJC_EXPORT NXHashState
- NXInitHashState(NXHashTable * _Nonnull table)
- OBJC_HASH_AVAILABILITY;
- OBJC_EXPORT int
- NXNextHashState(NXHashTable * _Nonnull table, NXHashState * _Nonnull state,
- void * _Nullable * _Nonnull data) OBJC_HASH_AVAILABILITY;
-
- OBJC_EXPORT uintptr_t
- NXPtrHash(const void * _Nullable info, const void * _Nullable data)
- OBJC_HASH_AVAILABILITY;
-
- OBJC_EXPORT uintptr_t
- NXStrHash(const void * _Nullable info, const void * _Nullable data)
- OBJC_HASH_AVAILABILITY;
-
- OBJC_EXPORT int
- NXPtrIsEqual(const void * _Nullable info, const void * _Nullable data1,
- const void * _Nullable data2)
- OBJC_HASH_AVAILABILITY;
-
- OBJC_EXPORT int
- NXStrIsEqual(const void * _Nullable info, const void * _Nullable data1,
- const void * _Nullable data2)
- OBJC_HASH_AVAILABILITY;
-
- OBJC_EXPORT void
- NXNoEffectFree(const void * _Nullable info, void * _Nullable data)
- OBJC_HASH_AVAILABILITY;
-
- OBJC_EXPORT void
- NXReallyFree(const void * _Nullable info, void * _Nullable data)
- OBJC_HASH_AVAILABILITY;
-
- OBJC_EXPORT const NXHashTablePrototype NXPtrPrototype
- OBJC_HASH_AVAILABILITY;
-
- OBJC_EXPORT const NXHashTablePrototype NXStrPrototype
- OBJC_HASH_AVAILABILITY;
-
- OBJC_EXPORT const NXHashTablePrototype NXPtrStructKeyPrototype
- OBJC_HASH_AVAILABILITY;
- OBJC_EXPORT const NXHashTablePrototype NXStrStructKeyPrototype
- OBJC_HASH_AVAILABILITY;
- #if !__OBJC2__ && !TARGET_OS_WIN32
- typedef const char *NXAtom OBJC_HASH_AVAILABILITY;
- OBJC_EXPORT NXAtom _Nullable
- NXUniqueString(const char * _Nullable buffer)
- OBJC_HASH_AVAILABILITY;
-
-
- OBJC_EXPORT NXAtom _Nonnull
- NXUniqueStringWithLength(const char * _Nullable buffer, int length)
- OBJC_HASH_AVAILABILITY;
-
-
- OBJC_EXPORT NXAtom _Nullable
- NXUniqueStringNoCopy(const char * _Nullable string)
- OBJC_HASH_AVAILABILITY;
-
-
- OBJC_EXPORT char * _Nullable
- NXCopyStringBuffer(const char * _Nullable buffer)
- OBJC_HASH_AVAILABILITY;
-
- OBJC_EXPORT char * _Nullable
- NXCopyStringBufferFromZone(const char * _Nullable buffer, void * _Nullable z)
- OBJC_HASH_AVAILABILITY;
-
- #endif
- __END_DECLS
- #endif
|