]> git.sur5r.net Git - i3/i3/blobdiff - include/libi3.h
Merge branch 'master' into next
[i3/i3] / include / libi3.h
index 45ba970f5ba88729a3f09944736d5388ce953ce9..6714cc5b921d6f61a201abaee51dd9f6337ba51e 100644 (file)
@@ -2,14 +2,14 @@
  * vim:ts=4:sw=4:expandtab
  *
  * i3 - an improved dynamic tiling window manager
- * © 2009-2011 Michael Stapelberg and contributors (see also: LICENSE)
+ * © 2009-2013 Michael Stapelberg and contributors (see also: LICENSE)
  *
  * libi3: contains functions which are used by i3 *and* accompanying tools such
  * as i3-msg, i3-config-wizard, …
  *
  */
-#ifndef _LIBI3_H
-#define _LIBI3_H
+#ifndef I3_LIBI3_H
+#define I3_LIBI3_H
 
 #include <stdbool.h>
 #include <stdarg.h>
@@ -69,10 +69,12 @@ struct Font {
 /* Since this file also gets included by utilities which don’t use the i3 log
  * infrastructure, we define a fallback. */
 #if !defined(LOG)
-#define LOG(fmt, ...) fprintf(stdout, "[libi3] " __FILE__ " " fmt, ##__VA_ARGS__)
+void verboselog(char *fmt, ...);
+#define LOG(fmt, ...) verboselog("[libi3] " __FILE__ " " fmt, ##__VA_ARGS__)
 #endif
 #if !defined(ELOG)
-#define ELOG(fmt, ...) fprintf(stderr, "[libi3] ERROR: " fmt, ##__VA_ARGS__)
+void errorlog(char *fmt, ...);
+#define ELOG(fmt, ...) errorlog("[libi3] ERROR: " fmt, ##__VA_ARGS__)
 #endif
 
 /**
@@ -200,8 +202,8 @@ int ipc_connect(const char *socket_path);
  * Returns 0 on success.
  *
  */
-int ipc_send_message(int sockfd, uint32_t message_size,
-                     uint32_t message_type, const uint8_t *payload);
+int ipc_send_message(int sockfd, const uint32_t message_size,
+                     const uint32_t message_type, const uint8_t *payload);
 
 /**
  * Reads a message from the given socket file descriptor and stores its length
@@ -214,7 +216,7 @@ int ipc_send_message(int sockfd, uint32_t message_size,
  * Returns 0 on success.
  *
  */
-int ipc_recv_message(int sockfd, uint32_t message_type,
+int ipc_recv_message(int sockfd, uint32_t *message_type,
                      uint32_t *reply_length, uint8_t **reply);
 
 /**
@@ -353,4 +355,10 @@ xcb_visualtype_t *get_visualtype(xcb_screen_t *screen);
  */
 bool is_debug_build() __attribute__((const));
 
+/**
+ * Returns the name of a temporary file with the specified prefix.
+ *
+ */
+char *get_process_filename(const char *prefix);
+
 #endif