MySQL 9.1.0
Source Code Documentation
m_string.h File Reference
#include <float.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <cstdint>
#include "lex_string.h"
#include "my_config.h"

Go to the source code of this file.

Functions

static void bchange (uint8_t *dst, size_t old_length, const uint8_t *src, size_t new_length, size_t tot_length)
 
static const char * strend (const char *s)
 
static char * strend (char *s)
 
static const char * strcend (const char *s, char c)
 
static char * strfill (char *s, size_t len, char fill)
 
static char * my_stpmov (char *dst, const char *src)
 
static char * my_stpnmov (char *dst, const char *src, size_t n)
 
static char * my_stpcpy (char *dst, const char *src)
 Copy a string from src to dst until (and including) terminating null byte. More...
 
static char * my_stpncpy (char *dst, const char *src, size_t n)
 Copy fixed-size string from src to dst. More...
 
static long long my_strtoll (const char *nptr, char **endptr, int base)
 
static unsigned long long my_strtoull (const char *nptr, char **endptr, int base)
 
static char * my_strtok_r (char *str, const char *delim, char **saveptr)
 
static int native_strcasecmp (const char *s1, const char *s2)
 
static int native_strncasecmp (const char *s1, const char *s2, size_t n)
 
static int is_prefix (const char *s, const char *t)
 
static const uint8_t * skip_trailing_space (const uint8_t *ptr, size_t len)
 Skip trailing space (ASCII spaces only). More...
 
static void human_readable_num_bytes (char *buf, int buf_len, double dbl_val)
 
static void lex_string_set (LEX_STRING *lex_str, char *c_str)
 
static void lex_cstring_set (LEX_CSTRING *lex_str, const char *c_str)
 

Function Documentation

◆ bchange()

static void bchange ( uint8_t *  dst,
size_t  old_length,
const uint8_t *  src,
size_t  new_length,
size_t  tot_length 
)
inlinestatic

◆ human_readable_num_bytes()

static void human_readable_num_bytes ( char *  buf,
int  buf_len,
double  dbl_val 
)
inlinestatic

◆ is_prefix()

static int is_prefix ( const char *  s,
const char *  t 
)
inlinestatic

◆ lex_cstring_set()

static void lex_cstring_set ( LEX_CSTRING lex_str,
const char *  c_str 
)
inlinestatic

◆ lex_string_set()

static void lex_string_set ( LEX_STRING lex_str,
char *  c_str 
)
inlinestatic

◆ my_stpcpy()

static char * my_stpcpy ( char *  dst,
const char *  src 
)
inlinestatic

Copy a string from src to dst until (and including) terminating null byte.

Parameters
dstDestination
srcSource
Note
src and dst cannot overlap. Use my_stpmov() if src and dst overlaps.
Unsafe, consider using my_stpnpy() instead.
Returns
pointer to terminating null byte.

◆ my_stpmov()

static char * my_stpmov ( char *  dst,
const char *  src 
)
inlinestatic

◆ my_stpncpy()

static char * my_stpncpy ( char *  dst,
const char *  src,
size_t  n 
)
inlinestatic

Copy fixed-size string from src to dst.

Parameters
dstDestination
srcSource
nMaximum number of characters to copy.
Note
src and dst cannot overlap Use my_stpnmov() if src and dst overlaps.
Returns
pointer to terminating null byte.

◆ my_stpnmov()

static char * my_stpnmov ( char *  dst,
const char *  src,
size_t  n 
)
inlinestatic

◆ my_strtok_r()

static char * my_strtok_r ( char *  str,
const char *  delim,
char **  saveptr 
)
inlinestatic

◆ my_strtoll()

static long long my_strtoll ( const char *  nptr,
char **  endptr,
int  base 
)
inlinestatic

◆ my_strtoull()

static unsigned long long my_strtoull ( const char *  nptr,
char **  endptr,
int  base 
)
inlinestatic

◆ native_strcasecmp()

static int native_strcasecmp ( const char *  s1,
const char *  s2 
)
inlinestatic

◆ native_strncasecmp()

static int native_strncasecmp ( const char *  s1,
const char *  s2,
size_t  n 
)
inlinestatic

◆ skip_trailing_space()

static const uint8_t * skip_trailing_space ( const uint8_t *  ptr,
size_t  len 
)
inlinestatic

Skip trailing space (ASCII spaces only).

Returns
New end of the string.

◆ strcend()

static const char * strcend ( const char *  s,
char  c 
)
inlinestatic

◆ strend() [1/2]

static char * strend ( char *  s)
inlinestatic

◆ strend() [2/2]

static const char * strend ( const char *  s)
inlinestatic

◆ strfill()

static char * strfill ( char *  s,
size_t  len,
char  fill 
)
inlinestatic