TPCCLIB
|
Functions for reading ASCII data files. More...
#include "libtpcmisc.h"
Go to the source code of this file.
Functions | |
void | str_token_list_init (STR_TOKEN_LIST *lst) |
void | str_token_list_empty (STR_TOKEN_LIST *lst) |
int | str_token_list_add (STR_TOKEN_LIST *lst, char *new_item) |
int | str_token_list_del (STR_TOKEN_LIST *lst, int item) |
int | str_token_list_read (const char *filename, STR_TOKEN_LIST *lst) |
int | textfileReadLines (const char *filename, STR_TOKEN_LIST *lst) |
int | readStrtokens (const char *filename, char ***toklist) |
int | asciiCommentLine (const char *line, int *cont) |
Functions for reading ASCII data files.
Definition in file readfile.c.
int asciiCommentLine | ( | const char * | line, |
int * | cont ) |
Check if ASCII text line starts with comment character '#'. Comment character is searched from the first non-space character (space characters here include spaces and tabs).
line | Pointer to string containing one line of ASCII text file |
cont | Optional pointer which is set to the index of line where the first non-space character after the comment character starts. If line does not start with comment character, then this will point to the first non-space character of the line. Enter NULL if not needed. |
Definition at line 246 of file readfile.c.
Referenced by sifRead().
int readStrtokens | ( | const char * | filename, |
char *** | toklist ) |
Read list of string tokens from specified file Remember to free the memory of string list.
filename | Name of file to read |
toklist | Pointer to list of strings read and allocated here |
Definition at line 181 of file readfile.c.
int str_token_list_add | ( | STR_TOKEN_LIST * | lst, |
char * | new_item ) |
Put a string in STR_TOKEN_LIST.
lst | List that has to be initialized beforehand. |
new_item | String that is added to list. |
Definition at line 42 of file readfile.c.
Referenced by str_token_list_read(), and textfileReadLines().
int str_token_list_del | ( | STR_TOKEN_LIST * | lst, |
int | item ) |
Remove the specified string item from the STR_TOKEN_LIST.
lst | List that has to be initialized beforehand. |
item | Item number to remove (1..item_nr). |
Definition at line 70 of file readfile.c.
Referenced by sifRead().
void str_token_list_empty | ( | STR_TOKEN_LIST * | lst | ) |
Free memory allocated for STR_TOKEN_LIST. All contents are destroyed.
lst | Pointer to list to be emptied. |
Definition at line 26 of file readfile.c.
Referenced by roi_read(), sifRead(), str_token_list_read(), and textfileReadLines().
void str_token_list_init | ( | STR_TOKEN_LIST * | lst | ) |
Initiate STR_TOKEN_LIST structure. This should be called once before first use.
lst | Pointer to list to be initiated. |
Definition at line 13 of file readfile.c.
Referenced by roi_read(), and sifRead().
int str_token_list_read | ( | const char * | filename, |
STR_TOKEN_LIST * | lst ) |
Read all string tokens from text file into STR_TOKEN_LIST. List needs to be initialized. Previous contents are deleted.
filename | Name of text file to read |
lst | Token list is allocated by this function. |
Definition at line 93 of file readfile.c.
int textfileReadLines | ( | const char * | filename, |
STR_TOKEN_LIST * | lst ) |
Read all lines from text file into STR_TOKEN_LIST. List needs to be initialized. Previous contents are deleted.
filename | Name of text file to read |
lst | Token list is allocated by this function. |
Definition at line 136 of file readfile.c.
Referenced by roi_read(), and sifRead().