coordinates.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <osl/macros.h>
#include <osl/util.h>
#include <osl/interface.h>
#include <osl/extensions/coordinates.h>
Include dependency graph for coordinates.c:

Go to the source code of this file.

Functions

void osl_coordinates_idump (FILE *file, osl_coordinates_p coordinates, int level)
void osl_coordinates_dump (FILE *file, osl_coordinates_p coordinates)
char * osl_coordinates_sprint (osl_coordinates_p coordinates)
osl_coordinates_p osl_coordinates_sread (char **input)
osl_coordinates_p osl_coordinates_malloc ()
void osl_coordinates_free (osl_coordinates_p coordinates)
osl_coordinates_p osl_coordinates_clone (osl_coordinates_p coordinates)
int osl_coordinates_equal (osl_coordinates_p c1, osl_coordinates_p c2)
osl_interface_p osl_coordinates_interface ()

Function Documentation

osl_coordinates_p osl_coordinates_clone ( osl_coordinates_p  coordinates  ) 

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

Parameters:
coordinates The pointer to the coordinates structure to clone.
Returns:
A pointer to the clone of the coordinates structure.

Definition at line 278 of file coordinates.c.

References osl_coordinates::end, osl_coordinates::indent, osl_coordinates::name, osl_coordinates_malloc(), OSL_strdup, and osl_coordinates::start.

Referenced by osl_coordinates_interface().

void osl_coordinates_dump ( FILE *  file,
osl_coordinates_p  coordinates 
)

osl_coordinates_dump function: this function prints the content of an osl_coordinates_t structure (*coordinates) into a file (file, possibly stdout).

Parameters:
file The file where the information has to be printed.
coordinates The coordinates structure to print.

Definition at line 142 of file coordinates.c.

References osl_coordinates_idump().

int osl_coordinates_equal ( osl_coordinates_p  c1,
osl_coordinates_p  c2 
)

osl_coordinates_equal function: this function returns true if the two coordinates structures are the same (content-wise), false otherwise. This functions considers two coordinates

Parameters:
c1 The first coordinates structure.
c2 The second coordinates structure.
Returns:
1 if c1 and c2 are the same (content-wise), 0 otherwise.

Definition at line 302 of file coordinates.c.

References osl_coordinates::indent, osl_coordinates::name, OSL_info, and osl_coordinates::start.

Referenced by osl_coordinates_interface().

void osl_coordinates_free ( osl_coordinates_p  coordinates  ) 

osl_coordinates_free function: this function frees the allocated memory for an osl_coordinates_t structure.

Parameters:
coordinates The pointer to the coordinates structure to free.

Definition at line 258 of file coordinates.c.

References osl_coordinates::name.

Referenced by osl_coordinates_interface().

void osl_coordinates_idump ( FILE *  file,
osl_coordinates_p  coordinates,
int  level 
)

osl_coordinates_idump function: this function displays an osl_coordinates_t structure (*coordinates) 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:
file The file where the information has to be printed.
coordinates The coordinates structure to print.
level Number of spaces before printing, for each line.

Definition at line 88 of file coordinates.c.

References osl_coordinates::end, osl_coordinates::indent, osl_coordinates::name, and osl_coordinates::start.

Referenced by osl_coordinates_dump(), and osl_coordinates_interface().

osl_interface_p osl_coordinates_interface (  ) 

osl_coordinates_interface function: this function creates an interface structure corresponding to the coordinates extension and returns it).

Returns:
An interface structure for the coordinates extension.

Definition at line 334 of file coordinates.c.

References osl_interface::clone, osl_interface::equal, osl_interface::free, osl_interface::idump, osl_interface::malloc, osl_coordinates_clone(), osl_coordinates_equal(), osl_coordinates_free(), osl_coordinates_idump(), osl_coordinates_malloc(), osl_coordinates_sprint(), osl_coordinates_sread(), osl_interface_malloc(), OSL_URI_COORDINATES, osl_interface::sprint, osl_interface::sread, and osl_interface::URI.

Referenced by osl_interface_get_default_registry().

osl_coordinates_p osl_coordinates_malloc (  ) 

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

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

Definition at line 239 of file coordinates.c.

References osl_coordinates::end, osl_coordinates::indent, osl_coordinates::name, OSL_malloc, OSL_UNDEFINED, and osl_coordinates::start.

Referenced by osl_coordinates_clone(), osl_coordinates_interface(), and osl_coordinates_sread().

char* osl_coordinates_sprint ( osl_coordinates_p  coordinates  ) 

osl_coordinates_sprint function: this function prints the content of an osl_coordinates_t structure (*coordinates) into a string (returned) in the OpenScop textual format.

Parameters:
coordinates The coordinates structure to be print.
Returns:
A string containing the OpenScop dump of the coordinates structure.

Definition at line 154 of file coordinates.c.

References osl_coordinates::end, osl_coordinates::indent, osl_coordinates::name, OSL_malloc, OSL_MAX_STRING, OSL_realloc, osl_util_safe_strcat(), and osl_coordinates::start.

Referenced by osl_coordinates_interface().

osl_coordinates_p osl_coordinates_sread ( char **  input  ) 

osl_coordinates_sread function: this function reads a coordinates structure from a string complying to the OpenScop textual format and returns a pointer to this structure. The input parameter is updated to the position in the input string this function reach right after reading the coordinates structure.

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

Definition at line 199 of file coordinates.c.

References osl_coordinates::end, osl_coordinates::indent, osl_coordinates::name, osl_coordinates_malloc(), OSL_debug, osl_util_read_int(), osl_util_read_line(), and osl_coordinates::start.

Referenced by osl_coordinates_interface().

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