Exemplo n.º 1
0
void _std sto_flush(void) {
   MTLOCK_THIS_FUNC _lk;

   int ii, cnt = 0;
   stoinit_entry *stl = sto_init();

   for (ii=0;ii<STO_BUF_LEN;ii++) {
      stoinit_entry *ste = stl+ii;
      if (ste->name[0]) {
         void *data = ste->isptr?(void*)ste->data:&ste->data;
         // log_printf("key %s(%d): %4lb\n", ste->name, ste->len, data);
         sto_save(ste->name, data, ste->len, !ste->isptr);
         ste->name[0] = 0;
         cnt++;
      }
   }
   log_printf("%d keys added\n", cnt);
}
Exemplo n.º 2
0
int atc_init(void)
{
	return sto_init(&sto_db, "Planes", sizeof(struct atc_plane));

}