|
eolib 0.5.0
A core C library for writing applications related to Endless Online
|
The EO protocol uses two mechanisms for optional data: chunked delimiters and padded fixed-length strings.
Reading optional fields with chunked mode:
In chunked reading mode, attempting to read past the end of the current chunk returns 0 (or an empty string) rather than EO_BUFFER_UNDERRUN. This lets you safely read fields that may or may not be present without extra length checks.
Writing optional fixed-length strings with padding:
Pass padded = true to eo_writer_add_fixed_string() or eo_writer_add_fixed_encoded_string() to right-pad a shorter string with 0xFF bytes up to the declared length.
Passing NULL as the string value is treated as an empty string and writes nothing (the field is simply omitted), which is useful when an optional trailing field is not present.