LITERAL(3)

NAME
literal - routines to manipulate a literal packet

SYNOPSIS
#include <pgplib.h>
int
file2literal(FILE *fd, PGPliteral_t *literal);
int
buf2literal(u_char *buf, int len, PGPliteral_t *literal);
int
literal2buf(PGPliteral_t *literal, u_char **buf);
int
create_literal(char *filename, PGPliteral_t *literal);
void
free_literal(PGPliteral_t *literal);

DESCRIPTION
The routine create_literal() will fill a literal struct with all relevan information. Source is a file, given by its name. The other routines manipulate such structures. free_literal() does not free the structure itself, only the data held by the structure. The size of the buffer returned by literal2buf() can be obtained by calling packet_length().

RETURN VALUES
Upon success, all routines return 0. If an error occurs (such as lack of memory) -1 is returned. All routnes will return 1 if there is a synax error in the input (or a file could not be read, or quite a few other problems).

SEE ALSO
free(3) malloc(3) packet_length(PGPlib) PGPlib(3)

STANDARDS
The packets that are read and written are compatible with RFC1991.

HISTORY
Written by Tage Stabell-Kulų. First appeared in PGPlib 0.1