Note * build_note_list_from_input(void) { /* build the note list, also create the note array, also set N_notes */ Event * e; Note * nl; e = build_event_list_and_beat_list_from_input(); if (e == NULL) { fprintf(stderr, "%s: No notes in the input.\n", this_program); my_exit(1); } build_beat_array(); global_DN_list = build_direct_note_list_from_event_list(e); compute_adjusted_direct_notes(); free_event_list(e); e = build_event_list_from_direct_notes(); nl = build_note_list_from_event_list(e); free_event_list(e); return nl; }
static void clean_up(void) { int i; free_event_list(); #ifndef DZEN_XFT if(dzen.font.set) XFreeFontSet(dzen.dpy, dzen.font.set); else XFreeFont(dzen.dpy, dzen.font.xfont); #endif XFreePixmap(dzen.dpy, dzen.title_win.drawable); if(dzen.slave_win.max_lines) { for(i=0; i < dzen.slave_win.max_lines; i++) { XFreePixmap(dzen.dpy, dzen.slave_win.drawable[i]); XDestroyWindow(dzen.dpy, dzen.slave_win.line[i]); } free(dzen.slave_win.line); XDestroyWindow(dzen.dpy, dzen.slave_win.win); } XFreeGC(dzen.dpy, dzen.gc); XFreeGC(dzen.dpy, dzen.rgc); XFreeGC(dzen.dpy, dzen.tgc); XDestroyWindow(dzen.dpy, dzen.title_win.win); XCloseDisplay(dzen.dpy); }
/** * @brief * dup_event_list() - evevnt_list copy constructor * * @param[in] oelist - event list to copy * @param[in] nsinfo - new universe * * @return duplicated event_list * */ event_list * dup_event_list(event_list *oelist, server_info *nsinfo) { event_list *nelist; if (oelist == NULL || nsinfo == NULL) return NULL; nelist = new_event_list(); if (nelist == NULL) return NULL; nelist->eol = oelist->eol; nelist->current_time = &nsinfo->server_time; if (oelist->events != NULL) { nelist->events = dup_timed_event_list(oelist->events, nsinfo); if (nelist->events == NULL) { free_event_list(nelist); return NULL; } } if (oelist->next_event != NULL) { nelist->next_event = find_timed_event(nelist->events, oelist->next_event->name, oelist->next_event->event_type, oelist->next_event->event_time); if (nelist->next_event == NULL) { schdlog(PBSEVENT_SCHED, PBS_EVENTCLASS_SCHED, LOG_WARNING, oelist->next_event->name, "can't find next event in duplicated list"); free_event_list(nelist); return NULL; } } return nelist; }