#############################################################################*/
%{
-#include <stdio.h>
-#include <stdlib.h>
-
#include <pakfire/logging.h>
#include <pakfire/types.h>
extern int yylex();
extern int yyparse();
-void yyerror(const char* s);
extern int num_lines;
-
+static Pakfire pakfire;
+static void yyerror(const char* s);
%}
%token APPEND
%%
-int pakfire_parser_parse_metadata(Pakfire pakfire, const char* data, size_t len) {
+int pakfire_parser_parse_metadata(Pakfire _pakfire, const char* data, size_t len) {
+ pakfire = _pakfire;
+
DEBUG(pakfire, "Parsing the following data:\n%s\n", data);
num_lines = 1;
}
void yyerror(const char* s) {
- fprintf(stderr, "Error (line %d): %s\n", num_lines, s);
+ ERROR(pakfire, "Error (line %d): %s\n", num_lines, s);
}