OpenScop  0.9.0
Functions
textual.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/textual.h>
Include dependency graph for textual.c:

Go to the source code of this file.

Functions

void osl_textual_idump (FILE *file, osl_textual_p textual, int level)
void osl_textual_dump (FILE *file, osl_textual_p textual)
char * osl_textual_sprint (osl_textual_p textual)
osl_textual_p osl_textual_sread (char **extensions)
osl_textual_p osl_textual_malloc ()
void osl_textual_free (osl_textual_p textual)
osl_textual_p osl_textual_clone (osl_textual_p textual)
int osl_textual_equal (osl_textual_p f1, osl_textual_p f2)
osl_interface_p osl_textual_interface ()

Function Documentation

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

Parameters:
[in]textualThe pointer to the textual structure we want to clone.
Returns:
A pointer to the clone of the textual structure.

Definition at line 263 of file textual.c.

References OSL_strdup, osl_textual_malloc(), and osl_textual::textual.

Referenced by osl_textual_interface().

void osl_textual_dump ( FILE *  file,
osl_textual_p  textual 
)

osl_textual_dump function: this function prints the content of an osl_textual_t structure (*textual) into a file (file, possibly stdout).

Parameters:
[in]fileThe file where the information has to be printed.
[in]textualThe textual structure to be printed.

Definition at line 139 of file textual.c.

References osl_textual_idump().

osl_textual_equal function: this function returns 1. This is part of the special behavior of the textual option (the text string can be easily different while the options are actually identical.

Parameters:
[in]f1The first textual structure.
[in]f2The second textual structure.
Returns:
1.

Definition at line 308 of file textual.c.

Referenced by osl_textual_interface().

void osl_textual_free ( osl_textual_p  textual)

osl_textual_free function: this function frees the allocated memory for an osl_textual_t structure.

Parameters:
[in,out]textualThe pointer to the textual structure to be freed.

Definition at line 242 of file textual.c.

References osl_textual::textual.

Referenced by osl_textual_interface().

void osl_textual_idump ( FILE *  file,
osl_textual_p  textual,
int  level 
)

osl_textual_idump function: this function displays an osl_textual_t structure (*textual) 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]textualThe textual structure to be printed.
[in]levelNumber of spaces before printing, for each line.

Definition at line 91 of file textual.c.

References OSL_strdup, and osl_textual::textual.

Referenced by osl_textual_dump(), and osl_textual_interface().

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

Returns:
An interface structure for the textual extension.

Definition at line 321 of file textual.c.

References osl_interface_malloc(), OSL_strdup, osl_textual_clone(), osl_textual_equal(), osl_textual_free(), osl_textual_idump(), osl_textual_malloc(), osl_textual_sprint(), osl_textual_sread(), and OSL_URI_TEXTUAL.

Referenced by osl_interface_get_default_registry().

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

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

Definition at line 226 of file textual.c.

References OSL_malloc, and osl_textual::textual.

Referenced by osl_textual_clone(), osl_textual_interface(), and osl_textual_sread().

char* osl_textual_sprint ( osl_textual_p  textual)

osl_textual_sprint function: this function returns NULL. This is part of the special behavior of the textual option (printing it along with other options would double the options...).

Parameters:
[in]textualThe textual structure to be printed.
Returns:
NULL.

Definition at line 176 of file textual.c.

Referenced by osl_textual_interface().

osl_textual_p osl_textual_sread ( char **  extensions)

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

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

Definition at line 197 of file textual.c.

References OSL_strdup, osl_textual_malloc(), and osl_textual::textual.

Referenced by osl_textual_interface().