rpmio/rpmhook.c File Reference

#include "system.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <rpmhook.h>

Go to the source code of this file.

Data Structures

struct  rpmhookItem_s
struct  rpmhookBucket_s
struct  rpmhookTable_s

Defines

#define RPMHOOK_TABLE_INITSIZE   256
#define RPMHOOK_BUCKET_INITSIZE   5

Typedefs

typedef rpmhookItem_srpmhookItem
typedef rpmhookBucket_srpmhookBucket
typedef rpmhookTable_srpmhookTable

Functions

rpmhookArgs rpmhookArgsNew (int argc)
rpmhookArgs rpmhookArgsFree (rpmhookArgs args)
static rpmhookTable rpmhookTableNew (int size)
static void rpmhookTableRehash (rpmhookTable *table)
static int rpmhookTableFindBucket (rpmhookTable *table, const char *name)
static void rpmhookTableAddItem (rpmhookTable *table, const char *name, rpmhookFunc func, void *data)
static void rpmhookTableDelItem (rpmhookTable *table, const char *name, rpmhookFunc func, void *data, int matchfunc, int matchdata)
static rpmhookArgs rpmhookArgsParse (const char *argt, va_list ap)
static void rpmhookTableCallArgs (rpmhookTable *table, const char *name, rpmhookArgs args)
void rpmhookRegister (const char *name, rpmhookFunc func, void *data)
void rpmhookUnregister (const char *name, rpmhookFunc func, void *data)
void rpmhookUnregisterAny (const char *name, rpmhookFunc func)
void rpmhookUnregisterAll (const char *name)
void rpmhookCall (const char *name, const char *argt,...)
void rpmhookCallArgs (const char *name, rpmhookArgs args)

Variables

static rpmhookTable globalTable = NULL


Define Documentation

#define RPMHOOK_BUCKET_INITSIZE   5

Definition at line 12 of file rpmhook.c.

#define RPMHOOK_TABLE_INITSIZE   256

Definition at line 11 of file rpmhook.c.

Referenced by rpmhookRegister().


Typedef Documentation

typedef struct rpmhookBucket_s * rpmhookBucket

typedef struct rpmhookItem_s * rpmhookItem

typedef struct rpmhookTable_s * rpmhookTable


Function Documentation

rpmhookArgs rpmhookArgsFree ( rpmhookArgs  args  ) 

Definition at line 42 of file rpmhook.c.

Referenced by rpmhookCall().

rpmhookArgs rpmhookArgsNew ( int  argc  ) 

Definition at line 34 of file rpmhook.c.

References xcalloc().

Referenced by rpmhookArgsParse().

static rpmhookArgs rpmhookArgsParse ( const char *  argt,
va_list  ap 
) [static]

Definition at line 194 of file rpmhook.c.

References rpmhookArgs_s::argc, rpmhookArgs_s::argt, rpmhookArgs_s::argv, rpmhookArgv::f, rpmhookArgv::i, rpmhookArgv::p, rpmhookArgsNew(), and rpmhookArgv::s.

Referenced by rpmhookCall().

void rpmhookCall ( const char *  name,
const char *  argt,
  ... 
)

Definition at line 271 of file rpmhook.c.

References globalTable, rpmhookArgsFree(), rpmhookArgsParse(), and rpmhookTableCallArgs().

void rpmhookCallArgs ( const char *  name,
rpmhookArgs  args 
)

Definition at line 286 of file rpmhook.c.

References globalTable, and rpmhookTableCallArgs().

void rpmhookRegister ( const char *  name,
rpmhookFunc  func,
void *  data 
)

Definition at line 244 of file rpmhook.c.

References globalTable, RPMHOOK_TABLE_INITSIZE, rpmhookTableAddItem(), and rpmhookTableNew().

static void rpmhookTableAddItem ( rpmhookTable table,
const char *  name,
rpmhookFunc  func,
void *  data 
) [static]

Definition at line 140 of file rpmhook.c.

References rpmhookBucket_s::item, rpmhookBucket_s::name, rpmhookItem_s::next, rpmhookTableFindBucket(), and xcalloc().

Referenced by rpmhookRegister().

static void rpmhookTableCallArgs ( rpmhookTable table,
const char *  name,
rpmhookArgs  args 
) [static]

Definition at line 228 of file rpmhook.c.

References rpmhookItem_s::data, rpmhookItem_s::func, rpmhookBucket_s::item, rpmhookItem_s::next, and rpmhookTableFindBucket().

Referenced by rpmhookCall(), and rpmhookCallArgs().

static void rpmhookTableDelItem ( rpmhookTable table,
const char *  name,
rpmhookFunc  func,
void *  data,
int  matchfunc,
int  matchdata 
) [static]

Definition at line 159 of file rpmhook.c.

References rpmhookItem_s::data, rpmhookItem_s::func, rpmhookBucket_s::item, rpmhookBucket_s::name, rpmhookItem_s::next, and rpmhookTableFindBucket().

Referenced by rpmhookUnregister(), rpmhookUnregisterAll(), and rpmhookUnregisterAny().

static int rpmhookTableFindBucket ( rpmhookTable table,
const char *  name 
) [static]

Definition at line 84 of file rpmhook.c.

References rpmhookBucket_s::hash, rpmhookBucket_s::name, and rpmhookTableRehash().

Referenced by rpmhookTableAddItem(), rpmhookTableCallArgs(), rpmhookTableDelItem(), and rpmhookTableRehash().

static rpmhookTable rpmhookTableNew ( int  size  )  [static]

Definition at line 50 of file rpmhook.c.

References xcalloc().

Referenced by rpmhookRegister(), and rpmhookTableRehash().

static void rpmhookTableRehash ( rpmhookTable table  )  [static]

Definition at line 118 of file rpmhook.c.

References rpmhookTable_s::bucket, rpmhookBucket_s::item, rpmhookBucket_s::name, rpmhookTableFindBucket(), rpmhookTableNew(), and rpmhookTable_s::used.

Referenced by rpmhookTableFindBucket().

void rpmhookUnregister ( const char *  name,
rpmhookFunc  func,
void *  data 
)

Definition at line 253 of file rpmhook.c.

References globalTable, and rpmhookTableDelItem().

void rpmhookUnregisterAll ( const char *  name  ) 

Definition at line 265 of file rpmhook.c.

References globalTable, and rpmhookTableDelItem().

void rpmhookUnregisterAny ( const char *  name,
rpmhookFunc  func 
)

Definition at line 259 of file rpmhook.c.

References globalTable, and rpmhookTableDelItem().


Variable Documentation

rpmhookTable globalTable = NULL [static]

Definition at line 242 of file rpmhook.c.

Referenced by rpmhookCall(), rpmhookCallArgs(), rpmhookRegister(), rpmhookUnregister(), rpmhookUnregisterAll(), and rpmhookUnregisterAny().


Generated on Mon Mar 5 13:44:18 2007 for rpm by  doxygen 1.5.1