uBlink  0.0.1
TheBlinkProtocol
uBlink

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
2 
3 VPATH += $(DIR_UBLINK)/src
4 
5 SRC += $(wildcard $(DIR_UBLINK)/src/*.c)
6 
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)
2 DEFINES += -DNDEBUG
3 
4 # include a file before BLINK_ERROR and BLINK_DEBUG are defined (default: not defined)
5 DEFINES += -DBLINK_DEBUG_INCLUDE='#include <ruby.h>'
6 
7 # remove all BLINK_DEBUG() and BLINK_ERROR() messages from code (default: not defined)
8 DEFINES += -DBLINK_NO_DEBUG_MESSAGE
9 
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);'
12 
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);'
15 
16 # define the largest literal or name that can be handled by the lexer (default: 100)
17 DEFINES += -DBLINK_TOKEN_MAX_SIZE=100
18 
19 # redefine the prefix (default: BLINK_)
20 # example: remove the prefix entirely
21 DEFINES += -DBLINK_

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