aboutsummaryrefslogtreecommitdiff
path: root/contrib/ls-config/doc
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ls-config/doc')
-rw-r--r--contrib/ls-config/doc/bash.api.txt75
-rw-r--r--contrib/ls-config/doc/bin.api.txt75
-rw-r--r--contrib/ls-config/doc/changlog.txt26
-rw-r--r--contrib/ls-config/doc/errorcodes.txt20
4 files changed, 196 insertions, 0 deletions
diff --git a/contrib/ls-config/doc/bash.api.txt b/contrib/ls-config/doc/bash.api.txt
new file mode 100644
index 0000000..762f600
--- /dev/null
+++ b/contrib/ls-config/doc/bash.api.txt
@@ -0,0 +1,75 @@
+Instalation:
+------------
+
+First of all, You must place ls-config binary and lslib-core bash
+script in the same directory (default: /usr/share/ls/lib)
+
+Next in lslib-core header chcange configuration:
+PACD tu point to parent directory of paced files
+then LIBD must point relative (tu PACD) to directory
+whrere script placed
+
+Usage:
+------
+
+In You bash script, first of all define LS_EXEC variable,
+and set his value to 1. (It protect lslib-core) to run
+standalone
+
+Next, source library:
+source /usr/share/ls/lib/lslib-core
+
+After thet You can use following function:
+
+Functions:
+----------
+
+cfg_g $PATH - this echo variable value of given PATH
+ and return error code
+cfg_t $PATH - this echo variable type of given PATH
+ and return error code
+cfg_c $PATH - this echo cout of variable elements
+ and return error code
+cfg_s $PATH $DATA [$TYPE] - this set variable of given PATH or create new
+ variable valuse are set to DATA, and if this
+ create new variable, variable will be type TYPE
+cfg_u $PATH - this unset (remove) variable of given PATH
+ and return error code
+cfg_f_g $FILE $PATH - same as cfg_g, but operate on given FILE
+cfg_f_t $FILE $PATH - same as cfg_t, but operate on given FILE
+cfg_f_c $FILE $PATH - same as cfg_c, but operate on given FILE
+cfg_f_s $FILE $PATH $DATA [$TYPE] - same as cfg_s, but operate on given FILE
+cfg_f_u $FILE $PATH - same as cfg_u, but operate on given FILE
+
+Configuration files:
+--------------------
+
+By default configuration file are placed in /etc/ls/
+with the same name as script file name
+(used in cfg_g, cfg_t, cfg_c, cfg_s, cfg_u)
+
+But if You need, You can use any location of configuration file
+by using cfg_f_* functions, giving configuration file location as
+first argument
+
+Detailed configuration file shema are publicated on:
+http://www.hyperrealm.com/libconfig/
+And his gramar on:
+http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files
+
+there are only short describe:
+configuration = setting-list | empty
+setting-list = setting | setting-list setting
+setting = name (":" | "=") value (";" | "," | empty)
+value = scalar-value | array | list | group
+value-list = value | value-list "," value
+scalar-value = boolean | integer | integer64 | hex | hex64 | float | string
+scalar-value-list = scalar-value | scalar-value-list "," scalar-value
+array = "[" (scalar-value-list | empty) "]"
+list = "(" (value-list | empty) ")"
+group = "{" (setting-list | empty) "}"
+empty =
+
+smaple configuration file and script are available on sample/ directory
+config - samble configuration file
+script - sample script, then read info variable from config file
diff --git a/contrib/ls-config/doc/bin.api.txt b/contrib/ls-config/doc/bin.api.txt
new file mode 100644
index 0000000..55baaf2
--- /dev/null
+++ b/contrib/ls-config/doc/bin.api.txt
@@ -0,0 +1,75 @@
+Instalation:
+------------
+
+First place somewhere ls-config binary, or make it from source
+
+Then if You woud like use it with national translation, then You muas build
+it form source and then copy *.mo files according to You system
+
+Usage:
+------
+
+Remember to call ls-config always with -f parameter,
+wich give ls-config inormation wich config file use.
+
+Then this program operate in three based modes:
+-g (get) for reading values (default)
+-s (set) for store values
+-h (help) for display help message
+both parameter (-g and -s) nedd to give it variable path
+(internal configuration variable path)
+
+for exapmle read info value from config file:
+ls-config -f config -g info
+
+Then You can set this value to another
+ls-config -f config -s info -d "Somethint to write"
+
+But when You wand to addn new configutation variable you must
+specify his type:
+ls-config -f config -s someint -d 10 -p int
+
+You can remove (unset) variable too. This is subfunstion of setting:
+ls-config -f config -s someint -u
+
+When reading You cent use following flag:
+-v - read only variable valut
+-t - read only variable type
+-c - read only variable element count (sense only in types: array, list, group)
+-i - read only variable index (sense only in type: array, list)
+-n - read only variable name
+
+and sometimes usable
+-q - to wori in quiet mode usable in scripts.
+
+For example to read variable somevar type, where variable in group foo:
+ls-config -f config -g "foo.somevar" -t
+
+For detailed list of parametera (long options available too) run ls-config
+in help mode:
+ls-config -h
+
+Configuraiton files:
+--------------------
+
+Detailed configuration file shema are publicated on:
+http://www.hyperrealm.com/libconfig/
+And his gramar on:
+http://www.hyperrealm.com/libconfig/libconfig_manual.html#Configuration-Files
+
+there are only short describe:
+configuration = setting-list | empty
+setting-list = setting | setting-list setting
+setting = name (":" | "=") value (";" | "," | empty)
+value = scalar-value | array | list | group
+value-list = value | value-list "," value
+scalar-value = boolean | integer | integer64 | hex | hex64 | float | string
+scalar-value-list = scalar-value | scalar-value-list "," scalar-value
+array = "[" (scalar-value-list | empty) "]"
+list = "(" (value-list | empty) ")"
+group = "{" (setting-list | empty) "}"
+empty =
+
+smaple configuration file and script are available on sample/ directory
+config - samble configuration file
+script - sample script, then read info variable from config file
diff --git a/contrib/ls-config/doc/changlog.txt b/contrib/ls-config/doc/changlog.txt
new file mode 100644
index 0000000..937e737
--- /dev/null
+++ b/contrib/ls-config/doc/changlog.txt
@@ -0,0 +1,26 @@
+Version 1.0.3
+-------------
+
+Fully commented code,
+Startin with documentation
+
+bugfixes
+- fix some badly returned exit codes
+- remove duplicate error messages
+- l10n textdomain corrected
+- extend sample configuration file to be full representative
+- some corrections in sample script (adding directly usaga)
+
+new features
+- adding documentation files (api)
+
+Version 1.0.1
+-------------
+
+Internaly translated tu englich
+
+
+Verison 1.0.0
+-------------
+
+First publicated and working version \ No newline at end of file
diff --git a/contrib/ls-config/doc/errorcodes.txt b/contrib/ls-config/doc/errorcodes.txt
new file mode 100644
index 0000000..303ef58
--- /dev/null
+++ b/contrib/ls-config/doc/errorcodes.txt
@@ -0,0 +1,20 @@
+ 0 - exit with no error
+ 1 - Cen't access witch right mode (read or write) configuration file.
+ 2 - (not used),
+ 3 - Variable of given path not found (path not found).
+ 4 - Variable path not given.
+ 5 - Can't remove root element (cused if someone try to unset it)
+ 6 - Can't find parent element
+ 7 - Variable unset failed.
+ 8 - Configuration file write failed.
+ 9 - Variable value not given.
+10 - Inconsistent value type (caused if set exisitng variablen and give type another then saved).
+11 - Variable set failed.
+12 - Incorrect data format.
+13 - Variable type not given (in som cases tu set variable, giving his type are necesery).
+14 - Inlegal data type (caused if user give type thet not known for libconfig9).
+15 - Bad name of variable (curently chcecking only if enpty stringa are given).
+16 - Inavlid configuration variable path.
+17 - New named configuration variable can be added only to group element.
+18 - Prohibited data type (caused when use type then connot be use in given case).
+