Main Page   Data Structures   File List   Data Fields   Globals  

mperfl.h File Reference

#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

MPerfmperf_ctor (MPerf *mp)
void mperf_dtor (MPerf *mp)
MPerfmperf_init (MPerf *mp, KeyString *keys, size_t keyNo)
int mperf_finish (MPerf *mp)
KeyStringmperf_find (MPerf *mp, const char *key, size_t keyLen)
KeyStringmperf_search (MPerf *mp, const char *key, size_t keyLen)
int mperf_for_all (MPerf *mp, int(*fnctn)(KeyString *, void *), void *data)


Define Documentation

#define ERR_DUPKEY   1
 


Typedef Documentation

typedef struct sNode Node
 


Enumeration Type Documentation

enum NodeType
 

Enumeration values:
NT_KEYS  
NT_SWITCH  
NT_FINAL  


Function Documentation

MPerf* mperf_ctor ( MPerf * mp )
 

Initialize an MPerf. If you pass NULL, memory will be malloc()'ed for an MPerf.

void mperf_dtor ( MPerf * mp )
 

Detele the lookup-structure, but NOT the MPerf. If you got it by passing NULL to mperf_ctor(), you'll have to free() it.

KeyString* mperf_find ( MPerf * mp,
const char * key,
size_t keyLen )
 

Use this function, I you're 100% sure, that the key will be found in the MPerf. This is fatser than mperf_search().

int mperf_finish ( MPerf * mp )
 

Finish an initalized MPerf. After finishing it, you may search it for keys.

int mperf_for_all ( MPerf * mp,
int(* fnctn)(KeyString *, void *),
void * data )
 

Let's you apply the function `fnctn' to all KeyStrings. `data' is passed as the second parameter to `fnctn'.

MPerf* mperf_init ( MPerf * mp,
KeyString * keys,
size_t keyNo )
 

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.

KeyString* mperf_search ( MPerf * mp,
const char * key,
size_t keyLen )
 

Use this function, if it's possible that the key is not in the MPerf. This will take the time for a final memcmp().


Generated at Wed Oct 9 23:29:05 2002 for mperf by doxygen1.2.6 written by Dimitri van Heesch, © 1997-2001