libpkgconf: move some utility funcs into pkgconf_ namespace

feature/tap-sh
William Pitcock 2015-09-06 10:48:24 -05:00
parent 61d5fc72c8
commit b17f264032
5 changed files with 9 additions and 9 deletions

View File

@ -16,14 +16,14 @@
#include <libpkgconf/libpkgconf.h> #include <libpkgconf/libpkgconf.h>
void void
pkg_argv_free(char **argv) pkgconf_argv_free(char **argv)
{ {
free(argv[0]); free(argv[0]);
free(argv); free(argv);
} }
int 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); char *buf = malloc(strlen(src) + 1);
const char *src_iter; const char *src_iter;

View File

@ -16,7 +16,7 @@
#include <libpkgconf/libpkgconf.h> #include <libpkgconf/libpkgconf.h>
char * char *
pkg_fgetline(char *line, size_t size, FILE *stream) pkgconf_fgetline(char *line, size_t size, FILE *stream)
{ {
char *s = line; char *s = line;
char *end = line + size - 1; char *end = line + size - 1;

View File

@ -196,11 +196,11 @@ pkgconf_fragment_parse(pkgconf_list_t *list, pkgconf_list_t *vars, const char *v
char **argv; char **argv;
char *repstr = pkgconf_tuple_parse(vars, value); 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++) for (i = 0; i < argc; i++)
pkgconf_fragment_add(list, argv[i], flags); pkgconf_fragment_add(list, argv[i], flags);
pkg_argv_free(argv); pkgconf_argv_free(argv);
free(repstr); free(repstr);
} }

View File

@ -155,8 +155,8 @@ void pkgconf_dependency_append(pkgconf_list_t *list, pkgconf_dependency_t *tail)
void pkgconf_dependency_free(pkgconf_list_t *list); void pkgconf_dependency_free(pkgconf_list_t *list);
/* argvsplit.c */ /* argvsplit.c */
int pkg_argv_split(const char *src, int *argc, char ***argv); int pkgconf_argv_split(const char *src, int *argc, char ***argv);
void pkg_argv_free(char **argv); void pkgconf_argv_free(char **argv);
/* fragment.c */ /* fragment.c */
void pkgconf_fragment_parse(pkgconf_list_t *list, pkgconf_list_t *vars, const char *value, unsigned int flags); 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); void pkgconf_fragment_free(pkgconf_list_t *list);
/* fileio.c */ /* fileio.c */
char *pkg_fgetline(char *line, size_t size, FILE *stream); char *pkgconf_fgetline(char *line, size_t size, FILE *stream);
/* tuple.c */ /* tuple.c */
pkgconf_tuple_t *pkgconf_tuple_add(pkgconf_list_t *parent, const char *key, const char *value); pkgconf_tuple_t *pkgconf_tuple_add(pkgconf_list_t *parent, const char *key, const char *value);

View File

@ -212,7 +212,7 @@ pkg_new_from_file(const char *filename, FILE *f, unsigned int flags)
if (idptr) if (idptr)
*idptr = '\0'; *idptr = '\0';
while (pkg_fgetline(readbuf, PKG_BUFSIZE, f) != NULL) while (pkgconf_fgetline(readbuf, PKG_BUFSIZE, f) != NULL)
{ {
char op, *p, *key, *value; char op, *p, *key, *value;