OpenScop
0.9.0
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <osl/macros.h>
#include <osl/util.h>
#include <osl/relation.h>
#include <osl/interface.h>
#include <osl/extensions/symbols.h>
Go to the source code of this file.
Functions | |
void | osl_symbols_idump (FILE *file, osl_symbols_p symbols, int level) |
void | osl_symbols_dump (FILE *file, osl_symbols_p symbols) |
char * | osl_symbols_sprint (osl_symbols_p symbols) |
osl_symbols_p | osl_symbols_sread (char **input) |
osl_symbols_p | osl_symbols_malloc () |
void | osl_symbols_free (osl_symbols_p symbols) |
void | osl_symbols_add (osl_symbols_p *location, osl_symbols_p symbols) |
osl_symbols_p | osl_symbols_nclone (osl_symbols_p symbols, int n) |
osl_symbols_p | osl_symbols_clone (osl_symbols_p symbols) |
int | osl_symbols_equal (osl_symbols_p c1, osl_symbols_p c2) |
int | osl_symbols_get_nb_symbols (osl_symbols_p symbols) |
osl_interface_p | osl_symbols_interface () |
void osl_symbols_add | ( | osl_symbols_p * | location, |
osl_symbols_p | symbols | ||
) |
osl_symbols_add function: this function adds a scop "scop" at the end of the symbols list pointed by "location".
[in,out] | location | Address of the first element of the symbols list. |
[in] | symbols | The symbols to add to the list. |
Definition at line 442 of file symbols.c.
Referenced by osl_symbols_nclone().
osl_symbols_p osl_symbols_clone | ( | osl_symbols_p | symbols | ) |
osl_symbols_clone function: this function builds and returns a "hard copy" (not a pointer copy) of an osl_symbols_t data structure.
[in] | symbols | The pointer to the symbols structure to clone. |
Definition at line 488 of file symbols.c.
References osl_symbols_nclone().
Referenced by osl_symbols_interface().
void osl_symbols_dump | ( | FILE * | file, |
osl_symbols_p | symbols | ||
) |
osl_symbols_dump function: this function prints the content of an osl_symbols_t structure (*symbols) into a file (file, possibly stdout).
[in] | file | The file where the information has to be printed. |
[in] | symbols | The symbols structure to print. |
Definition at line 201 of file symbols.c.
References osl_symbols_idump().
int osl_symbols_equal | ( | osl_symbols_p | c1, |
osl_symbols_p | c2 | ||
) |
osl_symbols_equal function: this function returns true if the two symbols structures are the same (content-wise), false otherwise.
[in] | c1 | The first symbols structure. |
[in] | c2 | The second symbols structure. |
Definition at line 502 of file symbols.c.
References osl_symbols::datatype, osl_symbols::extent, osl_symbols::generated, osl_symbols::identifier, osl_symbols::nb_dims, osl_generic_equal(), osl_symbols::scope, and osl_symbols::type.
Referenced by osl_symbols_interface().
void osl_symbols_free | ( | osl_symbols_p | symbols | ) |
osl_symbols_free function: this function frees the allocated memory for an osl_symbols_t structure.
[in,out] | symbols | The pointer to the symbols structure to free. |
Definition at line 415 of file symbols.c.
References osl_symbols::datatype, osl_symbols::extent, osl_symbols::identifier, osl_symbols::next, osl_generic_free(), and osl_symbols::scope.
Referenced by osl_symbols_interface().
int osl_symbols_get_nb_symbols | ( | osl_symbols_p | symbols | ) |
osl_symbols_get_nb_symbols function: this function returns the number of symbols in the symbol list provided as input.
symbols | The head of the symbol list. |
Definition at line 534 of file symbols.c.
References osl_symbols::next.
Referenced by osl_symbols_sprint().
void osl_symbols_idump | ( | FILE * | file, |
osl_symbols_p | symbols, | ||
int | level | ||
) |
osl_symbols_idump function: this function displays an osl_symbols_t structure (*symbols) 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.
[in] | file | The file where the information has to be printed. |
[in] | symbols | The symbols structure to print. |
[in] | level | Number of spaces before printing, for each line. |
Definition at line 90 of file symbols.c.
References osl_symbols::datatype, osl_symbols::extent, osl_symbols::generated, osl_symbols::identifier, osl_symbols::nb_dims, osl_symbols::next, osl_generic_idump(), OSL_SYMBOL_TYPE_ARRAY, OSL_SYMBOL_TYPE_FUNCTION, OSL_SYMBOL_TYPE_ITERATOR, OSL_SYMBOL_TYPE_PARAMETER, OSL_UNDEFINED, osl_symbols::scope, and osl_symbols::type.
Referenced by osl_symbols_dump(), and osl_symbols_interface().
osl_symbols_interface function: this function creates an interface structure corresponding to the symbols extension and returns it).
Definition at line 551 of file symbols.c.
References osl_interface_malloc(), OSL_strdup, osl_symbols_clone(), osl_symbols_equal(), osl_symbols_free(), osl_symbols_idump(), osl_symbols_malloc(), osl_symbols_sprint(), osl_symbols_sread(), and OSL_URI_SYMBOLS.
Referenced by osl_interface_get_default_registry().
osl_symbols_malloc function: this function allocates the memory space for an osl_symbols_t structure and sets its fields with default values. Then it returns a pointer to the allocated space.
Definition at line 392 of file symbols.c.
References osl_symbols::datatype, osl_symbols::extent, osl_symbols::generated, osl_symbols::identifier, osl_symbols::nb_dims, osl_symbols::next, OSL_malloc, OSL_UNDEFINED, osl_symbols::scope, and osl_symbols::type.
Referenced by osl_symbols_interface(), osl_symbols_nclone(), and osl_symbols_sread().
osl_symbols_p osl_symbols_nclone | ( | osl_symbols_p | symbols, |
int | n | ||
) |
osl_symbols_nclone function: This function builds and returns a "hard copy" (not a pointer copy) of the n first elements of an osl_symbols_t list.
symbols | The pointer to the symbols structure we want to clone. |
n | The number of nodes we want to copy (-1 for infinity). |
Definition at line 458 of file symbols.c.
References osl_symbols::datatype, osl_symbols::extent, osl_symbols::generated, osl_symbols::identifier, osl_symbols::nb_dims, osl_symbols::next, osl_generic_clone(), osl_symbols_add(), osl_symbols_malloc(), osl_symbols::scope, and osl_symbols::type.
Referenced by osl_symbols_clone().
char* osl_symbols_sprint | ( | osl_symbols_p | symbols | ) |
osl_symbols_sprint function: this function prints the content of an osl_symbols_t structure (*symbols) into a string (returned) in the OpenScop textual format.
[in] | symbols | The symbols structure to print. |
Definition at line 213 of file symbols.c.
References osl_symbols::datatype, osl_symbols::extent, osl_symbols::generated, osl_symbols::identifier, osl_symbols::nb_dims, osl_symbols::next, osl_generic_sprint(), OSL_malloc, OSL_MAX_STRING, OSL_realloc, OSL_SYMBOL_TYPE_ARRAY, OSL_SYMBOL_TYPE_FUNCTION, OSL_SYMBOL_TYPE_ITERATOR, OSL_SYMBOL_TYPE_PARAMETER, osl_symbols_get_nb_symbols(), OSL_UNDEFINED, osl_util_safe_strcat(), osl_symbols::scope, and osl_symbols::type.
Referenced by osl_symbols_interface().
osl_symbols_p osl_symbols_sread | ( | char ** | input | ) |
osl_symbols_sread function: this function reads a symbols structure from a string complying to the OpenScop textual format and returns a pointer to this symbols structure. The input parameter is updated to the position in the input string this function reach right after reading the symbols structure.
[in,out] | input | The input string where to find a symbols. Updated to the position after what has been read. |
Definition at line 308 of file symbols.c.
References osl_symbols::datatype, osl_symbols::extent, osl_symbols::generated, osl_symbols::identifier, osl_symbols::nb_dims, osl_symbols::next, OSL_debug, OSL_error, osl_generic_sread_one(), osl_interface_free(), osl_interface_get_default_registry(), OSL_MAX_STRING, OSL_SYMBOL_TYPE_ARRAY, OSL_SYMBOL_TYPE_FUNCTION, OSL_SYMBOL_TYPE_ITERATOR, OSL_SYMBOL_TYPE_PARAMETER, osl_symbols_malloc(), OSL_UNDEFINED, osl_util_read_int(), osl_util_read_string(), osl_symbols::scope, and osl_symbols::type.
Referenced by osl_symbols_interface().