TheBoussinesqModel  3.2.1
 All Data Structures Files Functions Variables Typedefs Macros Pages
key.palette.c File Reference
#include "turtle.h"
#include "tensor3D.h"
#include "t_utilities.h"
#include "key.palette.h"

Go to the source code of this file.

Macros

#define REFK   "_to_"
 

Functions

KEYWORDSread_keywords (FILE *init, short print)
 
KEYWORDS_LISTread_keywords_list (char *filename, short print)
 
void write_keywords (KEYWORDS *keywords)
 
void write_read_filenames (STRINGBIN *filenames, STRINGBIN *comments)
 
KEYWORDS_LISTreorder_keywords_list (KEYWORDS_LIST *written_palette, STRINGBIN *keywords_model, long jread, char *empty_name)
 
KEYWORDS_LISTread_and_reorder_keywords_list (char *filename, STRINGBIN *keywords_model, long jread, char *empty_name, short print)
 
void free_keywords_list (KEYWORDS_LIST *keywords_list)
 
void free_keywords (KEYWORDS *keywords)
 
STRINGBINread_names (FILE *fd, STRINGBIN *keywords, char *empty_name, short print)
 
STRINGBINjoin_path_to_stringbin (char *path, STRINGBIN *stringvector, char *no_joinstring)
 

Macro Definition Documentation

#define REFK   "_to_"

Definition at line 34 of file key.palette.c.

Referenced by read_names().

Function Documentation

void free_keywords ( KEYWORDS keywords)

void free_keywords(KEYWORDS *keywords)

Parameters
keywords- (KEYWORDS *) a generic variable

It frees the mamory allovcated by keywords

Author
Emanuele Cordano
Date
1 Fabruary 2008

Definition at line 447 of file key.palette.c.

References KEYWORDS::comments, free_stringbin(), and KEYWORDS::names.

Referenced by free_keywords_list(), get_filenames_from_keys(), and read_names().

void free_keywords_list ( KEYWORDS_LIST keywords_list)

void free_keywords_array(KEYWORDS_LIST* keywords_list

Parameters
keywords_list- (KEYWORD_LIST *) a generic variable It frees the mamory allovcated by keywords_list
Author
Emanuele Cordano
Date
13 Fabruary 2008

Definition at line 414 of file key.palette.c.

References KEYWORDS_LIST::element, free_keywords(), and KEYWORDS_LIST::nl.

Referenced by read_and_reorder_keywords_list().

STRINGBIN* join_path_to_stringbin ( char *  path,
STRINGBIN stringvector,
char *  no_joinstring 
)
KEYWORDS_LIST* read_and_reorder_keywords_list ( char *  filename,
STRINGBIN keywords_model,
long  jread,
char *  empty_name,
short  print 
)

KEYWORDS_LIST *read_&_reorder_keywords_list(char *filename, STRINGBIN *keywords_model, long jread, char *empty_name,short print)

Parameters
filename- (* char) a filemane used by read_keywords_list fuction
keywords_model- (* STRINGBIN) a string array containg the keyword of the model component
jread- (* long) parameteres jread utized in reorder_keyword_list function
empty_name- (* char) name correspondis to a mising or inactive model component as utilized in reorder_keyword_list function
print-(short) a short int used by FluidTurle library

It reads a KEYWORDS_LIST containing the model component values using read_keywords_list function and reorders it according to the STRINGBIN keywords_model using the reorder_keywords_list.

    \relate read_keywords_list, reorder_keywords_list, FluidTurtle Library
Author
Emanuele Cordano
Date
15 February 2008

Definition at line 376 of file key.palette.c.

References free_keywords_list(), read_keywords_list(), and reorder_keywords_list().

KEYWORDS* read_keywords ( FILE *  init,
short  print 
)

KEYWORDS read_keywords (char namefile_init, short print)

Parameters
init-(* FILE) File pointer
print-(short) print as
Returns
a KEYWORDS struct which contains two stringbins, one for the keyword names, the other for the referenced comments.

it reads a KEYWORDS struct from a string array

Author
Emanuele Cordano
Date
30 January 2008

FLUIDTURLE_STATICLIBRARY.read_stringarray

Definition at line 36 of file key.palette.c.

References KEYWORDS::comments, free_longvector(), free_stringbin(), st::index, KEYWORDS::names, new_longvector(), new_stringbin(), LONGVECTOR::nh, LONGVECTOR::nl, read_stringarray(), and t_error().

Referenced by get_filenames_from_keys(), read_keywords_list(), and read_names().

KEYWORDS_LIST* read_keywords_list ( char *  filename,
short  print 
)
KEYWORDS_LIST *read_keywords_array (char *filename, short print)
Parameters
filename-(* char) a filename
print-(short) a short int used by FluidTurle functions
Returns
a KEYWORDS_LIST struct which contains two or more KEYWORD structs.

it reads a KEYWORDS_LIST struct from a

Author
Emanuele Cordano
Date
13 Fabruary 2008

The function reads a ascii file written in FluidTurtle Format

FLUIDTURLE_STATICLIBRARY.read_stringarray

< read file keywords string

Definition at line 124 of file key.palette.c.

References KEYWORDS_LIST::element, isDynamic, KEYWORDS_LIST::isdynamic, KEYWORDS_LIST::nh, KEYWORDS_LIST::nl, NL, NR_END, read_index(), read_keywords(), t_error(), t_fclose(), and t_fopen().

Referenced by read_and_reorder_keywords_list().

STRINGBIN* read_names ( FILE *  fd,
STRINGBIN keywords,
char *  empty_name,
short  print 
)

< STRINGBIN *read_names(FILE *fd, STRINGBIN *keywords, char *empty_name,short print) *

Parameters
fd- (* FILE) file pointer
keywords- (* STRINGBIN) the string array containig the file keywords
empty_name(* char) - a string indicating a missing file
Returns
a STRINGNIN containing the filenames order according to STRINGBIN *keywords.

It reads a string array containg a series of filenames and reorders it according to STRINGBIN *keywords.

The reed string array is like a KEYWORD struct: filename1, KEYWWORD1, filename22, KEYWORD22. The filenames can be written in a scatterdc order and must be followed by the keyword of the filetype ther are referred to .

     \relate FluidTurtle Library,
Author
Emanuele Cordano
Date
6 Fabruary 2008

Definition at line 475 of file key.palette.c.

References KEYWORDS::comments, EMPTY_VALUE, free_keywords(), free_longvector(), st::index, join_strings(), KEYWORDS::names, new_longvector(), new_stringbin(), LONGVECTOR::nh, LONGVECTOR::nl, read_keywords(), and REFK.

Referenced by get_filenames_from_keys().

KEYWORDS_LIST* reorder_keywords_list ( KEYWORDS_LIST written_palette,
STRINGBIN keywords_model,
long  jread,
char *  empty_name 
)
  KEYWORD_LIST *reorder_keyword_list(KEYWOWORD_LIST *written_palette, STRINGBIN *keywords_model,long jread)

tempo troppo alto

Parameters
written_palette- (* KEYWORDS_LIST) a KEYWORDS_LIST struct written in a scattered way
keywords_model- (* STRINGBIN ) a stringbin which contains the model keywords in the correct order
jread- (long) - the number releted to the element for each KEYWORDS struct contained in keywords_model which contains the model keyword
empty_name- (* char) the value which correspons to a missing or inactive model component
Returns
a KEYWORDS_LIST for the model keyword and value in the correct order as reported in written_palette

It reorder the keywords_model according to the keyword oreder in written_palette.

The variable keyword_model contains two or more KEYWORDS struct. In each of these the jread-th element is the keyword of the model component (normally jread is assumed equal to 1), the other elements all possible values of the model component. Here the order of the model component is here modifed according to the order of the keywords in written_palette.

       \relate FluidTurtle librariy
Date
13 February 2008
Author
Emanuele Cordano

Definition at line 259 of file key.palette.c.

References KEYWORDS::comments, KEYWORDS_LIST::element, EMPTY_VALUE, free_longvector(), st::index, isDynamic, KEYWORDS_LIST::isdynamic, KEYWORDS::names, new_longvector(), new_stringbin(), KEYWORDS_LIST::nh, LONGVECTOR::nh, KEYWORDS_LIST::nl, LONGVECTOR::nl, NR_END, and t_error().

Referenced by read_and_reorder_keywords_list().

void write_keywords ( KEYWORDS keywords)

void write_keywords(KEYWORDS *keywords)

Date
13 February 2006
Author
Emanuele Cordano

This function writes all the elements of a KEYWORD struct. This function was made to test all the functions contains in this .c file.

Definition at line 184 of file key.palette.c.

References KEYWORDS::comments, st::index, KEYWORDS::names, and LONGVECTOR::nl.

Referenced by get_filenames_from_keys().

void write_read_filenames ( STRINGBIN filenames,
STRINGBIN comments 
)

void write_read_filenames(STRINGBIN *filenames, STRINGBIN *comments)

Author
Emanuele Cordano
Date
8 Fabruary 2008

Definition at line 216 of file key.palette.c.

References st::index, LONGVECTOR::nh, LONGVECTOR::nl, and t_error().

Referenced by get_filenames_from_keys().