#include "pakfire.h"
#include "parser.h"
-static ParserObject* Parser_new_core(PyTypeObject* type, PakfireParser parser) {
+static ParserObject* Parser_new_core(PyTypeObject* type, struct pakfire_parser* parser) {
ParserObject* self = (ParserObject *)type->tp_alloc(type, 0);
if (self) {
self->parser = pakfire_parser_ref(parser);
return self;
}
-PyObject* new_parser(PakfireParser parser) {
+PyObject* new_parser(struct pakfire_parser* parser) {
ParserObject* p = Parser_new_core(&ParserType, parser);
return (PyObject*)p;
typedef struct {
PyObject_HEAD
- PakfireParser parser;
+ struct pakfire_parser* parser;
} ParserObject;
extern PyTypeObject ParserType;
-PyObject* new_parser(PakfireParser parser);
+PyObject* new_parser(struct pakfire_parser* parser);
#endif /* PYTHON_PAKFIRE_PARSER_H */
// metadata
unsigned int format;
- PakfireParser parser;
+ struct pakfire_parser* parser;
PakfireFilelist filelist;
return 0;
}
-static int pakfire_build_package_add_files(Pakfire pakfire, PakfireParser makefile,
+static int pakfire_build_package_add_files(Pakfire pakfire, struct pakfire_parser* makefile,
const char* buildroot, const char* namespace, struct pakfire_package* pkg,
struct pakfire_packager* packager) {
PakfireFilelist filelist = NULL;
return r;
}
-static int pakfire_build_package_add_scriptlets(Pakfire pakfire, PakfireParser makefile,
+static int pakfire_build_package_add_scriptlets(Pakfire pakfire, struct pakfire_parser* makefile,
const char* namespace, struct pakfire_package* pkg, struct pakfire_packager* packager) {
char name[NAME_MAX];
int r;
return 0;
}
-static int pakfire_build_package(Pakfire pakfire, PakfireParser makefile,
+static int pakfire_build_package(Pakfire pakfire, struct pakfire_parser* makefile,
const char* id, const char* buildroot, const char* namespace, const char* target) {
struct pakfire_repo* repo = NULL;
struct pakfire_package* pkg = NULL;
return r;
}
-static int pakfire_build_packages(Pakfire pakfire, PakfireParser makefile,
+static int pakfire_build_packages(Pakfire pakfire, struct pakfire_parser* makefile,
const char* id, const char* buildroot, const char* target) {
DEBUG(pakfire, "Creating packages...");
int r = 1;
return r;
}
-static int pakfire_build_stage(Pakfire pakfire, PakfireParser makefile, const char* stage,
+static int pakfire_build_stage(Pakfire pakfire, struct pakfire_parser* makefile, const char* stage,
pakfire_execute_logging_callback logging_callback, void* data) {
char template[1024];
static int pakfire_build_makefile(Pakfire pakfire, const char* path, const char* target,
const char* id, int flags, pakfire_execute_logging_callback logging_callback, void* data) {
- PakfireParser makefile = NULL;
+ struct pakfire_parser* makefile = NULL;
char buildroot[PATH_MAX];
struct pakfire_parser_error* error = NULL;
int r = 1;
#define PAKFIRE_MACROS_GLOB_PATTERN PAKFIRE_MACROS_DIR "/*.macro"
static int pakfire_makefile_set_defaults(Pakfire pakfire,
- PakfireParser parser, const char* path) {
+ struct pakfire_parser* parser, const char* path) {
char buffer[1024];
int r;
return 0;
}
-int pakfire_read_makefile(PakfireParser* parser, Pakfire pakfire,
+int pakfire_read_makefile(struct pakfire_parser** parser, Pakfire pakfire,
const char* path, struct pakfire_parser_error** error) {
int r = 1;
}
static int pakfire_dist_create_downloader_and_mirrorlist(
- Pakfire pakfire, PakfireParser makefile,
+ Pakfire pakfire, struct pakfire_parser* makefile,
struct pakfire_downloader** downloader, struct pakfire_mirrorlist** mirrorlist) {
// Create the downloader
int r = pakfire_downloader_create(downloader, pakfire);
}
static int pakfire_dist_add_sources(Pakfire pakfire, struct pakfire_packager* packager,
- struct pakfire_package* pkg, PakfireParser makefile) {
+ struct pakfire_package* pkg, struct pakfire_parser* makefile) {
// Fetch sources
char** sources = pakfire_parser_get_split(makefile, NULL, "sources", ' ');
}
PAKFIRE_EXPORT int pakfire_dist(Pakfire pakfire, const char* path, const char* target) {
- PakfireParser makefile;
+ struct pakfire_parser* makefile;
struct pakfire_parser_error* error = NULL;
struct pakfire_packager* packager = NULL;
#include <pakfire/parser.h>
-int pakfire_read_makefile(PakfireParser* parser, Pakfire pakfire,
+int pakfire_read_makefile(struct pakfire_parser** parser, Pakfire pakfire,
const char* path, struct pakfire_parser_error** error);
#endif
#include <stdio.h>
+struct pakfire_parser;
+
#include <pakfire/package.h>
+#include <pakfire/parser.h>
#include <pakfire/repo.h>
#include <pakfire/types.h>
struct pakfire_parser_error;
-PakfireParser pakfire_parser_create(Pakfire pakfire, PakfireParser parser,
+struct pakfire_parser* pakfire_parser_create(Pakfire pakfire, struct pakfire_parser* parser,
const char* namespace, int flags);
-PakfireParser pakfire_parser_create_child(PakfireParser parser,
+struct pakfire_parser* pakfire_parser_create_child(struct pakfire_parser* parser,
const char* namespace);
-PakfireParser pakfire_parser_ref(PakfireParser parser);
-PakfireParser pakfire_parser_unref(PakfireParser parser);
-PakfireParser pakfire_parser_get_parent(PakfireParser parser);
+struct pakfire_parser* pakfire_parser_ref(struct pakfire_parser* parser);
+struct pakfire_parser* pakfire_parser_unref(struct pakfire_parser* parser);
+struct pakfire_parser* pakfire_parser_get_parent(struct pakfire_parser* parser);
-int pakfire_parser_set(PakfireParser parser,
+int pakfire_parser_set(struct pakfire_parser* parser,
const char* namespace, const char* name, const char* value, int flags);
-int pakfire_parser_append(PakfireParser parser,
+int pakfire_parser_append(struct pakfire_parser* parser,
const char* namespace, const char* name, const char* value);
-char* pakfire_parser_expand(PakfireParser parser, const char* namespace, const char* value);
-char* pakfire_parser_get(PakfireParser parser, const char* namespace, const char* name);
-char** pakfire_parser_get_split(PakfireParser parser,
+char* pakfire_parser_expand(struct pakfire_parser* parser, const char* namespace, const char* value);
+char* pakfire_parser_get(struct pakfire_parser* parser, const char* namespace, const char* name);
+char** pakfire_parser_get_split(struct pakfire_parser* parser,
const char* namespace, const char* name, char delim);
-char** pakfire_parser_list_namespaces(PakfireParser parser, const char* filter);
+char** pakfire_parser_list_namespaces(struct pakfire_parser* parser, const char* filter);
-int pakfire_parser_merge(PakfireParser parser1, PakfireParser parser2);
+int pakfire_parser_merge(struct pakfire_parser* parser1, struct pakfire_parser* parser2);
-int pakfire_parser_read(PakfireParser parser, FILE* f, struct pakfire_parser_error** error);
-int pakfire_parser_read_file(PakfireParser parser, const char* path,
+int pakfire_parser_read(struct pakfire_parser* parser, FILE* f, struct pakfire_parser_error** error);
+int pakfire_parser_read_file(struct pakfire_parser* parser, const char* path,
struct pakfire_parser_error** error);
-int pakfire_parser_parse(PakfireParser parser, const char* data, size_t size,
+int pakfire_parser_parse(struct pakfire_parser* parser, const char* data, size_t size,
struct pakfire_parser_error** error);
-char* pakfire_parser_dump(PakfireParser parser);
+char* pakfire_parser_dump(struct pakfire_parser* parser);
-const char* pakfire_parser_get_namespace(PakfireParser parser);
-int pakfire_parser_set_namespace(PakfireParser parser, const char* namespace);
+const char* pakfire_parser_get_namespace(struct pakfire_parser* parser);
+int pakfire_parser_set_namespace(struct pakfire_parser* parser, const char* namespace);
-int pakfire_parser_create_package(PakfireParser parser,
+int pakfire_parser_create_package(struct pakfire_parser* parser,
struct pakfire_package** pkg, struct pakfire_repo* repo, const char* namespace, const char* default_arch);
// Errors
int pakfire_parser_error_create(struct pakfire_parser_error** error,
- PakfireParser parser, const char* filename, int line, const char* message);
+ struct pakfire_parser* parser, const char* filename, int line, const char* message);
struct pakfire_parser_error* pakfire_parser_error_ref(struct pakfire_parser_error* error);
struct pakfire_parser_error* pakfire_parser_error_unref(struct pakfire_parser_error* error);
#include <linux/limits.h>
-Pakfire pakfire_parser_get_pakfire(PakfireParser parser);
+Pakfire pakfire_parser_get_pakfire(struct pakfire_parser* parser);
struct pakfire_parser_declaration {
char namespace[NAME_MAX];
};
int pakfire_parser_apply_declaration(
- PakfireParser parser, struct pakfire_parser_declaration* declaration);
+ struct pakfire_parser* parser, struct pakfire_parser_declaration* declaration);
-int pakfire_parser_parse_data(PakfireParser parent, const char* data, size_t len,
+int pakfire_parser_parse_data(struct pakfire_parser* parent, const char* data, size_t len,
struct pakfire_parser_error** error);
-char** pakfire_parser_make_environ(PakfireParser parser);
+char** pakfire_parser_make_environ(struct pakfire_parser* parser);
#endif /* PAKFIRE_PRIVATE */
typedef struct _PakfireArchiveSignature* PakfireArchiveSignature;
typedef struct _PakfireFilelist* PakfireFilelist;
typedef struct _PakfireKey* PakfireKey;
-typedef struct _PakfireParser* PakfireParser;
typedef struct _PakfireSolution* PakfireSolution;
#endif /* PAKFIRE_TYPES_H */
#include <pakfire/private.h>
#include <pakfire/util.h>
-struct _PakfireParser {
+struct pakfire_parser {
Pakfire pakfire;
- struct _PakfireParser* parent;
int nrefs;
+ struct pakfire_parser* parent;
int flags;
char* namespace;
pcre2_code* regex_variable;
};
-static int pakfire_parser_compile_regex(PakfireParser parser, pcre2_code** regex,
+static int pakfire_parser_compile_regex(struct pakfire_parser* parser, pcre2_code** regex,
const char* pattern) {
int pcre2_errno;
size_t pcre2_offset;
return 0;
}
-static int pakfire_parser_compile_regexes(PakfireParser parser) {
+static int pakfire_parser_compile_regexes(struct pakfire_parser* parser) {
int r;
// Commands
return 0;
}
-PAKFIRE_EXPORT PakfireParser pakfire_parser_create(Pakfire pakfire,
- PakfireParser parent, const char* namespace, int flags) {
- PakfireParser parser = calloc(1, sizeof(*parser));
+PAKFIRE_EXPORT struct pakfire_parser* pakfire_parser_create(Pakfire pakfire,
+ struct pakfire_parser* parent, const char* namespace, int flags) {
+ struct pakfire_parser* parser = calloc(1, sizeof(*parser));
if (parser) {
parser->pakfire = pakfire_ref(pakfire);
parser->nrefs = 1;
return parser;
}
-PAKFIRE_EXPORT PakfireParser pakfire_parser_create_child(PakfireParser parser, const char* namespace) {
+PAKFIRE_EXPORT struct pakfire_parser* pakfire_parser_create_child(struct pakfire_parser* parser, const char* namespace) {
return pakfire_parser_create(parser->pakfire, parser, namespace, parser->flags);
}
-PAKFIRE_EXPORT PakfireParser pakfire_parser_ref(PakfireParser parser) {
+PAKFIRE_EXPORT struct pakfire_parser* pakfire_parser_ref(struct pakfire_parser* parser) {
++parser->nrefs;
return parser;
}
-Pakfire pakfire_parser_get_pakfire(PakfireParser parser) {
+Pakfire pakfire_parser_get_pakfire(struct pakfire_parser* parser) {
return pakfire_ref(parser->pakfire);
}
-static void pakfire_parser_free_declarations(PakfireParser parser) {
+static void pakfire_parser_free_declarations(struct pakfire_parser* parser) {
if (!parser->declarations)
return;
free(parser->declarations);
}
-static void pakfire_parser_free(PakfireParser parser) {
+static void pakfire_parser_free(struct pakfire_parser* parser) {
// Release regular expressions
if (parser->regex_variable)
pcre2_code_free(parser->regex_variable);
free(parser);
}
-PAKFIRE_EXPORT PakfireParser pakfire_parser_unref(PakfireParser parser) {
+PAKFIRE_EXPORT struct pakfire_parser* pakfire_parser_unref(struct pakfire_parser* parser) {
if (--parser->nrefs > 0)
return parser;
return NULL;
}
-PAKFIRE_EXPORT PakfireParser pakfire_parser_get_parent(PakfireParser parser) {
+PAKFIRE_EXPORT struct pakfire_parser* pakfire_parser_get_parent(struct pakfire_parser* parser) {
if (parser->parent)
return pakfire_parser_ref(parser->parent);
}
static struct pakfire_parser_declaration* pakfire_parser_get_declaration(
- PakfireParser parser, const char* namespace, const char* name) {
+ struct pakfire_parser* parser, const char* namespace, const char* name) {
if (!name) {
errno = EINVAL;
return NULL;
}
static struct pakfire_parser_declaration* pakfire_parser_get_declaration_recursive(
- PakfireParser parser, const char* namespace, const char* name) {
+ struct pakfire_parser* parser, const char* namespace, const char* name) {
struct pakfire_parser_declaration* d = pakfire_parser_get_declaration(
parser, namespace, name);
if (d)
}
static struct pakfire_parser_declaration* pakfire_parser_find_declaration(
- PakfireParser parser, const char* namespace, const char* name) {
+ struct pakfire_parser* parser, const char* namespace, const char* name) {
struct pakfire_parser_declaration* d;
char* n = NULL;
return NULL;
}
-PAKFIRE_EXPORT int pakfire_parser_set(PakfireParser parser,
+PAKFIRE_EXPORT int pakfire_parser_set(struct pakfire_parser* parser,
const char* namespace, const char* name, const char* value, int flags) {
if (!name)
return -EINVAL;
return 0;
}
-int pakfire_parser_apply_declaration(PakfireParser parser,
+int pakfire_parser_apply_declaration(struct pakfire_parser* parser,
struct pakfire_parser_declaration* declaration) {
if (declaration->flags & PAKFIRE_PARSER_DECLARATION_APPEND)
return pakfire_parser_append(parser, declaration->namespace, declaration->name, declaration->value);
declaration->name, declaration->value, declaration->flags);
}
-static const char* pakfire_parser_find_template(PakfireParser parser,
+static const char* pakfire_parser_find_template(struct pakfire_parser* parser,
char* template, size_t size, const char* namespace) {
DEBUG(parser->pakfire, "Looking up template in namespace '%s'\n", namespace);
return template;
}
-static const char* pakfire_parser_get_raw(PakfireParser parser, const char* namespace, const char* name) {
+static const char* pakfire_parser_get_raw(struct pakfire_parser* parser, const char* namespace, const char* name) {
struct pakfire_parser_declaration* d = NULL;
// First, perform a simple lookup
return NULL;
}
-PAKFIRE_EXPORT int pakfire_parser_append(PakfireParser parser,
+PAKFIRE_EXPORT int pakfire_parser_append(struct pakfire_parser* parser,
const char* namespace, const char* name, const char* value) {
char* buffer = NULL;
return r;
}
-static int pakfire_parser_expand_commands(PakfireParser parser, char** buffer) {
+static int pakfire_parser_expand_commands(struct pakfire_parser* parser, char** buffer) {
int r = 0;
PCRE2_UCHAR* command = NULL;
PCRE2_SIZE command_length;
return r;
}
-static int pakfire_parser_expand_variables(PakfireParser parser,
+static int pakfire_parser_expand_variables(struct pakfire_parser* parser,
const char* namespace, char** buffer) {
int r = 0;
PCRE2_UCHAR* variable = NULL;
return r;
}
-PAKFIRE_EXPORT char* pakfire_parser_expand(PakfireParser parser,
+PAKFIRE_EXPORT char* pakfire_parser_expand(struct pakfire_parser* parser,
const char* namespace, const char* value) {
// Return NULL when the value is NULL
if (!value)
return NULL;
}
-PAKFIRE_EXPORT char* pakfire_parser_get(PakfireParser parser, const char* namespace, const char* name) {
+PAKFIRE_EXPORT char* pakfire_parser_get(struct pakfire_parser* parser, const char* namespace, const char* name) {
const char* value = pakfire_parser_get_raw(parser, namespace, name);
// Return NULL when nothing was found
return pakfire_parser_expand(parser, namespace, value);
}
-PAKFIRE_EXPORT char** pakfire_parser_get_split(PakfireParser parser,
+PAKFIRE_EXPORT char** pakfire_parser_get_split(struct pakfire_parser* parser,
const char* namespace, const char* name, char delim) {
char* value = pakfire_parser_get(parser, namespace, name);
if (!value)
return list;
}
-PAKFIRE_EXPORT char** pakfire_parser_list_namespaces(PakfireParser parser,
+PAKFIRE_EXPORT char** pakfire_parser_list_namespaces(struct pakfire_parser* parser,
const char* filter) {
char** namespaces = NULL;
unsigned int counter = 0;
return namespaces;
}
-PAKFIRE_EXPORT int pakfire_parser_merge(PakfireParser parser1, PakfireParser parser2) {
+PAKFIRE_EXPORT int pakfire_parser_merge(struct pakfire_parser* parser1, struct pakfire_parser* parser2) {
DEBUG(parser1->pakfire, "Merging parsers %p and %p\n", parser1, parser2);
char namespace[NAME_MAX*2+1];
return 0;
}
-PAKFIRE_EXPORT int pakfire_parser_read(PakfireParser parser, FILE* f,
+PAKFIRE_EXPORT int pakfire_parser_read(struct pakfire_parser* parser, FILE* f,
struct pakfire_parser_error** error) {
char* data;
size_t len;
return r;
}
-PAKFIRE_EXPORT int pakfire_parser_read_file(PakfireParser parser, const char* path,
+PAKFIRE_EXPORT int pakfire_parser_read_file(struct pakfire_parser* parser, const char* path,
struct pakfire_parser_error** error) {
FILE* f = fopen(path, "r");
if (!f)
return r;
}
-PAKFIRE_EXPORT int pakfire_parser_parse(PakfireParser parser,
+PAKFIRE_EXPORT int pakfire_parser_parse(struct pakfire_parser* parser,
const char* data, size_t size, struct pakfire_parser_error** error) {
return pakfire_parser_parse_data(parser, data, size, error);
}
-PAKFIRE_EXPORT char* pakfire_parser_dump(PakfireParser parser) {
+PAKFIRE_EXPORT char* pakfire_parser_dump(struct pakfire_parser* parser) {
char buffer[NAME_MAX*2 + 1];
char* s = NULL;
return s;
}
-PAKFIRE_EXPORT const char* pakfire_parser_get_namespace(PakfireParser parser) {
+PAKFIRE_EXPORT const char* pakfire_parser_get_namespace(struct pakfire_parser* parser) {
return parser->namespace;
}
-PAKFIRE_EXPORT int pakfire_parser_set_namespace(PakfireParser parser, const char* namespace) {
+PAKFIRE_EXPORT int pakfire_parser_set_namespace(struct pakfire_parser* parser, const char* namespace) {
if (parser->namespace)
free(parser->namespace);
return 0;
}
-char** pakfire_parser_make_environ(PakfireParser parser) {
+char** pakfire_parser_make_environ(struct pakfire_parser* parser) {
char** envp = NULL;
unsigned int num = 0;
return NULL;
}
-PAKFIRE_EXPORT int pakfire_parser_create_package(PakfireParser parser,
+PAKFIRE_EXPORT int pakfire_parser_create_package(struct pakfire_parser* parser,
struct pakfire_package** pkg, struct pakfire_repo* repo, const char* namespace, const char* default_arch) {
int r = 1;
// Error
struct pakfire_parser_error {
- PakfireParser parser;
+ struct pakfire_parser* parser;
int nrefs;
char* filename;
};
PAKFIRE_EXPORT int pakfire_parser_error_create(struct pakfire_parser_error** error,
- PakfireParser parser, const char* filename, int line, const char* message) {
+ struct pakfire_parser* parser, const char* filename, int line, const char* message) {
struct pakfire_parser_error* e = calloc(1, sizeof(*e));
if (!e)
return ENOMEM;
%parse-param
{yyscan_t* scanner}
{Pakfire pakfire}
- {PakfireParser* parser}
- {PakfireParser parent}
+ {struct pakfire_parser** parser}
+ {struct pakfire_parser* parent}
{struct pakfire_parser_error** error}
// Make the parser reentrant
OP_EQUALS = 0,
};
-static void yyerror(yyscan_t* scanner, Pakfire pakfire, PakfireParser* parser,
- PakfireParser parent, struct pakfire_parser_error** error, const char* s) {
+static void yyerror(yyscan_t* scanner, Pakfire pakfire, struct pakfire_parser** parser,
+ struct pakfire_parser* parent, struct pakfire_parser_error** error, const char* s) {
ERROR(pakfire, "Error (line %d): %s\n", num_lines, s);
// Create a new error object
}
}
-static PakfireParser make_if_stmt(Pakfire pakfire, const enum operator op,
- const char* val1, const char* val2, PakfireParser if_block, PakfireParser else_block);
+static struct pakfire_parser* make_if_stmt(Pakfire pakfire, const enum operator op,
+ const char* val1, const char* val2, struct pakfire_parser* if_block, struct pakfire_parser* else_block);
static int pakfire_parser_new_declaration(
struct pakfire_parser_declaration** declaration, const char* name, const char* value, int flags) {
%type <string> line
%union {
- PakfireParser parser;
+ struct pakfire_parser* parser;
char* string;
struct pakfire_parser_declaration* declaration;
}
block : T_INDENT grammar T_OUTDENT
{
// Reset the top parser
- PakfireParser p = pakfire_parser_get_parent(*parser);
+ struct pakfire_parser* p = pakfire_parser_get_parent(*parser);
pakfire_parser_unref(*parser);
*parser = p;
%%
-int pakfire_parser_parse_data(PakfireParser parent, const char* data, size_t len,
+int pakfire_parser_parse_data(struct pakfire_parser* parent, const char* data, size_t len,
struct pakfire_parser_error** error) {
Pakfire pakfire = pakfire_parser_get_pakfire(parent);
yyscan_t scanner;
yylex_init(&scanner);
// Create a new sub-parser
- PakfireParser parser = NULL;
+ struct pakfire_parser* parser = NULL;
num_lines = 1;
return r;
}
-static PakfireParser make_if_stmt(Pakfire pakfire, const enum operator op,
- const char* val1, const char* val2, PakfireParser if_block, PakfireParser else_block) {
+static struct pakfire_parser* make_if_stmt(Pakfire pakfire, const enum operator op,
+ const char* val1, const char* val2, struct pakfire_parser* if_block, struct pakfire_parser* else_block) {
switch (op) {
case OP_EQUALS:
DEBUG(pakfire, "Evaluating if statement: %s == %s?\n", val1, val2);
break;
}
- PakfireParser parent = pakfire_parser_get_parent(if_block);
+ struct pakfire_parser* parent = pakfire_parser_get_parent(if_block);
DEBUG(pakfire, " parent = %p, if = %p, else = %p\n", parent, if_block, else_block);
char* v1 = pakfire_parser_expand(parent, NULL, val1);
char* v2 = pakfire_parser_expand(parent, NULL, val2);
- PakfireParser result = NULL;
+ struct pakfire_parser* result = NULL;
switch (op) {
case OP_EQUALS:
NULL,
};
-static int load_macros(PakfireParser parser) {
+static int load_macros(struct pakfire_parser* parser) {
const char* macros = TEST_SRC_PATH "../macros/*.macro";
glob_t buffer;
FILE* f = fopen(path, "r");
ASSERT(f);
- PakfireParser parser = pakfire_parser_create(t->pakfire, NULL, NULL, 0);
+ struct pakfire_parser* parser = pakfire_parser_create(t->pakfire, NULL, NULL, 0);
r = pakfire_parser_read(parser, f, NULL);
ASSERT(r == 0);
}
static int test_macros(const struct test* t) {
- PakfireParser parser = pakfire_parser_create(t->pakfire, NULL, NULL, 0);
+ struct pakfire_parser* parser = pakfire_parser_create(t->pakfire, NULL, NULL, 0);
ASSERT(parser);
// Load 'em all
struct pakfire_repo* repo = pakfire_repo_create(t->pakfire, "test");
ASSERT(repo);
- PakfireParser parser = pakfire_parser_create(t->pakfire, NULL, NULL,
+ struct pakfire_parser* parser = pakfire_parser_create(t->pakfire, NULL, NULL,
PAKFIRE_PARSER_FLAGS_EXPAND_COMMANDS);
ASSERT(parser);
char* value = NULL;
// Create a new parser
- PakfireParser parser = pakfire_parser_create(t->pakfire, NULL, NULL, 0);
+ struct pakfire_parser* parser = pakfire_parser_create(t->pakfire, NULL, NULL, 0);
// Retrieve a value that does not exist
value = pakfire_parser_get(parser, NULL, "null");
ASSERT_STRING_EQUALS(value, "a b");
// Make a child parser
- PakfireParser subparser = pakfire_parser_create_child(parser, "child");
+ struct pakfire_parser* subparser = pakfire_parser_create_child(parser, "child");
ASSERT(subparser);
// Try to get a again
ASSERT(r >= 0);
// Create a new parser
- PakfireParser parser = pakfire_parser_create(t->pakfire, NULL, NULL, 0);
+ struct pakfire_parser* parser = pakfire_parser_create(t->pakfire, NULL, NULL, 0);
FILE* f = fopen(path, "r");
ASSERT(f);
static int test_parser_command(const struct test* t) {
const char* command = "%(echo \"ABC\")";
- PakfireParser parser = pakfire_parser_create(t->pakfire, NULL, NULL,
+ struct pakfire_parser* parser = pakfire_parser_create(t->pakfire, NULL, NULL,
PAKFIRE_PARSER_FLAGS_EXPAND_COMMANDS);
ASSERT(parser);