aboutsummaryrefslogtreecommitdiffstats
path: root/src/cg-base.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-08-04 19:30:03 +0200
committerMattias Andrée <maandree@kth.se>2016-08-04 19:30:03 +0200
commita606a64a58089a0fb7e4691c95b29be1eff21ab4 (patch)
tree5f7d7ae38ab5a3eca557835dcac8671bbb91dd6a /src/cg-base.h
parentWork on cg-base (diff)
downloadcg-tools-a606a64a58089a0fb7e4691c95b29be1eff21ab4.tar.gz
cg-tools-a606a64a58089a0fb7e4691c95b29be1eff21ab4.tar.bz2
cg-tools-a606a64a58089a0fb7e4691c95b29be1eff21ab4.tar.xz
cg-base should be complete now
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--src/cg-base.h52
1 files changed, 46 insertions, 6 deletions
diff --git a/src/cg-base.h b/src/cg-base.h
index 13667b7..b12d551 100644
--- a/src/cg-base.h
+++ b/src/cg-base.h
@@ -28,8 +28,10 @@ typedef struct filter_update
/**
* The filter to update
*
- * `.filter.crtc` and `.filter.priority`
- * are preconfigured
+ * `.filter.crtc`, `.filter.class`, and
+ * `.filter.priority`, `.filter.depth`
+ * are preconfigured, and `.filter.ramps`
+ * is preinitialised.
*/
libcoopgamma_filter_t filter;
@@ -106,6 +108,11 @@ extern size_t crtcs_n;
*/
extern const int64_t default_priority;
+/**
+ * The default class for the program
+ */
+extern char* const default_class;
+
/**
@@ -115,6 +122,36 @@ extern const int64_t default_priority;
*/
int make_slaves(void);
+/**
+ * Update a filter and synchronise calls
+ *
+ * @param index The index of the CRTC
+ * @param timeout The number of milliseconds a call to `poll` may block,
+ * -1 if it may block forever
+ * @return 1: Success, no pending synchronisations
+ * 0: Success, with still pending synchronisations
+ * -1: Error, `errno` set
+ * -2: Error, `cg.error` set
+ *
+ * @throws EINTR Call to `poll` was interrupted by a signal
+ * @throws EAGAIN Call to `poll` timed out
+ */
+int update_filter(size_t index, int timeout);
+
+/**
+ * Synchronised calls
+ *
+ * @param timeout The number of milliseconds a call to `poll` may block,
+ * -1 if it may block forever
+ * @return 1: Success, no pending synchronisations
+ * 0: Success, with still pending synchronisations
+ * -1: Error, `errno` set
+ * -2: Error, `cg.error` set
+ *
+ * @throws EINTR Call to `poll` was interrupted by a signal
+ * @throws EAGAIN Call to `poll` timed out
+ */
+int synchronise(int timeout);
/**
@@ -131,7 +168,7 @@ extern void usage(void);
* @param opt The option, it is a NUL-terminate two-character
* string starting with either '-' or '+', if the
* argument is not recognised, call `usage`. This
- * string will not be "-m", "-s", or "-c".
+ * string will not be "-M", "-S", "-c", "-p", or "-R".
* @param arg The argument associated with `opt`,
* `NULL` there is no next argument, if this
* parameter is `NULL` but needed, call `usage`
@@ -150,15 +187,18 @@ extern int handle_opt(char* opt, char* arg);
*
* @param argc The number of unparsed arguments
* @param argv `NULL` terminated list of unparsed arguments
- * @param method The argument associated with the "-m" option
- * @param site The argument associated with the "-s" option
+ * @param method The argument associated with the "-M" option
+ * @param site The argument associated with the "-S" option
* @param crtcs The arguments associated with the "-c" options, `NULL`-terminated
+ * @param prio The argument associated with the "-p" option
+ * @param rule The argument associated with the "-R" option
* @return Zero on success, -1 on error
*/
#if defined(__GNUC__)
__attribute__((__nonnull__(2)))
#endif
-extern int handle_args(int argc, char* argv[], char* method, char* site, char** crtcs);
+extern int handle_args(int argc, char* argv[], char* method, char* site, char** crtcs,
+ char* prio, char* rule);
/**
* The main function for the program-specific code