On 1/28/21 5:40 PM, Thiago Milczarek Sayão wrote:
Warning: Might be a stupid question.
const SANE_Device **dev_list;
sane_get_devices(&dev_list, SANE_FALSE);
How do I get the size of dev_list?
The returned list (actually, an array) is NULL-terminated, i.e., last
pointer is NULL.
The returned memory (list itself, devices, device names, etc) is owned
by backend, so there is no need for caller to free it. But please note,
that the next call to sane_get_devices() may invalidate ALL the memory,
returned by the previous call.
--
Wishes, Alexander Pevzner ([email protected])