Browse Source

Merge branch 'master' of git://git.etalabs.net/musl

nsz 13 years ago
parent
commit
e68a4633e0
3 changed files with 32 additions and 10 deletions
  1. 4 4
      COPYRIGHT
  2. 1 3
      README
  3. 27 3
      src/locale/strfmon.c

+ 4 - 4
COPYRIGHT

@@ -4,10 +4,10 @@ See the file COPYING for the text of this license.
 See below for the copyright status on all code included in musl:
 See below for the copyright status on all code included in musl:
 
 
 The TRE regular expression implementation (src/regex/reg* and
 The TRE regular expression implementation (src/regex/reg* and
-src/regex/tre*) is Copyright © 2001-2006 Ville Laurikari and licensed
-under the terms of the GNU LGPL version 2.1 or later. The included
-version was heavily modified in Spring 2006 by Rich Felker in the
-interests of size, simplicity, and namespace cleanliness.
+src/regex/tre*) is Copyright © 2001-2008 Ville Laurikari and licensed
+under a 2-clause BSD license (license text in the source files). The
+included version has been heavily modified by Rich Felker in 2012, in
+the interests of size, simplicity, and namespace cleanliness.
 
 
 Most of the math library code (src/math/* and src/complex/*) is
 Most of the math library code (src/math/* and src/complex/*) is
 Copyright © 1993,2004 Sun Microsystems or
 Copyright © 1993,2004 Sun Microsystems or

+ 1 - 3
README

@@ -26,9 +26,7 @@ intended to be stable at this point, and serious efforts have been
 made, using three separate test frameworks, to verify the correctness
 made, using three separate test frameworks, to verify the correctness
 of the implementation. Many major system-level and user-level programs
 of the implementation. Many major system-level and user-level programs
 are known to work with musl, either out-of-the-box or with minor
 are known to work with musl, either out-of-the-box or with minor
-patches to address portability errors; the main remaining applications
-which definitely will not work are those which require C++ support,
-which will be addressed during the 0.8 or 0.9 development series.
+patches to address portability errors.
 
 
 Included with this package is a gcc wrapper script (musl-gcc) which
 Included with this package is a gcc wrapper script (musl-gcc) which
 allows you to build musl-linked programs using an existing gcc 4.x
 allows you to build musl-linked programs using an existing gcc 4.x

+ 27 - 3
src/locale/strfmon.c

@@ -3,16 +3,15 @@
 #include <stdarg.h>
 #include <stdarg.h>
 #include <monetary.h>
 #include <monetary.h>
 #include <errno.h>
 #include <errno.h>
+#include <stdarg.h>
 
 
-ssize_t strfmon(char *s, size_t n, const char *fmt, ...)
+static ssize_t vstrfmon_l(char *s, size_t n, locale_t loc, const char *fmt, va_list ap)
 {
 {
 	size_t l;
 	size_t l;
 	double x;
 	double x;
 	int fill, nogrp, negpar, nosym, left, intl;
 	int fill, nogrp, negpar, nosym, left, intl;
 	int lp, rp, w, fw;
 	int lp, rp, w, fw;
 	char *s0=s;
 	char *s0=s;
-	va_list ap;
-	va_start(ap, fmt);
 	for (; n && *fmt; ) {
 	for (; n && *fmt; ) {
 		if (*fmt != '%') {
 		if (*fmt != '%') {
 		literal:
 		literal:
@@ -75,3 +74,28 @@ ssize_t strfmon(char *s, size_t n, const char *fmt, ...)
 	}
 	}
 	return s-s0;
 	return s-s0;
 }
 }
+
+ssize_t strfmon_l(char *s, size_t n, locale_t loc, const char *fmt, ...)
+{
+	va_list ap;
+	ssize_t ret;
+
+	va_start(ap, fmt);
+	ret = vstrfmon_l(s, n, loc, fmt, ap);
+	va_end(ap);
+
+	return ret;
+}
+
+
+ssize_t strfmon(char *s, size_t n, const char *fmt, ...)
+{
+	va_list ap;
+	ssize_t ret;
+
+	va_start(ap, fmt);
+	ret = vstrfmon_l(s, n, 0, fmt, ap);
+	va_end(ap);
+
+	return ret;
+}