The simple-config Reference Manual

This is the simple-config Reference Manual, version 1.2, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Jul 15 06:30:01 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 simple-config

loads and parses a KEY=VALUE style config file

Author

ava fox <>

License

BSD 3-Clause

Version

1.2

Dependencies
  • str (system).
  • uiop (system).
Source

simple-config.asd.

Child Components

3 Files

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


3.1 Lisp


3.1.1 simple-config/simple-config.asd

Source

simple-config.asd.

Parent Component

simple-config (system).

ASDF Systems

simple-config.


3.1.2 simple-config/package.lisp

Source

simple-config.asd.

Parent Component

simple-config (system).

Packages

simple-config.


3.1.3 simple-config/simple-config.lisp

Dependency

package.lisp (file).

Source

simple-config.asd.

Parent Component

simple-config (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 simple-config

Source

package.lisp.

Nickname

conf

Use List

common-lisp.

Public Interface
Internals

5 Definitions

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


5.1 Public Interface


5.1.1 Ordinary functions

Function: config (key &optional default config)

retrieve the value from config using KEY, returns nil if not found

if DEFAULT is given returns it instead of nil when KEY is not found

if CONFIG is passed in, we use that instead of our internal *CONFIG* variable

Package

simple-config.

Source

simple-config.lisp.

Function: load-config (file-path &key parse-lists list-separator set-internal-var)

loads config at FILE-PATH

PARSE-LISTS defaults to t
LIST-SEPARATOR defaults to #,

if PARSE-LISTS is non-nil we check any value for character LIST-SEPARATOR and split it by that

if SET-INTERNAL-VAR is non-nil we set SIMPLE-CONFIG::*CONFIG* to the alist we get from parsing the specified file

returns T on success, NIL otherwise, or an alist if SET-INTERNAL-VAR is nil

Package

simple-config.

Source

simple-config.lisp.

Function: save-config (file-path)

saves currently loaded config to FILEPATH

Package

simple-config.

Source

simple-config.lisp.


5.1.2 Generic functions

Generic Function: (setf config) (key)
Package

simple-config.

Methods
Method: (setf config) (key)

allows us to do setf on (config) calls

Source

simple-config.lisp.


5.2 Internals


5.2.1 Special variables

Special Variable: *config*

our loaded config

Package

simple-config.

Source

simple-config.lisp.

Special Variable: *list-separator*
Package

simple-config.

Source

simple-config.lisp.

Special Variable: *parse-lists*
Package

simple-config.

Source

simple-config.lisp.


5.2.2 Ordinary functions

Function: line-comment-p (line)

checks if LINE is a full line comments

Package

simple-config.

Source

simple-config.lisp.

Function: parse-value (value)

determines what kind of data VALUE is, and parses it correctly

Package

simple-config.

Source

simple-config.lisp.

Function: print-config (stream data &optional colonp atsignp)

custom format function that prints out config

Package

simple-config.

Source

simple-config.lisp.

Function: string-to-keyword (str)

converts STR into a keyword

replaces all underscores with hyphens

Package

simple-config.

Source

simple-config.lisp.


Appendix A Indexes


A.1 Concepts