#ifndef __TRACE_H__ #define __TRACE_H__ enum STATE { INIT=0, RUN=1, EXIT=2, PANIC=-1 }; struct ProcessDesc { pid_t pid; long count; long nr; int pid_status; enum STATE state; }; struct TraceAction { // data void *data; // methods int (*init) (struct TraceAction *this, int argc, char **argv, struct ProcessDesc *pd); int (*action) (struct TraceAction *this, ssv_t *state, struct ProcessDesc *pd); int (*cleanup)(struct TraceAction *this, ssv_t *last, struct ProcessDesc *pd); }; extern FILE *openTrace(char *basename); // You must provide this function and within it initialize the action object to // your methods and data. This is called once after you have been loaded. extern int SetupAction(struct TraceAction *action); #endif