sysrepo-crystal

Crystal C bindings for sysrepo

Build Status

sysrepo-crystal

These are crystal bindings for the sysrepo library.

These bindings are compatible with the master branch of sysrepo v1.0 and above ( legacy is not supported ).

The bindings themselves are heavily based on the CPP bindings located in the same repo.

Can be used in conjunction with the libyang-crystal bindings for the libyang library.

libsysrepo-crystal

As part of the bindings, a small shim will be generated upon install, libsysrepo-crystal.a.

This shim is used to facilitate integration with the sysrepo API.

The sysrepo API requires an opaque pointer to be created on the application side and provided to the sysrepo API where it will be populated.

I could not find a to create a null opaque pointer within crystal (application side ) and then provide it to the sysrepo API via the crystal binding methods that worked.

Therefore the shim was created to extend the sysrepo API by providing C functions that return null opaque pointers for various sysrepo types.

Prerequisites

sysrepo will need to be installed on your system, which itself requires libyang to be installed.

For installation instructions, please see their respective repos linked above.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      sysrepo-crystal:
        github: smalls12/sysrepo-crystal
    
  2. Run shards install

Usage

require "sysrepo-crystal"

Examples can be found in the sysrepo-crystal-examples repo:

Contributing

  1. Fork it (https://github.com/your-github-user/sysrepo-crystal/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

Repository

sysrepo-crystal

Owner
Statistic
  • 0
  • 0
  • 0
  • 0
  • 1
  • over 4 years ago
  • February 29, 2020
License

MIT License

Links
Synced at

Thu, 21 Nov 2024 20:27:12 GMT

Languages