blob: 6ce7aaded5fd621fadef13880354798b6d70faca (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#ifndef KNOB_FORMAT_H
#define KNOB_FORMAT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <knob/heap.h>
#include <stdint.h>
#include <stdarg.h>
//allocates new memory
char *format_v(const char *fmt, va_list args);
//allocates new memory
char *format(const char *fmt, ...);
void syslogf_v(const char *fmt, va_list args);
void syslogf(const char *fmt, ...);
//reads a unsigned decimal terminated by either null or whitespace
//returns length of string plus length of whitespace
//returns 0 on failure
uint32_t try_swtou(const char *from, uint32_t *i_out);
//reads a hexadecimal terminated by either null or whitespace
//returns length of string plus length of whitespace
//returns 0 on failure
uint32_t try_swtoh(const char *from, uint32_t *i_out);
#ifdef __cplusplus
}
#endif
#endif
|