Debian Codegraph @

liblastlog2/man/ll2_read_all.3.adoc

raw
1 //po4a: entry man manual
2 = ll2_read_all(3)
3 :doctype: manpage
4 :man manual: Programmer's Manual
5 :man source: util-linux {release-version}
6 :page-layout: base
7 :lib: liblastlog2
8 :firstversion: 2.40
9
10 == NAME
11
12 ll2_read_all - Reads all entries from database and calls the callback function for each entry.
13
14 == SYNOPSIS
15
16 *#include <lastlog2.h>*
17 *int ll2_read_all (struct ll2_context *__context__,
18 int (*__callback__)(const char *__user__, int64_t __ll_time__,
19 const char *__tty__, const char *__rhost__,
20 const char *__pam_service__, const char *__cb_error__),
21 char **__error__);*
22
23 == DESCRIPTION
24
25 Reads all entries from database, defined in _context_, and calls callback function _callback_ for each entry.
26 If _context_ is NULL, the default database, defined in _LL2_DEFAULT_DATABASE_, will be taken.
27
28 --------------------------------------
29 char *error = NULL;
30 const char *user = "root";
31
32 static int
33 callback (const char *res_user, int64_t ll_time, const char *res_tty,
34 const char *res_rhost, const char *res_service, const char *cb_error)
35 {
36 /* returning != 0 if no further entry has to be handled by the callback */
37 return 0;
38 }
39
40 int ret = ll2_read_all (NULL, callback, &error);
41 --------------------------------------
42
43 == RETURN VALUE
44
45 Returns 0 on success, -ENOMEM or -1 on other failure.
46 _error_ contains an error string if the return value is -1.
47 _error_ is not guaranteed to contain an error string, could also be NULL.
48 _error_ should be freed by the caller.
49 If lastlog2 database does not exist at all, the errno ENOENT is set
50 and can be checked.
51
52 == AUTHORS
53
54 mailto:[email protected][Thorsten Kukuk]
55
56 == SEE ALSO
57
58 *lastlog2*(3),
59 *ll2_new_context*(3),
60 *ll2_unref_context*(3),
61 *ll2_write_entry*(3),
62 *ll2_read_entry*(3),
63 *ll2_update_login_time*(3),
64 *ll2_remove_entry*(3),
65 *ll2_rename_user*(3),
66 *ll2_import_lastlog*(3)
67
68 include::man-common/bugreports.adoc[]
69
70 include::man-common/footer-lib.adoc[]
71
72 ifdef::translation[]
73 include::man-common/translation.adoc[]
74 endif::[]