Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=7bc3bd13b544916a26add815d29498116a80c401

commit 7bc3bd13b544916a26add815d29498116a80c401
Author: Michel Hermier <[email protected]>
Date:   Thu Nov 7 21:26:55 2013 +0100

libpacman: Make pacman_reg_match arguments constants.

diff --git a/doc/libpacman-changes.txt b/doc/libpacman-changes.txt
index dd4dee7..14f67a6 100644
--- a/doc/libpacman-changes.txt
+++ b/doc/libpacman-changes.txt
@@ -19,6 +19,7 @@ None.
==== Symbols changed:

pacman_logaction: Now returns a void instead of a int to reflect success. 
Logging should allways success and not be intrusive.
+pacman_reg_match: Make arguments const.
pacman_trans_cb_progress: Second argument (pkgname) is now a const.

==== Symbols added:
diff --git a/lib/libpacman/pacman.c b/lib/libpacman/pacman.c
index c23ad76..31f0a31 100644
--- a/lib/libpacman/pacman.c
+++ b/lib/libpacman/pacman.c
@@ -1047,7 +1047,7 @@ char *pacman_fetch_pkgurl(char *url)
* @param pattern the pattern to search for
* @return 1 on match, 0 on non-match, -1 on error (pm_errno is set accordingly)
*/
-int pacman_reg_match(char *string, char *pattern)
+int pacman_reg_match(const char *string, const char *pattern)
{
ASSERT(string != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
ASSERT(pattern != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
diff --git a/lib/libpacman/pacman.h b/lib/libpacman/pacman.h
index 8d07d0c..ee062ba 100644
--- a/lib/libpacman/pacman.h
+++ b/lib/libpacman/pacman.h
@@ -225,7 +225,7 @@ int pacman_pkg_free(pmpkg_t *pkg);
char *pacman_fetch_pkgurl(char *url);
int pacman_parse_config(char *file, pacman_cb_db_register callback, const char 
*this_section);
int pacman_pkg_vercmp(const char *ver1, const char *ver2);
-int pacman_reg_match(char *string, char *pattern);
+int pacman_reg_match(const char *string, const char *pattern);

/*
* Groups
diff --git a/lib/libpacman/util.c b/lib/libpacman/util.c
index 69ba272..d5da75a 100644
--- a/lib/libpacman/util.c
+++ b/lib/libpacman/util.c
@@ -683,7 +683,7 @@ int _pacman_check_freespace(pmtrans_t *trans, pmlist_t 
**data)
}

/* match a string against a regular expression */
-int _pacman_reg_match(char *string, char *pattern)
+int _pacman_reg_match(const char *string, const char *pattern)
{
int result;
regex_t reg;
diff --git a/lib/libpacman/util.h b/lib/libpacman/util.h
index 95cfe1a..44350e3 100644
--- a/lib/libpacman/util.h
+++ b/lib/libpacman/util.h
@@ -76,7 +76,7 @@ int _pacman_runhook(const char *hookname, pmtrans_t *trans);
int _pacman_check_freespace(pmtrans_t *trans, pmlist_t **data);
#endif
#endif
-int _pacman_reg_match(char *string, char *pattern);
+int _pacman_reg_match(const char *string, const char *pattern);
#ifdef __sun__
char* strsep(char** str, const char* delims);
char* mkdtemp(char *template);
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to