Git-Url:
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=fa634e03fc3b537dadf0512c1e2784e5a3dc1412
commit fa634e03fc3b537dadf0512c1e2784e5a3dc1412
Author: Miklos Vajna <[EMAIL PROTECTED]>
Date: Mon Nov 26 00:31:14 2007 +0100
export the _pacman_reg_match() function
diff --git a/lib/libpacman/pacman.c b/lib/libpacman/pacman.c
index 7bff3de..b4bfe7d 100644
--- a/lib/libpacman/pacman.c
+++ b/lib/libpacman/pacman.c
@@ -1114,6 +1114,18 @@ char *pacman_fetch_pkgurl(char *url)
return(_pacman_fetch_pkgurl(url));
}
+/** Match a string against a regular expression.
+ * @param string the input string
+ * @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)
+{
+ ASSERT(string != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
+ ASSERT(pattern != NULL, RET_ERR(PM_ERR_WRONG_ARGS, -1));
+ return(_pacman_reg_match(string, pattern));
+}
+
/** Parses a configuration file.
* @param file path to the config file.
* @param callback a function to be called upon new database creation
diff --git a/lib/libpacman/pacman.h b/lib/libpacman/pacman.h
index f952ca2..531e90b 100644
--- a/lib/libpacman/pacman.h
+++ b/lib/libpacman/pacman.h
@@ -213,6 +213,7 @@ int pacman_pkg_checksha1sum(PM_PKG *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);
/*
* Groups
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git