]> git.ipfire.org Git - pakfire.git/commitdiff
parser: Make the parser private
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 1 Jul 2021 11:54:28 +0000 (11:54 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 1 Jul 2021 11:54:28 +0000 (11:54 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/include/pakfire/parser.h
src/libpakfire/libpakfire.sym
src/libpakfire/parser.c

index 00fa7475062dc890d17f28c39e013c76e55b54a1..d33616659b8dc5900b6cb309c5b34423b560c41e 100644 (file)
@@ -21,6 +21,9 @@
 #ifndef PAKFIRE_PARSER_H
 #define PAKFIRE_PARSER_H
 
+#ifdef PAKFIRE_PRIVATE
+
+#include <linux/limits.h>
 #include <stdio.h>
 
 struct pakfire_parser;
@@ -81,10 +84,6 @@ const char* pakfire_parser_error_get_filename(struct pakfire_parser_error* error
 int pakfire_parser_error_get_line(struct pakfire_parser_error* error);
 const char* pakfire_parser_error_get_message(struct pakfire_parser_error* error);
 
-#ifdef PAKFIRE_PRIVATE
-
-#include <linux/limits.h>
-
 Pakfire pakfire_parser_get_pakfire(struct pakfire_parser* parser);
 
 struct pakfire_parser_declaration {
index b665c776f9dfdd9f6496cfbc053554a803828ca3..39ec9f29c0dff6bf4d72709c18492b08326c3b79 100644 (file)
@@ -209,35 +209,6 @@ global:
        pakfire_packagelist_sort;
        pakfire_packagelist_unref;
 
-       # parser
-       pakfire_parser_append;
-       pakfire_parser_create;
-       pakfire_parser_create_child;
-       pakfire_parser_create_package;
-       pakfire_parser_dump;
-       pakfire_parser_expand;
-       pakfire_parser_get;
-       pakfire_parser_get_namespace;
-       pakfire_parser_get_parent;
-       pakfire_parser_get_split;
-       pakfire_parser_list_namespaces;
-       pakfire_parser_merge;
-       pakfire_parser_parse;
-       pakfire_parser_read;
-       pakfire_parser_read_file;
-       pakfire_parser_ref;
-       pakfire_parser_set;
-       pakfire_parser_set_namespace;
-       pakfire_parser_unref;
-
-       # parser error
-       pakfire_parser_error_create;
-       pakfire_parser_error_get_filename;
-       pakfire_parser_error_get_line;
-       pakfire_parser_error_get_message;
-       pakfire_parser_error_ref;
-       pakfire_parser_error_unref;
-
        # problem
        pakfire_problem_get_solutions;
        pakfire_problem_ref;
index d261070dfbfedce6f1f84016ef20b7602743a478..15ab374915ada632f005f78ecdd48fb1a73f289d 100644 (file)
@@ -35,7 +35,6 @@
 #include <pakfire/package.h>
 #include <pakfire/parser.h>
 #include <pakfire/pakfire.h>
-#include <pakfire/private.h>
 #include <pakfire/util.h>
 
 struct pakfire_parser {
@@ -104,7 +103,7 @@ static int pakfire_parser_compile_regexes(struct pakfire_parser* 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) {
@@ -125,11 +124,11 @@ PAKFIRE_EXPORT struct pakfire_parser* pakfire_parser_create(Pakfire pakfire,
        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;
@@ -172,7 +171,7 @@ static void pakfire_parser_free(struct pakfire_parser* 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;
 
@@ -180,7 +179,7 @@ PAKFIRE_EXPORT struct pakfire_parser* pakfire_parser_unref(struct pakfire_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);
 
@@ -270,7 +269,7 @@ static struct pakfire_parser_declaration* pakfire_parser_find_declaration(
        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;
@@ -383,7 +382,7 @@ static const char* pakfire_parser_get_raw(struct pakfire_parser* parser, const c
        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;
 
@@ -598,7 +597,7 @@ ERROR:
        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)
@@ -638,7 +637,7 @@ ERROR:
        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
@@ -649,7 +648,7 @@ PAKFIRE_EXPORT char* pakfire_parser_get(struct pakfire_parser* parser, const cha
        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)
@@ -662,7 +661,7 @@ PAKFIRE_EXPORT char** pakfire_parser_get_split(struct pakfire_parser* parser,
        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;
@@ -715,7 +714,7 @@ PAKFIRE_EXPORT char** pakfire_parser_list_namespaces(struct pakfire_parser* pars
        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];
 
@@ -750,7 +749,7 @@ PAKFIRE_EXPORT int pakfire_parser_merge(struct pakfire_parser* parser1, struct p
        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;
@@ -767,7 +766,7 @@ PAKFIRE_EXPORT int pakfire_parser_read(struct pakfire_parser* parser, FILE* f,
        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)
@@ -779,12 +778,12 @@ PAKFIRE_EXPORT int pakfire_parser_read_file(struct pakfire_parser* parser, const
        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;
 
@@ -804,11 +803,11 @@ PAKFIRE_EXPORT char* pakfire_parser_dump(struct pakfire_parser* parser) {
        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);
 
@@ -867,7 +866,7 @@ ERROR:
        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;
 
@@ -1048,7 +1047,7 @@ struct pakfire_parser_error {
        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)
@@ -1073,7 +1072,7 @@ PAKFIRE_EXPORT int pakfire_parser_error_create(struct pakfire_parser_error** err
        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;
 
@@ -1092,7 +1091,7 @@ static void pakfire_parser_error_free(struct pakfire_parser_error* error) {
        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;
@@ -1102,16 +1101,16 @@ PAKFIRE_EXPORT struct pakfire_parser_error* pakfire_parser_error_unref(
        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;
 }