MySQL 9.0.0
Source Code Documentation
ut.cc File Reference

Various utilities for Innobase. More...

#include <sys/types.h>
#include <time.h>
#include <iomanip>
#include "univ.i"
#include "ut/ut.h"

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_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...
 
void ut_print_timestamp (FILE *file)
 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...
 
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...
 

Detailed Description

Various utilities for Innobase.

Created 5/11/1994 Heikki Tuuri

Function Documentation

◆ 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.

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)
Parameters
dstin: destination buffer
srcin: source buffer
sizein: size of destination buffer