Giter Site home page Giter Site logo

shubhamt2221 / libeconf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from opensuse/libeconf

0.0 0.0 0.0 595 KB

Enhanced config file parser, which merges config files placed in several locations into one.

License: MIT License

C 91.26% Meson 3.96% CMake 3.54% Shell 1.24%

libeconf's Introduction

libeconf

libeconf is a highly flexible and configurable library to parse and manage key=value configuration files. It reads configuration file snippets from different directories and builds the final configuration file for the application from it.

The first file is the vendor provided configuration file. There are two methods of overriding this vendor settings: Copy the file from /usr/vendordir to /etc and modify the settings (see Example 1). Alternatively, a directory named file.suffix.d/ within /etc can be created, with drop-in files in the form name.suffix (see Example 2). These files contain only the changes of the specific settings the user is interested in. There can be several such drop-in files, they are processed in lexicographic order of their filename.

The first method is useful to override the complete configuration file with an own one, the vendor supplied configuration is ignored.

So, if /etc/example.suffix exists, /usr/vendor/example.suffix and /usr/vendor/example.suffix.d/*.suffix will not be read. The disadvantage is, that changes of the vendor configuration file, due e.g. an package update, are ignored and the user has to manually merge them.

The other method will continue to use /usr/vendor/example.suffix as base configuration file and merge all changes from /etc/example.suffix.d/*.suffix. So the user will automatically get improvements of the vendor, with the drawback, that they could be incompatible with the user made changes.

Example 1

If a /etc/example.suffix files exists:

  • /etc/example.suffix
  • /etc/example.suffix.d/*.suffix

Example 2

The list of files and directories read if no /etc/example.suffix file exists:

  • /usr/vendor/example.suffix
  • /usr/vendor/example.suffix.d/*.suffix
  • /etc/example.suffix.d/*.suffix

API

The API is written in plain C. The description can be found here :https://opensuse.github.io/libeconf/

libeconf's People

Contributors

thkukuk avatar parlt91 avatar schubi2 avatar sysrich avatar mwilck avatar conan-kudo avatar laenion avatar nodeg avatar mmuman avatar adammajer avatar andhe avatar stephanlachnit 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.