OpenScop 0.8.1
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <osl/macros.h>
#include <osl/util.h>
#include <osl/strings.h>
#include <osl/interface.h>
#include <osl/extensions/arrays.h>
Go to the source code of this file.
Functions | |
void | osl_arrays_idump (FILE *file, osl_arrays_p arrays, int level) |
void | osl_arrays_dump (FILE *file, osl_arrays_p arrays) |
char * | osl_arrays_sprint (osl_arrays_p arrays) |
osl_arrays_p | osl_arrays_sread (char **extensions_fixme) |
osl_arrays_p | osl_arrays_malloc () |
void | osl_arrays_free (osl_arrays_p arrays) |
osl_arrays_p | osl_arrays_clone (osl_arrays_p arrays) |
int | osl_arrays_equal (osl_arrays_p a1, osl_arrays_p a2) |
char ** | osl_arrays_generate_names (osl_arrays_p arrays, int *nb_names) |
osl_interface_p | osl_arrays_interface () |
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.
arrays | The pointer to the arrays structure we want to copy. |
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).
file | The file where the information has to be printed. |
arrays | The 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.
a1 | The first arrays structure. |
a2 | The second arrays structure. |
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.
arrays | The 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.
arrays | The source of some array names. |
nb_names | Pointer to the location to store the number of 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.
file | The file where the information has to be printed. |
arrays | The arrays structure whose information has to be printed. |
level | Number 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).
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.
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.
arrays | The arrays structure whose information has to be printed. |
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.
extensions | The input string where to find an arrays structure. |
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().