Experimental C Library

Partly as a first step towards an ORM for C, and partly to explore some other C-related issues, I have started a small library The documentation is generated by a branched docco and the source is freely available (see ISTI licence info at top of page).

Something that might be of interest is the idea of namespaces in C. For example, I have code like:

ISTI_MEM_AS(mem)
ISTI_STR_AS(str)
...
int isti_sql_free(isti_sql *q, int previous) {
  STATUS;
  CHECK(str.free(q->template, status));
  CHECK(mem.free(q->values, &q->n_values, status));
  free(q);
  EXIT_PREVIOUS;
}

note the str.free and mem.free calls.


Related Posts

blog comments powered by