static void set_prop(void* o, const char* name) {
int r = rand();
sp_setstring(o, name, &r, sizeof(r));
}
void *o = sp_document(db);
int size;
set_prop(o, "key");
printf("key == %i\r\n", *(int*)sp_getstring(o, "key", &size));
set_prop(o, "value");
printf("value == %i\r\n", *(int*)sp_getstring(o, "value", &size));
printf("key == %i\r\n", *(int*)sp_getstring(o, "key", &size)); //key is now actually not what it used to be
Output:
key == 1804289383
value == 846930886
key == 846930886