libusbg: Add max and min values to enums

In some cases user of library would like to iterate over
all enum values. Depending on enum values order is not
a good idea so provide suitable min and max values to alow
doing something like:

int i;
for(i = USBG_GADGET_ATTR_MIN; i < USBG_GADGET_ATTR_MAX; ++i)
	do_something_useful(i);

Moreover, ensure that function_names and gadget_attr_names
arrays has allways the same size as number of meaningful
values in related enums.

Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
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>