MySQL 9.1.0
Source Code Documentation
ut.h File Reference

Various utilities. More...

#include "univ.i"

Go to the source code of this file.

Classes

struct  PrintBuffer
 

Functions

void ut_print_buf (FILE *file, const void *buf, ulint len)
 NOTE: The functions in this file should only use functions from other files in library. More...
 
void ut_print_timestamp (FILE *file) UNIV_COLD
 Prints a timestamp to a file. More...
 
void ut_sprintf_timestamp (char *buf)
 Sprintfs a timestamp to a buffer, 13..14 chars plus terminating NUL. More...
 
void ut_print_buf_hex (std::ostream &o, const void *buf, ulint len)
 Prints the contents of a memory buffer in hex. More...
 
void ut_print_buf (std::ostream &o, const void *buf, ulint len)
 Prints the contents of a memory buffer in hex and ascii. More...
 
ulint ut_strlcpy_rev (char *dst, const char *src, ulint size)
 Like ut_strlcpy, but if src doesn't fit in dst completely, copies the last (size - 1) bytes of src, not the first. More...
 
std::ostream & operator<< (std::ostream &out, const PrintBuffer &obj)
 

Detailed Description

Various utilities.

Created 1/20/1994 Heikki Tuuri

Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  out,
const PrintBuffer obj 
)
inline

◆ ut_print_buf() [1/2]

void ut_print_buf ( FILE *  file,
const void *  buf,
ulint  len 
)

NOTE: The functions in this file should only use functions from other files in library.

The code in this file is used to make a library for external tools. Prints the contents of a memory buffer in hex and ascii. in: length of the buffer

The code in this file is used to make a library for external tools. Prints the contents of a memory buffer in hex and ascii.

Parameters
filein: file where to print
bufin: memory buffer
lenin: length of the buffer

◆ ut_print_buf() [2/2]

void ut_print_buf ( std::ostream &  o,
const void *  buf,
ulint  len 
)

Prints the contents of a memory buffer in hex and ascii.

Parameters
[in,out]oOutput stream
[in]bufMemory buffer
[in]lenLength of the buffer

◆ ut_print_buf_hex()

void ut_print_buf_hex ( std::ostream &  o,
const void *  buf,
ulint  len 
)

Prints the contents of a memory buffer in hex.

Parameters
[in,out]oOutput stream
[in]bufMemory buffer
[in]lenLength of the buffer

◆ ut_print_timestamp()

void ut_print_timestamp ( FILE *  file)

Prints a timestamp to a file.

Parameters
filein: file where to print

◆ ut_sprintf_timestamp()

void ut_sprintf_timestamp ( char *  buf)

Sprintfs a timestamp to a buffer, 13..14 chars plus terminating NUL.

in: buffer where to sprintf

Parameters
bufin: buffer where to sprintf

◆ ut_strlcpy_rev()

ulint ut_strlcpy_rev ( char *  dst,
const char *  src,
ulint  size 
)

Like ut_strlcpy, but if src doesn't fit in dst completely, copies the last (size - 1) bytes of src, not the first.

Returns
strlen(src) in: size of destination buffer
strlen(src)
Parameters
dstin: destination buffer
srcin: source buffer
sizein: size of destination buffer