Code Monkey home page Code Monkey logo

azorian's Introduction

Build Status

Azorian

Azorian is a library implementing the multiformat specifications in C11. Azorian aims to be clean and lightweight - both on system resources and dependency chains.

Currently, to build just the library, no additional dependencies are required - just the C standard library. To build the tests, the Unity C unit testing framework is needed.

Azorian is still in early development and, as such, is unstable right now. Codecs for most of the multiformats are already implemented though. Once stable, Azorian is ideal for C or C++ implementations of libp2p, full IPFS implementations, or any other project which might want to exploit the power of the multiformat specifications for future-proof, self-describing data formats.

Building

$ git clone [email protected]:jmcph4/azorian.git
$ cd azorian

Release

$ make

Development

$ make debug

Tests

$ git clone https://github.com/throwtheswitch/unity.git
$ cp unity/src include/unity -r
$ make debug
$ make tests
$ ./run_tests.sh

Documentation

$ make docs

Note that this requires Doxygen.

Licensing

Please consult LICENSE.

Contributing

Azorian currently welcomes all contributors and the maintainers strive to comply with GitHub best practices.

As such, please consult CONTRIBUTING for all contribution information.

Further Information

For any further information about the project, the wiki is the best place to go.

azorian's People

Contributors

jmcph4 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

azorian's Issues

Incorrect memory allocation in unsigned-varint implementation

As of Version 0.7.0, the function az_uvarint_decode allocates a buffer of length bytearray.len, with each type being the width of uint8_t; however, this buffer is assigned to a variable of type az_bytearray_t, not uint8_t. As the widths of uint8_t and az_bytearray_t differ greatly, this is quite a serious memory corruption issue.

The offending line is as follows:

(*uvarint)->bytes = calloc(bytearray.len, sizeof(uint8_t));

Add static code analysis to CI build chain

Static code checking needs to be added to the build process and Continuous Integration (CI) build chain.
I have struggled to add OCLint to our Travis CI configuration (over 20 failed builds in fact) to no avail. OCLint seems to do the actual job of static checking well enough; however, it is extremely intolerant to different build systems and CI (despite what their documentation might suggest).

Add memory checking to CI build chain

Automated memory checking is currently not performed anywhere along the CI build chain. To ensure memory safety, this will need to change.

The best tool for this is likely Valgrind; however, ASAN is also an option.

Add code coverage metrics to CI build chain

To assist with QA/QC, code coverage for the unit test suite is desperately needed. Furthermore, this must be able to be added to the existing automated CI chain via Travis.

Feel free to recommend code coverage solutions for C code in this thread.

Typo in dummy type

There is a dummy type declared in src/azorian.h to satisfy ISO C11 compliance taking issue with empty translation units. This dummy type should be called __dummy_type_for_iso_compliance; however, (at least currently) it is called __dummy_type_for_ios_compliance:

typedef int __dummy_type_for_ios_compliance;

Remove magic numbers in codec functions

Often, as a quick validation check, the length of a az_bytearray_t will be checked to ensure it's at least three bytes long, due to inference from the actual multiformat specifications themselves. While this is technically valid, the current codebase is now littered with nasty magic numbers.

These belong in a macro constant of some sort, perhaps defined in src/azorian.h.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.