OpenScop  0.9.0
Functions
irregular.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <osl/macros.h>
#include <osl/util.h>
#include <osl/strings.h>
#include <osl/interface.h>
#include <osl/extensions/irregular.h>
Include dependency graph for irregular.c:

Go to the source code of this file.

Functions

void osl_irregular_idump (FILE *file, osl_irregular_p irregular, int level)
void osl_irregular_dump (FILE *file, osl_irregular_p irregular)
char * osl_irregular_sprint (osl_irregular_p irregular)
osl_irregular_p osl_irregular_sread (char **extensions_fixme)
osl_irregular_p osl_irregular_malloc ()
void osl_irregular_free (osl_irregular_p irregular)
osl_irregular_p osl_irregular_clone (osl_irregular_p irregular)
int osl_irregular_equal (osl_irregular_p c1, osl_irregular_p c2)
osl_irregular_p osl_irregular_add_control (osl_irregular_p irregular, char **iterators, int nb_iterators, char *body)
osl_irregular_p osl_irregular_add_exit (osl_irregular_p irregular, char **iterators, int nb_iterators, char *body)
osl_irregular_p osl_irregular_add_predicates (osl_irregular_p irregular, int *predicates, int nb_add_predicates)
osl_interface_p osl_irregular_interface ()

Function Documentation

osl_irregular_p osl_irregular_add_control ( osl_irregular_p  irregular,
char **  iterators,
int  nb_iterators,
char *  body 
)
osl_irregular_p osl_irregular_add_exit ( osl_irregular_p  irregular,
char **  iterators,
int  nb_iterators,
char *  body 
)
osl_irregular_p osl_irregular_add_predicates ( osl_irregular_p  irregular,
int *  predicates,
int  nb_add_predicates 
)

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

Parameters:
irregularThe pointer to the irregular structure we want to copy.
Returns:
A pointer to the copy of the irregular structure.

Definition at line 381 of file irregular.c.

References osl_irregular::body, osl_irregular::iterators, osl_interface::malloc, osl_irregular::nb_control, osl_irregular::nb_exit, osl_irregular::nb_iterators, osl_irregular::nb_predicates, osl_irregular::nb_statements, osl_irregular_malloc(), OSL_strdup, and osl_irregular::predicates.

Referenced by osl_irregular_interface().

void osl_irregular_dump ( FILE *  file,
osl_irregular_p  irregular 
)

osl_irregular_dump function: this function prints the content of an osl_irregular_t structure (*irregular) into a file (file, possibly stdout).

Parameters:
fileThe file where the information has to be printed.
irregularThe irregular structure whose information has to be printed.

Definition at line 147 of file irregular.c.

References osl_irregular_idump().

osl_irregular_equal function: this function returns true if the two irregular structures are the same (content-wise), false otherwise. This functions considers two irregular

Parameters:
c1The first irregular structure.
c2The second irregular structure.
Returns:
1 if c1 and c2 are the same (content-wise), 0 otherwise.

Definition at line 463 of file irregular.c.

References osl_irregular::body, osl_irregular::iterators, osl_irregular::nb_control, osl_irregular::nb_exit, osl_irregular::nb_iterators, osl_irregular::nb_predicates, and osl_irregular::nb_statements.

Referenced by osl_irregular_interface().

void osl_irregular_free ( osl_irregular_p  irregular)

osl_irregular_free function: This function frees the allocated memory for an osl_irregular_t structure.

Parameters:
irregularThe pointer to the irregular structure we want to free.

Definition at line 339 of file irregular.c.

References osl_irregular::body, osl_interface::free, osl_irregular::iterators, osl_irregular::nb_control, osl_irregular::nb_exit, osl_irregular::nb_iterators, osl_irregular::nb_predicates, osl_irregular::nb_statements, and osl_irregular::predicates.

Referenced by osl_irregular_interface().

void osl_irregular_idump ( FILE *  file,
osl_irregular_p  irregular,
int  level 
)

osl_irregular_idump function: this function displays an osl_irregular_t structure (*irregular) 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.
irregularThe irregular structure whose information has to be printed.
levelNumber of spaces before printing, for each line.

Definition at line 89 of file irregular.c.

References osl_irregular::body, osl_irregular::iterators, osl_irregular::nb_control, osl_irregular::nb_exit, osl_irregular::nb_iterators, osl_irregular::nb_predicates, osl_irregular::nb_statements, and osl_irregular::predicates.

Referenced by osl_irregular_dump(), and osl_irregular_interface().

osl_irregular_interface function: this function creates an interface structure corresponding to the irregular extension and returns it).

Returns:
An interface structure for the irregular extension.

Definition at line 749 of file irregular.c.

References osl_interface_malloc(), osl_irregular_clone(), osl_irregular_equal(), osl_irregular_free(), osl_irregular_idump(), osl_irregular_malloc(), osl_irregular_sprint(), osl_irregular_sread(), OSL_strdup, and OSL_URI_IRREGULAR.

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

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

Definition at line 315 of file irregular.c.

References osl_irregular::body, osl_irregular::iterators, osl_irregular::nb_control, osl_irregular::nb_exit, osl_irregular::nb_iterators, osl_irregular::nb_predicates, osl_irregular::nb_statements, OSL_malloc, and osl_irregular::predicates.

Referenced by osl_irregular_add_control(), osl_irregular_add_exit(), osl_irregular_add_predicates(), osl_irregular_clone(), osl_irregular_interface(), and osl_irregular_sread().

char* osl_irregular_sprint ( osl_irregular_p  irregular)

osl_irregular_sprint function: this function prints the content of an osl_irregular_t structure (*irregular) into a string (returned) in the OpenScop textual format.

Parameters:
irregularThe irregular structure whose information has to be printed.
Returns:
A string containing the OpenScop dump of the irregular structure.

Definition at line 159 of file irregular.c.

References osl_irregular::body, osl_interface::free, osl_irregular::iterators, osl_irregular::nb_control, osl_irregular::nb_exit, osl_irregular::nb_iterators, osl_irregular::nb_predicates, osl_irregular::nb_statements, OSL_malloc, OSL_MAX_STRING, OSL_realloc, OSL_TAG_IRREGULAR_START, OSL_TAG_IRREGULAR_STOP, osl_util_safe_strcat(), and osl_irregular::predicates.

Referenced by osl_irregular_interface().

osl_irregular_p osl_irregular_sread ( char **  extensions_fixme)

osl_irregular_sread function: this function reads a irregular structure from a string complying to the OpenScop textual format and returns a pointer to this irregular structure. The string should contain only one textual format of a irregular structure.

Parameters:
extensionsThe input string where to find a irregular structure.
Returns:
A pointer to the irregular structure that has been read.

Definition at line 230 of file irregular.c.

References osl_irregular::body, osl_irregular::iterators, osl_irregular::nb_control, osl_irregular::nb_exit, osl_irregular::nb_iterators, osl_irregular::nb_predicates, osl_irregular::nb_statements, OSL_debug, OSL_error, osl_irregular_malloc(), OSL_malloc, OSL_MAX_STRING, OSL_strdup, and osl_irregular::predicates.

Referenced by osl_irregular_interface().