TheBoussinesqModel  3.2.1
 All Data Structures Files Functions Variables Typedefs Macros Pages
t_io.h File Reference

Go to the source code of this file.

Functions

FILE * t_fopen (const char *, const char *)
 
FILE * t_fclose (FILE *stream)
 
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)
 
long read_intvector_elements (FILE *, INTVECTOR *, char *)
 
long write_intvector_elements (FILE *, INTVECTOR *, long)
 
long binarywrite_intvector_elements (FILE *, INTVECTOR *)
 
void print_intvector_elements (INTVECTOR *, long)
 
long read_longvector_elements (FILE *, LONGVECTOR *, char *)
 
long write_longvector_elements (FILE *, LONGVECTOR *, long)
 
long binarywrite_longvector_elements (FILE *, LONGVECTOR *)
 
void print_longvector_elements (LONGVECTOR *, long)
 
long read_floatvector_elements (FILE *, FLOATVECTOR *, char *)
 
long write_floatvector_elements (FILE *, FLOATVECTOR *, long)
 
long binarywrite_floatvector_elements (FILE *, FLOATVECTOR *)
 
void print_floatvector_elements (FLOATVECTOR *, long)
 
long read_doublevector_elements (FILE *, DOUBLEVECTOR *, char *)
 
long write_doublevector_elements (FILE *, DOUBLEVECTOR *, long)
 
long binarywrite_doublevector_elements (FILE *, DOUBLEVECTOR *)
 
void print_doublevector_elements (DOUBLEVECTOR *, long)
 
long read_charvector_elements (FILE *, CHARVECTOR *, char *)
 
long write_charvector_elements (FILE *, CHARVECTOR *, long)
 
long binarywrite_charvector_elements (FILE *, CHARVECTOR *)
 
void print_charvector_elements (CHARVECTOR *, long)
 
long read_shortmatrix_elements (FILE *, SHORTMATRIX *, char *)
 
long write_shortmatrix_elements (FILE *, SHORTMATRIX *, long)
 
long binarywrite_shortmatrix_elements (FILE *, SHORTMATRIX *)
 
void print_shortmatrix_elements (SHORTMATRIX *, long)
 
long read_intmatrix_elements (FILE *, INTMATRIX *, char *)
 
long write_intmatrix_elements (FILE *, INTMATRIX *, long)
 
long binarywrite_intmatrix_elements (FILE *, INTMATRIX *)
 
void print_intmatrix_elements (INTMATRIX *, long)
 
long read_longmatrix_elements (FILE *, LONGMATRIX *, char *)
 
long write_longmatrix_elements (FILE *, LONGMATRIX *, long)
 
long binarywrite_longmatrix_elements (FILE *, LONGMATRIX *)
 
void print_longmatrix_elements (LONGMATRIX *, long)
 
long read_floatmatrix_elements (FILE *, FLOATMATRIX *, char *)
 
long write_floatmatrix_elements (FILE *, FLOATMATRIX *, long)
 
long binarywrite_floatmatrix_elements (FILE *, FLOATMATRIX *)
 
void print_floatmatrix_elements (FLOATMATRIX *, long)
 
long read_doublematrix_elements (FILE *, DOUBLEMATRIX *, char *)
 
long write_doublematrix_elements (FILE *, DOUBLEMATRIX *, long)
 
long binarywrite_doublematrix_elements (FILE *, DOUBLEMATRIX *)
 
void print_doublematrix_elements (DOUBLEMATRIX *, long)
 
long read_intbin_elements (FILE *, INTBIN *, char *)
 
long write_intbin_elements (FILE *, INTBIN *, long)
 
long binarywrite_intbin_elements (FILE *output, INTBIN *l)
 
void print_intbin_elements (INTBIN *, long)
 
STRINGBINread_plane_strings (FILE *, long, long)
 
long write_stringbin_elements (FILE *, STRINGBIN *, long)
 
void print_stringbin_elements (STRINGBIN *, long)
 
long read_shortbin_elements (FILE *, SHORTBIN *, char *)
 
long write_shortbin_elements (FILE *, SHORTBIN *, long)
 
long binarywrite_shortbin_elements (FILE *, SHORTBIN *)
 
void print_shortbin_elements (SHORTBIN *, long)
 
long read_longbin_elements (FILE *, LONGBIN *, char *)
 
long write_longbin_elements (FILE *, LONGBIN *, long)
 
long binarywrite_longbin_elements (FILE *, LONGBIN *)
 
void print_longbin_elements (LONGBIN *, long)
 
long read_doublebin_elements (FILE *, DOUBLEBIN *, char *)
 
long write_doublebin_elements (FILE *, DOUBLEBIN *, long)
 
long binarywrite_doublebin_elements (FILE *, DOUBLEBIN *)
 
void print_doublebin_elements (DOUBLEBIN *, long)
 
int copy_buffer_into_stringbin (char *, STRINGBIN *)
 
int read_comment (FILE *, int, long, short)
 
char * readandstore_comment (FILE *, int, long)
 
char * read_buffer_from_stdio (long)
 
int iscomment (char *, FILE *)
 
char * join_strings (char *, char *)
 
char * get_filename (char *, char *)
 
STRINGBINread_filenames (char *working_directory, char *program, char *extension, char *position)
 
DOUBLEVECTORread_parameters (char *working_directory, char *program, char *extension, char *position)
 
double get_parameter (char *, char *)
 
char * get_strings (char *, char *)
 
char * get_workingdirectory (void)
 
void skip_whitespaces (FILE *)
 
void goto_EOF (FILE *)
 
HEADER read_header (FILE *, const char *)
 
void print_header (HEADER *)
 
int query_for_token (FILE *, const char *)
 
char * query_for_label (FILE *)
 
char * get_phrase (FILE *, const char)
 
INTMATRIXread_intmatrix (FILE *, char *, short)
 
SHORTMATRIXread_shortmatrix (FILE *, char *, short)
 
LONGMATRIXread_longmatrix (FILE *, char *, short)
 
FLOATMATRIXread_floatmatrix (FILE *, char *, short)
 
DOUBLEMATRIXread_doublematrix (FILE *, char *, short)
 
CHARVECTORread_charvector (FILE *, char *, short)
 
INTVECTORread_intvector (FILE *, char *, short)
 
SHORTVECTORread_shortvector (FILE *, char *, short)
 
LONGVECTORread_longvector (FILE *, char *, short)
 
FLOATVECTORread_floatvector (FILE *, char *, short)
 
DOUBLEVECTORread_doublevector (FILE *, char *, short)
 
SHORTBINread_shortbin (FILE *, char *, short)
 
INTBINread_intbin (FILE *, char *, short)
 
LONGBINread_longbin (FILE *, char *, short)
 
DOUBLEBINread_doublebin (FILE *, char *, short)
 
long read_index (FILE *, short)
 
INTVECTORread_intarray (FILE *, short)
 
SHORTVECTORread_shortarray (FILE *, short)
 
FLOATVECTORread_floatarray (FILE *, short)
 
LONGVECTORread_longarray (FILE *, short)
 
CHARVECTORread_chararray (FILE *, short)
 
DOUBLEVECTORread_doublearray (FILE *, short)
 
STRINGBINread_stringarray (FILE *, short)
 
void justread_floatarray (FILE *, FLOATVECTOR *, short)
 
void justread_floatmatrix (FILE *, FLOATMATRIX *, char *mode, short print)
 
void justread_longarray (FILE *, LONGVECTOR *, short)
 
void justread_chararray (FILE *, CHARVECTOR *, short)
 
void write_floatarray_elements (FILE *, FLOATVECTOR *, long)
 
void write_doublearray_elements (FILE *, DOUBLEVECTOR *, long)
 
void write_shortarray_elements (FILE *, SHORTVECTOR *, long)
 
void write_intarray_elements (FILE *, INTVECTOR *, long)
 
void write_longarray_elements (FILE *, LONGVECTOR *, long)
 
void write_chararray_elements (FILE *, CHARVECTOR *, long)
 
void write_stringsarray_elements (FILE *, STRINGBIN *)
 
long headercmp (HEADER *, HEADER *)
 
long longvectorcmp (LONGVECTOR *, LONGVECTOR *)
 
void read_matrixheader (FILE *, HEADER *)
 
void read_vectorheader (FILE *, HEADER *)
 
int header_scan (FILE *, HEADER *)
 
short header_name_scan (FILE *, HEADER)
 
void write_turtle (FILE *, char *, char *)
 
void write_comment (FILE *, const char *, long)
 
void write_header_header (FILE *, HEADER *H)
 
long write_doubletensor_elements (FILE *output, DOUBLETENSOR *m, long maxcols)
 
void print_doubletensor_elements (DOUBLETENSOR *m, long maxcols)
 
DOUBLETENSORread_doubletensor (FILE *inputfile, char *mode, short print)
 
long read_doubletensor_elements (FILE *input, DOUBLETENSOR *m, char *mode)
 
void read_tensorheader (FILE *inputfile, HEADER *h)
 

Function Documentation

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_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().

long headercmp ( HEADER a,
HEADER b 
)

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().

void justread_chararray ( FILE *  inputfile,
CHARVECTOR vec,
short  print 
)
void justread_floatarray ( FILE *  inputfile,
FLOATVECTOR vec,
short  print 
)

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_longarray ( FILE *  inputfile,
LONGVECTOR vec,
short  print 
)
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 
)

Definition at line 2569 of file t_io.c.

References co, db::co, db::index, db::isdynamic, and t_error().

void print_doublematrix_elements ( DOUBLEMATRIX m,
long  maxcols 
)
void print_doubletensor_elements ( DOUBLETENSOR m,
long  maxcols 
)
void print_doublevector_elements ( DOUBLEVECTOR v,
long  maxcols 
)
void print_floatmatrix_elements ( FLOATMATRIX m,
long  maxcols 
)
void print_floatvector_elements ( FLOATVECTOR v,
long  maxcols 
)
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 
)
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 
)
void print_longvector_elements ( LONGVECTOR v,
long  maxcols 
)
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 
)
void print_shortvector_elements ( SHORTVECTOR v,
long  maxcols 
)
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)
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   
)
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  print 
)

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().

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().

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().

long read_doubletensor_elements ( FILE *  input,
DOUBLETENSOR m,
char *  mode 
)
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 
)
FLOATVECTOR* read_floatarray ( FILE *  inputfile,
short  print 
)
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().

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

below stands for _vectorheader, matrixheader or

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  print 
)

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

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  print 
)

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().

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().

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().

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().

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 
)
SHORTVECTOR* read_shortarray ( FILE *  inputfile,
short  print 
)
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().

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().

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().

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 
)
char* readandstore_comment ( FILE *  inputfile,
int  opt,
long  maxbuffersize 
)

Definition at line 3921 of file t_io.c.

References BUFFERINCREMENT, iscomment(), and t_error().

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_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 
)
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 
)
long write_doubletensor_elements ( FILE *  output,
DOUBLETENSOR m,
long  maxcols 
)
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 
)
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 
)
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 
)
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 
)
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 
)
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 
)

Definition at line 10551 of file t_io.c.

References st::co, st::index, st::isdynamic, and t_error().

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().