OpenScop  0.9.0
Data Structures | Defines | Typedefs | Functions
symbols.h File Reference
#include <stdio.h>
#include <osl/interface.h>
#include <osl/relation.h>
#include <osl/generic.h>
Include dependency graph for symbols.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  osl_symbols

Defines

#define OSL_URI_SYMBOLS   "symbols"

Typedefs

typedef struct osl_symbols osl_symbols_t
typedef struct osl_symbolsosl_symbols_p

Functions

void osl_symbols_idump (FILE *, osl_symbols_p, int)
void osl_symbols_dump (FILE *, osl_symbols_p)
char * osl_symbols_sprint (osl_symbols_p)
osl_symbols_p osl_symbols_sread (char **)
osl_symbols_p osl_symbols_malloc ()
void osl_symbols_free (osl_symbols_p)
void osl_symbols_add (osl_symbols_p *, osl_symbols_p)
osl_symbols_p osl_symbols_nclone (osl_symbols_p, int)
osl_symbols_p osl_symbols_clone (osl_symbols_p)
int osl_symbols_equal (osl_symbols_p, osl_symbols_p)
osl_symbols_p osl_symbols_lookup (osl_symbols_p, osl_generic_p)
osl_symbols_p osl_symbols_remove (osl_symbols_p *, osl_symbols_p)
int osl_symbols_get_nb_symbols (osl_symbols_p)
osl_interface_p osl_symbols_interface ()

Define Documentation

#define OSL_URI_SYMBOLS   "symbols"

Definition at line 78 of file symbols.h.

Referenced by osl_symbols_interface().


Typedef Documentation

typedef struct osl_symbols* osl_symbols_p

Definition at line 96 of file symbols.h.

typedef struct osl_symbols osl_symbols_t

Definition at line 95 of file symbols.h.


Function Documentation

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".

Parameters:
[in,out]locationAddress of the first element of the symbols list.
[in]symbolsThe symbols to add to the list.

Definition at line 442 of file symbols.c.

Referenced by osl_symbols_nclone().

osl_symbols_clone function: this function builds and returns a "hard copy" (not a pointer copy) of an osl_symbols_t data structure.

Parameters:
[in]symbolsThe pointer to the symbols structure to clone.
Returns:
A pointer to the clone of the symbols structure.

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).

Parameters:
[in]fileThe file where the information has to be printed.
[in]symbolsThe symbols structure to print.

Definition at line 201 of file symbols.c.

References osl_symbols_idump().

osl_symbols_equal function: this function returns true if the two symbols structures are the same (content-wise), false otherwise.

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

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.

Parameters:
[in,out]symbolsThe 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().

osl_symbols_get_nb_symbols function: this function returns the number of symbols in the symbol list provided as input.

Parameters:
symbolsThe head of the symbol list.
Returns:
The number of symbols in 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.

Parameters:
[in]fileThe file where the information has to be printed.
[in]symbolsThe symbols structure to print.
[in]levelNumber 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).

Returns:
An interface structure for the symbols extension.

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.

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

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_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.

Parameters:
symbolsThe pointer to the symbols structure we want to clone.
nThe number of nodes we want to copy (-1 for infinity).
Returns:
The clone of the n first nodes of the symbols list.

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.

Parameters:
[in]symbolsThe symbols structure to print.
Returns:
A string containing the OpenScop dump of the symbols structure.

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.

Parameters:
[in,out]inputThe input string where to find a symbols. Updated to the position after what has been read.
Returns:
A pointer to the symbols structure that 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().