1.5.1
CCC
 
io.hpp File Reference
#include "gstlearn_export.hpp"
#include <stdarg.h>
#include <stdio.h>

Functions

GSTLEARN_EXPORT int _file_read (FILE *file, const char *format, va_list ap)
 
GSTLEARN_EXPORT int _file_get_ncol (FILE *file)
 
GSTLEARN_EXPORT void _file_delimitors (char del_com, const char *del_sep, char del_blk)
 
GSTLEARN_EXPORT FILE * _file_open (const char *filename, int mode)
 
GSTLEARN_EXPORT int _record_read (FILE *file, const char *format,...)
 
GSTLEARN_EXPORT int _buffer_read (char **buffer, const char *format, va_list ap)
 
GSTLEARN_EXPORT void _file_write (FILE *file, const char *format, va_list ap)
 
GSTLEARN_EXPORT void _buffer_write (char *buffer, const char *format, va_list ap)
 
GSTLEARN_EXPORT void _lire_string (const char *question, int flag_def, const char *valdef, char *answer)
 
GSTLEARN_EXPORT int _lire_int (const char *question, int flag_def, int valdef, int valmin, int valmax)
 
GSTLEARN_EXPORT double _lire_double (const char *question, int flag_def, double valdef, double valmin, double valmax)
 
GSTLEARN_EXPORT int _lire_logical (const char *question, int flag_def, int valdef)
 
GSTLEARN_EXPORT void _erase_current_string (void)
 

Function Documentation

◆ _buffer_read()

GSTLEARN_EXPORT int _buffer_read ( char **  buffer,
const char *  format,
va_list  ap 
)

Read the next token from the buffer

Returns
-1 if the end-of-record has been found
1 for a decoding error
0 otherwise
Parameters
[in]bufferBuffer to be read
[in]formatformat
[out]apva_list containing the read variables

This method is not documented on purpose. It should remain private

◆ _buffer_write()

GSTLEARN_EXPORT void _buffer_write ( char *  buffer,
const char *  format,
va_list  ap 
)

Write the next token into the buffer

Parameters
[in]bufferWriting buffer
[in]formatEncoding format
[in]apva_list to be written

This method is not documented on purpose. It should remain private

◆ _erase_current_string()

GSTLEARN_EXPORT void _erase_current_string ( void  )

Erase the current decoding string

This method is not documented on purpose. It should remain private

◆ _file_delimitors()

GSTLEARN_EXPORT void _file_delimitors ( char  del_com,
const char *  del_sep,
char  del_blk 
)

Define the file delimitors

Parameters
[in]del_comDelimitor for comments
[in]del_sepDelimitor for separator
[in]del_blkDelimitor for blank

This method is not documented on purpose. It should remain private

◆ _file_get_ncol()

GSTLEARN_EXPORT int _file_get_ncol ( FILE *  file)

Get the number of tokens in the line

Returns
Number of tokens
Parameters
[in]fileFILE structure

This method is not documented on purpose. It should remain private

◆ _file_open()

GSTLEARN_EXPORT FILE* _file_open ( const char *  filename,
int  mode 
)

Open an ASCII file

Returns
FILE returned pointer
Parameters
[in]filenameLocal file name
[in]modetype of file (OLD or NEW)

This method is not documented on purpose. It should remain private

◆ _file_read()

GSTLEARN_EXPORT int _file_read ( FILE *  file,
const char *  format,
va_list  ap 
)

Read the next token from the file

Returns
-1 if the end-of-file has been found
1 for a decoding error
0 otherwise
Parameters
[in]fileFILE structure
[in]formatformat
[in]apValue to be read

This method is not documented on purpose. It should remain private

◆ _file_write()

GSTLEARN_EXPORT void _file_write ( FILE *  file,
const char *  format,
va_list  ap 
)

Write the next token from the file

Parameters
[in]fileFILE structure
[in]formatEncoding format
[in]apValue to be written

This method is not documented on purpose. It should remain private

◆ _lire_double()

GSTLEARN_EXPORT double _lire_double ( const char *  question,
int  flag_def,
double  valdef,
double  valmin,
double  valmax 
)

Read a double value

Returns
Double value
Parameters
[in]questionQuestion to be asked
[in]flag_def1 if the default is authorized; 0 otherwise
[in]valdefDefault value or TEST
[in]valminMinimum authorized value or TEST
[in]valmaxMaximum authorized value or TEST

This method is not documented on purpose. It should remain private

◆ _lire_int()

GSTLEARN_EXPORT int _lire_int ( const char *  question,
int  flag_def,
int  valdef,
int  valmin,
int  valmax 
)

Read an integer value

Returns
Integer value
Parameters
[in]questionQuestion to be asked
[in]flag_def1 if the default is authorized; 0 otherwise
[in]valdefDefault value or ITEST
[in]valminMinimum authorized value or ITEST
[in]valmaxMaximum authorized value or ITEST

This method is not documented on purpose. It should remain private

◆ _lire_logical()

GSTLEARN_EXPORT int _lire_logical ( const char *  question,
int  flag_def,
int  valdef 
)

Read a boolean answer

Returns
Integer value: 1 for 'yes' and 0 for 'no'
Parameters
[in]questionQuestion to be asked
[in]flag_def1 if the default is authorized; 0 otherwise
[in]valdefDefault value (0 for NO and 1 for YES)

This method is not documented on purpose. It should remain private

◆ _lire_string()

GSTLEARN_EXPORT void _lire_string ( const char *  question,
int  flag_def,
const char *  valdef,
char *  answer 
)

Read astring

Parameters
[in]questionQuestion to be asked
[in]flag_def1 if the default is authorized; 0 otherwise
[in]valdefDefault string
[out]answerAnswering string

This method is not documented on purpose. It should remain private

◆ _record_read()

GSTLEARN_EXPORT int _record_read ( FILE *  file,
const char *  format,
  ... 
)

Read the next record

Returns
Error return code
Parameters
[in]filePointer to the file to be read
[in]formatEncoding format
[in]...Value to be written

This method is not documented on purpose. It should remain private