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

Go to the source code of this file.

Data Structures

struct  osl_extbody

Defines

#define OSL_URI_EXTBODY   "extbody"

Typedefs

typedef struct osl_extbody osl_extbody_t
typedef struct osl_extbodyosl_extbody_p
typedef struct osl_extbody const osl_const_extbody_t
typedef struct osl_extbody *const osl_extbody_const_p
typedef struct osl_extbody const * osl_const_extbody_p
typedef struct osl_extbody
const *const 
osl_const_extbody_const_p

Functions

void osl_extbody_idump (FILE *, osl_extbody_p, int)
void osl_extbody_dump (FILE *, osl_extbody_p)
char * osl_extbody_sprint (osl_extbody_p)
osl_extbody_p osl_extbody_sread (char **)
osl_extbody_p osl_extbody_malloc ()
void osl_extbody_free (osl_extbody_p)
osl_extbody_p osl_extbody_clone (osl_extbody_p)
int osl_extbody_equal (osl_extbody_p, osl_extbody_p)
osl_interface_p osl_extbody_interface ()
void osl_extbody_add (osl_extbody_p, int, int)

Define Documentation

#define OSL_URI_EXTBODY   "extbody"

Definition at line 78 of file extbody.h.

Referenced by osl_extbody_interface(), and osl_statement_get_body().


Typedef Documentation

typedef struct osl_extbody const* const osl_const_extbody_const_p

Definition at line 96 of file extbody.h.

typedef struct osl_extbody const* osl_const_extbody_p

Definition at line 95 of file extbody.h.

typedef struct osl_extbody const osl_const_extbody_t

Definition at line 93 of file extbody.h.

typedef struct osl_extbody* const osl_extbody_const_p

Definition at line 94 of file extbody.h.

typedef struct osl_extbody* osl_extbody_p

Definition at line 92 of file extbody.h.

typedef struct osl_extbody osl_extbody_t

Definition at line 91 of file extbody.h.


Function Documentation

void osl_extbody_add ( osl_extbody_p  ebody,
int  start,
int  length 
)

osl_extbody_add function: This function add an entry in the list of coordinates

Definition at line 383 of file extbody.c.

References osl_extbody::length, osl_extbody::nb_access, OSL_realloc, and osl_extbody::start.

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

Parameters:
[in]ebodyThe pointer to the extbody structure to clone.
Returns:
A pointer to the clone of the extbody structure.

Definition at line 286 of file extbody.c.

References osl_extbody::body, osl_extbody::length, osl_extbody::nb_access, osl_body_clone(), osl_extbody_malloc(), OSL_malloc, and osl_extbody::start.

Referenced by osl_extbody_interface().

void osl_extbody_dump ( FILE *  file,
osl_extbody_p  ebody 
)

osl_extbody_dump function: this function prints the content of an osl_extbody_t structure (*ebody) into a file (file, possibly stdout).

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

Definition at line 137 of file extbody.c.

References osl_extbody_idump().

osl_extbody_equal function: this function returns true if the two extbody structures are the same (content-wise), false otherwise. This functions considers two extbody structures as equal if the order of the array start/length differ, however the identifiers, start and length must be the same.

Parameters:
[in]e1The first extbody structure.
[in]e2The second extbody structure.
Returns:
1 if e1 and e2 are the same (content-wise), 0 otherwise.

Definition at line 319 of file extbody.c.

References osl_extbody::body, osl_extbody::length, osl_extbody::nb_access, osl_body_equal(), OSL_info, and osl_extbody::start.

Referenced by osl_extbody_interface().

osl_extbody_free function: this function frees the allocated memory for an ebody structure.

Parameters:
[in,out]ebodyThe pointer to the extbody structure we want to free.

Definition at line 264 of file extbody.c.

References osl_extbody::body, osl_extbody::length, osl_body_free(), and osl_extbody::start.

Referenced by osl_extbody_interface().

void osl_extbody_idump ( FILE *  file,
osl_extbody_p  ebody,
int  level 
)

osl_extbody_idump function: this function displays an osl_extbody_t structure (*extbody) 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]ebodyThe ebody structure to print.
[in]levelNumber of spaces before printing, for each line.

Definition at line 89 of file extbody.c.

References osl_extbody::body, osl_extbody::length, osl_extbody::nb_access, osl_body_idump(), and osl_extbody::start.

Referenced by osl_extbody_dump(), and osl_extbody_interface().

osl_extbody_interface function: this function creates an interface structure corresponding to the extbody extension and returns it.

Returns:
An interface structure for the extbody extension.

Definition at line 363 of file extbody.c.

References osl_extbody_clone(), osl_extbody_equal(), osl_extbody_free(), osl_extbody_idump(), osl_extbody_malloc(), osl_extbody_sprint(), osl_extbody_sread(), osl_interface_malloc(), OSL_strdup, and OSL_URI_EXTBODY.

Referenced by osl_interface_get_default_registry().

osl_extbody_malloc function: this function allocates the memory space for an osl_extbody_t structure and sets its fields with default values. Then it returns a pointer to the allocated space.

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

Definition at line 246 of file extbody.c.

References osl_extbody::body, osl_extbody::length, osl_extbody::nb_access, OSL_malloc, and osl_extbody::start.

Referenced by osl_extbody_clone(), osl_extbody_interface(), and osl_extbody_sread().

osl_extbody_sprint function: this function prints the content of an osl_extbody_t structure (*ebody) into a string (returned) in the OpenScop textual format.

Parameters:
[in]ebodyThe ebody structure to print.
Returns:
A string containing the OpenScop dump of the ebodystructure.

Definition at line 149 of file extbody.c.

References osl_extbody::body, osl_extbody::length, osl_extbody::nb_access, osl_body_sprint(), OSL_malloc, OSL_MAX_STRING, osl_util_safe_strcat(), and osl_extbody::start.

Referenced by osl_extbody_interface().

osl_extbody_p osl_extbody_sread ( char **  input)

osl_extbody_sread function: this function reads an extbody structure from a string complying to the OpenScop textual format and returns a pointer to this extbody structure. The string should contain only one textual format of an extbody structure. The input parameter is updated to the position in the input string this function reach right after reading the comment structure.

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

Definition at line 201 of file extbody.c.

References osl_extbody::body, osl_extbody::length, osl_extbody::nb_access, osl_body_sread(), OSL_debug, osl_extbody_malloc(), OSL_malloc, osl_util_read_int(), and osl_extbody::start.

Referenced by osl_extbody_interface().