rpm  5.4.10
Data Structures | Macros | Typedefs | Functions | Variables
rpmhook.c File Reference
#include "system.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include <rpmhook.h>
#include "debug.h"
Include dependency graph for rpmhook.c:

Go to the source code of this file.

Data Structures

struct  rpmhookItem_s
 
struct  rpmhookBucket_s
 
struct  rpmhookTable_s
 

Macros

#define RPMHOOK_TABLE_INITSIZE   256
 
#define RPMHOOK_BUCKET_INITSIZE   5
 

Typedefs

typedef struct rpmhookItem_srpmhookItem
 
typedef struct rpmhookBucket_srpmhookBucket
 
typedef struct 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
 

Macro Definition Documentation

§ RPMHOOK_BUCKET_INITSIZE

#define RPMHOOK_BUCKET_INITSIZE   5

Definition at line 12 of file rpmhook.c.

§ RPMHOOK_TABLE_INITSIZE

#define RPMHOOK_TABLE_INITSIZE   256

Definition at line 11 of file rpmhook.c.

Referenced by rpmhookRegister().

Typedef Documentation

§ rpmhookBucket

typedef struct rpmhookBucket_s * rpmhookBucket

§ rpmhookItem

typedef struct rpmhookItem_s * rpmhookItem

§ rpmhookTable

typedef struct rpmhookTable_s * rpmhookTable

Function Documentation

§ rpmhookArgsFree()

rpmhookArgs rpmhookArgsFree ( rpmhookArgs  args)

Definition at line 42 of file rpmhook.c.

Referenced by rpmhookCall().

§ rpmhookArgsNew()

rpmhookArgs rpmhookArgsNew ( int  argc)

Definition at line 34 of file rpmhook.c.

References rpmhookArgs_s::argc, rpmhookArgs_s::argv, and xcalloc().

Referenced by rpmhookArgsParse().

§ rpmhookArgsParse()

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

§ rpmhookCall()

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

Definition at line 267 of file rpmhook.c.

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

§ rpmhookCallArgs()

void rpmhookCallArgs ( const char *  name,
rpmhookArgs  args 
)

Definition at line 282 of file rpmhook.c.

References rpmhookTableCallArgs().

§ rpmhookRegister()

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

Definition at line 240 of file rpmhook.c.

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

§ rpmhookTableAddItem()

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

§ rpmhookTableCallArgs()

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

§ rpmhookTableDelItem()

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

§ rpmhookTableFindBucket()

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

§ rpmhookTableNew()

static rpmhookTable rpmhookTableNew ( int  size)
static

§ rpmhookTableRehash()

static void rpmhookTableRehash ( rpmhookTable table)
static

§ rpmhookUnregister()

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

Definition at line 249 of file rpmhook.c.

References rpmhookTableDelItem().

§ rpmhookUnregisterAll()

void rpmhookUnregisterAll ( const char *  name)

Definition at line 261 of file rpmhook.c.

References rpmhookTableDelItem().

§ rpmhookUnregisterAny()

void rpmhookUnregisterAny ( const char *  name,
rpmhookFunc  func 
)

Definition at line 255 of file rpmhook.c.

References rpmhookTableDelItem().

Variable Documentation

§ globalTable

rpmhookTable globalTable = NULL
static

Definition at line 238 of file rpmhook.c.