comment.h File Reference

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

Go to the source code of this file.

Data Structures

struct  osl_comment

Defines

#define OSL_URI_COMMENT   "comment"

Typedefs

typedef struct osl_comment osl_comment_t
typedef struct osl_commentosl_comment_p

Functions

void osl_comment_idump (FILE *, osl_comment_p, int)
void osl_comment_dump (FILE *, osl_comment_p)
char * osl_comment_sprint (osl_comment_p)
osl_comment_p osl_comment_sread (char **)
osl_comment_p osl_comment_malloc ()
void osl_comment_free (osl_comment_p)
osl_comment_p osl_comment_clone (osl_comment_p)
int osl_comment_equal (osl_comment_p, osl_comment_p)
osl_interface_p osl_comment_interface ()

Define Documentation

#define OSL_URI_COMMENT   "comment"

Definition at line 76 of file comment.h.

Referenced by osl_comment_interface().


Typedef Documentation

typedef struct osl_comment* osl_comment_p

Definition at line 87 of file comment.h.

typedef struct osl_comment osl_comment_t

Definition at line 86 of file comment.h.


Function Documentation

osl_comment_p osl_comment_clone ( osl_comment_p  comment  ) 

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

Parameters:
[in] comment The pointer to the comment structure to clone.
Returns:
A pointer to the clone of the comment structure.

Definition at line 249 of file comment.c.

References osl_comment::comment, osl_comment_malloc(), and OSL_strdup.

Referenced by osl_comment_interface().

void osl_comment_dump ( FILE *  file,
osl_comment_p  comment 
)

osl_comment_dump function: this function prints the content of an osl_comment_t structure (*comment) into a file (file, possibly stdout).

Parameters:
[in] file The file where the information has to be printed.
[in] comment The comment structure to print.

Definition at line 129 of file comment.c.

References osl_comment_idump().

int osl_comment_equal ( osl_comment_p  c1,
osl_comment_p  c2 
)

osl_comment_equal function: this function returns true if the two comment structures are the same (content-wise), false otherwise.

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

Definition at line 270 of file comment.c.

References osl_comment::comment.

Referenced by osl_comment_interface().

void osl_comment_free ( osl_comment_p  comment  ) 

osl_comment_free function: this function frees the allocated memory for an osl_comment_t structure.

Parameters:
[in,out] comment The pointer to the comment structure to free.

Definition at line 228 of file comment.c.

References osl_comment::comment.

Referenced by osl_comment_interface().

void osl_comment_idump ( FILE *  file,
osl_comment_p  comment,
int  level 
)

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

Definition at line 88 of file comment.c.

References osl_comment::comment.

Referenced by osl_comment_dump(), and osl_comment_interface().

osl_interface_p osl_comment_interface (  ) 

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

Returns:
An interface structure for the comment extension.

Definition at line 291 of file comment.c.

References osl_interface::clone, osl_interface::equal, osl_interface::free, osl_interface::idump, osl_interface::malloc, osl_comment_clone(), osl_comment_equal(), osl_comment_free(), osl_comment_idump(), osl_comment_malloc(), osl_comment_sprint(), osl_comment_sread(), osl_interface_malloc(), OSL_URI_COMMENT, osl_interface::sprint, osl_interface::sread, and osl_interface::URI.

Referenced by osl_interface_get_default_registry().

osl_comment_p osl_comment_malloc (  ) 

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

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

Definition at line 212 of file comment.c.

References osl_comment::comment, and OSL_malloc.

Referenced by osl_comment_clone(), osl_comment_interface(), and osl_comment_sread().

char* osl_comment_sprint ( osl_comment_p  comment  ) 

osl_comment_sprint function: this function prints the content of an osl_comment_t structure (*comment) into a string (returned) in the OpenScop textual format.

Parameters:
[in] comment The comment structure to print.
Returns:
A string containing the OpenScop dump of the comment structure.

Definition at line 141 of file comment.c.

References osl_comment::comment, OSL_malloc, OSL_MAX_STRING, OSL_realloc, and osl_util_safe_strcat().

Referenced by osl_comment_interface().

osl_comment_p osl_comment_sread ( char **  input  ) 

osl_comment_sread function: this function reads a comment structure from a string complying to the OpenScop textual format and returns a pointer to this comment 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] input The input string where to find a comment. Updated to the position after what has been read.
Returns:
A pointer to the comment structure that has been read.

Definition at line 177 of file comment.c.

References osl_comment::comment, osl_comment_malloc(), OSL_debug, OSL_error, OSL_MAX_STRING, and OSL_strdup.

Referenced by osl_comment_interface().

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