10unsigned int fmt_str(
char *s,
const char *t)
15 if (s) {
while ((ch = t[len])) s[len++] = ch; }
16 else while (t[len]) len++;
20unsigned int fmt_strn(
char *s,
const char *t,
unsigned int n)
25 if (s) {
while (n-- && (ch = t[len])) s[len++] = ch; }
26 else while (n-- && t[len]) len++;
32 unsigned long l; l = u;
return fmt_ulong(s,l);
35unsigned int fmt_uint0(
char *s,
unsigned int u,
unsigned int n)
39 while (len < n) {
if (s) *s++ =
'0'; ++len; }
49 while (q > 9) { ++len; q /= 10; }
52 do { *--s =
'0' + (u % 10); u /= 10; }
while(u);
62 while (q > 15) { ++len; q /= 16; }
65 do { *--s =
tohex(u % 16); u /= 16; }
while(u);
74 return num - 10 +
'a';
80 if (c >=
'0' && c <=
'9')
82 else if (c >=
'A' && c <=
'F')
84 else if (c >=
'a' && c <=
'f')
unsigned int fmt_uint(char *s, unsigned int u)
unsigned int fmt_uint0(char *s, unsigned int u, unsigned int n)
unsigned int fmt_ulong(char *s, unsigned long u)
unsigned int fmt_str(char *s, const char *t)
int fromhex(unsigned char c)
unsigned int fmt_xlong(char *s, unsigned long u)
unsigned int fmt_strn(char *s, const char *t, unsigned int n)
conversion function declarations