summaryrefslogtreecommitdiff
path: root/pkg.h
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2012-10-16 20:44:16 -0700
committerDan Nicholson <dbn.lists@gmail.com>2012-11-03 11:07:59 -0700
commit90ed8f193fc36f4b0aabdae996a87a821c67fafc (patch)
tree625edc2638b47d21bc709f47a5c6da5c6b5164de /pkg.h
parentd630bf3c756f945b2b494141d504676c9446349d (diff)
downloadpkg-config-90ed8f193fc36f4b0aabdae996a87a821c67fafc.tar.gz
Allow all combinations of --cflags and --libs variants
Use a bitmask to keep track of what Libs/Cflags to output. This makes it simple to handle any combination of --cflags and --libs option variants. A lot of excess code is removed in the process as all the flags options can now be carried around in a single variable. Freedesktop #54388 (https://bugs.freedesktop.org/show_bug.cgi?id=54388)
Diffstat (limited to 'pkg.h')
-rw-r--r--pkg.h23
1 files changed, 14 insertions, 9 deletions
diff --git a/pkg.h b/pkg.h
index c1a49f6..c394358 100644
--- a/pkg.h
+++ b/pkg.h
@@ -22,6 +22,18 @@
#include <glib.h>
+typedef guint8 FlagType; /* bit mask for flag types */
+
+#define LIBS_l (1 << 0)
+#define LIBS_L (1 << 1)
+#define LIBS_OTHER (1 << 2)
+#define CFLAGS_I (1 << 3)
+#define CFLAGS_OTHER (1 << 4)
+
+#define LIBS_ANY (LIBS_l | LIBS_L | LIBS_OTHER)
+#define CFLAGS_ANY (CFLAGS_I | CFLAGS_OTHER)
+#define FLAGS_ANY (LIBS_ANY | CFLAGS_ANY)
+
typedef enum
{
LESS_THAN,
@@ -72,19 +84,13 @@ struct _Package
Package *get_package (const char *name);
Package *get_package_quiet (const char *name);
-char * packages_get_l_libs (GSList *pkgs);
-char * packages_get_L_libs (GSList *pkgs);
-char * packages_get_other_libs (GSList *pkgs);
-char * packages_get_all_libs (GSList *pkgs);
-char * packages_get_I_cflags (GSList *pkgs);
-char * packages_get_other_cflags (GSList *pkgs);
-char * packages_get_all_cflags (GSList *pkgs);
+char * packages_get_flags (GSList *pkgs,
+ FlagType flags);
char * package_get_var (Package *pkg,
const char *var);
char * packages_get_var (GSList *pkgs,
const char *var);
-
void add_search_dir (const char *path);
void add_search_dirs (const char *path, const char *separator);
void package_init (void);
@@ -134,4 +140,3 @@ extern int msvc_syntax;
#endif
#endif
-