If an extension that we support is not present in the X11 server, this is not a
fatal error. We can just skip this extension. However, the code implementing
this accidentally also made calloc()-failures non-fatal which is wrong.
Spotted by Ran Benita.
Signed-off-by: Uli Schlachter <psychon@znc.in>
If some new events are added to an extension, older implementations register a
smaller portion of the event number space than this library possible knows. So
we cannot just look for some extension that has some code "in range", but we
need to find the best one (with the largest base).
Signed-off-by: Uli Schlachter <psychon@znc.in>
This is based on util-cursor's build system and libxcb/configure.ac for finding
xcb-proto's XML files.
Signed-off-by: Uli Schlachter <uli.schlachter@informatik.uni-oldenburg.de>
The previous commit changed these fields into uint16_t since xproto tries to
assign value 256 here. However, this isn't actually necessary, so this commit
reverts that and instead makes the code generator emit a 0 here, since this
value isn't used anyway.
Signed-off-by: Uli Schlachter <psychon@znc.in>
With this change, the output of the code generator actually compiles and can be
linked into a library. This also changes the API between the generated code and
the library code. Hopefully, this API is nicer.
The code generator generates a function register_extensions() that looks up all
extensions and calls register_extension() for each one. Also, a global variable
xproto_info is exported which contains the information for all core requests and
also provides fallback names for unknown major codes / event codes / error
codes.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This makes errors.h self-contained. It needs the definitions of uint8_t &
friends that we get through xcb.h from stdint.h.
Signed-off-by: Uli Schlachter <psychon@znc.in>
The xcb_connection_t is only needed during xcb_errors_context_new() and can be
passed around via arguments here.
Signed-off-by: Uli Schlachter <psychon@znc.in>
This is an initial prototype on how this library might look like. All the parts
which should be auto-generated from XCB's XML protocol description are missing.
The C parts should work fine, but are completely untested.
Signed-off-by: Uli Schlachter <psychon@znc.in>