1995-03-30 12:47:27 +00:00
|
|
|
.\" Copyright (c) 1994 Winning Strategies, Inc.
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by Winning Strategies, Inc.
|
|
|
|
.\" 4. The name of the author may not be used to endorse or promote products
|
|
|
|
.\" derived from this software without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
.\"
|
2000-09-04 13:20:56 +00:00
|
|
|
.\" $FreeBSD$
|
2005-02-27 16:30:16 +00:00
|
|
|
.Dd February 12, 2005
|
1995-03-30 12:47:27 +00:00
|
|
|
.Dt CATOPEN 3
|
|
|
|
.Os
|
|
|
|
.Sh NAME
|
|
|
|
.Nm catopen
|
2001-07-15 07:53:42 +00:00
|
|
|
.Nd open message catalog
|
2000-04-21 09:42:15 +00:00
|
|
|
.Sh LIBRARY
|
|
|
|
.Lb libc
|
1995-03-30 12:47:27 +00:00
|
|
|
.Sh SYNOPSIS
|
2001-10-01 16:09:29 +00:00
|
|
|
.In nl_types.h
|
1995-03-30 12:47:27 +00:00
|
|
|
.Ft nl_catd
|
|
|
|
.Fn catopen "const char *name" "int oflag"
|
|
|
|
.Sh DESCRIPTION
|
2001-07-15 07:53:42 +00:00
|
|
|
The
|
1995-03-30 12:47:27 +00:00
|
|
|
.Fn catopen
|
|
|
|
function opens the message catalog specified by
|
2001-07-15 07:53:42 +00:00
|
|
|
.Fa name
|
1995-03-30 12:47:27 +00:00
|
|
|
and returns a message catalog descriptor.
|
|
|
|
If
|
|
|
|
.Fa name
|
|
|
|
contains a
|
2001-07-15 07:53:42 +00:00
|
|
|
.Sq /
|
|
|
|
then
|
1995-03-30 12:47:27 +00:00
|
|
|
.Fa name
|
2001-07-15 07:53:42 +00:00
|
|
|
specifies the full pathname for the message catalog, otherwise the value
|
1995-03-30 12:47:27 +00:00
|
|
|
of the environment variable
|
2001-07-15 07:53:42 +00:00
|
|
|
.Ev NLSPATH
|
|
|
|
is used with
|
2000-09-05 19:14:34 +00:00
|
|
|
the following substitutions:
|
|
|
|
.Bl -tag -width XXX
|
|
|
|
.It \&%N
|
|
|
|
The value of the
|
1995-03-30 12:47:27 +00:00
|
|
|
.Fa name
|
2000-09-05 19:14:34 +00:00
|
|
|
argument.
|
|
|
|
.It \&%L
|
|
|
|
The value of the
|
|
|
|
.Ev LANG
|
|
|
|
environment variable or the
|
|
|
|
.Dv LC_MESSAGES
|
|
|
|
category (see below).
|
|
|
|
.It \&%l
|
|
|
|
The language element from the
|
|
|
|
.Ev LANG
|
|
|
|
environment variable or from the
|
|
|
|
.Dv LC_MESSAGES
|
|
|
|
category.
|
|
|
|
.It \&%t
|
|
|
|
The territory element from the
|
|
|
|
.Ev LANG
|
|
|
|
environment variable or from the
|
|
|
|
.Dv LC_MESSAGES
|
|
|
|
category.
|
|
|
|
.It \&%c
|
|
|
|
The codeset element from the
|
|
|
|
.Ev LANG
|
|
|
|
environment variable or from the
|
|
|
|
.Dv LC_MESSAGES
|
|
|
|
category.
|
|
|
|
.It \&%%
|
2001-07-15 07:53:42 +00:00
|
|
|
A single % character.
|
2000-09-05 19:14:34 +00:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
An empty string is substituted for undefined values.
|
|
|
|
.Pp
|
|
|
|
Path names templates defined in
|
|
|
|
.Ev NLSPATH
|
|
|
|
are separated by colons
|
|
|
|
.No ( Sq \&: ) .
|
|
|
|
A leading or two adjacent colons
|
|
|
|
is equivalent to specifying %N.
|
1995-03-30 12:47:27 +00:00
|
|
|
.Pp
|
1998-04-30 11:06:12 +00:00
|
|
|
If the
|
|
|
|
.Fa oflag
|
|
|
|
argument is set to the
|
|
|
|
.Dv NL_CAT_LOCALE
|
|
|
|
constant,
|
|
|
|
.Dv LC_MESSAGES
|
|
|
|
locale category used to open the message catalog; using
|
|
|
|
.Dv NL_CAT_LOCALE
|
|
|
|
conforms to the
|
|
|
|
.St -xpg4
|
2000-03-02 09:14:21 +00:00
|
|
|
standard.
|
|
|
|
You can specify 0 for compatibility with
|
1998-04-30 11:06:12 +00:00
|
|
|
.St -xpg3 ;
|
|
|
|
when
|
1995-03-30 12:47:27 +00:00
|
|
|
.Fa oflag
|
1998-04-30 11:06:12 +00:00
|
|
|
is set to 0, the
|
|
|
|
.Ev LANG
|
|
|
|
environment variable
|
|
|
|
determines the message catalog locale.
|
2000-08-30 10:22:23 +00:00
|
|
|
.Pp
|
|
|
|
A message catalog descriptor
|
2000-09-04 13:20:56 +00:00
|
|
|
remains valid in a process until that process closes it, or
|
|
|
|
until a successful call to one of the
|
2000-08-30 10:22:23 +00:00
|
|
|
.Xr exec 3
|
2000-09-04 13:20:56 +00:00
|
|
|
function.
|
2000-11-17 11:44:16 +00:00
|
|
|
.Sh RETURN VALUES
|
2001-07-15 07:53:42 +00:00
|
|
|
Upon successful completion,
|
1995-03-30 12:47:27 +00:00
|
|
|
.Fn catopen
|
|
|
|
returns a message catalog descriptor.
|
|
|
|
Otherwise, (nl_catd) -1 is returned and
|
2001-07-15 07:53:42 +00:00
|
|
|
.Va errno
|
1995-03-30 12:47:27 +00:00
|
|
|
is set to indicate the error.
|
|
|
|
.Sh ERRORS
|
|
|
|
.Bl -tag -width Er
|
2000-09-04 13:20:56 +00:00
|
|
|
.It Bq Er EINVAL
|
|
|
|
Argument
|
|
|
|
.Fa name
|
2005-02-27 16:30:16 +00:00
|
|
|
does not point to a valid message catalog, or catalog is corrupt.
|
2000-09-04 13:20:56 +00:00
|
|
|
.It Bq Er ENAMETOOLONG
|
|
|
|
An entire path to the message catalog exceeded 1024 characters.
|
|
|
|
.It Bq Er ENOENT
|
|
|
|
The named message catalog does not exists, or the
|
|
|
|
.Fa name
|
|
|
|
argument points to an empty string.
|
1995-03-30 12:47:27 +00:00
|
|
|
.It Bq Er ENOMEM
|
1996-01-30 16:34:52 +00:00
|
|
|
Insufficient memory is available.
|
1995-03-30 12:47:27 +00:00
|
|
|
.El
|
|
|
|
.Sh SEE ALSO
|
1999-09-22 22:44:42 +00:00
|
|
|
.Xr gencat 1 ,
|
1995-03-30 12:47:27 +00:00
|
|
|
.Xr catclose 3 ,
|
1998-04-30 16:11:50 +00:00
|
|
|
.Xr catgets 3 ,
|
|
|
|
.Xr setlocale 3
|
1995-03-30 12:47:27 +00:00
|
|
|
.Sh STANDARDS
|
|
|
|
The
|
|
|
|
.Fn catopen
|
|
|
|
function conforms to
|
2005-02-27 16:30:16 +00:00
|
|
|
.St -p1003.1-2001 .
|