#!html <h1 style="text-align: left; color: red"> This Plugin is not part of the current lcd4linux. This wiki entry was created for discussion about a plugin prototype. <br><br> </h1>
Plugin List allows to configure lists that can be modified while runtime.
The basic structure in the config-file looks like this:
Plugin List {
active 1
List1 {
value1 'red'
value2 'green'
value3 'blue'
value4 'alpha'
}
List2 {
value1 1
value2 'two'
value3 3
}
List3 {
}
}
„active 1“ activates the plugin. If it has not been activated all of its functions will return -1.
The plugin must contain at least 1 list. List may be empty (no value). Lists and values have to be numbered serially starting with 1.
Plugin parameters:
| active | Set to 1 to activate plugin, otherwise the plugin won't work and all of its functions return -1. |
List parameters:
| name* | must be unique, default: 'List1' for List1 … |
| limit* | Maximal number of values this list may contain 0..1000, overwritten with initial number of values if above, default: 10 |
| *optional |
====== functions3. Functions =
All functions return -1 on error (e.g. plugin not active, wrong config, wrong indexes, name not found).
As usual on lcd4linux indexing starts with 1.
| Function | args | Description |
| list::add( lst*, idx, val ) | 3 | add value to list, idx from 1..size+1, returns -1 on error, else 0 |
| list::delete( lst*, idx ) | 2 | deletes value number idx from list |
| list::get( lst*, idx ) | 2 | returns value number idx in list lst |
| list::find( lst*, val ) | 2 | returns idx of value val in list lst or -1 if not found |
| list::limit( lst* ) | 1 | maximal number of values in list lst |
| list::set( lst*, idx, val ) | 3 | sets value number idx to val, returns -1 on error, else 0 |
| list::size( lst* ) | 1 | current number of values in list lst |
| * lst may contain the name or the index of the list | ||