howm
howm
helper.h File Reference

howm More...

#include <stdio.h>

Go to the source code of this file.

Macros

#define MOVE_RESIZE_MASK
 
#define LENGTH(x)   (unsigned int)(sizeof(x) / sizeof(*x))
 
#define FFT(c)   (c->is_transient || c->is_floating || c->is_fullscreen)
 
#define UNUSED(x)   (void)(x)
 
#define MAX_FD(x, y)   ((x) > (y) ? (x + 1) : (y + 1))
 
#define LOG_LEVEL   LOG_DEBUG
 
#define DEBUG_ENABLE   false
 
#define LOG_DEBUG   1
 
#define LOG_INFO   2
 
#define LOG_WARN   3
 
#define LOG_ERR   4
 
#define LOG_NONE   5
 
#define log_debug(M, ...)   fprintf(stderr, "[DEBUG] (%s:%d) " M "\n", __FILE__, __LINE__, ##__VA_ARGS__)
 
#define log_info(M, ...)   fprintf(stderr, "[INFO] (%s:%d) " M "\n", __FILE__, __LINE__, ##__VA_ARGS__)
 
#define log_warn(M, ...)   fprintf(stderr, "[WARN] (%s:%d) " M "\n", __FILE__, __LINE__, ##__VA_ARGS__)
 
#define log_err(M, ...)   fprintf(stderr, "[ERROR] (%s:%d) " M "\n", __FILE__, __LINE__, ##__VA_ARGS__)
 

Detailed Description

howm

Author
Harvey Hunt
Date
2015

Macro Definition Documentation

#define DEBUG_ENABLE   false

Enable debugging output

#define FFT (   c)    (c->is_transient || c->is_floating || c->is_fullscreen)

Checks to see if a client is floating, fullscreen or transient.

#define LENGTH (   x)    (unsigned int)(sizeof(x) / sizeof(*x))

Calculates the length of an array.

#define LOG_DEBUG   1
#define log_debug (   M,
  ... 
)    fprintf(stderr, "[DEBUG] (%s:%d) " M "\n", __FILE__, __LINE__, ##__VA_ARGS__)
#define LOG_ERR   4
#define log_err (   M,
  ... 
)    fprintf(stderr, "[ERROR] (%s:%d) " M "\n", __FILE__, __LINE__, ##__VA_ARGS__)
#define LOG_INFO   2
#define log_info (   M,
  ... 
)    fprintf(stderr, "[INFO] (%s:%d) " M "\n", __FILE__, __LINE__, ##__VA_ARGS__)
#define LOG_LEVEL   LOG_DEBUG

How much detail should be logged. A LOG_LEVEL of INFO will log almost everything, LOG_WARN will log warnings and errors and LOG_ERR will log only errors.

LOG_NONE means nothing will be logged.

LOG_DEBUG should be used by developers.

#define LOG_NONE   5
#define LOG_WARN   3
#define log_warn (   M,
  ... 
)    fprintf(stderr, "[WARN] (%s:%d) " M "\n", __FILE__, __LINE__, ##__VA_ARGS__)
#define MAX_FD (   x,
 
)    ((x) > (y) ? (x + 1) : (y + 1))

Determine which file descriptor is the largest and add one to it.

#define MOVE_RESIZE_MASK
Value:
(XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y | \
XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT)

Calculates a mask that can be applied to a window in order to reconfigure a window.

#define UNUSED (   x)    (void)(x)

Supresses the unused variable compiler warnings.