OpenScop  0.9.0
Data Structures | Typedefs | Functions
interface.h File Reference
#include <stdio.h>
Include dependency graph for interface.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  osl_interface

Typedefs

typedef void(* osl_idump_f )(FILE *, void *, int)
typedef char *(* osl_sprint_f )(void *)
typedef void *(* osl_sread_f )(char **)
typedef void *(* osl_malloc_f )()
typedef void(* osl_free_f )(void *)
typedef void *(* osl_clone_f )(void *)
typedef int(* osl_equal_f )(void *, void *)
typedef struct osl_interface osl_interface_t
typedef struct osl_interfaceosl_interface_p

Functions

void osl_interface_idump (FILE *, osl_interface_p, int)
void osl_interface_dump (FILE *, osl_interface_p)
void osl_interface_add (osl_interface_p *, osl_interface_p)
osl_interface_p osl_interface_malloc ()
void osl_interface_free (osl_interface_p)
int osl_interface_number (osl_interface_p)
osl_interface_p osl_interface_nclone (osl_interface_p, int)
osl_interface_p osl_interface_clone (osl_interface_p)
int osl_interface_equal (osl_interface_p, osl_interface_p)
osl_interface_p osl_interface_lookup (osl_interface_p, char *)
osl_interface_p osl_interface_get_default_registry ()

Typedef Documentation

typedef void*(* osl_clone_f)(void *)

Definition at line 80 of file interface.h.

typedef int(* osl_equal_f)(void *, void *)

Definition at line 81 of file interface.h.

typedef void(* osl_free_f)(void *)

Definition at line 79 of file interface.h.

typedef void(* osl_idump_f)(FILE *, void *, int)

Definition at line 75 of file interface.h.

typedef struct osl_interface* osl_interface_p

Definition at line 101 of file interface.h.

Definition at line 100 of file interface.h.

typedef void*(* osl_malloc_f)()

Definition at line 78 of file interface.h.

typedef char*(* osl_sprint_f)(void *)

Definition at line 76 of file interface.h.

typedef void*(* osl_sread_f)(char **)

Definition at line 77 of file interface.h.


Function Documentation

void osl_interface_add ( osl_interface_p list,
osl_interface_p  interface 
)

osl_interface_add function: this function adds an interface node (it may be a list as well) to a list of interfaces provided as parameter (list). The new node is inserted at the end of the list.

Parameters:
listThe list of interfaces to add a node (NULL if empty).
interfaceThe interface to add to the list.

Definition at line 177 of file interface.c.

References osl_interface::next, OSL_error, osl_interface_lookup(), and osl_interface::URI.

Referenced by osl_interface_get_default_registry(), osl_interface_nclone(), and osl_scop_register_extension().

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

Parameters:
interfaceThe pointer to the interface structure we want to copy.
Returns:
A pointer to the copy of the interface structure.

Definition at line 314 of file interface.c.

References osl_interface_nclone().

Referenced by osl_generic_clone(), osl_scop_clone(), and osl_scop_pread().

void osl_interface_dump ( FILE *  file,
osl_interface_p  interface 
)

osl_interface_dump function: this function prints the content of a osl_interface_t structure (*interface) into a file (file, possibly stdout).

Parameters:
fileFile where informations are printed.
interfaceThe interface structure to print.

Definition at line 154 of file interface.c.

References osl_interface_idump().

int osl_interface_equal ( osl_interface_p  interface1,
osl_interface_p  interface2 
)

osl_interface_equal function: this function returns true if the two interface structures are the same, (content-wise) false otherwise.

Parameters:
interface1The first interface structure.
interface2The second interface structure.
Returns:
1 if interface1 and interface2 are the same, 0 otherwise.

Definition at line 328 of file interface.c.

References osl_interface::clone, osl_interface::equal, osl_interface::free, osl_interface::idump, osl_interface::malloc, osl_interface::sprint, osl_interface::sread, and osl_interface::URI.

Referenced by osl_generic_equal(), and osl_scop_equal().

void osl_interface_free ( osl_interface_p  interface)

osl_interface_free function: this function frees the allocated memory for an osl_interface_t structure, and all the interfaces stored in the list.

Parameters:
[in]interfaceThe pointer to the interface we want to free.

Definition at line 237 of file interface.c.

References osl_interface::next, and osl_interface::URI.

Referenced by osl_generic_free(), osl_scop_free(), osl_scop_read(), osl_statement_read(), and osl_symbols_sread().

osl_interface_get_default_registry function: this function creates the list of known interfaces (of all generic types, including extensions) and returns it.

Returns:
The list of known interfaces.

Definition at line 386 of file interface.c.

References osl_arrays_interface(), osl_body_interface(), osl_clay_interface(), osl_comment_interface(), osl_coordinates_interface(), osl_dependence_interface(), osl_extbody_interface(), osl_interface_add(), osl_loop_interface(), osl_null_interface(), osl_pluto_unroll_interface(), osl_relation_interface(), osl_scatnames_interface(), osl_strings_interface(), osl_symbols_interface(), and osl_textual_interface().

Referenced by osl_scop_read(), osl_statement_read(), and osl_symbols_sread().

void osl_interface_idump ( FILE *  file,
osl_interface_p  interface,
int  level 
)

osl_interface_idump function: this function displays an osl_interface_t structure (*interface) 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:
fileThe file where the information has to be printed.
interfaceThe interface structure which has to be printed.
levelNumber of spaces before printing, for each line.

Definition at line 100 of file interface.c.

References osl_interface::URI.

Referenced by osl_generic_idump(), osl_interface_dump(), and osl_scop_idump().

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

Parameters:
listThe interface list where to search a given interface URI.
URIThe URI of the interface we are looking for.
Returns:
The first interface of the requested URI in the list.

Definition at line 362 of file interface.c.

References osl_interface::next, OSL_warning, and osl_interface::URI.

Referenced by osl_generic_read_one(), osl_generic_sread_one(), and osl_interface_add().

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

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

Definition at line 212 of file interface.c.

References osl_interface::clone, osl_interface::equal, osl_interface::free, osl_interface::idump, osl_interface::malloc, osl_interface::next, OSL_malloc, osl_interface::sprint, osl_interface::sread, and osl_interface::URI.

Referenced by osl_arrays_interface(), osl_body_interface(), osl_clay_interface(), osl_comment_interface(), osl_coordinates_interface(), osl_dependence_interface(), osl_extbody_interface(), osl_interface_nclone(), osl_irregular_interface(), osl_loop_interface(), osl_null_interface(), osl_pluto_unroll_interface(), osl_relation_interface(), osl_scatnames_interface(), osl_strings_interface(), osl_symbols_interface(), and osl_textual_interface().

osl_interface_nclone function: This function builds and returns a "hard copy" (not a pointer copy) of the n first elements of an osl_interface_t list.

Parameters:
interfaceThe pointer to the interface structure we want to clone.
nThe number of nodes we want to copy (-1 for infinity).
Returns:
The clone of the n first nodes of the interface list.

Definition at line 283 of file interface.c.

References osl_interface::clone, osl_interface::equal, osl_interface::free, osl_interface::idump, osl_interface::malloc, osl_interface_add(), osl_interface_malloc(), OSL_strdup, osl_interface::sprint, osl_interface::sread, and osl_interface::URI.

Referenced by osl_generic_read_one(), osl_generic_sread_one(), and osl_interface_clone().

osl_interface_number function: this function returns the number of statements in the interface list provided as parameter.

Parameters:
[in]interfaceThe first element of the interface list.
Returns:
The number of statements in the interface list.

Definition at line 264 of file interface.c.