SIFEL/GEFEL/iotools.cpp File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <ctype.h>
#include "iotools.h"
#include "stacktrace.h"

Go to the source code of this file.

Functions

long a_fmt_skips_whitespaces (char *fmt)
 function determines whether the a format skips the initial whitespace characters including
and
long check_asterisk (const char *fmt)
 function searches assignment suppression character in format string
long check_feof_eos (XFILE *in)
 function checks end of file and end of section
long check_maxlnsize (XFILE *in, long fbr)
long check_newline_fmt (char *fmt)
 function checks whether the '
' character is included in the accepted set of characters for format "%[...]"
long checkenumerr (XFILE *in, long ret, long reqret, long war, kwdset *akwdset, const char *fmt, char *subfmt, long idt, const char *ptype, const char *errfile, int errline, const char *errfunc)
 function searches for errors which occured during m conversion in xfscanf function and eventually prints the error message
void checkeos (XFILE *in, char *fmt, long idt, char *ptype, char *subfmt, char *types, void *apar, char *errfile, int errline, const char *errfunc)
 checks file for end of section
void checkfeof (XFILE *in, const char *fmt, long idt, const char *ptype, char *subfmt, char *types, void *apar, const char *errfile, int errline, const char *errfunc)
 function detects end of file and eventually prints the error message
long checkfmt (const char *fmt)
 function returns number of located conversions in the format string
long checkint (const char *lnstr)
 function checks string for integer number
long checkouint (const char *lnstr)
 function checks string for unsigned integer number in octal notation
long checkreal (const char *lnstr)
 function checks string for real number
long checkscanferr (XFILE *in, long ret, long reqret, long war, const char *partmsg, const char *fmt, char *subfmt, long idt, const char *ptype, const char *errfile, int errline, const char *errfunc)
 function searches for errors which occured during xfscanf function and eventually prints the error message
long checkuint (const char *lnstr)
 function checks string for unsigned integer number
long checkxuint (const char *lnstr)
 function checks string for unsigned integer number in hexadecimal notation
void clearcomments (char *lnstr)
 function removes commented part of string
void cut_str_sec (XFILE *in, char *lnstr)
long detect_multln (char *astr)
 function detects connecting character '@' for multiline string at the end of the of the astr
void filename_decomposition (const char *file, char *&path, char *&name, char *&suffix)
 function decomposes the file name to strings with path, filename and suffix
long get_modif (const char *fmt, const char *pconv, const char *modif, int modifl)
 returns status of the conversion modifier in the format string
long get_num_args (const char *fmt, char **ptypes, char *types, long nvar, long fmtl)
long getenum (const char *lnstr, kwdset *akwdset, int *apar, unsigned int &br, long &war, int handling, long ignorecase)
 functions handles the enum reading (m conversion) in xfscanf function
long getkwd (XFILE *in, char *lnstr, char *&aptr, char *apar, unsigned int &br)
 functions searches for keyword in a string in xfscanf function
long getkwd_opt (XFILE *in, char *lnstr, char *&aptr, char *apar, unsigned int &br)
long getkwd_sect (XFILE *in, char *lnstr, char *&aptr, char *apar, long detect_allkwd)
 functions searches for keyword in a string for given section in xfscanf function
void getsubfmt (const char *fmt, char *subfmt, char **pconv, long bc)
 function assembles single conversion from the format string
void getsubfmt (const char *fmt, char *subfmt, long bc)
 function assembles single conversion from the format string
void gettypes (char *fmt, char *types, char **ptypes, long nvar)
 function searches conversions in format string
long isemptystr (const char *lnstr, const char *filter)
 function checks string if it contains only the characters specified in filter - primary for whitespaces
char * locate_kwd (char *lnstr, const char *kwd, long ignorecase, long &noc)
 function loactes keyword in the given string
long matchekwd (const char *ekwd, kwdset *akwdset, int *apar, long ignorecase)
 function searches for enum keywords in given string
long matchekwdint (int *apar, kwdset *akwdset)
 function searches for enum integer id in given string
void par_print_err (int n, const char *pname, const char *emsg, const char *errfile, int errln, const char *errfunc,...)
 function prints error message to standard error output device for parallel executions, format specifiers are allowed in emsg
void par_print_err (int n, const char *emsg, const char *errfile, int errln, const char *errfunc,...)
 function prints error message to standard error output device for parallel executions, format specifiers are allowed in emsg
void print_err (const char *emsg, const char *errfile, int errln, const char *errfunc,...)
 function prints error message to standard error output device, format specifiers are allowed in emsg
void print_warning (const char *wmsg, const char *warnfile, int warnln, const char *warnfunc,...)
 function prints warning message to standard error output device, format specifiers are allowed in wmsg
long proc_new_ln_fmt (XFILE *out, const char *fmt)
 processes new line characters and line numbers in the xfprintf function
char * proc_ord_fmt (XFILE *in, char *fmt, char *fmt_end, char *lnstr, char *&astr)
 function reads the ordinary format characters contained in the format substring fmt from the file in
long skip_space (XFILE *in, char *lnstr, char *&astr)
 function skips the blank characters in the file in
void skipline (XFILE *in)
 function skips rest of actual line and moves to the next line
const char * strstr (const char *haystack, const char *needle, long ignorecase)
 function finds the first occurence of substring needle in the string haystack
char * strstr (char *haystack, const char *needle, long ignorecase)
const char * strstrcis (const char *haystack, const char *needle)
char * strstrcis (char *haystack, const char *needle)
 function finds the first occurence of substring needle in the string haystack, the case of characters is ignored
void xf_copysec (XFILE *f, FILE *out)
 copies content of the actual section to the text file
void xf_resetsec (XFILE *f)
 function resets internal pointer of the given file to the beginning of the actual section
long xf_setsec (XFILE *f, long sec_id)
 set section given by internal section index of the file
long xf_setsec (XFILE *f, enumstr sec_alias)
 set section given by enumstr
int xfclose (XFILE *&f)
 function closes file of XFILE type
long xfdetect_sect (XFILE *f, const kwdset &kwdb, const kwdset &kwde)
 function detects sections defined by sets of beginning and end keywords
XFILExfopen (const char *name, const char *mode)
 function opens file of XFILE type
int xfprintf (XFILE *out, char *fmt,...)
int xfscanf (XFILE *in, char *fmt,...)
 extended fscanf function

Function Documentation

long a_fmt_skips_whitespaces ( char *  fmt  ) 

function determines whether the a format skips the initial whitespace characters including
and

The function checks whether the a format skips the initial white space characters including and
. If the format looks like a , %a , *a or *a where # is an integer number than it matches even empty strings. If the format type contains whitespaces between '' and conversion specifier (% a , * a, % a or * a) only non-empty strings can be matched and the initial whitespaces will be skipped.

Parameters:
fmt - format string starting with a conversion
Return values:
0 - the a format matches even empty strings
1 - the a format does not match empty strings

Created by Tomas Koudelka, 03.2012

Definition at line 3756 of file iotools.cpp.

References print_err().

Referenced by xfscanf().

long check_asterisk ( const char *  fmt  ) 

function searches assignment suppression character in format string

Function checks for asterisk chracter which suppresses following conversion assignment

Parameters:

Parameters:
fmt - format string
Return values:
0 - no asignment suppression was found
1 - assignment suppression was detected

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 2098 of file iotools.cpp.

References print_err().

Referenced by xfscanf().

long check_feof_eos ( XFILE in  ) 

function checks end of file and end of section

Function checks opened file in for end of file and end of section (only for sect_mode_seq, sect_mode_fwd, sect_mode_full and sect_mode_ignore).

Parameters:

Parameters:
in - pointer to the structure XFILE with opened text file for reading
Return values:
0 - no end of file nor end of section were encountered
1 - end of file or end of section were encountered

created 04.2011, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 2516 of file iotools.cpp.

References XFILE::asect, xfsection::end_secln, xfsection::end_secpos, XFILE::file, ignore, XFILE::kwdmode, XFILE::line, line_mode, and sequent_mode.

Referenced by xfscanf().

long check_maxlnsize ( XFILE in,
long  fbr 
)

Function checks maximum length of read line. It is used in xfscanf function after new line reading. The function setup flag in the XFILE structure in case the line length was exceeded.

Parameters:

Parameters:
in - pointer to the structure XFILE with opened text file for reading
fbr - number of read characters
Return values:
0 - line size is O.K.
1 - line size was exceeded
Returns:
In addition to that, the function sets flag of parameter 'in' in case the line size was exceeded.

Created 11.2009, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 2138 of file iotools.cpp.

References XFILE::file, XFILE::fname, XFILE::give_maxlnsize(), XFILE::line, XFILE::maxlnover, print_err(), print_warning(), and XFILE::warning.

Referenced by skip_space(), xf_resetsec(), and xfscanf().

long check_newline_fmt ( char *  fmt  ) 

function checks whether the '
' character is included in the accepted set of characters for format "%[...]"

The function checks whether the '
' character is included in the accepted set of characters for format "%[...]".

Parameters:
fmt - sreached format string
Return values:
0 - the '
' character is not included in the format set
1 - the '
' character is included in the format set

Created 04.2011 by Tomas Koudelka

Definition at line 3682 of file iotools.cpp.

Referenced by xfscanf().

long checkenumerr ( XFILE in,
long  ret,
long  reqret,
long  war,
kwdset akwdset,
const char *  fmt,
char *  subfmt,
long  idt,
const char *  ptype,
const char *  errfile,
int  errline,
const char *  errfunc 
)

function searches for errors which occured during m conversion in xfscanf function and eventually prints the error message

Function checks for errors during enum conversion.

Parameters:

Parameters:
in - pointer to the structure XFILE with opened text file for reading
ret - returned value from the scanf function
reqret - required returned value from the scanf function which was excepted
war - warning indicator (0=warning ignored/ 1=warning / 2=warning considered as error)
akwdset - pointer to class which contains set of aliases keywords and corresponding integer values

Following parameters are used only for error message

Parameters:
fmt - format string
idt - index of actually processed conversion in fmt
ptype - pointer to the actual conversion
subfmt - string for subformat
errfile - string with source file name where the error was detected
errline - line number in source file where the error was detected
errfunc - string with function name where the error was detected
Return values:
0 - enum integer was not found
1 - enum integer was successfully scanned

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 3224 of file iotools.cpp.

References enumstr::alias, XFILE::col, XFILE::fname, getsubfmt(), enumstr::id, XFILE::line, kwdset::n, print_err(), print_warning(), kwdset::set, and XFILE::warning.

Referenced by xfscanf().

void checkeos ( XFILE in,
char *  fmt,
long  idt,
char *  ptype,
char *  subfmt,
char *  types,
void *  apar,
char *  errfile,
int  errline,
const char *  errfunc 
)

checks file for end of section

Function checks opened file in for end of section (only for sect_mode_seq, sect_mode_fwd, sect_mode_full and sect_mode_ignore).

Parameters:

Parameters:
in - pointer to the structure XFILE with opened text file for reading Following parameters are used only for error message
fmt - format string
idt - index of actually processed conversion in fmt
ptype - pointer to the actual conversion
subfmt - string for subformat
types - array of types of particular conversions
apar - pointer to storage parameter for actual conversion
errfile - string with source file name where the error was detected
errline - line number in source file where the error was detected
errfunc - string with function name where the error was detected
Returns:
Function does not return anything.

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 2460 of file iotools.cpp.

References enumstr::alias, XFILE::asect, XFILE::col, xfsection::end_secln, xfsection::end_secpos, XFILE::file, XFILE::fname, getsubfmt(), ignore, XFILE::kwdmode, XFILE::line, line_mode, xfsection::name, print_err(), and sequent_mode.

Referenced by xfscanf().

void checkfeof ( XFILE in,
const char *  fmt,
long  idt,
const char *  ptype,
char *  subfmt,
char *  types,
void *  apar,
const char *  errfile,
int  errline,
const char *  errfunc 
)

function detects end of file and eventually prints the error message

Function checks opened file in for end of file (EOF).

Parameters:

Parameters:
in - pointer to the structure XFILE with opened text file for reading Following parameters are used only for error message
fmt - format string
idt - index of actually processed conversion in fmt
ptype - pointer to the actual conversion
subfmt - string for subformat
types - array of types of particular conversions
apar - pointer to storage parameter for actual conversion
errfile - string with source file name where the error was detected
errline - line number in source file where the error was detected
errfunc - string with function name where the error was detected
Returns:
Function does not return anything.

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 2408 of file iotools.cpp.

References XFILE::col, XFILE::file, XFILE::fname, getsubfmt(), XFILE::line, and print_err().

Referenced by xfscanf().

long checkfmt ( const char *  fmt  ) 

function returns number of located conversions in the format string

returns number of conversion in the format string

Function scans for format conversions in the given string. The number of conversion is increased by one in case that the first character of the format string does not contain a conversion indicator (%). In such the case the beginning of the format string up to the first conversion indicator is considered as an individual conversion (It can be used for skipping initial spaces in the input file - adding initial space before conversion indicator - " %a", simple keyword management "keyword %ld" etc.; see description of scanf function for handling of nonconversion charcaters.) Syntax of format string is the same as in the standard scanf function.

Parameters:

Parameters:
fmt - pointer to opened XFILE structure
Returns:
The function returns number of located conversions.

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 1826 of file iotools.cpp.

Referenced by xfprintf(), and xfscanf().

long checkint ( const char *  lnstr  ) 

function checks string for integer number

Function checks string lnstr for integer value

Parameters:
lnstr - input string
Return values:
0 - only permited characters was found for integer
1 - nonpermited character was found

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 2193 of file iotools.cpp.

Referenced by getenum(), and xfscanf().

long checkouint ( const char *  lnstr  ) 

function checks string for unsigned integer number in octal notation

Function checks string lnstr for unsigned integer value given by the octal notation.

Parameters:

Parameters:
lnstr - input string
Return values:
0 - only permited characters was found for integer
1 - nonpermited character was found

created 8.2014, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 2265 of file iotools.cpp.

Referenced by xfscanf().

long checkreal ( const char *  lnstr  ) 

function checks string for real number

Function checks string lnstr for real number value

Parameters:

Parameters:
lnstr - input string
Return values:
0 - only permited characters was found for integer
1 - nonpermited character was found

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 2337 of file iotools.cpp.

Referenced by xfscanf().

long checkscanferr ( XFILE in,
long  ret,
long  reqret,
long  war,
const char *  partmsg,
const char *  fmt,
char *  subfmt,
long  idt,
const char *  ptype,
const char *  errfile,
int  errline,
const char *  errfunc 
)

function searches for errors which occured during xfscanf function and eventually prints the error message

Function checks opened file in for error generated by scanf function.

Parameters:

Parameters:
in - pointer to the structure XFILE with opened text file for reading
ret - returned value from the scanf function
reqret - required returned value from the scanf function which was excepted
war - warning indicator (0=warning ignored/ 1=warning / 2=warning considered as error)
partmsg - string with part of error message

Following parameters are used only for error message

Parameters:
fmt - format string
idt - index of actually processed conversion in fmt
ptype - pointer to the actual conversion
subfmt - string for subformat
errfile - string with source file name where the error was detected
errline - line number in source file where the error was detected
errfunc - string with function name where the error was detected
Return values:
0 - no error was encountered
1 - error was encountered

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 2593 of file iotools.cpp.

References XFILE::col, XFILE::fname, getsubfmt(), XFILE::line, print_err(), print_warning(), and XFILE::warning.

Referenced by xfscanf().

long checkuint ( const char *  lnstr  ) 

function checks string for unsigned integer number

Function checks string lnstr for unsigned integer value

Parameters:

Parameters:
lnstr - input string
Return values:
0 - only permited characters was found for integer
1 - nonpermited character was found

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 2229 of file iotools.cpp.

Referenced by xfscanf().

long checkxuint ( const char *  lnstr  ) 

function checks string for unsigned integer number in hexadecimal notation

Function checks string lnstr for unsigned integer value given by the hexadecimal notation.

Parameters:

Parameters:
lnstr - input string
Return values:
0 - only permited characters was found for integer
1 - nonpermited character was found

created 8.2014, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 2301 of file iotools.cpp.

Referenced by xfscanf().

void clearcomments ( char *  lnstr  ) 

function removes commented part of string

removes comments from the string

Function removes commented characters from the string. The '#' character is assumed to be beginning of commented part of string.

Parameters:

Parameters:
lnstr - pointer to opened XFILE structure
Returns:
The function does not return anything.

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 1791 of file iotools.cpp.

Referenced by getgkwid(), getkwd_sect(), getnprop(), skip_space(), xf_resetsec(), xfdetect_sect(), and xfscanf().

void cut_str_sec ( XFILE in,
char *  lnstr 
)

Function cuts string lnstr depending on the end of actually selected section.

Parameters:

Parameters:
in - pointer to the structure XFILE with opened text file for reading
lnstr - input string
Returns:
Function does not return anything.

created 2.2008, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 2551 of file iotools.cpp.

References XFILE::asect, xfsection::end_seccol, xfsection::end_secln, ignore, XFILE::kwdmode, XFILE::line, line_mode, and sequent_mode.

Referenced by getkwd_sect(), skip_space(), xf_resetsec(), and xfscanf().

long detect_multln ( char *  astr  ) 

function detects connecting character '@' for multiline string at the end of the of the astr

The function searches an occurence of the connecting character '@' in the string astr. The connecting character is searched from the end of astr and only blank characters may precede it. It is used for the detection of multiline strings. If the connecting '@' is found then it is replaced by '
'

Parameters:
astr - pointer to the string terminated by
Return values:
0 - no connecting character was found at the end of string
1 - connecting character was found at the end of string

Created by Tomas Koudelka, 08.2011

Definition at line 3722 of file iotools.cpp.

Referenced by xfscanf().

void filename_decomposition ( const char *  file,
char *&  path,
char *&  name,
char *&  suffix 
)

function decomposes the file name to strings with path, filename and suffix

Function decomposes name of file(with path) to path,filename and suffix. ppp/ppp/fff.fff.sss -> path = "ppp/ppp" , name = "fff.fff" , suffix = ".sss"

Parameters:
file - decomposed name of file
path,name,suffix - components of name of file (output)
Returns:
The function returns pointers to decomposed parts in the parameters path, name and suffix for which the memory was allocated.

Created by Ladislav Svoboda, 1.4.2003, termit@cml.fsv.cvut.cz

Definition at line 3792 of file iotools.cpp.

Referenced by stochdriver::diagpostproc(), mefel_init(), metr_init(), newton_raphson_parcoupl_nonlin_new(), newton_raphson_parcoupl_nonlin_old(), outdrivert::print_graphics(), outdriverm::print_graphics(), outdrivert::print_graphics_forced(), print_init(), print_initt(), loadcaset::read(), adaptivityt::readinit(), adaptivity::readinit(), and trfel_init().

long get_modif ( const char *  fmt,
const char *  pconv,
const char *  modif,
int  modifl 
)

returns status of the conversion modifier in the format string

The function checks for the required conversion modifier given by the modif argument in the format string fmt.

Parameters:
fmt - format string with only one conversion
pconv - pointer to the conversion character
modif - pointer to a string with the given conversion modifier
modifl - length of the modif string
Return values:
0 - no corresponding modifier was found
1 - the given modifier was found

Created by Tomas Koudelka, 11.8.2014, koudelka@cml.fsv.cvut.cz

Definition at line 1695 of file iotools.cpp.

References strstr().

Referenced by xfprintf().

long get_num_args ( const char *  fmt,
char **  ptypes,
char *  types,
long  nvar,
long  fmtl 
)

The function checks for presence of variable width of string conversion s in the whole format string.

Parameters:
fmt - a format string
ptypes - array of pointers to tokens of the parsed format string fmt
types - array of conversion types
nvar - length of array types and ptypes
fmtl - length of string fmt
narg - the total number of expected arguments by the given conversion types

Definition at line 1731 of file iotools.cpp.

References getsubfmt(), memset(), and print_err().

long getenum ( const char *  lnstr,
kwdset akwdset,
int *  apar,
unsigned int &  br,
long &  war,
int  handling,
long  ignorecase 
)

functions handles the enum reading (m conversion) in xfscanf function

Function scans lnstr for enum type. Possible aliases for given enum are stored in the akwdset.

Parameters:

Parameters:
lnstr - string scanned for keyword
akwdset - pointer to class containing keyword set and set of corresponding integer values which are perimtted for given enum
apar - pointer to the integer argument to which the detected enum integer value will be assigned
br - output parameter which the read bytes are stored in
war - output parameter which the warning flag is stored in
handling - this parameter controls scanning for keyword = 0 - ignore akwdset -> do not scan for aliases keywords != 0 - scan either for possible keywords or for the integer id
ignorecase - flag for case insensitivity (=1)/ case sensitivity (=0)
Return values:
1 - enum was successfully scanned
2 - cannot read integer value of enum
3 - scanned integer value of enum was not found in akwdset
4 - nor enum keyword nor integer value of enum was read

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 3046 of file iotools.cpp.

References checkint(), ignore, matchekwd(), and matchekwdint().

Referenced by xfscanf().

long getkwd ( XFILE in,
char *  lnstr,
char *&  aptr,
char *  apar,
unsigned int &  br 
)

functions searches for keyword in a string in xfscanf function

Function scans lnstr for keyword. Required keyword is given by apar string.

Parameters:

Parameters:
in - pointer to the structure XFILE with opened text file for reading
lnstr - string with line scanned for keyword
aptr - actual position in lnstr string where should scanning start
apar - string with required keyword
br - output parameter in which the read bytes are stored
Return values:
0 - keyword was successfully found
1 - keyword was not found
2 - multiple keyword detection in lnstr in case line_mode handling
3 - invalid keyword is required (zero length of keyword string)

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 2648 of file iotools.cpp.

References getkwd_sect(), ignore, XFILE::ignorecase, XFILE::kwdmode, line_mode, memset(), print_err(), sect_mode_full, sect_mode_fwd, sect_mode_ignore, sect_mode_seq, sequent_mode, and strstr().

Referenced by xfscanf().

long getkwd_opt ( XFILE in,
char *  lnstr,
char *&  aptr,
char *  apar,
unsigned int &  br 
)

Function scans lnstr for keyword. Required keyword is given by apar string.

Parameters:

Parameters:
in - pointer to the structure XFILE with opened text file for reading
lnstr - string with line scanned for keyword
aptr - actual position in lnstr string where should scanning start
apar - string with required keyword
br - output parameter in which the read bytes are stored
Return values:
0 - keyword was successfully found
1 - keyword was not found
2 - multiple keyword detection in lnstr in case line_mode handling
3 - invalid keyword is required (zero length of keyword string)

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 2938 of file iotools.cpp.

References getkwd_sect(), ignore, XFILE::ignorecase, XFILE::kwdmode, line_mode, memset(), print_err(), sect_mode_full, sect_mode_fwd, sect_mode_ignore, sect_mode_seq, sequent_mode, and strstr().

long getkwd_sect ( XFILE in,
char *  lnstr,
char *&  aptr,
char *  apar,
long  detect_allkwd 
)

functions searches for keyword in a string for given section in xfscanf function

Function scans acutal section of file in for given keyword and return number of located keywords. If the lnstr == NULL, the function is supposed tobe called outside from the xfscanf, otherwise it is supposed to be called by the xfscanf. At the function entry it is supposed:

  • in->line in->col have to be correct actual line and column number
  • in->lnfpos has to be correct file position of the actual line beginning
  • file poition (ftell) corresponds to the last character on the actual line before
    if called from xfscanf (lnstr != NULL):
  • content of lnstr may be changed so that it contains line with the first keyword occurence
  • aptr is changed so that it points OVER the first located keyword
  • in->line, in->col are changed so that it points OVER the first located keyword
  • in->lnfpos file position of the actual line beginning
  • position in file is set (fseek) to the end of actual line before
    if called externally (lnstr == NULL):
  • lnstr and aptr are unchanged
  • in->line, in->col are changed so that it points TO THE FIRST character of first located keyword
  • in->lnfpos file position of the actual line beginning
  • position in file is set (fseek) to the end of actual line before

Parameters:

Parameters:
in - pointer to the structure XFILE with opened text file for reading
lnstr - string scanned for keyword used in the xfscanf
aptr - actual position in lnstr string where scanning should start
apar - string with required keyword
detect_allkwd - flag for detection of all keyword occurences(=1) or only the firstkeyword occurence (=0).
Returns:
number of suceffully located keywords

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz modified 11.9. 2013, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 2774 of file iotools.cpp.

References XFILE::asect, clearcomments(), XFILE::col, cut_str_sec(), xfsection::end_secln, XFILE::file, XFILE::give_maxlnsize(), XFILE::id_sec, XFILE::ignorecase, XFILE::index_created, isemptystr(), XFILE::kwdmode, XFILE::line, XFILE::lnfpos, XFILE::lnstr, locate_kwd(), XFILE::num_sec, print_err(), sect_mode_full, sect_mode_fwd, sect_mode_seq, and xf_resetsec().

Referenced by getkwd(), getkwd_opt(), input_elem_crsec(), input_elem_crsect(), input_elem_edgebc(), input_elem_eigstr(), input_elem_eltimefunc(), input_elem_eltimefunct(), input_elem_lcs(), input_elem_load(), input_elem_loadedge(), input_elem_loadsurf(), input_elem_loadvol(), input_elem_mat(), input_elem_matt(), input_elem_sourcet(), input_elem_surfbc(), input_elem_type(), input_elem_typet(), input_elem_vertbc(), input_nod_bocon(), input_nod_bocont(), input_nod_coupl_dofs(), input_nod_coupl_dofst(), input_nod_crsec(), input_nod_crsect(), input_nod_dof_tfunc(), input_nod_dof_tfunct(), input_nod_initcond(), input_nod_initcondt(), input_nod_lcs(), input_nod_load(), input_nod_ndof(), input_nod_sourcet(), input_nod_springs(), input_nod_tdload(), and input_nod_temper().

void getsubfmt ( const char *  fmt,
char *  subfmt,
char **  pconv,
long  bc 
)

function assembles single conversion from the format string

Function assembles one beginning conversion from the format string and copies it to the subfmt string. If the bc flag is set up than the byte count conversion (n) is appended to subformat string. Additionally, it returns pointer to the conversion type character in the subfmt string.

Parameters:

Parameters:
fmt - format string
subfmt - subformat string (output parameter)
pconv - pointer to the conversion type character in the subfmt string (output parameter)
bc - byte count flag whether n is appended to the subformat string (bc=1) or not (bc=0).
Returns:
The function does not return anything but sets arguments subfmt and pconv.

created 11.8.2014, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 1946 of file iotools.cpp.

References memset(), and print_err().

void getsubfmt ( const char *  fmt,
char *  subfmt,
long  bc 
)

function assembles single conversion from the format string

Function assembles one beginning conversion from the format string and copies it to the subfmt string. If the bc flag is set up than the byte count conversion (n) is appended to subformat string.

Parameters:

Parameters:
fmt - format string
subfmt - subformat string
bc - byte count flag whether n is appended to the subformat string (bc=1) or not (bc=0).
Returns:
The function does not return anything.

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 1872 of file iotools.cpp.

References memset(), and print_err().

Referenced by checkenumerr(), checkeos(), checkfeof(), checkscanferr(), get_num_args(), gettypes(), xfprintf(), and xfscanf().

void gettypes ( char *  fmt,
char *  types,
char **  ptypes,
long  nvar 
)

function searches conversions in format string

Function extracts particular conversions from the format string fmt and copies their base character to the array types. In addition, the function stores pointers to the beginign of each conversion in the ptypes array.

Parameters:

Parameters:
fmt - format string
types - array with base characters of particular conversions
ptypes - array of pointers to beginning of particular conversions in the format string fmt
nvar - number of required variables
Returns:
The function does not return anything.

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 2027 of file iotools.cpp.

References getsubfmt().

Referenced by xfprintf(), and xfscanf().

long isemptystr ( const char *  lnstr,
const char *  filter 
)

function checks string if it contains only the characters specified in filter - primary for whitespaces

Function checks string lnstr contains only set of chracters defined by the string filter Usually in this file, the filter contains whitespace characters and the function detects 'empty' string.

Parameters:

Parameters:
lnstr - input string
Return values:
1 - string contains only characters from the filter set
0 - string contains even other characters than the ones from the filter set

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 2374 of file iotools.cpp.

Referenced by getkwd_sect(), and xfscanf().

char* locate_kwd ( char *  lnstr,
const char *  kwd,
long  ignorecase,
long &  noc 
)

function loactes keyword in the given string

Function locates the first occurence of keyword given by kwd in the string (line) given by lnstr. Total number of occurences is returned via noc.

Parameters:

Parameters:
lnstr - pointer to scanned string
kwd - pointer to searched string
ignorecase - flag for case insensitivity (=1)/ case sensitivity (=0)
noc - number of occurences of searched keyword in lnstr
Returns:
The function returns either pointer to the first occurence of keyword in the lnstr or NULL in case that the keyword was not found.

created 02.2008, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 244 of file iotools.cpp.

References strstr().

Referenced by getkwd_sect(), and xfdetect_sect().

long matchekwd ( const char *  ekwd,
kwdset akwdset,
int *  apar,
long  ignorecase 
)

function searches for enum keywords in given string

Function searches aliases keywords in the string. (used for enum conversion)

Parameters:

Parameters:
ekwd - string with required keyword
akwdset - pointer to class which contains set of aliases keywords and corresponding integer values
apar - output parameter (pointer to integer) to which the integer value of detected enum keyword will be assigned
ignorecase - flag for case insensitivity (=1)/ case sensitivity (=0)
Return values:
0 - enum keyword was not found
1 - enum keyword was successfully scanned

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 3131 of file iotools.cpp.

References enumstr::alias, enumstr::id, kwdset::n, kwdset::set, and strstr().

Referenced by getenum().

long matchekwdint ( int *  apar,
kwdset akwdset 
)

function searches for enum integer id in given string

Function searches aliases integers in the string. (used for enum conversion)

Parameters:

Parameters:
apar - searched integer value
akwdset - pointer to class which contains set of aliases keywords and corresponding integer values
Return values:
0 - enum integer was not found
1 - enum integer was successfully scanned

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 3182 of file iotools.cpp.

References enumstr::id, kwdset::n, and kwdset::set.

Referenced by getenum().

void par_print_err ( int  n,
const char *  pname,
const char *  emsg,
const char *  errfile,
int  errln,
const char *  errfunc,
  ... 
)

function prints error message to standard error output device for parallel executions, format specifiers are allowed in emsg

Function writes error on standard error output device.

Parameters:

Parameters:
n - number of processor
pname - name of processor
emsg - string with error message, one terminating character
will automatically added
errfile - string with source file name where the error was generated
errln - line number in source file where the error was generated
errfunc - string with function name where the error was generated
... - other parameters used in format string emsg passed to the vfprintf function
Returns:
Function does not return anything.

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 120 of file iotools.cpp.

void par_print_err ( int  n,
const char *  emsg,
const char *  errfile,
int  errln,
const char *  errfunc,
  ... 
)

function prints error message to standard error output device for parallel executions, format specifiers are allowed in emsg

Function writes error on standard error output device.

Parameters:

Parameters:
n - number of processor
wmsg - string with error message, one terminating character
will automatically added
errfile - string with source file name where the error was generated
errln - line number in source file where the error was generated
errfunc - string with function name where the error was generated
... - other parameters used in format string emsg passed to the vfprintf function
Returns:
Function does not return anything.

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 88 of file iotools.cpp.

Referenced by fixnodesel::assemble_ltg_with_fixings(), partop::assemble_multip(), partop::assemble_nbnd_nind(), partop::assemble_nodmultip(), fixnodesel::create_master_graph(), partop::dofind_master(), fixnodesel::fixing_detection(), fixnodesel::give_whole_dim(), boundparcongrad::ilu_mat_petsc(), partop::initiation(), partopjk::ltg_conversion(), partop::ndofn_master(), partop::node_coarse_global_map(), partop::node_coarse_numbers(), partop::node_global_numbers(), par_solve_mefel_problem(), par_solve_metr_problem(), par_solve_trfel_problem(), parallel_solution_eigen_dynamics(), pmefel_init(), pmetr_init(), ptrfel_init(), partop::schur_ordering(), selnodes::selnodes(), and schurcompl::solve_red_sys().

void print_err ( const char *  emsg,
const char *  errfile,
int  errln,
const char *  errfunc,
  ... 
)

function prints error message to standard error output device, format specifiers are allowed in emsg

Function writes error on standard error output device, format specifiers are allowed.

Parameters:

Parameters:
emsg - string with error message and format specifiers, one terminating character
will automatically added
errfile - string with source file name where the error was generated
errln - line number in source file where the error was generated
errfunc - string with function name where the error was generated
... - other parameters used in format string emsg passed to the vfprintf function
Returns:
Function does not return anything.

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 25 of file iotools.cpp.

References stack_trace().

Referenced by gmatrix::a12block(), a_fmt_skips_whitespaces(), gmatrix::add_entry(), mechmat::add_macro_strains(), gmatrix::addgm(), addm(), addmultv(), addv(), lhsrhst::alloc(), lhsrhs::alloc(), gmatrix::alloc(), gtopology::alloc_elements(), gtopology::alloc_lnodes(), gtopology::alloc_nodes(), mechmat::alloc_nonmechq(), transmat::alloc_nontransq(), gtopology::alloc_phases(), allocim(), allocm(), allocv(), approx_slip_surf(), gtopology::approx_weights(), approximationcoup(), arclengthrv(), loadcaset::assemble(), loadcase::assemble(), dloadcase::assemble(), assemble_bclimcond(), assemble_bnodvalt(), assemble_coup(), transmat::assemble_dof_nameord(), loadcaset::assemble_flux(), seqtop::assemble_multip(), seqtop::assemble_nbnd_nind(), seqtop::assemble_nodmultip(), aggregator::assemble_smoothed_prol(), assemble_stiffness_matrix(), transmat::aux_values(), kunmat::aux_values(), gmatrix::auxdatsparsesolver(), nonlocplast::average(), nonlocdamg::average(), averageflux(), avercmat(), averdmat(), b3mat::b3_law(), gmatrix::back_incomplete_fact(), gmatrix::back_substitution(), beamel3d::beam_transf_matrix(), beamel2d::beam_transf_matrix(), comprow::bicg(), comprow::bicg_new(), bmatrix::bmatrix(), ortodamrot::brittle_damage(), ortodam::brittle_damage(), anisodamrot::brittle_damage(), anisodam::brittle_damage(), C60bazmat::C60baz_krg(), quadquadrilatt::capacity_matrix(), quadlineart::capacity_matrix(), linhext::capacity_matrix(), capacmat(), transmat::capcoeff(), multiph::cappress_check(), gelement::centroid(), densemat::cg(), comprow::cg(), comprow::cg_new(), symcomprow::cg_prec(), densemat::cg_prec(), comprow::cg_prec(), densemat::cg_prec_new(), stochdrivert::changecrsections(), gmatrix::changedecomp(), stochdrivert::changematerials(), radiationmat::changeparam(), isotrmat::changeparam(), damisotrmat::changeparam(), crsection3d::changeparam(), crsection2d::changeparam(), crsection1d::changeparam(), varelastisomat::changeparam(), splas1d::changeparam(), scaldam::changeparam(), mohrcoulombpar::changeparam(), mohrcoulomb::changeparam(), elastisomat::changeparam(), crsecplstr::changeparam(), crseclayer::changeparam(), crsec3d::changeparam(), crsec2dbeam::changeparam(), crsec2dbar::changeparam(), camclaycoup::changeparam(), camclay::changeparam(), check_asterisk(), adaptivityt::check_consistency(), adaptivity::check_consistency(), check_math_err(), check_math_errel(), check_maxlnsize(), check_reqsec(), check_reqsec_t(), checkenumerr(), checkeos(), checkfeof(), checkscanferr(), entitybocon::checkvar2coord(), kunmat::chm(), kunmat::cht(), kunmat::cmm(), kunmat::cmt(), cmulm(), cmulv(), gtopology::codenum_generation(), gfunct::compare(), mechmat::compnonloc_nlstresses(), gtopology::comptop(), rspecmat::compute_actual_ft(), rspecmat::compute_ages(), dplmat::compute_ages(), b3mat::compute_ages(), fixortodam::compute_eqdispl(), trlineart::compute_error(), quadlineart::compute_error(), adaptivityt::compute_error(), adaptivity::compute_error(), compute_ipstrains(), compute_ipstresses(), edget::compute_node_jump(), compute_nodeeqotherst(), compute_nodefluxes(), compute_nodegrads(), compute_nodeothers(), compute_nodeotherst(), compute_nodeotherst_comp(), compute_nodestrains(), compute_nodestresses(), med2::compute_othervalues(), med3::compute_othervalues(), med1::compute_othervalues(), med4::compute_othervalues(), patch_averaging::compute_patches_spr(), compute_req_val(), mechmat::computenlstresses(), mechmat::computenlstressesincr(), computestresses(), gmatrix::condense(), climatcond::condit_heat_flux(), climatcond2::condit_long_wave_radiat_flux(), climatcond::condit_long_wave_radiat_flux(), climatcond2::condit_rain_moisture_flux(), climatcond::condit_rain_moisture_flux(), climatcond2::condit_short_wave_radiat_flux(), climatcond::condit_short_wave_radiat_flux(), climatcond::condit_vapour_diffusion_moisture_flux(), climatcond::condit_vapour_diffusion_moisture_flux_salt(), quadquadrilatt::conductivity_matrix(), quadlineart::conductivity_matrix(), linhext::conductivity_matrix(), conductmat(), gnode::constr(), seqselnodes::contrib_dofs_cn(), seqselnodes::contrib_dofs_ln(), sel::conv_selprop(), gfunct::copy(), gmatrix::copygm(), copym(), copymultv(), copyv(), kunmat::CorD(), discmat::CorD(), cosav(), outdriverm::create_files_gidsp(), creep_aeging_strains(), creep_compute_actual_ym(), creep_compute_inital_ym(), creep_give_actual_ft(), creep_give_actual_ym(), creep_giveirrstrains(), creep_givestressincr(), creep_incrtotstresses(), creep_initmaterialmodel(), creep_matstiffchange(), creep_ncompo(), creep_nlstresses(), creep_nlstressesincr(), creep_number_rettimes(), creep_updateval(), crprd(), comprow::crxcv_cv(), mohrcoulomb::cutting_plane(), mechmat::cutting_plane(), mechmat::cutting_plane2(), transmat::cycle_detection(), ortodam::dam_eq_strain(), anisodamrot::dam_vol(), anisodam::dam_vol(), scaldam::damfuncpar(), mechmat::damfuncpar(), scaldam::damfunction(), mechmat::damfunction(), anisodam::daminc_vol(), damping_matrix(), tablefunct::datacheck(), gmatrix::dealloc(), gmatrix::decomp(), gmatrix::decompgmxv(), gmatrix::decompose_matrix(), mechtop::define_meaning(), tablefunct::derivative(), isotherm::derivative_inverse_isotherm_value(), isotherm::derivative_isotherm_value(), determine_dlambda(), detm(), mechmat::dfdqpar(), mechmat::dfdsigma(), mechmat::dfdsigmadq(), mechmat::dfdsigmadsigma(), mechmat::dgdqpar(), mechmat::dgdsigma(), mechmat::dgdsigmadq(), mechmat::dgdsigmadsigma(), mechmat::dhdgamma(), mechmat::dhdqpar(), mechmat::dhdsigma(), gmatrix::diag_check(), gmatrix::diag_scale(), gedge::direction_vector(), barelq3d::dirvect(), displincr(), distance2(), gnode::distance2(), seqselnodes::dof_feti(), mechmat::dstep_red_ip(), loadel::edgeload(), gtopology::edgenode_sorting(), mechmat::eigenstresses(), elem_eigstrain_forces(), elem_incr_internal_forces(), barel3d::elem_integration(), barel2d::elem_integration(), elem_integration_quant(), elem_internal_forces(), elem_intpointval(), elem_intpointval2(), elem_intpointvalt(), elem_local_values(), elem_mechq_nodval(), elem_mechq_nodval_comp(), elem_neumann_vector(), elem_newton_vector(), elem_nlstresses(), elem_nonloc_internal_forces(), elem_total_integral(), elem_total_integral_ip(), elem_transmission_flux(), elem_transq_nodval(), elem_transq_nodval_comp(), linhext::elem_volume(), elemvalues(), mechmat::elmatcompl(), varelastisomat::elmatstiff(), elastisomat::elmatstiff(), anisodamrot::elmatstiff(), anisodam::elmatstiff(), mechmat::elmatstiff(), endnodem::endnodem(), epressure_solver(), mechmat::epsefunction(), gmatrix::estim_spect_radius(), stochdrivert::exportvalues(), extractnegv(), stochdrivert::extractor(), extractposv(), fillcol(), fillrow(), find_extreme_ipstresses(), transmat::flux_contributions(), garclength(), multiph::gaspress_check(), gause(), gauss_points(), gauss_points_tet(), gauss_points_tr(), gemp(), densemat::gemp(), gen2delem::gen2delem(), bmatrix::gen_indices(), general_epressure(), gentensor_matrix(), kwdset::get_id(), get_num_args(), saltmat4::get_othervalue(), moistheatmat::get_othervalue(), kunmat::get_othervalue(), homogmat::get_othervalue(), discmat::get_othervalue(), dplmat::get_othervalue(), b3mat::get_othervalue(), dloadcase::get_pd(), kwdset::get_str(), grunewaldmat::get_transmission_flux_11(), discmat::get_transmission_flux_11(), kunmat::get_transmission_flux_hh(), moistheatmat::get_transmission_flux_tt(), kunmat::get_transmission_flux_tt(), homogmat::get_transmission_flux_tt(), bazpedmat::get_transmission_flux_tt(), saltmat4::get_transmission_flux_ww(), saltmat1::get_transmission_flux_ww(), homogmat::get_transmission_flux_ww(), bazpedmat::get_transmission_flux_ww(), grunewaldmat::get_transmission_nodval_11(), discmat::get_transmission_nodval_11(), moistheatmat::get_transmission_nodval_hh(), kunmat::get_transmission_nodval_hh(), moistheatmat::get_transmission_nodval_th(), kunmat::get_transmission_nodval_th(), moistheatmat::get_transmission_nodval_tt(), kunmat::get_transmission_nodval_tt(), homogmat::get_transmission_nodval_tt(), bazpedmat::get_transmission_nodval_tt(), homogmat::get_transmission_nodval_ww(), bazpedmat::get_transmission_nodval_ww(), grunewaldmat::get_transmission_transcoeff_11(), discmat::get_transmission_transcoeff_11(), moistheatmat::get_transmission_transcoeff_hh(), kunmat::get_transmission_transcoeff_hh(), moistheatmat::get_transmission_transcoeff_th(), kunmat::get_transmission_transcoeff_th(), moistheatmat::get_transmission_transcoeff_tt(), kunmat::get_transmission_transcoeff_tt(), homogmat::get_transmission_transcoeff_tt(), bazpedmat::get_transmission_transcoeff_tt(), homogmat::get_transmission_transcoeff_ww(), bazpedmat::get_transmission_transcoeff_ww(), tablefunct::getderiv(), gfunct::getderiv(), gfunct::getinvderiv(), tablefunct::getinvval(), gfunct::getinvval(), getkwd(), getkwd_opt(), getkwd_sect(), getsubfmt(), pvalt::getval(), entitybocon::getval(), dloadn::getval(), tablefunct::getval(), gfunct::getval(), tablefunct::getval3(), gfunct::getval_long(), gfmatrix::gfmatrix(), gfunct::gfunct(), mechmat::give_actual_fc(), timeswmat::give_actual_ft(), creep_effym::give_actual_ft(), mechmat::give_actual_ft(), timeswmat::give_actual_nu(), mechmat::give_actual_nu(), ortodamrot::give_actual_param_a(), ortodam::give_actual_param_a(), anisodamrot::give_actual_param_a(), anisodam::give_actual_param_a(), timeswmat::give_actual_ym(), mechmat::give_actual_ym(), mechtop::give_area(), mechcrsec::give_area(), transcrsec::give_areae(), transcrsec::give_arean(), nonlocplast::give_aver_quantv(), nonlocdamg::give_aver_quantv(), mechmat::give_aver_quantv(), transtop::give_bonodes(), gtopology::give_cn(), gtopology::give_code_numbers(), mechmat::give_consparam(), mechmat::give_crackwidth(), mechmat::give_dampar(), transtop::give_degree(), mechtop::give_degree(), gtopology::give_degree(), transcrsec::give_densitye(), mechcrsec::give_densitye(), transcrsec::give_densityn(), mechcrsec::give_densityn(), rspecmat::give_deps_free(), b3mat::give_deps_free(), b3mat::give_deps_stressinduced(), transtop::give_dimension(), mechtop::give_dimension(), gnode::give_dof(), transmat::give_dof_names(), saltmat1::give_dof_names(), richards::give_dof_names(), nlisotrmat::give_dof_names(), moistheatmat::give_dof_names(), kunmat::give_dof_names(), isotrmat::give_dof_names(), homogmat::give_dof_names(), glasgowmat::give_dof_names(), damisotrmat::give_dof_names(), con_awf1mat::give_dof_names(), gtopology::give_edge_loc_nodes(), transtop::give_edge_nodes(), mechtop::give_edge_nodes(), gtopology::give_edge_nodes(), dplmat::give_emu_eqother(), b3mat::give_emu_eqother(), transtop::give_end_nodes(), gtopology::give_end_nodes(), gmatrix::give_entry(), loadelt::give_external_nodval(), transmat::give_extinction_coeff(), mechmat::give_first_derivative(), climatcond2::give_flux(), climatcond::give_flux(), give_full_vector(), climatcond2::give_heat_flux(), climatcond::give_heat_flux(), mechmat::give_iniporosity(), mechmat::give_initial_nu(), timeswmat::give_initial_ym(), mechmat::give_initial_ym(), saltmat4::give_inittemperature(), moistheatmat::give_inittemperature(), kunmat::give_inittemperature(), mechmat::give_interparam(), transtop::give_intordcm(), transtop::give_intordkm(), mechtop::give_intordsm(), rspecmat::give_J_E_mu(), mechmat::give_kappa(), mechcrsec::give_layer_thicke(), mechcrsec::give_layer_zcoord(), mechtop::give_length(), bmatrix::give_locid(), gelement::give_master_nodes(), give_max_adjacip(), climatcond2::give_moisture_flux(), climatcond::give_moisture_flux(), mechcrsec::give_mominer(), gtopology::give_mult_code_numbers(), mechtop::give_napfun(), mechtop::give_nb(), mechtop::give_nb_te(), transtop::give_nbobjects(), transtop::give_ncomp(), mechtop::give_ncomp(), transtop::give_ndofe(), mechtop::give_ndofe(), transtop::give_ned(), mechtop::give_ned(), gtopology::give_ned(), gmatrix::give_negm(), gtopology::give_nen(), transtop::give_nip(), mechtop::give_nip(), transtop::give_nne(), mechtop::give_nne(), transtop::give_nned(), mechtop::give_nned(), gtopology::give_nned(), transtop::give_nnsurf(), mechtop::give_nnsurf(), gtopology::give_nnsurf(), give_nodal_humid(), transmat::give_nodal_rel_hum(), transmat::give_nodal_sat_vol_moist_cont(), transmat::give_nodal_vol_moist_cont(), gtopology::give_node_code_numbers(), gtopology::give_node_coord1d(), gtopology::give_node_coord2d(), gtopology::give_node_coord2dxz(), gtopology::give_node_coord3d(), gelement::give_nodes(), loadelt::give_nodval(), sel::give_nselcomp(), transtop::give_nsurf(), mechtop::give_nsurf(), gtopology::give_nsurf(), nonlocplast::give_num_averq(), nonlocdamg::give_num_averq(), mechmat::give_num_averq(), mechmat::give_num_interparam(), mechcrsec::give_num_lay(), mechcrsec::give_onethickness(), transmat::give_othervalue_name(), transmat::give_pore_pressure(), mechmat::give_preconspress(), scaldam::give_proczonelength(), mechmat::give_proczonelength(), give_red_vector(), effstress::give_reqnmq(), mechmat::give_reqnmq(), transmat::give_reqntq(), con_awf1mat::give_reqntq(), dplmat::give_rettimes(), b3mat::give_rettimes(), climatcond::give_salt_flux(), transmat::give_saturation_degree(), mechmat::give_second_derivative(), mechcrsec::give_shearcoeff(), mechtop::give_ssst(), transmat::give_suction(), gtopology::give_surf_nodes(), transtop::give_surface_nodes(), transmat::give_temperature(), transcrsec::give_thicke(), mechcrsec::give_thicke(), transcrsec::give_thickn(), mechcrsec::give_thickn(), mechtop::give_tncomp(), mechtop::give_tnip(), bmatrix::give_totid(), loadelt::give_trc(), loadelt::give_trr(), give_valuesinpoints(), mechcrsec::give_vectorlcs(), mechmat::give_virgporosity(), transmat::give_vol_moist_cont(), mechtop::give_volume(), transmat::give_water_pressure(), mechcrsec::give_weight(), gtopology::give_whole_dim(), transmat::givecompother(), drprag2::giveIdev(), drprag2::giveIota(), hissplas::giveirrstrains(), mechmat::giveirrstrains(), mechmat::givemechq(), transmat::givencompeqother(), mechmat::givencompeqother(), transmat::givencompother(), mechmat::givencompother(), mechmat::givenonmechq(), transmat::givenontransq(), mechmat::givequantity(), visplast::givestressincr(), mechmat::givestressincr(), transmat::givetransq(), sourcet::giveval(), gl_comp_engvectortransf(), gl_engvectortransf(), gmatrix::glocalize(), gmatrix::gmxv(), gnewton_raphson(), gnewton_raphson2(), gtopology::hang_nodes_check(), mechmat::hardsoftfunction(), higher_to_lower_level_elem(), densemat::ill(), imatrix::imatrix(), import_T3d(), import_T3d_bricks(), import_T3d_edges(), import_T3d_pyrams(), import_T3d_quads(), import_T3d_tetras(), import_T3d_trias(), import_T3d_vedges(), gmatrix::incomplete_fact(), shelltr::inicipval(), shellq::inicipval(), quadtet::inicipval(), quadhex::inicipval(), q4plate::inicipval(), planeelemsubqt::inicipval(), planeelemrotlt::inicipval(), planeelemrotlq::inicipval(), planeelemqt::inicipval(), planeelemqq::inicipval(), planeelemlt::inicipval(), planeelemlq::inicipval(), mechbclc::inicipval(), lintetrot::inicipval(), lintet::inicipval(), linhexrot::inicipval(), linhex::inicipval(), dstelem::inicipval(), dktelem::inicipval(), cctelem::inicipval(), barelq3d::inicipval(), barelq2d::inicipval(), barel3d::inicipval(), barel2d::inicipval(), axisymqq::inicipval(), axisymlt::inicipval(), axisymlq::inicipval(), mechtop::init_from_siftop(), lhsrhst::initcond(), lhsrhst::initcondprint(), nonlinman::initiate(), gmatrix::initiate(), gfunct::initiate(), precond::initiation(), initnodval(), initstiffmat(), beamel2d::initstr_matrix(), beamel2d::initstr_matrix_expl(), transmat::initvalues(), coupmatu::initvalues(), timeswmat::initvalues(), mechmat::initvalues(), input(), input_elem_crsec(), input_elem_crsect(), input_elem_edgebc(), input_elem_eigstr(), input_elem_eltimefunc(), input_elem_eltimefunct(), input_elem_lcs(), input_elem_load(), input_elem_loadedge(), input_elem_loadsurf(), input_elem_loadvol(), input_elem_mat(), input_elem_matt(), input_elem_sourcet(), input_elem_surfbc(), input_elem_type(), input_elem_typet(), input_elem_vertbc(), input_hang_nodes(), input_lc(), input_nod_bocon(), input_nod_bocont(), input_nod_coupl_dofs(), input_nod_coupl_dofst(), input_nod_crsec(), input_nod_crsect(), input_nod_dof_tfunc(), input_nod_dof_tfunct(), input_nod_initcond(), input_nod_initcondt(), input_nod_lcs(), input_nod_load(), input_nod_ndof(), input_nod_sourcet(), input_nod_springs(), input_nod_tdload(), input_nod_temper(), input_siftop(), input_siftopt(), inputt(), patch_averaging::insidenod_assembling(), quadquadrilatt::internal_fluxes(), quadlineart::internal_fluxes(), linhext::internal_fluxes(), internal_fluxes(), interpolate(), intpointeqothers(), intpointfluxes(), intpointgradients(), intpointgradientsc(), intpointothers(), intpointstrainsc(), intpointvalues(), intpointvalues_puc(), intpointvaluesc(), tablefunct::inv_derivative(), isotherm::inverse_isotherm_value(), tablefunct::inverse_piecewise_linear_interpol(), invm(), ipcoord(), ipvolume(), barel3d::ipvolume(), barel2d::ipvolume(), isotherm::isotherm_value(), ispointinel(), ivector::ivector(), kunmat::kapa_values(), skyline::ker(), densemat::ker(), gmatrix::kernel(), kunmat::khm(), kunmat::kht(), kunmat::kmm(), kunmat::kmt(), quadlineart::l_matrix(), linhext::l_matrix(), quadlineart::l_t_matrix(), linhext::l_t_matrix(), gmatrix::ldl_feti(), skyline::ldl_sky(), skyline::ldlkon_sky(), lg_engvectortransf(), linbartax::linbartax(), linhext::linhext(), tablefunct::lininterpol2(), tablefunct::lininterpol3(), lintett::lintett(), densemat::ll(), lmat(), ortodamrot::loadfunc(), ortodam::loadfunc(), anisodamrot::loadfuncdev(), anisodam::loadfuncdev(), anisodamrot::loadfuncvol(), anisodam::loadfuncvol(), loadmat(), mechmat::loc_elmatstiff(), loc_internal_forces(), mechmat::loc_transf_mat(), gmatrix::localize(), gmatrix::localized(), planeelemlt::locglob_nodeval(), lower_cap_coupl_mat(), lower_cond_coupl_mat(), lsm_quad(), ltmat(), densemat::lu(), dskyline::lu_dsky(), lu_full(), dskyline::lukon_dsky(), beamel2d::mass_matrix(), beamel2d::mass_matrix_expl(), massmat(), transmat::mat_aux_values(), med2::matcap(), med3::matcap(), med1::matcap(), med4::matcap(), medc1::matcap_l(), medc1::matcap_u(), varelastisomat::matcompl(), elastisomat::matcompl(), med2::matcond(), transmat::matcond(), med3::matcond(), sejtkrmat::matcond(), saltmat4::matcond(), saltmat1::matcond(), richardscontam::matcond(), richards::matcond(), radiationmat::matcond(), med1::matcond(), moistheatmat::matcond(), lincoupmat::matcond(), kunmat::matcond(), isotrmat::matcond(), homogmat::matcond(), med4::matcond(), damisotrmat::matcond(), con_awf1mat::matcond(), carbmat1::matcond(), med2::matcond2(), transmat::matcond2(), med3::matcond2(), saltmat4::matcond2(), richardscontam::matcond2(), richards::matcond2(), med1::matcond2(), med4::matcond2(), bazpedmat::matcond2(), medc1::matcond_l(), medc1::matcond_u(), therisomat::matdilat(), mechmat::matdilat(), seqfeti::matrices_assembl(), matrix::matrix(), matrix_tensor4(), visplast::matstiff(), timeswmat::matstiff(), scaldam::matstiff(), ortodamrot::matstiff(), ortodam::matstiff(), mohrcoulomb::matstiff(), graphmat::matstiff(), fixortodam::matstiff(), elastisomat::matstiff(), damplast::matstiff(), anisodamrot::matstiff(), anisodam::matstiff(), mechmat::matstiff(), mohrcoulomb::mc_msurf_cp(), planeelemlq::mechq_nodval_comp(), barel2d::mechq_nodval_comp(), mefel_init(), mefel_right_hand_side(), mefel_trfel_by_nodes(), mefel_trfel_ip_mapping(), gfunct::merge(), mechtop::mesh_check(), metr_init(), mixv(), seqfeti::mpcg(), mtxm(), mtxv(), gmatrix::mult_localize(), mxm(), mxmt(), mxv(), newmeshgen(), timecontr::newtime(), newton_raphson_gparcoupl(), newton_raphson_parcoupl(), newton_raphson_parcoupl_common_dt(), newton_raphson_parcoupl_comp(), timeswmat::nlstresses(), splas1d::nlstresses(), scaldam::nlstresses(), ortodamrot::nlstresses(), ortodam::nlstresses(), mohrcoulombpar::nlstresses(), mohrcoulomb::nlstresses(), j2flow::nlstresses(), hissplas::nlstresses(), graphmat::nlstresses(), drprag::nlstresses(), camclaycoup::nlstresses(), camclay::nlstresses(), anisodamrot::nlstresses(), anisodam::nlstresses(), layplate::nlstresses(), shrinkmat::nlstressesincr(), nodal_nodal_values(), nodalderivatives(), nodalval(), partop::node_coarse_numbers(), seqtop::node_coarse_numbers(), seqtop::node_global_glued_numbers(), seqtop::node_local_numbers(), beamel3d::nodeforces(), nodestrains_comp(), nodip_planelt(), nonlin_nonstat_dform(), nonlinear_solver(), mohrcoulombpar::nonloc_nlstresses(), mohrcoulomb::nonloc_nlstresses(), drprag::nonloc_nlstresses(), mechmat::nonlocaverage(), mechmat::nonlocradius(), gsurf::normal_vector(), gedge::normal_vector(), patch_averaging::nsp_spcoord_maxcoord_assembling(), seqselnodes::number_contrib_dofs(), ivector::operator()(), vector< vector< long > >::operator()(), gfmatrix::operator()(), imatrix::operator()(), matrix::operator()(), bmatrix::operator()(), operator++(), operator--(), ivector::operator[](), vector< vector< long > >::operator[](), imatrix::operator[](), matrix::operator[](), bmatrix::operator[](), par_newton_raphson_gparcoupl(), par_newton_raphson_parcoupl(), par_solve_gpcouplprob(), par_solve_pcouplprob(), paral_transport_homogenization(), doubdp::params(), anisodamrot::pdam_dev(), anisodam::pdam_dev(), anisodam::pdaminc_dev(), ortodamrot::pelmatstiff(), ortodam::pelmatstiff(), mohrcoulomb::pelmatstiff(), tablefunct::piecewise_const_interpol(), tablefunct::piecewise_linear_interpol(), mechmat::plasmodscalar(), mechmat::plasticmoduli(), pmefel_init(), precond::preconditioning(), aggregator::prepare_boss(), gmatrix::prepmat(), gmatrix::prepmat2(), sel::presence_id(), sel::presence_idgt(), gtopology::prev_next_edges(), prevnodval(), ortodamrot::princ_dam(), ortodam::princ_dam(), princ_val(), sourcet::print(), pvalt::print(), probdesct::print(), nonlinmant::print(), isotherm::print(), crsection3d::print(), crsection2d::print(), crsection1d::print(), climatcond2::print(), climatcond::print(), probdescc::print(), strretalg::print(), shrinkmat::print(), probdesc::print(), pointoutm::print(), elemoutgm::print(), elemoutm::print(), nodeoutgm::print(), nodeoutm::print(), outdiagm::print(), nonlinman::print(), mechbclc::print(), eigvalsol::print(), dloadcase::print(), crsecplstr::print(), crsec3d::print(), crsec2dbeam::print(), crsec2dbar::print(), timecontr::print(), slesolv::print(), seqschur::print(), sel::print(), precond::print(), hdbcontr::print(), gfunct::print(), gnode::print_constr(), print_default_dx(), outdriverm::print_default_vtk(), outdiagm::print_displacements(), print_displacements(), mechbclc::print_eigenstrains(), outdiagm::print_forces(), elemoutgt::print_gr_eqoth_vec(), elemoutgt::print_gr_flux_vec(), elemoutgt::print_gr_grad_vec(), elemoutgm::print_gr_oth_mtx(), nodeoutgm::print_gr_oth_mtx(), elemoutgm::print_gr_oth_scal(), nodeoutgm::print_gr_oth_scal(), elemoutgt::print_gr_oth_vec(), elemoutgm::print_gr_oth_vec(), nodeoutgm::print_gr_oth_vec(), elemoutgm::print_gr_stra_mtx(), nodeoutgm::print_gr_stra_mtx(), elemoutgm::print_gr_stra_scal(), nodeoutgm::print_gr_stra_scal(), elemoutgm::print_gr_stra_vec(), nodeoutgm::print_gr_stra_vec(), elemoutgm::print_gr_stre_mtx(), nodeoutgm::print_gr_stre_mtx(), elemoutgm::print_gr_stre_scal(), nodeoutgm::print_gr_stre_scal(), elemoutgm::print_gr_stre_vec(), nodeoutgm::print_gr_stre_vec(), elemoutgt::print_graphics(), nodeoutgt::print_graphics(), outdrivert::print_graphics(), elemoutgm::print_graphics(), nodeoutgm::print_graphics(), outdriverm::print_graphics(), outdrivert::print_graphics_forced(), outdriverm::print_graphics_forced(), outdiagt::print_header(), outdiagm::print_header(), print_init(), outdiagm::print_macrostr(), print_multipliers(), outdrivert::print_newstep(), pointoutm::print_other(), outdiagm::print_others(), saltmat4::print_othervalue_name(), moistheatmat::print_othervalue_name(), kunmat::print_othervalue_name(), homogmat::print_othervalue_name(), discmat::print_othervalue_name(), dplmat::print_othervalue_name(), b3mat::print_othervalue_name(), med2::print_othervaluesnames(), med3::print_othervaluesnames(), med1::print_othervaluesnames(), outdiagm::print_reactions(), print_step(), print_step_forced(), pointoutm::print_stra(), outdiagm::print_strains(), pointoutm::print_stre(), outdiagm::print_stresses(), print_VTK_nodedata(), transcrsec::printcrschar(), mechcrsec::printcrschar(), gmatrix::printdiag(), gmatrix::printmat(), transmat::printmatchar(), mechmat::printmatchar(), printv(), outdiagt::printval(), outdiagm::printval(), outdiagt::printval_forced(), outdiagm::printval_forced(), proc_ord_fmt(), ptrfel_init(), ortodamrot::qbezier_damage(), ortodam::qbezier_damage(), quadbart::quadbart(), quadbartax::quadbartax(), quadeqcoeff(), quadhext::quadhext(), quadlinaxisym::quadlinaxisym(), quadlineart::quadlineart(), quadquadrilatt::quadquadrilatt(), quadquadrilattax::quadquadrilattax(), quadtetrahedral_surfnod(), quadquadrilatt::quantity_source_vector(), quadlineart::quantity_source_vector(), linhext::quantity_source_vector(), transtop::read(), transcrsec::read(), sourcet::read(), richardscontam::read(), richards::read(), pvalt::read(), probdesct::read(), nonlinmant::read(), loadelt::read(), loadcaset::read(), lincoupmat::read(), isotherm::read(), elementt::read(), crsection3d::read(), crsection2d::read(), crsection1d::read(), climatcond2::read(), climatcond::read(), entitybocon::read(), matrt::read(), csect::read(), bocont::read(), probdescc::read(), timeswmat::read(), strretalg::read(), shrinkmat::read(), probdesc::read(), pointoutm::read(), elemoutgm::read(), elemoutm::read(), nodeoutgm::read(), nodeoutm::read(), outdriverm::read(), outdiagm::read(), ortodamrot::read(), ortodam::read(), nonlocplast::read(), nonlocdamg::read(), nonlinman::read(), node::read(), mechtop::read(), mechcrsec::read(), mechbclc::read(), loadn::read(), loadel::read(), loadcase::read(), graphmat::read(), element::read(), eigvalsol::read(), effstress::read(), dloadn::read(), dloadcase::read(), crsecplstr::read(), crseclayer::read(), crsec3d::read(), crsec2dbeam::read(), crsec2dbar::read(), rspecmat::read(), b3mat::read(), anisodamrot::read(), anisodam::read(), matr::read(), csec::read(), atsel::read(), timecontr::read(), slesolv::read(), seqschur::read(), sel::read(), precond::read(), seqfeti::read(), hdbcontr::read(), gfunct::read(), gelement::read(), aggregator::read(), climatcond2::read_climatic_files(), climatcond::read_climatic_files(), mechbclc::read_eigenstrains(), gtopology::read_gf(), gelement::read_gf(), read_inicd_file(), gfunct::read_prop(), transcrsec::readcrsectype(), mechcrsec::readcrsectype(), mechbclc::readinic(), adaptivityt::readinit(), adaptivity::readinit(), transmat::readmatchar(), coupmatu::readmatchar(), coupmatl::readmatchar(), mechmat::readmatchar(), transmat::readmattype(), mechmat::readmattype(), readv(), reallocm(), reallocv(), restore_adjacip(), restore_adjacip_bin(), restore_adjacip_txt(), intpointst::restore_data_bin(), intpoints::restore_data_bin(), intpointst::restore_data_txt(), intpoints::restore_data_txt(), mechmat::restore_intpoints_bin(), mechmat::restore_intpoints_txt(), transmat::restore_intpointst_bin(), transmat::restore_intpointst_txt(), medc1::rhs_u(), med3::rhs_volume(), med1::rhs_volume(), symcomprow::rows_mult_ldl_scr(), adaptivityt::run(), adaptivity::run(), save_adjacip(), gnode::save_dof(), mechmat::save_intpoints_bin(), mechmat::save_intpoints_txt(), transmat::save_intpointst_bin(), transmat::save_intpointst_txt(), mechmat::scal_dam_sol(), gmatrix::scalgm(), partop::schur_ordering(), scprd(), selnodes::selnodes(), seqselnodes::seqselnodes(), solve_eigen_dynamics(), solve_gpcouplprob(), solve_mefel_deterministic_problem(), solve_pcouplprob(), seqschur::solve_red_sys(), slesolv::solve_system(), gmatrix::solve_system(), solve_trfel_adaptivity_problem(), solve_trfel_deterministic_problem(), solve_trfel_problem(), solve_trfel_stochastic_problem(), solver_restore(), solver_restore_binary(), solver_restore_binary_multiple(), solver_restore_binary_single(), solver_restore_text(), solver_restore_text_multiple(), solver_restore_text_single(), solver_save(), solver_save_binary(), solver_save_binary_multiple(), solver_save_binary_single(), solver_save_text(), solver_save_text_multiple(), solver_save_text_single(), solvert_restore(), solvert_restore_binary(), solvert_restore_binary_multiple(), solvert_restore_binary_single(), solvert_restore_text(), solvert_restore_text_multiple(), solvert_restore_text_single(), solvert_save(), solvert_save_binary(), solvert_save_binary_multiple(), solvert_save_binary_single(), solvert_save_text(), solvert_save_text_multiple(), solvert_save_text_single(), kunmat::sorption_izoterms_giva_data(), source_vector(), adaptivityt::spr(), adaptivity::spr(), adaptivityt::statedata_backup(), adaptivityt::statedata_transfer(), mechmat::stiff_deps_vispl(), mechmat::stiff_eps(), stiffmat(), beamel2d::stiffness_matrix(), barel3d::stiffness_matrix(), barel2d::stiffness_matrix(), beamel2d::stiffness_matrix_expl_local(), mechtop::store_code_num_elem(), dplmat::store_emu_eqother(), b3mat::store_emu_eqother(), mechmat::storenonmechq(), transmat::storenontransq(), visplast::storestressincr(), quadtet::strains(), planeelemlq::strains(), barelq3d::strains(), barel3d::strains(), barel2d::strains(), relaxeuroc::stress(), quadtet::stresses(), planeelemlq::stresses(), barelq3d::stresses(), barel3d::stresses(), barel2d::stresses(), subm(), subv(), loadel::surfaceload(), tablefunct::tablefunct(), dloadcase::tempercontrib(), therisomat::temprstrains(), mechmat::temprstrains(), tensor4_matrix(), tensor_vector(), tensor_vector_matrix(), tensprd(), anisodam::tmatstiff(), linhext::total_integral(), tranm(), transfvalues_nod(), climatcond2::transmission_coefficient_tt(), climatcond2::transmission_coefficient_tw(), climatcond2::transmission_coefficient_ww(), climatcond2::transmission_exterior_value_tt(), climatcond2::transmission_exterior_value_ww(), med2::transmission_flux(), transmat::transmission_flux(), med3::transmission_flux(), med1::transmission_flux(), med4::transmission_flux(), med2::transmission_nodval(), transmat::transmission_nodval(), med3::transmission_nodval(), med1::transmission_nodval(), med4::transmission_nodval(), med2::transmission_transcoeff(), transmat::transmission_transcoeff(), med3::transmission_transcoeff(), med1::transmission_transcoeff(), med4::transmission_transcoeff(), transport_homogenization(), trfel_right_hand_side(), trlinaxisym::trlinaxisym(), trlineart::trlineart(), umatunsat_(), unit_compl_matrix(), seqtop::update_multip(), transmat::updateipvalmat(), coupmatu::updateipvalmat(), mechmat::updateipvalmat(), mechmat::updateq(), timeswmat::updateval(), upper_cap_coupl_mat(), upper_cond_coupl_mat(), transmat::values_correction(), kunmat::values_correction(), transmat::values_transformation(), entitybocon::var2coord(), vector::vector(), vector_tensor(), transmat::volume_rhs(), linhext::volume_rhs_vector(), volume_rhs_vector(), volume_rhs_vectorc(), vxm(), vxmt(), vxmxv(), vxv(), whereispoint(), wr_bocon(), wr_bocont(), wr_climatcond(), wr_climatcond2(), wr_dprescdisp(), wr_elements(), wr_elementst(), wr_lay_elements(), wr_load(), wr_loadcaset(), wr_prescdisp(), write_elements(), write_elemscalar(), write_gid_elem_type_scalar(), write_gid_elem_type_tensor(), write_gid_elem_type_vector(), write_gid_elem_type_vectort(), write_gid_nodscalar(), write_gid_nodtensor(), write_gid_nodvector(), write_nodscalar(), xf_copysec(), xf_resetsec(), xfdetect_sect(), xfopen(), xfprintf(), xfscanf(), and mechmat::yieldfunction().

void print_warning ( const char *  wmsg,
const char *  warnfile,
int  warnln,
const char *  warnfunc,
  ... 
)

function prints warning message to standard error output device, format specifiers are allowed in wmsg

Function writes warning on standard error output device, format specifiers are allowed in wmsg.

Parameters:

Parameters:
wmsg - string with warning message, one terminating character
will automatically added
warnfile - string with source file name where the error was generated
warnln - line number in source file where the warning was generated
warnfunc - string with function name where the warning was generated
... - other parameters used in format string wmsg passed to the vfprintf function
Returns:
Function does not return anything.

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 56 of file iotools.cpp.

References stack_trace().

Referenced by bmatrix::bmatrix(), symcomprow::cg(), check_maxlnsize(), checkenumerr(), checkscanferr(), imatrix::imatrix(), ivector::ivector(), matrix::matrix(), probdesc::read(), nonlinman::read(), vector::vector(), and xfclose().

long proc_new_ln_fmt ( XFILE out,
const char *  fmt 
)

processes new line characters and line numbers in the xfprintf function

Function prints given prefix/postfix strings after/before each new line character in the fmt string.

Parameters:
out - pointer to the opened XFILE
fmt - pointer to the format processed
Returns:
The function returns the number of written characters to the out file.

Created by Tomas Koudelka, 11.8.2014, koudelka@cml.fsv.cvut.cz

Definition at line 1637 of file iotools.cpp.

References XFILE::col, XFILE::file, XFILE::line, XFILE::lnfpos, XFILE::lnpostf, XFILE::lnpref, and memset().

Referenced by xfprintf().

char* proc_ord_fmt ( XFILE in,
char *  fmt,
char *  fmt_end,
char *  lnstr,
char *&  astr 
)

function reads the ordinary format characters contained in the format substring fmt from the file in

Function reads the ordinary format characters contained in the format substring fmt from the file in. Ordinary format characters are defined as characters which does not belong to the conversion specification. For example, the format string "z= %le, ndof= %ld " has to be divided into three format substrings

  • s1 = "z= ",
  • s2 = "%le, ndof= " and
  • s3 = "%ld ".

Any of s1, s2 or s3 can be passed as the argument fmt and fmt_end has to be pointer to the next substring i.e. s2, s3 or NULL.

Following ordinary format substrings will be detected:

  • "z= " for s1,
  • ", ndof= " for s2 and
  • " " for s3.
Parameters:
in - pointer to the structure XFILE with opened text file for reading
fmt - format substring containing at most one conversion specifier
fmt_end - pointer to the end of format substring fmt or NULL if the fmt is terminated by ''
lnstr - line buffer of the file in
aptr - pointer of the actual position in lnstr
Return values:
NULL - if the ordinary format has been read successfully
afmt - if a matching failure has been detected (afmt is string with format which caused the failure)

Created 04.2011, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 3463 of file iotools.cpp.

References XFILE::col, print_err(), and skip_space().

Referenced by xfscanf().

long skip_space ( XFILE in,
char *  lnstr,
char *&  astr 
)

function skips the blank characters in the file in

Function skips the blank characters ' ', '
', '', ', '' (defined in the standard isspace function) in the file in.

Parameters:
in - pointer to the structure XFILE with opened text file for reading
lnstr - line buffer of the file in
astr - pointer of the actual position in lnstr
Return values:
0 - on success
1 - on end of file/section
2 - on maximum line length error

Created 04.2011, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 3591 of file iotools.cpp.

References XFILE::asect, check_maxlnsize(), clearcomments(), XFILE::col, cut_str_sec(), xfsection::end_secln, xfsection::end_secpos, XFILE::file, XFILE::give_maxlnsize(), XFILE::index_created, XFILE::line, XFILE::lnfpos, and memset().

Referenced by proc_ord_fmt().

void skipline ( XFILE in  ) 

function skips rest of actual line and moves to the next line

Function skips rest of actual line in file in.

Parameters:

Parameters:
in - pointer to the structure XFILE with opened text file for reading
Returns:
The function does not return anything.

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz modified 11.9.2013, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 3426 of file iotools.cpp.

References XFILE::col, and XFILE::lnstr.

Referenced by import_T3d_bricks(), import_T3d_nodes(), import_T3d_pyrams(), import_T3d_quads(), import_T3d_tetras(), import_T3d_trias(), import_T3d_vedges(), matrt::read(), csect::read(), matr::read(), and csec::read().

const char* strstr ( const char *  haystack,
const char *  needle,
long  ignorecase 
)

function finds the first occurence of substring needle in the string haystack

Function performs case sensistive/insensitive searching of substring 'needle' in the string 'haystack', The terminating '' characters are not compared. The case sensitivity is controlled by the parameter ignorecase: 0 = case sensitive / 1 = case insensitive.

Parameters:

Parameters:
haystack - searched in string literal
needle - searched for string
ignorecase - flag for case insensitivity (=1)/ case sensitivity (=0)
Returns:
The function returns a pointer to the beginning of the substring, or NULL if the substring is not found

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 3325 of file iotools.cpp.

References strstr(), and strstrcis().

char* strstr ( char *  haystack,
const char *  needle,
long  ignorecase 
)

Function performs case sensistive/insensitive searching of substring 'needle' in the string 'haystack', The terminating '' characters are not compared. The case sensitivity is controlled by the parameter ignorecase: 0 = case sensitive / 1 = case insensitive.

Parameters:

Parameters:
haystack - searched in string
needle - searched for string
ignorecase - flag for case insensitivity (=1)/ case sensitivity (=0)
Returns:
The function returns a pointer to the beginning of the substring, or NULL if the substring is not found

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 3299 of file iotools.cpp.

References strstr(), and strstrcis().

Referenced by get_modif(), getkwd(), getkwd_opt(), iscomment(), isgkw(), ispkw(), locate_kwd(), matchekwd(), strstr(), and xf_setsec().

const char* strstrcis ( const char *  haystack,
const char *  needle 
)

Function performs case insensitive searching of substring 'needle' in the string 'haystack', The terminating '' characters are not compared.

Parameters:

Parameters:
haystack - searched in string literal
needle - searched for string
Returns:
The function returns a pointer to the begning of the substring, or NULL if the substring is not found

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 3388 of file iotools.cpp.

char* strstrcis ( char *  haystack,
const char *  needle 
)

function finds the first occurence of substring needle in the string haystack, the case of characters is ignored

Function performs case insensitive searching of substring 'needle' in the string 'haystack', The terminating '' characters are not compared.

Parameters:

Parameters:
haystack - searched in string
needle - searched for string
Returns:
The function returns a pointer to the begning of the substring, or NULL if the substring is not found

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 3349 of file iotools.cpp.

Referenced by process_args(), process_argsc(), process_argst(), probdescc::read(), and strstr().

void xf_copysec ( XFILE f,
FILE *  out 
)

copies content of the actual section to the text file

Function copises content of the actual section in the file f to the text file out. Copying of content starts form the actual file position in the actual section.

Parameters:

Parameters:
f - pointer to opened XFILE structure
out - pointer to the opened FILE structure
Returns:
The function does not return anything

created 11.2009, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 654 of file iotools.cpp.

References XFILE::asect, xfsection::end_secpos, XFILE::file, memset(), and print_err().

void xf_resetsec ( XFILE f  ) 

function resets internal pointer of the given file to the beginning of the actual section

Function resets internal variables of given file so that they points to the beginning of the actual section.

Parameters:

Parameters:
f - pointer to opened XFILE structure
Returns:
The function returns nothing

created 02.2008, Tomas Koudelka, koudelka@cml.fsv.cvut.cz modified 11.9.2013, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 523 of file iotools.cpp.

References XFILE::asect, xfsection::beg_seccol, xfsection::beg_secln, xfsection::beg_secpos, check_maxlnsize(), clearcomments(), XFILE::col, cut_str_sec(), XFILE::file, XFILE::fname, XFILE::give_maxlnsize(), XFILE::id_sec, XFILE::index_created, XFILE::line, XFILE::lnfpos, XFILE::lnstr, XFILE::num_sec, and print_err().

Referenced by getkwd_sect(), main(), and xf_setsec().

long xf_setsec ( XFILE f,
long  sec_id 
)

set section given by internal section index of the file

Function sets internal file pointers to the beginning of section of given id

Parameters:

Parameters:
f - pointer to opened XFILE structure
sec_id - index of required section in the array sect of XFILE
Return values:
0 - on success
1 - index is out of range
2 - index was not built

created 02.2008, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 623 of file iotools.cpp.

References XFILE::asect, XFILE::id_sec, XFILE::index_created, XFILE::num_sec, XFILE::sect, and xf_resetsec().

long xf_setsec ( XFILE f,
enumstr  sec_alias 
)

set section given by enumstr

Function sets internal file pointers to the beginning of section with given alias.

Parameters:

Parameters:
f - pointer to opened XFILE structure
sec_alias - structure containing string with section name and enum with section alias
Return values:
0 - on success
1 - index was not found
2 - section index was not built

created 02.2008, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 579 of file iotools.cpp.

References enumstr::alias, XFILE::asect, enumstr::id, XFILE::id_sec, XFILE::index_created, xfsection::name, XFILE::num_sec, XFILE::sect, strstr(), and xf_resetsec().

Referenced by check_reqsec(), check_reqsec_t(), input_crs(), input_crst(), input_elem_crsec(), input_elem_crsect(), input_elem_edgebc(), input_elem_eigstr(), input_elem_eltimefunc(), input_elem_eltimefunct(), input_elem_lcs(), input_elem_load(), input_elem_loadedge(), input_elem_loadsurf(), input_elem_loadvol(), input_elem_mat(), input_elem_matt(), input_elem_sourcet(), input_elem_surfbc(), input_elem_type(), input_elem_typet(), input_elem_vertbc(), input_lc(), input_lct(), input_materials(), input_materialst(), input_nod_bocon(), input_nod_bocont(), input_nod_coupl_dofs(), input_nod_coupl_dofst(), input_nod_crsec(), input_nod_crsect(), input_nod_dof_tfunc(), input_nod_dof_tfunct(), input_nod_initcond(), input_nod_initcondt(), input_nod_lcs(), input_nod_load(), input_nod_ndof(), input_nod_sourcet(), input_nod_springs(), input_nod_tdload(), input_nod_temper(), and main().

int xfclose ( XFILE *&  f  ) 

function closes file of XFILE type

Function closes file given by parameter f. This function replaces standard fclose function for XFILE type.

Parameters:

Parameters:
f - pointer to opened XFILE structure
Returns:
The function returns the same value as fclose function

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz modified 11.9.2013, Tomas Koudelka, koudelka@cml.fsv.cvut.cz modified 1.8.2014, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 208 of file iotools.cpp.

References XFILE::file, XFILE::fname, XFILE::give_maxlnsize(), XFILE::maxlnover, and print_warning().

Referenced by input(), input_crs(), input_crst(), input_materials(), input_materialst(), inputt(), main(), mefel_init(), metr_init(), pmefel_init(), pmetr_init(), ptrfel_init(), stochdrivert::read(), loadcaset::read(), seismtool::read(), loadcase::read(), climatcond2::read_climatic_files(), climatcond::read_climatic_files(), tablefunct::read_data_file(), trfel_init(), and stochdriver::~stochdriver().

long xfdetect_sect ( XFILE f,
const kwdset kwdb,
const kwdset kwde 
)

function detects sections defined by sets of beginning and end keywords

Function detects particular sections in file given by parameter f. Number of searched sections is given by data member n of kwdb and kwde (they must be the same). These structures contain array with base keywords indicating beginnings or ends of searched sections. Not all of the searched sections have to be detected and the function stores data about detected sections in coresponding data mambers in structure of f (see description of XFILE).

Parameters:

Parameters:
f - pointer to opened XFILE structure
kwdb - structure containing array with keywords used for indicating beginning of sections
kwde - structure containing array with keywords used for indicating end of sections
Returns:
The function returns number of successfully detected sections

created 02.2008, Tomas Koudelka, koudelka@cml.fsv.cvut.cz modified 11.9.2013, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 333 of file iotools.cpp.

References enumstr::alias, XFILE::asect, xfsection::beg_seccol, xfsection::beg_secln, xfsection::beg_secpos, clearcomments(), xfsection::end_seccol, xfsection::end_secln, xfsection::end_secpos, XFILE::file, XFILE::give_maxlnsize(), enumstr::id, XFILE::id_sec, XFILE::ignorecase, XFILE::index_created, XFILE::kwdmode, XFILE::lnfpos, XFILE::lnstr, locate_kwd(), memset(), kwdset::n, xfsection::name, XFILE::num_sec, print_err(), XFILE::sect, sect_mode_full, sect_mode_fwd, sect_mode_ignore, sect_mode_seq, and kwdset::set.

Referenced by main().

XFILE* xfopen ( const char *  name,
const char *  mode 
)

function opens file of XFILE type

Function opens file given by parameter name with given mode. This function replaces standard fopen function for XFILE type. By default, the kwdmode is set to 'ignore', warnings are switched off and maximum line size is set to 1024.

Parameters:

Parameters:
name - string with file name
mode - string with file handling mode. Only "r" or "a" reading mode is supported
Returns:
The function returns pointer to the newly allocated structure XFILE with opened file or NULL in case failure of file opening.

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz modified 11.9.2013, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 151 of file iotools.cpp.

References XFILE::asect, XFILE::col, XFILE::file, XFILE::fname, XFILE::id_sec, ignore, XFILE::ignorecase, XFILE::index_created, XFILE::kwdmode, XFILE::line, XFILE::lnfpos, XFILE::maxlnover, XFILE::num_sec, print_err(), XFILE::sect, XFILE::set_maxlnsize(), and XFILE::warning.

Referenced by import_T3d(), input(), input_crs(), input_crst(), input_materials(), input_materialst(), inputt(), main(), mefel_init(), metr_init(), pmefel_init(), pmetr_init(), ptrfel_init(), stochdrivert::read(), loadcaset::read(), stochdriver::read(), seismtool::read(), loadcase::read(), climatcond2::read_climatic_files(), climatcond::read_climatic_files(), tablefunct::read_data_file(), read_inicd_file(), and trfel_init().

int xfprintf ( XFILE out,
char *  fmt,
  ... 
)

Function extends standard fprintf function about line prefix, line postfix, error checking, and keywords. ALL ARGUMENTS USED BY CONVERSIONS MUST BE PASSED BY POINTERS. Several new conversions are defined or redefined : a - prints string including the whitespaces %[ - prints string including the whitespaces k - prints keyword stored in the corresponding argument. The keyword printing is controlled by the XFILE kwdmode option. Argument should be string with required keyword. m - prints enum value given either by string or corresponding integer value. This conversion processes two arguments. The first argument should be pointer to class kwdset, which contains array with enumstr structures containing predefined alias strings and integer values. These aliases (string integer values) are used for the checking of the second parameter and printed to the output file depending on the XFILE kwdmode setting. Integer value of the printed value is contained in the second argument which is supposed to be a pointer to the integer type.

Parameters:

Parameters:
out - pointer to the opened XFILE structure
fmt - format string
... - arguments used for conversions prescribed in the fmt string
Returns:
returns number of successfully scanned and assigned items

created 11.8.2014, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 1322 of file iotools.cpp.

References kwdset::check_int(), checkfmt(), XFILE::col, XFILE::file, get_modif(), kwdset::get_str(), getsubfmt(), gettypes(), ignore, XFILE::kwdmode, print_err(), and proc_new_ln_fmt().

int xfscanf ( XFILE in,
char *  fmt,
  ... 
)

extended fscanf function

Function extends standard fscanf function about error checking, input type checking, and keywords. Several new conversions are defined or redefined : a - reads string including whitespaces until the newline chracter is reached argument of char* type is expected and it has to have sufficient memory allocated to hold whole scanned string including trailing . Format string " %a" skips the initial whitespaces like ' ', '', '
', '' and '' and starts the scanning at the first nonwhitespace character Format string "% a" skips '
' and '' BUT NOT ' ', '' and '' and than starts scanning. In this case, the scanned string can contain initial spaces or tabelators. Format string "% #a" skips '
' and '' BUT NOT ' ', '' and '' and than starts scanning. No more than # characters is read (terminating is not counted) and the scanned string can contain initial spaces or tabs. k - keyword stored in the corresponding argument will be located in the input file. Keyword locating and handling with keyword is controlled by the XFILE kwdmode option. Argument should be string with required keyword, no conversion is performed.Following conversion should perform conversion and assignment of keyword value to the argument which follows argument with keyword string. m - reads enum value given either by string or corresponding integer value. This conversion processes two arguments. The first argument should be pointer to class kwdset, which contains array with enumstr structures containing predefined alias strings and integer values. These aliases (string or integer values) are searched in the input file. Integer value of located alias is assigned to the second argument which is supposed to be a pointer to the integer type.

Parameters:

Parameters:
in - pointer to the opened XFILE structure
fmt - format string
... - arguments used for conversions prescribed in the fmt string
Returns:
returns number of successfully scanned and assigned items

created 12.2006, Tomas Koudelka, koudelka@cml.fsv.cvut.cz modified 11.9.2013, Tomas Koudelka, koudelka@cml.fsv.cvut.cz

Definition at line 729 of file iotools.cpp.

References a_fmt_skips_whitespaces(), XFILE::asect, xfsection::beg_secpos, check_asterisk(), check_feof_eos(), check_maxlnsize(), check_newline_fmt(), checkenumerr(), checkeos(), checkfeof(), checkfmt(), checkint(), checkouint(), checkreal(), checkscanferr(), checkuint(), checkxuint(), clearcomments(), XFILE::col, cut_str_sec(), detect_multln(), xfsection::end_secln, XFILE::file, XFILE::fname, getenum(), getkwd(), getsubfmt(), gettypes(), XFILE::give_maxlnsize(), XFILE::ignorecase, isemptystr(), XFILE::kwdmode, XFILE::line, line_mode, XFILE::lnfpos, XFILE::lnstr, XFILE::maxlnover, memset(), print_err(), proc_ord_fmt(), sect_mode_full, sect_mode_fwd, and sect_mode_seq.

Referenced by stochdriver::assemble_new_values(), gnode::constr(), import_T3d(), import_T3d_bricks(), import_T3d_edges(), import_T3d_nodes(), import_T3d_pyrams(), import_T3d_quads(), import_T3d_tetras(), import_T3d_trias(), import_T3d_vedges(), lhsrhst::initcond(), lhsrhs::initcond(), input_elem_crsec(), input_elem_crsect(), input_elem_edgebc(), input_elem_eigstr(), input_elem_eltimefunc(), input_elem_eltimefunct(), input_elem_lcs(), input_elem_load(), input_elem_loadedge(), input_elem_loadsurf(), input_elem_loadvol(), input_elem_mat(), input_elem_matt(), input_elem_sourcet(), input_elem_surfbc(), input_elem_type(), input_elem_typet(), input_elem_vertbc(), input_files(), input_filest(), input_hang_nodes(), input_lc(), input_lct(), input_nod_bocon(), input_nod_bocont(), input_nod_coupl_dofs(), input_nod_coupl_dofst(), input_nod_crsec(), input_nod_crsect(), input_nod_dof_tfunc(), input_nod_dof_tfunct(), input_nod_initcond(), input_nod_initcondt(), input_nod_lcs(), input_nod_load(), input_nod_ndof(), input_nod_sourcet(), input_nod_springs(), input_nod_tdload(), input_nod_temper(), main(), pmefel_init(), pmetr_init(), ptrfel_init(), transtop::read(), transcrsec::read(), transbclc::read(), stochdrivert::read(), sourcet::read(), sorpisorootgrun::read(), sorpisohansen::read(), saltmat4::read(), saltmat3::read(), saltmat2::read(), richardscontam::read(), richards::read(), radiationmat::read(), pvalt::read(), probdesct::read(), pedmat::read(), pointoutt::read(), elemoutgt::read(), elemoutt::read(), nodeoutgt::read(), nodeoutt::read(), outdrivert::read(), outdiagt::read(), nonlinmant::read(), nodet::read(), nlisotrmat::read(), moistheatmat::read(), millymat::read(), loadelt::read(), loadcaset::read(), lincoupmat::read(), kunmat2::read(), kunmat::read(), isotrmat::read(), isotherm::read(), hydrationheat::read(), grunewaldmat::read(), glasgowmat::read(), elementt::read(), discmat::read(), discisotrmat::read(), devriesmat::read(), damisotrmat::read(), crsection3d::read(), crsection2d::read(), crsection1d::read(), con_awf2mat::read(), con_awf1mat::read(), concreteBmat::read(), climatcond2::read(), climatcond::read(), cernymat::read(), cemhydmat::read(), carbmat1::read(), bnodvalt::read(), bazpedmat::read(), baroghelmat::read(), entitybocon::read(), dbmatt::read(), matrt::read(), dbcrst::read(), csect::read(), bocont::read(), probdescc::read(), isotrmatc::read(), glasgowmatc::read(), elementc::read(), couptop::read(), con_awf2matc::read(), con_awf1matc::read(), concreteBmatc::read(), baroghelmatc::read(), winpast::read(), varelastisomat::read(), timeswmat::read(), therisomat::read(), strretalg::read(), stochdriver::read(), splas1d::read(), simviscous::read(), shrinkmat::read(), shefplast::read(), seismtool::read(), scaldamcc::read(), scaldam::read(), relaxeuroc::read(), probdesc::read(), pointoutm::read(), elemoutgm::read(), elemoutm::read(), nodeoutgm::read(), nodeoutm::read(), outdriverm::read(), outdiagm::read(), ortodamrot::read(), ortodam::read(), normmat::read(), nonlocplast::read(), nonlocmicroM4::read(), nonlocdamg::read(), nonlinman::read(), node::read(), mohrcoulombpar::read(), mohrcoulomb::read(), microSIM::read(), microM4::read(), microfiber::read(), mechtop::read(), mechcrsec::read(), mechbclc::read(), loadn::read(), loadel::read(), loadcase::read(), lenjonesmat::read(), lemaitre::read(), j2flow2::read(), j2flow::read(), intpoints::read(), inicd::read(), hypoplast::read(), hissplas::read(), hardsoft::read(), graphmat::read(), glasgowdam::read(), glasgmech::read(), geoelastmat::read(), fixortodam::read(), element::read(), elastortomat::read(), elastisomat::read(), elastgmat3d::read(), eigvalsol::read(), effstress::read(), drprag::read(), dloadn::read(), dloadcase::read(), crsecplstr::read(), crsecnod::read(), crseclayer::read(), crsec3dbeam::read(), crsec3d::read(), crsec2dbeam::read(), crsec2dbar::read(), creepbs::read(), creepb::read(), rspecmat::read(), dplmat::read(), b3mat::read(), contactmat::read(), consol::read(), chen::read(), cebfipcontactmat::read(), cebfip78::read(), camclaycoup::read(), camclay::read(), boermat::read(), anisodamrot::read(), anisodam::read(), aci78::read(), tempload::read(), hangnode::read(), entityload::read(), dbmat::read(), matr::read(), dbcrs::read(), csec::read(), bocon::read(), drprag2::read(), doubdp::read(), layplate::read(), atsel::read(), timecontr::read(), tablefunct::read(), slesolv::read(), seqschur::read(), sel::read(), precond::read(), seqfeti::read(), itablefunct::read(), hdbcontr::read(), gnode::read(), gfunct::read(), gelement::read(), fuzzynum::read(), fuzzygen::read(), aggregator::read(), seqfeti::read_booldata(), climatcond2::read_climatic_files(), climatcond::read_climatic_files(), tablefunct::read_data_file(), mechbclc::read_eigenstrains(), seqtop::read_eldom(), gtopology::read_gf(), gelement::read_gf(), read_inicd_file(), seqtop::read_ltg(), seqtop::read_nnsd(), loadel::read_prep(), nonlinman::read_seldof(), nonlinman::read_seldofcoord(), nonlinman::read_selnod(), gtopology::read_seq_top(), saltmat4::read_Sourcet(), transcrsec::readcrsectype(), mechcrsec::readcrsectype(), loadel::readedgeload(), mechbclc::readinic(), adaptivityt::readinit(), adaptivity::readinit(), readm(), elementt::readmat(), elementc::readmat(), element::readmat(), transmat::readmatchar(), coupmatu::readmatchar(), coupmatl::readmatchar(), mechmat::readmatchar(), transmat::readmattype(), mechmat::readmattype(), dbcrs::readmc(), dbmat::readmm(), loadel::readsurfaceload(), stochdrivert::readtable(), dbcrst::readtc(), dbmatt::readtm(), readv(), tablefunct::readval(), and loadel::readvolumeload().


Generated by  doxygen 1.6.2