Rune* runestrcat(Rune *s1, const Rune *s2) { runestrcpy((Rune*)runestrchr(s1, 0), s2); return s1; }
Rune* runestrcat(Rune *s1, Rune *s2) { runestrcpy(runestrchr(s1, 0), s2); return s1; }
Rune* runestrdup(Rune *s) { Rune *ns; ns = malloc(sizeof(Rune)*(runestrlen(s) + 1)); if(ns == 0) return 0; setmalloctag(ns, getcallerpc(&s)); return runestrcpy(ns, s); }
Rune* runestrdup(Rune *s) { Rune *ns; ns = malloc(sizeof(Rune)*(runestrlen(s) + 1)); if(ns == 0) return 0; return runestrcpy(ns, s); }
int dv(int d) { Rune sub[6]; d += getnr(L(".dv")); nr(L(".dv"), d); runestrcpy(sub, L("<sub>")); sub[0] = Ult; sub[4] = Ugt; if(d < 0){ sub[3] = 'p'; ihtml(L(".dv"), sub); }else if(d > 0) ihtml(L(".dv"), sub); else ihtml(L(".dv"), nil); return 0; }
/* .di, .da */ void r_di(int argc, Rune **argv) { br(); if(argc > 2) warn("extra arguments to %C%S", dot, argv[0]); if(argc == 1){ /* end diversion */ if(ndi <= 0){ /* warn("unmatched %C%S", dot, argv[0]); */ return; } flushdi(); if(--ndi == 0){ _nr(L(".z"), nil); outcb = nil; }else{ _nr(L(".z"), di[ndi-1]); runefmtstrinit(&difmt); fmtrune(&difmt, Uformatted); difmtinit = 1; } return; } /* start diversion */ /* various register state should be saved, but it's all useless to us */ flushdi(); if(ndi >= nelem(di)) sysfatal("%Cdi overflow", dot); if(argv[0][1] == 'i') ds(argv[1], nil); _nr(L(".z"), argv[1]); runestrcpy(di[ndi++], argv[1]); runefmtstrinit(&difmt); fmtrune(&difmt, Uformatted); difmtinit = 1; outcb = outdi; }