Skip to content

ignatenkobrain/yxtrang

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yxtrang
-------

The 'trang is not a framework, it's a library. A toolkit. A loose
collection of small modules that do interesting things and which can
be used together if need be or not. It has no dependencies on any
external libraries. It is written in plain old C and is absolutely
free, with a BSD 2-clause license.

I've enjoyed rewriting code that I previously did in C++, and for
the most part it's cleaner, more concise, easier to understand and
faster.

From little things big things grow!


Current modules
---------------

base64:

 Base64 encoder/decoder.


daemon:

 Platform agnostic daemonizer code.


httpserver:

 Mechanism to easily write a custom HTTP handler (see examples/httpd).
 Should also serve as a template for any bespoke protocol.


json:

 JSON parser/generator.


jsonq:

 JSON quick and dirty search for named value. Doesn't allocate any
 memory and is useful for one-off key-value fetches.


linda:

 An implementation of the Linda coordination language as an idempotent
 JSON database built on top of 'store'. It has some limited indexing
 and ad-hoc querying capabilities (see examples/lindad).

list:

 Simple doubly-linked list/stack operations.


network:

 Threadpooled socket handling with support for select, poll, epoll
 and kqueue. Supports TCP (with TLS) and UDP (unicast, multicast and
 broadcast).


scriptlet:

 Engine to compile to bytecode and run micro-scripts. These can be used
 for event-handling/event-processing to transform input under user
 defined rules that are loaded at run-time.


skipbuck:

 Skiplist buckets. This unique variant of a skiplist uses a bucketized
 mod allowing more efficient storage (eg. 400M vs 150M keys on an 8GB
 system) than the original skiplist code (see below).


skiplist:

 A simple dictionary based on a skiplist. Optionally allow duplicates.
 Only the key/value pointers are stored, no data is copied, but the
 option exists to free keys and/or values if needed.


store:

 Append-mode log-structured store with index by UUID. There is no
 persistent disk index, rather it is regenerated in memory each time
 at start.


thread:

 Threads, threadpool, locks, atomics etc.


tree:

 Append-mode binary tree designed primarily for in-order (or near)
 insertion. Delete is supported with space recovery. This variant is
 bucketized and is extremely space-efficient: equal to skipbuck above
 but twice as fast.


uncle:

 Umbilical network client liason engine. Resource discovery. Uses UDP
 (broadcast for now, will move to multicast) datagrams. Uncle is scope
 based, meaning it can organize resources by group: those within the
 same scope can find each other, but not those outside. Uncle is not
 a centralized server. It's job is to facilitate decentralized and
 distributed services via mutual discovery.


uuid:

 Universal unique identifiers.



Build
-----

  git clone http://github.com/infradig/yxtrang
  cd yxtrang
  make

There are no outside code dependencies other than OpenSSL.

Compilers tested: gcc & clang with C99 and C11 options.
Also tcc and VC++2010.

Platforms tested: Linux, FreeBSD, WinXP, Win7+.

About

From little things big things grow.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 100.0%