2004-04-19 02:30:21 +08:00
|
|
|
#ifndef RPMHOOK_H
|
|
|
|
#define RPMHOOK_H
|
|
|
|
|
|
|
|
typedef union {
|
2004-04-19 04:47:29 +08:00
|
|
|
const char *s;
|
2004-04-19 02:30:21 +08:00
|
|
|
int i;
|
|
|
|
float f;
|
|
|
|
void *p;
|
|
|
|
} rpmhookArgv;
|
|
|
|
|
|
|
|
typedef struct rpmhookArgs_s {
|
|
|
|
int argc;
|
|
|
|
const char *argt;
|
|
|
|
rpmhookArgv argv[1];
|
|
|
|
} * rpmhookArgs;
|
|
|
|
|
|
|
|
typedef int (*rpmhookFunc)(rpmhookArgs args, void *data);
|
|
|
|
|
2004-04-19 04:47:29 +08:00
|
|
|
rpmhookArgs rpmhookArgsNew(int argc);
|
|
|
|
rpmhookArgs rpmhookArgsFree(rpmhookArgs args);
|
|
|
|
|
2004-04-19 02:30:21 +08:00
|
|
|
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, ...);
|
2004-04-19 04:47:29 +08:00
|
|
|
void rpmhookCallArgs(const char *name, rpmhookArgs args);
|
2004-04-19 02:30:21 +08:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* vim:ts=4:sw=4:et
|
|
|
|
*/
|