aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/cg-base.c27
-rw-r--r--src/cg-base.h13
2 files changed, 27 insertions, 13 deletions
diff --git a/src/cg-base.c b/src/cg-base.c
index dbcaf19..2de0abc 100644
--- a/src/cg-base.c
+++ b/src/cg-base.c
@@ -646,19 +646,22 @@ int main(int argc, char* argv[])
nulstrcmp(rule, "?") && nulstrcmp(method, "?"))
if (handle_args(argc, argv, prio) < 0)
goto fail;
-
- if (!nulstrcmp(prio, "?"))
- {
- printf("%" PRIi64 "\n", priority);
- return 0;
- }
- else if (prio != NULL)
+
+ if (default_priority != NO_DEFAULT_PRIORITY)
{
- char *end;
- errno = 0;
- priority = (int64_t)strtoll(prio, &end, 10);
- if (errno || *end || !*prio)
- usage();
+ if (!nulstrcmp(prio, "?"))
+ {
+ printf("%" PRIi64 "\n", priority);
+ return 0;
+ }
+ else if (prio != NULL)
+ {
+ char *end;
+ errno = 0;
+ priority = (int64_t)strtoll(prio, &end, 10);
+ if (errno || *end || !*prio)
+ usage();
+ }
}
if (!nulstrcmp(rule, "??"))
diff --git a/src/cg-base.h b/src/cg-base.h
index 713c9df..5ab23a9 100644
--- a/src/cg-base.h
+++ b/src/cg-base.h
@@ -17,6 +17,16 @@
*/
#include <libcoopgamma.h>
+#include <inttypes.h>
+
+
+
+/**
+ * Value of `default_priority` that indicates
+ * that there is no default priority
+ */
+#define NO_DEFAULT_PRIORITY INT64_MAX
+
/**
@@ -49,7 +59,8 @@ typedef struct filter_update
* The filter to update
*
* `.filter.crtc`, `.filter.class`, and
- * `.filter.priority`, `.filter.depth`
+ * `.filter.priority` (unless `default_priority`
+ * is `NO_DEFAULT_PRIORITY`), `.filter.depth`
* are preconfigured, and `.filter.ramps`
* is preinitialised and preset to an
* identity ramp