libusbg: Add udc structure

Add structure to store informations about available udcs
instead of using their names as a string.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
libusbg: Replace usbg_get_udcs() with loop

Library allows to iterate over each gadget using loop.
To be consistent with this convention add similar loop
for UDCs.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
libusbg: Rework API to use usbg_udc structure

Using string as udc identifier provides a lot
of troubles. To be more consistent with rest of
API rework it to start using usbg_udc structure
instead of using char *.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
libusbg: Refresh gadget UDC while each usbg_get_gadget_udc()

Kernel may decide to detach our gadget in some cases.
A good example is when FFS daemon received a SIGSEGV
and all descriptors has been closed.

To avoid returning false informations to user we have
to refresh UDC attribute before returning cached pointer
to usbg_udc.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
libusbg: Allow to get gadget enabled on given UDC

Add usbg_get_udc_gadget() which allows user to learn
which gadget is attached to selected UDC.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
libusbg: Add example how to use usbg_udc structure

This example shows how to learn what udcs are available
in system and also how to find out what gadgets are
enabled on them.

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