You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.5 KiB

26 years ago
26 years ago
26 years ago
  1. /* Copyright (C) 2000 MySQL AB
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation; version 2 of the License.
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License
  10. along with this program; if not, write to the Free Software
  11. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
  12. /*
  13. strmov(dst, src) moves all the characters of src (including the
  14. closing NUL) to dst, and returns a pointer to the new closing NUL in
  15. dst. The similar UNIX routine strcpy returns the old value of dst,
  16. which I have never found useful. strmov(strmov(dst,a),b) moves a//b
  17. into dst, which seems useful.
  18. */
  19. #include <my_global.h>
  20. #include "m_string.h"
  21. #ifdef BAD_STRING_COMPILER
  22. #undef strmov
  23. #define strmov strmov_overlapp
  24. #endif
  25. #ifndef strmov
  26. #if !defined(MC68000) && !defined(DS90)
  27. char *strmov(register char *dst, register const char *src)
  28. {
  29. while ((*dst++ = *src++)) ;
  30. return dst-1;
  31. }
  32. #else
  33. char *strmov(dst, src)
  34. char *dst, *src;
  35. {
  36. asm(" movl 4(a7),a1 ");
  37. asm(" movl 8(a7),a0 ");
  38. asm(".L4: movb (a0)+,(a1)+ ");
  39. asm(" jne .L4 ");
  40. asm(" movl a1,d0 ");
  41. asm(" subql #1,d0 ");
  42. }
  43. #endif
  44. #endif /* strmov */