#include <pakfire/package.h>
#include <pakfire/parser.h>
#include <pakfire/pakfire.h>
-#include <pakfire/private.h>
#include <pakfire/util.h>
struct pakfire_parser {
return 0;
}
-PAKFIRE_EXPORT struct pakfire_parser* pakfire_parser_create(Pakfire pakfire,
+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) {
return parser;
}
-PAKFIRE_EXPORT struct pakfire_parser* pakfire_parser_create_child(struct pakfire_parser* parser, const char* namespace) {
+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 struct pakfire_parser* pakfire_parser_ref(struct pakfire_parser* parser) {
+struct pakfire_parser* pakfire_parser_ref(struct pakfire_parser* parser) {
++parser->nrefs;
return parser;
free(parser);
}
-PAKFIRE_EXPORT struct pakfire_parser* pakfire_parser_unref(struct pakfire_parser* parser) {
+struct pakfire_parser* pakfire_parser_unref(struct pakfire_parser* parser) {
if (--parser->nrefs > 0)
return parser;
return NULL;
}
-PAKFIRE_EXPORT struct pakfire_parser* pakfire_parser_get_parent(struct pakfire_parser* parser) {
+struct pakfire_parser* pakfire_parser_get_parent(struct pakfire_parser* parser) {
if (parser->parent)
return pakfire_parser_ref(parser->parent);
return NULL;
}
-PAKFIRE_EXPORT int pakfire_parser_set(struct pakfire_parser* parser,
+int pakfire_parser_set(struct pakfire_parser* parser,
const char* namespace, const char* name, const char* value, int flags) {
if (!name)
return -EINVAL;
return NULL;
}
-PAKFIRE_EXPORT int pakfire_parser_append(struct pakfire_parser* parser,
+int pakfire_parser_append(struct pakfire_parser* parser,
const char* namespace, const char* name, const char* value) {
char* buffer = NULL;
return r;
}
-PAKFIRE_EXPORT char* pakfire_parser_expand(struct pakfire_parser* parser,
+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(struct pakfire_parser* parser, const char* namespace, const char* name) {
+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(struct pakfire_parser* parser,
+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(struct pakfire_parser* parser,
+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(struct pakfire_parser* parser1, struct pakfire_parser* parser2) {
+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(struct pakfire_parser* parser, FILE* f,
+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(struct pakfire_parser* parser, const char* path,
+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(struct pakfire_parser* parser,
+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(struct pakfire_parser* parser) {
+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(struct pakfire_parser* parser) {
+const char* pakfire_parser_get_namespace(struct pakfire_parser* parser) {
return parser->namespace;
}
-PAKFIRE_EXPORT int pakfire_parser_set_namespace(struct pakfire_parser* parser, const char* namespace) {
+int pakfire_parser_set_namespace(struct pakfire_parser* parser, const char* namespace) {
if (parser->namespace)
free(parser->namespace);
return NULL;
}
-PAKFIRE_EXPORT int pakfire_parser_create_package(struct pakfire_parser* 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) {
int r = 1;
char* message;
};
-PAKFIRE_EXPORT int pakfire_parser_error_create(struct pakfire_parser_error** error,
+int pakfire_parser_error_create(struct pakfire_parser_error** error,
struct pakfire_parser* parser, const char* filename, int line, const char* message) {
struct pakfire_parser_error* e = calloc(1, sizeof(*e));
if (!e)
return 0;
}
-PAKFIRE_EXPORT struct pakfire_parser_error* pakfire_parser_error_ref(
+struct pakfire_parser_error* pakfire_parser_error_ref(
struct pakfire_parser_error* error) {
++error->nrefs;
free(error);
}
-PAKFIRE_EXPORT struct pakfire_parser_error* pakfire_parser_error_unref(
+struct pakfire_parser_error* pakfire_parser_error_unref(
struct pakfire_parser_error* error) {
if (--error->nrefs > 0)
return error;
return NULL;
}
-PAKFIRE_EXPORT const char* pakfire_parser_error_get_filename(
+const char* pakfire_parser_error_get_filename(
struct pakfire_parser_error* error) {
return error->filename;
}
-PAKFIRE_EXPORT int pakfire_parser_error_get_line(struct pakfire_parser_error* error) {
+int pakfire_parser_error_get_line(struct pakfire_parser_error* error) {
return error->line;
}
-PAKFIRE_EXPORT const char* pakfire_parser_error_get_message(
+const char* pakfire_parser_error_get_message(
struct pakfire_parser_error* error) {
return error->message;
}