+ struct sl_pp_context *context;
+
+ context = calloc(1, sizeof(struct sl_pp_context));
+ if (!context) {
+ return NULL;
+ }
+
+ if (sl_pp_dict_init(context)) {
+ sl_pp_context_destroy(context);
+ return NULL;
+ }
+
+ context->getc_buf_capacity = 64;
+ context->getc_buf = malloc(context->getc_buf_capacity * sizeof(char));
+ if (!context->getc_buf) {
+ sl_pp_context_destroy(context);
+ return NULL;
+ }
+
+ if (sl_pp_token_buffer_init(&context->tokens, context)) {
+ sl_pp_context_destroy(context);
+ return NULL;
+ }
+
+ context->macro_tail = &context->macro;
+ context->if_ptr = SL_PP_MAX_IF_NESTING;
+ context->if_value = 1;
+ memset(context->error_msg, 0, sizeof(context->error_msg));
+ context->error_line = 1;
+ context->line = 1;
+ context->file = 0;
+
+ sl_pp_purify_state_init(&context->pure, input, options);
+
+ memset(&context->process_state, 0, sizeof(context->process_state));
+
+ return context;