Line data Source code
1 : #include "context.h" 2 : #include "schema.h" 3 : 4 : #include <stdlib.h> 5 : #include <string.h> 6 : 7 : struct oid_context_t 8 : { 9 : oid_schema_t* schema; 10 : }; 11 : 12 2 : oid_context_t* oid_init_context(void) 13 : { 14 2 : oid_context_t* ctx = calloc(1, sizeof(oid_context_t)); 15 : 16 2 : if(!ctx) 17 : { 18 0 : return NULL; 19 : } 20 : 21 2 : ctx->schema = oid_init_schema(); 22 2 : if (!ctx->schema) 23 : { 24 0 : free(ctx); 25 0 : return NULL; 26 : } 27 : 28 2 : return ctx; 29 : } 30 : 31 2 : void oid_free_context(oid_context_t* ctx) 32 : { 33 2 : if (ctx) 34 : { 35 2 : oid_free_schema(ctx->schema); 36 2 : free(ctx); 37 : } 38 2 : }