/[monit]/monit/gc.c
ViewVC logotype

Diff of /monit/gc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.23 by hauk, Thu Jul 24 00:35:25 2003 UTC revision 1.24 by martinp, Sun Aug 3 19:19:39 2003 UTC
# Line 28  Line 28 
28    
29    
30  /* Private prototypes */  /* Private prototypes */
31  static void _gcppl(Port_T*);  static void _gcppl(Port_T *);
32  static void _gcpl(Service_T*);  static void _gcpl(Service_T *);
33  static void _gcpcl(Checksum_T*);  static void _gcpcl(Checksum_T *);
34  static void _gcpql(Resource_T*);  static void _gcpql(Resource_T *);
35  static void _gcppil(ProcInfo_T*);  static void _gcppil(ProcInfo_T *);
36  static void _gcptl(Timestamp_T*);  static void _gcptl(Timestamp_T *);
37  static void _gccmd(Command_T *c);  static void _gccmd(Command_T *);
38  static void _gcpdil(DeviceInfo_T*);  static void _gcpdil(DeviceInfo_T *);
39  static void _gcpdl(Dependant_T *d);  static void _gcpdl(Dependant_T *);
40    static void _gcso(Size_T *);
41    
42    
43  /**  /**
# Line 68  void gc_service(Service_T *s) { Line 69  void gc_service(Service_T *s) {
69    ASSERT(s&&*s);    ASSERT(s&&*s);
70        
71    if((*s)->portlist) {    if((*s)->portlist) {
       
72      _gcppl(&(*s)->portlist);      _gcppl(&(*s)->portlist);
   
73    }    }
74    
75    if((*s)->checksumlist) {    if((*s)->checksumlist) {
       
76      _gcpcl(&(*s)->checksumlist);      _gcpcl(&(*s)->checksumlist);
   
77    }    }
78    
79    if((*s)->maillist) {    if((*s)->maillist) {
   
80      gc_mail_list(&(*s)->maillist);      gc_mail_list(&(*s)->maillist);
   
81    }    }
82    
83    if((*s)->resourcelist) {    if((*s)->resourcelist) {
       
84      _gcpql(&(*s)->resourcelist);      _gcpql(&(*s)->resourcelist);
       
85    }    }
86    
87    if((*s)->procinfo) {    if((*s)->procinfo) {
   
88      _gcppil(&(*s)->procinfo);      _gcppil(&(*s)->procinfo);
   
89    }    }
90        
91    if((*s)->devinfo) {    if((*s)->devinfo) {
   
92      _gcpdil(&(*s)->devinfo);      _gcpdil(&(*s)->devinfo);
   
93    }    }
94        
95    if((*s)->timestamplist) {    if((*s)->timestamplist) {
       
96      _gcptl(&(*s)->timestamplist);      _gcptl(&(*s)->timestamplist);
97      }
98    
99      if((*s)->sizelist) {
100        _gcso(&(*s)->sizelist);
101    }    }
102    
103    if((*s)->dependantlist) {    if((*s)->dependantlist) {
       
104      _gcpdl(&(*s)->dependantlist);      _gcpdl(&(*s)->dependantlist);
       
105    }    }
106    
107    free((*s)->name);    free((*s)->name);
# Line 143  void gc_mail_list(Mail_T *m) { Line 132  void gc_mail_list(Mail_T *m) {
132    ASSERT(m);    ASSERT(m);
133        
134    if((*m)->next)    if((*m)->next)
135        gc_mail_list(&(*m)->next);      gc_mail_list(&(*m)->next);
136        
137    free((*m)->to);    free((*m)->to);
138    free((*m)->from);    free((*m)->from);
# Line 164  static void _gcpl(Service_T *s) { Line 153  static void _gcpl(Service_T *s) {
153    ASSERT(s&&*s);    ASSERT(s&&*s);
154    
155    if((*s)->next) {    if((*s)->next) {
       
156      _gcpl(&(*s)->next);      _gcpl(&(*s)->next);
       
157    }    }
158        
159    gc_service(&(*s));    gc_service(&(*s));
# Line 182  static void _gccmd(Command_T *c) { Line 169  static void _gccmd(Command_T *c) {
169    ASSERT(c&&*c);    ASSERT(c&&*c);
170        
171    for(i= 0; (*c)->arg[i]; i++)    for(i= 0; (*c)->arg[i]; i++)
172        free((*c)->arg[i]);      free((*c)->arg[i]);
173    free(*c);    free(*c);
174    *c= NULL;    *c= NULL;
175    
# Line 195  static void _gcppl(Port_T *s) { Line 182  static void _gcppl(Port_T *s) {
182    ASSERT(s&&*s);    ASSERT(s&&*s);
183    
184    if((*s)->next) {    if((*s)->next) {
       
185      _gcppl(&(*s)->next);      _gcppl(&(*s)->next);
       
186    }    }
187    
188    free((*s)->hostname);    free((*s)->hostname);
# Line 216  static void _gcpcl(Checksum_T *s) { Line 201  static void _gcpcl(Checksum_T *s) {
201    ASSERT(s&&*s);    ASSERT(s&&*s);
202    
203    if((*s)->next) {    if((*s)->next) {
       
204      _gcpcl(&(*s)->next);      _gcpcl(&(*s)->next);
       
205    }    }
206    
207    free((*s)->file);    free((*s)->file);
# Line 234  static void _gcpql(Resource_T *q) { Line 217  static void _gcpql(Resource_T *q) {
217    ASSERT(q);    ASSERT(q);
218    
219    if((*q)->next) {    if((*q)->next) {
   
220      _gcpql(&(*q)->next);      _gcpql(&(*q)->next);
   
221    }    }
222        
223    if((*q)->exec) {    if((*q)->exec) {
# Line 274  static void _gcptl(Timestamp_T *p) { Line 255  static void _gcptl(Timestamp_T *p) {
255    ASSERT(p);    ASSERT(p);
256    
257    if((*p)->next) {    if((*p)->next) {
       
258      _gcptl(&(*p)->next);      _gcptl(&(*p)->next);
       
259    }    }
260    
261    free((*p)->pathname);    free((*p)->pathname);
# Line 289  static void _gcptl(Timestamp_T *p) { Line 268  static void _gcptl(Timestamp_T *p) {
268  }  }
269    
270    
271    static void _gcso(Size_T *s) {
272      
273      ASSERT(s);
274    
275      if((*s)->next)
276        _gcso(&(*s)->next);
277    
278      if((*s)->exec)
279        _gccmd(&(*s)->exec);
280    
281      free(*s);
282      *s= NULL;
283    
284    }
285    
286    
287  static void _gcpdl(Dependant_T *d) {  static void _gcpdl(Dependant_T *d) {
288    
289    ASSERT(d);    ASSERT(d);
290    
291    if((*d)->next) {    if((*d)->next) {
       
292      _gcpdl(&(*d)->next);      _gcpdl(&(*d)->next);
       
293    }    }
294    
295    free((*d)->dependant);    free((*d)->dependant);

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26