xref: /openbsd/lib/libc/nls/catopen.3 (revision 771fbea0)
1.\"	$OpenBSD: catopen.3,v 1.8 2013/06/05 03:39:23 tedu Exp $
2.\"
3.\" Written by J.T. Conklin <jtc@netbsd.org>.
4.\" Public domain.
5.\"
6.Dd $Mdocdate: June 5 2013 $
7.Dt CATOPEN 3
8.Os
9.Sh NAME
10.Nm catopen
11.Nd open message catalog
12.Sh SYNOPSIS
13.In nl_types.h
14.Ft nl_catd
15.Fn catopen "const char *name" "int oflag"
16.Sh DESCRIPTION
17The
18.Fn catopen
19function opens the message catalog specified by
20.Fa name
21and returns a message catalog descriptor.
22If
23.Fa name
24contains a
25.Ql / ,
26then
27.Fa name
28specifies the full pathname for the message catalog, otherwise the value
29of the environment variable
30.Ev NLSPATH
31is used with
32.Fa name
33substituted for
34.Ql \&%N .
35.Pp
36If the
37.Fa oflag
38argument is
39.Dv NL_CAT_LOCALE ,
40the
41.Ev LC_MESSAGES
42environment variable is used to select the message catalog.
43If the
44.Fa oflag
45argument is zero, the
46.Ev LANG
47environment variable is used to select the message catalog.
48.Sh RETURN VALUES
49Upon successful completion,
50.Fn catopen
51returns a message catalog descriptor.
52Otherwise, \-1 is returned and
53.Va errno
54is set to indicate the error.
55.Sh SEE ALSO
56.Xr catclose 3 ,
57.Xr catgets 3
58.Sh STANDARDS
59The
60.Fn catopen
61function conforms to
62.St -p1003.1-2008 .
63