Flush DBUG log in case of DBUG_ASSERT()

Added strings_def.h into strings library to be able to have a DBUG_ASSERT() version without _db_flush() call (as strings.a should not depend on dbug.a)
Remove include of m_string.h in all string files (as it's included by string_def.h).
Fixed include order.
Changed "m_ctype.h" -> <m_ctype.h>

 

include/my_dbug.h:
  Flush DBUG log in case of DBUG_ASSERT()
strings/bchange.c:
  Include strings_def.h
strings/bcmp.c:
  Include strings_def.h
strings/bfill.c:
  Include strings_def.h
strings/bmove.c:
  Include strings_def.h
strings/bmove512.c:
  Include strings_def.h
strings/bmove_upp.c:
  Include strings_def.h
strings/conf_to_src.c:
  Include strings_def.h
  Fixed copyright
strings/ctype-big5.c:
  Include strings_def.h
strings/ctype-bin.c:
  Include strings_def.h
strings/ctype-cp932.c:
  Include strings_def.h
strings/ctype-czech.c:
  Include strings_def.h
strings/ctype-euc_kr.c:
  Include strings_def.h
strings/ctype-eucjpms.c:
  Include strings_def.h
strings/ctype-extra.c:
  Include strings_def.h
strings/ctype-gbk.c:
  Include strings_def.h
strings/ctype-latin1.c:
  Include strings_def.h
strings/ctype-mb.c:
  Include strings_def.h
strings/ctype-simple.c:
  Include strings_def.h
strings/ctype-sjis.c:
  Include strings_def.h
strings/ctype-tis620.c:
  Include strings_def.h
strings/ctype-uca.c:
  Include strings_def.h
strings/ctype-ucs2.c:
  Include strings_def.h
strings/ctype-ujis.c:
  Include strings_def.h
strings/ctype-utf8.c:
  Include strings_def.h
strings/ctype-win1250ch.c:
  Include strings_def.h
strings/ctype.c:
  Include strings_def.h
strings/decimal.c:
  Include strings_def.h
strings/do_ctype.c:
  Include strings_def.h
strings/int2str.c:
  Include strings_def.h
strings/is_prefix.c:
  Include strings_def.h
strings/llstr.c:
  Include strings_def.h
strings/longlong2str.c:
  Include strings_def.h
strings/longlong2str_asm.c:
  Include strings_def.h
strings/my_strchr.c:
  Include strings_def.h
strings/my_strtoll10.c:
  Include strings_def.h
strings/my_vsnprintf.c:
  Include strings_def.h
strings/r_strinstr.c:
  Include strings_def.h
strings/str2int.c:
  Include strings_def.h
strings/str_alloc.c:
  Include strings_def.h
strings/str_test.c:
  Include strings_def.h
  Fixed compiler warnings
strings/strappend.c:
  Include strings_def.h
strings/strcend.c:
  Include strings_def.h
strings/strcont.c:
  Include strings_def.h
strings/strend.c:
  Include strings_def.h
strings/strfill.c:
  Include strings_def.h
strings/strinstr.c:
  Include strings_def.h
strings/strmake.c:
  Include strings_def.h
strings/strmov.c:
  Include strings_def.h
strings/strmov_overlapp.c:
  Include strings_def.h
strings/strnlen.c:
  Include strings_def.h
strings/strnmov.c:
  Include strings_def.h
strings/strstr.c:
  Include strings_def.h
strings/strto.c:
  Include strings_def.h
strings/strtod.c:
  Include strings_def.h
strings/strtol.c:
  Include strings_def.h
strings/strtoll.c:
  Include strings_def.h
strings/strtoul.c:
  Include strings_def.h
strings/strtoull.c:
  Include strings_def.h
strings/strxmov.c:
  Include strings_def.h
strings/strxnmov.c:
  Include strings_def.h
strings/uctypedump.c:
  Include strings_def.h
  Fixed compiler warnings
  Removed double include of m_ctype.h
strings/udiv.c:
  Include strings_def.h
strings/xml.c:
  Include strings_def.h
This commit is contained in:
Michael Widenius 2011-01-30 12:41:44 +02:00
parent c46305ab48
commit 785695e7c3
66 changed files with 137 additions and 179 deletions

View File

@ -126,7 +126,7 @@ extern void _db_flush_();
#define DBUG_END() _db_end_ () #define DBUG_END() _db_end_ ()
#define DBUG_LOCK_FILE _db_lock_file_() #define DBUG_LOCK_FILE _db_lock_file_()
#define DBUG_UNLOCK_FILE _db_unlock_file_() #define DBUG_UNLOCK_FILE _db_unlock_file_()
#define DBUG_ASSERT(A) assert(A) #define DBUG_ASSERT(A) do { _db_flush_(); assert(A); } while(0)
#define DBUG_EXPLAIN(buf,len) _db_explain_(0, (buf),(len)) #define DBUG_EXPLAIN(buf,len) _db_explain_(0, (buf),(len))
#define DBUG_EXPLAIN_INITIAL(buf,len) _db_explain_init_((buf),(len)) #define DBUG_EXPLAIN_INITIAL(buf,len) _db_explain_init_((buf),(len))
#define DEBUGGER_OFF do { _dbug_on_= 0; } while(0) #define DEBUGGER_OFF do { _dbug_on_= 0; } while(0)

View File

@ -23,8 +23,7 @@
src in a buffer with tot_length bytes. src in a buffer with tot_length bytes.
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
void bchange(register uchar *dst, size_t old_length, register const uchar *src, void bchange(register uchar *dst, size_t old_length, register const uchar *src,
size_t new_length, size_t tot_length) size_t new_length, size_t tot_length)

View File

@ -21,8 +21,7 @@
comparing a shorter string with bcmp. comparing a shorter string with bcmp.
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
#ifdef HAVE_valgrind #ifdef HAVE_valgrind
#undef bcmp #undef bcmp

View File

@ -29,8 +29,7 @@
code is presented for your interest and amusement. code is presented for your interest and amusement.
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
#if !defined(bfill) && !defined(HAVE_BFILL) #if !defined(bfill) && !defined(HAVE_BFILL)

View File

@ -36,8 +36,7 @@
code is presented for your interest and amusement. code is presented for your interest and amusement.
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
#if !defined(HAVE_BMOVE) && !defined(bmove) #if !defined(HAVE_BMOVE) && !defined(bmove)

View File

@ -25,8 +25,7 @@
fastest way to move a mutiple of 512 byte. fastest way to move a mutiple of 512 byte.
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
#ifndef bmove512 #ifndef bmove512

View File

@ -22,8 +22,7 @@
"src-len" to the destination "dst-len" counting downwards. "src-len" to the destination "dst-len" counting downwards.
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
#if defined(MC68000) && defined(DS90) #if defined(MC68000) && defined(DS90)

View File

@ -13,8 +13,7 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h> #include "strings_def.h"
#include <m_string.h>
#include <m_ctype.h> #include <m_ctype.h>
#include <fcntl.h> #include <fcntl.h>
#include <my_xml.h> #include <my_xml.h>
@ -250,7 +249,7 @@ static void
fprint_copyright(FILE *file) fprint_copyright(FILE *file)
{ {
fprintf(file, fprintf(file,
"/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.\n" "/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems Inc., 2010-2011 Monty Program Ab\n"
"\n" "\n"
" This program is free software; you can redistribute it and/or modify\n" " This program is free software; you can redistribute it and/or modify\n"
" it under the terms of the GNU General Public License as published by\n" " it under the terms of the GNU General Public License as published by\n"

View File

@ -26,9 +26,8 @@
* .configure. mbmaxlen_big5=2 * .configure. mbmaxlen_big5=2
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h" #include <m_ctype.h>
#include "m_ctype.h"
#ifdef HAVE_CHARSET_big5 #ifdef HAVE_CHARSET_big5

View File

@ -18,9 +18,8 @@
/* This file is for binary pseudo charset, created by bar@mysql.com */ /* This file is for binary pseudo charset, created by bar@mysql.com */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h" #include <m_ctype.h>
#include "m_ctype.h"
static uchar ctype_bin[]= static uchar ctype_bin[]=
{ {

View File

@ -16,9 +16,8 @@
/* This file is for cp932 charaset (Windows Japanese), /* This file is for cp932 charaset (Windows Japanese),
and created based on ctype-sjis.c file */ and created based on ctype-sjis.c file */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h" #include <m_ctype.h>
#include "m_ctype.h"
#ifdef HAVE_CHARSET_cp932 #ifdef HAVE_CHARSET_cp932

View File

@ -65,9 +65,8 @@
#ifdef REAL_MYSQL #ifdef REAL_MYSQL
#include <my_global.h> #include "strings_def.h"
#include "m_string.h" #include <m_ctype.h>
#include "m_ctype.h"
#else #else
@ -427,8 +426,7 @@ static my_bool my_like_range_czech(CHARSET_INFO *cs __attribute__((unused)),
* *
* definition table reworked by Jaromir Dolecek <dolecek@ics.muni.cz> * definition table reworked by Jaromir Dolecek <dolecek@ics.muni.cz>
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
static uchar NEAR ctype_czech[257] = { static uchar NEAR ctype_czech[257] = {
0, 0,

View File

@ -25,9 +25,8 @@
* .configure. mbmaxlen_euc_kr=2 * .configure. mbmaxlen_euc_kr=2
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h" #include <m_ctype.h>
#include "m_ctype.h"
#ifdef HAVE_CHARSET_euckr #ifdef HAVE_CHARSET_euckr

View File

@ -26,9 +26,8 @@ ctype-ujis.c file.
* .configure. mbmaxlen_eucjpms=3 * .configure. mbmaxlen_eucjpms=3
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h" #include <m_ctype.h>
#include "m_ctype.h"
#ifdef HAVE_CHARSET_eucjpms #ifdef HAVE_CHARSET_eucjpms

View File

@ -21,7 +21,7 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include <my_global.h> #include "strings_def.h"
#include <m_ctype.h> #include <m_ctype.h>
#ifdef HAVE_CHARSET_dec8 #ifdef HAVE_CHARSET_dec8

View File

@ -23,9 +23,8 @@
* .configure. mbmaxlen_gb2312=2 * .configure. mbmaxlen_gb2312=2
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h" #include <m_ctype.h>
#include "m_ctype.h"
#ifdef HAVE_CHARSET_gb2312 #ifdef HAVE_CHARSET_gb2312

View File

@ -26,9 +26,8 @@
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h" #include <m_ctype.h>
#include "m_ctype.h"
#ifdef HAVE_CHARSET_gbk #ifdef HAVE_CHARSET_gbk

View File

@ -13,9 +13,8 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h" #include <m_ctype.h>
#include "m_ctype.h"
static uchar ctype_latin1[] = { static uchar ctype_latin1[] = {
0, 0,

View File

@ -13,9 +13,8 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h> #include "strings_def.h"
#include "m_ctype.h" #include <m_ctype.h>
#include "m_string.h"
#ifdef USE_MB #ifdef USE_MB

View File

@ -13,9 +13,8 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h" #include <m_ctype.h>
#include "m_ctype.h"
#include "my_sys.h" /* Needed for MY_ERRNO_ERANGE */ #include "my_sys.h" /* Needed for MY_ERRNO_ERANGE */
#include <errno.h> #include <errno.h>

View File

@ -16,9 +16,8 @@
/* This file is for Shift JIS charset, and created by tommy@valley.ne.jp. /* This file is for Shift JIS charset, and created by tommy@valley.ne.jp.
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h" #include <m_ctype.h>
#include "m_ctype.h"
#ifdef HAVE_CHARSET_sjis #ifdef HAVE_CHARSET_sjis

View File

@ -47,11 +47,10 @@
* .configure. strxfrm_multiply_tis620=4 * .configure. strxfrm_multiply_tis620=4
*/ */
#include <my_global.h> #include "strings_def.h"
#include <my_sys.h> #include <m_ctype.h>
#include "m_string.h"
#include "m_ctype.h"
#include "t_ctype.h" #include "t_ctype.h"
#include <my_sys.h>
#ifdef HAVE_CHARSET_tis620 #ifdef HAVE_CHARSET_tis620

View File

@ -32,10 +32,8 @@
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h" #include <m_ctype.h>
#include "m_ctype.h"
#define MY_UCA_CNT_FLAG_SIZE 4096 #define MY_UCA_CNT_FLAG_SIZE 4096
#define MY_UCA_CNT_FLAG_MASK 4095 #define MY_UCA_CNT_FLAG_MASK 4095

View File

@ -17,11 +17,9 @@
/* UCS2 support. Written by Alexander Barkov <bar@mysql.com> */ /* UCS2 support. Written by Alexander Barkov <bar@mysql.com> */
#include <my_global.h> #include "strings_def.h"
#include <m_ctype.h>
#include <my_sys.h> #include <my_sys.h>
#include "m_string.h"
#include "m_ctype.h"
#include <errno.h>
#include <stdarg.h> #include <stdarg.h>

View File

@ -25,9 +25,8 @@
* .configure. mbmaxlen_ujis=3 * .configure. mbmaxlen_ujis=3
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h" #include <m_ctype.h>
#include "m_ctype.h"
#ifdef HAVE_CHARSET_ujis #ifdef HAVE_CHARSET_ujis

View File

@ -18,10 +18,8 @@
/* UTF8 according RFC 2279 */ /* UTF8 according RFC 2279 */
/* Written by Alexander Barkov <bar@udm.net> */ /* Written by Alexander Barkov <bar@udm.net> */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h" #include <m_ctype.h>
#include "m_ctype.h"
#include <errno.h>
#ifndef EILSEQ #ifndef EILSEQ
#define EILSEQ ENOENT #define EILSEQ ENOENT

View File

@ -40,8 +40,7 @@
#ifdef REAL_MYSQL #ifdef REAL_MYSQL
#include "my_global.h" #include "my_global.h"
#include "m_string.h" #include <m_ctype.h>
#include "m_ctype.h"
#else #else

View File

@ -13,13 +13,9 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h> #include "strings_def.h"
#include <m_ctype.h> #include <m_ctype.h>
#include <my_xml.h> #include <my_xml.h>
#ifndef SCO
#include <m_string.h>
#endif
/* /*

View File

@ -99,11 +99,10 @@
implementation-defined. implementation-defined.
*/ */
#include <my_global.h> #include "strings_def.h"
#include <m_ctype.h> #include <m_ctype.h>
#include <myisampack.h> #include <myisampack.h>
#include <my_sys.h> /* for my_alloca */ #include <my_sys.h> /* for my_alloca */
#include <m_string.h>
#include <decimal.h> #include <decimal.h>
/* /*

View File

@ -20,10 +20,9 @@
#undef DBUG_OFF #undef DBUG_OFF
#endif #endif
#include <my_global.h> #include "strings_def.h"
#include <ctype.h> #include <ctype.h>
#include <my_sys.h> #include <my_sys.h>
#include "m_string.h"
uchar NEAR to_upper[256]; uchar NEAR to_upper[256];
uchar NEAR to_lower[256],NEAR sort_order[256]; uchar NEAR to_lower[256],NEAR sort_order[256];

View File

@ -13,8 +13,7 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
/* /*
_dig_vec arrays are public because they are used in several outer places. _dig_vec arrays are public because they are used in several outer places.

View File

@ -21,8 +21,7 @@
A empty t is allways a prefix. A empty t is allways a prefix.
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
int is_prefix(register const char *s, register const char *t) int is_prefix(register const char *s, register const char *t)
{ {

View File

@ -24,8 +24,7 @@
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
char *llstr(longlong value,char *buff) char *llstr(longlong value,char *buff)
{ {

View File

@ -37,8 +37,7 @@
itoa assumes that 10 -base numbers are allways signed and other arn't. itoa assumes that 10 -base numbers are allways signed and other arn't.
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
#if defined(HAVE_LONG_LONG) && !defined(longlong2str) && !defined(HAVE_LONGLONG2STR) #if defined(HAVE_LONG_LONG) && !defined(longlong2str) && !defined(HAVE_LONGLONG2STR)

View File

@ -20,8 +20,7 @@
_dig_vector in a portable manner. _dig_vector in a portable manner.
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
extern char *longlong2str_with_dig_vector(longlong val,char *dst,int radix, extern char *longlong2str_with_dig_vector(longlong val,char *dst,int radix,
const char *dig_vector); const char *dig_vector);

View File

@ -21,9 +21,8 @@
frequently. frequently.
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h" #include <m_ctype.h>
#include "m_ctype.h"
char *my_strchr(CHARSET_INFO *cs, const char *str, const char *end, char *my_strchr(CHARSET_INFO *cs, const char *str, const char *end,

View File

@ -13,9 +13,8 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h> #include "strings_def.h"
#include <my_sys.h> /* Needed for MY_ERRNO_ERANGE */ #include <my_sys.h> /* Needed for MY_ERRNO_ERANGE */
#include <m_string.h>
#undef ULONGLONG_MAX #undef ULONGLONG_MAX
/* /*

View File

@ -13,10 +13,9 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h> #include "strings_def.h"
#include <m_string.h>
#include <stdarg.h>
#include <m_ctype.h> #include <m_ctype.h>
#include <stdarg.h>
/* /*
Limited snprintf() implementations Limited snprintf() implementations

View File

@ -22,8 +22,7 @@
the pattern counted from the begining of the string. the pattern counted from the begining of the string.
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
size_t r_strinstr(reg1 const char * str, size_t from, reg4 const char * search) size_t r_strinstr(reg1 const char * str, size_t from, reg4 const char * search)
{ {

View File

@ -37,9 +37,8 @@
call has no problems. call has no problems.
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h" #include <m_ctype.h>
#include "m_ctype.h"
#include "my_sys.h" /* defines errno */ #include "my_sys.h" /* defines errno */
#include <errno.h> #include <errno.h>

View File

@ -13,8 +13,7 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h> #include "strings_def.h"
#include <m_string.h>
static void *my_str_malloc_default(size_t size) static void *my_str_malloc_default(size_t size)
{ {

View File

@ -15,9 +15,8 @@
/* Test of all stringfunktions that is coded in assembler */ /* Test of all stringfunktions that is coded in assembler */
#include <my_global.h> #include "strings_def.h"
#include <stdarg.h> #include <stdarg.h>
#include "m_string.h"
#define F_LEN 8 #define F_LEN 8
#define F_CHAR 'A' #define F_CHAR 'A'
@ -50,10 +49,10 @@ int main(void)
errors=tests=0; errors=tests=0;
init_strings(); init_strings();
test_arg("bcmp(from,to,5)",(long) my_test(bcmp(from,to,5)),1L); test_arg("bcmp(from,to,5)",(long) my_test(bcmp((uchar*) from, (uchar*) to,5)),1L);
test_arg("bcmp(from,from,5)",(long) bcmp(from,from,5),0L); test_arg("bcmp(from,from,5)",(long) bcmp((uchar*) from, (uchar*) from,5),0L);
test_arg("bcmp(from,to,0)",(long) bcmp(from,to,0),0L); test_arg("bcmp(from,to,0)",(long) bcmp((uchar*) from, (uchar*) to,0),0L);
test_arg("strend(from)",(long) strend(from),(long) from+F_LEN); test_arg("strend(from)",(long) strend(from),(long) from+F_LEN);
test_arg("strchr(v1,'M')",(long) strchr(v1,'M'),(long) v1); test_arg("strchr(v1,'M')",(long) strchr(v1,'M'),(long) v1);
test_arg("strchr(v1,'y')",(long) strchr(v1,'y'),(long) v1+4); test_arg("strchr(v1,'y')",(long) strchr(v1,'y'),(long) v1+4);
@ -90,10 +89,10 @@ int main(void)
test_strarg("bmove(to,from,4)",(bmove(to,from,4),0L),INT_MAX32,4,F_CHAR, test_strarg("bmove(to,from,4)",(bmove(to,from,4),0L),INT_MAX32,4,F_CHAR,
0,0); 0,0);
test_strarg("bmove(to,from,0)",(bmove(to,from,0),0L),INT_MAX32,0,0); test_strarg("bmove(to,from,0)",(bmove(to,from,0),0L),INT_MAX32,0,0);
test_strarg("bmove_upp(to+6,from+6,3)",(bmove_upp(to+6,from+6,3),0L),INT_MAX32, test_strarg("bmove_upp(to+6,from+6,3)",(bmove_upp((uchar*) to+6, (uchar*) from+6,3),0L),INT_MAX32,
3,T_CHAR,3,F_CHAR,0,0); 3,T_CHAR,3,F_CHAR,0,0);
test_strarg("bmove_upp(to,from,0)",(bmove_upp(to,from,0),0L),INT_MAX32,0,0); test_strarg("bmove_upp(to,from,0)",(bmove_upp((uchar*) to, (uchar*) from,0),0L),INT_MAX32,0,0);
test_strarg("bmove_align(to,from,8)",(bmove_align(to,from,8),0L),INT_MAX32, test_strarg("bmove_align(to,from,8)",(bmove_align((uchar*) to, (uchar*) from,8),0L),INT_MAX32,
8,F_CHAR,0,0); 8,F_CHAR,0,0);
test_strarg("strappend(to,3,' ')",(strappend(to,3,' '),0L),INT_MAX32, test_strarg("strappend(to,3,' ')",(strappend(to,3,' '),0L),INT_MAX32,
3,T_CHAR,1,0,T_LEN-4,T_CHAR,1,0,0,0); 3,T_CHAR,1,0,T_LEN-4,T_CHAR,1,0,0,0);
@ -124,7 +123,7 @@ int main(void)
test_strarg("strxnmov(to,2,\"!!\",NullS)",strxnmov(to,2,"!!","xx",NullS),to+2,2,'!',0,0,0); test_strarg("strxnmov(to,2,\"!!\",NullS)",strxnmov(to,2,"!!","xx",NullS),to+2,2,'!',0,0,0);
test_strarg("strxnmov(to,2,\"!\",\"x\",\"y\",NullS)",strxnmov(to,2,"!","x","y",NullS),to+2,1,'!',1,'x',0,0,0); test_strarg("strxnmov(to,2,\"!\",\"x\",\"y\",NullS)",strxnmov(to,2,"!","x","y",NullS),to+2,1,'!',1,'x',0,0,0);
test_strarg("bchange(to,2,from,4,6)",(bchange(to,2,from,4,6),0L),INT_MAX32, test_strarg("bchange(to,2,from,4,6)",(bchange((uchar*) to,2,(uchar*) from,4,6),0L),INT_MAX32,
4,F_CHAR,2,T_CHAR,0,0); 4,F_CHAR,2,T_CHAR,0,0);
printf("tests: %d errors: %d\n",tests,errors); printf("tests: %d errors: %d\n",tests,errors);
@ -233,7 +232,7 @@ int compare_buff(const char *message, char * b1, char * b2, int length,
{ {
int i,error=0; int i,error=0;
if (bcmp(b1,b2,length)) if (bcmp((uchar*) b1, (uchar*) b2, length))
{ {
errors++; errors++;
printf("func: '%s' Buffers differ\nIs: ",message); printf("func: '%s' Buffers differ\nIs: ",message);
@ -259,19 +258,19 @@ int compare_buff(const char *message, char * b1, char * b2, int length,
return error; return error;
} /* compare_buff */ } /* compare_buff */
/* These are here to be loaded and examined */ /* These are here to be loaded and examined in debugger */
extern void dummy_functions(void); extern void dummy_functions(void);
void dummy_functions(void) void dummy_functions(void)
{ {
VOID(memchr(from,'a',5)); (void) memchr(from,'a',5);
VOID(memcmp(from,to,5)); (void) memcmp(from,to,5);
VOID(memcpy(from,to,5)); (void) memcpy(from,to,5);
VOID(memset(from,' ',5)); (void) memset(from,' ',5);
VOID(strcmp(from,to)); (void) strcmp(from,to);
VOID(strcpy(from,to)); (void) strcpy(from,to);
VOID(strstr(from,to)); (void) strstr(from,to);
VOID(strrchr(from,'a')); (void) strrchr(from,'a');
return; return;
} }

View File

@ -23,8 +23,7 @@
trunked. The des+len character is allways set to NULL. trunked. The des+len character is allways set to NULL.
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
void strappend(register char *s, size_t len, pchar fill) void strappend(register char *s, size_t len, pchar fill)

View File

@ -22,8 +22,7 @@
occurs, or a pointer to the end-null of s if c does not occur in s. occurs, or a pointer to the end-null of s if c does not occur in s.
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
#if defined(MC68000) && defined(DS90) #if defined(MC68000) && defined(DS90)

View File

@ -24,8 +24,7 @@
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
char * strcont(reg1 const char *str,reg2 const char *set) char * strcont(reg1 const char *str,reg2 const char *set)
{ {

View File

@ -27,8 +27,7 @@
Beware: the asm version works only if strlen(s) < 65535. Beware: the asm version works only if strlen(s) < 65535.
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
#if VaxAsm #if VaxAsm

View File

@ -23,8 +23,7 @@
strfill() returns pointer to dest+len; strfill() returns pointer to dest+len;
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
char * strfill(char *s, size_t len, pchar fill) char * strfill(char *s, size_t len, pchar fill)
{ {

31
strings/strings_def.h Normal file
View File

@ -0,0 +1,31 @@
/* Copyright (C) 2011 Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* This file is to be include first in all files in the string directory */
#include <my_global.h> /* Define standar vars */
#include "m_string.h" /* Exernal defintions of string functions */
/*
We can't use the original DBUG_ASSERT() (which includes _db_flush())
in the strings library as libdbug is compiled after the the strings
library and we don't want to have strings depending on libdbug which
depends on mysys and strings.
*/
#if !defined(DBUG_OFF)
#undef DBUG_ASSERT
#define DBUG_ASSERT(A) assert(A)
#endif

View File

@ -25,8 +25,7 @@
char is 1. char is 1.
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
size_t strinstr(reg1 const char *str,reg4 const char *search) size_t strinstr(reg1 const char *str,reg4 const char *search)
{ {

View File

@ -24,8 +24,7 @@
strmake() returns pointer to closing null strmake() returns pointer to closing null
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
char *strmake(register char *dst, register const char *src, size_t length) char *strmake(register char *dst, register const char *src, size_t length)
{ {

View File

@ -21,8 +21,7 @@
into dst, which seems useful. into dst, which seems useful.
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
#ifndef strmov #ifndef strmov

View File

@ -13,8 +13,7 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
/* A trivial implementation */ /* A trivial implementation */
char *strmov_overlapp(char *dst, const char *src) char *strmov_overlapp(char *dst, const char *src)

View File

@ -20,8 +20,7 @@
strnlen(s, len) returns the length of s or len if s is longer than len. strnlen(s, len) returns the length of s or len if s is longer than len.
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
#ifndef HAVE_STRNLEN #ifndef HAVE_STRNLEN

View File

@ -20,8 +20,7 @@
truncated. truncated.
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
char *strnmov(register char *dst, register const char *src, size_t n) char *strnmov(register char *dst, register const char *src, size_t n)
{ {

View File

@ -27,8 +27,7 @@
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
#ifndef HAVE_STRSTR #ifndef HAVE_STRSTR

View File

@ -40,7 +40,7 @@
/* see 'strtoll.c' and 'strtoull.c' for the reasons */ /* see 'strtoll.c' and 'strtoull.c' for the reasons */
#endif #endif
#include "m_ctype.h" #include <m_ctype.h>
#include "my_sys.h" /* defines errno */ #include "my_sys.h" /* defines errno */
#include <errno.h> #include <errno.h>

View File

@ -27,7 +27,7 @@
*/ */
#include "my_base.h" /* Includes errno.h + EOVERFLOW */ #include "my_base.h" /* Includes errno.h + EOVERFLOW */
#include "m_ctype.h" #include <m_ctype.h>
#ifdef HAVE_IEEEFP_H #ifdef HAVE_IEEEFP_H
#include <ieeefp.h> #include <ieeefp.h>
#endif #endif

View File

@ -20,8 +20,7 @@
functions, especially they handle tricks for Tru64 where 'long' is functions, especially they handle tricks for Tru64 where 'long' is
64 bit already and our 'longlong' is just a 'long'. 64 bit already and our 'longlong' is just a 'long'.
*/ */
#include <my_global.h> #include "strings_def.h"
#include <m_string.h>
#if !defined(MSDOS) && !defined(HAVE_STRTOL) && !defined(__WIN__) #if !defined(MSDOS) && !defined(HAVE_STRTOL) && !defined(__WIN__)
#include "strto.c" #include "strto.c"

View File

@ -24,8 +24,7 @@
for 'strtoll()' but no implementation, see "6.1 New C99 library functions" for 'strtoll()' but no implementation, see "6.1 New C99 library functions"
in file '/usr/share/doclib/cc.dtk/release_notes.txt'. in file '/usr/share/doclib/cc.dtk/release_notes.txt'.
*/ */
#include <my_global.h> #include "strings_def.h"
#include <m_string.h>
#if !defined(HAVE_STRTOLL) && defined(HAVE_LONG_LONG) #if !defined(HAVE_STRTOLL) && defined(HAVE_LONG_LONG)
#define USE_LONGLONG #define USE_LONGLONG

View File

@ -20,8 +20,7 @@
functions, especially they handle tricks for Tru64 where 'long' is functions, especially they handle tricks for Tru64 where 'long' is
64 bit already and our 'longlong' is just a 'long'. 64 bit already and our 'longlong' is just a 'long'.
*/ */
#include <my_global.h> #include "strings_def.h"
#include <m_string.h>
#if !defined(MSDOS) && !defined(HAVE_STRTOUL) #if !defined(MSDOS) && !defined(HAVE_STRTOUL)
#define USE_UNSIGNED #define USE_UNSIGNED

View File

@ -24,8 +24,7 @@
for 'strtoull()' but no implementation, see "6.1 New C99 library functions" for 'strtoull()' but no implementation, see "6.1 New C99 library functions"
in file '/usr/share/doclib/cc.dtk/release_notes.txt'. in file '/usr/share/doclib/cc.dtk/release_notes.txt'.
*/ */
#include <my_global.h> #include "strings_def.h"
#include <m_string.h>
#if !defined(HAVE_STRTOULL) && defined(HAVE_LONG_LONG) #if !defined(HAVE_STRTOULL) && defined(HAVE_LONG_LONG)
#define USE_UNSIGNED #define USE_UNSIGNED

View File

@ -30,8 +30,7 @@
character pointer, or not the same bit pattern as NullS. character pointer, or not the same bit pattern as NullS.
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
char *strxmov(char *dst,const char *src, ...) char *strxmov(char *dst,const char *src, ...)
{ {

View File

@ -35,8 +35,7 @@
if total-string-length >= length then dst[length] will be set to \0 if total-string-length >= length then dst[length] will be set to \0
*/ */
#include <my_global.h> #include "strings_def.h"
#include "m_string.h"
#include <stdarg.h> #include <stdarg.h>
char *strxnmov(char *dst, size_t len, const char *src, ...) char *strxnmov(char *dst, size_t len, const char *src, ...)

View File

@ -13,15 +13,8 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* #include "strings_def.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
*/
#include <my_global.h>
#include <m_string.h>
#include <m_ctype.h> #include <m_ctype.h>
#include "m_ctype.h"
typedef struct my_ctype_name_st typedef struct my_ctype_name_st
@ -204,7 +197,7 @@ int main(int ac, char ** av)
int charnum=0; int charnum=0;
int num=0; int num=0;
printf("static unsigned char uctype_page%02X[256]=\n{\n",plane); printf("static unsigned char uctype_page%02X[256]=\n{\n", (uint) plane);
for(charnum=0;charnum<256;charnum++) for(charnum=0;charnum<256;charnum++)
{ {
@ -231,7 +224,7 @@ int main(int ac, char ** av)
{ {
char plane_name[128]="NULL"; char plane_name[128]="NULL";
if(uctype[plane].ctype){ if(uctype[plane].ctype){
sprintf(plane_name,"uctype_page%02X",plane); sprintf(plane_name,"uctype_page%02X",(uint) plane);
} }
printf("\t{%d,%s}%s\n",uctype[plane].pctype,plane_name,plane<255?",":""); printf("\t{%d,%s}%s\n",uctype[plane].pctype,plane_name,plane<255?",":"");
} }

View File

@ -15,7 +15,7 @@
/* Do udiv and urem if machine dosn't have it */ /* Do udiv and urem if machine dosn't have it */
#include <my_global.h> #include "strings_def.h"
#include <math.h> #include <math.h>
unsigned long udiv(long unsigned int a, long unsigned int b) unsigned long udiv(long unsigned int a, long unsigned int b)

View File

@ -14,7 +14,6 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "my_global.h" #include "my_global.h"
#include "m_string.h"
#include "my_xml.h" #include "my_xml.h"