.github
AnyEvent-I3
contrib
debian
docs
etc
i3-config-wizard
i3-dump-log
i3-input
i3-msg
i3-nagbar
i3bar
include
i3
all.h
assignments.h
atoms.xmacro
atoms_NET_SUPPORTED.xmacro
atoms_rest.xmacro
bindings.h
click.h
cmdparse.h
commands.h
commands_parser.h
con.h
config_directives.h
config_parser.h
configuration.h
data.h
display_version.h
ewmh.h
fake_outputs.h
floating.h
handlers.h
i3.h
ipc.h
key_press.h
libi3.h
load_layout.h
log.h
main.h
manage.h
match.h
move.h
output.h
queue.h
randr.h
regex.h
render.h
resize.h
restore_layout.h
scratchpad.h
sd-daemon.h
shmlog.h
sighandler.h
startup.h
tree.h
util.h
window.h
workspace.h
x.h
xcb.h
xcursor.h
xinerama.h
yajl_utils.h
libi3
m4
man
parser-specs
share
src
testcases
travis
.clang-format
.gitignore
.travis.yml
DEPENDS
I3_VERSION
LICENSE
Makefile.am
PACKAGE-MAINTAINER
RELEASE-NOTES-4.14
configure.ac
generate-command-parser.pl
i3-dmenu-desktop
i3-migrate-config-to-v4
i3-save-tree
i3-sensible-editor
i3-sensible-pager
i3-sensible-terminal
logo.svg
pseudo-doc.doxygen
release.sh
Including config.h is necessary to get e.g. the _GNU_SOURCE define and any other definitions that autoconf declares. Hence, config.h needs to be included as the first header in each file. This is done either via: 1. Including "common.h" (i3bar) 2. Including "libi3.h" 3. Including "all.h" (i3) 4. Including <config.h> directly Also remove now-unused I3__FILE__, add copyright/license statement where missing and switch include/all.h to #pragma once.
51 lines
1.5 KiB
C
51 lines
1.5 KiB
C
/*
|
||
* vim:ts=4:sw=4:expandtab
|
||
*
|
||
* i3 - an improved dynamic tiling window manager
|
||
* © 2009 Michael Stapelberg and contributors (see also: LICENSE)
|
||
*
|
||
* The format of the shmlog data structure which i3 development versions use by
|
||
* default (ringbuffer for storing the debug log).
|
||
*
|
||
*/
|
||
#pragma once
|
||
|
||
#include <config.h>
|
||
|
||
#include <stdint.h>
|
||
#if !defined(__OpenBSD__)
|
||
#include <pthread.h>
|
||
#endif
|
||
|
||
/* Default shmlog size if not set by user. */
|
||
extern const int default_shmlog_size;
|
||
|
||
/*
|
||
* Header of the shmlog file. Used by i3/src/log.c and i3/i3-dump-log/main.c.
|
||
*
|
||
*/
|
||
typedef struct i3_shmlog_header {
|
||
/* Byte offset where the next line will be written to. */
|
||
uint32_t offset_next_write;
|
||
|
||
/* Byte offset where the last wrap occurred. */
|
||
uint32_t offset_last_wrap;
|
||
|
||
/* The size of the logfile in bytes. Since the size is limited to 25 MiB
|
||
* an uint32_t is sufficient. */
|
||
uint32_t size;
|
||
|
||
/* wrap counter. We need it to reliably signal to clients that we just
|
||
* wrapped (clients cannot use offset_last_wrap because that might
|
||
* coincidentally be exactly the same as previously). Overflows can happen
|
||
* and don’t matter — clients use an equality check (==). */
|
||
uint32_t wrap_count;
|
||
|
||
#if !defined(__OpenBSD__)
|
||
/* pthread condvar which will be broadcasted whenever there is a new
|
||
* message in the log. i3-dump-log uses this to implement -f (follow, like
|
||
* tail -f) in an efficient way. */
|
||
pthread_cond_t condvar;
|
||
#endif
|
||
} i3_shmlog_header;
|