Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=4b9d8b98f2b98f78e59e6da8fed9c9cf225b4811
commit 4b9d8b98f2b98f78e59e6da8fed9c9cf225b4811 Author: Michel Hermier <herm...@frugalware.org> Date: Fri Nov 15 00:20:58 2013 +0100 libpacman: Constify pacman_parse_config file argument. diff --git a/doc/libpacman-changes.txt b/doc/libpacman-changes.txt index 3f28f66..d7b02c9 100644 --- a/doc/libpacman-changes.txt +++ b/doc/libpacman-changes.txt @@ -20,7 +20,7 @@ None. pacman_cb_log: Make char * message argument a constant. pacman_logaction: Now returns a void instead of a int to reflect success. Logging should allways success and not be intrusive. -pacman_parse_config: Remove this_section argument, it is internal and should not have been exposed publicly. +pacman_parse_config: Make 'file' argument a constant. Remove 'this_section' argument, it is internal and should not have been exposed publicly. pacman_reg_match: Make arguments const. pacman_trans_cb_progress: Second argument (pkgname) is now a const. diff --git a/lib/libpacman/config_parser.c b/lib/libpacman/config_parser.c index 0d4b381..ec0798a 100644 --- a/lib/libpacman/config_parser.c +++ b/lib/libpacman/config_parser.c @@ -63,7 +63,7 @@ #define min(X, Y) ((X) < (Y) ? (X) : (Y)) -int _pacman_parse_config(char *file, pacman_cb_db_register callback, const char *this_section) +int _pacman_parse_config(const char *file, pacman_cb_db_register callback, const char *this_section) { FILE *fp = NULL; char line[PATH_MAX+1]; diff --git a/lib/libpacman/config_parser.h b/lib/libpacman/config_parser.h index 4f6c724..440e2b6 100644 --- a/lib/libpacman/config_parser.h +++ b/lib/libpacman/config_parser.h @@ -26,7 +26,7 @@ #include "pacman.h" -int _pacman_parse_config(char *file, pacman_cb_db_register callback, const char *this_section); +int _pacman_parse_config(const char *file, pacman_cb_db_register callback, const char *this_section); #endif /* _PACMAN_CONFIG_PARSER_H */ diff --git a/lib/libpacman/pacman.c b/lib/libpacman/pacman.c index ea0c94f..05ed541 100644 --- a/lib/libpacman/pacman.c +++ b/lib/libpacman/pacman.c @@ -993,7 +993,7 @@ int pacman_reg_match(const char *string, const char *pattern) * @param this_section the config current section being parsed * @return 0 on success, -1 on error (pm_errno is set accordingly) */ -int pacman_parse_config(char *file, pacman_cb_db_register callback) +int pacman_parse_config(const char *file, pacman_cb_db_register callback) { ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); diff --git a/lib/libpacman/pacman.h b/lib/libpacman/pacman.h index ef1e1ef..0a87a66 100644 --- a/lib/libpacman/pacman.h +++ b/lib/libpacman/pacman.h @@ -223,7 +223,7 @@ pmlist_t *pacman_pkg_getowners(char *filename); int pacman_pkg_load(char *filename, pmpkg_t **pkg); int pacman_pkg_free(pmpkg_t *pkg); char *pacman_fetch_pkgurl(char *url); -int pacman_parse_config(char *file, pacman_cb_db_register callback); +int pacman_parse_config(const char *file, pacman_cb_db_register callback); int pacman_pkg_vercmp(const char *ver1, const char *ver2); int pacman_reg_match(const char *string, const char *pattern); _______________________________________________ Frugalware-git mailing list Frugalware-git@frugalware.org http://frugalware.org/mailman/listinfo/frugalware-git