/* vim: set filetype=c:
 *
 * cstrings.c86  -  string handling routines for target system
 *
 * Copyright (C) 2003-2007 Gero Kuhlmann   <gero@gkminix.han.de>
 *
 *  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
 *  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., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 * $Id: cstrings.c86,v 1.5 2007/01/06 18:30:51 gkminix Exp $
 */


/* Include target system C headers */
#include <common.h86>
#ifdef __USE_STRING_INLINES
#undef __USE_STRING_INLINES
#endif
#include <i386/string.h86>



/*
 * Copy a string
 */
#ifdef L_strcpy
char *strcpy(char *dest, const char *src)
{
  return(_strcpy(dest, src));
}
#endif



/*
 * Copy a string with a limited length
 */
#ifdef L_strncpy
char *strncpy(char *dest, const char *src, size_t count)
{
  return(_strncpy(dest, src, count));
}
#endif



/*
 * Concatenate two strings together
 */
#ifdef L_strcat
char *strcat(char *dest, const char *src)
{
  return(_strcat(dest, src));
}
#endif



/*
 * Concatenate two strings together with a limited length
 */
#ifdef L_strncat
char *strncat(char *dest, const char *src, size_t count)
{
  return(_strncat(dest, src, count));
}
#endif



/*
 * Compare two strings
 */
#ifdef L_strcmp
short strcmp(const char *cs, const char *ct)
{
  return(_strcmp(cs, ct));
}
#endif



/*
 * Compare two strings with limited length
 */
#ifdef L_strncmp
short strncmp(const char *cs, const char *ct, size_t count)
{
  return(_strncmp(cs, ct, count));
}
#endif



/*
 * Search a string within a string starting at the beginning
 */
#ifdef L_strchr
char *strchr(const char *s, char c)
{
  return(_strchr(s, c));
}
#endif



/*
 * Search a string within a string starting at the end
 */
#ifdef L_strrchr
char *strrchr(const char *s, char c)
{
  return(_strrchr(s, c));
}
#endif



/*
 * Determine the length of a string
 */
#ifdef L_strlen
size_t strlen(const char *s)
{
  return(_strlen(s));
}
#endif



/*
 * Copy memory
 */
#ifdef L_memcpy
void *memcpy(void *to, const void *from, size_t n)
{
  return(_memcpy(to, from, n));
}
#endif



/*
 * Set memory with a value
 */
#ifdef L_memset
void *memset(void *s, unsigned char c, size_t n)
{
  return(_memset(s, c, n));
}
#endif



/*
 * Compare two memory blocks
 */
#ifdef L_memcmp
short memcmp(const void *cs, const void *ct, size_t n)
{
  return(_memcmp(cs, ct, n));
}
#endif



/*
 * Copy from local into far memory
 */
#ifdef L_fmemcpy
void fmemcpy(__fptr tomem, const __fptr frommem, size_t n)
{
  return(_fmemcpy(tomem, frommem, n));
}
#endif

