forked from ariadne/pkgconf
libpkgconf: move some utility funcs into pkgconf_ namespace
parent
61d5fc72c8
commit
b17f264032
|
@ -16,14 +16,14 @@
|
|||
#include <libpkgconf/libpkgconf.h>
|
||||
|
||||
void
|
||||
pkg_argv_free(char **argv)
|
||||
pkgconf_argv_free(char **argv)
|
||||
{
|
||||
free(argv[0]);
|
||||
free(argv);
|
||||
}
|
||||
|
||||
int
|
||||
pkg_argv_split(const char *src, int *argc, char ***argv)
|
||||
pkgconf_argv_split(const char *src, int *argc, char ***argv)
|
||||
{
|
||||
char *buf = malloc(strlen(src) + 1);
|
||||
const char *src_iter;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
#include <libpkgconf/libpkgconf.h>
|
||||
|
||||
char *
|
||||
pkg_fgetline(char *line, size_t size, FILE *stream)
|
||||
pkgconf_fgetline(char *line, size_t size, FILE *stream)
|
||||
{
|
||||
char *s = line;
|
||||
char *end = line + size - 1;
|
||||
|
|
|
@ -196,11 +196,11 @@ pkgconf_fragment_parse(pkgconf_list_t *list, pkgconf_list_t *vars, const char *v
|
|||
char **argv;
|
||||
char *repstr = pkgconf_tuple_parse(vars, value);
|
||||
|
||||
pkg_argv_split(repstr, &argc, &argv);
|
||||
pkgconf_argv_split(repstr, &argc, &argv);
|
||||
|
||||
for (i = 0; i < argc; i++)
|
||||
pkgconf_fragment_add(list, argv[i], flags);
|
||||
|
||||
pkg_argv_free(argv);
|
||||
pkgconf_argv_free(argv);
|
||||
free(repstr);
|
||||
}
|
||||
|
|
|
@ -155,8 +155,8 @@ void pkgconf_dependency_append(pkgconf_list_t *list, pkgconf_dependency_t *tail)
|
|||
void pkgconf_dependency_free(pkgconf_list_t *list);
|
||||
|
||||
/* argvsplit.c */
|
||||
int pkg_argv_split(const char *src, int *argc, char ***argv);
|
||||
void pkg_argv_free(char **argv);
|
||||
int pkgconf_argv_split(const char *src, int *argc, char ***argv);
|
||||
void pkgconf_argv_free(char **argv);
|
||||
|
||||
/* fragment.c */
|
||||
void pkgconf_fragment_parse(pkgconf_list_t *list, pkgconf_list_t *vars, const char *value, unsigned int flags);
|
||||
|
@ -166,7 +166,7 @@ void pkgconf_fragment_delete(pkgconf_list_t *list, pkgconf_fragment_t *node);
|
|||
void pkgconf_fragment_free(pkgconf_list_t *list);
|
||||
|
||||
/* fileio.c */
|
||||
char *pkg_fgetline(char *line, size_t size, FILE *stream);
|
||||
char *pkgconf_fgetline(char *line, size_t size, FILE *stream);
|
||||
|
||||
/* tuple.c */
|
||||
pkgconf_tuple_t *pkgconf_tuple_add(pkgconf_list_t *parent, const char *key, const char *value);
|
||||
|
|
|
@ -212,7 +212,7 @@ pkg_new_from_file(const char *filename, FILE *f, unsigned int flags)
|
|||
if (idptr)
|
||||
*idptr = '\0';
|
||||
|
||||
while (pkg_fgetline(readbuf, PKG_BUFSIZE, f) != NULL)
|
||||
while (pkgconf_fgetline(readbuf, PKG_BUFSIZE, f) != NULL)
|
||||
{
|
||||
char op, *p, *key, *value;
|
||||
|
||||
|
|
Loading…
Reference in New Issue