|
smartmontools SVN Rev 5716
Utility to control and monitor storage systems with "S.M.A.R.T."
|
#include <float.h>#include <time.h>#include <stdarg.h>#include <stdint.h>#include <stdio.h>#include <string.h>#include <string>#include <sys/types.h>#include <regex.h>

Go to the source code of this file.
Classes | |
| class | raw_buffer |
| class | stdio_file |
| Wrapper class for FILE *. More... | |
| class | regular_expression |
| Wrapper class for POSIX regex(3) or std::regex Supports copy & assignment and is compatible with STL containers. More... | |
Macros | |
| #define | UTILITY_H_CVSID "$Id: utility.h 5519 2023-07-24 15:57:54Z chrfranke $" |
| #define | __attribute_format_printf(x, y) |
| #define | DATEANDEPOCHLEN 64 |
Functions | |
| std::string | format_version_info (const char *prog_name, int lines=2) |
| std::string | strprintf (const char *fmt,...) __attribute_format_printf(1 |
| std::string std::string | vstrprintf (const char *fmt, va_list ap) |
| bool | str_starts_with (const char *str, const char *prefix) |
| bool | str_starts_with (const std::string &str, const char *prefix) |
| struct tm * | time_to_tm_local (struct tm *tp, time_t t) |
| void | dateandtimezoneepoch (char(&buffer)[DATEANDEPOCHLEN], time_t tval) |
| void | pout (const char *fmt,...) __attribute_format_printf(1 |
| void void | syserror (const char *message) |
| int | split_selective_arg (char *s, uint64_t *start, uint64_t *stop, int *mode) |
| bool | isbigendian () |
| void | swap2 (char *location) |
| void | swap4 (char *location) |
| void | swap8 (char *location) |
| void | swapx (unsigned short *p) |
| void | swapx (unsigned int *p) |
| void | swapx (uint64_t *p) |
| void | check_config () |
| const char * | packetdevicetype (int type) |
| bool | nonempty (const void *data, int size) |
| void | FixGlibcTimeZoneBug () |
| const char * | format_char_array (char *str, int strsize, const char *chr, int chrsize) |
| template<size_t STRSIZE, size_t CHRSIZE> | |
| const char * | format_char_array (char(&str)[STRSIZE], const char(&chr)[CHRSIZE]) |
| const char * | format_with_thousands_sep (char *str, int strsize, uint64_t val, const char *thousands_sep=0) |
| const char * | format_capacity (char *str, int strsize, uint64_t val, const char *decimal_point=0) |
| int | uint128_to_str_precision_bits () |
| const char * | uint128_hilo_to_str (char *str, int strsize, uint64_t value_hi, uint64_t value_lo) |
| template<size_t SIZE> | |
| const char * | uint128_hilo_to_str (char(&str)[SIZE], uint64_t value_hi, uint64_t value_lo) |
| long long | get_timer_usec () |
| Get microseconds since some unspecified starting point. | |
| #define UTILITY_H_CVSID "$Id: utility.h 5519 2023-07-24 15:57:54Z chrfranke $" |
| void check_config | ( | ) |
Definition at line 919 of file utility.cpp.
| void dateandtimezoneepoch | ( | char(&) | buffer[DATEANDEPOCHLEN], |
| time_t | tval | ||
| ) |
Definition at line 349 of file utility.cpp.
| void FixGlibcTimeZoneBug | ( | ) |
Definition at line 214 of file utility.cpp.
| const char * format_capacity | ( | char * | str, |
| int | strsize, | ||
| uint64_t | val, | ||
| const char * | decimal_point = 0 |
||
| ) |
Definition at line 748 of file utility.cpp.
| const char * format_char_array | ( | char * | str, |
| int | strsize, | ||
| const char * | chr, | ||
| int | chrsize | ||
| ) |
Definition at line 692 of file utility.cpp.
|
inline |
| std::string format_version_info | ( | const char * | prog_name, |
| int | lines = 2 |
||
| ) |
Definition at line 87 of file utility.cpp.
| const char * format_with_thousands_sep | ( | char * | str, |
| int | strsize, | ||
| uint64_t | val, | ||
| const char * | thousands_sep = 0 |
||
| ) |
Definition at line 716 of file utility.cpp.
| long long get_timer_usec | ( | ) |
Get microseconds since some unspecified starting point.
Used only for command duration measurements in debug outputs. Returns -1 if unsupported.
Definition at line 865 of file utility.cpp.
| bool nonempty | ( | const void * | data, |
| int | size | ||
| ) |
Definition at line 682 of file utility.cpp.
| const char * packetdevicetype | ( | int | type | ) |
Definition at line 315 of file utility.cpp.
| void pout | ( | const char * | fmt, |
| ... | |||
| ) |
| int split_selective_arg | ( | char * | s, |
| uint64_t * | start, | ||
| uint64_t * | stop, | ||
| int * | mode | ||
| ) |
Definition at line 630 of file utility.cpp.
|
inline |
|
inline |
| std::string strprintf | ( | const char * | fmt, |
| ... | |||
| ) |
| void swap2 | ( | char * | location | ) |
Definition at line 304 of file atacmds.cpp.
| void swap4 | ( | char * | location | ) |
Definition at line 312 of file atacmds.cpp.
| void swap8 | ( | char * | location | ) |
Definition at line 321 of file atacmds.cpp.
| void void syserror | ( | const char * | message | ) |
Definition at line 409 of file utility.cpp.
| struct tm * time_to_tm_local | ( | struct tm * | tp, |
| time_t | t | ||
| ) |
Definition at line 326 of file utility.cpp.
| const char * uint128_hilo_to_str | ( | char * | str, |
| int | strsize, | ||
| uint64_t | value_hi, | ||
| uint64_t | value_lo | ||
| ) |
Definition at line 856 of file utility.cpp.
|
inline |
| std::string std::string vstrprintf | ( | const char * | fmt, |
| va_list | ap | ||
| ) |