]> sourceware.org Git - newlib-cygwin.git/commitdiff
Add documentation for duplocale, freelocale, newlocale, and uselocale.
authorCorinna Vinschen <corinna@vinschen.de>
Mon, 15 Aug 2016 15:34:40 +0000 (17:34 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 15 Aug 2016 15:34:40 +0000 (17:34 +0200)
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
newlib/libc/locale/Makefile.am
newlib/libc/locale/Makefile.in
newlib/libc/locale/duplocale.c
newlib/libc/locale/freelocale.c
newlib/libc/locale/newlocale.c
newlib/libc/locale/uselocale.c

index 666ca5f39e11328c4539af5a04340be4dc70dc17..7312654e1900301106a32d10aafe597016953541 100644 (file)
@@ -38,6 +38,11 @@ endif # USE_LIBTOOL
 
 include $(srcdir)/../../Makefile.shared
 
-CHEWOUT_FILES = locale.def
+CHEWOUT_FILES = \
+       duplocale.def \
+       freelocale.def \
+       locale.def \
+       newlocale.def \
+       uselocale.def
 
 CHAPTERS = locale.tex
index 43b7f884060d7f8f17e8413a52276a291b7e941d..0f605f3ef69b2d8d658d56be10b0c8e13b0db6d7 100644 (file)
@@ -297,7 +297,12 @@ DOCBOOK_CHEW = ${top_srcdir}/../doc/makedocbook.py
 DOCBOOK_OUT_FILES = $(CHEWOUT_FILES:.def=.xml)
 DOCBOOK_CHAPTERS = $(CHAPTERS:.tex=.xml)
 CLEANFILES = $(CHEWOUT_FILES) $(CHEWOUT_FILES:.def=.ref) $(DOCBOOK_OUT_FILES)
-CHEWOUT_FILES = locale.def
+CHEWOUT_FILES = \
+       duplocale.def \
+       freelocale.def \
+       locale.def \
+       newlocale.def \
+       uselocale.def
 CHAPTERS = locale.tex
 all: all-am
 
index 6c4c79313ccd17ad4f40f652912996eb690b014a..7bd89eafca00531156811fa10918e6315b13a58f 100644 (file)
@@ -1,3 +1,39 @@
+/*
+FUNCTION
+       <<duplocale>>---duplicate a locale object
+
+INDEX
+       duplocale
+
+INDEX
+       _duplocale_r
+
+ANSI_SYNOPSIS
+       #include <locale.h>
+       locale_t duplocale(locale_t <[locobj]>);
+
+       locale_t _duplocale_r(void *<[reent]>, locale_t <[locobj]>);
+
+DESCRIPTION
+The <<duplocale>> function shall create a duplicate copy of the locale
+object referenced by the <[locobj]> argument.
+
+If the <[locobj]> argument is LC_GLOBAL_LOCALE, duplocale() shall create
+a new locale object containing a copy of the global locale determined by
+the setlocale() function.
+
+The behavior is undefined if the <[locobj]> argument is not a valid locale
+object handle.
+
+RETURNS
+Upon successful completion, the <<duplocale>> function shall return a
+handle for a new locale object.  Otherwise <<duplocale>> shall return
+(locale_t) <<0>> and set errno to indicate the error.
+
+PORTABILITY
+<<duplocale>> is POSIX-1.2008.
+*/
+
 #include <newlib.h>
 #include <reent.h>
 #include <stdlib.h>
index d7eb5bf8fcb65b314f0ecdacfb85ab533cdbf673..e18b453335f6cbbe6c9a4d3da10a0f7f46b1f0d3 100644 (file)
@@ -1,3 +1,37 @@
+/*
+FUNCTION
+       <<freelocale>>---free resources allocated for a locale object
+
+INDEX
+       freelocale
+
+INDEX
+       _freelocale_r
+
+ANSI_SYNOPSIS
+       #include <locale.h>
+       locale_t freelocale(locale_t <[locobj]>);
+
+       locale_t _freelocale_r(void *<[reent]>, locale_t <[locobj]>);
+
+DESCRIPTION
+The <<freelocale>> function shall cause the resources allocated for a
+locale object returned by a call to the <<newlocale>> or <<duplocale>>
+functions to be released.
+
+The behavior is undefined if the <[locobj]> argument is the special locale
+object LC_GLOBAL_LOCALE or is not a valid locale object handle.
+
+Any use of a locale object that has been freed results in undefined
+behavior.
+
+RETURNS
+None.
+
+PORTABILITY
+<<freelocale>> is POSIX-1.2008.
+*/
+
 #include <newlib.h>
 #include <reent.h>
 #include <stdlib.h>
index 224b7abcc4f9fc8e5e17cff46dafa696f3894879..239173bca138d840d43f5e2fb785e321d0e197d8 100644 (file)
@@ -1,3 +1,78 @@
+/*
+FUNCTION
+       <<newlocale>>---create or modify a locale object
+
+INDEX
+       newlocale
+
+INDEX
+       _newlocale_r
+
+ANSI_SYNOPSIS
+       #include <locale.h>
+       locale_t newlocale(int <[category_mask]>, const char *<[locale]>,
+                          locale_t <[locobj]>);
+
+       locale_t _newlocale_r(void *<[reent]>, int <[category_mask]>,
+                             const char *<[locale]>, locale_t <[locobj]>);
+
+DESCRIPTION
+The <<newlocale>> function shall create a new locale object or modify an
+existing one.  If the base argument is (locale_t) <<0>>, a new locale
+object shall be created. It is unspecified whether the locale object
+pointed to by base shall be modified, or freed and a new locale object
+created.
+
+The category_mask argument specifies the locale categories to be set or
+modified.  Values for category_mask shall be constructed by a
+bitwise-inclusive OR of the symbolic constants LC_CTYPE_MASK,
+LC_NUMERIC_MASK, LC_TIME_MASK, LC_COLLATE_MASK, LC_MONETARY_MASK, and
+LC_MESSAGES_MASK, or any of the other implementation-defined LC_*_MASK
+values defined in <locale.h>.
+
+For each category with the corresponding bit set in category_mask the
+data from the locale named by locale shall be used. In the case of
+modifying an existing locale object, the data from the locale named by
+locale shall replace the existing data within the locale object. If a
+completely new locale object is created, the data for all sections not
+requested by category_mask shall be taken from the default locale.
+
+The following preset values of locale are defined for all settings of
+category_mask:
+
+"POSIX"        Specifies the minimal environment for C-language translation
+called the POSIX locale.
+
+"C"    Equivalent to "POSIX".
+
+""     Specifies an implementation-defined native environment.  This
+       corresponds to the value of the associated environment variables,
+       LC_* and LANG; see the Base Definitions volume of POSIX.1‐2008,
+       Chapter 7, Locale and Chapter 8, Environment Variables.
+
+If the base argument is not (locale_t) <<0>> and the <<newlocale>>
+function call succeeds, the contents of base are unspecified.
+Applications shall ensure that they stop using base as a locale object
+before calling <<newlocale>>.  If the function call fails and the base
+argument is not (locale_t) <<0>>, the contents of base shall remain
+valid and unchanged.
+
+The behavior is undefined if the base argument is the special locale
+object LC_GLOBAL_LOCALE, or is not a valid locale object handle and is
+not (locale_t) <<0>>.
+
+RETURNS
+Upon successful completion, the <<newlocale>> function shall return a
+handle which the caller may use on subsequent calls to <<duplocale>>,
+<<freelocale>>, and other functions taking a locale_t argument.
+
+Upon failure, the <<newlocale>> function shall return (locale_t) <<0>>
+and set errno to indicate the error.
+
+PORTABILITY
+<<newlocale>> is POSIX-1.2008.
+*/
+
 #include <newlib.h>
 #include <errno.h>
 #include <reent.h>
index dbf0d33936383169c2083486d998be92aafb647d..810590fc027cc34b8ef30d70c8047f33afc98343 100644 (file)
@@ -1,3 +1,55 @@
+/*
+FUNCTION
+       <<uselocale>>---free resources allocated for a locale object
+
+INDEX
+       uselocale
+
+INDEX
+       _uselocale_r
+
+ANSI_SYNOPSIS
+       #include <locale.h>
+       locale_t uselocale(locale_t <[locobj]>);
+
+       locale_t _uselocale_r(void *<[reent]>, locale_t <[locobj]>);
+
+DESCRIPTION
+The <<uselocale>> function shall set the current locale for the current
+thread to the locale represented by newloc.
+
+The value for the newloc argument shall be one of the following:
+
+1. A value returned by the <<newlocale>> or <<duplocale>> functions
+
+2. The special locale object descriptor LC_GLOBAL_LOCALE
+
+3. (locale_t) <<0>>
+
+Once the <<uselocale>> function has been called to install a thread-local
+locale, the behavior of every interface using data from the current
+locale shall be affected for the calling thread. The current locale for
+other threads shall remain unchanged.
+
+If the newloc argument is (locale_t) <<0>>, the object returned is the
+current locale or LC_GLOBAL_LOCALE if there has been no previous call to
+<<uselocale>> for the current thread.
+
+If the newloc argument is LC_GLOBAL_LOCALE, the thread shall use the
+global locale determined by the <<setlocale>> function.
+
+RETURNS
+Upon successful completion, the <<uselocale>> function shall return the
+locale handle from the previous call for the current thread, or
+LC_GLOBAL_LOCALE if there was no such previous call.  Otherwise,
+<<uselocale>> shall return (locale_t) <<0>> and set errno to indicate
+the error.
+
+
+PORTABILITY
+<<uselocale>> is POSIX-1.2008.
+*/
+
 #include <newlib.h>
 #include <reent.h>
 #include <stdlib.h>
This page took 0.03951 seconds and 5 git commands to generate.