123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- #ifndef _OBJC_MAPTABLE_H_
- #define _OBJC_MAPTABLE_H_
- #ifndef _OBJC_PRIVATE_H_
- # define OBJC_MAP_AVAILABILITY \
- __OSX_DEPRECATED(10.0, 10.1, "NXMapTable is deprecated") \
- __IOS_UNAVAILABLE __TVOS_UNAVAILABLE \
- __WATCHOS_UNAVAILABLE __BRIDGEOS_UNAVAILABLE
- #else
- # define OBJC_MAP_AVAILABILITY
- #endif
- #include <objc/objc.h>
- __BEGIN_DECLS
-
- typedef struct _NXMapTable {
-
- const struct _NXMapTablePrototype * _Nonnull prototype;
- unsigned count;
- unsigned nbBucketsMinusOne;
- void * _Nullable buckets;
- } NXMapTable OBJC_MAP_AVAILABILITY;
- typedef struct _NXMapTablePrototype {
- unsigned (* _Nonnull hash)(NXMapTable * _Nonnull,
- const void * _Nullable key);
- int (* _Nonnull isEqual)(NXMapTable * _Nonnull,
- const void * _Nullable key1,
- const void * _Nullable key2);
- void (* _Nonnull free)(NXMapTable * _Nonnull,
- void * _Nullable key,
- void * _Nullable value);
- int style;
- } NXMapTablePrototype OBJC_MAP_AVAILABILITY;
-
-
- #define NX_MAPNOTAKEY ((void * _Nonnull)(-1))
- OBJC_EXPORT NXMapTable * _Nonnull
- NXCreateMapTableFromZone(NXMapTablePrototype prototype,
- unsigned capacity, void * _Nullable z)
- OBJC_MAP_AVAILABILITY;
- OBJC_EXPORT NXMapTable * _Nonnull
- NXCreateMapTable(NXMapTablePrototype prototype, unsigned capacity)
- OBJC_MAP_AVAILABILITY;
-
- OBJC_EXPORT void
- NXFreeMapTable(NXMapTable * _Nonnull table)
- OBJC_MAP_AVAILABILITY;
-
-
- OBJC_EXPORT void
- NXResetMapTable(NXMapTable * _Nonnull table)
- OBJC_MAP_AVAILABILITY;
-
- OBJC_EXPORT BOOL
- NXCompareMapTables(NXMapTable * _Nonnull table1, NXMapTable * _Nonnull table2)
- OBJC_MAP_AVAILABILITY;
-
- OBJC_EXPORT unsigned
- NXCountMapTable(NXMapTable * _Nonnull table)
- OBJC_MAP_AVAILABILITY;
-
-
- OBJC_EXPORT void * _Nullable
- NXMapMember(NXMapTable * _Nonnull table, const void * _Nullable key,
- void * _Nullable * _Nonnull value) OBJC_MAP_AVAILABILITY;
-
-
- OBJC_EXPORT void * _Nullable
- NXMapGet(NXMapTable * _Nonnull table, const void * _Nullable key)
- OBJC_MAP_AVAILABILITY;
-
-
- OBJC_EXPORT void * _Nullable
- NXMapInsert(NXMapTable * _Nonnull table, const void * _Nullable key,
- const void * _Nullable value)
- OBJC_MAP_AVAILABILITY;
-
-
- OBJC_EXPORT void * _Nullable
- NXMapRemove(NXMapTable * _Nonnull table, const void * _Nullable key)
- OBJC_MAP_AVAILABILITY;
-
-
- typedef struct {int index;} NXMapState OBJC_MAP_AVAILABILITY;
-
- OBJC_EXPORT NXMapState
- NXInitMapState(NXMapTable * _Nonnull table)
- OBJC_MAP_AVAILABILITY;
- OBJC_EXPORT int
- NXNextMapState(NXMapTable * _Nonnull table, NXMapState * _Nonnull state,
- const void * _Nullable * _Nonnull key,
- const void * _Nullable * _Nonnull value)
- OBJC_MAP_AVAILABILITY;
-
- OBJC_EXPORT const NXMapTablePrototype NXPtrValueMapPrototype
- OBJC_MAP_AVAILABILITY;
-
- OBJC_EXPORT const NXMapTablePrototype NXStrValueMapPrototype
- OBJC_MAP_AVAILABILITY;
-
- OBJC_EXPORT const NXMapTablePrototype NXObjectMapPrototype
- OBJC2_UNAVAILABLE;
-
- __END_DECLS
- #endif
|