generic.h File Reference

#include <osl/interface.h>
Include dependency graph for generic.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  osl_generic

Typedefs

typedef struct osl_generic osl_generic_t
typedef struct osl_genericosl_generic_p

Functions

void osl_generic_idump (FILE *, osl_generic_p, int)
void osl_generic_dump (FILE *, osl_generic_p)
void osl_generic_print (FILE *, osl_generic_p)
osl_generic_p osl_generic_sread (char *, osl_interface_p)
osl_generic_p osl_generic_read_one (FILE *, osl_interface_p)
osl_generic_p osl_generic_read (FILE *, osl_interface_p)
void osl_generic_add (osl_generic_p *, osl_generic_p)
osl_generic_p osl_generic_malloc ()
void osl_generic_free (osl_generic_p)
osl_generic_p osl_generic_clone (osl_generic_p)
int osl_generic_equal (osl_generic_p, osl_generic_p)
int osl_generic_has_URI (osl_generic_p, char *)
void * osl_generic_lookup (osl_generic_p, char *)
osl_generic_p osl_generic_shell (void *, osl_interface_p)

Typedef Documentation

typedef struct osl_generic* osl_generic_p

Definition at line 87 of file generic.h.

typedef struct osl_generic osl_generic_t

Definition at line 86 of file generic.h.


Function Documentation

void osl_generic_add ( osl_generic_p list,
osl_generic_p  generic 
)

osl_generic_add function: this function adds a generic node (it may be a list as well) to a list of generics provided as parameter (list). The new node is inserted at the end of the list.

Parameters:
[in] list The list of generics to add a node (NULL if empty).
[in] generic The generic list to add to the initial list.

Definition at line 295 of file generic.c.

References osl_generic::interface, osl_generic::next, OSL_error, osl_generic_lookup(), and osl_interface::URI.

Referenced by osl_generic_clone(), osl_generic_sread(), and osl_scop_register_extension().

osl_generic_p osl_generic_clone ( osl_generic_p  generic  ) 

osl_generic_clone function: This function builds and returns a "hard copy" (not a pointer copy) of an osl_generic_t data structure.

Parameters:
[in] generic The pointer to the generic structure we want to clone.
Returns:
A pointer to the clone of the input generic structure.

Definition at line 381 of file generic.c.

References osl_interface::clone, osl_generic::interface, osl_generic_add(), osl_generic_malloc(), osl_interface_clone(), and OSL_warning.

Referenced by osl_scop_clone(), and osl_statement_clone().

void osl_generic_dump ( FILE *  file,
osl_generic_p  generic 
)

osl_generic_dump function: this function prints the content of an osl_generic_t structure (*generic) into a file (file, possibly stdout).

Parameters:
[in] file File where the information has to be printed.
[in] generic The generic structure to print.

Definition at line 145 of file generic.c.

References osl_generic_idump().

int osl_generic_equal ( osl_generic_p  x1,
osl_generic_p  x2 
)

osl_generic_equal function: this function returns true if the two generic structures are the same, false otherwise. This functions considers two generic structures as equal independently of the order of the nodes.

Parameters:
[in] x1 The first generic structure.
[in] x2 The second generic structure.
Returns:
1 if x1 and x2 are the same (content-wise), 0 otherwise.

Definition at line 433 of file generic.c.

References osl_generic::data, osl_interface::equal, osl_generic::interface, osl_generic::next, osl_generic_count(), osl_interface_equal(), and OSL_warning.

Referenced by osl_scop_equal(), and osl_statement_equal().

void osl_generic_free ( osl_generic_p  generic  ) 

osl_generic_free function: This function frees the allocated memory for a generic structure.

Parameters:
[in] generic The pointer to the generic structure we want to free.

Definition at line 348 of file generic.c.

References osl_interface::free, osl_generic::interface, osl_generic::next, osl_interface_free(), and OSL_warning.

Referenced by osl_scop_free(), and osl_statement_free().

int osl_generic_has_URI ( osl_generic_p  x,
char *  URI 
)

osl_generic_has_URI function: this function returns 1 if the generic provided as parameter has a given URI, 0 other wise.

Parameters:
[in] x The generic structure to test.
[in] URI The URI value to test.
Returns:
1 if x has the provided URI, 0 otherwise.

Definition at line 489 of file generic.c.

References osl_generic::interface, and osl_interface::URI.

Referenced by osl_generic_lookup(), osl_scop_print(), osl_statement_integrity_check(), and osl_statement_pprint().

void osl_generic_idump ( FILE *  file,
osl_generic_p  generic,
int  level 
)

osl_generic_idump function: this function displays an osl_generic_t structure (*generic) into a file (file, possibly stdout) in a way that trends to be understandable. It includes an indentation level (level) in order to work with others idump functions.

Parameters:
[in] file File where informations are printed.
[in] generic The generic whose information has to be printed.
[in] level Number of spaces before printing, for each line.

Definition at line 88 of file generic.c.

References osl_interface_idump().

Referenced by osl_generic_dump(), osl_scop_idump(), and osl_statement_idump().

void* osl_generic_lookup ( osl_generic_p  x,
char *  URI 
)

osl_generic_lookup function: this function returns the first generic with a given URI in the generic list provided as parameter and NULL if it doesn't find such a generic.

Parameters:
[in] x The generic list where to search a given generic URI.
[in] URI The URI of the generic we are looking for.
Returns:
The first generic of the requested URI in the list.

Definition at line 510 of file generic.c.

References osl_generic::data, osl_generic::next, and osl_generic_has_URI().

Referenced by osl_generic_add(), osl_scop_print(), and osl_scop_register_extension().

osl_generic_p osl_generic_malloc (  ) 

osl_generic_malloc function: This function allocates the memory space for an osl_generic_t structure and sets its fields with default values. Then it returns a pointer to the allocated space.

Returns:
A pointer to an empty generic structure with fields set to default values.

Definition at line 331 of file generic.c.

References OSL_malloc.

Referenced by osl_generic_clone(), osl_generic_read_one(), osl_generic_shell(), and osl_generic_sread().

void osl_generic_print ( FILE *  file,
osl_generic_p  generic 
)

osl_generic_print function: this function prints the content of an osl_generic_t structure (*generic) into a string (returned) in the OpenScop format.

Parameters:
[in] file File where the information has to be printed.
[in] generic The generic structure to print.

Definition at line 157 of file generic.c.

Referenced by osl_scop_print(), and osl_statement_pprint().

osl_generic_p osl_generic_read ( FILE *  file,
osl_interface_p  registry 
)

osl_generic_read function: this function reads a list of generics from a file (possibly stdin) complying to the OpenScop textual format and a list of known interfaces. It returns a pointer to the list of corresponding generic structures.

Parameters:
[in] file The input file where to read a list of data.
[in] registry The list of known interfaces (others are ignored).
Returns:
A pointer to the generic information list that has been read.

Definition at line 271 of file generic.c.

References osl_generic_sread(), OSL_TAG_END_SCOP, and osl_util_read_uptotag().

Referenced by osl_scop_pread().

osl_generic_p osl_generic_read_one ( FILE *  file,
osl_interface_p  registry 
)

osl_generic_read_one function: this function reads one generic from a file (possibly stdin) complying to the OpenScop textual format and a list of known interfaces. It returns a pointer to the corresponding generic structure. If no tag is found, an error is reported, in the case of an empty or closing tag name the function returns the NULL pointer.

Parameters:
[in] file The input file where to read a list of data.
[in] registry The list of known interfaces (others are ignored).
Returns:
A pointer to the generic that has been read.

Definition at line 230 of file generic.c.

References OSL_debug, osl_generic_malloc(), osl_interface_lookup(), osl_interface_nclone(), osl_util_read_tag(), osl_util_read_uptoendtag(), OSL_warning, and osl_interface::sread.

Referenced by osl_scop_pread(), and osl_statement_pread().

osl_generic_p osl_generic_shell ( void *  data,
osl_interface_p  interface 
)

osl_generic_shell function: this function creates and returns a generic structure "shell" which embed the data and interface provided as parameters.

Parameters:
[in] data Data to put in the generic shell.
[in] interface Interface to put in the generic shell.
Returns:
A new generic structure containing the data and interface.

Definition at line 530 of file generic.c.

References osl_generic_malloc(), and OSL_warning.

osl_generic_p osl_generic_sread ( char *  string,
osl_interface_p  registry 
)

osl_generic_sread function: this function reads a list of generics from a string complying to the OpenScop textual format and a list of known interfaces. It returns a pointer to the corresponding list of generic structures.

Parameters:
[in] string The string where to read a list of data.
[in] registry The list of known interfaces (others are ignored).
Returns:
A pointer to the generic information list that has been read.

Definition at line 194 of file generic.c.

References osl_interface::next, osl_generic_add(), osl_generic_malloc(), osl_interface_nclone(), osl_util_tag_content(), osl_interface::sread, osl_coordinates::start, and osl_interface::URI.

Referenced by osl_generic_read(), and osl_scop_register_extension().

Generated on Fri Feb 17 15:26:44 2012 for OpenScop by  doxygen 1.6.3