Compare commits
35
Commits
eb01667896
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
340cb98bde
|
||
|
|
4d54471bed
|
||
|
|
1bc3116835
|
||
|
|
64a0850aea
|
||
|
|
c5157ff447
|
||
|
|
32d66fb575
|
||
|
|
0d7326947c
|
||
|
|
f0d637df89
|
||
|
|
c6a8d65bbc
|
||
|
|
c82a367391
|
||
|
|
eba8ead2b7
|
||
|
|
022cce71fa
|
||
|
|
e0b9a31a57
|
||
|
|
ba4b3d43b8
|
||
|
|
287225de4d
|
||
|
|
952665bf3e
|
||
|
|
4cfaf9e2b3
|
||
|
|
285dacb785
|
||
|
|
bb75c8e4fa
|
||
|
|
8fdb6c702d
|
||
|
|
9c0f8df784
|
||
|
|
be66e0e00a
|
||
|
|
fb6170f2b6
|
||
|
|
c0ea24d92d
|
||
|
|
7f2156c3d7
|
||
|
|
998122267b
|
||
|
|
c7fdd8ec58
|
||
|
|
12063aecde
|
||
|
|
e90abbd03c
|
||
|
|
2453d4d0b1
|
||
|
|
0af42f975c
|
||
|
|
d4f81ffa89
|
||
|
|
fbb577f3f8
|
||
|
|
b7f6b0c757
|
||
|
|
f28aa74e6b
|
+4
-4
@@ -50,7 +50,7 @@ endif ()
|
||||
foreach (name ${tests})
|
||||
add_executable (test-${name} tests/${name}.c ${common_sources})
|
||||
add_threads (test-${name})
|
||||
target_link_libraries (test-${name} ${common_libraries})
|
||||
target_link_libraries (test-${name} PRIVATE ${common_libraries})
|
||||
add_test (NAME test-${name} COMMAND test-${name})
|
||||
endforeach ()
|
||||
|
||||
@@ -97,7 +97,7 @@ add_custom_target (test-lxdrgen-outputs ALL DEPENDS ${lxdrgen_outputs})
|
||||
set_source_files_properties (${lxdrgen_base}.c
|
||||
PROPERTIES HEADER_FILE_ONLY TRUE)
|
||||
add_executable (test-lxdrgen-c tests/lxdrgen.c ${lxdrgen_base}.c)
|
||||
target_include_directories (test-lxdrgen-c PUBLIC ${PROJECT_BINARY_DIR})
|
||||
target_include_directories (test-lxdrgen-c PRIVATE ${PROJECT_BINARY_DIR})
|
||||
add_test (NAME test-lxdrgen-c COMMAND test-lxdrgen-c)
|
||||
|
||||
set_source_files_properties (${lxdrgen_base}.cpp
|
||||
@@ -109,8 +109,8 @@ else ()
|
||||
add_executable (test-lxdrgen-cpp tests/lxdrgen.cpp
|
||||
${lxdrgen_base}.cpp tools/lxdrgen-cpp-posix.cpp)
|
||||
endif ()
|
||||
target_link_libraries (test-lxdrgen-cpp ${common_libraries})
|
||||
target_include_directories (test-lxdrgen-cpp PUBLIC ${PROJECT_BINARY_DIR})
|
||||
target_link_libraries (test-lxdrgen-cpp PRIVATE ${common_libraries})
|
||||
target_include_directories (test-lxdrgen-cpp PRIVATE ${PROJECT_BINARY_DIR})
|
||||
add_test (NAME test-lxdrgen-cpp COMMAND test-lxdrgen-cpp)
|
||||
|
||||
find_program (GO_EXECUTABLE go)
|
||||
|
||||
+4
-4
@@ -9,8 +9,8 @@ of as a successor to my other C library, libxtnd.
|
||||
You are supposed to import it as a git submodule and include the main source
|
||||
file directly everywhere you need it, setting feature flags as appropriate.
|
||||
Everything is declared "static". I have come to the conclusion that this style
|
||||
of C programming suits me the best, as it allows me to nearly forget about the
|
||||
mess that are header files.
|
||||
of C programming suits me best, as it allows me to nearly forget about the mess
|
||||
that are header files.
|
||||
|
||||
The API is intentionally unstable, which allows for easy refactoring.
|
||||
|
||||
@@ -53,12 +53,12 @@ lxdrgen-cpp-posix.cpp::
|
||||
lxdrgen-cpp-qt.cpp::
|
||||
lxdrgen-cpp-win32.cpp::
|
||||
LibertyXDR backend for C++, primarily targeting Win32 and its wide strings.
|
||||
Link the result together with one of the accompanied source files.
|
||||
Link the result together with one of the accompanying source files.
|
||||
|
||||
lxdrgen-go.awk::
|
||||
LibertyXDR backend for Go, supporting _encoding/json_ interfaces. It also
|
||||
produces optimized JSON marshallers (however, note that the _json.Marshaler_
|
||||
interface is bound to be underperforming, due to the amount of otherwise
|
||||
interface is bound to be underperforming, due to the number of otherwise
|
||||
avoidable memory allocations it necessitates).
|
||||
|
||||
lxdrgen-mjs.awk::
|
||||
|
||||
@@ -18,6 +18,6 @@ function (add_threads target)
|
||||
INTERFACE_COMPILE_OPTIONS "-pthread")
|
||||
endif ()
|
||||
if (CMAKE_THREAD_LIBS_INIT)
|
||||
target_link_libraries (${target} "${CMAKE_THREAD_LIBS_INIT}")
|
||||
target_link_libraries (${target} PUBLIC "${CMAKE_THREAD_LIBS_INIT}")
|
||||
endif ()
|
||||
endfunction ()
|
||||
|
||||
@@ -4,9 +4,10 @@ set (CMAKE_SYSTEM_PROCESSOR "x86_64")
|
||||
set (CMAKE_C_COMPILER "x86_64-w64-mingw32-gcc")
|
||||
set (CMAKE_CXX_COMPILER "x86_64-w64-mingw32-g++")
|
||||
set (CMAKE_RC_COMPILER "x86_64-w64-mingw32-windres")
|
||||
set (CMAKE_OBJDUMP "x86_64-w64-mingw32-objdump")
|
||||
|
||||
# Remember to set WINEPATH for library dependencies
|
||||
set (CMAKE_CROSSCOMPILING_EMULATOR "wine64")
|
||||
set (CMAKE_CROSSCOMPILING_EMULATOR "wine")
|
||||
|
||||
set (CMAKE_FIND_ROOT_PATH "/usr/x86_64-w64-mingw32")
|
||||
|
||||
|
||||
+1
-1
@@ -1678,7 +1678,7 @@ mpd_client_add_task
|
||||
// later flushed if an early ACK or OK arrives).
|
||||
hard_assert (!self->in_list);
|
||||
|
||||
struct mpd_client_task *task = xcalloc (1, sizeof *self);
|
||||
struct mpd_client_task *task = xcalloc (1, sizeof *task);
|
||||
task->callback = cb;
|
||||
task->user_data = user_data;
|
||||
LIST_APPEND_WITH_TAIL (self->tasks, self->tasks_tail, task);
|
||||
|
||||
+1539
-121
File diff suppressed because it is too large
Load Diff
@@ -108,6 +108,17 @@ extern char **environ;
|
||||
#define ATTRIBUTE_SENTINEL
|
||||
#endif // ! __GNUC__ || __GNUC__ < 4
|
||||
|
||||
// Since Clang 2.9 and later GCC 5
|
||||
#ifndef __has_attribute
|
||||
#define __has_attribute(x) 0
|
||||
#endif
|
||||
|
||||
#if __has_attribute (nonstring)
|
||||
#define ATTRIBUTE_NONSTRING __attribute__ ((nonstring))
|
||||
#else
|
||||
#define ATTRIBUTE_NONSTRING
|
||||
#endif
|
||||
|
||||
#define N_ELEMENTS(a) (sizeof (a) / sizeof ((a)[0]))
|
||||
|
||||
#define BLOCK_START do {
|
||||
@@ -838,7 +849,7 @@ random_bytes (void *output, size_t len, struct error **e)
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
static unsigned char g_siphash_key[16] = "SipHash 2-4 key!";
|
||||
static unsigned char g_siphash_key[16] ATTRIBUTE_NONSTRING = "SipHash 2-4 key!";
|
||||
|
||||
static inline void
|
||||
siphash_wrapper_randomize (void)
|
||||
|
||||
+5
-5
@@ -20,7 +20,7 @@ whatever is appropriate in their target language.
|
||||
|
||||
Primitive data types
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
Like in XDR, all data is serialized in the network byte order, i.e., big-endian.
|
||||
Like in XDR, all data is serialized in network byte order, i.e. big-endian.
|
||||
|
||||
* *void*: 0 bytes
|
||||
+
|
||||
@@ -51,7 +51,7 @@ typeless integer constants:
|
||||
|
||||
const VERSION = 1;
|
||||
|
||||
The value can be either a name of another previously defined constant,
|
||||
The value can be either the name of a previously defined constant,
|
||||
or an immediate decimal value, which may not contain leading zeros.
|
||||
|
||||
Enumerations
|
||||
@@ -60,7 +60,7 @@ An *enum* is an *i8* with uniquely named values, in their own namespace.
|
||||
|
||||
Values can be either specified explicitly, in the same way as with a constant,
|
||||
or they can be left implicit, in which case names assume a value that is one
|
||||
larger than their predecessor. Zero is reserved for internal use, thus
|
||||
larger than their predecessor. Zero is reserved for internal use. Thus,
|
||||
enumerations implicitly begin with a value of one. For example, these form
|
||||
a sequence from one to three:
|
||||
|
||||
@@ -80,7 +80,7 @@ definitions can be arbitrarily syntactically nested, as in C.
|
||||
u8 version; // Version of this report.
|
||||
struct Item {
|
||||
Vehicle kind; // The vehicle in question.
|
||||
i32 count; // How many vehicle of that kind there are.
|
||||
i32 count; // How many vehicles of that kind there are.
|
||||
} items<>; // Reported items.
|
||||
};
|
||||
|
||||
@@ -98,7 +98,7 @@ and always-present field, which must be a tag *enum*:
|
||||
|
||||
There is no *case* fall-through.
|
||||
Unless *default* is present, only the listed enumeration values are valid.
|
||||
Any *default* must currently be empty.
|
||||
Any *default* must currently be devoid of data.
|
||||
|
||||
Framing
|
||||
-------
|
||||
|
||||
+2
-2
@@ -139,9 +139,9 @@ function format(line, v) {
|
||||
while (line) {
|
||||
if (match(line, /^[+][+][+][^+]+[+][+][+]/)) {
|
||||
v = v substr(line, RSTART + 3, RLENGTH - 6)
|
||||
} else if (match(line, /^__[^_]+__/)) {
|
||||
} else if (match(line, /^__([^_]+.)*[^_]+__/)) {
|
||||
v = v "\\fI" substr(line, RSTART + 2, RLENGTH - 4) "\\fP"
|
||||
} else if (match(line, /^[*][*][^*]+[*][*]/)) {
|
||||
} else if (match(line, /^[*][*]([^*]+.)*[^*]+[*][*]/)) {
|
||||
v = v "\\fB" substr(line, RSTART + 2, RLENGTH - 4) "\\fP"
|
||||
} else if (match(line, /^_[^_]+_/) &&
|
||||
substr(line, RSTART + RLENGTH) !~ /^[[:alnum:]]/) {
|
||||
|
||||
+4
-1
@@ -164,8 +164,11 @@ function codegen_struct_field(d, cg, f, dispose, serialize, deserialize) {
|
||||
indent(sprintf(serialize, f "[i]")))
|
||||
}
|
||||
|
||||
# Avoiding a compiler warning on platforms where SIZE_MAX > UINT32_MAX.
|
||||
append(cg, "deserialize", sprintf(CodegenDeserialize["u32"], f "_len") \
|
||||
"\tif (!(" f " = calloc(" f "_len + 1, sizeof *" f ")))\n" \
|
||||
"\tif (" f "_len + 0ull == SIZE_MAX)\n" \
|
||||
"\t\treturn false;\n" \
|
||||
"\tif (!(" f " = calloc(" f "_len + 1ull, sizeof *" f ")))\n" \
|
||||
"\t\treturn false;\n")
|
||||
if (d["type"] == "u8" || d["type"] == "i8") {
|
||||
append(cg, "deserialize",
|
||||
|
||||
@@ -35,7 +35,7 @@ is garbage-collected, unless *wait* has collected the process group leader.
|
||||
|
||||
wdye.expect ([pattern1, ...])
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Waits until any pattern is ready, in order.
|
||||
Waits until any of the patterns is ready, in order.
|
||||
When no *timeout* (or *default*) patterns are included, one is added implicitly.
|
||||
|
||||
The function returns the matching _pattern_'s values, while replacing
|
||||
@@ -44,8 +44,8 @@ passing the matching _pattern_ as their sole argument.
|
||||
|
||||
wdye.timeout {[timeout, ] [value1, ...]}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Returns a new timeout _pattern_. When no *timeout* is given, which is specified
|
||||
in seconds, a default timeout value is assumed. Any further values
|
||||
Returns a new timeout _pattern_. The *timeout* is specified in seconds.
|
||||
When none is given, a default timeout value is assumed. Any further values
|
||||
are remembered to be later processed by *expect*.
|
||||
|
||||
wdye.continue ()
|
||||
@@ -55,21 +55,21 @@ all processing.
|
||||
|
||||
PROCESS.buffer
|
||||
~~~~~~~~~~~~~~
|
||||
A string with the _process_' current read buffer contents.
|
||||
A string with the _process_'s current read buffer contents.
|
||||
|
||||
PROCESS.pid
|
||||
~~~~~~~~~~~
|
||||
An integer with the _process_' process ID, or -1 if *wait* has collected it.
|
||||
An integer with the _process_'s process ID, or -1 if *wait* has collected it.
|
||||
|
||||
PROCESS.term
|
||||
~~~~~~~~~~~~
|
||||
A table with the _process_' *terminfo*(5) capabilities,
|
||||
A table with the _process_'s *terminfo*(5) capabilities,
|
||||
notably containing all **key_...** codes.
|
||||
This functionality may not be enabled, then this table will always be empty.
|
||||
|
||||
PROCESS:send ([string, ...])
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Writes the given strings to the _process_' terminal slave,
|
||||
Writes the given strings to the _process_'s terminal slave,
|
||||
and returns the _process_ for method chaining.
|
||||
|
||||
Beware of echoing and deadlocks, as only *expect* can read from the _process_,
|
||||
@@ -85,7 +85,7 @@ When the *nocase* option is _true_, the expression will be matched
|
||||
case-insensitively.
|
||||
|
||||
Unless the *notransfer* option is _true_, all data up until the end of the match
|
||||
will be erased from the _process_' read buffer upon a successful match.
|
||||
will be erased from the _process_'s read buffer upon a successful match.
|
||||
|
||||
PROCESS:exact {literal [, nocase=true] [, notransfer=true] [, value1, ...]}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Reference in New Issue
Block a user