OpenScop 0.8.1
Data Structures | Defines | Typedefs | Functions

lines.h File Reference

#include <stdio.h>
#include <osl/interface.h>
Include dependency graph for lines.h:

Go to the source code of this file.

Data Structures

struct  osl_lines

Defines

#define OSL_URI_LINES   "lines"
#define OSL_TAG_LINES_START   "<"OSL_URI_LINES">"
#define OSL_TAG_LINES_STOP   "</"OSL_URI_LINES">"

Typedefs

typedef struct osl_lines osl_lines_t
typedef struct osl_linesosl_lines_p

Functions

void osl_lines_idump (FILE *, osl_lines_p, int)
void osl_lines_dump (FILE *, osl_lines_p)
char * osl_lines_sprint (osl_lines_p)
osl_lines_p osl_lines_sread (char **)
osl_lines_p osl_lines_malloc ()
void osl_lines_free (osl_lines_p)
osl_lines_p osl_lines_clone (osl_lines_p)
int osl_lines_equal (osl_lines_p, osl_lines_p)
osl_interface_p osl_lines_interface ()

Define Documentation

#define OSL_TAG_LINES_START   "<"OSL_URI_LINES">"

Definition at line 77 of file lines.h.

Referenced by osl_lines_sprint().

#define OSL_TAG_LINES_STOP   "</"OSL_URI_LINES">"

Definition at line 78 of file lines.h.

Referenced by osl_lines_sprint().

#define OSL_URI_LINES   "lines"

Definition at line 76 of file lines.h.

Referenced by osl_lines_interface().


Typedef Documentation

typedef struct osl_lines* osl_lines_p

Definition at line 91 of file lines.h.

typedef struct osl_lines osl_lines_t

Definition at line 90 of file lines.h.


Function Documentation

osl_lines_p osl_lines_clone ( osl_lines_p  lines)

osl_lines_clone function: This function builds and returns a "hard copy" (not a pointer copy) of an osl_lines_t data structure.

Parameters:
linesThe pointer to the lines structure we want to copy.
Returns:
A pointer to the copy of the lines structure.

Definition at line 259 of file lines.c.

References osl_lines::end, osl_lines_malloc(), and osl_lines::start.

Referenced by osl_lines_interface().

void osl_lines_dump ( FILE *  file,
osl_lines_p  lines 
)

osl_lines_dump function: this function prints the content of an osl_lines_t structure (*lines) into a file (file, possibly stdout).

Parameters:
fileThe file where the information has to be printed.
linesThe lines structure whose information has to be printed.

Definition at line 123 of file lines.c.

References osl_lines_idump().

int osl_lines_equal ( osl_lines_p  c1,
osl_lines_p  c2 
)

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

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

Definition at line 281 of file lines.c.

References osl_lines::end, and osl_lines::start.

Referenced by osl_lines_interface().

void osl_lines_free ( osl_lines_p  lines)

osl_lines_free function: This function frees the allocated memory for an osl_lines_t structure.

Parameters:
linesThe pointer to the lines structure we want to free.

Definition at line 240 of file lines.c.

Referenced by osl_lines_interface().

void osl_lines_idump ( FILE *  file,
osl_lines_p  lines,
int  level 
)

osl_lines_idump function: this function displays an osl_lines_t structure (*lines) 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:
fileThe file where the information has to be printed.
linesThe lines structure whose information has to be printed.
levelNumber of spaces before printing, for each line.

Definition at line 88 of file lines.c.

References osl_lines::end, and osl_lines::start.

Referenced by osl_lines_dump(), and osl_lines_interface().

osl_interface_p osl_lines_interface ( )

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

Returns:
An interface structure for the lines extension.

Definition at line 301 of file lines.c.

References osl_interface::clone, osl_interface::equal, osl_interface::free, osl_interface::idump, osl_interface::malloc, osl_interface_malloc(), osl_lines_clone(), osl_lines_equal(), osl_lines_free(), osl_lines_idump(), osl_lines_malloc(), osl_lines_sprint(), osl_lines_sread(), OSL_URI_LINES, osl_interface::sprint, osl_interface::sread, and osl_interface::URI.

osl_lines_p osl_lines_malloc ( )

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

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

Definition at line 223 of file lines.c.

References osl_lines::end, OSL_malloc, OSL_UNDEFINED, and osl_lines::start.

Referenced by osl_lines_clone(), osl_lines_interface(), and osl_lines_sread().

char* osl_lines_sprint ( osl_lines_p  lines)

osl_lines_sprint function: this function prints the content of an osl_lines_t structure (*lines) into a string (returned) in the OpenScop textual format.

Parameters:
linesThe lines structure whose information has to be printed.
Returns:
A string containing the OpenScop dump of the lines structure.

Definition at line 135 of file lines.c.

References osl_lines::end, OSL_malloc, OSL_MAX_STRING, OSL_realloc, OSL_TAG_LINES_START, OSL_TAG_LINES_STOP, osl_util_safe_strcat(), and osl_lines::start.

Referenced by osl_lines_interface().

osl_lines_p osl_lines_sread ( char **  extensions_fixme)

osl_lines_sread function: this function reads a lines structure from a string complying to the OpenScop textual format and returns a pointer to this lines structure. The string should contain only one textual format of a lines structure.

Parameters:
extensionsThe input string where to find a lines structure.
Returns:
A pointer to the lines structure that has been read.

Definition at line 178 of file lines.c.

References osl_lines::end, OSL_debug, OSL_error, osl_lines_malloc(), OSL_MAX_STRING, and osl_lines::start.

Referenced by osl_lines_interface().