The conf Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The conf Reference Manual

This is the conf Reference Manual, version 1.0.1, generated automatically by Declt version 2.4 patchlevel 1 "Will Decker" on Fri May 24 08:41:03 2019 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

conf

Simple configuration file manipulator for projects.

Getting Started in conf

Dependencies

cl-fad

Installation

1 - Download conf system

By quicklisp:

IN PROGRESS...

or directly from github:

git clone https://github.com/noloop/conf.git

2 - Install conf

By quicklisp:

IN PROGRESS...

or directly from asdf:

(asdf:load-system :conf)

Note: Remember to configure asdf to find your directory where you downloaded the libraries (asdf call them "systems") above, if you do not know how to make a read at: https://lisp-lang.org/learn/writing-libraries.

Initialize conf

(init-conf "~/lisp/config/" "my-system.conf")

Set conf directory

(let ((conf (init-conf "~/lisp/config/" "my-system.conf")))
     (set-conf-directory conf "/home/your/some/"))

Get conf directory

(let ((conf (init-conf "~/lisp/config/" "my-system.conf")))
     (get-conf-directory conf)
     (set-conf-directory conf "/home/your/some/")
     (get-conf-directory conf))

;; CL-USER> "~/lisp/config/"
;; CL-USER> "/home/your/some"

Set conf file

(let ((conf (init-conf "~/lisp/config/" "my-system.conf")))
     (set-conf-file conf "my-file.conf"))

Get conf file

(let ((conf (init-conf "~/lisp/config/" "my-system.conf")))
     (get-conf-file conf)
     (set-conf-file conf "my-file.conf")
     (get-conf-file conf))

;; CL-USER> "my-system.conf"
;; CL-USER> "my-file.conf"

Get conf full path

(let ((conf (init-conf "~/lisp/config/" "my-system.conf")))
     (get-conf-full-path conf)
     (set-conf-directory conf "/home/your/some/")
     (set-conf-file conf "my-file.conf")
     (get-conf-full-path conf))

;; CL-USER> "~/lisp/config/my-system.conf"
;; CL-USER> "/home/your/some/my-file.conf"

Get conf hash

(let ((conf (init-conf "~/lisp/config/" "my-system.conf")))
     (get-conf-hash conf))

;; #<HASH-TABLE :TEST EQL :COUNT 5 {10033E4713}>

Replace conf

The replace-conf is a function that requires user interaction, so you will have to answer some questions she will ask you to configure your file. It works like this:

The replace-conf function will only ask you what you have in your configuration file. Example of a configuration file called "something.conf":

(:author "Unknown"
:maintainer "you"
:license "UNLICENSED"
:version "0.0.0"
:git-service "github")

So in that case replace-conf will ask you to replace the five fields :author, :maintainer, :license, :version and :git-service, if you add more fields, it will ask you all what you write in your file configuration. By default the conf will not create the configuration file, so there will be no default fields to be overridden with replace-conf if you do not configure a config file, then you should start conf with init-conf showing where to find the file you wrote.

Sample questions from the "something.conf" file:

CL-USER> (defvar *c* (conf:init-conf "/home/your/lisp/projects/test-project/" "test-project.conf"))
CL-USER> (conf:replace-conf *c*)
AUTHOR?(actual your) I
MAINTAINER?(actual your) I
LICENSE?(actual GPL v3) 
VERSION?(actual 0.1.0) 
GIT-SERVICE?(actual github) 

File saved successfully.
NIL

Keep current configuration in replace-conf

Note that you can set the field you want to leave as the current configuration that is already in your configuration file. Como é mostrado abaixo:

CL-USER> (conf:replace-conf c)
AUTHOR?(actual your) I
MAINTAINER?(actual your) I
LICENSE?(actual GPL v3) 

The LICENSE field will continue to have the current value of "GPL v3", so you only have to enter enter without adding any characters for the read-line to read.

API

function (init-conf directory file-name)

function (set-conf-directory conf new-directory)

function (get-conf-directory conf)

function (set-conf-file conf new-file-name)

function (get-conf-file conf)

function (get-conf-full-path conf)

function (get-conf-hash conf)

function (replace-conf conf)


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 conf

Maintainer

noloop <noloop@zoho.com>

Author

noloop <noloop@zoho.com>

Home Page

https://github.com/noloop/conf

Source Control

(:git "git@github.com:noloop/conf.git")

Bug Tracker

https://github.com/noloop/conf/issues

License

GNU General Public License v3.0

Description

Simple configuration file manipulator for projects.

Long Description

# conf

### _Simple configuration file manipulator for projects._

### Getting Started in conf

### Dependencies

[cl-fad](https://github.com/edicl/cl-fad)

### Installation

**1 - Download conf system**

By quicklisp:

“‘
IN PROGRESS...
“‘

or directly from github:

“‘
git clone https://github.com/noloop/conf.git
“‘

**2 - Install conf**

By quicklisp:

“‘
IN PROGRESS...
“‘

or directly from asdf:

“‘lisp
(asdf:load-system :conf)
“‘

_**Note: Remember to configure asdf to find your directory where you downloaded the libraries (asdf call them "systems") above, if you do not know how to make a read at: https://lisp-lang.org/learn/writing-libraries.**_

### Initialize conf

“‘lisp
(init-conf "~/lisp/config/" "my-system.conf")

“‘

### Set conf directory

“‘lisp
(let ((conf (init-conf "~/lisp/config/" "my-system.conf")))
(set-conf-directory conf "/home/your/some/"))
“‘

### Get conf directory

“‘lisp
(let ((conf (init-conf "~/lisp/config/" "my-system.conf")))
(get-conf-directory conf)
(set-conf-directory conf "/home/your/some/")
(get-conf-directory conf))

;; CL-USER> "~/lisp/config/"
;; CL-USER> "/home/your/some"
“‘

### Set conf file

“‘lisp
(let ((conf (init-conf "~/lisp/config/" "my-system.conf")))
(set-conf-file conf "my-file.conf"))
“‘

### Get conf file

“‘lisp
(let ((conf (init-conf "~/lisp/config/" "my-system.conf")))
(get-conf-file conf)
(set-conf-file conf "my-file.conf")
(get-conf-file conf))

;; CL-USER> "my-system.conf"
;; CL-USER> "my-file.conf"
“‘

### Get conf full path

“‘lisp
(let ((conf (init-conf "~/lisp/config/" "my-system.conf")))
(get-conf-full-path conf)
(set-conf-directory conf "/home/your/some/")
(set-conf-file conf "my-file.conf")
(get-conf-full-path conf))

;; CL-USER> "~/lisp/config/my-system.conf"
;; CL-USER> "/home/your/some/my-file.conf"
“‘

### Get conf hash

“‘lisp
(let ((conf (init-conf "~/lisp/config/" "my-system.conf")))
(get-conf-hash conf))

;; #<HASH-TABLE :TEST EQL :COUNT 5 {10033E4713}>
“‘

### Replace conf
The replace-conf is a function that requires user interaction, so you will have to answer some questions she will ask you to configure your file. It works like this:

The replace-conf function will only ask you what you have in your configuration file. Example of a configuration file called "something.conf":

“‘lisp
(:author "Unknown"
:maintainer "you"
:license "UNLICENSED"
:version "0.0.0"
:git-service "github")
“‘

So in that case replace-conf will ask you to replace the five fields :author, :maintainer, :license, :version and :git-service, if you add more fields, it will ask you all what you write in your file configuration. By default the conf will not create the configuration file, so there will be no default fields to be overridden with replace-conf if you do not configure a config file, then you should start conf with init-conf showing where to find the file you wrote.

Sample questions from the "something.conf" file:

“‘lisp
CL-USER> (defvar *c* (conf:init-conf "/home/your/lisp/projects/test-project/" "test-project.conf"))
CL-USER> (conf:replace-conf *c*)
AUTHOR?(actual your) I
MAINTAINER?(actual your) I
LICENSE?(actual GPL v3)
VERSION?(actual 0.1.0)
GIT-SERVICE?(actual github)

File saved successfully.
NIL
“‘

#### Keep current configuration in replace-conf

Note that you can set the field you want to leave as the current configuration that is already in your configuration file. Como é mostrado abaixo:

“‘lisp
CL-USER> (conf:replace-conf c)
AUTHOR?(actual your) I
MAINTAINER?(actual your) I
LICENSE?(actual GPL v3)
“‘

The LICENSE field will continue to have the current value of "GPL v3", so you only have to enter enter without adding any characters for the read-line to read.

## API

function **(init-conf directory file-name)**

function **(set-conf-directory conf new-directory)**

function **(get-conf-directory conf)**

function **(set-conf-file conf new-file-name)**

function **(get-conf-file conf)**

function **(get-conf-full-path conf)**

function **(get-conf-hash conf)**

function **(replace-conf conf)**

Version

1.0.1

Dependency

cl-fad

Source

conf.asd (file)

Component

src (module)


Next: , Previous: , Up: Top   [Contents][Index]

3 Modules

Modules are listed depth-first from the system components tree.


Previous: , Up: Modules   [Contents][Index]

3.1 conf/src

Parent

conf (system)

Location

src/

Components

Next: , Previous: , Up: Top   [Contents][Index]

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

4.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.1 conf.asd

Location

conf.asd

Systems

conf (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.2 conf/src/package.lisp

Parent

src (module)

Location

src/package.lisp

Packages

noloop.conf


Previous: , Up: Lisp files   [Contents][Index]

4.1.3 conf/src/conf.lisp

Dependency

package.lisp (file)

Parent

src (module)

Location

src/conf.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

5.1 noloop.conf

Source

package.lisp (file)

Nickname

conf

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

6.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

6.1.1 Functions

Function: get-conf-directory CONF
Package

noloop.conf

Source

conf.lisp (file)

Function: get-conf-file CONF
Package

noloop.conf

Source

conf.lisp (file)

Function: get-conf-full-path CONF
Package

noloop.conf

Source

conf.lisp (file)

Function: get-conf-hash CONF
Package

noloop.conf

Source

conf.lisp (file)

Function: init-conf DIRECTORY FILE-NAME
Package

noloop.conf

Source

conf.lisp (file)

Function: replace-conf CONF
Package

noloop.conf

Source

conf.lisp (file)

Function: set-conf-directory CONF NEW-DIRECTORY
Package

noloop.conf

Source

conf.lisp (file)

Function: set-conf-file CONF NEW-FILE-NAME
Package

noloop.conf

Source

conf.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

6.2 Internal definitions


Previous: , Up: Internal definitions   [Contents][Index]

6.2.1 Functions

Function: hash-table-for-string YOUR-HASH
Package

noloop.conf

Source

conf.lisp (file)

Function: list-for-hash-table YOUR-LIST
Package

noloop.conf

Source

conf.lisp (file)

Function: load-conf-file-for-hash-table CONF
Package

noloop.conf

Source

conf.lisp (file)

Function: load-file FILE-NAME
Package

noloop.conf

Source

conf.lisp (file)

Function: read-field FIELD-NAME ACTUAL-VALUE
Package

noloop.conf

Source

conf.lisp (file)

Function: replace-conf-fields YOUR-HASH
Package

noloop.conf

Source

conf.lisp (file)

Function: save-conf-file CONF CONF-HASH
Package

noloop.conf

Source

conf.lisp (file)

Function: save-file FILE-NAME STG
Package

noloop.conf

Source

conf.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L   M  
Index Entry  Section

C
conf.asd: The conf<dot>asd file
conf/src: The conf/src module
conf/src/conf.lisp: The conf/src/conf<dot>lisp file
conf/src/package.lisp: The conf/src/package<dot>lisp file

F
File, Lisp, conf.asd: The conf<dot>asd file
File, Lisp, conf/src/conf.lisp: The conf/src/conf<dot>lisp file
File, Lisp, conf/src/package.lisp: The conf/src/package<dot>lisp file

L
Lisp File, conf.asd: The conf<dot>asd file
Lisp File, conf/src/conf.lisp: The conf/src/conf<dot>lisp file
Lisp File, conf/src/package.lisp: The conf/src/package<dot>lisp file

M
Module, conf/src: The conf/src module

Jump to:   C   F   L   M  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   F   G   H   I   L   R   S  
Index Entry  Section

F
Function, get-conf-directory: Exported functions
Function, get-conf-file: Exported functions
Function, get-conf-full-path: Exported functions
Function, get-conf-hash: Exported functions
Function, hash-table-for-string: Internal functions
Function, init-conf: Exported functions
Function, list-for-hash-table: Internal functions
Function, load-conf-file-for-hash-table: Internal functions
Function, load-file: Internal functions
Function, read-field: Internal functions
Function, replace-conf: Exported functions
Function, replace-conf-fields: Internal functions
Function, save-conf-file: Internal functions
Function, save-file: Internal functions
Function, set-conf-directory: Exported functions
Function, set-conf-file: Exported functions

G
get-conf-directory: Exported functions
get-conf-file: Exported functions
get-conf-full-path: Exported functions
get-conf-hash: Exported functions

H
hash-table-for-string: Internal functions

I
init-conf: Exported functions

L
list-for-hash-table: Internal functions
load-conf-file-for-hash-table: Internal functions
load-file: Internal functions

R
read-field: Internal functions
replace-conf: Exported functions
replace-conf-fields: Internal functions

S
save-conf-file: Internal functions
save-file: Internal functions
set-conf-directory: Exported functions
set-conf-file: Exported functions

Jump to:   F   G   H   I   L   R   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables


Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   N   P   S  
Index Entry  Section

C
conf: The conf system

N
noloop.conf: The noloop<dot>conf package

P
Package, noloop.conf: The noloop<dot>conf package

S
System, conf: The conf system

Jump to:   C   N   P   S