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;
return context->error_msg;
}
+void
+sl_pp_context_error_position(const struct sl_pp_context *context,
+ unsigned int *file,
+ unsigned int *line)
+{
+ if (file) {
+ *file = 0;
+ }
+ if (line) {
+ *line = context->error_line;
+ }
+}
+
int
sl_pp_context_add_predefined(struct sl_pp_context *context,
const char *name,
unsigned int if_value;
char error_msg[SL_PP_MAX_ERROR_MSG];
+ unsigned int error_line;
unsigned int line;
unsigned int file;
const char *
sl_pp_context_error_message(const struct sl_pp_context *context);
+void
+sl_pp_context_error_position(const struct sl_pp_context *context,
+ unsigned int *file,
+ unsigned int *line);
+
int
sl_pp_context_add_extension(struct sl_pp_context *context,
const char *name,
_pure_getc(struct sl_pp_context *context)
{
char c;
- unsigned int current_line;
if (context->getc_buf_size) {
return context->getc_buf[--context->getc_buf_size];
}
- if (sl_pp_purify_getc(&context->pure, &c, ¤t_line, context->error_msg, sizeof(context->error_msg)) == 0) {
+ if (sl_pp_purify_getc(&context->pure, &c, &context->error_line, context->error_msg, sizeof(context->error_msg)) == 0) {
return PURE_ERROR;
}
return c;