OpenScop
0.9.0
|
#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/body.h>
Go to the source code of this file.
Functions | |
void | osl_body_idump (FILE *file, osl_body_p body, int level) |
void | osl_body_dump (FILE *file, osl_body_p body) |
void | osl_body_print (FILE *file, osl_body_p body) |
void | osl_body_print_scoplib (FILE *file, osl_body_p body) |
char * | osl_body_sprint (osl_body_p body) |
osl_body_p | osl_body_sread (char **input) |
osl_body_p | osl_body_malloc () |
void | osl_body_free (osl_body_p body) |
osl_body_p | osl_body_clone (osl_body_p body) |
int | osl_body_equal (osl_body_p b1, osl_body_p b2) |
osl_interface_p | osl_body_interface () |
osl_body_p osl_body_clone | ( | osl_body_p | body | ) |
osl_body_clone function: this functions builds and returns a "hard copy" (not a pointer copy) of an osl_body_t data structure provided as parameter. However, let us recall here that non-string elements are untouched by the OpenScop Library.
[in] | body | The pointer to the body we want to copy. |
Definition at line 339 of file body.c.
References osl_body::expression, osl_body::iterators, osl_body_malloc(), and osl_strings_clone().
Referenced by osl_body_interface(), and osl_extbody_clone().
void osl_body_dump | ( | FILE * | file, |
osl_body_p | body | ||
) |
osl_body_dump function: this function prints the content of an osl_body_t structure (*body) into a file (file, possibly stdout).
[in] | file | File where informations are printed. |
[in] | body | The body whose information has to be printed. |
Definition at line 129 of file body.c.
References osl_body_idump().
int osl_body_equal | ( | osl_body_p | b1, |
osl_body_p | b2 | ||
) |
osl_body_equal function: this function returns true if the two bodies are the same, false otherwise (the usr field is not tested). However, let us recall here that non-string elements are untouched by the OpenScop Library.
[in] | b1 | The first body. |
[in] | b2 | The second body. |
Definition at line 361 of file body.c.
References osl_body::expression, osl_body::iterators, OSL_info, and osl_strings_equal().
Referenced by osl_body_interface(), and osl_extbody_equal().
void osl_body_free | ( | osl_body_p | body | ) |
osl_body_free function: this function frees the allocated memory for an osl_body_t structure.
[in,out] | body | The pointer to the body we want to free. |
Definition at line 316 of file body.c.
References osl_body::expression, osl_body::iterators, and osl_strings_free().
Referenced by osl_body_interface(), and osl_extbody_free().
void osl_body_idump | ( | FILE * | file, |
osl_body_p | body, | ||
int | level | ||
) |
osl_body_idump function: this function displays an osl_body_t structure (*body) 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 dumping functions.
[in] | file | File where informations are printed. |
[in] | body | The body whose information has to be printed. |
[in] | level | Number of spaces before printing, for each line. |
Definition at line 90 of file body.c.
References osl_body::expression, osl_body::iterators, and osl_strings_idump().
Referenced by osl_body_dump(), osl_body_interface(), and osl_extbody_idump().
osl_body_interface function: this function creates an interface structure corresponding to the body structure and returns it).
Definition at line 392 of file body.c.
References osl_body_clone(), osl_body_equal(), osl_body_free(), osl_body_idump(), osl_body_malloc(), osl_body_sprint(), osl_body_sread(), osl_interface_malloc(), OSL_strdup, and OSL_URI_BODY.
Referenced by osl_interface_get_default_registry().
osl_body_malloc function: this function allocates the memory space for an osl_body_t structure and sets its fields with default values. Then it returns a pointer to the allocated space.
Definition at line 299 of file body.c.
References osl_body::expression, osl_body::iterators, and OSL_malloc.
Referenced by osl_body_clone(), osl_body_interface(), and osl_body_sread().
void osl_body_print | ( | FILE * | file, |
osl_body_p | body | ||
) |
osl_body_print function: this function prints the content of an osl_body_t structure (*body) into a file (file, possibly stdout) in the OpenScop format.
[in] | file | File where informations are printed. |
[in] | body | The body whose information has to be printed. |
Definition at line 141 of file body.c.
References osl_body::expression, osl_body::iterators, osl_strings_print(), and osl_strings_size().
void osl_body_print_scoplib | ( | FILE * | file, |
osl_body_p | body | ||
) |
osl_body_print_scoplib function: this function prints the content of an osl_body_t structure (*body) into a file (file, possibly stdout) in the SCoPLib format.
[in] | file | File where informations are printed. |
[in] | body | The body whose information has to be printed. |
Definition at line 170 of file body.c.
References osl_body::expression, osl_body::iterators, osl_strings_print(), and osl_strings_size().
Referenced by osl_statement_pprint_scoplib().
char* osl_body_sprint | ( | osl_body_p | body | ) |
osl_body_sprint function: this function prints the content of an osl_body_t structure (*body) into a string (returned) in the OpenScop textual format.
[in] | body | The body structure which has to be printed. |
Definition at line 199 of file body.c.
References osl_body::expression, osl_body::iterators, OSL_malloc, OSL_MAX_STRING, osl_strings_size(), osl_strings_sprint(), and osl_util_safe_strcat().
Referenced by osl_body_interface(), and osl_extbody_sprint().
osl_body_p osl_body_sread | ( | char ** | input | ) |
osl_body_read function: this function reads a body structure from a string complying to the OpenScop textual format and returns a pointer to this body structure. The input string should only contain the body this function has to read (comments at the end of the line are accepted). The input parameter is updated to the position in the input string this function reach right after reading the strings structure.
[in,out] | input | The input string where to find a body structure. Updated to the position after what has been read. |
Definition at line 255 of file body.c.
References osl_body::expression, osl_body::iterators, osl_body_malloc(), OSL_malloc, osl_strings_encapsulate(), osl_strings_malloc(), osl_strings_sread(), osl_util_read_int(), osl_util_read_line(), and osl_strings::string.
Referenced by osl_body_interface(), and osl_extbody_sread().