2004-04-19 02:30:21 +08:00
|
|
|
#ifndef RPMHOOK_H
|
|
|
|
#define RPMHOOK_H
|
|
|
|
|
|
|
|
typedef union {
|
2004-04-19 20:12:12 +08:00
|
|
|
/*@observer@*/
|
|
|
|
const char * s;
|
2004-04-19 02:30:21 +08:00
|
|
|
int i;
|
|
|
|
float f;
|
2004-04-19 20:12:12 +08:00
|
|
|
/*@observer@*/
|
|
|
|
void * p;
|
2004-04-19 02:30:21 +08:00
|
|
|
} rpmhookArgv;
|
|
|
|
|
|
|
|
typedef struct rpmhookArgs_s {
|
|
|
|
int argc;
|
2004-04-19 20:12:12 +08:00
|
|
|
const char * argt;
|
2004-04-19 02:30:21 +08:00
|
|
|
rpmhookArgv argv[1];
|
|
|
|
} * rpmhookArgs;
|
|
|
|
|
2004-04-19 20:12:12 +08:00
|
|
|
typedef int (*rpmhookFunc) (rpmhookArgs args, void *data);
|
2004-04-19 02:30:21 +08:00
|
|
|
|
2004-04-19 20:12:12 +08:00
|
|
|
/*@only@*/
|
|
|
|
rpmhookArgs rpmhookArgsNew(int argc)
|
|
|
|
/*@*/;
|
2004-10-10 01:29:22 +08:00
|
|
|
/*@null@*/
|
|
|
|
rpmhookArgs rpmhookArgsFree(/*@only@*/ /*@null@*/ rpmhookArgs args)
|
2004-04-19 20:12:12 +08:00
|
|
|
/*@modifies args @*/;
|
2004-04-19 04:47:29 +08:00
|
|
|
|
2004-04-19 20:12:12 +08:00
|
|
|
void rpmhookRegister(const char *name, rpmhookFunc func, void *data)
|
|
|
|
/*@globals internalState @*/
|
|
|
|
/*@modifies internalState @*/;
|
|
|
|
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)
|
|
|
|
/*@globals internalState @*/
|
|
|
|
/*@modifies internalState @*/;
|
2004-04-19 02:30:21 +08:00
|
|
|
|
|
|
|
#endif
|