shmlog: store meta information in the buffer itself, store path as X11 atom

This makes i3-dump-log completely independent of a running i3 instance.
This commit is contained in:
Michael Stapelberg
2012-01-06 23:40:07 +00:00
parent ed37a63942
commit dee7c07ad2
13 changed files with 59 additions and 157 deletions

View File

@ -26,3 +26,4 @@ xmacro(WM_WINDOW_ROLE)
xmacro(I3_SOCKET_PATH)
xmacro(I3_CONFIG_PATH)
xmacro(I3_SYNC)
xmacro(I3_SHMLOG_PATH)

View File

@ -40,9 +40,6 @@
/** Request the configuration for a specific 'bar' */
#define I3_IPC_MESSAGE_TYPE_GET_BAR_CONFIG 6
/** Request the SHM debug log start/wrap markers */
#define I3_IPC_MESSAGE_TYPE_GET_LOG_MARKERS 7
/*
* Messages from i3 to clients
*
@ -69,9 +66,6 @@
/** Bar config reply type */
#define I3_IPC_REPLY_TYPE_BAR_CONFIG 6
/** Request the SHM debug log start/wrap markers */
#define I3_IPC_REPLY_TYPE_LOG_MARKERS 7
/*
* Events from i3 to clients. Events have the first bit set high.
*

View File

@ -47,13 +47,14 @@ struct Font {
#endif
/**
* Try to get the socket path from X11 and return NULL if it doesnt work.
* Try to get the contents of the given atom (for example I3_SOCKET_PATH) from
* the X11 root window and return NULL if it doesnt work.
*
* The memory for the socket path is dynamically allocated and has to be
* The memory for the contents is dynamically allocated and has to be
* free()d by the caller.
*
*/
char *socket_path_from_x11();
char *root_atom_contents(const char *atomname);
/**
* Safe-wrapper around malloc which exits if malloc returns NULL (meaning that

View File

@ -37,13 +37,6 @@ void init_logging();
*/
void add_loglevel(const char *level);
/**
* Returns the offsets for the next write and for the last wrap.
* Necessary to print the i3 SHM log in the correct order.
*
*/
void get_log_markers(int *offset_next_write, int *offset_last_wrap, int *size);
/**
* Set verbosity of i3. If verbose is set to true, informative messages will
* be printed to stdout. If verbose is set to false, only errors will be