summaryrefslogtreecommitdiffstats
path: root/lib/libc/nls
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1998-04-30 11:06:12 +0000
committerache <ache@FreeBSD.org>1998-04-30 11:06:12 +0000
commit1eaf120df93e4e7920ee597dd5c9389b5bdfc1d8 (patch)
tree315380d21885a1d2011538bda1b52439fda7a29f /lib/libc/nls
parent3462ea1e26399168124cb3392c1b2e3aacca8f8f (diff)
downloadFreeBSD-src-1eaf120df93e4e7920ee597dd5c9389b5bdfc1d8.zip
FreeBSD-src-1eaf120df93e4e7920ee597dd5c9389b5bdfc1d8.tar.gz
Implement NL_CAT_LOCALE
Manpages cleanup
Diffstat (limited to 'lib/libc/nls')
-rw-r--r--lib/libc/nls/catclose.34
-rw-r--r--lib/libc/nls/catgets.37
-rw-r--r--lib/libc/nls/catopen.323
-rw-r--r--lib/libc/nls/msgcat.c11
4 files changed, 33 insertions, 12 deletions
diff --git a/lib/libc/nls/catclose.3 b/lib/libc/nls/catclose.3
index e4757bd..9376565 100644
--- a/lib/libc/nls/catclose.3
+++ b/lib/libc/nls/catclose.3
@@ -1,4 +1,4 @@
-.\" $Id$
+.\" $Id: catclose.3,v 1.4 1997/02/22 15:00:44 peter Exp $
.\"
.\" Copyright (c) 1994 Winning Strategies, Inc.
.\" All rights reserved.
@@ -50,5 +50,5 @@ function closes the message catalog specified by the argument
The
.Fn catclose
function conforms to
-.St -xpg3 .
+.St -xpg4 .
diff --git a/lib/libc/nls/catgets.3 b/lib/libc/nls/catgets.3
index b50f8a4..6d03527 100644
--- a/lib/libc/nls/catgets.3
+++ b/lib/libc/nls/catgets.3
@@ -1,4 +1,4 @@
-.\" $Id$
+.\" $Id: catgets.3,v 1.4 1997/02/22 15:00:46 peter Exp $
.\"
.\" Copyright (c) 1994 Winning Strategies, Inc.
.\" All rights reserved.
@@ -37,7 +37,7 @@
.Sh SYNOPSIS
.Fd #include <nl_types.h>
.Ft char *
-.Fn catgets "nl_catd catd" "int set_id" "int msg_id" "char *s"
+.Fn catgets "nl_catd catd" "int set_id" "int msg_id" "const char *s"
.Sh DESCRIPTION
The
.Fn catgets
@@ -63,4 +63,5 @@ otherwise it returns
.Sh STANDARDS
The
.Fn catgets
-function conforms to \fBxpg3\fR.
+function conforms to
+.St -xpg4 .
diff --git a/lib/libc/nls/catopen.3 b/lib/libc/nls/catopen.3
index a792ebd..869722c 100644
--- a/lib/libc/nls/catopen.3
+++ b/lib/libc/nls/catopen.3
@@ -1,4 +1,4 @@
-.\" $Id$
+.\" $Id: catopen.3,v 1.4 1997/02/22 15:00:48 peter Exp $
.\"
.\" Copyright (c) 1994 Winning Strategies, Inc.
.\" All rights reserved.
@@ -57,9 +57,24 @@ is used with
.Fa name
substituted for %N.
.Pp
-The
+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
+standard. You can specify 0 for compatibility with
+.St -xpg3 ;
+when
.Fa oflag
-argument is reserved for future use and should be set to zero.
+is set to 0, the
+.Ev LANG
+environment variable
+determines the message catalog locale.
.Sh RETURN VALUE
Upon successful completion,
.Fn catopen
@@ -79,4 +94,4 @@ Insufficient memory is available.
The
.Fn catopen
function conforms to
-.St -xpg3 .
+.St -xpg4 .
diff --git a/lib/libc/nls/msgcat.c b/lib/libc/nls/msgcat.c
index 014d366..d19c70e 100644
--- a/lib/libc/nls/msgcat.c
+++ b/lib/libc/nls/msgcat.c
@@ -1,4 +1,4 @@
-/* $Id: msgcat.c,v 1.12 1998/01/15 09:58:08 jb Exp $ */
+/* $Id: msgcat.c,v 1.13 1998/04/30 10:14:55 ache Exp $ */
/***********************************************************
Copyright 1990, by Alfalfa Software Incorporated, Cambridge, Massachusetts.
@@ -57,6 +57,7 @@ static char *rcsid = "$NetBSD: msgcat.c,v 1.11 1995/02/27 13:06:51 cgd Exp $";
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
+#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -99,8 +100,12 @@ int type;
catpath = name;
if (stat(catpath, &sbuf)) return(NLERR);
} else {
- if ((lang = (char *) getenv("LANG")) == NULL)
- lang = "C";
+ if (type == NL_CAT_LOCALE)
+ lang = setlocale(LC_MESSAGES, NULL);
+ else {
+ if ((lang = (char *) getenv("LANG")) == NULL)
+ lang = "C";
+ }
if ((nlspath = (char *) getenv("NLSPATH")) == NULL
#ifndef __NETBSD_SYSCALLS
|| issetugid()
OpenPOWER on IntegriCloud