diff options
Diffstat (limited to 'strings')
66 files changed, 1206 insertions, 715 deletions
diff --git a/strings/Makefile.am b/strings/Makefile.am index 1acd3365100..89b5d8c03e9 100644 --- a/strings/Makefile.am +++ b/strings/Makefile.am @@ -22,13 +22,13 @@ pkglib_LIBRARIES = libmystrings.a # Exact one of ASSEMBLER_X if ASSEMBLER_x86 ASRCS = strings-x86.s longlong2str-x86.s -CSRCS = bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c strxmov.c bmove_upp.c strappend.c strcont.c strend.c strfill.c strcend.c is_prefix.c strstr.c strinstr.c strmake.c strnmov.c strmov.c llstr.c ctype.c strnlen.c +CSRCS = bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c ctype.c strnlen.c else -if ASSEMBLER_sparc +if ASSEMBLER_sparc32 # These file MUST all be on the same line!! Otherwise automake # generats a very broken makefile -ASRCS = bmove_upp-sparc.s strappend-sparc.s strend-sparc.s strinstr-sparc.s strmake-sparc.s strmov-sparc.s strnmov-sparc.s strstr-sparc.s strxmov-sparc.s -CSRCS = strcont.c strfill.c strcend.c is_prefix.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c ctype.c strnlen.c +ASRCS = bmove_upp-sparc.s strappend-sparc.s strend-sparc.s strinstr-sparc.s strmake-sparc.s strmov-sparc.s strnmov-sparc.s strstr-sparc.s +CSRCS = strcont.c strfill.c strcend.c is_prefix.c longlong2str.c bfill.c bmove.c bmove512.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c atof.c bcmp.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c ctype.c strnlen.c strxmov.c else #no assembler ASRCS = @@ -44,7 +44,7 @@ DISTCLEANFILES = ctype_autoconf.c # Default charset definitions EXTRA_DIST = ctype-big5.c ctype-czech.c ctype-euc_kr.c \ ctype-gb2312.c ctype-gbk.c ctype-sjis.c \ - ctype-tis620.c ctype-ujis.c \ + ctype-tis620.c ctype-ujis.c ctype-latin1_de.c \ strto.c strings-x86.s \ longlong2str.c longlong2str-x86.s \ strxmov.c bmove_upp.c strappend.c strcont.c strend.c \ @@ -76,8 +76,11 @@ clean-local: if ASSEMBLER # On Linux gcc can compile the assembly files %.o : %.s - $(AS) -o $@ $< + $(AS) $(ASFLAGS) -o $@ $< endif +str_test: str_test.c $(LIBRARIES) + $(LINK) $(FLAGS) -DMAIN $(srcdir)/str_test.c $(LDADD) $(LIBS) + # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/strings/atof.c b/strings/atof.c index 1ce16027089..0e0aa598718 100644 --- a/strings/atof.c +++ b/strings/atof.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 */ /* A quicker atof. About 2-10 times faster than standard atof on sparc. @@ -23,7 +22,7 @@ Must be inited with init_my_atof to handle possibly overflows. */ -#include <global.h> +#include <my_global.h> #ifdef USE_MY_ATOF /* Skipp if we don't want it */ #include <m_ctype.h> #include <floatingpoint.h> diff --git a/strings/bchange.c b/strings/bchange.c index 99066cf1e95..034dd3382e1 100644 --- a/strings/bchange.c +++ b/strings/bchange.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 : bchange.c Author : Michael widenius @@ -25,10 +24,11 @@ src in a buffer with tot_length bytes. */ -#include <global.h> +#include <my_global.h> #include "m_string.h" -void bchange(register char *dst, uint old_length, register const char *src, uint new_length, uint tot_length) +void bchange(register char *dst, uint old_length, register const char *src, + uint new_length, uint tot_length) { uint rest=tot_length-old_length; if (old_length < new_length) diff --git a/strings/bcmp.c b/strings/bcmp.c index 3dce5025b64..64a6b72c443 100644 --- a/strings/bcmp.c +++ b/strings/bcmp.c @@ -1,30 +1,35 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 */ /* bcmp(s1, s2, len) returns 0 if the "len" bytes starting at "s1" are identical to the "len" bytes starting at "s2", non-zero if they are different. - Now only used with purify. + Now only used with purify because purify gives wrong warnings when + comparing a shorter string with bcmp. */ -#include <global.h> +#include <my_global.h> #include "m_string.h" +#ifdef HAVE_purify +#undef bcmp +#undef HAVE_BCMP +#endif + #if !defined(bcmp) && !defined(HAVE_BCMP) #if defined(MC68000) && defined(DS90) @@ -46,14 +51,11 @@ uint len; /* 0 <= len <= 65535 */ #else -#ifdef HAVE_purify -int my_bcmp(s1, s2, len) +#ifndef HAVE_purify +int bcmp(register const char *s1,register const char *s2, register uint len) #else -int bcmp(s1, s2, len) +int my_bcmp(register const char *s1,register const char *s2, register uint len) #endif - register const char *s1; - register const char *s2; - register uint len; { while (len-- != 0 && *s1++ == *s2++) ; return len+1; diff --git a/strings/bcopy-duff.c b/strings/bcopy-duff.c index 2f5a709c3a0..5ac6a716dab 100644 --- a/strings/bcopy-duff.c +++ b/strings/bcopy-duff.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 */ #define IFACTOR 4 diff --git a/strings/bfill.c b/strings/bfill.c index 9f5db7201d0..85d21483b41 100644 --- a/strings/bfill.c +++ b/strings/bfill.c @@ -29,7 +29,7 @@ code is presented for your interest and amusement. */ -#include <global.h> +#include <my_global.h> #include "m_string.h" #if !defined(bfill) && !defined(HAVE_BFILL) diff --git a/strings/bmove.c b/strings/bmove.c index 466bf74db75..09fe067adcd 100644 --- a/strings/bmove.c +++ b/strings/bmove.c @@ -36,7 +36,7 @@ code is presented for your interest and amusement. */ -#include <global.h> +#include <my_global.h> #include "m_string.h" #if !defined(HAVE_BMOVE) && !defined(bmove) diff --git a/strings/bmove512.c b/strings/bmove512.c index 11dc282d05c..30ac4b744b6 100644 --- a/strings/bmove512.c +++ b/strings/bmove512.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 : bmove512.c Author : Michael Widenius; @@ -27,7 +26,7 @@ fastest way to move a mutiple of 512 byte. */ -#include <global.h> +#include <my_global.h> #include "m_string.h" #ifndef bmove512 diff --git a/strings/bmove_upp-sparc.s b/strings/bmove_upp-sparc.s index 4fae7f5cc7c..f38c391f8ab 100644 --- a/strings/bmove_upp-sparc.s +++ b/strings/bmove_upp-sparc.s @@ -27,11 +27,11 @@ bmove_upp: nop .loop: sub %o1, 1, %o1 - ldub [%o1], %g2 + ldub [%o1], %o3 sub %o0, 1, %o0 subcc %o2, 1, %o2 bcc .loop - stb %g2, [%o0] + stb %o3, [%o0] .end: retl nop diff --git a/strings/bmove_upp.c b/strings/bmove_upp.c index af6575ebf41..5319cd9611a 100644 --- a/strings/bmove_upp.c +++ b/strings/bmove_upp.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 : bmove.c Author : Michael widenius @@ -24,7 +23,7 @@ "src-len" to the destination "dst-len" counting downwards. */ -#include <global.h> +#include <my_global.h> #include "m_string.h" #if defined(MC68000) && defined(DS90) diff --git a/strings/bzero.c b/strings/bzero.c index cc628e05277..a2b780cb396 100644 --- a/strings/bzero.c +++ b/strings/bzero.c @@ -1,3 +1,19 @@ +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 : bzero.c Author : Richard A. O'Keefe. Michael Widenius; ifdef MC68000 diff --git a/strings/conf_to_src.c b/strings/conf_to_src.c index 89415d31820..22e04337b14 100644 --- a/strings/conf_to_src.c +++ b/strings/conf_to_src.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 */ /* can't use -lmysys because this prog is used to create -lstrings */ diff --git a/strings/ctype-big5.c b/strings/ctype-big5.c index cccf6730046..44f8a100897 100644 --- a/strings/ctype-big5.c +++ b/strings/ctype-big5.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 basicly usa7 character sets with some extra functions @@ -28,7 +27,7 @@ * .configure. mbmaxlen_big5=2 */ -#include <global.h> +#include <my_global.h> #include "m_string.h" #include "m_ctype.h" diff --git a/strings/ctype-czech.c b/strings/ctype-czech.c index b47eaf3a63f..70f95e0d5d6 100644 --- a/strings/ctype-czech.c +++ b/strings/ctype-czech.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 strings/ctype-czech.c for MySQL. @@ -67,7 +66,7 @@ #ifdef REAL_MYSQL -#include <global.h> +#include <my_global.h> #include "m_string.h" #else @@ -427,7 +426,7 @@ my_bool my_like_range_czech(const char *ptr,uint ptr_length,pchar escape, * * definition table reworked by Jaromir Dolecek <dolecek@ics.muni.cz> */ -#include <global.h> +#include <my_global.h> #include "m_string.h" uchar NEAR ctype_czech[257] = { diff --git a/strings/ctype-euc_kr.c b/strings/ctype-euc_kr.c index df6f8c496bc..d05ca518283 100644 --- a/strings/ctype-euc_kr.c +++ b/strings/ctype-euc_kr.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 for Korean EUC charset, and created by powerm90@tinc.co.kr. @@ -27,7 +26,7 @@ * .configure. mbmaxlen_euc_kr=2 */ -#include <global.h> +#include <my_global.h> #include "m_string.h" uchar NEAR ctype_euc_kr[257] = diff --git a/strings/ctype-gb2312.c b/strings/ctype-gb2312.c index a587d72905e..28717d98403 100644 --- a/strings/ctype-gb2312.c +++ b/strings/ctype-gb2312.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 for Chinese EUC character sets (GB2312), and created by Miles Tsai (net-bull@126.com). */ @@ -25,7 +24,7 @@ * .configure. mbmaxlen_gb2312=2 */ -#include <global.h> +#include <my_global.h> #include "m_string.h" uchar NEAR ctype_gb2312[257] = diff --git a/strings/ctype-gbk.c b/strings/ctype-gbk.c index a5d55789bb8..9fccce175d8 100644 --- a/strings/ctype-gbk.c +++ b/strings/ctype-gbk.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 for Chinese character sets GBK, created by Wei He (hewei@mail.ied.ac.cn) @@ -28,7 +27,7 @@ */ -#include <global.h> +#include <my_global.h> #include "m_string.h" #include "m_ctype.h" @@ -2629,12 +2628,12 @@ int my_strnxfrm_gbk(uchar * dest, const uchar * src, int len, int srclen) } return srclen; } - + int my_strxfrm_gbk(uchar * dest, const uchar * src, int len) { return my_strnxfrm_gbk(dest,src,len,(uint) strlen((char*) src)); } - + /* ** Calculate min_str and max_str that ranges a LIKE string. ** Arguments: diff --git a/strings/ctype-latin1_de.c b/strings/ctype-latin1_de.c new file mode 100644 index 00000000000..01d377f91c3 --- /dev/null +++ b/strings/ctype-latin1_de.c @@ -0,0 +1,361 @@ +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 the latin1 character set with German sorting + * + * The modern sort order is used, where: + * + * 'ä' -> "ae" + * 'ö' -> "oe" + * 'ü' -> "ue" + * 'ß' -> "ss" + */ + +/* + * This comment is parsed by configure to create ctype.c, + * so don't change it unless you know what you are doing. + * + * .configure. strxfrm_multiply_latin1_de=2 + */ + +#include <my_global.h> +#include "m_string.h" +#include "m_ctype.h" + +uchar ctype_latin1_de[] = { + 0, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 40, 40, 40, 40, 40, 32, 32, + 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, + 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 132,132,132,132,132,132,132,132,132,132, 16, 16, 16, 16, 16, 16, + 16,129,129,129,129,129,129, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 16, 16, 16, 16, 16, + 16,130,130,130,130,130,130, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 16, 16, 16, 16, 32, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 72, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 16, 1, 1, 1, 1, 1, 1, 1, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 16, 2, 2, 2, 2, 2, 2, 2, 2 +}; + +uchar to_lower_latin1_de[] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, + 112,113,114,115,116,117,118,119,120,121,122, 91, 92, 93, 94, 95, + 96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111, + 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127, + 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, + 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, + 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, + 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, + 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, + 240,241,242,243,244,245,246,215,248,249,250,251,252,253,254,223, + 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239, + 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255 +}; + +uchar to_upper_latin1_de[] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, + 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, + 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, + 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, + 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, + 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, + 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, + 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, + 208,209,210,211,212,213,214,247,216,217,218,219,220,221,222,255 +}; + +/* + * This is a simple latin1 mapping table, which maps all accented + * characters to their non-accented equivalents. Note: in this + * table, 'ä' is mapped to 'A', 'ÿ' is mapped to 'Y', etc. - all + * accented characters except the following are treated the same way. + * Ü, ü, Ö, ö, Ä, ä + */ + +uchar sort_order_latin1_de[] = { + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,123,124,125,126,127, + 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, + 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, + 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, + 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, + 65, 65, 65, 65,196, 65, 92, 67, 69, 69, 69, 69, 73, 73, 73, 73, + 68, 78, 79, 79, 79, 79,214,215,216, 85, 85, 85,220, 89,222,223, + 65, 65, 65, 65,196, 65, 92, 67, 69, 69, 69, 69, 73, 73, 73, 73, + 68, 78, 79, 79, 79, 79,214,247,216, 85, 85, 85,220, 89,222, 89 +}; + +#define L1_AE 196 +#define L1_ae 228 +#define L1_OE 214 +#define L1_oe 246 +#define L1_UE 220 +#define L1_ue 252 +#define L1_ss 223 + + +/* + Some notes about the following comparison rules: + By definition, my_strnncoll_latin_de must works exactly as if had called + my_strnxfrm_latin_de() on both strings and compared the result strings. + + This means that: + Ä must also matches ÁE and Aè, because my_strxn_frm_latin_de() will convert + both to AE. + + The other option would be to not do any accent removal in + sort_order_latin_de[] at all +*/ + + +#define CHECK_S1_COMBO(ch1, ch2, str1, str1_end, res_if_str1_smaller, str2, fst, snd, accent) \ + /* Invariant: ch1 == fst == sort_order_latin1_de[accent] && ch1 != ch2 */ \ + if (ch2 != accent) \ + { \ + ch1= fst; \ + goto normal; \ + } \ + if (str1 == str1_end) \ + return res_if_str1_smaller; \ + { \ + int diff = (int) sort_order_latin1_de[*str1] - snd; \ + if (diff) \ + return diff*(-(res_if_str1_smaller)); \ + /* They are equal (e.g., "Ae" == 'ä') */ \ + str1++; \ + } + + +int my_strnncoll_latin1_de(const uchar * s1, int len1, + const uchar * s2, int len2) +{ + const uchar *e1 = s1 + len1; + const uchar *e2 = s2 + len2; + + while (s1 < e1 && s2 < e2) + { + /* + Because sort_order_latin1_de doesn't convert 'Ä', Ü or ß we + can use it here. + */ + uchar c1 = sort_order_latin1_de[*s1++]; + uchar c2 = sort_order_latin1_de[*s2++]; + if (c1 != c2) + { + switch (c1) { + case 'A': + CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'A', 'E', L1_AE); + break; + case 'O': + CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'O', 'E', L1_OE); + break; + case 'U': + CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'U', 'E', L1_UE); + break; + case 'S': + CHECK_S1_COMBO(c1, c2, s1, e1, -1, s2, 'S', 'S', L1_ss); + break; + case L1_AE: + CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'A', 'E', 'A'); + break; + case L1_OE: + CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'O', 'E', 'O'); + break; + case L1_UE: + CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'U', 'E', 'U'); + break; + case L1_ss: + CHECK_S1_COMBO(c1, c2, s2, e2, 1, s1, 'S', 'S', 'S'); + break; + default: + /* + Handle the case where 'c2' is a special character + If this is true, we know that c1 can't match this character. + */ + normal: + switch (c2) { + case L1_AE: + return (int) c1 - (int) 'A'; + case L1_OE: + return (int) c1 - (int) 'O'; + case L1_UE: + return (int) c1 - (int) 'U'; + case L1_ss: + return (int) c1 - (int) 'S'; + default: + { + int diff= (int) c1 - (int) c2; + if (diff) + return diff; + } + break; + } + } + } + } + /* A simple test of string lengths won't work -- we test to see + * which string ran out first */ + return s1 < e1 ? 1 : s2 < e2 ? -1 : 0; +} + + +int my_strnxfrm_latin1_de(uchar * dest, const uchar * src, int len, int srclen) +{ + const uchar *dest_orig = dest; + const uchar *de = dest + len; + const uchar *se = src + srclen; + while (src < se && dest < de) + { + uchar chr=sort_order_latin1_de[*src]; + switch (chr) { + case L1_AE: + *dest++ = 'A'; + if (dest < de) + *dest++ = 'E'; + break; + case L1_OE: + *dest++ = 'O'; + if (dest < de) + *dest++ = 'E'; + break; + case L1_UE: + *dest++ = 'U'; + if (dest < de) + *dest++ = 'E'; + break; + case L1_ss: + *dest++ = 'S'; + if (dest < de) + *dest++ = 'S'; + break; + default: + *dest++= chr; + break; + } + ++src; + } + return dest - dest_orig; +} + + +int my_strcoll_latin1_de(const uchar * s1, const uchar * s2) +{ + /* XXX QQ: This should be fixed to not call strlen */ + return my_strnncoll_latin1_de(s1, strlen((char*) s1), + s2, strlen((char*) s2)); +} + +int my_strxfrm_latin1_de(uchar * dest, const uchar * src, int len) +{ + /* XXX QQ: This should be fixed to not call strlen */ + return my_strnxfrm_latin1_de(dest, src, len, strlen((char*) src)); +} + +/* + * Calculate min_str and max_str that ranges a LIKE string. + * Arguments: + * ptr IN: Pointer to LIKE string. + * ptr_length IN: Length of LIKE string. + * escape IN: Escape character in LIKE. (Normally '\'). + * No escape characters should appear in min_str or max_str + * res_length IN: Length of min_str and max_str. + * min_str IN/OUT: Smallest case sensitive string that ranges LIKE. + * Should be space padded to res_length. + * max_str IN/OUT: Largest case sensitive string that ranges LIKE. + * Normally padded with the biggest character sort value. + * min_length OUT: Length of min_str without space padding. + * max_length OUT: Length of max_str without space padding. + * + * The function should return 0 if ok and 1 if the LIKE string can't be + * optimized ! + */ + +#define min_sort_char ((char) 0) +#define max_sort_char ((char) 255) +#define wild_one '_' +#define wild_many '%' + +my_bool my_like_range_latin1_de(const char *ptr, uint ptr_length, + pchar escape, uint res_length, + char *min_str, char *max_str, + uint *min_length, uint *max_length) +{ + const char *end = ptr + ptr_length; + char *min_org = min_str; + char *min_end = min_str + res_length; + + for (; ptr != end && min_str != min_end; ptr++) + { + if (*ptr == escape && ptr + 1 != end) + { + ptr++; /* Skip escape */ + *min_str++ = *max_str++ = *ptr; + continue; + } + if (*ptr == wild_one) /* '_' in SQL */ + { + *min_str++ = min_sort_char; + *max_str++ = max_sort_char; + continue; + } + if (*ptr == wild_many) /* '%' in SQL */ + { + *min_length = (uint)(min_str - min_org); + *max_length = res_length; + do { + *min_str++ = ' '; /* Because if key compression */ + *max_str++ = max_sort_char; + } while (min_str != min_end); + return 0; + } + *min_str++ = *max_str++ = *ptr; + } + *min_length = *max_length = (uint) (min_str - min_org); + + /* Temporary fix for handling wild_one at end of string (key compression) */ + { + char *tmp; + for (tmp= min_str ; tmp > min_org && tmp[-1] == '\0';) + *--tmp=' '; + } + + while (min_str != min_end) + *min_str++ = *max_str++ = ' '; /* Because if key compression */ + return 0; +} diff --git a/strings/ctype-sjis.c b/strings/ctype-sjis.c index 9f23d69eb12..5d5f64cc5fe 100644 --- a/strings/ctype-sjis.c +++ b/strings/ctype-sjis.c @@ -1,24 +1,23 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 for Shift JIS charset, and created by tommy@valley.ne.jp. */ -#include <global.h> +#include <my_global.h> #include "m_string.h" #include "m_ctype.h" diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c index 1c0acc38e24..d5181dc4db0 100644 --- a/strings/ctype-tis620.c +++ b/strings/ctype-tis620.c @@ -1,3 +1,19 @@ +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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) 2001 by Korakot Chaovavanich <korakot@iname.com> and Apisilp Trunganont <apisilp@pantip.inet.co.th> @@ -27,7 +43,7 @@ * .configure. strxfrm_multiply_tis620=4 */ -#include <global.h> +#include <my_global.h> #include <my_sys.h> #include "m_string.h" #include "m_ctype.h" @@ -444,8 +460,8 @@ static uchar* thai2sortable(const uchar * tstr,uint len) const uchar* p = tstr; uchar *outBuf; -// uchar *pRight1, *pRight2, *pRight3, *pRight4; -// uchar *pLeft1, *pLeft2, *pLeft3, *pLeft4; +/* uchar *pRight1, *pRight2, *pRight3, *pRight4; */ +/* uchar *pLeft1, *pLeft2, *pLeft3, *pLeft4; */ uchar *pRight1, *pRight2, *pRight3; uchar *pLeft1, *pLeft2, *pLeft3; uint bufSize; @@ -480,11 +496,11 @@ static uchar* thai2sortable(const uchar * tstr,uint len) *pRight1++ = t_ctype[p[1]][0]; *pRight2++ = t_ctype[p[1]][1]; *pRight3++ = t_ctype[p[1]][2]; -// *pRight4++ = t_ctype[p[1]][3]; +/* *pRight4++ = t_ctype[p[1]][3]; */ *pRight1++ = t_ctype[*p][0]; *pRight2++ = t_ctype[*p][1]; *pRight3++ = t_ctype[*p][2]; -// *pRight4++ = t_ctype[*p][3]; +/* *pRight4++ = t_ctype[*p][3]; */ len--; p += 2; } else { @@ -501,17 +517,17 @@ static uchar* thai2sortable(const uchar * tstr,uint len) } *pRight1++ = L2_BLANK; *pRight2++ = L3_BLANK; -// *pRight3++ = L4_BLANK; +/* *pRight3++ = L4_BLANK; */ *pRight3++ = '\0'; -// *pRight4++ = '\0'; +/* *pRight4++ = '\0'; */ memcpy(pRight1, pLeft2, pRight2 - pLeft2); pRight1 += pRight2 - pLeft2; memcpy(pRight1, pLeft3, pRight3 - pLeft3); -// pRight1 += pRight3 - pLeft3; -// memcpy(pRight1, pLeft4, pRight4 - pLeft4); +/* pRight1 += pRight3 - pLeft3; */ +/* memcpy(pRight1, pLeft4, pRight4 - pLeft4); */ free(pLeft2); free(pLeft3); -// free(pLeft4); +/* free(pLeft4); */ return(outBuf); } @@ -603,22 +619,22 @@ my_bool my_like_range_tis620(const char *ptr, uint ptr_length, pchar escape, { if (*ptr == escape && ptr+1 != end) { - ptr++; // Skipp escape + ptr++; /* Skipp escape */ *min_str++= *max_str++ = *ptr; continue; } - if (*ptr == wild_one) // '_' in SQL + if (*ptr == wild_one) /* '_' in SQL */ { - *min_str++='\0'; // This should be min char + *min_str++='\0'; /* This should be min char */ *max_str++=max_sort_chr; continue; } - if (*ptr == wild_many) // '%' in SQL + if (*ptr == wild_many) /* '%' in SQL */ { *min_length= (uint) (min_str - min_org); *max_length=res_length; do { - *min_str++ = ' '; // Because if key compression + *min_str++ = ' '; /* Because if key compression */ *max_str++ = max_sort_chr; } while (min_str != min_end); return 0; @@ -628,7 +644,7 @@ my_bool my_like_range_tis620(const char *ptr, uint ptr_length, pchar escape, *min_length= *max_length = (uint) (min_str - min_org); while (min_str != min_end) - *min_str++ = *max_str++ = ' '; // Because if key compression + *min_str++ = *max_str++ = ' '; /* Because if key compression */ return 0; } diff --git a/strings/ctype-ujis.c b/strings/ctype-ujis.c index 5356978976f..650182bfda1 100644 --- a/strings/ctype-ujis.c +++ b/strings/ctype-ujis.c @@ -25,7 +25,7 @@ * .configure. mbmaxlen_ujis=3 */ -#include <global.h> +#include <my_global.h> #include "m_string.h" uchar NEAR ctype_ujis[257] = diff --git a/strings/ctype.c b/strings/ctype.c index e66c9771d78..8e3571b1b88 100644 --- a/strings/ctype.c +++ b/strings/ctype.c @@ -1,23 +1,24 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 */ -#include <global.h> +#include <my_global.h> #include <m_ctype.h> +#ifndef SCO #include <m_string.h> +#endif /* generated by make, using conf_to_src */ #include "ctype_extra_sources.c" diff --git a/strings/do_ctype.c b/strings/do_ctype.c index e05926bf8d3..f51770e3633 100644 --- a/strings/do_ctype.c +++ b/strings/do_ctype.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 */ /* Prints case-convert and sort-convert tabell on stdout. This is used to make _ctype.c easyer */ @@ -22,7 +21,7 @@ #undef DBUG_OFF #endif -#include <global.h> +#include <my_global.h> #include <ctype.h> #include <my_sys.h> #include "m_string.h" @@ -146,7 +145,7 @@ void init_case_convert() higher_pos= (uchar * ) "\217\216\231\232\220"; /* Extra chars to konv. */ lower_pos= (uchar * ) "\206\204\224\201\202"; #else -#if defined(HPUX) && ASCII_BITS_USED == 8 +#if defined(HPUX10) && ASCII_BITS_USED == 8 higher_pos= (uchar * ) "\xd0\xd8\xda\xdb\xdc\xd3"; lower_pos= (uchar * ) "\xd4\xcc\xce\xdf\xc9\xd7"; #else @@ -161,7 +160,7 @@ void init_case_convert() lower_pos= (uchar * ) "{}|`~"; #endif #endif /* USE_INTERNAL_CTYPE */ -#endif /* HPUX */ +#endif /* HPUX10 */ #endif /* MSDOS */ while (*higher_pos) @@ -177,7 +176,7 @@ void init_case_convert() higher_pos= (uchar *) "\217\216\231\232\220"; lower_pos= (uchar *) "\216\217\231YE"; #else -#if defined(HPUX) && ASCII_BITS_USED == 8 +#if defined(HPUX10) && ASCII_BITS_USED == 8 higher_pos= lower_pos= (uchar *) ""; /* Tecknen i r{tt ordning */ #else #ifdef USE_ISO_8859_1 /* As in USG5 ICL-386 */ @@ -187,7 +186,7 @@ void init_case_convert() higher_pos= (uchar *) "][\\~`"; /* R{tt ordning p} tecknen */ lower_pos= (uchar *) "[\\]YE"; /* Ordning enligt ascii */ #endif /* USE_ISO_8859_1 */ -#endif /* HPUX */ +#endif /* HPUX10 */ #endif /* MSDOS */ while (*higher_pos) diff --git a/strings/int2str.c b/strings/int2str.c index 4003e8a6167..38e8a5182a3 100644 --- a/strings/int2str.c +++ b/strings/int2str.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 */ /* Defines: int2str(), itoa(), ltoa() @@ -39,7 +38,7 @@ itoa assumes that 10 -base numbers are allways signed and other arn't. */ -#include <global.h> +#include <my_global.h> #include "m_string.h" char NEAR _dig_vec[] = diff --git a/strings/is_prefix.c b/strings/is_prefix.c index d3f2b148de2..37d8002703b 100644 --- a/strings/is_prefix.c +++ b/strings/is_prefix.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 : is_prefix.c Author : Michael Widenius @@ -23,7 +22,7 @@ A empty t is allways a prefix. */ -#include <global.h> +#include <my_global.h> #include "m_string.h" int is_prefix(register const char *s, register const char *t) diff --git a/strings/llstr.c b/strings/llstr.c index 470645a4f65..966b347ac7e 100644 --- a/strings/llstr.c +++ b/strings/llstr.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 */ /* Defines: llstr(); @@ -26,7 +25,7 @@ */ -#include <global.h> +#include <my_global.h> #include "m_string.h" char *llstr(longlong value,char *buff) diff --git a/strings/longlong2str.c b/strings/longlong2str.c index 5c4eaf98c85..a991c57b4d9 100644 --- a/strings/longlong2str.c +++ b/strings/longlong2str.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 */ /* Defines: longlong2str(); @@ -39,7 +38,7 @@ itoa assumes that 10 -base numbers are allways signed and other arn't. */ -#include <global.h> +#include <my_global.h> #include "m_string.h" #if defined(HAVE_LONG_LONG) && !defined(longlong2str) && !defined(HAVE_LONGLONG2STR) diff --git a/strings/memcmp.c b/strings/memcmp.c index 1bb8deaeac0..2f1e4e2ea1f 100644 --- a/strings/memcmp.c +++ b/strings/memcmp.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 */ /* memcmp(lhs, rhs, len) compares the two memory areas lhs[0..len-1] ?? rhs[0..len-1]. It diff --git a/strings/memcpy.c b/strings/memcpy.c index 4fc84fb6052..de79e43ae72 100644 --- a/strings/memcpy.c +++ b/strings/memcpy.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 */ /* memcpy(dst, src, len) diff --git a/strings/memset.c b/strings/memset.c index 57c8fea5ebe..53383beb170 100644 --- a/strings/memset.c +++ b/strings/memset.c @@ -1,3 +1,19 @@ +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 : memset.c Author : Richard A. O'Keefe. Updated: 25 May 1984 @@ -27,7 +43,7 @@ char *memset(char *dst,int chr, int len) char *memset(char *dst, register pchar chr, register int len) { register char *d; - + for (d = dst; --len >= 0; *d++ = chr) ; return dst; } diff --git a/strings/r_strinstr.c b/strings/r_strinstr.c index 882a4eda412..76d310a3fda 100644 --- a/strings/r_strinstr.c +++ b/strings/r_strinstr.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 */ /* Author : David @@ -24,7 +23,7 @@ the pattern counted from the begining of the string. */ -#include <global.h> +#include <my_global.h> #include "m_string.h" uint r_strinstr(reg1 my_string str,int from, reg4 my_string search) diff --git a/strings/str2int.c b/strings/str2int.c index 55fcd56adb9..58669287473 100644 --- a/strings/str2int.c +++ b/strings/str2int.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 */ /* str2int(src, radix, lower, upper, &val) @@ -39,7 +38,7 @@ call has no problems. */ -#include <global.h> +#include <my_global.h> #include "m_string.h" #include "m_ctype.h" #include "my_sys.h" /* defines errno */ @@ -50,7 +49,8 @@ X >= 'a' && X <= 'z' ? X-'a'+10 :\ '\177') -char *str2int(register const char *src, register int radix, long int lower, long int upper, long int *val) +char *str2int(register const char *src, register int radix, long int lower, + long int upper, long int *val) { int sign; /* is number negative (+1) or positive (-1) */ int n; /* number of digits yet to be converted */ diff --git a/strings/str_test.c b/strings/str_test.c index bd54bc6d806..0c3ff471ad7 100644 --- a/strings/str_test.c +++ b/strings/str_test.c @@ -1,23 +1,22 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 */ /* Test of all stringfunktions that is coded in assembler */ -#include <global.h> +#include <my_global.h> #include <stdarg.h> #include "m_string.h" @@ -131,9 +130,6 @@ int main(void) if (errors) fputs("--- Some functions doesn't work!! Fix them\n",stderr); return(errors > 0); - - fputs("Fatal error\n",stderr); - return(2); } /* main */ diff --git a/strings/strappend-sparc.s b/strings/strappend-sparc.s index 69bb555aa47..30b621c3fce 100644 --- a/strings/strappend-sparc.s +++ b/strings/strappend-sparc.s @@ -22,28 +22,28 @@ .type strappend,#function .proc 020 strappend: - add %o0, %o1, %g3 ! g3 = endpos - ldsb [%o0], %g2 + add %o0, %o1, %o3 ! o3 = endpos + ldsb [%o0], %o4 .loop1: add %o0, 1, %o0 ! find end of str - cmp %g2, 0 + cmp %o4, 0 bne,a .loop1 - ldsb [%o0], %g2 + ldsb [%o0], %o4 sub %o0, 1, %o0 - cmp %o0, %g3 + cmp %o0, %o3 bgeu .end nop stb %o2, [%o0] .loop2: add %o0, 1, %o0 - cmp %o0, %g3 + cmp %o0, %o3 blu,a .loop2 stb %o2, [%o0] .end: retl - stb %g0, [%g3] + stb %g0, [%o3] .strappend_end: .size strappend,.strappend_end-strappend .ident "Matt Wagner & Monty" diff --git a/strings/strappend.c b/strings/strappend.c index d5defaeb0bf..9912bd5197d 100644 --- a/strings/strappend.c +++ b/strings/strappend.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 @@ -25,7 +24,7 @@ trunked. The des+len character is allways set to NULL. */ -#include <global.h> +#include <my_global.h> #include "m_string.h" @@ -39,5 +38,3 @@ void strappend(register char *s, uint len, pchar fill) while (s<endpos) *(s++) = fill; *(endpos) = '\0'; } /* strappend */ - - diff --git a/strings/strcat.c b/strings/strcat.c index 699729cd7b5..3c571514701 100644 --- a/strings/strcat.c +++ b/strings/strcat.c @@ -1,3 +1,19 @@ +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 : strcat.c Author : Richard A. O'Keefe. Updated: 10 April 1984 diff --git a/strings/strcend.c b/strings/strcend.c index 246b81d7f7b..a3f00a1057b 100644 --- a/strings/strcend.c +++ b/strings/strcend.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 @@ -24,7 +23,7 @@ occurs, or a pointer to the end-null of s if c does not occur in s. */ -#include <global.h> +#include <my_global.h> #include "m_string.h" #if defined(MC68000) && defined(DS90) diff --git a/strings/strchr.c b/strings/strchr.c index ef117d85635..3f1a569c296 100644 --- a/strings/strchr.c +++ b/strings/strchr.c @@ -1,3 +1,19 @@ +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 : strchr.c Author : Richard A. O'Keefe. Michael Widenius: ifdef MC68000 diff --git a/strings/strcmp.c b/strings/strcmp.c index d911b2daa17..d673c035dbc 100644 --- a/strings/strcmp.c +++ b/strings/strcmp.c @@ -1,3 +1,19 @@ +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 : strcmp.c Author : Richard A. O'Keefe. Updated: 10 April 1984 diff --git a/strings/strcont.c b/strings/strcont.c index 5c7d5d2e55f..1d89be89517 100644 --- a/strings/strcont.c +++ b/strings/strcont.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 : strcont.c Author : Monty @@ -26,7 +25,7 @@ */ -#include <global.h> +#include <my_global.h> #include "m_string.h" my_string strcont(reg1 const char *str,reg2 const char *set) diff --git a/strings/strend-sparc.s b/strings/strend-sparc.s index fd1dba4d36f..0f19f6a435a 100644 --- a/strings/strend-sparc.s +++ b/strings/strend-sparc.s @@ -22,12 +22,12 @@ .type strend,#function .proc 0102 strend: - ldsb [%o0], %g2 ! Handle first char differently to make + ldsb [%o0], %o3 ! Handle first char differently to make .loop: ! a faster loop add %o0, 1, %o0 - cmp %g2, 0 + cmp %o3, 0 bne,a .loop - ldsb [%o0], %g2 + ldsb [%o0], %o3 retl sub %o0,1,%o0 .strend_end: diff --git a/strings/strend.c b/strings/strend.c index 3affb9bd5f6..0e9c0333fc8 100644 --- a/strings/strend.c +++ b/strings/strend.c @@ -27,7 +27,7 @@ Beware: the asm version works only if strlen(s) < 65535. */ -#include <global.h> +#include <my_global.h> #include "m_string.h" #if VaxAsm diff --git a/strings/strfill.c b/strings/strfill.c index ef0ccb567d1..0ef56a67706 100644 --- a/strings/strfill.c +++ b/strings/strfill.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 : strfill.c Author : Monty @@ -25,7 +24,7 @@ strfill() returns pointer to dest+len; */ -#include <global.h> +#include <my_global.h> #include "m_string.h" my_string strfill(my_string s,uint len,pchar fill) diff --git a/strings/strings-not-used.h b/strings/strings-not-used.h index fa4dff318f5..e0dc1eac3a5 100644 --- a/strings/strings-not-used.h +++ b/strings/strings-not-used.h @@ -1,3 +1,19 @@ +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 : strings.h Author : Richard A. O'Keefe. Updated: 1 June 1984 @@ -13,7 +29,7 @@ #ifndef NullS -#include <global.h> /* Define standar vars */ +#include <my_global.h> /* Define standar vars */ #include "m_string.h" #define NUL '\0' diff --git a/strings/strinstr.c b/strings/strinstr.c index e1d502f4004..1c814d19d47 100644 --- a/strings/strinstr.c +++ b/strings/strinstr.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 : strinstr.c Author : Monty & David @@ -27,7 +26,7 @@ char is 1. */ -#include <global.h> +#include <my_global.h> #include "m_string.h" uint strinstr(reg1 const char *str,reg4 const char *search) diff --git a/strings/strlen.c b/strings/strlen.c index c142a7f2b14..b9be374fa6e 100644 --- a/strings/strlen.c +++ b/strings/strlen.c @@ -1,3 +1,19 @@ +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 : strlen.c Author : Richard A. O'Keefe. / Monty Michael Widenius; ifdef MC68000 diff --git a/strings/strmake-sparc.s b/strings/strmake-sparc.s index 9fe72a9f9a2..4effe95774e 100644 --- a/strings/strmake-sparc.s +++ b/strings/strmake-sparc.s @@ -25,16 +25,16 @@ strmake: orcc %g0,%o2,%g0 be,a .end nop - ldsb [%o1],%g2 + ldsb [%o1],%o3 .loop: - stb %g2,[%o0] - cmp %g2,0 + stb %o3,[%o0] + cmp %o3,0 be .end ! Jump to end on end of string add %o1,1,%o1 add %o0,1,%o0 subcc %o2,1,%o2 bne,a .loop - ldsb [%o1],%g2 + ldsb [%o1],%o3 .end: retl stb %g0,[%o0] diff --git a/strings/strmake.c b/strings/strmake.c index 66a230338a1..2e384fc168a 100644 --- a/strings/strmake.c +++ b/strings/strmake.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 : strmake.c Author : Michael Widenius @@ -26,7 +25,7 @@ strmake() returns pointer to closing null */ -#include <global.h> +#include <my_global.h> #include "m_string.h" #ifdef BAD_STRING_COMPILER diff --git a/strings/strmov-sparc.s b/strings/strmov-sparc.s index 6114b0bf6e2..3536685b47b 100644 --- a/strings/strmov-sparc.s +++ b/strings/strmov-sparc.s @@ -23,10 +23,10 @@ .proc 0102 strmov: .loop: - ldub [%o1], %g2 - stb %g2, [%o0] + ldub [%o1], %o3 + stb %o3, [%o0] add %o1, 1, %o1 - cmp %g2, 0 + cmp %o3, 0 bne,a .loop add %o0, 1, %o0 retl diff --git a/strings/strmov.c b/strings/strmov.c index 8f5beb41f41..507c2b6d997 100644 --- a/strings/strmov.c +++ b/strings/strmov.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 */ /* strmov(dst, src) moves all the characters of src (including the @@ -23,7 +22,7 @@ into dst, which seems useful. */ -#include <global.h> +#include <my_global.h> #include "m_string.h" #ifdef BAD_STRING_COMPILER diff --git a/strings/strnlen.c b/strings/strnlen.c index 3d625f7d48a..fc8879b3a41 100644 --- a/strings/strnlen.c +++ b/strings/strnlen.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 : strnlen.c Author : Michael Widenius @@ -22,7 +21,7 @@ strnlen(s, len) returns the length of s or len if s is longer than len. */ -#include <global.h> +#include <my_global.h> #include "m_string.h" #ifndef HAVE_STRNLEN diff --git a/strings/strnmov-sparc.s b/strings/strnmov-sparc.s index 2dfcb95ab76..f681318f410 100644 --- a/strings/strnmov-sparc.s +++ b/strings/strnmov-sparc.s @@ -25,16 +25,16 @@ strnmov: orcc %g0,%o2,%g0 be,a .end nop - ldsb [%o1],%g2 + ldsb [%o1],%o3 .loop: - stb %g2,[%o0] - cmp %g2,0 + stb %o3,[%o0] + cmp %o3,0 be .end ! Jump to end on end of string add %o1,1,%o1 add %o0,1,%o0 subcc %o2,1,%o2 bne,a .loop - ldsb [%o1],%g2 + ldsb [%o1],%o3 .end: retl nop diff --git a/strings/strnmov.c b/strings/strnmov.c index ffc4a62f75e..362f3d6c4a8 100644 --- a/strings/strnmov.c +++ b/strings/strnmov.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 */ /* strnmov(dst,src,length) moves length characters, or until end, of src to @@ -22,7 +21,7 @@ truncated. */ -#include <global.h> +#include <my_global.h> #include "m_string.h" char *strnmov(register char *dst, register const char *src, uint n) diff --git a/strings/strrchr.c b/strings/strrchr.c index 5a045ac3740..fb588c015f2 100644 --- a/strings/strrchr.c +++ b/strings/strrchr.c @@ -1,3 +1,19 @@ +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 : strrchr.c Author : Richard A. O'Keefe. Updated: 10 April 1984 diff --git a/strings/strstr-sparc.s b/strings/strstr-sparc.s index 1263236f107..eb658e9f7f0 100644 --- a/strings/strstr-sparc.s +++ b/strings/strstr-sparc.s @@ -33,10 +33,10 @@ strstr: ldsb [%o1],%o2 ! o2= First char of search .top: - ldsb [%o0],%g3 ! g3= First char of rest of str - cmp %g3,0 + ldsb [%o0],%o4 ! o4= First char of rest of str + cmp %o4,0 be .abort ! Found end null ; - cmp %g3,%o2 + cmp %o4,%o2 bne .top add %o0,1,%o0 @@ -45,20 +45,20 @@ strstr: ! while (*j) ! if (*i++ != *j++) goto skipp; - or %g0,%o0,%g2 - add %o1,1,%g3 ! g3= search+1 + or %g0,%o0,%o3 + add %o1,1,%o4 ! o4= search+1 ldsb [%o0],%o5 ! o5= [current_str+1] .loop2: - ldsb [%g3],%g4 - add %g3,1,%g3 + ldsb [%o4],%g4 + add %o4,1,%o4 cmp %g4,0 be .end cmp %o5,%g4 bne .top - add %g2,1,%g2 + add %o3,1,%o3 ba .loop2 - ldsb [%g2],%o5 + ldsb [%o3],%o5 .end: retl diff --git a/strings/strstr.c b/strings/strstr.c index 01b29db0068..ca845568ddb 100644 --- a/strings/strstr.c +++ b/strings/strstr.c @@ -27,7 +27,7 @@ */ -#include <global.h> +#include <my_global.h> #include "m_string.h" #ifndef HAVE_STRSTR diff --git a/strings/strto.c b/strings/strto.c index d3392c794e9..c98b19a7e67 100644 --- a/strings/strto.c +++ b/strings/strto.c @@ -1,19 +1,18 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 */ /* strtol,strtoul,strtoll,strtoull @@ -36,7 +35,7 @@ it can be compiled with the UNSIGNED and/or LONGLONG flag set */ -#include <global.h> +#include <my_global.h> #include "m_string.h" #include "m_ctype.h" #include "my_sys.h" /* defines errno */ @@ -104,6 +103,7 @@ function (const char *nptr,char **endptr,int base) } /* Check for a sign. */ + negative= 0; if (*s == '-') { negative = 1; @@ -111,11 +111,9 @@ function (const char *nptr,char **endptr,int base) } else if (*s == '+') { - negative = 0; ++s; } - else - negative = 0; + if (base == 16 && s[0] == '0' && toupper (s[1]) == 'X') s += 2; diff --git a/strings/strtol.c b/strings/strtol.c index 87fe0d22cf3..10d7f8f9da6 100644 --- a/strings/strtol.c +++ b/strings/strtol.c @@ -1,23 +1,22 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 defines strtol() if neaded */ -#include <global.h> +#include <my_global.h> #if !defined(MSDOS) && !defined(HAVE_STRTOL) && !defined(__WIN__) #include "strto.c" #endif diff --git a/strings/strtoll.c b/strings/strtoll.c index 678c28649ef..8d0ba21d576 100644 --- a/strings/strtoll.c +++ b/strings/strtoll.c @@ -1,23 +1,22 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 is defines strtoll() if neaded */ -#include <global.h> +#include <my_global.h> #include <m_string.h> #if !defined(HAVE_STRTOLL) && defined(HAVE_LONG_LONG) #define USE_LONGLONG diff --git a/strings/strtoul.c b/strings/strtoul.c index e49a9ebea6a..00e1f820942 100644 --- a/strings/strtoul.c +++ b/strings/strtoul.c @@ -1,23 +1,22 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 is defines strtoul() if neaded */ -#include <global.h> +#include <my_global.h> #if !defined(MSDOS) && !defined(HAVE_STRTOUL) #define USE_UNSIGNED #include "strto.c" diff --git a/strings/strtoull.c b/strings/strtoull.c index 74dab95b801..25201e546ce 100644 --- a/strings/strtoull.c +++ b/strings/strtoull.c @@ -1,23 +1,22 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 is defines strtoull() */ -#include <global.h> +#include <my_global.h> #include <m_string.h> #if !defined(HAVE_STRTOULL) && defined(HAVE_LONG_LONG) #define USE_UNSIGNED diff --git a/strings/strxmov-sparc.s b/strings/strxmov-sparc.s index e65b56d317d..b4ca531d2e4 100644 --- a/strings/strxmov-sparc.s +++ b/strings/strxmov-sparc.s @@ -15,12 +15,17 @@ ! Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, ! MA 02111-1307, USA +! +! Note that this function only works on 32 bit sparc systems +! on 64 bits the offsets to %sp are different ! + .file "strxmov-sparc.s" .section ".text" .align 4 .global strxmov .type strxmov,#function .proc 0102 + strxmov: st %o2, [%sp+76] ! store 3rd param before other params st %o3, [%sp+80] ! store 4th param " " @@ -28,18 +33,18 @@ strxmov: st %o4, [%sp+84] ! store 5th param be .end st %o5, [%sp+88] ! store last - add %sp, 76, %g2 ! put pointer to 3rd arg + add %sp, 76, %o4 ! put pointer to 3rd arg .loop: - ldub [%o1], %g1 ! set values of src (o1) + ldub [%o1], %o5 ! set values of src (o1) add %o1, 1, %o1 ! inc src - stb %g1, [%o0] ! and dst (o2) equal - cmp %g1, 0 ! second while cmp + stb %o5, [%o0] ! and dst (o2) equal + cmp %o5, 0 ! second while cmp bne,a .loop add %o0, 1, %o0 ! inc dst - ld [%g2], %o1 ! get next param + ld [%o4], %o1 ! get next param cmp %o1, 0 ! check if last param bne .loop - add %g2, 4, %g2 ! advance to next param + add %o4, 4, %o4 ! advance to next param .end: retl stb %g0, [%o0] diff --git a/strings/strxmov.c b/strings/strxmov.c index 3ef120a691e..fe1e88c13d0 100644 --- a/strings/strxmov.c +++ b/strings/strxmov.c @@ -30,7 +30,7 @@ character pointer, or not the same bit pattern as NullS. */ -#include <global.h> +#include <my_global.h> #include "m_string.h" #include <stdarg.h> diff --git a/strings/strxnmov.c b/strings/strxnmov.c index ec3b6fe71e8..3ef0e57650c 100644 --- a/strings/strxnmov.c +++ b/strings/strxnmov.c @@ -37,7 +37,7 @@ needed. */ -#include <global.h> +#include <my_global.h> #include "m_string.h" #include <stdarg.h> diff --git a/strings/t_ctype.h b/strings/t_ctype.h index 6699244c1f4..ac1fa408c0e 100644 --- a/strings/t_ctype.h +++ b/strings/t_ctype.h @@ -1,3 +1,19 @@ +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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) 1998, 1999 by Pruet Boonma, all rights reserved. Copyright (C) 1998 by Theppitak Karoonboonyanan, all rights reserved. @@ -125,7 +141,7 @@ enum l1_symbols { L1_SARA_AI_MAIMUAN, L1_SARA_AI_MAIMALAI }; - + // level 2 symbols & order enum l2_symbols { L2_BLANK = TOT_LEVELS, @@ -139,7 +155,7 @@ enum l2_symbols { L2_TONE3, L2_TONE4 }; - + // level 3 symbols & order enum l3_symbols { L3_BLANK = TOT_LEVELS, diff --git a/strings/udiv.c b/strings/udiv.c index 07af323a706..25f3f4685f0 100644 --- a/strings/udiv.c +++ b/strings/udiv.c @@ -1,23 +1,22 @@ -/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, +/* Copyright (C) 2000 MySQL 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; either version 2 of the License, or + (at your option) any later version. + + 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 - 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 */ + 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 */ /* Do udiv and urem if machine dosn't have it */ -#include <global.h> +#include <my_global.h> #include <math.h> unsigned long udiv(long unsigned int a, long unsigned int b) |