22 #include <sys/types.h> 25 #include <netinet/in.h> 68 time_t starttime = time(0);
69 char *datestring = ctime(&starttime);
91 demo1->
name =
format (0,
"My name is Ishmael%c", 0);
104 demo1, sizeof (demo1));
109 demo2 = demo1->
demo2;
111 fformat (stdout,
"demo2 location: %llx\n", demo2);
127 demo1->
demo2 = demo2;
155 time_t starttime = time(0);
156 char *datestring = ctime(&starttime);
163 if (checkpoint == 0) {
169 demo1->
demo2 = demo2;
170 demo1->
name =
format (0,
"My name is Ishmael%c", 0);
181 checkpoint, sizeof (
u8));
194 demo2 = demo1->
demo2;
196 fformat (stdout,
"demo2 location: %llx\n", demo2);
204 int main (
int argc,
char **argv)
220 else if (
unformat (input,
"serialize"))
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
static void svm_pop_heap(void *oldheap)
void * svmdb_local_get_variable_reference(svmdb_client_t *client, svmdb_namespace_t namespace, char *var)
svmdb_client_t * svmdb_map_chroot_size(char *root_path, uword size)
void unserialize_demo1(serialize_main_t *sm, va_list *args)
clib_error_t * persist_malloc(persist_main_t *pm)
#define clib_error_report(e)
void svmdb_unmap(svmdb_client_t *client)
void unserialize_open_data(serialize_main_t *m, u8 *data, uword n_data_bytes)
static void * svm_push_data_heap(svm_region_t *rp)
void unserialize_cstring(serialize_main_t *m, char **s)
clib_error_t * serialize(serialize_main_t *m,...)
always_inline void * clib_mem_alloc(uword size)
void serialize_open_vector(serialize_main_t *m, u8 *vector)
#define vec_free(V)
Free vector's memory (no header).
void svmdb_local_set_vec_variable(svmdb_client_t *client, char *var, void *val_arg, u32 elsize)
clib_error_t * persist_serialize(persist_main_t *pm)
clib_error_t * unserialize(serialize_main_t *m,...)
void serialize_cstring(serialize_main_t *m, char *s)
void serialize_demo1(serialize_main_t *sm, va_list *args)
int main(int argc, char **argv)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
persist_main_t persist_main
void * svmdb_local_get_vec_variable(svmdb_client_t *client, char *var, u32 elsize)
void * serialize_close_vector(serialize_main_t *m)
#define clib_error_return(e, args...)
CLIB vectors are ubiquitous dynamically resized arrays with by user defined "headers".