Page History
...
IMPORTANT: You should always release the handle to an SRP Hash Table when you no longer need it by calling SRP_HashTable_Release.
Examples
Code Block |
---|
// Create a case-insensitive hash table Handle = SRP_HashTable_Create() // Add some entries SRP_HashTable_Set(Handle, "Amazon", "http://www.amazon.com") SRP_HashTable_Set(Handle, "Google", "http://www.google.com") SRP_HashTable_Set(Handle, "Revelation", "http://www.revelation.com") SRP_HashTable_Set(Handle, "SRP", "http://www.srpcs.com") SRP_HashTable_Set(Handle, "Yahoo", "http://www.yahoo.com") SRP_HashTable_Set(Handle, "Empty", "") // The key exists Exists = SRP_HashTable_Contains(Handle, "SRP") // Remove one SRP_HashTable_Remove(Handle, "SRP") // The key no longer exists Exists = SRP_HashTable_Contains(Handle, "SRP") // Release it SRP_HashTable_Release(Handle) |