registerhook(HOOK_CORE_SIGUSR1, reopen_logfile);
}
+void fini_logfile() {
+ deregisterhook(HOOK_CORE_SIGUSR1, reopen_logfile);
+ fclose(logfile);
+}
+
void Error(char *source, int severity, char *reason, ... ) {
char buf[512];
va_list va;
events=(schedule **)malloc(INITSCHEDSIZE*sizeof(schedule *));
}
+void finischedule() {
+ deregisterhook(HOOK_CORE_STATSREQUEST, &schedulestats);
+ free(events);
+}
+
void schedule_heapify(int index) {
int firstindex=index;
schedule *ep;
insertschedule(sp);
#ifdef SCHEDDEBUG
- Error("schedule",ERR_DEBUG,"scheduleoneshot: (%ld, %x, %x) = %x",when, callback, arg, sp);
+ Error("schedule",ERR_DEBUG,"scheduleoneshot: (%ld, %x, %x) = %x",when, (unsigned int)callback, (unsigned int)arg, (unsigned int)sp);
#endif
return (void *)sp;
* pass it in here for an O(1) *cough* O(lg n) delete */
#ifdef SCHEDDEBUG
- Error("schedule",ERR_DEBUG,"deleteschedule(%x,%x,%x)",sch,callback, arg);
+ Error("schedule",ERR_DEBUG,"deleteschedule(%x,%x,%x)",(unsigned int)sch,(unsigned int)callback, (unsigned int)arg);
#endif
if (sch) {
break;
}
#ifdef SCHEDDEBUG
- Error("schedule",ERR_DEBUG,"exec schedule:(%x, %x, %x)", sp, sc, arg);
+ Error("schedule",ERR_DEBUG,"exec schedule:(%x, %x, %x)", (unsigned int)sp, (unsigned int)sc, (unsigned int)arg);
#endif
(sc)(arg);
#ifdef SCHEDDEBUG