ut0mem.ic 1.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
/***********************************************************************
Memory primitives

(c) 1994, 1995 Innobase Oy

Created 5/30/1994 Heikki Tuuri
************************************************************************/

UNIV_INLINE
void*
11
ut_memcpy(void* dest, const void* sour, ulint n)
12 13 14 15 16 17
{
	return(memcpy(dest, sour, n)); 
}

UNIV_INLINE
void*
18
ut_memmove(void* dest, const void* sour, ulint n)
19 20 21 22 23 24
{
	return(memmove(dest, sour, n));
}

UNIV_INLINE
int
25
ut_memcmp(const void* str1, const void* str2, ulint n)
26 27 28 29 30 31
{
	return(memcmp(str1, str2, n));
}

UNIV_INLINE
char*
32
ut_strcpy(char* dest, const char* sour)
33 34 35 36 37 38
{
	return(strcpy(dest, sour));
}

UNIV_INLINE
ulint
unknown's avatar
unknown committed
39
ut_strlen(const char* str)
40 41 42 43 44 45
{
	return(strlen(str));
}

UNIV_INLINE
int
46
ut_strcmp(const void* str1, const void* str2)
47
{
48
	return(strcmp((const char*)str1, (const char*)str2));
49 50
}

51
/**************************************************************************
52
Compute strlen(ut_strcpyq(str, q)). */
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
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);
}