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

Go to the source code of this file.

Functions

void osl_names_idump (FILE *file, osl_names_p names, int level)
void osl_names_dump (FILE *file, osl_names_p names)
osl_names_p osl_names_malloc ()
void osl_names_free (osl_names_p names)
osl_names_p osl_names_generate (char *parameter_prefix, int nb_parameters, char *iterator_prefix, int nb_iterators, char *scatt_dim_prefix, int nb_scatt_dims, char *local_dim_prefix, int nb_local_dims, char *array_prefix, int nb_arrays)
osl_names_p osl_names_clone (osl_names_p names)

Function Documentation

osl_names_clone function: this function builds and returns a "hard copy" (not a pointer copy) of an osl_names_t data structure provided as parameter.

Parameters:
[in]namesThe pointer to the names structure we want to clone.
Returns:
A pointer to the clone of the names structure provided as parameter.

Definition at line 230 of file names.c.

References osl_names::arrays, osl_names::iterators, osl_names::local_dims, osl_names_malloc(), osl_strings_clone(), osl_names::parameters, and osl_names::scatt_dims.

void osl_names_dump ( FILE *  file,
osl_names_p  names 
)

osl_names_dump function: this function prints the content of an osl_names_t structure (*names) into a file (file, possibly stdout).

Parameters:
[in]fileThe file where the information has to be printed.
[in]namesThe names structure whose information has to be printed.

Definition at line 127 of file names.c.

References osl_names_idump().

void osl_names_free ( osl_names_p  names)

osl_names_free function: This function frees the allocated memory for an osl_names_t structure. If the names are not character strings, it is the responsibility of the user to free each array of elements (including the array itself), this function will only free the osl_names_t shell.

Parameters:
[in,out]namesThe pointer to the names structure we want to free.

Definition at line 172 of file names.c.

References osl_names::arrays, osl_names::iterators, osl_names::local_dims, osl_strings_free(), osl_names::parameters, and osl_names::scatt_dims.

Referenced by osl_relation_spprint_polylib(), osl_relation_spprint_polylib_scoplib(), osl_scop_print(), osl_scop_print_scoplib(), osl_statement_pprint(), and osl_statement_pprint_scoplib().

osl_names_p osl_names_generate ( char *  parameter_prefix,
int  nb_parameters,
char *  iterator_prefix,
int  nb_iterators,
char *  scatt_dim_prefix,
int  nb_scatt_dims,
char *  local_dim_prefix,
int  nb_local_dims,
char *  array_prefix,
int  nb_arrays 
)

osl_names_generate function: this function generates some names. For each kind of name it will generate a given number of names with a given prefix followed by a number.

Parameters:
[in]parameter_prefixPrefix for parameter names.
[in]nb_parametersNumber of parameters names to generate.
[in]iterator_prefixPrefix for iterator names.
[in]nb_iteratorsNumber of iterators names to generate.
[in]scatt_dim_prefixPrefix for scattering dimension names.
[in]nb_scatt_dimsNumber of scattering dim names to generate.
[in]local_dim_prefixPrefix for local dimension names.
[in]nb_local_dimsNumber of local dimension names to generate.
[in]array_prefixPrefix for array names.
[in]nb_arraysNumber of array names to generate.
Returns:
A new names structure containing generated names.

Definition at line 206 of file names.c.

References osl_names::arrays, osl_names::iterators, osl_names::local_dims, osl_names_malloc(), osl_strings_generate(), osl_names::parameters, and osl_names::scatt_dims.

Referenced by osl_relation_names(), osl_scop_names(), and osl_statement_names().

void osl_names_idump ( FILE *  file,
osl_names_p  names,
int  level 
)

osl_names_idump function: this function displays an osl_names_t structure (*names) 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]fileThe file where the information has to be printed.
[in]namesThe names structure whose information has to be printed.
[in]levelNumber of spaces before printing, for each line.

Definition at line 87 of file names.c.

References osl_names::arrays, osl_names::iterators, osl_names::local_dims, osl_strings_idump(), osl_names::parameters, and osl_names::scatt_dims.

Referenced by osl_names_dump().

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

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

Definition at line 150 of file names.c.

References osl_names::arrays, osl_names::iterators, osl_names::local_dims, OSL_malloc, osl_names::parameters, and osl_names::scatt_dims.

Referenced by osl_names_clone(), and osl_names_generate().