summaryrefslogtreecommitdiff
path: root/src/glsl/apps/version.c
diff options
context:
space:
mode:
authorMichal Krol <michal@vmware.com>2009-09-18 11:20:42 +0200
committerMichal Krol <michal@vmware.com>2009-09-18 11:20:42 +0200
commit5f9f30a75268bf6803627930ce982aede2c870f5 (patch)
tree66e2c8f095a4d6232df9adebf3924d4f4888f56a /src/glsl/apps/version.c
parent8302208b02739904cfeb5bcc22e63b15c8ec26e9 (diff)
glsl/apps: Use glsl pp public interface.
Diffstat (limited to 'src/glsl/apps/version.c')
-rw-r--r--src/glsl/apps/version.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/glsl/apps/version.c b/src/glsl/apps/version.c
index 50c564b470..f259431992 100644
--- a/src/glsl/apps/version.c
+++ b/src/glsl/apps/version.c
@@ -28,8 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
-#include "../pp/sl_pp_purify.h"
-#include "../pp/sl_pp_version.h"
+#include "../pp/sl_pp_public.h"
int
@@ -41,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;
unsigned int version;
unsigned int tokens_eaten;
@@ -99,7 +98,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 +107,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;
@@ -118,16 +118,16 @@ main(int argc,
free(outbuf);
- if (sl_pp_version(&context, tokens, &version, &tokens_eaten)) {
- fprintf(out, "$ERROR: `%s'\n", context.error_msg);
+ if (sl_pp_version(context, tokens, &version, &tokens_eaten)) {
+ fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context));
- sl_pp_context_destroy(&context);
+ sl_pp_context_destroy(context);
free(tokens);
fclose(out);
return -1;
}
- sl_pp_context_destroy(&context);
+ sl_pp_context_destroy(context);
free(tokens);
fprintf(out,