nfs-ganesha 1.4
Functions

nodelist_common.c File Reference

#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "nodelist.h"

Go to the source code of this file.

Functions

int _nodelist_common_string_get_token_common (char *string, char *separators_list, int *p_token_nb, int token_id, char **p_token)
int nodelist_common_string_get_token (char *string, char *separators_list, int token_id, char **p_token)
 Get a specific token included in a string.
int nodelist_common_string_get_tokens_quantity (char *string, char *separators_list, int *p_token_nb)
 Get number of tokens included in a string.
int nodelist_common_string_appends_and_extends (char **p_io_string, size_t *p_current_length, size_t inc_length, char *string2append, char *separator)
 Appends a char* giving a char* to append and an optionnal separator.
int nodelist_common_extended2condensed_nodelist (char *src_list, char **p_dst_list)
 Get an compacted nodes list based on a extended one.
int nodelist_common_condensed2extended_nodelist (char *src_list, char **p_dst_list)
 Get an extended nodes list based on a compacted one.

Function Documentation

int _nodelist_common_string_get_token_common ( char *  string,
char *  separators_list,
int *  p_token_nb,
int  token_id,
char **  p_token 
)

Definition at line 265 of file nodelist_common.c.

int nodelist_common_string_appends_and_extends ( char **  p_io_string,
size_t *  p_current_length,
size_t  inc_length,
char *  string2append,
char *  separator 
)

Appends a char* giving a char* to append and an optionnal separator.

Parameters:
p_io_stringpointer on the input char* that have to be appended
p_current_lengthpointer on the size_t that contains the current char* associated buffer (should be larger that string length)
inc_lengthincrementation step length
string2appendchar* that must be added
separatorchar* containing the separator
Return values:
0operation successfully done
-1operation failed

Definition at line 82 of file nodelist_common.c.

int nodelist_common_string_get_token ( char *  string,
char *  separators_list,
int  token_id,
char **  p_token 
)

Get a specific token included in a string.

Parameters:
stringinput string
separators_liststring containing allowed token 's separators
tokenid the id of the token in the list
p_tokenpointer on a string that will be set according to the token value (must be free later)
Return values:
0operation successfully done
-1operation failed

Definition at line 23 of file nodelist_common.c.

int nodelist_common_string_get_tokens_quantity ( char *  string,
char *  separators_list,
int *  p_token_nb 
)

Get number of tokens included in a string.

Parameters:
stringinput string
separators_liststring containing allowed token 's separators
p_token_nbpointer on an integer that will be set to tokens quantity found in the string
Return values:
0operation successfully done
-1operation failed

Definition at line 49 of file nodelist_common.c.