smartmontools  SVN Rev 4115
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)
 
int split_report_arg (char *s, int *i)
 
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_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 842 of file utility.cpp.

static void check_endianness ( )
static

Definition at line 268 of file utility.cpp.

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

Definition at line 382 of file utility.cpp.

void dateandtimezone ( char *  buffer)

Definition at line 337 of file utility.cpp.

void dateandtimezoneepoch ( char *  buffer,
time_t  tval 
)

Definition at line 289 of file utility.cpp.

void FixGlibcTimeZoneBug ( )

Definition at line 167 of file utility.cpp.

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

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

bool nonempty ( const void *  data,
int  size 
)

Definition at line 695 of file utility.cpp.

const char* packetdevicetype ( int  type)

Definition at line 257 of file utility.cpp.

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

Definition at line 818 of file utility.cpp.

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

Definition at line 806 of file utility.cpp.

int split_report_arg ( char *  s,
int *  i 
)

Definition at line 520 of file utility.cpp.

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

Definition at line 596 of file utility.cpp.

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

Definition at line 787 of file utility.cpp.

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

Definition at line 545 of file utility.cpp.

void syserror ( const char *  message)

Definition at line 348 of file utility.cpp.

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

Definition at line 779 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 4031 2015-01-01 10:47:48Z 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.