libp7/doc/p7_request.3.txt

61 lines
1.3 KiB
Plaintext

P7_REQUEST(3)
=============
Thomas "Cakeisalie5" Touhey
:Email: thomas@touhey.fr
:man source: libp7
:man manual: libp7 manual
NAME
----
p7_request, p7_reqfile - request a file from the calculator
SYNOPSIS
--------
[source,c]
----
#include <libp7.h>
int p7_request(p7_handle_t *handle, p7_buffer_t *buffer,
const char *dirname, const char *filename, const char *devname,
void (*disp)());
int p7_reqfile(p7_handle_t *handle, FILE *file,
const char *dirname, const char *filename, const char *devname,
void (*disp)());
FILE *fp = fopen("myaddin.g1a", "w");
p7_reqfile(handle, fp, NULL, "myaddin.g1a", "fls0", NULL);
----
DESCRIPTION
-----------
These functions request a file from the calculator, and writes its content
into the given buffer. *p7_request* uses the libp7 buffer interface, see
*p7_buffer*(3) to read more about it.
If directory name is NULL, file will be read at root.
The *disp* parameter is only there if you want to display a loading bar. It
should have this prototype:
[source,c]
----
void my_display(p7ushort_t id, p7ushort_t total);
----
If it is non-null, it is first called with *id* > *total* to initialize display.
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_sendfile*(3),
*p7_error*(3)