Commit graph

66 commits

Author SHA1 Message Date
Uli Schlachter
c4f199fdae Fix get_strings_entry() to actually work
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-03-24 21:57:49 +01:00
Uli Schlachter
fbd56b6b75 Fix error checking in call to register_extensions()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-03-24 21:57:36 +01:00
Uli Schlachter
55961e7d79 Code generator: Implement errorcopy and eventcopy
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-03-24 21:57:14 +01:00
Uli Schlachter
e8b35be19f Begin work on a test suite
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-03-24 21:56:53 +01:00
Uli Schlachter
90dfd2682e Mark the auto-generated file as auto-generated
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-03-24 21:26:55 +01:00
Uli Schlachter
8f230431a6 static_extension_info_t: Use uint8_t again were possible
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>
2015-03-24 21:23:35 +01:00
Uli Schlachter
278a19c566 Implement a working code generator
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>
2015-03-24 21:18:53 +01:00
Uli Schlachter
71b018acc7 Add a first version of the code generator
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-03-24 20:21:31 +01:00
Uli Schlachter
92123f9f80 Include xcb_errors.h from errors.h
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>
2015-03-18 22:13:05 +01:00
Uli Schlachter
925ab1e7fb Define the "unknown foo" lists as strings
This gets rid of lots of relocations that were needed for the pointers into the
strings.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-03-18 22:11:48 +01:00
Uli Schlachter
514070caf8 Add a TODO about round-trips
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-03-18 22:02:38 +01:00
Uli Schlachter
a000b288db Remove pretty much unused member from xcb_errors_context_t
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>
2015-03-18 22:01:53 +01:00
Uli Schlachter
4b6a0d480c Fix memory leak in xcb_errors_context_new()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-03-18 22:01:35 +01:00
Uli Schlachter
c851709f01 Add and use helper macro for range checks
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-03-18 22:00:27 +01:00
Uli Schlachter
6d84293699 Fix off-by-one in length check
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-03-18 22:00:04 +01:00
Uli Schlachter
68cf24822c Initial version
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>
2015-03-18 21:43:05 +01:00