OSDN Git Service

Retire LDP man-pages repository
[linuxjm/LDP_man-pages.git] / draft / man3 / duplocale.3
diff --git a/draft/man3/duplocale.3 b/draft/man3/duplocale.3
deleted file mode 100644 (file)
index 11163d0..0000000
+++ /dev/null
@@ -1,149 +0,0 @@
-.\" t
-.\" Copyright (C) 2014 Michael Kerrisk <mtk.manpages@gmail.com>
-.\"
-.\" %%%LICENSE_START(VERBATIM)
-.\" Permission is granted to make and distribute verbatim copies of this
-.\" manual provided the copyright notice and this permission notice are
-.\" preserved on all copies.
-.\"
-.\" Permission is granted to copy and distribute modified versions of this
-.\" manual under the conditions for verbatim copying, provided that the
-.\" entire resulting derived work is distributed under the terms of a
-.\" permission notice identical to this one.
-.\"
-.\" Since the Linux kernel and libraries are constantly changing, this
-.\" manual page may be incorrect or out-of-date.  The author(s) assume no
-.\" responsibility for errors or omissions, or for damages resulting from
-.\" the use of the information contained herein.  The author(s) may not
-.\" have taken the same level of care in the production of this manual,
-.\" which is licensed free of charge, as they might when working
-.\" professionally.
-.\"
-.\" Formatted or processed versions of this manual, if unaccompanied by
-.\" the source, must acknowledge the copyright and authors of this work.
-.\" %%%LICENSE_END
-.\"
-.\"*******************************************************************
-.\"
-.\" This file was generated with po4a. Translate the source file.
-.\"
-.\"*******************************************************************
-.TH DUPLOCALE 3 2014\-03\-12 Linux "Linux Programmer's Manual"
-.SH 名前
-duplocale \- ロケールオブジェクトを複製する
-.SH 書式
-.nf
-\fB#include <locale.h>\fP
-
-\fBlocale_t duplocale(locale_t \fP\fIlocobj\fP\fB);\fP
-.fi
-.sp
-.in -4n
-glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7)  参照):
-.in
-.sp
-\fBduplocale\fP():
-.PD 0
-.RS 4
-.TP 
-glibc 2.10 以降:
-_XOPEN_SOURCE\ >=\ 700
-.TP 
-glibc 2.10 より前:
-_GNU_SOURCE
-.RE
-.PD
-.SH 説明
-\fBduplocale\fP() 関数は \fIlocobj\fP が参照するロケールオブジェクトの複製を作成する。
-
-\fIlocobj\fP が \fBLC_GLOBAL_LOCALE\fP の場合、 \fBduplocale\fP() は \fBsetlocale\fP(3)
-により判定されたグローバルロケールのコピーを含むロケールオブジェクトを作成する。
-.SH 返り値
-成功すると、 \fBduplocale\fP() は新しいロケールオブジェクトのハンドルを返す。 エラーの場合、 \fI(locale_t)\ 0\fP を返し、
-\fIerrno\fP にエラーの原因を示す値を設定する。
-.SH エラー
-.TP 
-\fBENOMEM\fP
-ロケールオブジェクトの複製を作成するのに十分なメモリーがない。
-.SH バージョン
-\fBduplocale\fP() 関数は GNU C ライブラリのバージョン 2.3 で初めて登場した。
-.SH 準拠
-POSIX.1\-2008.
-.SH 注意
-ロケールの複製は以下のことを行う際に役立つ。
-.IP * 3
-ロケールオブジェクトのコピーを作成し、  (\fBnewlocale\fP(3) を使って) いくつかのカテゴリーだけを変更する。
-.IP *
-現在のロケールに対するハンドルを取得する。 このハンドルはロケールハンドルを受け取る他の関数 (\fBtoupper_l\fP(3) など) で使用できる。
-これを行うには、 以下の呼び出しが返した値を \fBduplocale\fP() に渡せばよい。
-
-    loc = uselocale((locale_t) 0);
-
-.IP
-上記の \fBuselocale\fP(3) の呼び出しは値 \fBLC_GLOBAL_LOCALE\fP を返すことがあり、 この値を
-\fBtoupper_l\fP(3) などの関数に渡した場合の動作は不定なので、 この方法は必要である。 \fBduplocale\fP()
-を呼び出すことで、確実に \fBLC_GLOBAL_LOCALE\fP が使用可能なロケールオブジェクトに変換することができる。 下記の「例」を参照。
-.PP
-\fBduplocale\fP() で作成された各ロケールオブジェクトは \fBfreelocale\fP(3) を使って解放すべきである。
-.SH 例
-以下のプログラムでは、 \fBtoupper_l\fP(3) に渡す現在のロケールのハンドルを取得するのに \fBuselocale\fP(3) と
-\fBduplocale\fP() を使用する。
-このプログラムはコマンドライン引き数として文字列を一つ取る。この文字列は、大文字に変換され、標準出力に表示される。 以下は使用例である。
-.in +4n
-.nf
-
-$ \fB./a.out abc\fP
-ABC
-.fi
-.in
-.SS プログラムのソース
-.nf
-#define _XOPEN_SOURCE 700
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <locale.h>
-
-#define errExit(msg)    do { perror(msg); exit(EXIT_FAILURE); \e
-                        } while (0)
-
-int
-main(int argc, char *argv[])
-{
-    locale_t loc, nloc;
-    char *p;
-
-    if (argc != 2) {
-        fprintf(stderr, "Usage: %s string\en", argv[0]);
-        exit(EXIT_FAILURE);
-    }
-
-    /* この一連の処理は必要である。 uselocale() は toupper_l() の
-       引き数として渡すことができない値 LC_GLOBAL_LOCALE を返す
-       可能性があるからである。 */
-
-    loc = uselocale((locale_t) 0);
-    if (loc == (locale_t) 0)
-        errExit("uselocale");
-
-    nloc = duplocale(loc);
-    if (nloc == (locale_t) 0)
-        errExit("duplocale");
-
-    for (p = argv[1]; *p; p++)
-        putchar(toupper_l(*p, nloc));
-
-    printf("\en");
-
-    freelocale(nloc);
-
-    exit(EXIT_SUCCESS);
-}
-.fi
-.SH 関連項目
-\fBfreelocale\fP(3), \fBnewlocale\fP(3), \fBsetlocale\fP(3), \fBuselocale\fP(3),
-\fBlocale\fP(5), \fBlocale\fP(7)
-.SH この文書について
-この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部
-である。プロジェクトの説明とバグ報告に関する情報は
-http://www.kernel.org/doc/man\-pages/ に書かれている。