Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

mask.c File Reference

#include "sys.h"
#include "errors.h"
#include "bits_n_bytes.h"
#include "mask.h"

Functions

int32_t aw_mask_defrag (aw_mask_t *mt)
 Realloc all entries into a contiguous block, freeing old ones .

void aw_mask_delete (u_int32_t mask, aw_mask_t *mt)
 Delete ALL user_pointers associated with mask in table mt.

void aw_mask_delete_specific (u_int32_t mask, void *user_pointer, aw_mask_t *mt)
 Delete user_pointer associated with mask,user_pointer pair in table mt.

void aw_mask_destroy (aw_mask_t *mt)
 Free mask table.

void * aw_mask_fetch (aw_mask_cursor_t *c)
 Fill cursor with next match.

int32_t aw_mask_insert (u_int32_t mask, void *user_pointer, aw_mask_t *mt)
 Associate user_pointer with mask in table mt.

aw_mask_t * aw_mask_make (void)
 Create mask table.
Returns:
A aw_mask_t pointer is returned on success, NULL on error.


void aw_mask_query (u_int32_t key, aw_mask_cursor_t *c, const aw_mask_t *mt)
 Fill cursor with results of query. Must call aw_mask_fetch() to get data in cursor.


Function Documentation

int32_t aw_mask_defrag (  aw_mask_t *  mt  ) 
 

Realloc all entries into a contiguous block, freeing old ones .

aw_mask_defrag

Parameters:
mt Mask table.
Returns:
0 on success.

void aw_mask_delete (  u_int32_t  mask,
aw_mask_t *  mt
) 
 

Delete ALL user_pointers associated with mask in table mt.

Parameters:
mask 32bit mask.
mt Mask table.

void aw_mask_delete_specific (  u_int32_t  mask,
void *  user_pointer,
aw_mask_t *  mt
) 
 

Delete user_pointer associated with mask,user_pointer pair in table mt.

Parameters:
mask 32bit mask.
user_pointer Value to associated with key
mt Mask table.

void aw_mask_destroy (  aw_mask_t *  mt  ) 
 

Free mask table.

Parameters:
mt Mask table.

void* aw_mask_fetch (  aw_mask_cursor_t *  c  ) 
 

Fill cursor with next match.

Parameters:
c Cursor.
Returns:
Returns associated user_pointer, NULL when no more data.

int32_t aw_mask_insert (  u_int32_t  mask,
void *  user_pointer,
aw_mask_t *  mt
) 
 

Associate user_pointer with mask in table mt.

Parameters:
mask 32bit mask.
user_pointer Pointer to associate with mask.
mt Mask table.
Returns:
0 on success.

aw_mask_t* aw_mask_make (  void   ) 
 

Create mask table.

Returns:
A aw_mask_t pointer is returned on success, NULL on error.

void aw_mask_query (  u_int32_t  key,
aw_mask_cursor_t *  c,
const aw_mask_t *  mt
) 
 

Fill cursor with results of query. Must call aw_mask_fetch() to get data in cursor.

Parameters:
key 32bit key.
c Cursor.
mt Mask table.

Aware 0.11.1 Copyright (C) 1998-2005 Russell Leighton (russ@elegant-software.com)