void ahelpkey() { int x,i,lgscr,page; byte ch; if (vstate(0)==4) smallscr(NO); if (equipment(0)==7) { page =0; smallscr(NO); } else { page =3; } vpage(page); crttim=0; lgscr = (tvmaxc==39) ? TRUE:FALSE; for (i=0; i<10; ++i) { helptop(page); for (x=0;;++x) { ch=*(helpkey[i]+x); if (ch==0) break; if (ch=='_') { if (lgscr) rprints(foreg,page,"\n \t \t "); else rputcinc(' ',0,foreg,NO,page); } else rputcinc(ch,0,foreg,NO,page); if ((ch==LF) && (lgscr)) putch(LF); /* 2nd LF */ } curset(23,5,page); if (i<9) { rprints(foreg,page,"Do you want the next page (Y/N) ? "); x=getyn(); if (x==NO) break; } else { rprints(foreg,page,"Hit any key to return "); getkey(); } } bright; /* Restore page 0 */ if (page==0) { if (SMALLMSK(maskp)) smallscr(NO); else largescr(NO); dspmsk(); } }
extern tcconf_section_t * tcconf_nextsection(tcconf_section_t *ts, char *name, void **state) { tcconf_section_t *ns; v_state *vs; conf_section *sec = NULL; if(!(vs = vstate(ts, name, state))) return NULL; while(vs->ml){ tcconf_section_t *s = tcconf_nextsection(vs->sec, vs->n, &vs->vsr); if(!vs->vsr){ tcconf_section_t *ms = next_merge(vs->ts, vs); tcfree(vs->sec); if(ms){ vs->sec = ms; } else { vs->sec = vs->ts; } } if(s){ sec = s->sec; tcfree(s); break; } } if(!sec){ tcc_entry *te = tclist_prev_matched(vs->sec->sec->entries, &vs->li, vs->n, cmp_str_sec); if(!te){ *state = NULL; vsfree(vs); return NULL; } sec = te->section; } ns = tcallocd(sizeof(*ns), NULL, tcconf_free); ns->sec = tcref(sec); ns->parent = tcref(ts); return ns; }
static int tcconf_nextvalue_vc(tcconf_section_t *ts, char *name, void **state, char **rname, char *fmt, va_list args, tccompare_fn cmp) { v_state *vs; tcc_entry *te; int n = 0; if(!(vs = vstate(ts, name, state))) return -1; while(vs->ml){ n = tcconf_nextvalue_vc(vs->sec, vs->n, &vs->vsr, rname, fmt, args, cmp); if(!vs->vsr){ tcconf_section_t *ms = next_merge(vs->ts, vs); tcfree(vs->sec); if(ms){ vs->sec = ms; } else { vs->sec = vs->ts; } } if(n > 0){ return n; } } te = tclist_prev_matched(vs->sec->sec->entries, &vs->li, vs->n, cmp); if(te){ n = getentry(vs->sec, te, fmt, args, NULL); if(rname) *rname = te->value.key; } else { *state = NULL; vsfree(vs); } return n < 0? -n: n; }