forked from ariadne/pkgconf
libpkgconf: clean up PKG_MODULE_SEPARATOR() and PKG_OPERATOR_CHAR() macros
parent
ec5cc3f068
commit
50cf8db086
|
@ -106,7 +106,7 @@ pkgconf_dependency_parse_str(pkgconf_list_t *deplist_head, const char *depends)
|
||||||
switch (state)
|
switch (state)
|
||||||
{
|
{
|
||||||
case OUTSIDE_MODULE:
|
case OUTSIDE_MODULE:
|
||||||
if (!PKG_MODULE_SEPARATOR(*ptr))
|
if (!PKGCONF_IS_MODULE_SEPARATOR(*ptr))
|
||||||
state = INSIDE_MODULE_NAME;
|
state = INSIDE_MODULE_NAME;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -121,14 +121,14 @@ pkgconf_dependency_parse_str(pkgconf_list_t *deplist_head, const char *depends)
|
||||||
|
|
||||||
if (*sptr == '\0')
|
if (*sptr == '\0')
|
||||||
state = OUTSIDE_MODULE;
|
state = OUTSIDE_MODULE;
|
||||||
else if (PKG_MODULE_SEPARATOR(*sptr))
|
else if (PKGCONF_IS_MODULE_SEPARATOR(*sptr))
|
||||||
state = OUTSIDE_MODULE;
|
state = OUTSIDE_MODULE;
|
||||||
else if (PKG_OPERATOR_CHAR(*sptr))
|
else if (PKGCONF_IS_OPERATOR_CHAR(*sptr))
|
||||||
state = BEFORE_OPERATOR;
|
state = BEFORE_OPERATOR;
|
||||||
else
|
else
|
||||||
state = OUTSIDE_MODULE;
|
state = OUTSIDE_MODULE;
|
||||||
}
|
}
|
||||||
else if (PKG_MODULE_SEPARATOR(*ptr))
|
else if (PKGCONF_IS_MODULE_SEPARATOR(*ptr))
|
||||||
state = OUTSIDE_MODULE;
|
state = OUTSIDE_MODULE;
|
||||||
else if (*(ptr + 1) == '\0')
|
else if (*(ptr + 1) == '\0')
|
||||||
{
|
{
|
||||||
|
@ -140,7 +140,7 @@ pkgconf_dependency_parse_str(pkgconf_list_t *deplist_head, const char *depends)
|
||||||
{
|
{
|
||||||
char *iter = start;
|
char *iter = start;
|
||||||
|
|
||||||
while (PKG_MODULE_SEPARATOR(*iter))
|
while (PKGCONF_IS_MODULE_SEPARATOR(*iter))
|
||||||
iter++;
|
iter++;
|
||||||
|
|
||||||
package = iter;
|
package = iter;
|
||||||
|
@ -163,7 +163,7 @@ pkgconf_dependency_parse_str(pkgconf_list_t *deplist_head, const char *depends)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BEFORE_OPERATOR:
|
case BEFORE_OPERATOR:
|
||||||
if (PKG_OPERATOR_CHAR(*ptr))
|
if (PKGCONF_IS_OPERATOR_CHAR(*ptr))
|
||||||
{
|
{
|
||||||
state = INSIDE_OPERATOR;
|
state = INSIDE_OPERATOR;
|
||||||
*cnameptr++ = *ptr;
|
*cnameptr++ = *ptr;
|
||||||
|
@ -172,7 +172,7 @@ pkgconf_dependency_parse_str(pkgconf_list_t *deplist_head, const char *depends)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case INSIDE_OPERATOR:
|
case INSIDE_OPERATOR:
|
||||||
if (!PKG_OPERATOR_CHAR(*ptr))
|
if (!PKGCONF_IS_OPERATOR_CHAR(*ptr))
|
||||||
{
|
{
|
||||||
state = AFTER_OPERATOR;
|
state = AFTER_OPERATOR;
|
||||||
compare = pkgconf_pkg_comparator_lookup_by_name(cmpname);
|
compare = pkgconf_pkg_comparator_lookup_by_name(cmpname);
|
||||||
|
@ -195,7 +195,7 @@ pkgconf_dependency_parse_str(pkgconf_list_t *deplist_head, const char *depends)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case INSIDE_VERSION:
|
case INSIDE_VERSION:
|
||||||
if (PKG_MODULE_SEPARATOR(*ptr) || *(ptr + 1) == '\0')
|
if (PKGCONF_IS_MODULE_SEPARATOR(*ptr) || *(ptr + 1) == '\0')
|
||||||
{
|
{
|
||||||
version = vstart;
|
version = vstart;
|
||||||
version_sz = ptr - vstart;
|
version_sz = ptr - vstart;
|
||||||
|
|
|
@ -104,8 +104,8 @@ struct pkgconf_pkg_ {
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define PKG_MODULE_SEPARATOR(c) ((c) == ',' || isspace ((c)))
|
#define PKGCONF_IS_MODULE_SEPARATOR(c) ((c) == ',' || isspace ((c)))
|
||||||
#define PKG_OPERATOR_CHAR(c) ((c) == '<' || (c) == '>' || (c) == '!' || (c) == '=')
|
#define PKGCONF_IS_OPERATOR_CHAR(c) ((c) == '<' || (c) == '>' || (c) == '!' || (c) == '=')
|
||||||
|
|
||||||
#define PKGF_NONE 0x000
|
#define PKGF_NONE 0x000
|
||||||
#define PKGF_SEARCH_PRIVATE 0x001
|
#define PKGF_SEARCH_PRIVATE 0x001
|
||||||
|
|
2
main.c
2
main.c
|
@ -848,7 +848,7 @@ main(int argc, char *argv[])
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argv[pkg_optind + 1] == NULL || !PKG_OPERATOR_CHAR(*(argv[pkg_optind + 1])))
|
if (argv[pkg_optind + 1] == NULL || !PKGCONF_IS_OPERATOR_CHAR(*(argv[pkg_optind + 1])))
|
||||||
{
|
{
|
||||||
pkgconf_queue_push(&pkgq, package);
|
pkgconf_queue_push(&pkgq, package);
|
||||||
pkg_optind++;
|
pkg_optind++;
|
||||||
|
|
Loading…
Reference in New Issue