libp7/doc/p7_list.3.txt

55 lines
1.1 KiB
Plaintext

P7_LIST(3)
==========
Thomas "Cakeisalie5" Touhey
:Email: thomas@touhey.fr
:man source: libp7
:man manual: libp7 manual
NAME
----
p7_list - list existing files on device
SYNOPSIS
--------
[source,c]
----
#include <libp7.h>
int p7_list(p7_handle_t *handle, char *devname, void (*callback)(),
void *cookie);
p7_list(handle, "fls0", &print_file_info);
----
DESCRIPTION
-----------
This function lists files on the distant device. For each received file info,
it will call the callback with the file info. The *cookie* is just something
you want this function to transmit to the callback.
*callback* musn't be NULL, and must have this prototype:
[source,c]
----
void my_callback(void *cookie, const char *dir, const char *filename,
unsigned int filesize);
----
If the element is a directory, *filename* will be *NULL*.
If the file is at the device's root, *dir* will be *NULL*.
The root directory isn't sent.
RETURN VALUE
------------
This function returns zero if everything went well, and the error code
otherwise.
ERRORS
------
See *p7_error*(3).
SEE ALSO
--------
*libp7*(3),
*p7_error*(3)