Blink Protocol in C.
Highlights
- Hand coded schema parser and lexer
- Compact form encode/decode primitives
- Requires malloc but this can be a simple linear allocator
- User configurable IO streams
- Tests
Integrating With Your Project
Example makefile snippet:
1 INCLUDES += $(DIR_UBLINK)/include
3 VPATH += $(DIR_UBLINK)/src
5 SRC += $(wildcard $(DIR_UBLINK)/src/*.c)
7 OBJECTS += $(SRC:.c=.o)
Add #include "ublink.h"
to source files that use the UBlink API.
Compile Time Options
The following options can be defined at compile time.
1 # remove asserts (default: not defined)
4 # include a file before BLINK_ERROR and BLINK_DEBUG are defined (default: not defined)
5 DEFINES += -DBLINK_DEBUG_INCLUDE='#include <ruby.h>'
7 # remove all BLINK_DEBUG() and BLINK_ERROR() messages from code (default: not defined)
8 DEFINES += -DBLINK_NO_DEBUG_MESSAGE
10 # define your own BLINK_DEBUG() macro (default: defined as shown)
11 DEFINES += -DBLINK_DEBUG(...)='do{fprintf(stderr, __VA_ARGS__);fprintf(stderr, "\n");}while(0);'
13 # define your own BLINK_ERROR() macro (default: defined as shown)
14 DEFINES += -DBLINK_ERROR(...)='do{fprintf(stderr, __VA_ARGS__);fprintf(stderr, "\n");}while(0);'
16 # define the largest literal or name that can be handled by the lexer (default: 100)
17 DEFINES += -DBLINK_TOKEN_MAX_SIZE=100
19 # redefine the prefix (default: BLINK_)
20 # example: remove the prefix entirely
See Also
SlowBlink: Blink Protocol in Ruby
License
uBlink has an MIT license.
Contact
conta.nosp@m.ct@c.nosp@m.jh.id.nosp@m..au