TheBoussinesqModel
3.2.1
|
Go to the source code of this file.
long binarywrite_charvector_elements | ( | FILE * | output, |
CHARVECTOR * | v | ||
) |
Write a vector of char to a file in binary mode
Definition at line 937 of file t_io.c.
References CHARVECTOR::co, CHARVECTOR::isdynamic, CHARVECTOR::nh, CHARVECTOR::nl, and t_error().
long binarywrite_doublebin_elements | ( | FILE * | output, |
DOUBLEBIN * | l | ||
) |
Write a list of double to a file
Here is still missing a check that output was open as "wb"
Definition at line 2523 of file t_io.c.
References LONGVECTOR::co, db::co, db::index, db::isdynamic, and t_error().
long binarywrite_doublematrix_elements | ( | FILE * | output, |
DOUBLEMATRIX * | m | ||
) |
Write a matrix of double to a file
Definition at line 1803 of file t_io.c.
References DOUBLEMATRIX::co, DOUBLEMATRIX::isdynamic, DOUBLEMATRIX::nch, DOUBLEMATRIX::ncl, DOUBLEMATRIX::nrh, DOUBLEMATRIX::nrl, and t_error().
long binarywrite_doublevector_elements | ( | FILE * | output, |
DOUBLEVECTOR * | v | ||
) |
Write a vector of double to a file in binary mode
Definition at line 786 of file t_io.c.
References DOUBLEVECTOR::co, DOUBLEVECTOR::isdynamic, DOUBLEVECTOR::nh, DOUBLEVECTOR::nl, and t_error().
long binarywrite_floatmatrix_elements | ( | FILE * | output, |
FLOATMATRIX * | m | ||
) |
Write a matrix of float to a file
Definition at line 1632 of file t_io.c.
References FLOATMATRIX::co, FLOATMATRIX::isdynamic, FLOATMATRIX::nch, FLOATMATRIX::ncl, FLOATMATRIX::nrh, FLOATMATRIX::nrl, and t_error().
long binarywrite_floatvector_elements | ( | FILE * | output, |
FLOATVECTOR * | v | ||
) |
Write a vector of float to a file in binary mode
Definition at line 635 of file t_io.c.
References FLOATVECTOR::co, FLOATVECTOR::isdynamic, FLOATVECTOR::nh, FLOATVECTOR::nl, and t_error().
long binarywrite_intbin_elements | ( | FILE * | output, |
INTBIN * | l | ||
) |
Write a list of int to a file
Here is still missing a check that output was open as "wb"
Definition at line 1980 of file t_io.c.
References LONGVECTOR::co, INTBIN::co, INTBIN::index, INTBIN::isdynamic, and t_error().
long binarywrite_intmatrix_elements | ( | FILE * | output, |
INTMATRIX * | m | ||
) |
Write a matrix of int to a file
Definition at line 1281 of file t_io.c.
References INTMATRIX::co, INTMATRIX::isdynamic, INTMATRIX::nch, INTMATRIX::ncl, INTMATRIX::nrh, INTMATRIX::nrl, and t_error().
long binarywrite_intvector_elements | ( | FILE * | output, |
INTVECTOR * | v | ||
) |
Write a vector of int to a file in binary mode
Definition at line 334 of file t_io.c.
References INTVECTOR::co, INTVECTOR::isdynamic, INTVECTOR::nh, INTVECTOR::nl, and t_error().
long binarywrite_longbin_elements | ( | FILE * | output, |
LONGBIN * | l | ||
) |
Write a list of long to a file
Here is still missing a check that output was open as "wb"
Definition at line 2342 of file t_io.c.
References LONGVECTOR::co, LONGBIN::co, LONGBIN::index, LONGBIN::isdynamic, and t_error().
long binarywrite_longmatrix_elements | ( | FILE * | output, |
LONGMATRIX * | m | ||
) |
Write a matrix of long to a file
Definition at line 1455 of file t_io.c.
References LONGMATRIX::co, LONGMATRIX::isdynamic, LONGMATRIX::nch, LONGMATRIX::ncl, LONGMATRIX::nrh, LONGMATRIX::nrl, and t_error().
long binarywrite_longvector_elements | ( | FILE * | output, |
LONGVECTOR * | v | ||
) |
Write a vector of long to a file in binary mode
Definition at line 485 of file t_io.c.
References LONGVECTOR::co, LONGVECTOR::isdynamic, LONGVECTOR::nh, LONGVECTOR::nl, and t_error().
long binarywrite_shortbin_elements | ( | FILE * | output, |
SHORTBIN * | l | ||
) |
Write a list of short to a file
Here is still missing a check that output was open as "wb"
Definition at line 2161 of file t_io.c.
References LONGVECTOR::co, SHORTBIN::co, SHORTBIN::index, SHORTBIN::isdynamic, and t_error().
long binarywrite_shortmatrix_elements | ( | FILE * | output, |
SHORTMATRIX * | m | ||
) |
Write a matrix of shorts to a file
Definition at line 1110 of file t_io.c.
References SHORTMATRIX::co, SHORTMATRIX::isdynamic, SHORTMATRIX::nch, SHORTMATRIX::ncl, SHORTMATRIX::nrh, SHORTMATRIX::nrl, and t_error().
long binarywrite_shortvector_elements | ( | FILE * | output, |
SHORTVECTOR * | v | ||
) |
Write a vector of short int to a file in binary mode
Definition at line 181 of file t_io.c.
References SHORTVECTOR::co, SHORTVECTOR::isdynamic, SHORTVECTOR::nh, SHORTVECTOR::nl, and t_error().
int copy_buffer_into_stringbin | ( | char * | buffer, |
STRINGBIN * | l | ||
) |
Name: copy_buffer_into_stringbin
Synopsis: int copy_buffer_into_stringbin(char *,STRINGBIN *);
Version: 1.0
Description: In order to read a fixed number of strings whose
length is unknown, a buffer is inizialized and filled with the strings
reallocating each time is necessary a certain amount of memory
specified in the global variable BUFFER_INCREMENT. A buffer is termined
by a null character. Each string is separated by another by a whitespace
(in the sense of iswhitespace() - e.g. Harbison and Steele, 1995). While
reading them is kept track of the length of each string and the suitable
vector index for the string bin is inizialized (note: the number of string
must be known in advance). Finally one has to copy the content of the buffer
into its stringbin.
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Authors & Date: Riccardo Rigon, August 1997
Inputs: read_: A pointer to the buffer and a pointer to the stringbin.
Return: 1 if successful (otherwise it aborts).
See Also: iswhitespace, read_stringbin, print_stringbin_elements
Keywords: buffer, strings
Examples: 3.examples.c
Definition at line 2830 of file t_io.c.
References co, st::co, st::index, st::isdynamic, OK, and t_error().
Referenced by read_plane_strings(), and read_plane_strings_restricted().
char* get_filename | ( | char * | working_directory, |
char * | program | ||
) |
Name: get_filename
Synopsis: char *get_filename(char *WORKING_DIRECTORY,char *program);
Version: 0.8
Description: get_filename returns the full name of a file to work with. It is intended to be a platform
independent way to store input/output file names in a file. Thus avoiding to specify them on the standard input every
time the program is executed (this is particularly useful when the same program with the same inputs is executed several times).
The working directory (the variable: WORKING_DIRECTORY )is specified in the file
$PathFile that has to be placed in the directory where the programs are (Windows95/NT or Mac OS) or in the
current directory (Unixes). The file names are instead stored in a file whose name is $program where "program" is the
name of the program being executed.
Authors & Date : Riccardo Rigon, April 1998
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Inputs:
1) The pointer to working directory name
2) The pointer to the name of the program being executed
Return: the requested name
See Also: simplefind, get_parameter, get_string
Definition at line 3058 of file t_io.c.
References st::co, IO_FILES_COUNTER, join_strings(), NOPRINT, read_stringarray(), simplefind(), t_error(), t_fclose(), and WORKING_POSITION.
double get_parameter | ( | char * | working_directory, |
char * | program | ||
) |
Name: get_parameter
Synopsis: double *get_parameter(char *WORKING_DIRECTORY,char *program);
Version: 0.8
Description: get_parameter returns a requested parameter. It is intended to be a platform
independent way to store program parameter values in a file without having to specify them on the standard input every
time the program is executed. The working directory (the variable: WORKING_DIRECTORY )is specified in the file
$PathFile that has to be placed in the directory where the programs are (Windows95/NT or Mac OS) or in the
current directory (Unixes). The file names are instead stored in a file whose name is $program where "program" is the
name of the program being executed. Every parameter is first read as a double but assignement to a different type
of variable is possible
Authors & Date: Riccardo Rigon, April 1998
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Inputs:
1) The pointer to working directory name
2) The pointer to the name of the program being executed
Return: the requested variable
See Also: simplefind, get_filename, get_string
Definition at line 3126 of file t_io.c.
References DOUBLEVECTOR::co, IO_PARMS_COUNTER, join_strings(), NOPRINT, read_doublearray(), simplefind(), t_error(), t_fclose(), and WORKING_POSITION.
char* get_phrase | ( | FILE * | inputfile, |
const char | separator | ||
) |
isspace(label[i-1]) &&
Definition at line 3400 of file t_io.c.
References join_strings(), LABELINCREMENT, MAXLABELSIZE, skip_whitespaces(), t_error(), and WORKING_DIRECTORY.
Referenced by justread_floatmatrix(), read_charvector(), read_doublematrix(), read_doubletensor(), read_doublevector(), read_floatmatrix(), read_floatvector(), read_intmatrix(), read_intvector(), read_longmatrix(), read_longvector(), read_shortmatrix(), and read_shortvector().
char* get_strings | ( | char * | working_directory, |
char * | program | ||
) |
Name: char *get_string
Synopsis: char *get_string(char *WORKING_DIRECTORY,char *program);
Version: 0.8
Description: get_string returns a string needed by a program. It is intended to be a platform
independent way to store strings in a file without having to specify them on the standard input every
time the program is executed. The strings are stored in a file whose name is $program where "program" is the
name of the program being executed.
Authors & Date: Riccardo Rigon, April 1998
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Inputs:
1) The pointer to working directory name
2) The pointer to the name of the program being executed
Return: the requested string
See Also: simplefind, get_filename, get_parameter
Definition at line 3170 of file t_io.c.
References st::co, IO_FILES_COUNTER, join_strings(), NOPRINT, read_stringarray(), simplefind(), t_error(), t_fclose(), and WORKING_POSITION.
char* get_workingdirectory | ( | void | ) |
Names: get_workingdirectory
Synopsis: char *get_workingdirectory(void );
Version: 1.0
Description: It asks for the working directory, i.e. the directory where inputs data are stored.
This directory can be alternatively specified in a file $WorkingPaths to be found in the executable directory
(for Windows or Mac systems where it is useful. In Unix systems it can be also the directory from where
the program containing this routine is called)
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Inputs: void
Return: a pointer to the resulting string (the working directory )
Examples: 1.examples.c
Authors & Date: Riccardo Rigon, October 1997
Definition at line 2992 of file t_io.c.
References t_error().
void goto_EOF | ( | FILE * | inputfile) |
Name: goto_EOF
Synopsis: void goto_EOF(FILE *);
Version: 1.0
Description: skips the whitespaces in a file and exits when a
normal character or EOF is found. It is very similar to skip_whitespaces.
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Authors & Date: Riccardo Rigon, February 1997
Inputs: the pointer to the opened file
Return: void
See Also: read_comment, iscomment, goto_EOF
Definition at line 2927 of file t_io.c.
Referenced by read_charvector(), and read_intbin().
short header_name_scan | ( | FILE * | , |
HEADER | |||
) |
int header_scan | ( | FILE * | inputfile, |
HEADER * | h | ||
) |
Name: header_scan
Version: 1.0
Description: reads the first part of a header
Authors & Date: Riccardo Rigon, September 1997
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Inputs: the pointer to the file where the header is stored
and the pointer to the HEADER variable where to write read information
Return: 1 if successfull
See Also: read_header.
Keywords: turtle file
Examples: 1.example.c
Definition at line 4504 of file t_io.c.
References HEADER::category, t_keywords::category, HEADER::gender, t_keywords::gender, iscomment(), MAX_KEYWORD_LENGTH, MAXBUFFERSIZE, HEADER::name, NOPRINT, HEADER::number, OK, query_for_label(), read_comment(), skip_whitespaces(), t_error(), T_KEYWORDS, HEADER::type, and t_keywords::type.
Referenced by justread_chararray(), justread_floatarray(), justread_longarray(), read_doublearray(), read_floatarray(), read_longarray(), read_matrixheader(), read_shortarray(), read_stringarray(), read_tensorheader(), read_vectorheader(), search_array(), and search_named_array().
Name: headercmp
Synopsis: long headercmp(HEADER *,HEADER *);
Version: 1.0
Descriptiontion: compares two HEADERS. They
are said to be equal if they have the same type,
gender, category and name (they possibly differ
for the number that indicate their position in
the file.
Authors & Date: Riccardo Rigon, September 1997
Inputs: the pointers to the two header to compare
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Return: 0 if the HEADER are equal, a suitable number
if some difference is found. This number is the
result of four comparison operation. Each one returns
zero if successful. Otherwise it is returned: 1
if the two headers differ for type, 10 if they differ
for gender, 1000 if they differ for category,
10000 if they differ for name. If more that one comparison
is unsuccessful the returned value is the sum of
the unseccesful comparison value, i.e. 11 means that
the two headers differs for type and gender.
See Also: read_comment, read_header.
Keywords: turtle file
Examples: 1.example.c
Definition at line 4943 of file t_io.c.
References HEADER::category, HEADER::dimensions, HEADER::gender, HEADER::name, t_error(), and HEADER::type.
Referenced by justread_floatmatrix(), read_charvector(), read_doublematrix(), read_doubletensor(), read_doublevector(), read_floatmatrix(), read_floatvector(), read_intmatrix(), read_intvector(), read_longmatrix(), read_longvector(), read_shortmatrix(), and read_shortvector().
int iscomment | ( | char * | buffer, |
FILE * | inputfile | ||
) |
Name: iscomment
Synopsis: int iscomment(char *,FILE *);
Version: 1.0
Description: inspect a file a look for the string that starts
a comment ( / ** without space)
Authors & Date: Riccardo Rigon, February 1997
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Inputs: a buffer where to store the comment and the pointer to the opened
file
Return: 1 if successful 0 otherwise
See Also: read_comment, skip_whitespaces
Definition at line 2959 of file t_io.c.
References skip_whitespaces().
Referenced by header_scan(), read_comment(), read_index(), and readandstore_comment().
char* join_strings | ( | char * | first, |
char * | second | ||
) |
Names: join_strings
Synopsis: char * join_strings(char *,char *);
Version: 1.0
Description: joins two strings and store the results in a third string.
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Inputs: the two strings to be joined.
Return: a pointer to the resulting string
Examples: 1.examples.c
Authors & Date: Riccardo Rigon, October 1997
Definition at line 3039 of file t_io.c.
Referenced by doublematrix_control(), doublematrix_dem(), doublematrix_dem3(), doubletensor_dem(), doublevector_dem(), error_message(), existing_file(), existing_file_text(), floatmatrix_dem(), floatvector_dem(), get_dirichletsnode(), get_doublesquare_grid(), get_filename(), get_filenames_from_keys(), get_parameter(), get_phrase(), get_sources(), get_strings(), intmatrix_dem(), join_path_to_stringbin(), longmatrix_dem(), namefile_i(), namefile_i_we(), namefile_i_we2(), Newton_convergence(), read_doublesquare_grid(), read_esriascii(), read_filenames(), read_grassascii(), read_grid(), read_map(), read_mapseries(), read_maptensor(), read_names(), read_parameters(), shortmatrix_dem(), shortmatrix_dem3(), write_esriascii(), write_fluidturtle(), write_grassascii(), write_line_map(), write_map_results(), write_mapseries(), write_tensorseries(), and write_tensorseries_bis().
void justread_chararray | ( | FILE * | inputfile, |
CHARVECTOR * | vec, | ||
short | |||
) |
Definition at line 6712 of file t_io.c.
References HEADER::category, CHARVECTOR::co, header_scan(), CHARVECTOR::isdynamic, CHARVECTOR::nh, print_header(), skip_whitespaces(), t_error(), and HEADER::type.
void justread_floatarray | ( | FILE * | inputfile, |
FLOATVECTOR * | vec, | ||
short | |||
) |
Name: justread_floatarray, justread_chararray, justread_longarray
Synopsis: void justread_floatarray(FILE *,FLOATVECTOR *,short );
Version: 1.0
Description: works as read_** but assumes that the vector containing
the data has been already allocated
Authors & Date: Riccardo Rigon, November 1997
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Inputs: a pointer to a file, a pointer to the allocated strucure, PRINT or NOPRINT
to indicate if the header specification are printed on the standard output
Return: void
See Also: read_comment, read_header, read__.
Keywords: turtle file
Examples: 5.example.c 6.example.c
Notes: only long, char and float array reading is implemented
Definition at line 6600 of file t_io.c.
References HEADER::category, FLOATVECTOR::co, header_scan(), FLOATVECTOR::isdynamic, FLOATVECTOR::nh, print_header(), skip_whitespaces(), t_error(), and HEADER::type.
void justread_floatmatrix | ( | FILE * | inputfile, |
FLOATMATRIX * | C, | ||
char * | mode, | ||
short | |||
) |
Definition at line 6642 of file t_io.c.
References HEADER::category, HEADER::dimensions, EXTERNAL_FILE, EXTERNAL_FILE_NAME, EXTERNAL_FILE_POSITION, free_header(), get_phrase(), headercmp(), NOPRINT, OLD_NAME, OPENYES, print_header(), query_for_token(), read_floatmatrix_elements(), read_index(), read_matrixheader(), skip_whitespaces(), t_error(), t_fclose(), t_fopen(), and HEADER::type.
void justread_longarray | ( | FILE * | inputfile, |
LONGVECTOR * | vec, | ||
short | |||
) |
Definition at line 6546 of file t_io.c.
References HEADER::category, LONGVECTOR::co, header_scan(), LONGVECTOR::isdynamic, LONGVECTOR::nh, print_header(), skip_whitespaces(), t_error(), and HEADER::type.
long longvectorcmp | ( | LONGVECTOR * | A, |
LONGVECTOR * | B | ||
) |
Name: longvectorcmp
Synopsis: long longvectorcmp(LONGVECTOR *, LONGVECTOR *);
Version: 1.0
Description: compares two lonvector. This routine is used
in read_*bin
Authors & Date: Riccardo Rigon, September 1997
Inputs: the pointers to the two header to compare
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Return: 0 if the longvector are equal, a suitable number
if some difference is found.
See Also: read_comment, read_header, header_cmp.
Keywords: turtle file
Examples: 1.example.c
Definition at line 2873 of file t_io.c.
References LONGVECTOR::co, LONGVECTOR::isdynamic, and LONGVECTOR::nh.
Referenced by read_doublebin(), read_intbin(), read_longbin(), and read_shortbin().
void print_charvector_elements | ( | CHARVECTOR * | v, |
long | maxcols | ||
) |
Definition at line 977 of file t_io.c.
References CHARVECTOR::co, CHARVECTOR::isdynamic, CHARVECTOR::nh, CHARVECTOR::nl, and t_error().
void print_doublebin_elements | ( | DOUBLEBIN * | l, |
long | maxcols | ||
) |
void print_doublematrix_elements | ( | DOUBLEMATRIX * | m, |
long | maxcols | ||
) |
Definition at line 1844 of file t_io.c.
References DOUBLEMATRIX::co, DOUBLEMATRIX::isdynamic, DOUBLEMATRIX::nch, DOUBLEMATRIX::ncl, DOUBLEMATRIX::nrh, DOUBLEMATRIX::nrl, and t_error().
void print_doubletensor_elements | ( | DOUBLETENSOR * | m, |
long | maxcols | ||
) |
Definition at line 11013 of file t_io.c.
References DOUBLETENSOR::co, DOUBLETENSOR::isdynamic, DOUBLETENSOR::nch, DOUBLETENSOR::ncl, DOUBLETENSOR::ndl, DOUBLETENSOR::nrh, DOUBLETENSOR::nrl, and t_error().
void print_doublevector_elements | ( | DOUBLEVECTOR * | v, |
long | maxcols | ||
) |
Definition at line 826 of file t_io.c.
References DOUBLEVECTOR::co, DOUBLEVECTOR::isdynamic, DOUBLEVECTOR::nh, DOUBLEVECTOR::nl, and t_error().
void print_floatmatrix_elements | ( | FLOATMATRIX * | m, |
long | maxcols | ||
) |
Definition at line 1673 of file t_io.c.
References FLOATMATRIX::co, FLOATMATRIX::isdynamic, FLOATMATRIX::nch, FLOATMATRIX::ncl, FLOATMATRIX::nrh, FLOATMATRIX::nrl, and t_error().
void print_floatvector_elements | ( | FLOATVECTOR * | v, |
long | maxcols | ||
) |
Definition at line 675 of file t_io.c.
References FLOATVECTOR::co, FLOATVECTOR::isdynamic, FLOATVECTOR::nh, FLOATVECTOR::nl, and t_error().
void print_header | ( | HEADER * | H) |
Definition at line 10616 of file t_io.c.
References HEADER::category, t_keywords::category, HEADER::gender, t_keywords::gender, HEADER::name, HEADER::number, T_KEYWORDS, HEADER::type, and t_keywords::type.
Referenced by justread_chararray(), justread_floatarray(), justread_floatmatrix(), justread_longarray(), read_charvector(), read_doublearray(), read_doublematrix(), read_doubletensor(), read_doublevector(), read_floatarray(), read_floatmatrix(), read_floatvector(), read_intmatrix(), read_intvector(), read_longarray(), read_longmatrix(), read_longvector(), read_shortarray(), read_shortmatrix(), read_shortvector(), and read_stringarray().
void print_intbin_elements | ( | INTBIN * | l, |
long | maxcols | ||
) |
Definition at line 2026 of file t_io.c.
References co, INTBIN::co, INTBIN::index, INTBIN::isdynamic, and t_error().
void print_intmatrix_elements | ( | INTMATRIX * | m, |
long | maxcols | ||
) |
Definition at line 1322 of file t_io.c.
References INTMATRIX::co, INTMATRIX::isdynamic, INTMATRIX::nch, INTMATRIX::ncl, INTMATRIX::nrh, INTMATRIX::nrl, and t_error().
void print_intvector_elements | ( | INTVECTOR * | v, |
long | maxcols | ||
) |
Definition at line 374 of file t_io.c.
References INTVECTOR::co, INTVECTOR::isdynamic, INTVECTOR::nh, INTVECTOR::nl, and t_error().
void print_longbin_elements | ( | LONGBIN * | l, |
long | maxcols | ||
) |
Definition at line 2388 of file t_io.c.
References co, LONGBIN::co, LONGBIN::index, LONGBIN::isdynamic, and t_error().
void print_longmatrix_elements | ( | LONGMATRIX * | m, |
long | maxcols | ||
) |
Definition at line 1496 of file t_io.c.
References LONGMATRIX::co, LONGMATRIX::isdynamic, LONGMATRIX::nch, LONGMATRIX::ncl, LONGMATRIX::nrh, LONGMATRIX::nrl, and t_error().
void print_longvector_elements | ( | LONGVECTOR * | v, |
long | maxcols | ||
) |
Definition at line 525 of file t_io.c.
References LONGVECTOR::co, LONGVECTOR::isdynamic, LONGVECTOR::nh, LONGVECTOR::nl, and t_error().
Referenced by addresses_bubble_sort(), bubble_sort(), print_stringbin_elements(), read_doublebin(), read_intbin(), read_longbin(), and read_shortbin().
void print_shortbin_elements | ( | SHORTBIN * | l, |
long | maxcols | ||
) |
Definition at line 2207 of file t_io.c.
References co, SHORTBIN::co, SHORTBIN::index, SHORTBIN::isdynamic, and t_error().
void print_shortmatrix_elements | ( | SHORTMATRIX * | m, |
long | maxcols | ||
) |
Definition at line 1151 of file t_io.c.
References SHORTMATRIX::co, SHORTMATRIX::isdynamic, SHORTMATRIX::nch, SHORTMATRIX::ncl, SHORTMATRIX::nrh, SHORTMATRIX::nrl, and t_error().
void print_shortvector_elements | ( | SHORTVECTOR * | v, |
long | maxcols | ||
) |
Definition at line 221 of file t_io.c.
References SHORTVECTOR::co, SHORTVECTOR::isdynamic, SHORTVECTOR::nh, SHORTVECTOR::nl, and t_error().
void print_stringbin_elements | ( | STRINGBIN * | l, |
long | maxcols | ||
) |
Definition at line 2797 of file t_io.c.
References co, st::co, st::index, st::isdynamic, print_longvector_elements(), and t_error().
char* query_for_label | ( | FILE * | inputfile) |
Definition at line 3278 of file t_io.c.
References LABELINCREMENT, MAXLABELSIZE, skip_whitespaces(), and t_error().
Referenced by header_scan(), read_doublebin(), read_intbin(), read_longbin(), and read_shortbin().
int query_for_token | ( | FILE * | inputfile, |
const char * | token | ||
) |
Name: query_for_token, query_for_label, get_phrase
Description: ask the file to receive either a known word (query_for_token)
or an unknown sequence of words terminated by a '{' (query for label) or
a sequence of words terminated by a given separator (get_phrase).
Authors & Date: Riccardo Rigon, February, September 1997
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Inputs: a pointer to a file, the word to be searched; a pointer to a file.
get_phrase second input is the separator, for instance: ';'.
Return: 1 if succesfull 0 otherwise ; the read word or NOLABEL in case
of failure.
See Also: read_comment, read_header
Keywords: turtle file
Definition at line 3522 of file t_io.c.
References skip_whitespaces().
Referenced by justread_floatmatrix(), read_charvector(), read_doublebin(), read_doublematrix(), read_doubletensor(), read_doublevector(), read_floatmatrix(), read_floatvector(), read_index(), read_intbin(), read_intmatrix(), read_intvector(), read_longbin(), read_longmatrix(), read_longvector(), read_shortbin(), read_shortmatrix(), and read_shortvector().
char* read_buffer_from_stdio | ( | long | maxbuffersize) |
Names: read_buffer_from stdio
Synopsis: char *read_buffer_from stdio(long maxbufferzsize)
Version: 1.0
Description: reads from the standard input a comment. It is opened by and closed the same way
this comment is.
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Inputs: maxbuffersize is the length of the maximum number of characters
Return: a pointer to the buffer stored
Examples: matrixconverter.c
Authors & Date: Riccardo Rigon, October 1997
Definition at line 4256 of file t_io.c.
References BUFFERINCREMENT, and t_error().
CHARVECTOR* read_chararray | ( | FILE * | , |
short | |||
) |
CHARVECTOR* read_charvector | ( | FILE * | inputfile, |
char * | mode, | ||
short | |||
) |
Definition at line 6992 of file t_io.c.
References HEADER::category, HEADER::dimensions, EXTERNAL_FILE, EXTERNAL_FILE_NAME, EXTERNAL_FILE_POSITION, free_header(), get_phrase(), goto_EOF(), headercmp(), new_charvector(), NOPRINT, OLD_NAME, OPENYES, print_header(), query_for_token(), read_charvector_elements(), read_index(), read_vectorheader(), skip_whitespaces(), t_error(), t_fclose(), t_fopen(), and HEADER::type.
long read_charvector_elements | ( | FILE * | input, |
CHARVECTOR * | v, | ||
char * | mode | ||
) |
It reads a vector of char numbers and returns the number of elements read. Storage mode can be either ascii or binary.
Definition at line 854 of file t_io.c.
References CHARVECTOR::co, CHARVECTOR::isdynamic, CHARVECTOR::nh, CHARVECTOR::nl, and t_error().
Referenced by read_charvector().
int read_comment | ( | FILE * | inputfile, |
int | opt, | ||
long | maxbuffersize, | ||
short | |||
) |
Name: read_comment, readandstore_comment
Synopsis:
int read_comment(FILE *,int, long, short );
char * readandstore_comment(FILE *,int, long);++++
Version: 1.0
Description: reads a comment from a turtle file. read_comment prints it on the screen, readandstore_comment
save it in a dynamically allocated buffer pointed by the return value.
Authors & Date: Riccardo Rigon, February, September, November 1997
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Inputs: a pointer to the file to be read, 1 or 0, the maximum length
of the comment to be printed. If 1 the text read is checked to be a comment
(i.e. the program looks for the string / ** without space ). If 0 the check is suppressed.
Return: read_comment: 1 if successful 0 otherwise; readandstore_comment a pointer to a buffer that
contains the data read
See Also: iscomment, skip_whitespaces
Examples: read_
References:
Definition at line 3571 of file t_io.c.
References BUFFERINCREMENT, iscomment(), and t_error().
Referenced by header_scan(), and read_index().
DOUBLEVECTOR* read_doublearray | ( | FILE * | inputfile, |
short | |||
) |
Definition at line 5667 of file t_io.c.
References BUFFERINCREMENT, HEADER::category, DOUBLEVECTOR::co, free_header(), header_scan(), MAXBUFFERSIZE, new_doublevector(), print_header(), skip_whitespaces(), t_error(), and HEADER::type.
Referenced by get_parameter(), get_s_times(), read_b_parameters_ft(), read_connections(), read_doublevector_from_a_ft_format_single_file(), read_map(), read_parameters(), and read_polygon().
DOUBLEBIN* read_doublebin | ( | FILE * | inputfile, |
char * | mode, | ||
short | |||
) |
Definition at line 9919 of file t_io.c.
References EXTERNAL_FILE, EXTERNAL_FILE_NAME, EXTERNAL_FILE_POSITION, free_header(), free_longvector(), longvectorcmp(), new_doublebin(), NOPRINT, OLD_NAME, OPENYES, print_longvector_elements(), query_for_label(), query_for_token(), read_doublebin_elements(), read_index(), read_longarray(), skip_whitespaces(), t_error(), t_fclose(), and t_fopen().
long read_doublebin_elements | ( | FILE * | input, |
DOUBLEBIN * | l, | ||
char * | mode | ||
) |
Definition at line 2417 of file t_io.c.
References co, LONGVECTOR::co, db::co, db::index, db::isdynamic, and t_error().
Referenced by read_doublebin().
DOUBLEMATRIX* read_doublematrix | ( | FILE * | inputfile, |
char * | mode, | ||
short | |||
) |
Definition at line 9166 of file t_io.c.
References HEADER::category, HEADER::dimensions, EXTERNAL_FILE, EXTERNAL_FILE_NAME, EXTERNAL_FILE_POSITION, free_header(), get_phrase(), headercmp(), new_doublematrix(), NOPRINT, OLD_NAME, OPENYES, print_header(), query_for_token(), read_doublematrix_elements(), read_index(), read_matrixheader(), skip_whitespaces(), t_error(), t_fclose(), t_fopen(), and HEADER::type.
Referenced by read_linevector(), and read_map().
long read_doublematrix_elements | ( | FILE * | input, |
DOUBLEMATRIX * | m, | ||
char * | mode | ||
) |
Read a matrix of double numbers
Definition at line 1704 of file t_io.c.
References DOUBLEMATRIX::co, DOUBLEMATRIX::isdynamic, DOUBLEMATRIX::nch, DOUBLEMATRIX::ncl, DOUBLEMATRIX::nrh, DOUBLEMATRIX::nrl, and t_error().
Referenced by read_doublematrix().
DOUBLETENSOR* read_doubletensor | ( | FILE * | inputfile, |
char * | mode, | ||
short | |||
) |
Definition at line 11048 of file t_io.c.
References HEADER::category, HEADER::dimensions, EXTERNAL_FILE, EXTERNAL_FILE_NAME, EXTERNAL_FILE_POSITION, free_header(), get_phrase(), headercmp(), new_doubletensor(), NOPRINT, OLD_NAME, OPENYES, print_header(), query_for_token(), read_doubletensor_elements(), read_index(), read_matrixheader(), read_tensorheader(), skip_whitespaces(), t_error(), t_fclose(), t_fopen(), and HEADER::type.
long read_doubletensor_elements | ( | FILE * | input, |
DOUBLETENSOR * | m, | ||
char * | mode | ||
) |
Read a matrix of double numbers
Definition at line 10919 of file t_io.c.
References DOUBLETENSOR::co, DOUBLETENSOR::isdynamic, DOUBLETENSOR::nch, DOUBLETENSOR::ncl, DOUBLETENSOR::ndh, DOUBLETENSOR::ndl, DOUBLETENSOR::nrh, DOUBLETENSOR::nrl, and t_error().
Referenced by read_doubletensor().
DOUBLEVECTOR* read_doublevector | ( | FILE * | inputfile, |
char * | mode, | ||
short | |||
) |
Definition at line 8141 of file t_io.c.
References HEADER::category, HEADER::dimensions, EXTERNAL_FILE, EXTERNAL_FILE_NAME, EXTERNAL_FILE_POSITION, free_header(), get_phrase(), headercmp(), new_doublevector(), NOPRINT, OLD_NAME, OPENYES, print_header(), query_for_token(), read_doublevector_elements(), read_index(), read_vectorheader(), skip_whitespaces(), t_error(), t_fclose(), t_fopen(), and HEADER::type.
long read_doublevector_elements | ( | FILE * | input, |
DOUBLEVECTOR * | v, | ||
char * | mode | ||
) |
It reads a vector of float numbers and returns the number of elements read. Storage mode can be either ascii or binary.
Definition at line 703 of file t_io.c.
References DOUBLEVECTOR::co, DOUBLEVECTOR::isdynamic, DOUBLEVECTOR::nh, DOUBLEVECTOR::nl, and t_error().
Referenced by read_doublevector().
STRINGBIN* read_filenames | ( | char * | working_directory, |
char * | program, | ||
char * | extension, | ||
char * | position | ||
) |
Definition at line 3230 of file t_io.c.
References st::co, st::index, join_strings(), LONGVECTOR::nh, NOPRINT, read_stringarray(), simplefind(), and t_error().
FLOATVECTOR* read_floatarray | ( | FILE * | inputfile, |
short | |||
) |
Definition at line 5344 of file t_io.c.
References BUFFERINCREMENT, HEADER::category, FLOATVECTOR::co, header_scan(), MAXBUFFERSIZE, new_floatvector(), print_header(), skip_whitespaces(), t_error(), and HEADER::type.
FLOATMATRIX* read_floatmatrix | ( | FILE * | inputfile, |
char * | mode, | ||
short | |||
) |
Definition at line 9092 of file t_io.c.
References HEADER::category, HEADER::dimensions, EXTERNAL_FILE, EXTERNAL_FILE_NAME, EXTERNAL_FILE_POSITION, free_header(), get_phrase(), headercmp(), new_floatmatrix(), NOPRINT, OLD_NAME, OPENYES, print_header(), query_for_token(), read_floatmatrix_elements(), read_index(), read_matrixheader(), skip_whitespaces(), t_error(), t_fclose(), t_fopen(), and HEADER::type.
long read_floatmatrix_elements | ( | FILE * | input, |
FLOATMATRIX * | m, | ||
char * | mode | ||
) |
Read a matrix of floating point numbers
Definition at line 1531 of file t_io.c.
References FLOATMATRIX::co, FLOATMATRIX::isdynamic, FLOATMATRIX::nch, FLOATMATRIX::ncl, FLOATMATRIX::nrh, FLOATMATRIX::nrl, and t_error().
Referenced by justread_floatmatrix(), and read_floatmatrix().
FLOATVECTOR* read_floatvector | ( | FILE * | inputfile, |
char * | mode, | ||
short | |||
) |
Definition at line 7909 of file t_io.c.
References HEADER::category, HEADER::dimensions, EXTERNAL_FILE, EXTERNAL_FILE_NAME, EXTERNAL_FILE_POSITION, free_header(), get_phrase(), headercmp(), new_floatvector(), NOPRINT, OLD_NAME, OPENYES, print_header(), query_for_token(), read_floatvector_elements(), read_index(), read_vectorheader(), skip_whitespaces(), t_error(), t_fclose(), t_fopen(), and HEADER::type.
long read_floatvector_elements | ( | FILE * | input, |
FLOATVECTOR * | v, | ||
char * | mode | ||
) |
It reads a vector of float numbers and returns the number of elements read. Storage mode can be either ascii or binary.
Definition at line 553 of file t_io.c.
References FLOATVECTOR::co, FLOATVECTOR::isdynamic, FLOATVECTOR::nh, FLOATVECTOR::nl, and t_error().
Referenced by read_floatvector().
HEADER read_header | ( | FILE * | , |
const char * | |||
) |
Name: read_header, print_header
Synopsis:
HEADER read_header(FILE *,const char *);
void print_header(HEADER *);
Version: 1.0
Description: read in a turtle file the header
of the stored data. See the file "turtle.dat" for
further details. print_header prints the header
header
Authors & Date: Riccardo Rigon, February, September 1997
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Inputs: read_#: the pointer to the opened file. print_#
the HEADER to be printed
Return: a HEADER
Keywords: turtle file
Examples: 1.example.c
long read_index | ( | FILE * | inputfile, |
short | |||
) |
Name: read_index
Synopsis: long read_index(FILE *);
Version: 1.0
Description: reads the number of data blocks in a file. the format is:
index{a,Nm} where a is the number of blocks and Nm is the type of file. Nm is optional.
Authors & Date: Riccardo Rigon, September 1997
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Inputs: a pointer to a file
Return: the number of blocks or 0 if unsuccessful in reading
See Also: read_comment, read_header
Keywords: turtle file
Examples: 5.example.c 6.example.c
Definition at line 4442 of file t_io.c.
References iscomment(), MAXBUFFERSIZE, query_for_token(), read_comment(), skip_whitespaces(), and t_error().
Referenced by get_filenames_from_keys(), get_s_times(), justread_floatmatrix(), read_b_parameters_ft(), read_charvector(), read_connection_attribute_array(), read_doublebin(), read_doublematrix(), read_doubletensor(), read_doublevector(), read_doublevector_from_a_ft_format_single_file(), read_fine_indices(), read_floatmatrix(), read_floatvector(), read_intbin(), read_intmatrix(), read_intvector(), read_keywords_list(), read_line_indices(), read_linevector(), read_longbin(), read_longmatrix(), read_longvector(), read_map(), read_polygonvector(), read_shortbin(), read_shortmatrix(), and read_shortvector().
INTVECTOR* read_intarray | ( | FILE * | , |
short | |||
) |
Name: read__
Synopsis: INTVECTOR * read_intarray(FILE *,short );
Version: 1.0
Description: read_** reads a data set of the specified type;
Authors & Date: Riccardo Rigon, September 1997
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Inputs: a pointer to a file
Return: the structure read
See Also: read_comment, read_header.
Keywords: turtle file
Examples: 1.example.c
INTBIN* read_intbin | ( | FILE * | inputfile, |
char * | mode, | ||
short | |||
) |
Definition at line 9254 of file t_io.c.
References EXTERNAL_FILE, EXTERNAL_FILE_NAME, EXTERNAL_FILE_POSITION, free_header(), free_longvector(), goto_EOF(), longvectorcmp(), new_intbin(), NOPRINT, OLD_NAME, OPENYES, print_longvector_elements(), query_for_label(), query_for_token(), read_index(), read_intbin_elements(), read_longarray(), skip_whitespaces(), t_error(), t_fclose(), and t_fopen().
long read_intbin_elements | ( | FILE * | input, |
INTBIN * | l, | ||
char * | mode | ||
) |
Definition at line 1874 of file t_io.c.
References co, LONGVECTOR::co, INTBIN::co, INTBIN::index, INTBIN::isdynamic, and t_error().
Referenced by read_intbin().
INTMATRIX* read_intmatrix | ( | FILE * | inputfile, |
char * | mode, | ||
short | |||
) |
Name: read_
Synopsis:
INTMATRIX * read_intmatrix(FILE *, char *,short );
Version: 1.0
Description: read_* reads a data set of the specified type after having allocated an appropriate structure
Authors & Date: Riccardo Rigon, February, September 1997
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Inputs: a pointer to a file (FILE) where the data are, the mode of reading and 1 if
the header is going to be printed , 0 otherwise
Return: the pointer to the appropriate structure where data are stored;
See Also: read_comment, read_header.
Keywords: turtle file
Examples: 1.example.c
Definition at line 8618 of file t_io.c.
References HEADER::category, HEADER::dimensions, EXTERNAL_FILE, EXTERNAL_FILE_NAME, EXTERNAL_FILE_POSITION, free_header(), get_phrase(), headercmp(), new_intmatrix(), NOPRINT, OLD_NAME, OPENYES, print_header(), query_for_token(), read_index(), read_intmatrix_elements(), read_matrixheader(), skip_whitespaces(), t_error(), t_fclose(), t_fopen(), and HEADER::type.
long read_intmatrix_elements | ( | FILE * | input, |
INTMATRIX * | m, | ||
char * | mode | ||
) |
Read a matrix of int numbers
Definition at line 1180 of file t_io.c.
References INTMATRIX::co, INTMATRIX::isdynamic, INTMATRIX::nch, INTMATRIX::ncl, INTMATRIX::nrh, INTMATRIX::nrl, and t_error().
Referenced by read_intmatrix().
INTVECTOR* read_intvector | ( | FILE * | inputfile, |
char * | mode, | ||
short | |||
) |
Definition at line 7442 of file t_io.c.
References HEADER::category, HEADER::dimensions, EXTERNAL_FILE, EXTERNAL_FILE_NAME, EXTERNAL_FILE_POSITION, free_header(), get_phrase(), headercmp(), new_intvector(), NOPRINT, OLD_NAME, OPENYES, print_header(), query_for_token(), read_index(), read_intvector_elements(), read_vectorheader(), skip_whitespaces(), t_error(), t_fclose(), t_fopen(), and HEADER::type.
long read_intvector_elements | ( | FILE * | input, |
INTVECTOR * | v, | ||
char * | mode | ||
) |
It reads a vector of short numbers and returns the number of elements read. Storage mode can be either ascii or binary.
Definition at line 249 of file t_io.c.
References INTVECTOR::co, INTVECTOR::isdynamic, INTVECTOR::nh, INTVECTOR::nl, and t_error().
Referenced by read_intvector().
LONGVECTOR* read_longarray | ( | FILE * | inputfile, |
short | |||
) |
Definition at line 5023 of file t_io.c.
References BUFFERINCREMENT, HEADER::category, LONGVECTOR::co, header_scan(), MAXBUFFERSIZE, new_longvector(), print_header(), skip_whitespaces(), t_error(), and HEADER::type.
Referenced by read_doublebin(), read_intbin(), read_line_indices(), read_longbin(), and read_shortbin().
LONGBIN* read_longbin | ( | FILE * | inputfile, |
char * | mode, | ||
short | |||
) |
Definition at line 9695 of file t_io.c.
References EXTERNAL_FILE, EXTERNAL_FILE_NAME, EXTERNAL_FILE_POSITION, free_header(), free_longvector(), longvectorcmp(), new_longbin(), NOPRINT, OLD_NAME, OPENYES, print_longvector_elements(), query_for_label(), query_for_token(), read_index(), read_longarray(), read_longbin_elements(), skip_whitespaces(), t_error(), t_fclose(), and t_fopen().
long read_longbin_elements | ( | FILE * | input, |
LONGBIN * | l, | ||
char * | mode | ||
) |
Definition at line 2236 of file t_io.c.
References co, LONGVECTOR::co, LONGBIN::co, LONGBIN::index, LONGBIN::isdynamic, and t_error().
Referenced by read_longbin().
LONGMATRIX* read_longmatrix | ( | FILE * | inputfile, |
char * | mode, | ||
short | |||
) |
Definition at line 8856 of file t_io.c.
References HEADER::category, HEADER::dimensions, EXTERNAL_FILE, EXTERNAL_FILE_NAME, EXTERNAL_FILE_POSITION, free_header(), get_phrase(), headercmp(), new_longmatrix(), NOPRINT, OLD_NAME, OPENYES, print_header(), query_for_token(), read_index(), read_longmatrix_elements(), read_matrixheader(), skip_whitespaces(), t_error(), t_fclose(), t_fopen(), and HEADER::type.
Referenced by read_fine_indices().
long read_longmatrix_elements | ( | FILE * | input, |
LONGMATRIX * | m, | ||
char * | mode | ||
) |
Read a matrix of long point numbers
Definition at line 1354 of file t_io.c.
References LONGMATRIX::co, LONGMATRIX::isdynamic, LONGMATRIX::nch, LONGMATRIX::ncl, LONGMATRIX::nrh, LONGMATRIX::nrl, and t_error().
Referenced by read_longmatrix().
LONGVECTOR* read_longvector | ( | FILE * | inputfile, |
char * | mode, | ||
short | |||
) |
Definition at line 7668 of file t_io.c.
References HEADER::category, HEADER::dimensions, EXTERNAL_FILE, EXTERNAL_FILE_NAME, EXTERNAL_FILE_POSITION, free_header(), get_phrase(), headercmp(), new_longvector(), NOPRINT, OLD_NAME, OPENYES, print_header(), query_for_token(), read_index(), read_longvector_elements(), read_vectorheader(), skip_whitespaces(), t_error(), t_fclose(), t_fopen(), and HEADER::type.
long read_longvector_elements | ( | FILE * | input, |
LONGVECTOR * | v, | ||
char * | mode | ||
) |
It reads a vector of long numbers and returns the number of elements read. Storage mode can be either ascii or binary.
Definition at line 402 of file t_io.c.
References LONGVECTOR::co, LONGVECTOR::isdynamic, LONGVECTOR::nh, LONGVECTOR::nl, and t_error().
Referenced by read_longvector().
void read_matrixheader | ( | FILE * | inputfile, |
HEADER * | h | ||
) |
Name: read_header, read_matrix_header,read_vector_header
Version: 1.0
Synopsis:
Description: read a vector, matrix or generic header
Authors & Date: Riccardo Rigon, September 1997
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Inputs: the pointer to the file where the header is stored
and the pointer to the HEADER variable where to write read information
Keywords: turtle file
Examples: 1.example.c
See also: ../HANDMADE/TurtleFile
Definition at line 6885 of file t_io.c.
References HEADER::dimensions, header_scan(), skip_whitespaces(), and t_error().
Referenced by justread_floatmatrix(), read_doublematrix(), read_doubletensor(), read_floatmatrix(), read_intmatrix(), read_longmatrix(), and read_shortmatrix().
DOUBLEVECTOR* read_parameters | ( | char * | working_directory, |
char * | program, | ||
char * | extension, | ||
char * | position | ||
) |
Definition at line 3255 of file t_io.c.
References join_strings(), NOPRINT, read_doublearray(), simplefind(), and t_error().
STRINGBIN* read_plane_strings | ( | FILE * | inputfile, |
long | length, | ||
long | maxbuffersize | ||
) |
Definition at line 2602 of file t_io.c.
References BUFFERINCREMENT, LONGVECTOR::co, copy_buffer_into_stringbin(), free_longvector(), new_longvector(), new_stringbin(), LONGVECTOR::nh, skip_whitespaces(), and t_error().
SHORTVECTOR* read_shortarray | ( | FILE * | inputfile, |
short | |||
) |
Definition at line 5987 of file t_io.c.
References BUFFERINCREMENT, HEADER::category, SHORTVECTOR::co, header_scan(), MAXBUFFERSIZE, new_shortvector(), print_header(), skip_whitespaces(), t_error(), and HEADER::type.
SHORTBIN* read_shortbin | ( | FILE * | inputfile, |
char * | mode, | ||
short | |||
) |
Definition at line 9472 of file t_io.c.
References EXTERNAL_FILE, EXTERNAL_FILE_NAME, EXTERNAL_FILE_POSITION, free_header(), free_longvector(), longvectorcmp(), new_shortbin(), NOPRINT, OLD_NAME, OPENYES, print_longvector_elements(), query_for_label(), query_for_token(), read_index(), read_longarray(), read_shortbin_elements(), skip_whitespaces(), t_error(), t_fclose(), and t_fopen().
long read_shortbin_elements | ( | FILE * | input, |
SHORTBIN * | l, | ||
char * | mode | ||
) |
Definition at line 2055 of file t_io.c.
References co, LONGVECTOR::co, SHORTBIN::co, SHORTBIN::index, SHORTBIN::isdynamic, and t_error().
Referenced by read_shortbin().
SHORTMATRIX* read_shortmatrix | ( | FILE * | inputfile, |
char * | mode, | ||
short | |||
) |
Definition at line 8374 of file t_io.c.
References HEADER::category, HEADER::dimensions, EXTERNAL_FILE, EXTERNAL_FILE_NAME, EXTERNAL_FILE_POSITION, free_header(), get_phrase(), headercmp(), new_shortmatrix(), NOPRINT, OLD_NAME, OPENYES, print_header(), query_for_token(), read_index(), read_matrixheader(), read_shortmatrix_elements(), skip_whitespaces(), t_error(), t_fclose(), t_fopen(), and HEADER::type.
long read_shortmatrix_elements | ( | FILE * | input, |
SHORTMATRIX * | m, | ||
char * | mode | ||
) |
Matrixes
Read a matrix of short numbers
Definition at line 1010 of file t_io.c.
References SHORTMATRIX::co, SHORTMATRIX::isdynamic, SHORTMATRIX::nch, SHORTMATRIX::ncl, SHORTMATRIX::nrh, SHORTMATRIX::nrl, and t_error().
Referenced by read_shortmatrix().
SHORTVECTOR* read_shortvector | ( | FILE * | inputfile, |
char * | mode, | ||
short | |||
) |
Definition at line 7214 of file t_io.c.
References HEADER::category, HEADER::dimensions, EXTERNAL_FILE, EXTERNAL_FILE_NAME, EXTERNAL_FILE_POSITION, free_header(), get_phrase(), headercmp(), new_shortvector(), NOPRINT, OLD_NAME, OPENYES, print_header(), query_for_token(), read_index(), read_shortvector_elements(), read_vectorheader(), skip_whitespaces(), t_error(), t_fclose(), t_fopen(), and HEADER::type.
long read_shortvector_elements | ( | FILE * | input, |
SHORTVECTOR * | v, | ||
char * | mode | ||
) |
Name: read_, write__elements, binarywrite__elements.
Version: 1.0
Synopsis:
long read_shortvector_elements(FILE * ,SHORTVECTOR *,char *);
long write_shortvector_elements(FILE *,SHORTVECTOR *,long );
long binarywrite_shortvector_elements(FILE *,SHORTVECTOR *);
void print_shortvector_elements(SHORTVECTOR *,long );
Description: For each data type four functions are given: 1) read_* to
read (both in ascii or binary format) the elements of a vector, matrix or bin,
from the specified FILE stream; 2) write_* to write it on the specified file;
3) binarywrite_* to write in binary format and 4) print_* to print it on the screen.
Using "long" as a return value obviosly limits the size of the vector and matrixes used.
A better choice would have been size_t but this prevents to have returned
negative numbers that are used to handle the errors. Thus, use of size_t would require
a rewriting of the error handling part of the routines. Also, one could observe that, in the
case of matrixes, the total number of elements (rows times columns) must be limited to
the maximum of long, say MAX_LONG, in order to have correct return values even if one could theoretically
allocate matrixes of size MAX_LONG*MAX_LONG.
Authors & Date: Riccardo Rigon, February 1997, April 1997
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Inputs: read_ : The pointer to the opened file stream FILE *, the pointer to the structure
were the data are going to be allocated and the mode in which the data are read ("a"
for ascii and "b" for binary).
write_: The pointer to the file were the data are going to be write, the pointer to
the structure were they are actually allocated, the number of columns of the output.
binarywrite_*:The pointer to the file were the data are going to be write, the pointer to
the structure were they are actually allocated.
print_ : the pointer to the file and the maximum number of data to be printed
on the same row.
Return: read_, write_, binarywrite_: a long indicating the number of elements read/written. A negative long is
returned if some error is encountered in reading/writing. print_ returns a void.
In the case of reading a STRINGBIN or array, a pointer to STRINGBIN
is returned.
Examples: 1.examples.c, 2.examples.c
References:
It reads a vector of short numbers and returns the number of elements read. Storage mode can be either ascii or binary.
Definition at line 100 of file t_io.c.
References SHORTVECTOR::co, SHORTVECTOR::isdynamic, SHORTVECTOR::nh, SHORTVECTOR::nl, and t_error().
Referenced by read_shortvector().
STRINGBIN* read_stringarray | ( | FILE * | inputfile, |
short | |||
) |
Definition at line 6090 of file t_io.c.
References BUFFERINCREMENT, HEADER::category, co, LONGVECTOR::co, st::co, free_header(), header_scan(), st::index, MAXBUFFERSIZE, new_longvector(), new_stringbin(), print_header(), skip_whitespaces(), t_error(), and HEADER::type.
Referenced by get_filename(), get_s_times(), get_strings(), read_filenames(), and read_keywords().
void read_tensorheader | ( | FILE * | inputfile, |
HEADER * | h | ||
) |
Definition at line 11145 of file t_io.c.
References HEADER::dimensions, header_scan(), skip_whitespaces(), and t_error().
Referenced by read_doubletensor().
void read_vectorheader | ( | FILE * | inputfile, |
HEADER * | h | ||
) |
Definition at line 6769 of file t_io.c.
References HEADER::dimensions, header_scan(), skip_whitespaces(), and t_error().
Referenced by read_charvector(), read_doublevector(), read_floatvector(), read_intvector(), read_longvector(), and read_shortvector().
char* readandstore_comment | ( | FILE * | inputfile, |
int | opt, | ||
long | maxbuffersize | ||
) |
void skip_whitespaces | ( | FILE * | inputfile) |
Name: skip_whitespaces
Version: 1.0
Synopsis: void skip_whitespaces(FILE *);
Description: skips the whitespaces in a file and exits when a
normal character is found. White spaces are defined by the standard C routine isspace
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Authors & Date: Riccardo Rigon, February 1997
Inputs: the pointer to the opened file
Return: void
See Also: read_comment, iscomment, goto_EOF
Definition at line 2909 of file t_io.c.
Referenced by file_copy(), get_phrase(), header_scan(), iscomment(), justread_chararray(), justread_floatarray(), justread_floatmatrix(), justread_longarray(), query_for_label(), query_for_token(), read_charvector(), read_doublearray(), read_doublebin(), read_doublematrix(), read_doubletensor(), read_doublevector(), read_floatarray(), read_floatmatrix(), read_floatvector(), read_index(), read_intbin(), read_intmatrix(), read_intvector(), read_longarray(), read_longbin(), read_longmatrix(), read_longvector(), read_matrixheader(), read_plane_strings(), read_plane_strings_restricted(), read_shortarray(), read_shortbin(), read_shortmatrix(), read_shortvector(), read_stringarray(), read_tensorheader(), and read_vectorheader().
FILE* t_fclose | ( | FILE * | stream) |
Definition at line 81 of file t_io.c.
Referenced by doublematrix_control(), doublematrix_dem(), doublematrix_dem2(), doublematrix_dem3(), doubletensor_dem(), doublevector_dem(), floatmatrix_dem(), floatmatrix_dem2(), floatvector_dem(), get_filename(), get_filenames_from_keys(), get_parameter(), get_s_times(), get_strings(), intmatrix_dem(), intmatrix_dem2(), justread_floatmatrix(), longmatrix_dem(), longmatrix_dem2(), read_b_parameters_ft(), read_charvector(), read_connection_attribute_array(), read_doublebin(), read_doublematrix(), read_doubletensor(), read_doublevector(), read_fine_indices(), read_floatmatrix(), read_floatvector(), read_intbin(), read_intmatrix(), read_intvector(), read_keywords_list(), read_line_indices(), read_longbin(), read_longmatrix(), read_longvector(), read_map(), read_polygonvector(), read_shortbin(), read_shortmatrix(), read_shortvector(), shortmatrix_dem(), shortmatrix_dem2(), shortmatrix_dem3(), write_doublevector_in_a_ascii_ft_format_single_file(), write_fluidturtle(), write_longmatrix_vector(), and write_small_lines_indices().
FILE* t_fopen | ( | const char * | name, |
const char * | mode | ||
) |
Name: t_fopen, t_fclose
Synopsis: FILE *t_fopen(const char * ,const char *); FILE *t_fclose(FILE * stream);
Version: 1.0
Description:
Safe open and close file. t_fopen() used in writing mode checks if an file with the existing name already exists.
In this case it moves it to filename.old. Future inplementations will implement the check of the mode of opening.
Authors & Date: Riccardo Rigon, 1996
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Inputs: name of the file and mode of opening
Return: a pointer to the opened file or a NULL pointer in the case of t_fclose
See Also: fopen, close, t_error
Keywords: streams
Examples: 1.example.c
Definition at line 45 of file t_io.c.
References t_error().
Referenced by doublematrix_control(), doublematrix_dem(), doublematrix_dem2(), doublematrix_dem3(), doubletensor_dem(), doublevector_dem(), floatmatrix_dem(), floatmatrix_dem2(), floatvector_dem(), get_filenames_from_keys(), get_s_times(), intmatrix_dem(), intmatrix_dem2(), justread_floatmatrix(), longmatrix_dem(), longmatrix_dem2(), read_b_parameters_ft(), read_charvector(), read_connection_attribute_array(), read_doublebin(), read_doublematrix(), read_doubletensor(), read_doublevector(), read_fine_indices(), read_floatmatrix(), read_floatvector(), read_intbin(), read_intmatrix(), read_intvector(), read_keywords_list(), read_line_indices(), read_linevector(), read_longbin(), read_longmatrix(), read_longvector(), read_map(), read_polygonvector(), read_shortbin(), read_shortmatrix(), read_shortvector(), shortmatrix_dem(), shortmatrix_dem2(), shortmatrix_dem3(), write_doublevector_in_a_ascii_ft_format_single_file(), write_fluidturtle(), write_longmatrix_vector(), and write_small_lines_indices().
void write_chararray_elements | ( | FILE * | outputfile, |
CHARVECTOR * | V, | ||
long | columns | ||
) |
Definition at line 10485 of file t_io.c.
References CHARVECTOR::co, CHARVECTOR::isdynamic, CHARVECTOR::nh, CHARVECTOR::nl, and t_error().
long write_charvector_elements | ( | FILE * | output, |
CHARVECTOR * | v, | ||
long | maxcols | ||
) |
Write a vector of char to a file
Definition at line 900 of file t_io.c.
References CHARVECTOR::co, CHARVECTOR::isdynamic, CHARVECTOR::nh, CHARVECTOR::nl, OK, and t_error().
void write_comment | ( | FILE * | outputfile, |
const char * | comment, | ||
long | columns | ||
) |
Name: write_comment
Synopsis: void write_comment(FILE *,const char *,long);
Version: 1.0
Description: It writes: "This is a turtle file" and the date on a file
Authors & Date: Riccardo Rigon, September 1997
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Inputs: the pointer to the file where to write, the string to write and the line\
length
Return: void
See Also: read_comment
Keywords: turtle file
Examples:1.example.c
Definition at line 10796 of file t_io.c.
References t_error().
void write_doublearray_elements | ( | FILE * | outputfile, |
DOUBLEVECTOR * | V, | ||
long | columns | ||
) |
Definition at line 10417 of file t_io.c.
References DOUBLEVECTOR::co, DOUBLEVECTOR::isdynamic, DOUBLEVECTOR::nh, DOUBLEVECTOR::nl, and t_error().
Referenced by doublematrix_dem2(), doublematrix_dem3(), doubletensor_dem(), doublevector_dem(), longmatrix_dem2(), shortmatrix_dem2(), and shortmatrix_dem3().
long write_doublebin_elements | ( | FILE * | output, |
DOUBLEBIN * | l, | ||
long | maxcols | ||
) |
Write a list of double to a file
Definition at line 2484 of file t_io.c.
References co, LONGVECTOR::co, db::co, db::index, db::isdynamic, OK, and t_error().
long write_doublematrix_elements | ( | FILE * | output, |
DOUBLEMATRIX * | m, | ||
long | maxcols | ||
) |
Definition at line 1764 of file t_io.c.
References DOUBLEMATRIX::co, DOUBLEMATRIX::isdynamic, DOUBLEMATRIX::nch, DOUBLEMATRIX::ncl, DOUBLEMATRIX::nrh, DOUBLEMATRIX::nrl, OK, and t_error().
Referenced by doublematrix_control(), doublematrix_dem(), doublematrix_dem2(), doublematrix_dem3(), and doubletensor_dem().
long write_doubletensor_elements | ( | FILE * | output, |
DOUBLETENSOR * | m, | ||
long | maxcols | ||
) |
Definition at line 10971 of file t_io.c.
References DOUBLETENSOR::co, DOUBLETENSOR::isdynamic, DOUBLETENSOR::nch, DOUBLETENSOR::ncl, DOUBLETENSOR::ndh, DOUBLETENSOR::ndl, DOUBLETENSOR::nrh, DOUBLETENSOR::nrl, OK, and t_error().
long write_doublevector_elements | ( | FILE * | output, |
DOUBLEVECTOR * | v, | ||
long | maxcols | ||
) |
Write a vector of double to a file
Definition at line 749 of file t_io.c.
References DOUBLEVECTOR::co, DOUBLEVECTOR::isdynamic, DOUBLEVECTOR::nh, DOUBLEVECTOR::nl, OK, and t_error().
void write_floatarray_elements | ( | FILE * | outputfile, |
FLOATVECTOR * | V, | ||
long | columns | ||
) |
Name: write__elements
Version: 1.0
Synopsis:
void write_floatarray_elements(FILE *,FLOATVECTOR *, long );
Descriptiontion: write an array of the specified type on
a specified file
Authors & Date: Riccardo Rigon, September 1997
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Inputs: the pointer to the file and the pointer to the data stored,
the length of the line
Return: void
See Also: read__
Keywords: turtle file
Examples: 1.example.c
Definition at line 10351 of file t_io.c.
References FLOATVECTOR::co, FLOATVECTOR::isdynamic, FLOATVECTOR::nh, FLOATVECTOR::nl, and t_error().
Referenced by doublematrix_dem(), floatmatrix_dem(), floatmatrix_dem2(), floatvector_dem(), intmatrix_dem(), intmatrix_dem2(), longmatrix_dem(), and shortmatrix_dem().
long write_floatmatrix_elements | ( | FILE * | output, |
FLOATMATRIX * | m, | ||
long | maxcols | ||
) |
Definition at line 1595 of file t_io.c.
References FLOATMATRIX::co, FLOATMATRIX::isdynamic, FLOATMATRIX::nch, FLOATMATRIX::ncl, FLOATMATRIX::nrh, FLOATMATRIX::nrl, OK, and t_error().
Referenced by floatmatrix_dem(), and floatmatrix_dem2().
long write_floatvector_elements | ( | FILE * | output, |
FLOATVECTOR * | v, | ||
long | maxcols | ||
) |
Write a vector of float to a file
Definition at line 599 of file t_io.c.
References FLOATVECTOR::co, FLOATVECTOR::isdynamic, FLOATVECTOR::nh, FLOATVECTOR::nl, OK, and t_error().
void write_header_header | ( | FILE * | outputfile, |
HEADER * | H | ||
) |
Name: write_header_header
Synopsis: void write_header_header(FILE *,HEADER *H);
Version: 1.0
Description: writes a HEADER CONTENT to a file
Authors & Date: Riccardo Rigon, September 1997
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Inputs: the pointer to the file where to write and a pointer to the header
where the information are stored
Return: void
See Also: read_header
Keywords: turtle file
Examples: 1.example.c
Definition at line 10654 of file t_io.c.
References HEADER::category, t_keywords::category, t_keywords::delimiter, HEADER::dimensions, HEADER::gender, t_keywords::gender, HEADER::name, HEADER::number, t_error(), HEADER::type, and t_keywords::type.
void write_intarray_elements | ( | FILE * | outputfile, |
INTVECTOR * | V, | ||
long | columns | ||
) |
Definition at line 10213 of file t_io.c.
References INTVECTOR::co, INTVECTOR::isdynamic, INTVECTOR::nh, INTVECTOR::nl, and t_error().
long write_intbin_elements | ( | FILE * | output, |
INTBIN * | l, | ||
long | maxcols | ||
) |
Write a list of int to a file
Definition at line 1941 of file t_io.c.
References co, LONGVECTOR::co, INTBIN::co, INTBIN::index, INTBIN::isdynamic, OK, and t_error().
long write_intmatrix_elements | ( | FILE * | output, |
INTMATRIX * | m, | ||
long | maxcols | ||
) |
Definition at line 1244 of file t_io.c.
References INTMATRIX::co, INTMATRIX::isdynamic, INTMATRIX::nch, INTMATRIX::ncl, INTMATRIX::nrh, INTMATRIX::nrl, OK, and t_error().
Referenced by intmatrix_dem(), and intmatrix_dem2().
long write_intvector_elements | ( | FILE * | output, |
INTVECTOR * | v, | ||
long | maxcols | ||
) |
Write a vector of int to a file
Definition at line 296 of file t_io.c.
References INTVECTOR::co, INTVECTOR::isdynamic, INTVECTOR::nh, INTVECTOR::nl, OK, and t_error().
void write_longarray_elements | ( | FILE * | outputfile, |
LONGVECTOR * | V, | ||
long | columns | ||
) |
Definition at line 10283 of file t_io.c.
References LONGVECTOR::co, LONGVECTOR::isdynamic, LONGVECTOR::nh, LONGVECTOR::nl, and t_error().
long write_longbin_elements | ( | FILE * | output, |
LONGBIN * | l, | ||
long | maxcols | ||
) |
Write a list of int to a file
Definition at line 2303 of file t_io.c.
References co, LONGVECTOR::co, LONGBIN::co, LONGBIN::index, LONGBIN::isdynamic, OK, and t_error().
long write_longmatrix_elements | ( | FILE * | output, |
LONGMATRIX * | m, | ||
long | maxcols | ||
) |
Definition at line 1417 of file t_io.c.
References LONGMATRIX::co, LONGMATRIX::isdynamic, LONGMATRIX::nch, LONGMATRIX::ncl, LONGMATRIX::nrh, LONGMATRIX::nrl, OK, and t_error().
Referenced by longmatrix_dem(), longmatrix_dem2(), and write_longmatrix_vector().
long write_longvector_elements | ( | FILE * | output, |
LONGVECTOR * | v, | ||
long | maxcols | ||
) |
Write a vector of int to a file
Definition at line 448 of file t_io.c.
References LONGVECTOR::co, LONGVECTOR::isdynamic, LONGVECTOR::nh, LONGVECTOR::nl, OK, and t_error().
void write_shortarray_elements | ( | FILE * | outputfile, |
SHORTVECTOR * | V, | ||
long | columns | ||
) |
Definition at line 10145 of file t_io.c.
References SHORTVECTOR::co, SHORTVECTOR::isdynamic, SHORTVECTOR::nh, SHORTVECTOR::nl, and t_error().
long write_shortbin_elements | ( | FILE * | output, |
SHORTBIN * | l, | ||
long | maxcols | ||
) |
Write a list of int to a file
Definition at line 2122 of file t_io.c.
References co, LONGVECTOR::co, SHORTBIN::co, SHORTBIN::index, SHORTBIN::isdynamic, OK, and t_error().
long write_shortmatrix_elements | ( | FILE * | output, |
SHORTMATRIX * | m, | ||
long | maxcols | ||
) |
Definition at line 1071 of file t_io.c.
References SHORTMATRIX::co, SHORTMATRIX::isdynamic, SHORTMATRIX::nch, SHORTMATRIX::ncl, SHORTMATRIX::nrh, SHORTMATRIX::nrl, OK, and t_error().
Referenced by shortmatrix_dem(), shortmatrix_dem2(), and shortmatrix_dem3().
long write_shortvector_elements | ( | FILE * | output, |
SHORTVECTOR * | v, | ||
long | maxcols | ||
) |
Write a vector of short int to a file
Definition at line 146 of file t_io.c.
References SHORTVECTOR::co, SHORTVECTOR::isdynamic, SHORTVECTOR::nh, SHORTVECTOR::nl, OK, and t_error().
long write_stringbin_elements | ( | FILE * | output, |
STRINGBIN * | l, | ||
long | maxcols | ||
) |
Write a list of strings to a file
Definition at line 2758 of file t_io.c.
References co, LONGVECTOR::co, st::co, st::index, st::isdynamic, OK, and t_error().
void write_stringsarray_elements | ( | FILE * | outputfile, |
STRINGBIN * | V | ||
) |
void write_turtle | ( | FILE * | outputfile, |
char * | creator, | ||
char * | inputs | ||
) |
Name: write_turtle
Synopsis: void write_turtle(FILE * ,char *,char *);
Version: 1.0
Description: writes: This is a turtle file and the date on a file. It also write:
1) the name of the programs that created the file and 2) the files whose elaboration generated the file
Authors & Date: Riccardo Rigon, September 1997, November 1987
FILE: LIBRARIES/BASICS/t_io.h, LIBRARIES/BASICS/t_io.c
Inputs: the pointer to the file where to write and 1) and 2) above
Return: void
See Also: read_comment
Keywords: turtle file
Examples: 1.example.c.
Definition at line 10738 of file t_io.c.
References t_error().