char *rewrite_binding(const char *bindingline);
static void finish();
+/*
+ * Having verboselog() and errorlog() is necessary when using libi3.
+ *
+ */
+void verboselog(char *fmt, ...) {
+ va_list args;
+
+ va_start(args, fmt);
+ vfprintf(stdout, fmt, args);
+ va_end(args);
+}
+
+void errorlog(char *fmt, ...) {
+ va_list args;
+
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ va_end(args);
+}
+
/*
* This function resolves ~ in pathnames.
* It may resolve wildcards in the first part of the path, but if no match
xcb_connection_t *conn;
xcb_screen_t *root_screen;
+/*
+ * Having verboselog() and errorlog() is necessary when using libi3.
+ *
+ */
+void verboselog(char *fmt, ...) {
+ va_list args;
+
+ va_start(args, fmt);
+ vfprintf(stdout, fmt, args);
+ va_end(args);
+}
+
+void errorlog(char *fmt, ...) {
+ va_list args;
+
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ va_end(args);
+}
+
/*
* Concats the glyphs (either UCS-2 or UTF-8) to a single string, suitable for
* rendering it (UCS-2) or sending it to i3 (UTF-8).
xcb_connection_t *conn;
xcb_screen_t *root_screen;
+/*
+ * Having verboselog() and errorlog() is necessary when using libi3.
+ *
+ */
+void verboselog(char *fmt, ...) {
+ va_list args;
+
+ va_start(args, fmt);
+ vfprintf(stdout, fmt, args);
+ va_end(args);
+}
+
+void errorlog(char *fmt, ...) {
+ va_list args;
+
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ va_end(args);
+}
+
/*
* Starts the given application by passing it through a shell. We use double fork
* to avoid zombie processes. As the started application’s parent exits (immediately),
* vim:ts=4:sw=4:expandtab
*
* i3bar - an xcb-based status- and ws-bar for i3
- * © 2010-2011 Axel Wagner and contributors (see also: LICENSE)
+ * © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
*
*/
#include <stdio.h>
#include "common.h"
+/*
+ * Having verboselog() and errorlog() is necessary when using libi3.
+ *
+ */
+void verboselog(char *fmt, ...) {
+ va_list args;
+
+ va_start(args, fmt);
+ vfprintf(stdout, fmt, args);
+ va_end(args);
+}
+
+void errorlog(char *fmt, ...) {
+ va_list args;
+
+ va_start(args, fmt);
+ vfprintf(stderr, fmt, args);
+ va_end(args);
+}
+
/*
* Glob path, i.e. expand ~
*
/* 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
/**
static bool load_pango_font(i3Font *font, const char *desc) {
/* Load the font description */
font->specific.pango_desc = pango_font_description_from_string(desc);
- if (!font->specific.pango_desc)
- {
+ if (!font->specific.pango_desc) {
ELOG("Could not open font %s with Pango, fallback to X font.\n", desc);
return false;
}
- LOG("Using Pango font %s, size %d",
+ LOG("Using Pango font %s, size %d\n",
pango_font_description_get_family(font->specific.pango_desc),
pango_font_description_get_size(font->specific.pango_desc)
);
}
}
- LOG("Using X font %s", pattern);
+ LOG("Using X font %s\n", pattern);
/* Get information (height/name) for this font */
if (!(font.specific.xcb.info = xcb_query_font_reply(conn, info_cookie, NULL)))