summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2000-06-03 12:24:08 +0000
committerache <ache@FreeBSD.org>2000-06-03 12:24:08 +0000
commit50dddc0919baff9cbacfd717c0dedf5b21688989 (patch)
treec1c5d98ac56ccd0648a552f37c3d4ac3a24db391
parentf8cc8650700e82a6bf297d84634dd12a616d0209 (diff)
downloadFreeBSD-src-50dddc0919baff9cbacfd717c0dedf5b21688989.zip
FreeBSD-src-50dddc0919baff9cbacfd717c0dedf5b21688989.tar.gz
Megre XPG4 code into libc
-rw-r--r--lib/libc/locale/big5.c4
-rw-r--r--lib/libc/locale/euc.c4
-rw-r--r--lib/libc/locale/mskanji.c4
-rw-r--r--lib/libc/locale/runetype.c5
-rw-r--r--lib/libc/locale/setlocale.c16
-rw-r--r--lib/libc/locale/setrunelocale.c27
-rw-r--r--lib/libc/locale/table.c2
-rw-r--r--lib/libc/locale/tolower.c5
-rw-r--r--lib/libc/locale/toupper.c5
-rw-r--r--lib/libc/locale/utf2.c4
10 files changed, 24 insertions, 52 deletions
diff --git a/lib/libc/locale/big5.c b/lib/libc/locale/big5.c
index 9294f0c..b8628dd 100644
--- a/lib/libc/locale/big5.c
+++ b/lib/libc/locale/big5.c
@@ -32,9 +32,10 @@
* 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.
+ *
+ * $FreeBSD$
*/
-#ifdef XPG4
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)big5.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
@@ -117,4 +118,3 @@ _BIG5_sputrune(c, string, n, result)
return (0);
}
-#endif /* XPG4 */
diff --git a/lib/libc/locale/euc.c b/lib/libc/locale/euc.c
index ea5cdb4..3c81012 100644
--- a/lib/libc/locale/euc.c
+++ b/lib/libc/locale/euc.c
@@ -32,9 +32,10 @@
* 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.
+ *
+ * $FreeBSD$
*/
-#ifdef XPG4
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)euc.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
@@ -220,4 +221,3 @@ CodeSet1:
}
return (len);
}
-#endif /* XPG4 */
diff --git a/lib/libc/locale/mskanji.c b/lib/libc/locale/mskanji.c
index bce27fe..6c3199e 100644
--- a/lib/libc/locale/mskanji.c
+++ b/lib/libc/locale/mskanji.c
@@ -29,9 +29,10 @@
* 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.
+ *
+ * $FreeBSD$
*/
-#ifdef XPG4
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)mskanji.c 1.0 (Phase One) 5/5/95";
#endif /* LIBC_SCCS and not lint */
@@ -104,4 +105,3 @@ _MSKanji_sputrune(c, string, n, result)
}
return len;
}
-#endif /* XPG4 */
diff --git a/lib/libc/locale/runetype.c b/lib/libc/locale/runetype.c
index 282f806..dde54a4 100644
--- a/lib/libc/locale/runetype.c
+++ b/lib/libc/locale/runetype.c
@@ -32,6 +32,8 @@
* 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.
+ *
+ * $FreeBSD$
*/
#include <stdio.h>
@@ -41,7 +43,6 @@ unsigned long
___runetype(c)
_BSD_CT_RUNE_T_ c;
{
-#ifdef XPG4
int x;
_RuneRange *rr = &_CurrentRuneLocale->runetype_ext;
_RuneEntry *re = rr->ranges;
@@ -59,6 +60,6 @@ ___runetype(c)
return(re->map);
}
}
-#endif
+
return(0L);
}
diff --git a/lib/libc/locale/setlocale.c b/lib/libc/locale/setlocale.c
index 179be54..f5f5fae 100644
--- a/lib/libc/locale/setlocale.c
+++ b/lib/libc/locale/setlocale.c
@@ -96,10 +96,6 @@ static int stub_load_locale __P((const char *));
extern int __time_load_locale __P((const char *)); /* strftime.c */
-#ifdef XPG4
-extern int _xpg4_setrunelocale __P((char *));
-#endif
-
char *
setlocale(category, locale)
int category;
@@ -243,18 +239,10 @@ loadlocale(category)
return (old);
if (category == LC_CTYPE) {
-#ifdef XPG4
- ret = _xpg4_setrunelocale(new) ? NULL : new;
-#else
ret = setrunelocale(new) ? NULL : new;
-#endif
- if (!ret) {
-#ifdef XPG4
- (void)_xpg4_setrunelocale(old);
-#else
+ if (!ret)
(void)setrunelocale(old);
-#endif
- } else
+ else
(void)strcpy(old, new);
return (ret);
}
diff --git a/lib/libc/locale/setrunelocale.c b/lib/libc/locale/setrunelocale.c
index 8cfddab..55d6ba9 100644
--- a/lib/libc/locale/setrunelocale.c
+++ b/lib/libc/locale/setrunelocale.c
@@ -32,6 +32,8 @@
* 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.
+ *
+ * $FreeBSD$
*/
#include <rune.h>
@@ -44,30 +46,14 @@
#include "setlocale.h"
extern int _none_init __P((_RuneLocale *));
-#ifdef XPG4
extern int _UTF2_init __P((_RuneLocale *));
extern int _EUC_init __P((_RuneLocale *));
extern int _BIG5_init __P((_RuneLocale *));
extern int _MSKanji_init __P((_RuneLocale *));
-extern int _xpg4_setrunelocale __P((char *));
-#endif
extern _RuneLocale *_Read_RuneMagi __P((FILE *));
-#ifdef XPG4
-int
-setrunelocale(encoding)
- char *encoding;
-{
- return _xpg4_setrunelocale(encoding);
-}
-#endif
-
int
-#ifndef XPG4
setrunelocale(encoding)
-#else
-_xpg4_setrunelocale(encoding)
-#endif
char *encoding;
{
FILE *fp;
@@ -117,23 +103,18 @@ _xpg4_setrunelocale(encoding)
}
fclose(fp);
-#ifdef XPG4
- if (!rl->encoding[0] || !strcmp(rl->encoding, "UTF2"))
- return(_UTF2_init(rl));
-#else
if (!rl->encoding[0])
return(EINVAL);
-#endif
else if (!strcmp(rl->encoding, "NONE"))
return(_none_init(rl));
-#ifdef XPG4
+ else if (!strcmp(rl->encoding, "UTF2"))
+ return(_UTF2_init(rl));
else if (!strcmp(rl->encoding, "EUC"))
return(_EUC_init(rl));
else if (!strcmp(rl->encoding, "BIG5"))
return(_BIG5_init(rl));
else if (!strcmp(rl->encoding, "MSKanji"))
return(_MSKanji_init(rl));
-#endif
else
return(EINVAL);
}
diff --git a/lib/libc/locale/table.c b/lib/libc/locale/table.c
index 2fe979c..1c81e80 100644
--- a/lib/libc/locale/table.c
+++ b/lib/libc/locale/table.c
@@ -49,7 +49,7 @@ extern int _none_init __P((char *, char **));
_RuneLocale _DefaultRuneLocale = {
_RUNE_MAGIC_1,
- "none",
+ "NONE",
_none_sgetrune,
_none_sputrune,
0xFFFD,
diff --git a/lib/libc/locale/tolower.c b/lib/libc/locale/tolower.c
index 65d5175..d9cbd6f 100644
--- a/lib/libc/locale/tolower.c
+++ b/lib/libc/locale/tolower.c
@@ -32,6 +32,8 @@
* 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.
+ *
+ * $FreeBSD$
*/
#include <stdio.h>
@@ -41,7 +43,6 @@ _BSD_CT_RUNE_T_
___tolower(c)
_BSD_CT_RUNE_T_ c;
{
-#ifdef XPG4
int x;
_RuneRange *rr = &_CurrentRuneLocale->maplower_ext;
_RuneEntry *re = rr->ranges;
@@ -55,6 +56,6 @@ ___tolower(c)
if (c <= re->max)
return(re->map + c - re->min);
}
-#endif
+
return(c);
}
diff --git a/lib/libc/locale/toupper.c b/lib/libc/locale/toupper.c
index d2e4480..d01104b0 100644
--- a/lib/libc/locale/toupper.c
+++ b/lib/libc/locale/toupper.c
@@ -32,6 +32,8 @@
* 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.
+ *
+ * $FreeBSD$
*/
#include <stdio.h>
@@ -41,7 +43,6 @@ _BSD_CT_RUNE_T_
___toupper(c)
_BSD_CT_RUNE_T_ c;
{
-#ifdef XPG4
int x;
_RuneRange *rr = &_CurrentRuneLocale->mapupper_ext;
_RuneEntry *re = rr->ranges;
@@ -55,6 +56,6 @@ ___toupper(c)
if (c <= re->max)
return(re->map + c - re->min);
}
-#endif
+
return(c);
}
diff --git a/lib/libc/locale/utf2.c b/lib/libc/locale/utf2.c
index 52b4cad..81a9412 100644
--- a/lib/libc/locale/utf2.c
+++ b/lib/libc/locale/utf2.c
@@ -32,9 +32,10 @@
* 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.
+ *
+ * $FreeBSD$
*/
-#ifdef XPG4
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid[] = "@(#)utf2.c 8.1 (Berkeley) 6/4/93";
#endif /* LIBC_SCCS and not lint */
@@ -147,4 +148,3 @@ _UTF2_sputrune(c, string, n, result)
return (1);
}
}
-#endif /* XPG4 */
OpenPOWER on IntegriCloud