OpenScop 0.8.1
Data Structures | Defines | Typedefs | Functions

arrays.h File Reference

#include <stdio.h>
#include <osl/interface.h>
Include dependency graph for arrays.h:

Go to the source code of this file.

Data Structures

struct  osl_arrays

Defines

#define OSL_URI_ARRAYS   "arrays"
#define OSL_TAG_ARRAYS_START   "<"OSL_URI_ARRAYS">"
#define OSL_TAG_ARRAYS_STOP   "</"OSL_URI_ARRAYS">"

Typedefs

typedef struct osl_arrays osl_arrays_t
typedef struct osl_arraysosl_arrays_p

Functions

void osl_arrays_idump (FILE *, osl_arrays_p, int)
void osl_arrays_dump (FILE *, osl_arrays_p)
char * osl_arrays_sprint (osl_arrays_p)
osl_arrays_p osl_arrays_sread (char **)
osl_arrays_p osl_arrays_malloc ()
void osl_arrays_free (osl_arrays_p)
osl_arrays_p osl_arrays_clone (osl_arrays_p)
int osl_arrays_equal (osl_arrays_p, osl_arrays_p)
char ** osl_arrays_generate_names (osl_arrays_p, int *)
osl_interface_p osl_arrays_interface ()

Define Documentation

#define OSL_TAG_ARRAYS_START   "<"OSL_URI_ARRAYS">"

Definition at line 77 of file arrays.h.

Referenced by osl_arrays_sprint().

#define OSL_TAG_ARRAYS_STOP   "</"OSL_URI_ARRAYS">"

Definition at line 78 of file arrays.h.

Referenced by osl_arrays_sprint().

#define OSL_URI_ARRAYS   "arrays"

Definition at line 76 of file arrays.h.

Referenced by osl_arrays_interface().


Typedef Documentation

typedef struct osl_arrays* osl_arrays_p

Definition at line 93 of file arrays.h.

typedef struct osl_arrays osl_arrays_t

Definition at line 92 of file arrays.h.


Function Documentation

osl_arrays_p osl_arrays_clone ( osl_arrays_p  arrays)

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

Parameters:
arraysThe pointer to the arrays structure we want to copy.
Returns:
A pointer to the copy of the arrays structure.

Definition at line 319 of file arrays.c.

References osl_arrays::id, osl_arrays::names, osl_arrays::nb_names, osl_arrays_malloc(), OSL_error, and OSL_malloc.

Referenced by osl_arrays_interface().

void osl_arrays_dump ( FILE *  file,
osl_arrays_p  arrays 
)

osl_arrays_print function: this function prints the content of an osl_arrays_t structure (*arrays) into a file (file, possibly stdout).

Parameters:
fileThe file where the information has to be printed.
arraysThe arrays structure whose information has to be printed.

Definition at line 134 of file arrays.c.

References osl_arrays_idump().

int osl_arrays_equal ( osl_arrays_p  a1,
osl_arrays_p  a2 
)

osl_arrays_equal function: this function returns true if the two arrays structures are the same (content-wise), false otherwise. This functions considers two arrays structures as equal if the order of the array names differ, however the identifiers and names must be the same.

Parameters:
a1The first arrays structure.
a2The second arrays structure.
Returns:
1 if a1 and a2 are the same (content-wise), 0 otherwise.

Definition at line 354 of file arrays.c.

References osl_arrays::id, osl_arrays::names, and osl_arrays::nb_names.

Referenced by osl_arrays_interface().

void osl_arrays_free ( osl_arrays_p  arrays)

osl_arrays_free function: This function frees the allocated memory for an arrays structure.

Parameters:
arraysThe pointer to the arrays structure we want to free.

Definition at line 291 of file arrays.c.

References osl_arrays::id, osl_arrays::names, and osl_arrays::nb_names.

Referenced by osl_arrays_interface().

char** osl_arrays_generate_names ( osl_arrays_p  arrays,
int *  nb_names 
)

osl_arrays_generate_names function: This function generates an array of strings corresponding to array names. The ith string will correspond to the array name with identifier i in the arrays structure. If some identifiers are missing, the corresponding names will be generated. The size of the array of strings corresponds to the maximum identifier, it is returned using the parameter nb_names.

Parameters:
arraysThe source of some array names.
nb_namesPointer to the location to store the number of names.
Returns:
An array of strings corresponding to the array names.

Definition at line 396 of file arrays.c.

References osl_arrays::id, osl_arrays::names, osl_arrays::nb_names, OSL_error, and OSL_malloc.

void osl_arrays_idump ( FILE *  file,
osl_arrays_p  arrays,
int  level 
)

osl_arrays_print_structure function: this function displays a osl_arrays_t structure (*arrays) 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.
arraysThe arrays structure whose information has to be printed.
levelNumber of spaces before printing, for each line.

Definition at line 90 of file arrays.c.

References osl_arrays::id, osl_arrays::names, and osl_arrays::nb_names.

Referenced by osl_arrays_dump(), and osl_arrays_interface().

osl_interface_p osl_arrays_interface ( )

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

Returns:
An interface structure for the arrays extension.

Definition at line 441 of file arrays.c.

References osl_interface::clone, osl_interface::equal, osl_interface::free, osl_interface::idump, osl_interface::malloc, osl_arrays_clone(), osl_arrays_equal(), osl_arrays_free(), osl_arrays_idump(), osl_arrays_malloc(), osl_arrays_sprint(), osl_arrays_sread(), osl_interface_malloc(), OSL_URI_ARRAYS, osl_interface::sprint, osl_interface::sread, and osl_interface::URI.

osl_arrays_p osl_arrays_malloc ( )

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

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

Definition at line 274 of file arrays.c.

References osl_arrays::id, osl_arrays::names, osl_arrays::nb_names, and OSL_malloc.

Referenced by osl_arrays_clone(), osl_arrays_interface(), and osl_arrays_sread().

char* osl_arrays_sprint ( osl_arrays_p  arrays)

osl_arrays_print_openscop function: this function prints the content of an osl_arrays_t structure (*arrays) into a string (returned) in the OpenScop textual format.

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

Definition at line 146 of file arrays.c.

References osl_arrays::id, osl_arrays::names, osl_arrays::nb_names, OSL_malloc, OSL_MAX_STRING, OSL_realloc, OSL_TAG_ARRAYS_START, OSL_TAG_ARRAYS_STOP, and osl_util_safe_strcat().

Referenced by osl_arrays_interface().

osl_arrays_p osl_arrays_sread ( char **  extensions_fixme)

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

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

Definition at line 191 of file arrays.c.

References osl_arrays::id, osl_arrays::names, osl_arrays::nb_names, osl_arrays_malloc(), OSL_debug, OSL_error, OSL_MAX_STRING, and osl_util_read_int().

Referenced by osl_arrays_interface().