A lightweight library for parsing command line arguments into structured data formats like JSON. C-CLON provides a simple, human-readable syntax for command line interfaces while maintaining powerful data structure capabilities.
C-CLON is a library that allows parsing CLON (Command Line Object Notation) into structured data formats. It bridges the gap between simple command line interfaces and complex data structures.
- Simple, intuitive syntax for command line arguments
- Support for complex data structures:
- Key-value pairs
- Arrays
- Nested objects
- Multiple data types (strings, numbers, booleans, null)
- Extensible writer system for different output formats
- Memory efficient C implementation
- No external dependencies
- Comprehensive error handling
- Thread-safe operations
Strings are used for object keys and can also be values. The syntax is the same for both.
For simple strings using only characters, numbers and underscores parentheses can be omitted.
some_name
For complex strings with special characters, single or double quotes can be used to enclose the string.
"wild_string'n"
Both integers and floating point numbers are supported.
30
0.3e-10
Booleans are represented by the keywords true and false.
true
false
Null is represented by the keyword null.
null
Arrays are represented by square brackets and only contain values separated by commas.
[name_1,name_2,name_3]
Also, Arrays can be nested.
[[1,2],[3,4]]
Objects are represented by square brackets and contain only key-value pairs separated by commas.
[name=john,age=30]
For highly nested objects, other key notations can be used. The following examples produce equivalent results.
[db=[user=[name=john]]]
db[user[name]]=john
db.user.name=john