#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 |
|
) |
| |
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_string | pointer on the input char* that have to be appended |
p_current_length | pointer on the size_t that contains the current char* associated buffer (should be larger that string length) |
inc_length | incrementation step length |
string2append | char* that must be added |
separator | char* containing the separator |
- Return values:
-
0 | operation successfully done |
-1 | operation 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:
-
string | input string |
separators_list | string containing allowed token 's separators |
token | id the id of the token in the list |
p_token | pointer on a string that will be set according to the token value (must be free later) |
- Return values:
-
0 | operation successfully done |
-1 | operation 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:
-
string | input string |
separators_list | string containing allowed token 's separators |
p_token_nb | pointer on an integer that will be set to tokens quantity found in the string |
- Return values:
-
0 | operation successfully done |
-1 | operation failed |
Definition at line 49 of file nodelist_common.c.