2001-02-17 13:19:19 +01:00
|
|
|
/***********************************************************************
|
|
|
|
Memory primitives
|
|
|
|
|
|
|
|
(c) 1994, 1995 Innobase Oy
|
|
|
|
|
|
|
|
Created 5/30/1994 Heikki Tuuri
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
UNIV_INLINE
|
|
|
|
void*
|
2004-05-14 13:23:46 +02:00
|
|
|
ut_memcpy(void* dest, const void* sour, ulint n)
|
2001-02-17 13:19:19 +01:00
|
|
|
{
|
|
|
|
return(memcpy(dest, sour, n));
|
|
|
|
}
|
|
|
|
|
|
|
|
UNIV_INLINE
|
|
|
|
void*
|
2004-05-14 13:23:46 +02:00
|
|
|
ut_memmove(void* dest, const void* sour, ulint n)
|
2001-02-17 13:19:19 +01:00
|
|
|
{
|
|
|
|
return(memmove(dest, sour, n));
|
|
|
|
}
|
|
|
|
|
|
|
|
UNIV_INLINE
|
|
|
|
int
|
2004-05-14 13:23:46 +02:00
|
|
|
ut_memcmp(const void* str1, const void* str2, ulint n)
|
2001-02-17 13:19:19 +01:00
|
|
|
{
|
|
|
|
return(memcmp(str1, str2, n));
|
|
|
|
}
|
|
|
|
|
|
|
|
UNIV_INLINE
|
|
|
|
char*
|
2004-05-14 13:23:46 +02:00
|
|
|
ut_strcpy(char* dest, const char* sour)
|
2001-02-17 13:19:19 +01:00
|
|
|
{
|
|
|
|
return(strcpy(dest, sour));
|
|
|
|
}
|
|
|
|
|
|
|
|
UNIV_INLINE
|
|
|
|
ulint
|
2002-07-23 17:31:22 +02:00
|
|
|
ut_strlen(const char* str)
|
2001-02-17 13:19:19 +01:00
|
|
|
{
|
|
|
|
return(strlen(str));
|
|
|
|
}
|
|
|
|
|
|
|
|
UNIV_INLINE
|
|
|
|
int
|
2004-05-14 13:23:46 +02:00
|
|
|
ut_strcmp(const void* str1, const void* str2)
|
2001-02-17 13:19:19 +01:00
|
|
|
{
|
2004-05-14 13:23:46 +02:00
|
|
|
return(strcmp((const char*)str1, (const char*)str2));
|
2001-02-17 13:19:19 +01:00
|
|
|
}
|
|
|
|
|
2004-04-01 15:51:34 +02:00
|
|
|
/**************************************************************************
|
2004-10-04 19:38:23 +02:00
|
|
|
Compute strlen(ut_strcpyq(str, q)). */
|
2004-04-01 15:51:34 +02:00
|
|
|
UNIV_INLINE
|
|
|
|
ulint
|
|
|
|
ut_strlenq(
|
|
|
|
/*=======*/
|
|
|
|
/* out: length of the string when quoted */
|
|
|
|
const char* str, /* in: null-terminated string */
|
|
|
|
char q) /* in: the quote character */
|
|
|
|
{
|
|
|
|
ulint len;
|
|
|
|
|
|
|
|
for (len = 0; *str; len++, str++) {
|
|
|
|
if (*str == q) {
|
|
|
|
len++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return(len);
|
|
|
|
}
|