smartmontools SVN Rev 3317
Utility to control and monitor storage systems with "S.M.A.R.T."
Defines | 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.

Defines

#define BUILD_INFO   "(local build)"

Functions

std::string format_version_info (const char *prog_name, bool full)
void FixGlibcTimeZoneBug ()
const char * packetdevicetype (int type)
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,...)

Variables

const char * utility_cpp_cvsid
const char * packet_types []

Define Documentation

#define BUILD_INFO   "(local build)"

Definition at line 79 of file utility.cpp.


Function Documentation

void check_endianness ( )

Definition at line 265 of file utility.cpp.

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

Definition at line 379 of file utility.cpp.

void dateandtimezone ( char *  buffer)

Definition at line 334 of file utility.cpp.

void dateandtimezoneepoch ( char *  buffer,
time_t  tval 
)

Definition at line 286 of file utility.cpp.

void FixGlibcTimeZoneBug ( )

Definition at line 164 of file utility.cpp.

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

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

bool nonempty ( const void *  data,
int  size 
)

Definition at line 712 of file utility.cpp.

const char* packetdevicetype ( int  type)

Definition at line 254 of file utility.cpp.

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

Definition at line 835 of file utility.cpp.

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

Definition at line 823 of file utility.cpp.

int split_report_arg ( char *  s,
int *  i 
)

Definition at line 517 of file utility.cpp.

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

Definition at line 593 of file utility.cpp.

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

Definition at line 804 of file utility.cpp.

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

Definition at line 542 of file utility.cpp.

void syserror ( const char *  message)

Definition at line 345 of file utility.cpp.

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

Definition at line 796 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 3871 2014-01-01 16:28:01Z chrfranke $"
                                 UTILITY_H_CVSID INT64_H_CVSID

Definition at line 55 of file utility.cpp.