10 erealloc(void *v, ulong n)
14 sysfatal("out of memory reallocating %lud", n);
15 setmalloctag(v, getcallerpc(&v));
26 sysfatal("out of memory allocating %lud", n);
28 setmalloctag(v, getcallerpc(&n));
43 setmalloctag(t, getcallerpc(&s));
48 estrdupn(char *s, int n)
59 setmalloctag(t, getcallerpc(&s));
69 if('A' <= *p && *p <= 'Z')
75 s_appendsub(String *s, char *p, int n, Sub *sub, int nsub)
84 for(i=0; i<nsub; i++){
85 if(sub[i].sub && (r = strstr(p, sub[i].match)) && r < q){
90 s = s_nappend(s, p, q-p);
93 s = s_append(s, sub[m].sub);
94 p += strlen(sub[m].match);
101 s_appendlist(String *s, ...)
107 while(x = va_arg(arg, char*))
114 opentemp(char *template)
119 p = estrdup(template);
123 if(access(p, 0) < 0 && (fd=create(p, ORDWR|ORCLOSE, 0444)) >= 0)