1GENDERS_LOAD_DATA(3) LIBGENDERS GENDERS_LOAD_DATA(3)
2
3
4
6 genders_load_data - read and parse a genders file
7
9 #include <genders.h>
10
11 int genders_load_data(genders_t handle, const char *filename);
12
14 genders_load_data() read and parses the genders file indicated by file‐
15 name. If filename is NULL, genders_load_data() will attempt to read
16 and parse the default genders file defined by GENDERS_DEFAULT_FILE.
17 handle is a genders handle created by genders_handle_create(3).
18
19 After genders_load_data() is called, information about the genders file
20 is stored in the genders handle passed in. This information is used by
21 other genders C API functions. All future use of handle with other
22 genders C API functions will be directly associated with the genders
23 file indicated by filename (or the default genders file if filename is
24 NULL).
25
27 On success, 0 is returned. On error, -1 is returned, and an error code
28 is returned in handle. The error code can be retrieved via gen‐
29 ders_errnum(3) , and a description of the error code can be retrieved
30 via genders_strerror(3). Error codes are defined in genders.h.
31
33 GENDERS_ERR_NULLHANDLE
34 The handle parameter is NULL. The genders handle must be cre‐
35 ated with genders_handle_create(3).
36
37 GENDERS_ERR_OPEN
38 The genders file indicated by filename cannot be opened for
39 reading.
40
41 GENDERS_ERR_READ
42 Error reading the genders file indicated by filename.
43
44 GENDERS_ERR_PARSE
45 The genders file indicated by filename is incorrectly formatted.
46
47 GENDERS_ERR_ISLOADED
48 genders_load_data(3) has already been called with handle.
49
50 GENDERS_ERR_OVERFLOW
51 A line in the genders database exceeds the maximum allowed
52 length.
53
54 GENDERS_ERR_OUTMEM
55 malloc(3) has failed internally, system is out of memory.
56
57 GENDERS_ERR_MAGIC
58 handle has an incorrect magic number. handle does not point to
59 a genders handle or handle has been destroyed by genders_han‐
60 dle_destroy(3).
61
62 GENDERS_ERR_INTERNAL
63 An internal system error has occurred.
64
66 /usr/include/genders.h
67
69 libgenders(3), genders_handle_create(3), genders_handle_destroy(3),
70 genders_errnum(3), genders_strerror(3)
71
72
73
74LLNL August 2003 GENDERS_LOAD_DATA(3)