]> git.neil.brown.name Git - metad.git/commitdiff
Full prototype for class methods.
authorNeil Brown <neilb@notabene.(none)>
Wed, 7 Jun 2006 11:19:35 +0000 (21:19 +1000)
committerNeil Brown <neilb@notabene.(none)>
Wed, 7 Jun 2006 11:19:35 +0000 (21:19 +1000)
Helps type checking.

metad.h

diff --git a/metad.h b/metad.h
index 7c4f88512a385c02c5e8281a9ef53954b1bce26f..4900d1fb96041c87bb36a21f4fa4ab85555bf50e 100644 (file)
--- a/metad.h
+++ b/metad.h
@@ -33,21 +33,6 @@ typedef struct service {
        time_t next_hold;               /* hold time for next crashing processes */
 } *service_t;
 
-typedef struct class {
-       char *class;                    /* name of class */
-       int  (*c_process_opt)();        /* function to processes options */
-       void (*register_service)();     /* register the service if necessary */
-       void (*c_check_service)();      /* check if anything needs to be done for a service */
-       void (*init_state)();           /* copy state from old service struct to new */
-       void (*copy_state)();           /* copy state from old service struct to new */
-       void (*free_state)();           /* free class dependant state */
-       void (*send_class)();           /* send class info */
-       void (*disable_service)();      /* unregister service */
-       void (*new_parent)();           /* in parent of new child */
-       void (*new_child)();            /* in a new child */
-       int  (*prefork)();              /* just before fork */
-} *class_t;
-
 typedef struct proc {
        pid_t           pid;            /* pid of process */
        service_t       service;
@@ -62,6 +47,21 @@ typedef struct proc {
        int             status;         /* wait status if exit_time > 0 */
 } *proc_t;
 
+typedef struct class {
+       char *class;                    /* name of class */
+       int  (*c_process_opt)(service_t sv, char *opt); /* function to processes options */
+       void (*register_service)(service_t sv); /* register the service if necessary */
+       void (*c_check_service)(service_t sv);  /* check if anything needs to be done for a service */
+       void (*init_state)(service_t to);       /* copy state from old service struct to new */
+       void (*copy_state)(service_t to, service_t from);/* copy state from old service struct to new */
+       void (*free_state)(service_t sv);       /* free class dependant state */
+       void (*send_class)(service_t sv);       /* send class info */
+       void (*disable_service)(service_t sv);  /* unregister service */
+       void (*new_parent)(service_t sv, proc_t p);/* in parent of new child */
+       void (*new_child)(service_t sv);        /* in a new child */
+       int  (*prefork)(service_t sv);          /* just before fork */
+} *class_t;
+
 
 typedef struct daemon_info {           /* class specific info for class "daemon" */
        int             min_proc;       /* minimum number of processes to have running */