diff options
Diffstat (limited to 'src/glsl/apps/tokenise.c')
-rw-r--r-- | src/glsl/apps/tokenise.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/glsl/apps/tokenise.c b/src/glsl/apps/tokenise.c index 1746e20c13b..2b3ebcf283d 100644 --- a/src/glsl/apps/tokenise.c +++ b/src/glsl/apps/tokenise.c @@ -28,9 +28,7 @@ #include <stdio.h> #include <stdlib.h> #include <assert.h> -#include "../pp/sl_pp_context.h" -#include "../pp/sl_pp_purify.h" -#include "../pp/sl_pp_token.h" +#include "../pp/sl_pp_public.h" int @@ -42,7 +40,7 @@ main(int argc, char *inbuf; struct sl_pp_purify_options options; char *outbuf; - struct sl_pp_context context; + struct sl_pp_context *context; struct sl_pp_token_info *tokens; FILE *out; unsigned int i; @@ -99,7 +97,8 @@ main(int argc, free(inbuf); - if (sl_pp_context_init(&context)) { + context = sl_pp_context_create(); + if (!context) { fprintf(out, "$CONTEXERROR\n"); free(outbuf); @@ -107,10 +106,10 @@ main(int argc, return 1; } - if (sl_pp_tokenise(&context, outbuf, &tokens)) { - fprintf(out, "$ERROR: `%s'\n", context.error_msg); + if (sl_pp_tokenise(context, outbuf, &tokens)) { + fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); - sl_pp_context_destroy(&context); + sl_pp_context_destroy(context); free(outbuf); fclose(out); return 1; @@ -312,11 +311,11 @@ main(int argc, break; case SL_PP_IDENTIFIER: - fprintf(out, "%s ", sl_pp_context_cstr(&context, tokens[i].data.identifier)); + fprintf(out, "%s ", sl_pp_context_cstr(context, tokens[i].data.identifier)); break; case SL_PP_NUMBER: - fprintf(out, "(%s) ", sl_pp_context_cstr(&context, tokens[i].data.number)); + fprintf(out, "(%s) ", sl_pp_context_cstr(context, tokens[i].data.number)); break; case SL_PP_OTHER: @@ -332,7 +331,7 @@ main(int argc, } } - sl_pp_context_destroy(&context); + sl_pp_context_destroy(context); free(tokens); fclose(out); |