Distributed File System 1
Distributed file system in C
Loading...
Searching...
No Matches
list_str.h File Reference
#include "lib.h"
#include "list.h"

Go to the source code of this file.

Functions

 DefList (Str) ListStr split(Str str
 Split a string by a separator.
void ListStr_print (ListStr list)
 Print a List of Strings.
 DefList (SafeStr) Buffer ListSafeStr_serialize(ListSafeStr list)
 Serialize a List of SafeStr to a Buffer.
ListSafeStr ListSafeStr_deserialize (Buffer buf)
 Deserialize a SafeStr from a Buffer.

Variables

char sep

Function Documentation

◆ DefList() [1/2]

DefList ( SafeStr )

Serialize a List of SafeStr to a Buffer.

Parameters
listthe List of SafeStr that you want to serialize
Returns
a Buffer containing that List of SafeStr

◆ DefList() [2/2]

DefList ( Str )

Split a string by a separator.

This is very useful for parsing command line arguments.

Parameters
strthe string to split
septhe separator in he string
Returns
a List of Str where each Str was separated by sep in str

◆ ListSafeStr_deserialize()

ListSafeStr ListSafeStr_deserialize ( Buffer buf)

Deserialize a SafeStr from a Buffer.

WARNING: Do NOT deinitialize this using ListSafeStr_deinit. You must manually deinitialize the strings inside the list and then the whole list.

Parameters
bufa Buffer containing the Safe
Returns
a List of SafeStr

◆ ListStr_print()

void ListStr_print ( ListStr list)

Print a List of Strings.

Parameters
listthe list to print

Variable Documentation

◆ sep

char sep