aboutsummaryrefslogtreecommitdiffstats
path: root/libcontacts_format_contact.3
blob: 59de67cfd985a9f0b50b257247be3b6c4b6ebb5f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
.TH LIBCONTACTS_FORMAT_CONTACT 3 LIBCONTACTS
.SH NAME
libcontacts_format_contact \- Construct a contact file
.SH SYNOPSIS
.nf
#include <libcontacts.h>

int libcontacts_format_contact(const struct libcontacts_contact *\fIcontact\fP, char **\fIdatap\fP);
.fi
.PP
Link with
.IR -lcontacts .

.SH DESCRIPTION
The
.BR libcontacts_format_contact ()
function formats the content that shall be stored
the a contact file, for the contact in the
.I contact
parameter. The resulting content will be NUL-terminated
and, upon successful completion, stored in
.IR *datap .
The caller must manually deallocate the content with the
.BR free (3)
function when it's no longer needed.

.SH RETURN VALUE
The
.BR libcontacts_format_contact ()
function returns 0 upon successful completion;
otherwise -1 is returned and
.I errno
is set appropriately to indicate the error.

.SH ERRORS
The
.BR libcontacts_format_contact ()
function may fail for any reason specified for the
.BR open_memstream (3)
and
.BR fprintf (3)
(other than
.IR EILSEQ )
functions.

.SH SEE ALSO
.BR libcontacts.h (0),
.BR libcontacts (7)
.BR libcontacts_save_contact (3),
.BR libcontacts_parse_contact (3),
.BR libcontacts_get_file (3),
.BR contacts (5),