#include <stdlib.h>
Go to the source code of this file.
Data Structures | |
struct | KeyString |
struct | MPerf |
struct | sNode |
struct | SSizedKeys |
struct | Switch |
Defines | |
#define | ERR_DUPKEY 1 |
Typedefs | |
typedef struct sNode | Node |
Enumerations | |
enum | NodeType { NT_KEYS, NT_SWITCH, NT_FINAL } |
Functions | |
MPerf* | mperf_ctor (MPerf *mp) |
void | mperf_dtor (MPerf *mp) |
MPerf* | mperf_init (MPerf *mp, KeyString *keys, size_t keyNo) |
int | mperf_finish (MPerf *mp) |
KeyString* | mperf_find (MPerf *mp, const char *key, size_t keyLen) |
KeyString* | mperf_search (MPerf *mp, const char *key, size_t keyLen) |
int | mperf_for_all (MPerf *mp, int(*fnctn)(KeyString *, void *), void *data) |
|
|
|
|
|
|
|
Initialize an MPerf. If you pass NULL, memory will be malloc()'ed for an MPerf. |
|
Detele the lookup-structure, but NOT the MPerf. If you got it by passing NULL to mperf_ctor(), you'll have to free() it. |
|
Use this function, I you're 100% sure, that the key will be found in the MPerf. This is fatser than mperf_search(). |
|
Finish an initalized MPerf. After finishing it, you may search it for keys. |
|
Let's you apply the function `fnctn' to all KeyStrings. `data' is passed as the second parameter to `fnctn'. |
|
Set the probabilities, keys and the associated data. After calling this you MPerf won't work, yet. You'll have to call mperf_finish() * first. |
|
Use this function, if it's possible that the key is not in the MPerf. This will take the time for a final memcmp(). |