diff options
author | Andrey A. Chernov <ache@FreeBSD.org> | 1998-04-30 11:06:12 +0000 |
---|---|---|
committer | Andrey A. Chernov <ache@FreeBSD.org> | 1998-04-30 11:06:12 +0000 |
commit | c897062234ec08ed9a82a462a981c3a02ba71ef5 (patch) | |
tree | ae0e38903d6f0ba1fdbdbe7ef27b85312d214f83 /lib/libc | |
parent | d95038c45e16c6e434ec11bcafcf39840d060570 (diff) | |
download | src-c897062234ec08ed9a82a462a981c3a02ba71ef5.tar.gz src-c897062234ec08ed9a82a462a981c3a02ba71ef5.zip |
Implement NL_CAT_LOCALE
Manpages cleanup
Notes
Notes:
svn path=/head/; revision=35548
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/nls/catclose.3 | 4 | ||||
-rw-r--r-- | lib/libc/nls/catgets.3 | 7 | ||||
-rw-r--r-- | lib/libc/nls/catopen.3 | 23 | ||||
-rw-r--r-- | lib/libc/nls/msgcat.c | 11 |
4 files changed, 33 insertions, 12 deletions
diff --git a/lib/libc/nls/catclose.3 b/lib/libc/nls/catclose.3 index e4757bd27db5..9376565795f5 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 b50f8a4f5c6a..6d03527edd01 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 a792ebddf8ec..869722c130a9 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 014d3667b8b7..d19c70ee6cd6 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() |