diff options
Diffstat (limited to 'strings')
53 files changed, 726 insertions, 438 deletions
diff --git a/strings/bchange.c b/strings/bchange.c index 45eabacb767..c8e477fa186 100644 --- a/strings/bchange.c +++ b/strings/bchange.c @@ -1,17 +1,30 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: - 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. + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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. +*/ /* File : bchange.c Author : Michael widenius @@ -23,8 +36,7 @@ src in a buffer with tot_length bytes. */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" void bchange(register uchar *dst, size_t old_length, register const uchar *src, size_t new_length, size_t tot_length) diff --git a/strings/bmove_upp.c b/strings/bmove_upp.c index d466b69face..a1a955c9c51 100644 --- a/strings/bmove_upp.c +++ b/strings/bmove_upp.c @@ -1,17 +1,30 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: - 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. + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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. +*/ /* File : bmove.c Author : Michael widenius @@ -22,8 +35,7 @@ "src-len" to the destination "dst-len" counting downwards. */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" void bmove_upp(register uchar *dst, register const uchar *src, register size_t len) diff --git a/strings/conf_to_src.c b/strings/conf_to_src.c index 3217d1a4aa6..f8b560422d7 100644 --- a/strings/conf_to_src.c +++ b/strings/conf_to_src.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,8 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <my_global.h> -#include <m_string.h> +#include "strings_def.h" #include <m_ctype.h> #include <fcntl.h> #include <my_xml.h> @@ -251,7 +251,9 @@ static void fprint_copyright(FILE *file) { fprintf(file, -"/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.\n" +"/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems Inc.\n" +" Copyright 2010-2011 Monty Program Ab\n" +" Copyright (c) 2003, 2011, Oracle and/or its affiliates\n" "\n" " This program is free software; you can redistribute it and/or modify\n" " it under the terms of the GNU General Public License as published by\n" @@ -272,7 +274,7 @@ fprint_copyright(FILE *file) int main(int argc, char **argv __attribute__((unused))) { - CHARSET_INFO ncs; + struct charset_info_st ncs; CHARSET_INFO *cs; char filename[256]; FILE *f= stdout; diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c index b093aa6b080..e636c6e0263 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -26,9 +27,8 @@ * .configure. mbmaxlen_big5=2 */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #ifdef HAVE_CHARSET_big5 diff --git a/strings/ctype-bin.c b/strings/ctype-bin.c index 9738d1068b8..8f09561fb16 100644 --- a/strings/ctype-bin.c +++ b/strings/ctype-bin.c @@ -1,4 +1,6 @@ -/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. & tommy@valley.ne.jp. +/* Copyright tommy@valley.ne.jp. + Copyright (c) 2002, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -18,9 +20,8 @@ /* This file is for binary pseudo charset, created by bar@mysql.com */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> static const uchar ctype_bin[]= { diff --git a/strings/ctype-cp932.c b/strings/ctype-cp932.c index c7b01450779..037d9da7926 100644 --- a/strings/ctype-cp932.c +++ b/strings/ctype-cp932.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,9 +17,8 @@ /* This file is for cp932 charaset (Windows Japanese), and created based on ctype-sjis.c file */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #ifdef HAVE_CHARSET_cp932 diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c index f0078a38bf0..21af116edf6 100644 --- a/strings/ctype-czech.c +++ b/strings/ctype-czech.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -65,9 +66,8 @@ #ifdef REAL_MYSQL -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #else @@ -427,8 +427,7 @@ static my_bool my_like_range_czech(CHARSET_INFO *cs __attribute__((unused)), * * definition table reworked by Jaromir Dolecek <dolecek@ics.muni.cz> */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" static const uchar ctype_czech[257] = { 0, diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c index 5a6c2cb07d5..9321a0ac2c8 100644 --- a/strings/ctype-euc_kr.c +++ b/strings/ctype-euc_kr.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,9 +26,8 @@ * .configure. mbmaxlen_euc_kr=2 */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #ifdef HAVE_CHARSET_euckr diff --git a/strings/ctype-eucjpms.c b/strings/ctype-eucjpms.c index edf29dc327b..5d09c1c9d8d 100644 --- a/strings/ctype-eucjpms.c +++ b/strings/ctype-eucjpms.c @@ -1,5 +1,7 @@ -/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. & tommy@valley.ne.jp. - +/* Copyright tommy@valley.ne.jp. + Copyright (c) 2002, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab + This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; version 2 @@ -26,9 +28,8 @@ ctype-ujis.c file. * .configure. mbmaxlen_eucjpms=3 */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #ifdef HAVE_CHARSET_eucjpms diff --git a/strings/ctype-extra.c b/strings/ctype-extra.c index 57f900888a2..e0499c6f2e3 100644 --- a/strings/ctype-extra.c +++ b/strings/ctype-extra.c @@ -6,7 +6,8 @@ ./conf_to_src ../sql/share/charsets/ > FILE */ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. + Copyright (c) 2000, 2011, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -21,7 +22,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <my_global.h> +#include "strings_def.h" #include <m_ctype.h> #ifdef HAVE_CHARSET_dec8 diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c index 940284c535a..af0526790c5 100644 --- a/strings/ctype-gb2312.c +++ b/strings/ctype-gb2312.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -23,9 +24,8 @@ * .configure. mbmaxlen_gb2312=2 */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #ifdef HAVE_CHARSET_gb2312 diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c index 0c5f67e206b..f021c268d0a 100644 --- a/strings/ctype-gbk.c +++ b/strings/ctype-gbk.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,9 +26,8 @@ * .configure. mbmaxlen_gbk=2 */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #ifdef HAVE_CHARSET_gbk diff --git a/strings/ctype-latin1.c b/strings/ctype-latin1.c index 4eba876a08f..63858b56c9e 100644 --- a/strings/ctype-latin1.c +++ b/strings/ctype-latin1.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,9 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> static const uchar ctype_latin1[] = { 0, diff --git a/strings/ctype-mb.c b/strings/ctype-mb.c index 14dcacdbd60..d220a80d120 100644 --- a/strings/ctype-mb.c +++ b/strings/ctype-mb.c @@ -14,9 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <my_global.h> -#include "m_ctype.h" -#include "m_string.h" +#include "strings_def.h" +#include <m_ctype.h> #ifdef USE_MB diff --git a/strings/ctype-simple.c b/strings/ctype-simple.c index 3507bd279eb..4f2a42f5905 100644 --- a/strings/ctype-simple.c +++ b/strings/ctype-simple.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,9 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #include "my_sys.h" /* Needed for MY_ERRNO_ERANGE */ #include <errno.h> @@ -1422,7 +1422,7 @@ my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)), } } - digits= str - beg; + digits= (int) (str - beg); /* Continue to accumulate into ulonglong */ for (dot= NULL, ull= ul; str < end; str++) @@ -1459,7 +1459,7 @@ my_strntoull10rnd_8bit(CHARSET_INFO *cs __attribute__((unused)), } else { - shift= dot - str; + shift= (int) (dot - str); for ( ; str < end && (ch= (uchar) (*str - '0')) < 10; str++); } goto exp; diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c index 7e06fe828ff..b782c892fd9 100644 --- a/strings/ctype-sjis.c +++ b/strings/ctype-sjis.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,9 +17,8 @@ /* This file is for Shift JIS charset, and created by tommy@valley.ne.jp. */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #ifdef HAVE_CHARSET_sjis diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index f62c2619e1f..9bf7a73a6d1 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -1,5 +1,4 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. - +/* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. @@ -14,6 +13,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* + Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab Copyright (C) 2003 by Sathit Jittanupat <jsat66@hotmail.com,jsat66@yahoo.com> * solving bug crash with long text field string @@ -47,11 +48,10 @@ * .configure. strxfrm_multiply_tis620=4 */ -#include <my_global.h> -#include <my_sys.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #include "t_ctype.h" +#include <my_sys.h> #ifdef HAVE_CHARSET_tis620 diff --git a/strings/ctype-uca.c b/strings/ctype-uca.c index 4a77728b227..683fb8f6654 100644 --- a/strings/ctype-uca.c +++ b/strings/ctype-uca.c @@ -32,10 +32,8 @@ - No combining marks processing is done */ - -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #define MY_UCA_CNT_FLAG_SIZE 4096 #define MY_UCA_CNT_FLAG_MASK 4095 diff --git a/strings/ctype-ucs2.c b/strings/ctype-ucs2.c index 64652bf6d36..4f676c8effe 100644 --- a/strings/ctype-ucs2.c +++ b/strings/ctype-ucs2.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -17,11 +18,9 @@ /* UCS2 support. Written by Alexander Barkov <bar@mysql.com> */ -#include <my_global.h> +#include "strings_def.h" +#include <m_ctype.h> #include <my_sys.h> -#include "m_string.h" -#include "m_ctype.h" -#include <errno.h> #include <stdarg.h> diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c index 5ef752412d6..ecb0992c70d 100644 --- a/strings/ctype-ujis.c +++ b/strings/ctype-ujis.c @@ -1,4 +1,6 @@ -/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. & tommy@valley.ne.jp. +/* Copyright tommy@valley.ne.jp. + Copyright (c) 2002, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -25,9 +27,8 @@ * .configure. mbmaxlen_ujis=3 */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #ifdef HAVE_CHARSET_ujis diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 729d9c41a54..74dcbcf4fc2 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -18,10 +19,8 @@ /* UTF8 according RFC 2279 */ /* Written by Alexander Barkov <bar@udm.net> */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" -#include <errno.h> +#include "strings_def.h" +#include <m_ctype.h> #ifndef EILSEQ #define EILSEQ ENOENT diff --git a/strings/ctype-win1250ch.c b/strings/ctype-win1250ch.c index 9a6d21567ed..19896de5e66 100644 --- a/strings/ctype-win1250ch.c +++ b/strings/ctype-win1250ch.c @@ -1,4 +1,6 @@ -/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2001 Jan Pazdziora. + Copyright (c) 2003, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -39,9 +41,8 @@ #define REAL_MYSQL #ifdef REAL_MYSQL -#include "my_global.h" -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #else diff --git a/strings/ctype.c b/strings/ctype.c index 338ed75198a..429f4a0b366 100644 --- a/strings/ctype.c +++ b/strings/ctype.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,13 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <my_global.h> +#include "strings_def.h" #include <m_ctype.h> #include <my_xml.h> -#ifndef SCO -#include <m_string.h> -#endif - /* diff --git a/strings/decimal.c b/strings/decimal.c index 6e0edf6a513..dc8a8a70809 100644 --- a/strings/decimal.c +++ b/strings/decimal.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,7 +29,7 @@ integer that determines the number of significant digits in a particular radix R, where R is either 2 or 10. S is a non-negative integer. Every value of an exact numeric type of scale S is of the - form n*10^{-S}, where n is an integer such that �-R^P <= n <= R^P. + form n*10^{-S}, where n is an integer such that -R^P <= n <= R^P. [...] @@ -97,11 +98,10 @@ implementation-defined. */ -#include <my_global.h> +#include "strings_def.h" #include <m_ctype.h> #include <myisampack.h> #include <my_sys.h> /* for my_alloca */ -#include <m_string.h> #include <decimal.h> /* @@ -1024,7 +1024,7 @@ int longlong2decimal(longlong from, decimal_t *to) return ull2dec(from, to); } -int decimal2ulonglong(decimal_t *from, ulonglong *to) +int decimal2ulonglong(const decimal_t *from, ulonglong *to) { dec1 *buf=from->buf; ulonglong x=0; @@ -1053,7 +1053,7 @@ int decimal2ulonglong(decimal_t *from, ulonglong *to) return E_DEC_OK; } -int decimal2longlong(decimal_t *from, longlong *to) +int decimal2longlong(const decimal_t *from, longlong *to) { dec1 *buf=from->buf; longlong x=0; @@ -1172,7 +1172,7 @@ int decimal2longlong(decimal_t *from, longlong *to) 7E F2 04 37 2D FB 2D */ -int decimal2bin(decimal_t *from, uchar *to, int precision, int frac) +int decimal2bin(const decimal_t *from, uchar *to, int precision, int frac) { dec1 mask=from->sign ? -1 : 0, *buf1=from->buf, *stop1; int error=E_DEC_OK, intg=precision-frac, diff --git a/strings/do_ctype.c b/strings/do_ctype.c index 9bdbd3d27eb..c0e4aaf9be6 100644 --- a/strings/do_ctype.c +++ b/strings/do_ctype.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,10 +21,9 @@ #undef DBUG_OFF #endif -#include <my_global.h> +#include "strings_def.h" #include <ctype.h> #include <my_sys.h> -#include "m_string.h" uchar to_upper[256]; uchar to_lower[256], sort_order[256]; diff --git a/strings/dtoa.c b/strings/dtoa.c index 59aa056df9c..3aeeed9e148 100644 --- a/strings/dtoa.c +++ b/strings/dtoa.c @@ -36,9 +36,8 @@ ***************************************************************/ +#include "strings_def.h" #include <my_base.h> /* for EOVERFLOW on Windows */ -#include <my_global.h> -#include <m_string.h> /* for memcpy and NOT_FIXED_DEC */ /** Appears to suffice to not call malloc() in most cases. diff --git a/strings/dump_map.c b/strings/dump_map.c index 60bd91541c4..61e6cbb6e02 100644 --- a/strings/dump_map.c +++ b/strings/dump_map.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/int2str.c b/strings/int2str.c index d292594e1d9..9d099d2e7d1 100644 --- a/strings/int2str.c +++ b/strings/int2str.c @@ -1,20 +1,32 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - 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 - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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. +*/ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" /* _dig_vec arrays are public because they are used in several outer places. diff --git a/strings/is_prefix.c b/strings/is_prefix.c index 370927a24cd..2933577b5ab 100644 --- a/strings/is_prefix.c +++ b/strings/is_prefix.c @@ -1,17 +1,30 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: - 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. + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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. +*/ /* File : is_prefix.c Author : Michael Widenius @@ -21,8 +34,7 @@ A empty t is allways a prefix. */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" int is_prefix(register const char *s, register const char *t) { diff --git a/strings/llstr.c b/strings/llstr.c index 1ad798397b7..3525cab79ca 100644 --- a/strings/llstr.c +++ b/strings/llstr.c @@ -1,17 +1,30 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - 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 - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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. +*/ /* Defines: llstr(); @@ -24,8 +37,7 @@ */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" char *llstr(longlong value,char *buff) { diff --git a/strings/longlong2str.c b/strings/longlong2str.c index 21027a0ee9a..4be380207a4 100644 --- a/strings/longlong2str.c +++ b/strings/longlong2str.c @@ -1,17 +1,30 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - 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 - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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. +*/ /* Defines: longlong2str(); @@ -37,8 +50,7 @@ itoa assumes that 10 -base numbers are allways signed and other arn't. */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" #ifndef ll2str @@ -51,7 +63,7 @@ char *ll2str(longlong val,char *dst,int radix, int upcase) char buffer[65]; register char *p; long long_val; - char *dig_vec= upcase ? _dig_vec_upper : _dig_vec_lower; + const char *dig_vec= upcase ? _dig_vec_upper : _dig_vec_lower; ulonglong uval= (ulonglong) val; if (radix < 0) diff --git a/strings/my_strchr.c b/strings/my_strchr.c index 35f39d563c5..baf832c9a0a 100644 --- a/strings/my_strchr.c +++ b/strings/my_strchr.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2005, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,9 +14,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #define NEQ(A, B) ((A) != (B)) #define EQU(A, B) ((A) == (B)) diff --git a/strings/my_strtoll10.c b/strings/my_strtoll10.c index 5263abb335c..48d548242a8 100644 --- a/strings/my_strtoll10.c +++ b/strings/my_strtoll10.c @@ -1,21 +1,33 @@ -/* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - 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 - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* Copyright (c) 2003 TXT DataKonsult Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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. +*/ -#include <my_global.h> +#include "strings_def.h" #include <my_sys.h> /* Needed for MY_ERRNO_ERANGE */ -#include <m_string.h> #define MAX_NEGATIVE_NUMBER ((ulonglong) LL(0x8000000000000000)) #define INIT_CNT 9 diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c index 9f425a1db4d..72fd35e4e0f 100644 --- a/strings/my_vsnprintf.c +++ b/strings/my_vsnprintf.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,10 +14,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <my_global.h> -#include <m_string.h> -#include <stdarg.h> +#include "strings_def.h" #include <m_ctype.h> +#include <stdarg.h> #define MAX_ARGS 32 /* max positional args count*/ @@ -678,4 +678,3 @@ size_t my_snprintf(char* to, size_t n, const char* fmt, ...) va_end(args); return result; } - diff --git a/strings/str2int.c b/strings/str2int.c index 7cf49982d76..64d4e169891 100644 --- a/strings/str2int.c +++ b/strings/str2int.c @@ -1,17 +1,30 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - 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 - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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. +*/ /* str2int(src, radix, lower, upper, &val) @@ -37,9 +50,8 @@ call has no problems. */ -#include <my_global.h> -#include "m_string.h" -#include "m_ctype.h" +#include "strings_def.h" +#include <m_ctype.h> #include "my_sys.h" /* defines errno */ #include <errno.h> diff --git a/strings/str_alloc.c b/strings/str_alloc.c index fdf32b8ee15..5233a804153 100644 --- a/strings/str_alloc.c +++ b/strings/str_alloc.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,8 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <my_global.h> -#include <m_string.h> +#include "strings_def.h" static void *my_str_malloc_default(size_t size) { diff --git a/strings/strappend.c b/strings/strappend.c index e81a4d4301e..29d38e74fb5 100644 --- a/strings/strappend.c +++ b/strings/strappend.c @@ -1,31 +1,32 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - 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 - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* File : strappend.c - Author : Monty - Updated: 1987.02.07 - Defines: strappend() - - strappend(dest, len, fill) appends fill-characters to a string so that - the result length == len. If the string is longer than len it's - trunked. The des+len character is allways set to NULL. +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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. */ -#include <my_global.h> -#include "m_string.h" - +#include "strings_def.h" void strappend(register char *s, size_t len, pchar fill) { diff --git a/strings/strcend.c b/strings/strcend.c index c48f695cfd6..35f103fc40a 100644 --- a/strings/strcend.c +++ b/strings/strcend.c @@ -1,29 +1,32 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - 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 - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -/* File : strcend.c - Author : Michael Widenius: ifdef MC68000 - Updated: 20 April 1984 - Defines: strcend() - - strcend(s, c) returns a pointer to the first place in s where c - occurs, or a pointer to the end-null of s if c does not occur in s. +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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. */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" char *strcend(register const char *s, register pchar c) { diff --git a/strings/strcont.c b/strings/strcont.c index ddf8f2c838f..514d1a1d62f 100644 --- a/strings/strcont.c +++ b/strings/strcont.c @@ -1,17 +1,30 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - 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 - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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. +*/ /* File : strcont.c Author : Monty @@ -24,8 +37,7 @@ */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" char * strcont(reg1 const char *str,reg2 const char *set) { diff --git a/strings/strend.c b/strings/strend.c index c38502bd55c..33abcad49b3 100644 --- a/strings/strend.c +++ b/strings/strend.c @@ -1,19 +1,31 @@ -/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; version 2 - of the License. - - This library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ +/* Copyright Richard A. O'Keefe. + Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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. +*/ /* File : strend.c Author : Richard A. O'Keefe. @@ -26,8 +38,7 @@ be used instead, but this is clearer and faster. */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" char *strend(register const char *s) { diff --git a/strings/strfill.c b/strings/strfill.c index 12d227f5805..377f9b85e36 100644 --- a/strings/strfill.c +++ b/strings/strfill.c @@ -1,17 +1,30 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: - 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. + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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. +*/ /* File : strfill.c Author : Monty @@ -23,8 +36,7 @@ strfill() returns pointer to dest+len; */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" char * strfill(char *s, size_t len, pchar fill) { diff --git a/strings/strings_def.h b/strings/strings_def.h new file mode 100644 index 00000000000..6bd8e8f5575 --- /dev/null +++ b/strings/strings_def.h @@ -0,0 +1,103 @@ +#ifndef STRINGS_DEF_INCLUDED +#define STRINGS_DEF_INCLUDED +/* Copyright (C) 2011 Monty Program Ab + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + 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 + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +/* This file is to be include first in all files in the string directory */ + +#include <my_global.h> /* Define standar vars */ +#include "m_string.h" /* Exernal defintions of string functions */ + +/* + We can't use the original DBUG_ASSERT() (which includes _db_flush()) + in the strings library as libdbug is compiled after the the strings + library and we don't want to have strings depending on libdbug which + depends on mysys and strings. +*/ + +#if !defined(DBUG_OFF) +#undef DBUG_ASSERT +#define DBUG_ASSERT(A) assert(A) +#endif + +/* SPACE_INT is a word that contains only spaces */ +#if SIZEOF_INT == 4 +#define SPACE_INT 0x20202020 +#elif SIZEOF_INT == 8 +#define SPACE_INT 0x2020202020202020 +#else +#error define the appropriate constant for a word full of spaces +#endif + +/** + Skip trailing space. + + On most systems reading memory in larger chunks (ideally equal to the size of + the chinks that the machine physically reads from memory) causes fewer memory + access loops and hence increased performance. + This is why the 'int' type is used : it's closest to that (according to how + it's defined in C). + So when we determine the amount of whitespace at the end of a string we do + the following : + 1. We divide the string into 3 zones : + a) from the start of the string (__start) to the first multiple + of sizeof(int) (__start_words) + b) from the end of the string (__end) to the last multiple of sizeof(int) + (__end_words) + c) a zone that is aligned to sizeof(int) and can be safely accessed + through an int * + 2. We start comparing backwards from (c) char-by-char. If all we find is + space then we continue + 3. If there are elements in zone (b) we compare them as unsigned ints to a + int mask (SPACE_INT) consisting of all spaces + 4. Finally we compare the remaining part (a) of the string char by char. + This covers for the last non-space unsigned int from 3. (if any) + + This algorithm works well for relatively larger strings, but it will slow + the things down for smaller strings (because of the additional calculations + and checks compared to the naive method). Thus the barrier of length 20 + is added. + + @param ptr pointer to the input string + @param len the length of the string + @return the last non-space character +*/ + +static inline const uchar *skip_trailing_space(const uchar *ptr,size_t len) +{ + const uchar *end= ptr + len; + + if (len > 20) + { + const uchar *end_words= (const uchar *)(intptr) + (((ulonglong)(intptr)end) / SIZEOF_INT * SIZEOF_INT); + const uchar *start_words= (const uchar *)(intptr) + ((((ulonglong)(intptr)ptr) + SIZEOF_INT - 1) / SIZEOF_INT * SIZEOF_INT); + + DBUG_ASSERT(((ulonglong)(intptr)ptr) >= SIZEOF_INT); + if (end_words > ptr) + { + while (end > end_words && end[-1] == 0x20) + end--; + if (end[-1] == 0x20 && start_words < end_words) + while (end > start_words && ((unsigned *)end)[-1] == SPACE_INT) + end -= SIZEOF_INT; + } + } + while (end > ptr && end[-1] == 0x20) + end--; + return (end); +} +#endif diff --git a/strings/strmake.c b/strings/strmake.c index 500d739f8dd..5c26538c9bd 100644 --- a/strings/strmake.c +++ b/strings/strmake.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,8 +25,7 @@ strmake() returns pointer to closing null */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" char *strmake(register char *dst, register const char *src, size_t length) { diff --git a/strings/strmov.c b/strings/strmov.c index 19f12efceb9..b38d5db5d6e 100644 --- a/strings/strmov.c +++ b/strings/strmov.c @@ -1,17 +1,30 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - 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 - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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. +*/ /* strmov(dst, src) moves all the characters of src (including the @@ -21,8 +34,7 @@ into dst, which seems useful. */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" #ifndef strmov diff --git a/strings/strmov_overlapp.c b/strings/strmov_overlapp.c index 4cc3e294620..59d980fc7c4 100644 --- a/strings/strmov_overlapp.c +++ b/strings/strmov_overlapp.c @@ -13,8 +13,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" /* A trivial implementation */ char *strmov_overlapp(char *dst, const char *src) diff --git a/strings/strnlen.c b/strings/strnlen.c index 7c8f3c4a54e..c831d63243e 100644 --- a/strings/strnlen.c +++ b/strings/strnlen.c @@ -1,17 +1,31 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. - - 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 - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* Copyright Richard A. O'Keefe. + Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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. +*/ /* File : strnlen.c Author : Michael Widenius @@ -20,8 +34,7 @@ strnlen(s, len) returns the length of s or len if s is longer than len. */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" #ifndef HAVE_STRNLEN diff --git a/strings/strnmov.c b/strings/strnmov.c index a826233bb17..41d772c6819 100644 --- a/strings/strnmov.c +++ b/strings/strnmov.c @@ -1,17 +1,30 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 of the License. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: - 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. + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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. +*/ /* strnmov(dst,src,length) moves length characters, or until end, of src to @@ -20,8 +33,7 @@ truncated. */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" char *strnmov(register char *dst, register const char *src, size_t n) { diff --git a/strings/strxmov.c b/strings/strxmov.c index 815a4cbeaad..6338832a1a0 100644 --- a/strings/strxmov.c +++ b/strings/strxmov.c @@ -1,19 +1,31 @@ -/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; version 2 - of the License. - - This library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ +/* Copyright Richard A. O'Keefe. + Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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. +*/ /* File : strxmov.c Author : Richard A. O'Keefe. @@ -30,8 +42,7 @@ character pointer, or not the same bit pattern as NullS. */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" char *strxmov(char *dst,const char *src, ...) { diff --git a/strings/strxnmov.c b/strings/strxnmov.c index dac6eab5d63..20058b84259 100644 --- a/strings/strxnmov.c +++ b/strings/strxnmov.c @@ -1,19 +1,31 @@ -/* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; version 2 - of the License. - - This library 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 - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public - License along with this library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA */ +/* Copyright Richard A. O'Keefe. + Copyright (c) 2000 TXT DataKonsult Ab & Monty Program Ab + Copyright (c) 2009-2011, Monty Program Ab + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY + EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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. +*/ /* File : strxnmov.c Author : Richard A. O'Keefe. @@ -35,8 +47,7 @@ if total-string-length >= length then dst[length] will be set to \0 */ -#include <my_global.h> -#include "m_string.h" +#include "strings_def.h" #include <stdarg.h> char *strxnmov(char *dst, size_t len, const char *src, ...) diff --git a/strings/uca-dump.c b/strings/uca-dump.c index 3ba78163c2f..d281783aa2b 100644 --- a/strings/uca-dump.c +++ b/strings/uca-dump.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/uctypedump.c b/strings/uctypedump.c index 5b902843ee1..117db2ba30a 100644 --- a/strings/uctypedump.c +++ b/strings/uctypedump.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,15 +13,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -/* -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -*/ -#include <my_global.h> -#include <m_string.h> +#include "strings_def.h" #include <m_ctype.h> -#include "m_ctype.h" typedef struct my_ctype_name_st @@ -204,7 +197,7 @@ int main(int ac, char ** av) int charnum=0; int num=0; - printf("static unsigned char uctype_page%02X[256]=\n{\n",plane); + printf("static unsigned char uctype_page%02X[256]=\n{\n", (uint) plane); for(charnum=0;charnum<256;charnum++) { @@ -231,7 +224,7 @@ int main(int ac, char ** av) { char plane_name[128]="NULL"; if(uctype[plane].ctype){ - sprintf(plane_name,"uctype_page%02X",plane); + sprintf(plane_name,"uctype_page%02X",(uint) plane); } printf("\t{%d,%s}%s\n",uctype[plane].pctype,plane_name,plane<255?",":""); } diff --git a/strings/utr11-dump.c b/strings/utr11-dump.c index adbbdda1169..41cc387b2e0 100644 --- a/strings/utr11-dump.c +++ b/strings/utr11-dump.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2004, 2011, Oracle and/or its affiliates. + Copyright (c) 2009-2011, Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/strings/xml.c b/strings/xml.c index abe40810a97..7834f971269 100644 --- a/strings/xml.c +++ b/strings/xml.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. + Copyright (c) 2011 Monty Program Ab This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,8 +14,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "my_global.h" -#include "m_string.h" +#include "strings_def.h" #include "my_xml.h" |