You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
392 B
C
13 lines
392 B
C
21 years ago
|
#include "str.h"
|
||
|
#include "array.h"
|
||
|
#include "textcode.h"
|
||
|
|
||
|
unsigned long scan_to_array(unsigned long (*func)(const char*,char*,unsigned long*),
|
||
|
const char* src,array* dest) {
|
||
|
unsigned long scanned;
|
||
|
unsigned long needed=str_len(src);
|
||
|
char* x=array_start(dest)+array_bytes(dest);
|
||
|
if (!array_allocate(dest,1,array_bytes(dest)+needed-1)) return 0;
|
||
|
return func(src,x,&scanned);
|
||
|
}
|