Motr  M0
string.c File Reference
#include "lib/trace.h"
#include "lib/types.h"
#include "lib/memory.h"
#include "lib/misc.h"
#include "lib/finject.h"
#include "lib/string.h"
Include dependency graph for string.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_LIB
 

Functions

const char * m0_bcount_with_suffix (char *buf, size_t size, m0_bcount_t c)
 
M0_INTERNAL void m0_strings_free (const char **arr)
 
M0_INTERNAL const char ** m0_strings_dup (const char **src)
 
M0_INTERNAL char * m0_vsnprintf (char *buf, size_t buflen, const char *format,...)
 
M0_INTERNAL bool m0_startswith (const char *prefix, const char *str)
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_LIB

Definition at line 23 of file string.c.

Function Documentation

◆ m0_bcount_with_suffix()

const char* m0_bcount_with_suffix ( char *  buf,
size_t  size,
m0_bcount_t  c 
)

Converts m0_bcount_t number into a reduced string representation, calculating a magnitude and representing it as standard suffix like "Ki", "Mi", "Gi" etc. So, for example, 87654321 becomes "83 Mi".

Definition at line 32 of file string.c.

Here is the caller graph for this function:

◆ m0_startswith()

M0_INTERNAL bool m0_startswith ( const char *  prefix,
const char *  str 
)

Returns true iff ‘str’ starts with the specified ‘prefix’.

Definition at line 98 of file string.c.

Here is the caller graph for this function:

◆ m0_strings_dup()

M0_INTERNAL const char** m0_strings_dup ( const char **  src)

Definition at line 55 of file string.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_strings_free()

M0_INTERNAL void m0_strings_free ( const char **  arr)

Definition at line 45 of file string.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ m0_vsnprintf()

M0_INTERNAL char* m0_vsnprintf ( char *  buf,
size_t  buflen,
const char *  format,
  ... 
)

Definition at line 84 of file string.c.

Here is the caller graph for this function: