diff options
author | Mattias Andrée <maandree@kth.se> | 2021-04-13 17:29:14 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-04-13 17:29:14 +0200 |
commit | 6546989d280d8fc1e8e2bc152f08d9b04090d4b8 (patch) | |
tree | d201c83a72d9ef296773794d0cfce6dd7ecab7e0 /libcontacts_load_contact.3 | |
parent | Update todo: do not support multiple calendars, all birthdays shall be stored in gregorian, and other software shall convert (diff) | |
download | libcontacts-6546989d280d8fc1e8e2bc152f08d9b04090d4b8.tar.gz libcontacts-6546989d280d8fc1e8e2bc152f08d9b04090d4b8.tar.bz2 libcontacts-6546989d280d8fc1e8e2bc152f08d9b04090d4b8.tar.xz |
m + add section 3 man pages
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | libcontacts_load_contact.3 | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/libcontacts_load_contact.3 b/libcontacts_load_contact.3 new file mode 100644 index 0000000..e6f5521 --- /dev/null +++ b/libcontacts_load_contact.3 @@ -0,0 +1,75 @@ +.TH LIBCONTACTS_LOAD_CONTACT 3 LIBCONTACTS +.SH NAME +libcontacts_load_contact \- Load a contact +.SH SYNOPSIS +.nf +#include <libcontacts.h> + +int libcontacts_load_contact(const char *\fIid\fP, struct libcontacts_contact *\fIcontactp\fP, const struct passwd *\fIuser\fP); +.fi +.PP +Link with +.IR -lcontacts . + +.SH DESCRIPTION +The +.BR libcontacts_load_contact () +function loads the entry of the contact, whose ID +is specified in the +.I id +parameter, and store it in +.I *contactp +upon successful completion. +.PP +.I user +shall be the user's entry in the password database (not +the shadow database). This is used for the get user's +home directory. +.PP +When no longer needed, the caller shall manually +deallocate all member stored in +.I *contactp +using the +.BR libcontacts_contact_destroy (3) +function. +.PP +The pointer +.I id +will be copied to +.IR contactp->id . + +.SH RETURN VALUE +The +.BR libcontacts_load_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_load_contact () +function will fail if: +.TP +.B 0 +The file it loads contains a NUL byte. +.PP +The +.BR libcontacts_load_contact () +function may fail for any reason specified for the +.BR libcontacts_get_path (3), +.BR libcontacts_parse_contact (3), +.BR open (3), +.BR realloc (3), +and +.BR read (3) +functions. + +.SH SEE ALSO +.BR libcontacts.h (0), +.BR libcontacts (7), +.BR libcontacts_loads_contact (3), +.BR libcontacts_save_contact (3), +.BR libcontacts_contact_destroy (3), +.BR libcontacts_list_contacts (3), +.BR libcontacts_parse_contact (3) |