smartmontools  SVN Rev 4325
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.

Macros

#define BUILD_INFO   "(local build)"
 

Functions

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)
 
std::string vstrprintf (const char *fmt, va_list ap)
 
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 ()
 

Variables

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

void check_config ( )

Definition at line 800 of file utility.cpp.

static void check_endianness ( )
static

Definition at line 276 of file utility.cpp.

static const char* check_regex ( const char *  pattern)
static

Definition at line 389 of file utility.cpp.

void dateandtimezone ( char *  buffer)

Definition at line 344 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 694 of file utility.cpp.

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

Definition at line 638 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 662 of file utility.cpp.

bool nonempty ( const void *  data,
int  size 
)

Definition at line 628 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 776 of file utility.cpp.

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

Definition at line 764 of file utility.cpp.

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

Definition at line 576 of file utility.cpp.

std::string strprintf ( const char *  fmt,
  ... 
)

Definition at line 745 of file utility.cpp.

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

Definition at line 525 of file utility.cpp.

void syserror ( const char *  message)

Definition at line 355 of file utility.cpp.

std::string vstrprintf ( const char *  fmt,
va_list  ap 
)

Definition at line 737 of file utility.cpp.

Variable Documentation

const char* packet_types[]
Initial value:
= {
"Direct-access (disk)",
"Sequential-access (tape)",
"Printer",
"Processor",
"Write-once (optical disk)",
"CD/DVD",
"Scanner",
"Optical memory (optical disk)",
"Medium changer",
"Communications",
"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 4309 2016-04-24 14:59:15Z chrfranke $"
#define INT64_H_CVSID
Definition: int64.h:23
#define UTILITY_H_CVSID
Definition: utility.h:28

Definition at line 55 of file utility.cpp.