smartmontools  SVN Rev 4559
Utility to control and monitor storage systems with "S.M.A.R.T."
Macros | Functions | Variables
utility.cpp File Reference
#include "config.h"
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
#include <sys/stat.h>
#include <stdexcept>
#include "svnversion.h"
#include "int64.h"
#include "utility.h"
#include "atacmds.h"
#include "dev_interface.h"
Include dependency graph for utility.cpp:

Go to the source code of this file.


#define BUILD_INFO   "(local build)"


std::string format_version_info (const char *prog_name, bool full)
void FixGlibcTimeZoneBug ()
const char * packetdevicetype (int type)
static void check_endianness ()
void dateandtimezoneepoch (char *buffer, time_t tval)
void dateandtimezone (char *buffer)
void syserror (const char *message)
static const char * check_regex (const char *pattern)
uint64_t strtoull (const char *p, char **endp, int base)
int split_selective_arg (char *s, uint64_t *start, uint64_t *stop, int *mode)
bool nonempty (const void *data, int size)
const char * format_char_array (char *str, int strsize, const char *chr, int chrsize)
const char * format_with_thousands_sep (char *str, int strsize, uint64_t val, const char *thousands_sep)
const char * format_capacity (char *str, int strsize, uint64_t val, const char *decimal_point)
 __attribute_format_printf (1, 0) std
std::string strprintf (const char *fmt,...)
int safe_vsnprintf (char *buf, int size, const char *fmt, va_list ap)
int safe_snprintf (char *buf, int size, const char *fmt,...)
void check_config ()


const char * utility_cpp_cvsid
const char * packet_types []

Macro Definition Documentation

#define BUILD_INFO   "(local build)"

Definition at line 79 of file utility.cpp.

Function Documentation

__attribute_format_printf ( ,

Definition at line 741 of file utility.cpp.

void check_config ( )

Definition at line 805 of file utility.cpp.

static void check_endianness ( )

Definition at line 276 of file utility.cpp.

static const char* check_regex ( const char *  pattern)

Definition at line 394 of file utility.cpp.

void dateandtimezone ( char *  buffer)

Definition at line 349 of file utility.cpp.

void dateandtimezoneepoch ( char *  buffer,
time_t  tval 

Definition at line 297 of file utility.cpp.

void FixGlibcTimeZoneBug ( )

Definition at line 175 of file utility.cpp.

const char* format_capacity ( char *  str,
int  strsize,
uint64_t  val,
const char *  decimal_point 

Definition at line 699 of file utility.cpp.

const char* format_char_array ( char *  str,
int  strsize,
const char *  chr,
int  chrsize 

Definition at line 643 of file utility.cpp.

std::string format_version_info ( const char *  prog_name,
bool  full 

Definition at line 83 of file utility.cpp.

const char* format_with_thousands_sep ( char *  str,
int  strsize,
uint64_t  val,
const char *  thousands_sep 

Definition at line 667 of file utility.cpp.

bool nonempty ( const void *  data,
int  size 

Definition at line 633 of file utility.cpp.

const char* packetdevicetype ( int  type)

Definition at line 265 of file utility.cpp.

int safe_snprintf ( char *  buf,
int  size,
const char *  fmt,

Definition at line 781 of file utility.cpp.

int safe_vsnprintf ( char *  buf,
int  size,
const char *  fmt,
va_list  ap 

Definition at line 769 of file utility.cpp.

int split_selective_arg ( char *  s,
uint64_t start,
uint64_t stop,
int *  mode 

Definition at line 581 of file utility.cpp.

std::string strprintf ( const char *  fmt,

Definition at line 750 of file utility.cpp.

uint64_t strtoull ( const char *  p,
char **  endp,
int  base 

Definition at line 530 of file utility.cpp.

void syserror ( const char *  message)

Definition at line 360 of file utility.cpp.

Variable Documentation

const char* packet_types[]
Initial value:
= {
"Direct-access (disk)",
"Sequential-access (tape)",
"Write-once (optical disk)",
"Optical memory (optical disk)",
"Medium changer",
"Graphic arts pre-press (10)",
"Graphic arts pre-press (11)",
"Array controller",
"Enclosure services",
"Reduced block command (simplified disk)",
"Optical card reader/writer"

Definition at line 58 of file utility.cpp.

const char* utility_cpp_cvsid
Initial value:
= "$Id: utility.cpp 4509 2017-10-04 20:31:35Z samm2 $"
#define INT64_H_CVSID
Definition: int64.h:23
Definition: utility.h:28

Definition at line 55 of file utility.cpp.