OpenScop  0.9.0
Functions
scatnames.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/strings.h>
#include <osl/extensions/scatnames.h>
Include dependency graph for scatnames.c:

Go to the source code of this file.

Functions

void osl_scatnames_idump (FILE *file, osl_scatnames_p scatnames, int level)
void osl_scatnames_dump (FILE *file, osl_scatnames_p scatnames)
char * osl_scatnames_sprint (osl_scatnames_p scatnames)
osl_scatnames_p osl_scatnames_sread (char **input)
osl_scatnames_p osl_scatnames_malloc ()
void osl_scatnames_free (osl_scatnames_p scatnames)
osl_scatnames_p osl_scatnames_clone (osl_scatnames_p scatnames)
int osl_scatnames_equal (osl_scatnames_p s1, osl_scatnames_p s2)
osl_interface_p osl_scatnames_interface ()

Function Documentation

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

Parameters:
[in]scatnamesThe pointer to the scatnames structure to clone.
Returns:
A pointer to the clone of the scatnames structure.

Definition at line 227 of file scatnames.c.

References osl_scatnames::names, osl_scatnames_malloc(), and osl_strings_clone().

Referenced by osl_scatnames_interface().

void osl_scatnames_dump ( FILE *  file,
osl_scatnames_p  scatnames 
)

osl_scatnames_dump function: this function prints the content of an osl_scatnames_t structure (*scatnames) into a file (file, possibly stdout).

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

Definition at line 125 of file scatnames.c.

References osl_scatnames_idump().

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

Parameters:
[in]s1The first scatnames structure.
[in]s2The second scatnames structure.
Returns:
1 if s1 and s2 are the same (content-wise), 0 otherwise.

Definition at line 248 of file scatnames.c.

References osl_scatnames::names, and osl_strings_equal().

Referenced by osl_scatnames_interface().

void osl_scatnames_free ( osl_scatnames_p  scatnames)

osl_scatnames_free function: this function frees the allocated memory for an osl_scatnames_t structure.

Parameters:
[in,out]scatnamesThe pointer to the scatnames structure to free.

Definition at line 207 of file scatnames.c.

References osl_scatnames::names, and osl_strings_free().

Referenced by osl_scatnames_interface().

void osl_scatnames_idump ( FILE *  file,
osl_scatnames_p  scatnames,
int  level 
)

osl_scatnames_idump function: this function displays an osl_scatnames_t structure (*scatnames) 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]scatnamesScatnames structure to print.
[in]levelNumber of spaces before printing, for each line.

Definition at line 89 of file scatnames.c.

References osl_scatnames::names, and osl_strings_idump().

Referenced by osl_scatnames_dump(), and osl_scatnames_interface().

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

Returns:
An interface structure for the scatnames extension.

Definition at line 269 of file scatnames.c.

References osl_interface_malloc(), osl_scatnames_clone(), osl_scatnames_equal(), osl_scatnames_free(), osl_scatnames_idump(), osl_scatnames_malloc(), osl_scatnames_sprint(), osl_scatnames_sread(), OSL_strdup, and OSL_URI_SCATNAMES.

Referenced by osl_interface_get_default_registry().

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

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

Definition at line 191 of file scatnames.c.

References osl_scatnames::names, and OSL_malloc.

Referenced by osl_scatnames_clone(), osl_scatnames_interface(), and osl_scatnames_sread().

char* osl_scatnames_sprint ( osl_scatnames_p  scatnames)

osl_scatnames_sprint function: this function prints the content of an osl_scatnames_t structure (*scatnames) into a string (returned) in the OpenScop textual format.

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

Definition at line 137 of file scatnames.c.

References osl_scatnames::names, and osl_strings_sprint().

Referenced by osl_scatnames_interface().

osl_scatnames_sread function: this function reads a scatnames structure from a string complying to the OpenScop textual format and returns a pointer to this scatnames structure. The input parameter is updated to the position in the input string this function reach right after reading the scatnames structure. If there is nothing to read, the function returns NULL.

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

Definition at line 158 of file scatnames.c.

References osl_scatnames::names, OSL_debug, osl_scatnames_malloc(), and osl_strings_sread().

Referenced by osl_scatnames_interface().