MySQL 9.1.0
Source Code Documentation
|
Memory primitives. More...
Macros | |
#define | MK_UINT16(a, b) (((uint16)(b)) << 8 | (uint16)(a)) |
#define | UINT16_GET_A(u) ((unsigned char)((u)&0xFF)) |
#define | UINT16_GET_B(u) ((unsigned char)((u) >> 8)) |
#define | MK_ALL_UINT16_WITH_A(a) |
#define | LOOP_READ_BYTES(ASSIGN) |
Functions | |
static void * | ut_memcpy (void *dest, const void *src, ulint n) |
Wrapper for memcpy(3). More... | |
static void * | ut_memmove (void *dest, const void *src, ulint n) |
Wrapper for memmove(3). More... | |
static int | ut_memcmp (const void *str1, const void *str2, ulint n) |
Wrapper for memcmp(3). More... | |
static char * | ut_strcpy (char *dest, const char *src) |
Wrapper for strcpy(3). More... | |
static ulint | ut_strlen (const char *str) |
Wrapper for strlen(3). More... | |
static int | ut_strcmp (const char *str1, const char *str2) |
Wrapper for strcmp(3). More... | |
static ulint | ut_raw_to_hex (const void *raw, ulint raw_size, char *hex, ulint hex_size) |
Converts a raw binary data to a NUL-terminated hex string. More... | |
static ulint | ut_str_sql_format (const char *str, ulint str_len, char *buf, ulint buf_size) |
Adds single quotes to the start and end of string and escapes any quotes by doubling them. More... | |
Memory primitives.
Created 5/30/1994 Heikki Tuuri
#define LOOP_READ_BYTES | ( | ASSIGN | ) |
#define MK_ALL_UINT16_WITH_A | ( | a | ) |
#define UINT16_GET_A | ( | u | ) | ((unsigned char)((u)&0xFF)) |
#define UINT16_GET_B | ( | u | ) | ((unsigned char)((u) >> 8)) |
|
inlinestatic |
Wrapper for memcmp(3).
Compare memory areas.
[in] | str1 | first memory block to compare |
[in] | str2 | second memory block to compare |
[in] | n | number of bytes to compare |
|
inlinestatic |
Wrapper for memcpy(3).
Copy memory area when the source and target are not overlapping.
[in,out] | dest | copy to |
[in] | src | copy from |
[in] | n | number of bytes to copy |
|
inlinestatic |
Wrapper for memmove(3).
Copy memory area when the source and target are overlapping.
[in,out] | dest | Move to |
[in] | src | Move from |
[in] | n | number of bytes to move |
|
inlinestatic |
Converts a raw binary data to a NUL-terminated hex string.
The output is truncated if there is not enough space in "hex", make sure "hex_size" is at least (2 * raw_size + 1) if you do not want this to happen. Returns the actual number of characters written to "hex" (including the NUL).
raw | in: raw data |
raw_size | in: "raw" length in bytes |
hex | out: hex string |
hex_size | in: "hex" size in bytes |
|
inlinestatic |
Adds single quotes to the start and end of string and escapes any quotes by doubling them.
Returns the number of bytes that were written to "buf" (including the terminating NUL). If buf_size is too small then the trailing bytes from "str" are discarded.
str | in: string |
str_len | in: string length in bytes |
buf | out: output buffer |
buf_size | in: output buffer size in bytes |
|
inlinestatic |
Wrapper for strcmp(3).
Compare NUL-terminated strings.
[in] | str1 | first string to compare |
[in] | str2 | second string to compare |
|
inlinestatic |
Wrapper for strcpy(3).
Copy a NUL-terminated string.
[in,out] | dest | Destination to copy to |
[in] | src | Source to copy from |
|
inlinestatic |
Wrapper for strlen(3).
Determine the length of a NUL-terminated string.
[in] | str | string |