Apriltag WASM Detector
Apriltag detector using the apriltag C library and compiled to WASM using emscripten.
str_json.h
Go to the documentation of this file.
1 
8 #ifndef _STR_JSON_JS_
9 #define _STR_JSON_JS_
10 
11 #define STR_JSON_INITIALIZER { .len = 0, .str=NULL, .alloc_size=0 }
12 
17 typedef struct {
18  size_t len; // string length
19  char *str;
20  size_t alloc_size; // allocated size
21 } t_str_json;
22 
23 // json format string for errors
24 extern const char fmt_error[];
25 
26 // json format string for the detection corners
27 extern const char fmt_det_point[];
28 
29 // json format string for the detection with pose
30 extern const char fmt_det_point_pose[];
31 
42 int str_json_create ( t_str_json *str_json, size_t size_bytes );
43 
51 int str_json_destroy ( t_str_json *str_json );
52 
58 void str_json_clear ( t_str_json *str_json );
59 
72 size_t str_json_concat ( t_str_json *str_json_dest, const char *source_c_str );
73 
83 size_t str_json_printf ( t_str_json *str_json_dest, const char *format, ... );
84 
85 #endif
void str_json_clear(t_str_json *str_json)
Clear a string.
Definition: str_json.c:48
size_t str_json_printf(t_str_json *str_json_dest, const char *format,...)
Composes a string with the same text that would be printed if format was used on printf,.
Definition: str_json.c:74
size_t str_json_concat(t_str_json *str_json_dest, const char *source_c_str)
Copy the content of source_c_str to str_json_dest.
Definition: str_json.c:56
int str_json_destroy(t_str_json *str_json)
Free a string.
Definition: str_json.c:38
int str_json_create(t_str_json *str_json, size_t size_bytes)
Init a string.
Definition: str_json.c:24
Definition: str_json.h:17