body.h File Reference

#include <stdio.h>
#include <osl/strings.h>
#include <osl/interface.h>
Include dependency graph for body.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  osl_body

Defines

#define OSL_URI_BODY   "body"

Typedefs

typedef struct osl_body osl_body_t
typedef struct osl_bodyosl_body_p

Functions

void osl_body_idump (FILE *, osl_body_p, int)
void osl_body_dump (FILE *, osl_body_p)
char * osl_body_sprint (osl_body_p)
void osl_body_print (FILE *, osl_body_p)
osl_body_p osl_body_sread (char **)
osl_body_p osl_body_malloc ()
void osl_body_free (osl_body_p)
osl_body_p osl_body_clone (osl_body_p)
int osl_body_equal (osl_body_p, osl_body_p)
osl_interface_p osl_body_interface ()

Define Documentation

#define OSL_URI_BODY   "body"

Definition at line 76 of file body.h.

Referenced by osl_body_interface(), osl_statement_integrity_check(), and osl_statement_pprint().


Typedef Documentation

typedef struct osl_body* osl_body_p

Definition at line 90 of file body.h.

typedef struct osl_body osl_body_t

Definition at line 89 of file body.h.


Function Documentation

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.

Parameters:
[in] body The pointer to the body we want to copy.
Returns:
A pointer to the full copy of the body provided as parameter.

Definition at line 310 of file body.c.

References osl_body::expression, osl_body::iterators, osl_body_malloc(), and osl_strings_clone().

Referenced by osl_body_interface().

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

Parameters:
[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.

Parameters:
[in] b1 The first body.
[in] b2 The second body.
Returns:
1 if b1 and b2 are the same (content-wise), 0 otherwise.

Definition at line 332 of file body.c.

References osl_body::expression, osl_body::iterators, OSL_info, and osl_strings_equal().

Referenced by osl_body_interface().

void osl_body_free ( osl_body_p  body  ) 

osl_body_free function: this function frees the allocated memory for an osl_body_t structure.

Parameters:
[in,out] body The pointer to the body we want to free.

Definition at line 287 of file body.c.

References osl_body::expression, osl_body::iterators, and osl_strings_free().

Referenced by osl_body_interface().

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.

Parameters:
[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(), and osl_body_interface().

osl_interface_p osl_body_interface (  ) 

osl_body_interface function: this function creates an interface structure corresponding to the body structure and returns it).

Returns:
An interface structure for the body structure.

Definition at line 363 of file body.c.

References osl_interface::clone, osl_interface::equal, osl_interface::free, osl_interface::idump, osl_interface::malloc, 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_URI_BODY, osl_interface::sprint, osl_interface::sread, and osl_interface::URI.

Referenced by osl_interface_get_default_registry().

osl_body_p osl_body_malloc (  ) 

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.

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

Definition at line 270 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.

Parameters:
[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().

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.

Parameters:
[in] body The body structure which has to be printed.
Returns:
A string containing the OpenScop dump of the body structure.

Definition at line 170 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().

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.

Parameters:
[in,out] input The input string where to find a body structure. Updated to the position after what has been read.
Returns:
A pointer to the body structure that has been read.

Definition at line 226 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().

Generated on Fri Feb 17 15:26:44 2012 for OpenScop by  doxygen 1.6.3