|
|
@ -4,10 +4,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
unsigned long scan_to_sa(unsigned long (*func)(const char*,char*,unsigned long*),
|
|
|
|
unsigned long scan_to_sa(unsigned long (*func)(const char*,char*,unsigned long*),
|
|
|
|
const char* src,stralloc* sa) {
|
|
|
|
const char* src,stralloc* sa) {
|
|
|
|
unsigned long scanned;
|
|
|
|
unsigned long written;
|
|
|
|
unsigned long r;
|
|
|
|
unsigned long r;
|
|
|
|
if (!stralloc_readyplus(sa,str_len(src))) return 0;
|
|
|
|
if (!stralloc_readyplus(sa,str_len(src))) return 0;
|
|
|
|
if ((r=func(src,sa->s+sa->len,&scanned)))
|
|
|
|
if ((r=func(src,sa->s+sa->len,&written)))
|
|
|
|
sa->len+=r;
|
|
|
|
sa->len+=written;
|
|
|
|
return r;
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
}
|
|
|
|