Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Commit

Permalink
WL#5498: Remove dead and unused source code
Browse files Browse the repository at this point in the history
Remove unused string functions.
  • Loading branch information
Davi Arnaut committed Jul 23, 2010
1 parent 60ab2b9 commit 68cd3bc
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 245 deletions.
24 changes: 0 additions & 24 deletions include/m_string.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,7 @@ extern void bchange(uchar *dst,size_t old_len,const uchar *src,
extern void strappend(char *s,size_t len,pchar fill);
extern char *strend(const char *s);
extern char *strcend(const char *, pchar);
extern char *strfield(char *src,int fields,int chars,int blanks,
int tabch);
extern char *strfill(char * s,size_t len,pchar fill);
extern size_t strinstr(const char *str,const char *search);
extern size_t r_strinstr(const char *str, size_t from, const char *search);
extern char *strkey(char *dst,char *head,char *tail,char *flags);
extern char *strmake(char *dst,const char *src,size_t length);

#ifndef strmov
Expand All @@ -128,35 +123,16 @@ extern char *strmov(char *dst,const char *src);
extern char *strmov_overlapp(char *dst,const char *src);
#endif
extern char *strnmov(char *dst, const char *src, size_t n);
extern char *strsuff(const char *src, const char *suffix);
extern char *strcont(const char *src, const char *set);
extern char *strxcat(char *dst, const char *src, ...);
extern char *strxmov(char *dst, const char *src, ...);
extern char *strxcpy(char *dst, const char *src, ...);
extern char *strxncat(char *dst, size_t len, const char *src, ...);
extern char *strxnmov(char *dst, size_t len, const char *src, ...);
extern char *strxncpy(char *dst, size_t len, const char *src, ...);

/* Prototypes of normal stringfunctions (with may ours) */

#ifdef WANT_STRING_PROTOTYPES
extern char *strcat(char *, const char *);
extern char *strchr(const char *, pchar);
extern char *strrchr(const char *, pchar);
extern char *strcpy(char *, const char *);
extern int strcmp(const char *, const char *);
#ifndef __GNUC__
extern size_t strlen(const char *);
#endif
#endif
#ifndef HAVE_STRNLEN
extern size_t strnlen(const char *s, size_t n);
#endif

#if !defined(__cplusplus)
#ifndef HAVE_STRPBRK
extern char *strpbrk(const char *, const char *);
#endif
#ifndef HAVE_STRSTR
extern char *strstr(const char *, const char *);
#endif
Expand Down
2 changes: 1 addition & 1 deletion libmysql/Makefile.shared
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ target_sources = libmysql.c password.c \
mystringsobjects = strmov.lo strxmov.lo strxnmov.lo strnmov.lo \
strmake.lo strend.lo \
strnlen.lo strfill.lo is_prefix.lo \
int2str.lo str2int.lo strinstr.lo strcont.lo \
int2str.lo str2int.lo strcont.lo \
strcend.lo ctype-latin1.lo \
bchange.lo bmove.lo bmove_upp.lo longlong2str.lo \
strtoull.lo strtoll.lo llstr.lo my_vsnprintf.lo \
Expand Down
4 changes: 2 additions & 2 deletions strings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ SET(STRINGS_SOURCES bchange.c bfill.c bmove_upp.c ctype-big5.c ctype-bin.c ctype
ctype-czech.c ctype-euc_kr.c ctype-eucjpms.c ctype-extra.c ctype-gb2312.c ctype-gbk.c
ctype-latin1.c ctype-mb.c ctype-simple.c ctype-sjis.c ctype-tis620.c ctype-uca.c
ctype-ucs2.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype.c decimal.c dtoa.c int2str.c
is_prefix.c llstr.c longlong2str.c my_strtoll10.c my_vsnprintf.c r_strinstr.c
is_prefix.c llstr.c longlong2str.c my_strtoll10.c my_vsnprintf.c
str2int.c str_alloc.c strcend.c strend.c strfill.c strmake.c strmov.c strnmov.c
strtol.c strtoll.c strtoul.c strtoull.c strxmov.c strxnmov.c xml.c
my_strchr.c strcont.c strinstr.c strnlen.c strappend.c)
my_strchr.c strcont.c strnlen.c strappend.c)

# Avoid dependencies on perschema data defined in mysys
ADD_DEFINITIONS(-DDISABLE_MYSQL_THREAD_H)
Expand Down
12 changes: 6 additions & 6 deletions strings/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ pkglib_LIBRARIES = libmystrings.a
# Exact one of ASSEMBLER_X
if ASSEMBLER_x86
ASRCS = strings-x86.s longlong2str-x86.s my_strtoll10-x86.s
CSRCS = bfill.c bmove.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c str_alloc.c longlong2str_asm.c my_strchr.c dtoa.c strmov.c
CSRCS = bfill.c bmove.c bchange.c strxnmov.c int2str.c str2int.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c str_alloc.c longlong2str_asm.c my_strchr.c dtoa.c strmov.c
else
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
CSRCS = strcont.c strfill.c strcend.c is_prefix.c longlong2str.c bfill.c bmove.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c strxmov.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c my_strtoll10.c str_alloc.c my_strchr.c dtoa.c strmov.c
ASRCS = bmove_upp-sparc.s strappend-sparc.s strend-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 bchange.c strxnmov.c int2str.c str2int.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c strxmov.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c my_strtoll10.c str_alloc.c my_strchr.c dtoa.c strmov.c
else
#no assembler
ASRCS =
# These file MUST all be on the same line!! Otherwise automake
# generats a very broken makefile
CSRCS = 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 longlong2str.c bfill.c bmove.c bchange.c strxnmov.c int2str.c str2int.c r_strinstr.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c my_strtoll10.c str_alloc.c my_strchr.c dtoa.c
CSRCS = strxmov.c bmove_upp.c strappend.c strcont.c strend.c strfill.c strcend.c is_prefix.c strstr.c strmake.c strnmov.c strmov.c longlong2str.c bfill.c bmove.c bchange.c strxnmov.c int2str.c str2int.c strtol.c strtoul.c strtoll.c strtoull.c llstr.c strnlen.c ctype.c ctype-simple.c ctype-mb.c ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc_kr.c ctype-gb2312.c ctype-gbk.c ctype-sjis.c ctype-tis620.c ctype-ujis.c ctype-utf8.c ctype-ucs2.c ctype-uca.c ctype-win1250ch.c ctype-bin.c ctype-latin1.c my_vsnprintf.c xml.c decimal.c ctype-extra.c my_strtoll10.c str_alloc.c my_strchr.c dtoa.c
endif
endif

Expand All @@ -57,10 +57,10 @@ EXTRA_DIST = ctype-big5.c ctype-cp932.c ctype-czech.c ctype-eucjpms.c ctype-euc
longlong2str.c longlong2str-x86.s longlong2str_asm.c \
my_strtoll10.c my_strtoll10-x86.s \
strxmov.c bmove_upp.c strappend.c strcont.c strend.c \
strfill.c strcend.c is_prefix.c strstr.c strinstr.c \
strfill.c strcend.c is_prefix.c strstr.c \
strmake.c strnmov.c strmov.c strnlen.c \
bmove_upp-sparc.s strappend-sparc.s strend-sparc.s \
strinstr-sparc.s strmake-sparc.s strmov-sparc.s \
strmake-sparc.s strmov-sparc.s \
strnmov-sparc.s strstr-sparc.s strxmov-sparc.s \
t_ctype.h my_strchr.c CMakeLists.txt \
CHARSET_INFO.txt
Expand Down
50 changes: 0 additions & 50 deletions strings/r_strinstr.c

This file was deleted.

2 changes: 0 additions & 2 deletions strings/str_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ int main(void)
test_arg("strstr(v1,v5)",(long) strstr(v1,v5),0L);
test_arg("strstr(v6,v8)",(long) strstr(v6,v8),0L);

test_arg("strinstr(v1,v4)",(long) strinstr(v1,v4),4L);
test_arg("strinstr(v1,v5)",(long) strinstr(v1,v5),0L);
test_arg("strlen(from)",(long) strlen(from),(long) F_LEN);
test_arg("strlen(\"\")",(long) strlen(""),0L);
#ifdef HAVE_STRNLEN
Expand Down
5 changes: 0 additions & 5 deletions strings/string.doc
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ Speciella anv
The result is a pointer to the first character of the located instance,
or NullS if pat does not occur in src.

strinstr(src, pat) looks for an instance of pat in src. pat is not a
regex(3) pattern, it is a literal string which must be matched exactly.
The result 0 if the pattern was not found else it is the start char of
the pattern counted from the begining of the string.

strmake(dst,src,length) moves length characters, or until end, of src to
dst and appends a closing NUL to dst.
strmake() returns pointer to closing null;
Expand Down
41 changes: 0 additions & 41 deletions strings/strings-not-used.h

This file was deleted.

23 changes: 0 additions & 23 deletions strings/strings-x86.s
Original file line number Diff line number Diff line change
Expand Up @@ -281,29 +281,6 @@ sf_fo: movl %edx,%eax # Char found here
.strstr_end:
.size strstr,.strstr_end-strstr


# Find a substring in string, return index
# Arg: str,search

.globl strinstr
.type strinstr,@function

strinstr:
pushl %ebp
movl %esp,%ebp
pushl 12(%ebp) # search
pushl 8(%ebp) # str
call strstr
add $8,%esp
or %eax,%eax
jz si_99 # Not found, return NULL
sub 8(%ebp),%eax # Pos from start
inc %eax # And first pos = 1
si_99: popl %ebp
ret
.strinstr_end:
.size strinstr,.strinstr_end-strinstr

# Make a string of len length from another string
# Arg: dst,src,length
# ret: end of dst
Expand Down
43 changes: 0 additions & 43 deletions strings/strinstr-sparc.s

This file was deleted.

48 changes: 0 additions & 48 deletions strings/strinstr.c

This file was deleted.

0 comments on commit 68cd3bc

Please sign in to comment.