aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-clipboard.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-08-03 06:55:55 +0200
committerMattias Andrée <maandree@operamail.com>2014-08-03 06:55:55 +0200
commit000eea67ffd1f3250385a17a8aea8a8871e14210 (patch)
treeeb6feba9acfbbf987298468386acca1792cb8574 /src/mds-clipboard.h
parentmds-clipboard: all actions except add, however there is not removal of old entries yet (diff)
downloadmds-000eea67ffd1f3250385a17a8aea8a8871e14210.tar.gz
mds-000eea67ffd1f3250385a17a8aea8a8871e14210.tar.bz2
mds-000eea67ffd1f3250385a17a8aea8a8871e14210.tar.xz
the rest of the clipboard
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/mds-clipboard.h67
1 files changed, 66 insertions, 1 deletions
diff --git a/src/mds-clipboard.h b/src/mds-clipboard.h
index c84ad01..965d107 100644
--- a/src/mds-clipboard.h
+++ b/src/mds-clipboard.h
@@ -22,6 +22,71 @@
#include "mds-base.h"
#include <stddef.h>
+#include <time.h>
+#include <stdint.h>
+
+
+
+/**
+ * Delete entry only when needed
+ */
+#define CLIPITEM_AUTOPURGE_NEVER 0
+
+/**
+ * Delete entry when the client closes, or needed
+ */
+#define CLIPITEM_AUTOPURGE_UPON_DEATH 1
+
+/**
+ * Delete entry when a point in time has elapsed, or needed
+ */
+#define CLIPITEM_AUTOPURGE_UPON_CLOCK 2
+
+/**
+ * Delete entry when the client closes or when a
+ * point in time has elapsed, or when needed
+ */
+#define CLIPITEM_AUTOPURGE_UPON_DEATH_OR_CLOCK 3
+
+
+/**
+ * A clipboard entry
+ */
+typedef struct clipitem
+{
+ /**
+ * The stored content
+ */
+ char* content;
+
+ /**
+ * The length of the stored content
+ */
+ size_t length;
+
+ /**
+ * Time of planned death if `autopurge` is `CLIPITEM_AUTOPURGE_UPON_CLOCK`
+ */
+ struct timespec dethklok;
+
+ /**
+ * The client that issued the inclusion of this entry
+ */
+ uint64_t client;
+
+ /**
+ * Rule for automatic deletion
+ */
+ int autopurge;
+
+} clipitem_t;
+
+
+/**
+ * The number of levels in the clipboard
+ */
+#define CLIPBOARD_LEVELS 3
+
/**
@@ -52,7 +117,7 @@ int clipboard_death(const char* recv_client_id);
* Add a new entry to the clipboard
*
* @param level The clipboard level
- * @param time_to_live --
+ * @param time_to_live When the entry should be removed
* @param recv_client_id The ID of the client
* @return Zero on success, -1 on error
*/