~drizzle-trunk/drizzle/development

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/***********************************************************************
Memory primitives

(c) 1994, 1995 Innobase Oy

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

UNIV_INLINE
void*
ut_memcpy(void* dest, const void* sour, ulint n)
{
	return(memcpy(dest, sour, n));
}

UNIV_INLINE
void*
ut_memmove(void* dest, const void* sour, ulint n)
{
	return(memmove(dest, sour, n));
}

UNIV_INLINE
int
ut_memcmp(const void* str1, const void* str2, ulint n)
{
	return(memcmp(str1, str2, n));
}

UNIV_INLINE
char*
ut_strcpy(char* dest, const char* sour)
{
	return(strcpy(dest, sour));
}

UNIV_INLINE
ulint
ut_strlen(const char* str)
{
	return(strlen(str));
}

UNIV_INLINE
int
ut_strcmp(const void* str1, const void* str2)
{
	return(strcmp((const char*)str1, (const char*)str2));
}

/**************************************************************************
Compute strlen(ut_strcpyq(str, q)). */
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);
}