Motr  M0
Collaboration diagram for String List:

Data Structures

struct  slist_params
 

Functions

static bool slist_alloc (struct m0_net_test_slist *slist, size_t string_nr, size_t arr_len)
 
static void slist_free (struct m0_net_test_slist *slist)
 
int m0_net_test_slist_init (struct m0_net_test_slist *slist, const char *str, char delim)
 
bool m0_net_test_slist_invariant (const struct m0_net_test_slist *slist)
 
void m0_net_test_slist_fini (struct m0_net_test_slist *slist)
 
bool m0_net_test_slist_unique (const struct m0_net_test_slist *slist)
 
 TYPE_DESCR (slist_params)
 
static m0_bcount_t slist_encode (struct m0_net_test_slist *slist, struct m0_bufvec *bv, m0_bcount_t offset)
 
static m0_bcount_t slist_decode (struct m0_net_test_slist *slist, struct m0_bufvec *bv, m0_bcount_t offset)
 
m0_bcount_t m0_net_test_slist_serialize (enum m0_net_test_serialize_op op, struct m0_net_test_slist *slist, struct m0_bufvec *bv, m0_bcount_t offset)
 

Detailed Description

Function Documentation

◆ m0_net_test_slist_fini()

void m0_net_test_slist_fini ( struct m0_net_test_slist slist)

Finalize string list.

Precondition
m0_net_test_slist_invariant(slist);

Definition at line 120 of file slist.c.

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

◆ m0_net_test_slist_init()

int m0_net_test_slist_init ( struct m0_net_test_slist slist,
const char *  str,
char  delim 
)

Initialize a string list from a C string composed of individual sub-strings separated by a delimiter character. The delimiter cannot be NUL and cannot be part of the sub-string.

Precondition
slist != NULL
str != NULL
delim != NUL
Postcondition
(result == 0) && m0_net_test_slist_invariant(slist)

Definition at line 57 of file slist.c.

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

◆ m0_net_test_slist_invariant()

bool m0_net_test_slist_invariant ( const struct m0_net_test_slist slist)

Definition at line 97 of file slist.c.

Here is the caller graph for this function:

◆ m0_net_test_slist_serialize()

m0_bcount_t m0_net_test_slist_serialize ( enum m0_net_test_serialize_op  op,
struct m0_net_test_slist slist,
struct m0_bufvec bv,
m0_bcount_t  offset 
)

Serialize/deserialize string list to/from m0_bufvec. m0_net_test_slist_init() shall not be called for slist before m0_net_test_slist_serialize(). m0_net_test_slist_fini() must be called for slist to free memory, allocated by m0_net_test_slist_serialize(M0_NET_TEST_DESERIALIZE, slist,...).

See also
m0_net_test_serialize().

Definition at line 235 of file slist.c.

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

◆ m0_net_test_slist_unique()

bool m0_net_test_slist_unique ( const struct m0_net_test_slist slist)

Is every string in list unique in this list. Time complexity - O(N*N), N - number of strings in the list. Two strings are equal if strcmp() returns 0.

Returns
all strings in list are different.
Precondition
m0_net_test_slist_invariant(slist);

Definition at line 129 of file slist.c.

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

◆ slist_alloc()

static bool slist_alloc ( struct m0_net_test_slist slist,
size_t  string_nr,
size_t  arr_len 
)
static

Definition at line 38 of file slist.c.

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

◆ slist_decode()

static m0_bcount_t slist_decode ( struct m0_net_test_slist slist,
struct m0_bufvec bv,
m0_bcount_t  offset 
)
static

Definition at line 184 of file slist.c.

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

◆ slist_encode()

static m0_bcount_t slist_encode ( struct m0_net_test_slist slist,
struct m0_bufvec bv,
m0_bcount_t  offset 
)
static

Definition at line 156 of file slist.c.

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

◆ slist_free()

static void slist_free ( struct m0_net_test_slist slist)
static

Definition at line 51 of file slist.c.

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

◆ TYPE_DESCR()

TYPE_DESCR ( slist_params  )