Coder Social home page Coder Social logo

libnereon's Introduction

LIBNEREON

Build Status

Table of Contents generated with DocToc

Introduction

libnereon is a multi-configuration parser library implemented in C.
This library parses the following configurations by HCL.

  • The command-line arguments.
  • The environment variables.
  • The configuration files.

NOS and NOC syntax

libnereon uses NOS and NOC configurations based on HCL syntax.

NOS configuration

NOS is the NereOn configuration Schema syntax that allows describing what configuration parameters are allowed. It has the following HCL syntax:

config_option <name> {
	type = <type>

	cmdline "switch" {
		short = <short command line switch>
		long  = <long command line switch>
	}

	cmdline "description" {
		short = <short command line description>
		long  = <long command line description>
	}

	env    = <environment variable>
	config = <NOC configuration keyword>

	default = <default value>
}

  • type has the following configuration types:
    • basic types : int, bool, string, float, array
    • config : the configuration option with this type describes how to specify configuration file from
      command line and environment variable.
    • helper : the configuration option with this type describes command line options how to show help message.
  • cmdline switch describes short and long switch options on command line.
  • cmdline description describes short and long descriptions on command line.
  • env describes environment variable to specify the option.
  • config describes NOC keyword to specify the option.
  • default specifies default value of the option.

NOC configuration

NOC is the NereOn Configuration syntax to allow setting configuration

libnereon API functions

NOTE: NOS configuration should be compiled with the projects which is using libnereon. nos2cc converts NOS configuration to C source file.
To convert NOS to C source file, it needs to execute the following command.

nos2cc <NOS configuration file> <NOS CC output path> <prefix of function name>

The project should compile <NOS filename>.c and <NOS filename>.h, and call get_<prefix of function name>_nos_cfg function to get NOS contents.

libnereon's People

Contributors

jjr840430 avatar drystone avatar

Watchers

Anton Strogonoff avatar James Cloos avatar

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.