libusbg: Add label field to usbg_function structure

Add some field where additional label for function can be stored.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
libusbg: Add export function functionality

Function settings may be complicated and their configuration
may take a long while. To save time it would be convenient
to allow for storing function settings in a file.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
libusbg: Add export config functionality

Configuration may have several functions if we add
strings and some attributes it gives a few shell commands
to set it up. To avoid this add export cofiguration
which allows to store usb configuration in a file.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
libusbg: Add export gadget functionality

Whole gadget setting process take a lot of simple
commands (or lines of code). Those shell commands
may take a while or require dedicated script and
hard-coding gadget configuration. To avoid such
situation add to library ability to export a whole
gadget into file.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
libusbg: examples: Add sample application to export gadget

Add sample C code which shows how to use new functionality
of libusbg - gadget export. This program allows to export
chosen gadget from configfs to a file.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
libusbg: Add errors which may happen during parsing

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
libusbg: Allow to store error information in usbg_gadget

If error occurred during parsing user should have
an oportunity to get details about place and type
of error.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
libusbg: Add import function functionality

Functions can be exported to file using usbg_export_function().
This commit adds complementary API function usbg_import_function()
which allows to import function from file to configfs.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
libusbg: Add import config functionality

Configurations can be exported to file using usbg_export_config().
This commit adds complementary API function usbg_import_config()
which allows to import configuration (with attrs, strings and
bindings) from file to chosen gadget.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
libusbg: Allow to store error information in usbg_state

If error occurred during parsing user should have
an opportunity to get details about place and type
of error.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
libusbg: Add import gadget functionality

Whole gadget can be exported to file using usbg_export_gadget().
This commit adds complementary API function usbg_import_gadget()
which allows to import whole gadget (including attrs, strings,
configs, functions and bindings) from file to configfs.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
libusbg: Add functions to get import error text and line

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
libusbg: examples: Add gadget-import sample app

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
libusbg: doc: Add document about gadget schemes

Add document which clarify reasons of implementing
gadget schemes and also describes syntax of such files.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>