#include <string.h>
#include <strings.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <errno.h>
#include "eg_macros.h"
Include dependency graph for eg_io.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Defines | |
#define | EGnullDisplay ((EGdisplay_f)0) |
#define | EGsfopen(__file, __mode) |
safe open function, it test that we can open the given file with the given mode, if an error occurs, display it on screen and exit, otherwise, return the open file stream. | |
Typedefs | |
typedef void(* | EGdisplay_f )(void *, FILE *) |
type of functions for display, receives a void* to the structure to print, and a *FILE where to output | |
typedef void(* | EGdisplayOS_f )(void *, FILE *, size_t *) |
type of functions for display, receives a void* to the structure to print, a *FILE where to output, and a set of offsets for datas, the length of that array must be know by the user. | |
Functions | |
void | EGdisplayString (void *str, FILE *file) |
display function for strings | |
void | EGioDisCom (char **next, char **current, const char *delim, const char *coment, char *store, unsigned int storeSize, FILE *in) |
this discard all lines starting with comments and stores the next leading line in current and the next token in next, we assume that next does not contain data, and that current store the remainings of the current line | |
void | EGioNParse (char *input, int max_argc, const char *delim, const char *comment, int *argc, char **argv) |
Given a string 'input' this function uses EGioParse to separate up to N words in it, we assume that argc is an array of pointers to strings of size N, and note that the input array will be changed. | |
void | EGioParse (char **next, char **current, const char *delim, const char *coment) |
given two *pointers 'next' and 'current' and a constant set of strings (parse delimiters), it store in 'next the next meaningfull string, and in current the rest of the secuence, the idea is to iterate over 'next' while it is not true; you have to store the original pointer to the string stream elsewere; also, we assume that the original stream is terminated with ''; also, it will discaard any sub-string that start with #, that is inteded for discard comments | |
int | EGioReadLine (char *const str, size_t const max_len, FILE *file) |
read a line from an input stream. | |
void | EGmvar (char *str, int nind, const char *header,...) |
create names with indices |
|
|
|
Value: ({\ const char*__EGsfile = (__file);\ const char*__EGsmode = (__mode);\ FILE*__EGsFILE = fopen(__EGsfile,__EGsmode);\ if(!__EGsFILE)\ {\ const int __EGserrno = errno;\ fprintf(stderr,"fopen() failed with error code %d, error\n%s",__EGserrno,strerror(__EGserrno));\ MESSAGE(0,"Could not open %s with mode %s", __EGsfile, __EGsmode);\ exit(__EGserrno);\ }\ __EGsFILE;})
|
|
type of functions for display, receives a void* to the structure to print, and a *FILE where to output
|
|
type of functions for display, receives a void* to the structure to print, a *FILE where to output, and a set of offsets for datas, the length of that array must be know by the user.
|
|
display function for strings
|
|
this discard all lines starting with comments and stores the next leading line in current and the next token in next, we assume that next does not contain data, and that current store the remainings of the current line
Definition at line 173 of file eg_io.c. Here is the call graph for this function: ![]() |
|
Given a string 'input' this function uses EGioParse to separate up to N words in it, we assume that argc is an array of pointers to strings of size N, and note that the input array will be changed.
Definition at line 57 of file eg_io.c. Here is the call graph for this function: ![]() |
|
given two *pointers 'next' and 'current' and a constant set of strings (parse delimiters), it store in 'next the next meaningfull string, and in current the rest of the secuence, the idea is to iterate over 'next' while it is not true; you have to store the original pointer to the string stream elsewere; also, we assume that the original stream is terminated with ''; also, it will discaard any sub-string that start with #, that is inteded for discard comments
|
|
read a line from an input stream.
|
|
create names with indices
|