From: Matthias Braun Date: Thu, 5 Jul 2012 15:57:27 +0000 (+0200) Subject: make pp_token emit API public X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=d8af9e5135caeadbafa107995acef9e792485d41;p=cparser make pp_token emit API public --- diff --git a/preprocessor.c b/preprocessor.c index 728775e..a229bc8 100644 --- a/preprocessor.c +++ b/preprocessor.c @@ -1410,7 +1410,19 @@ static bool emit_newlines(void) return true; } -static void emit_pp_token(void) +void set_preprocessor_output(FILE *output) +{ + out = output; + if (out != NULL) { + error_on_unknown_chars = false; + resolve_escape_sequences = false; + } else { + error_on_unknown_chars = true; + resolve_escape_sequences = true; + } +} + +void emit_pp_token(void) { if (!emit_newlines() && (info.had_whitespace || tokens_would_paste(last_token, pp_token.kind))) @@ -1856,7 +1868,7 @@ static void pop_conditional(void) conditional_stack = conditional_stack->parent; } -static void check_unclosed_conditionals(void) +void check_unclosed_conditionals(void) { while (conditional_stack != NULL) { pp_conditional_t *conditional = conditional_stack; diff --git a/preprocessor.h b/preprocessor.h index ce4002f..74e9794 100644 --- a/preprocessor.h +++ b/preprocessor.h @@ -19,4 +19,8 @@ string_t make_string(char const *string); extern bool allow_dollar_in_symbol; extern token_t pp_token; +void set_preprocessor_output(FILE *output); +void emit_pp_token(void); +void check_unclosed_conditionals(void); + #endif