3 #include <proto/exec.h>
8 #include <exec/rawfmt.h>
13 extern struct Library
*SysBase
;
16 STRPTR
strnew(APTR pool
, STRPTR original
)
19 STRPTR copy
, p
, s
= original
;
22 while (*original
++) l
++;
24 if (copy
= AllocVecPooled(pool
, l
))
33 copy
= AllocVecPooled(pool
, 1);
41 STRPTR
vfmtnew(APTR pool
, STRPTR fmt
, ...)
50 static UBYTE strng_tmp
[1024];
51 sprintf((STRPTR
)strng_tmp
, fmt
, args
);
53 l
= strlen(strng_tmp
);
57 __va_copy(copy
, args
);
59 VNewRawDoFmt(fmt
, (APTR(*)(APTR
, UBYTE
))RAWFMTFUNC_COUNT
, (STRPTR
)&l
, args
);
62 if (s
= AllocVecPooled(pool
, l
+ 1))
67 VNewRawDoFmt(fmt
, RAWFMTFUNC_STRING
, s
, copy
);
74 STRPTR
fmtnew(APTR pool
, STRPTR fmt
, ...)
80 s
= vfmtnew(pool
, fmt
, args
);