Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Enumerations | Functions
string_helpers.h File Reference
#include <linux/types.h>

Go to the source code of this file.

Enumerations

enum  string_size_units { STRING_UNITS_10, STRING_UNITS_2 }
 

Functions

int string_get_size (u64 size, enum string_size_units units, char *buf, int len)
 

Enumeration Type Documentation

Enumerator:
STRING_UNITS_10 
STRING_UNITS_2 

Definition at line 8 of file string_helpers.h.

Function Documentation

int string_get_size ( u64  size,
const enum string_size_units  units,
char buf,
int  len 
)

string_get_size - get the size in the specified units : The size to be converted : units to use (powers of 1000 or 1024) : buffer to format to : length of buffer

This function returns a string formatted to 3 significant figures giving the size in the required units. Returns 0 on success or error on failure. is always zero terminated.

Definition at line 23 of file string_helpers.c.