2005-05-27 20:34:03 +00:00
|
|
|
/* Compare numeric strings.
|
|
|
|
|
|
2012-01-01 09:47:10 +01:00
|
|
|
Copyright (C) 2005-2006, 2009-2012 Free Software Foundation, Inc.
|
2005-05-27 20:34:03 +00:00
|
|
|
|
2007-07-23 14:35:58 +02:00
|
|
|
This program is free software: you can redistribute it and/or modify
|
2005-05-27 20:34:03 +00:00
|
|
|
it under the terms of the GNU General Public License as published by
|
2007-07-23 14:35:58 +02:00
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
(at your option) any later version.
|
2005-05-27 20:34:03 +00:00
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2007-07-23 14:35:58 +02:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
2005-05-27 20:34:03 +00:00
|
|
|
|
|
|
|
|
/* Written by Paul Eggert. */
|
|
|
|
|
|
2006-08-26 06:55:57 +00:00
|
|
|
#include <config.h>
|
2005-09-27 08:21:28 +00:00
|
|
|
|
2005-05-27 20:34:03 +00:00
|
|
|
#include "strnumcmp-in.h"
|
|
|
|
|
|
|
|
|
|
/* Externally-visible name for numcompare. */
|
|
|
|
|
|
maint: use "const" and "pure" function attributes where possible
* configure.ac (WARN_CFLAGS): Add -Wsuggest-attribute=const,
-Wsuggest-attribute=pure and -Wsuggest-attribute=noreturn.
(GNULIB_WARN_CFLAGS): But do not add them here... yet.
* src/chown-core.h (chopt_free, uid_to_name): Add function attribute(s).
* src/copy.c (is_ancestor, valid_options): Likewise.
* src/copy.h (chown_failure_ok): Likewise.
* src/dd.c (operand_matches, operand_is): Likewise.
* src/df.c (selected_fstype, excluded_fstype): Likewise.
* src/expr.c (null looks_like_integer): Likewise.
* src/md5sum.c (hex_digits): Likewise.
* src/od.c (get_lcm): Likewise.
* src/pathchk.c (component_start, component_len): Likewise.
* src/pinky.c (count_ampersands): Likewise.
* src/pr.c (cols_ready_to_print): Likewise.
* src/ptx.c (search_table): Likewise.
* src/sort.c (find_unit_order): Likewise.
* src/stty.c (mode_type_flag, string_to_baud, baud_to_value): Likewise.
* src/system.h (gcd, lcm): Likewise.
* src/tr.c (is_char_class_member, look_up_char_class): Likewise.
(star_digits_closebracket): Likewise.
* src/uniq.c (find_field): Likewise.
* src/wc.c (compute_number_width): Likewise.
* lib/xfts.h (cycle_warning_required): Likewise.
* gl/lib/randint.h (randint_get_source): Likewise.
* gl/lib/randperm.c (ceil_lg): Likewise.
* gl/lib/randperm.h (randperm_bound): Likewise.
* lib/strnumcmp.h (strintcmp): Likewise.
2011-04-24 19:06:39 +02:00
|
|
|
int _GL_ATTRIBUTE_PURE
|
2005-05-27 20:34:03 +00:00
|
|
|
strnumcmp (char const *a, char const *b,
|
2009-08-22 18:56:06 +02:00
|
|
|
int decimal_point, int thousands_sep)
|
2005-05-27 20:34:03 +00:00
|
|
|
{
|
|
|
|
|
return numcompare (a, b, decimal_point, thousands_sep);
|
|
|
|
|
}
|