ZOO-Project
Data Structures | Typedefs | Functions | Variables
main_conf_read.y File Reference
#include <service.h>

Data Structures

struct  maps
 linked list of map pointer More...
 
struct  iotype
 Not named linked list. More...
 
struct  elements
 Metadata information about input or output. More...
 
struct  service
 Metadata information about a full Service. More...
 
struct  services
 Services chained list. More...
 
struct  registry
 Profile registry. More...
 

Typedefs

typedef struct maps maps
 linked list of map pointer More...
 
typedef struct iotype iotype
 Not named linked list. More...
 
typedef struct elements elements
 Metadata information about input or output. More...
 
typedef struct service service
 Metadata information about a full Service. More...
 
typedef struct services services
 Services chained list. More...
 
typedef struct registry registry
 Profile registry. More...
 

Functions

ZOO_DLL_EXPORT void _dumpMap (map *)
 Dump a map on stderr. More...
 
ZOO_DLL_EXPORT void dumpMap (map *)
 Dump a map on stderr, see _dumpMap() More...
 
ZOO_DLL_EXPORT void dumpMaps (maps *m)
 Dump a maps on stderr, see dumpMap(). More...
 
ZOO_DLL_EXPORT void dumpMapToFile (map *, FILE *)
 Dump a map to a file. More...
 
ZOO_DLL_EXPORT void dumpMapsToFile (maps *, char *, int)
 Dump a maps to a file, see _dumpMapsToFile(). More...
 
ZOO_DLL_EXPORT mapcreateMap (const char *, const char *)
 Create a new map. More...
 
ZOO_DLL_EXPORT mapscreateMaps (const char *)
 Create a new maps with the given name. More...
 
ZOO_DLL_EXPORT int count (map *)
 Count number of map in a map. More...
 
ZOO_DLL_EXPORT bool hasKey (map *, const char *)
 Verify if a key exist in a map. More...
 
ZOO_DLL_EXPORT mapsgetMaps (maps *, const char *)
 Access a specific maps. More...
 
ZOO_DLL_EXPORT mapgetMap (map *, const char *)
 Access a specific map. More...
 
ZOO_DLL_EXPORT mapgetLastMap (map *)
 Access the last map. More...
 
ZOO_DLL_EXPORT mapgetMapFromMaps (maps *, const char *, const char *)
 Access a specific map from a maps. More...
 
ZOO_DLL_EXPORT void freeMap (map **)
 Free allocated memory of a map. More...
 
ZOO_DLL_EXPORT void freeMaps (maps **mo)
 Free allocated memory of a maps. More...
 
ZOO_DLL_EXPORT elementscreateEmptyElements ()
 Create an empty elements. More...
 
ZOO_DLL_EXPORT elementscreateElements (char *)
 Create a named elements. More...
 
ZOO_DLL_EXPORT void setElementsName (elements **, char *)
 Set the name of an elements. More...
 
ZOO_DLL_EXPORT bool hasElement (elements *, const char *)
 Verify if an elements contains a name equal to the given key. More...
 
ZOO_DLL_EXPORT elementsgetElements (elements *, char *)
 Access a specific elements named key. More...
 
ZOO_DLL_EXPORT void freeIOType (iotype **)
 Free allocated memory of an iotype. More...
 
ZOO_DLL_EXPORT void freeElements (elements **)
 Free allocated memory of an elements. More...
 
ZOO_DLL_EXPORT void setServiceName (service **, char *)
 Set the name of a service. More...
 
ZOO_DLL_EXPORT void freeService (service **)
 Free allocated memory of a service. More...
 
ZOO_DLL_EXPORT void addToMap (map *, const char *, const char *)
 Add key value pair to an existing map. More...
 
ZOO_DLL_EXPORT void addIntToMap (map *, const char *, const int)
 Add a key and an integer value to an existing map. More...
 
ZOO_DLL_EXPORT mapaddToMapWithSize (map *, const char *, const char *, int)
 Add a key and a binary value to an existing map. More...
 
ZOO_DLL_EXPORT void addMapToMap (map **, map *)
 Add a map at the end of another map. More...
 
ZOO_DLL_EXPORT void addMapToIoType (iotype **, map *)
 Add a map to iotype. More...
 
ZOO_DLL_EXPORT mapgetMapOrFill (map **, const char *, const char *)
 Access a specific map or set its value. More...
 
ZOO_DLL_EXPORT bool contains (map *, map *)
 Verify if a map is contained in another map. More...
 
ZOO_DLL_EXPORT iotypegetIoTypeFromElement (elements *, char *, map *)
 Access a specific iotype from an elements. More...
 
ZOO_DLL_EXPORT void loadMapBinary (map **, map *, int)
 Load binary values from a map (in) and add them to another map (out) More...
 
ZOO_DLL_EXPORT void loadMapBinaries (map **, map *)
 Load binary values from a map (in) and add them to another map (out). More...
 
ZOO_DLL_EXPORT mapsdupMaps (maps **)
 Duplicate a Maps. More...
 
ZOO_DLL_EXPORT void addMapsToMaps (maps **, maps *)
 Add a maps at the end of another maps. More...
 
ZOO_DLL_EXPORT mapgetMapArray (map *, const char *, int)
 Access a specific map array element. More...
 
ZOO_DLL_EXPORT void setMapArray (map *, const char *, int, const char *)
 Add a key value in a MapArray for a specific index. More...
 
ZOO_DLL_EXPORT mapgetMapType (map *)
 Access the map "type". More...
 
ZOO_DLL_EXPORT int addMapsArrayToMaps (maps **, maps *, char *)
 Add a Maps containing a MapArray to a Maps. More...
 
ZOO_DLL_EXPORT void setMapInMaps (maps *, const char *, const char *, const char *)
 Set a key value pair to a map contained in a Maps. More...
 
ZOO_DLL_EXPORT void dumpElements (elements *)
 Dump an elements on stderr. More...
 
ZOO_DLL_EXPORT void dumpElementsAsYAML (elements *, int)
 Dump an elements on stderr using the YAML syntaxe. More...
 
ZOO_DLL_EXPORT elementsdupElements (elements *)
 Duplicate an elements. More...
 
ZOO_DLL_EXPORT void addToElements (elements **, elements *)
 Add an elements to another elements. More...
 
ZOO_DLL_EXPORT void dumpService (service *)
 Dump a service on stderr. More...
 
ZOO_DLL_EXPORT void dumpServiceAsYAML (service *)
 Dump a service on stderr using the YAML syntaxe. More...
 
ZOO_DLL_EXPORT servicedupService (service *)
 Duplicate a service. More...
 
ZOO_DLL_EXPORT void dumpRegistry (registry *)
 Print the registry on stderr. More...
 
ZOO_DLL_EXPORT bool addServiceToRegistry (registry **, char *, service *)
 Add a service to the registry. More...
 
ZOO_DLL_EXPORT void freeRegistry (registry **)
 Free memory allocated for the registry. More...
 
ZOO_DLL_EXPORT servicegetServiceFromRegistry (registry *, char *, char *)
 Access a service in the registry. More...
 
ZOO_DLL_EXPORT void inheritMap (map **, map *)
 Apply inheritance to an out map from a reference in map. More...
 
ZOO_DLL_EXPORT void inheritIOType (iotype **, iotype *)
 Apply inheritance to an out iotype from a reference in iotype. More...
 
ZOO_DLL_EXPORT void inheritElements (elements **, elements *)
 Apply inheritance to an out elements from a reference in elements. More...
 
ZOO_DLL_EXPORT void inheritance (registry *, service **)
 Apply inheritance to a service based on a registry. More...
 
ZOO_DLL_EXPORT void mapsToCharXXX (maps *, char ***)
 Convert a maps to a char*** (only used for Fortran support) More...
 
ZOO_DLL_EXPORT void charxxxToMaps (char ***, maps **)
 Convert a char*** to a maps (only used for Fortran support) More...
 
void crerror (const char *s)
 Print on stderr the message and the line number of the error which occurred. More...
 
void usage (void)
 
int crlex (void)
 
int crlex_destroy (void)
 
 if (debug)
 
 free (curr_key)
 
 free (current_content)
 
 snprintf (current_maps->name,(strlen($1)+1),"%s", $1)
 
int conf_read (const char *file, maps *my_map)
 Parse the main.cfg file and fill the maps structure. More...
 

Variables

static mapsmy_maps =NULL
 
static mapscurrent_maps =NULL
 
static mapcurrent_content =NULL
 
static char * curr_key
 
static int debug =0
 
int crdebug
 
char crtext []
 
int crlineno
 
FILE * crin
 
union {
char * s
 
char * chaine
 
char * key
 
char * val
 
document
 
miscetoile __pad0__
 
Attributeetoile __pad1__
 
contentetoile __pad2__
 
pair __pad3__
 
 EPAIR
 
 else
 
 SPAIR {curr_key=zStrdup($1)
 
processid __pad4__
 
current_maps next =NULL
 
current_maps content =NULL
 

Data Structure Documentation

struct maps

linked list of map pointer

Small object to store WPS KVP set.

Data Fields
struct maps * child the child maps
struct map * content the content map
char * name the maps name
struct maps * next the pointer to the next maps if any or NULL
struct iotype

Not named linked list.

Used to store information about formats, such as mimeType, encoding ...

Data Fields
struct map * content the content map
struct iotype * next the pointer to the next iotype if any or NULL
struct elements

Metadata information about input or output.

The elements are used to store metadata information defined in the ZCFG.

Data Fields
struct elements * child the pointer to the children element if any (or NULL)
struct map * content the content map
struct iotype * defaults the default iotype
char * format the format: LiteralData or ComplexData or BoundingBoxData
struct map * metadata the metadata map
char * name the name
struct elements * next the pointer to the next element if any (or NULL)
struct iotype * supported the supported iotype
struct service

Metadata information about a full Service.

Data Fields
struct map * content the content map
struct elements * inputs the inputs elements
struct map * metadata the metadata map
char * name the name
struct elements * outputs the outputs elements
struct services

Services chained list.

Data Fields
struct service * content the content service pointer
struct services * next the pointer to the next services*
struct registry

Profile registry.

Data Fields
struct services * content the content services pointer
char * name the name
struct registry * next the next registry pointer

Typedef Documentation

typedef struct elements elements

Metadata information about input or output.

The elements are used to store metadata information defined in the ZCFG.

typedef struct iotype iotype

Not named linked list.

Used to store information about formats, such as mimeType, encoding ...

typedef struct maps maps

linked list of map pointer

Small object to store WPS KVP set.

typedef struct registry registry

Profile registry.

typedef struct service service

Metadata information about a full Service.

typedef struct services services

Services chained list.

Function Documentation

ZOO_DLL_EXPORT void _dumpMap ( map t)

Dump a map on stderr.

Parameters
tthe map to dump
ZOO_DLL_EXPORT void addIntToMap ( map m,
const char *  n,
const int  v 
)

Add a key and an integer value to an existing map.

Parameters
mthe map to add the KVP
nthe key to add
vthe corresponding value to add
ZOO_DLL_EXPORT int addMapsArrayToMaps ( maps **  mo,
maps mi,
char *  typ 
)

Add a Maps containing a MapArray to a Maps.

See also
getMapType
Parameters
mothe maps
mithe maps
typthe map "type"
Returns
ZOO_DLL_EXPORT void addMapsToMaps ( maps **  mo,
maps mi 
)

Add a maps at the end of another maps.

See also
addMapToMap, dupMaps, getMaps
Parameters
mothe maps to add mi
mithe maps to add to mo
ZOO_DLL_EXPORT void addMapToIoType ( iotype **  io,
map mi 
)

Add a map to iotype.

Parameters
iothe iotype to add the map
mithe map to add to io
ZOO_DLL_EXPORT void addMapToMap ( map **  mo,
map mi 
)

Add a map at the end of another map.

Parameters
mothe map to add mi
mithe map to add to mo
ZOO_DLL_EXPORT bool addServiceToRegistry ( registry **  reg,
char *  name,
service content 
)

Add a service to the registry.

Parameters
regthe resgitry to add the service
namethe registry name to update
contentthe service to add
ZOO_DLL_EXPORT void addToElements ( elements **  m,
elements e 
)

Add an elements to another elements.

See also
dupElements
Parameters
mthe elements to add the e
ethe elements to be added to m
ZOO_DLL_EXPORT void addToMap ( map m,
const char *  n,
const char *  v 
)

Add key value pair to an existing map.

Parameters
mthe map to add the KVP
nthe key to add
vthe corresponding value to add
ZOO_DLL_EXPORT map* addToMapWithSize ( map m,
const char *  n,
const char *  v,
int  size 
)

Add a key and a binary value to an existing map.

Parameters
mthe map to add the KVP
nthe key to add
vthe corresponding value to add
sizethe size of the given value
Returns
a pointer to the updated map m
ZOO_DLL_EXPORT void charxxxToMaps ( char ***  c,
maps **  m 
)

Convert a char*** to a maps (only used for Fortran support)

Parameters
cthe array to convert
mthe resulting maps
int conf_read ( const char *  file,
maps my_map 
)

Parse the main.cfg file and fill the maps structure.

Parameters
filethe filename to parse
my_mapthe maps structure to fill
ZOO_DLL_EXPORT bool contains ( map m,
map i 
)

Verify if a map is contained in another map.

Parameters
mthe map to search for i
ithe map to search in m
Returns
true if i was found in m, false in other case
ZOO_DLL_EXPORT int count ( map m)

Count number of map in a map.

Parameters
mthe maps to count
Returns
number of map in a map
ZOO_DLL_EXPORT elements* createElements ( char *  name)

Create a named elements.

Parameters
namethe elements name
Returns
a pointer to the allocated elements
ZOO_DLL_EXPORT elements* createEmptyElements ( )

Create an empty elements.

Returns
a pointer to the allocated elements
ZOO_DLL_EXPORT map* createMap ( const char *  name,
const char *  value 
)

Create a new map.

Parameters
namethe key to add to the map
valuethe corresponding value to add to the map
Returns
a pointer to the allocated map
ZOO_DLL_EXPORT maps* createMaps ( const char *  name)

Create a new maps with the given name.

Parameters
nameof the maps
Returns
the allocated map
void crerror ( const char *  s)

Print on stderr the message and the line number of the error which occurred.

Parameters
sthe error message
int crlex ( void  )
int crlex_destroy ( void  )
ZOO_DLL_EXPORT void dumpElements ( elements e)

Dump an elements on stderr.

Parameters
ethe elements to dump
ZOO_DLL_EXPORT void dumpElementsAsYAML ( elements e,
int  level 
)

Dump an elements on stderr using the YAML syntaxe.

Parameters
ethe elements to dump
ZOO_DLL_EXPORT void dumpMap ( map t)

Dump a map on stderr, see _dumpMap()

Parameters
tthe map to dump
ZOO_DLL_EXPORT void dumpMaps ( maps m)

Dump a maps on stderr, see dumpMap().

Parameters
mthe map to dump
ZOO_DLL_EXPORT void dumpMapsToFile ( maps m,
char *  file_path,
int  limit 
)

Dump a maps to a file, see _dumpMapsToFile().

Parameters
mthe map to dump
file_paththe full path to the file name to store the map
limitthe number limiting the maps to be dumped
ZOO_DLL_EXPORT void dumpMapToFile ( map t,
FILE *  file 
)

Dump a map to a file.

Parameters
tthe map to dump to file
filethe file pointer to store the map
ZOO_DLL_EXPORT void dumpRegistry ( registry r)

Print the registry on stderr.

Parameters
rthe registry
ZOO_DLL_EXPORT void dumpService ( service s)

Dump a service on stderr.

Parameters
sthe service to dump
ZOO_DLL_EXPORT void dumpServiceAsYAML ( service s)

Dump a service on stderr using the YAML syntaxe.

Parameters
sthe service to dump
ZOO_DLL_EXPORT elements* dupElements ( elements e)

Duplicate an elements.

Parameters
ethe elements to clone
Returns
the allocated elements containing a copy of the elements e
ZOO_DLL_EXPORT maps* dupMaps ( maps **  mo)

Duplicate a Maps.

Parameters
mothe maps to clone
Returns
the allocated maps containing a copy of the mo maps
ZOO_DLL_EXPORT service* dupService ( service s)

Duplicate a service.

Parameters
sthe service to clone
Returns
the allocated service containing a copy of the serfvice s
free ( curr_key  )
free ( current_content  )
ZOO_DLL_EXPORT void freeElements ( elements **  e)

Free allocated memory of an elements.

Require to call free on e after calling this function.

Parameters
ethe iotype to free
ZOO_DLL_EXPORT void freeIOType ( iotype **  i)

Free allocated memory of an iotype.

Require to call free on i after calling this function.

Parameters
ithe iotype to free
ZOO_DLL_EXPORT void freeMap ( map **  mo)

Free allocated memory of a map.

Require to call free on mo after calling this function.

Parameters
mothe map to free
ZOO_DLL_EXPORT void freeMaps ( maps **  mo)

Free allocated memory of a maps.

Require to call free on mo after calling this function.

Parameters
mothe maps to free
ZOO_DLL_EXPORT void freeRegistry ( registry **  r)

Free memory allocated for the registry.

Parameters
rthe registry
ZOO_DLL_EXPORT void freeService ( service **  s)

Free allocated memory of a service.

Require to call free on e after calling this function.

Parameters
sthe service to free
ZOO_DLL_EXPORT elements* getElements ( elements m,
char *  key 
)

Access a specific elements named key.

Parameters
mthe elements to search
keythe elements name to search
Returns
a pointer to the specific element if found, NULL in other case.
ZOO_DLL_EXPORT iotype* getIoTypeFromElement ( elements e,
char *  name,
map values 
)

Access a specific iotype from an elements.

Parameters
ethe elements to search for the name
namethe name to search in the elements e
valuesthe map to verify it was contained in the defaults or supported content of the elements e
Returns
a pointer on the iotype found or NULL if not found
ZOO_DLL_EXPORT map* getLastMap ( map m)

Access the last map.

Parameters
mthe map to search for the lastest map
Returns
a pointer on the lastest map found or NULL if not found
ZOO_DLL_EXPORT map* getMap ( map m,
const char *  key 
)

Access a specific map.

Parameters
mthe map to search for the key
keythe key to search in the map
Returns
a pointer on the map found or NULL if not found
ZOO_DLL_EXPORT map* getMapArray ( map m,
const char *  key,
int  index 
)

Access a specific map array element.

Parameters
mthe map to search for the key
keythe key to search in the map
indexof the MapArray
Returns
a pointer on the map found or NULL if not found
ZOO_DLL_EXPORT map* getMapFromMaps ( maps m,
const char *  key,
const char *  subkey 
)

Access a specific map from a maps.

Parameters
mthe maps to search for the key
keythe key to search in the maps
subkeythe key to search in the map (found for the key, if any)
Returns
a pointer on the map found or NULL if not found
ZOO_DLL_EXPORT map* getMapOrFill ( map **  m,
const char *  key,
const char *  value 
)

Access a specific map or set its value.

Parameters
mthe map to search for the key
keythe key to search/add in the map
valuethe value to add if the key does not exist
Returns
a pointer on the map found or NULL if not found
ZOO_DLL_EXPORT maps* getMaps ( maps m,
const char *  key 
)

Access a specific maps.

Parameters
mthe maps to search for the key
keythe key to search in the maps
Returns
a pointer on the maps found or NULL if not found
ZOO_DLL_EXPORT map* getMapType ( map mt)

Access the map "type".

Parameters
mtthe map
Returns
a pointer on the map for mimeType/dataType/CRS if found, NULL in other case
ZOO_DLL_EXPORT service* getServiceFromRegistry ( registry r,
char *  level,
char *  sname 
)

Access a service in the registry.

Parameters
rthe registry
levelthe regitry to search ("concept", "generic" or "implementation")
snamethe service name
Returns
the service pointer if a corresponding service was found or NULL
ZOO_DLL_EXPORT bool hasElement ( elements e,
const char *  key 
)

Verify if an elements contains a name equal to the given key.

Parameters
ethe elements to search for the key
keythe elements name to search
Returns
true if the elements contains the name, false in other cases.
ZOO_DLL_EXPORT bool hasKey ( map m,
const char *  key 
)

Verify if a key exist in a map.

Parameters
mthe map to search for the key
keythe key to search in the map
Returns
true if the key wwas found, false in other case
if ( debug  )
ZOO_DLL_EXPORT void inheritance ( registry r,
service **  s 
)

Apply inheritance to a service based on a registry.

Parameters
rthe registry storing profiles hierarchy
sthe service to update depending on its inheritance
ZOO_DLL_EXPORT void inheritElements ( elements **  out,
elements in 
)

Apply inheritance to an out elements from a reference in elements.

Parameters
outthe elements to update
inthe reference elements (containing inherited properties)
ZOO_DLL_EXPORT void inheritIOType ( iotype **  out,
iotype in 
)

Apply inheritance to an out iotype from a reference in iotype.

Parameters
outthe iotype to update
inthe reference iotype (containing inherited properties)
ZOO_DLL_EXPORT void inheritMap ( map **  out,
map in 
)

Apply inheritance to an out map from a reference in map.

Parameters
outthe map to update
inthe reference map (containing inherited properties)
ZOO_DLL_EXPORT void loadMapBinaries ( map **  out,
map in 
)

Load binary values from a map (in) and add them to another map (out).

This function will take care of MapArray.

See also
loadMapBinary
Parameters
outthe map to add binaries values
inthe map containing the binary values to add ti out
ZOO_DLL_EXPORT void loadMapBinary ( map **  out,
map in,
int  pos 
)

Load binary values from a map (in) and add them to another map (out)

Parameters
outthe map to add binaries values
inthe map containing the binary values to add ti out
posindex of the binary in an array (in case of "MapArray")
ZOO_DLL_EXPORT void mapsToCharXXX ( maps m,
char ***  c 
)

Convert a maps to a char*** (only used for Fortran support)

Parameters
mthe maps to convert
cthe resulting array
ZOO_DLL_EXPORT void setElementsName ( elements **  elem,
char *  name 
)

Set the name of an elements.

Parameters
namethe elements name
Returns
a pointer to the allocated elements
ZOO_DLL_EXPORT void setMapArray ( map m,
const char *  key,
int  index,
const char *  value 
)

Add a key value in a MapArray for a specific index.

Parameters
mthe map to search for the key
keythe key to search in the map
indexthe index of the MapArray
valuethe value to set in the MapArray
Returns
a pointer on the map found or NULL if not found
ZOO_DLL_EXPORT void setMapInMaps ( maps m,
const char *  key,
const char *  subkey,
const char *  value 
)

Set a key value pair to a map contained in a Maps.

Parameters
mthe maps
keythe maps name
subkeythe map name included in the maps corresponding to key
valuethe corresponding value to add in the map
ZOO_DLL_EXPORT void setServiceName ( service **  serv,
char *  name 
)

Set the name of a service.

Parameters
namethe service name
snprintf ( current_maps->  name,
(strlen($1)+1)  ,
"%s"  ,
  $1 
)
void usage ( void  )

Variable Documentation

miscetoile __pad0__
Attributeetoile __pad1__
contentetoile __pad2__
pair __pad3__
processid __pad4__
current_maps content =NULL
int crdebug
FILE* crin
int crlineno
char crtext[]
char* curr_key
static
freeMap & current_content =NULL
static
current_maps =NULL
static
int debug =0
static
union { ... } document
else
Initial value:
{
static map * current_content
Definition: main_conf_read.y:31
static char * curr_key
Definition: main_conf_read.y:32
ZOO_DLL_EXPORT void addToMap(map *, const char *, const char *)
Add key value pair to an existing map.
Definition: service.c:451
EPAIR
Initial value:
{
if(current_content==NULL)
static map * current_content
Definition: main_conf_read.y:31
ZOO_DLL_EXPORT map * createMap(const char *, const char *)
Create a new map.
Definition: service.c:151
static char * curr_key
Definition: main_conf_read.y:32
maps* my_maps =NULL
static
current_maps next =NULL
SPAIR {curr_key=zStrdup($1)