DC_DESCRIPTOR_ITERATOR(3)

NAME
dc_descriptor_iterator - get all supported dive computers

LIBRARY
libdivecomputer

SYNOPSIS
#include <libdivecomputer/descriptor.h>
dc_status_t
dc_descriptor_iterator(dc_iterator_t **iterator);

DESCRIPTION
Gets all descriptors available to libdivecomputer. It must be matched with dc_iterator_free(3) if the return value is DC_STATUS_SUCCESS. The dc_iterator_next(3) function must be used to iterate over the iterator. You must use dc_descriptor_free(3) on the returned descriptor value.

RETURN VALUES
This returns DC_STATUS_SUCCESS and fills in the iterator pointer on success.

EXAMPLES
The following iterates over all descriptors, printing the vendor, then frees the iterator. It does no error checking.

    dc_descriptor_iterator(&iter));
    while (dc_iterator_next(iter, &desc) == DC_STATUS_SUCCESS) {
    	printf("%s\n", dc_descriptor_get_vendor(desc));
    	dc_descriptor_free(desc);
    }
    dc_iterator_free(iter);

SEE ALSO
dc_descriptor_free(3), dc_iterator_free(3), dc_iterator_next(3)

AUTHORS
The libdivecomputer library was written by Jef Driesen, jef@libdivecomputer.org. The manpages were written by Kristaps Dzonsons, kristaps@bsd.lv.