void system_event_handler(system_event_t events, uint32_t param, void* pointer) { if (events&firmware_update) { switch (param) { case firmware_update_begin: stats.total++; update_begin(); break; case firmware_update_complete: stats.success++; update_end(true); break; case firmware_update_failed: stats.fail++; update_end(false); break; } } }
static mk_compend(gk_string *Have, gk_string *Avoid, char *curstr, char *endtype) { char fname[BUFSIZ]; FILE * f; FILE * MorphFopen(); int i; char line[BUFSIZ]; char savestem[MAXWORDSIZE]; gk_string TmpHave; gk_string TmpAvoid; sprintf(line,"endtables/basics/%s.end", endtype ); if( ! (f=MorphFopen(line,"r")) ) { fprintf(stderr,"could not open [%s]\n", endtype ); return(-1); } while(fgets(line,sizeof line,f)) { char curendstr[MAXWORDSIZE]; strcpy(savestem,curstr); if( is_blank(line) ) continue; if( Is_comment(line) ) continue; TmpHave = * Have; TmpAvoid = * Avoid; nextkey(line,curendstr); update_end(&TmpHave,&TmpAvoid,savestem,curendstr,line); } fclose(f); }