scop.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <scoplib/scop.h>
Include dependency graph for scop.c:

Functions

void scoplib_scop_print_structure (FILE *file, scoplib_scop_p scop, int level)
void scoplib_scop_print (FILE *file, scoplib_scop_p scop)
static void scoplib_scop_print_dot_scop_ (FILE *file, scoplib_scop_p scop, int castle, int arraystag)
void scoplib_scop_print_dot_scop (FILE *file, scoplib_scop_p scop)
void scoplib_scop_print_dot_scop_options (FILE *file, scoplib_scop_p scop, int options)
static char ** scoplib_scop_read_strings (FILE *file, int nb_strings)
static int scoplib_scop_read_int (FILE *file, char **str)
char ** scoplib_scop_generate_names (char *seed, int nb)
char * scoplib_scop_tag_content (scoplib_scop_p scop, char *tag, char *endtag)
char * scoplib_scop_tag_content_from_string (char *str, char *tag, char *endtag)
scoplib_scop_p scoplib_scop_read (FILE *file)
scoplib_scop_p scoplib_scop_malloc ()
void scoplib_scop_free (scoplib_scop_p scop)
scoplib_scop_p scoplib_scop_dup (scoplib_scop_p scop)

Function Documentation

scoplib_scop_p scoplib_scop_dup ( scoplib_scop_p  scop  ) 
void scoplib_scop_free ( scoplib_scop_p  scop  ) 

scoplib_scop_free function: This function frees the allocated memory for a scoplib_scop_t structure.

Parameters:
scop The pointer to the scop we want to free.
  • 30/04/2008: first version.

References scoplib_scop::arrays, scoplib_scop::context, scoplib_scop::nb_arrays, scoplib_scop::nb_parameters, scoplib_scop::optiontags, scoplib_scop::parameters, scoplib_matrix_free(), scoplib_statement_free(), and scoplib_scop::statement.

char** scoplib_scop_generate_names ( char *  seed,
int  nb 
)

scoplib_scop_generate_names function: This function generates an array of size 'nb' of chars of the form "seedXX" where XX goes from 1 to nb.

Parameters:
seed The template for the created names
nb The number of created items.

Referenced by scoplib_scop_read(), and scoplib_statement_read().

scoplib_scop_p scoplib_scop_malloc (  ) 

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

  • 30/04/2008: first version.

References scoplib_scop::arrays, scoplib_scop::context, scoplib_scop::nb_arrays, scoplib_scop::nb_parameters, scoplib_scop::optiontags, scoplib_scop::parameters, scoplib_scop::statement, and scoplib_scop::usr.

Referenced by scoplib_scop_dup(), and scoplib_scop_read().

void scoplib_scop_print ( FILE *  file,
scoplib_scop_p  scop 
)

scoplib_scop_print function: This function prints the content of a scoplib_scop_t structure (*scop) into a file (file, possibly stdout).

Parameters:
file File where informations are printed.
scop The scop whose information have to be printed.
  • 30/04/2008: first version.

References scoplib_scop_print_structure().

void scoplib_scop_print_dot_scop ( FILE *  file,
scoplib_scop_p  scop 
)

scoplib_scop_print_dot_scop function: This function prints the content of a scoplib_scop_t structure (*scop) into a file (file, possibly stdout) for the .scop format.

Parameters:
file File where informations are printed.
scop The scop whose information have to be printed.
  • 02/05/2008: first version.

References scoplib_scop_print_dot_scop_().

static void scoplib_scop_print_dot_scop_ ( FILE *  file,
scoplib_scop_p  scop,
int  castle,
int  arraystag 
) [static]
void scoplib_scop_print_dot_scop_options ( FILE *  file,
scoplib_scop_p  scop,
int  options 
)

scoplib_scop_print_dot_scop_castle function: This function prints the content of a scoplib_scop_t structure (*scop) into a file (file, possibly stdout) for the .scop format, with the castle.

Parameters:
file File where informations are printed.
scop The scop whose information have to be printed.
  • 02/05/2008: first version.

References SCOPLIB_SCOP_PRINT_ARRAYSTAG, SCOPLIB_SCOP_PRINT_CASTLE, and scoplib_scop_print_dot_scop_().

void scoplib_scop_print_structure ( FILE *  file,
scoplib_scop_p  scop,
int  level 
)

scoplib_scop_print_structure function: Displays a scoplib_scop_t structure (*scop) into a file (file, possibly stdout) in a way that trends to be understandable without falling in a deep depression or, for the lucky ones, getting a headache... It includes an indentation level (level) in order to work with others print_structure functions.

Parameters:
file File where informations are printed.
scop The scop whose information have to be printed.
level Number of spaces before printing, for each line.
  • 30/04/2008: first version.

References scoplib_scop::arrays, scoplib_scop::context, scoplib_scop::nb_arrays, scoplib_scop::nb_parameters, scoplib_scop::parameters, scoplib_matrix_print_structure(), scoplib_statement_print_structure(), and scoplib_scop::statement.

Referenced by scoplib_scop_print().

scoplib_scop_p scoplib_scop_read ( FILE *  file  ) 
static int scoplib_scop_read_int ( FILE *  file,
char **  str 
) [static]

Internal function. Read an int on the input 'file'.

should be placed somewhere else, it's duplicated in statement.c.

References SCOPLIB_MAX_STRING.

Referenced by scoplib_scop_read().

static char** scoplib_scop_read_strings ( FILE *  file,
int  nb_strings 
) [static]

Internal function. Read 'nb_strings' strings on the input 'file'.

should be placed somewhere else, it's duplicated in statement.c.

References SCOPLIB_MAX_STRING.

Referenced by scoplib_scop_read().

char* scoplib_scop_tag_content ( scoplib_scop_p  scop,
char *  tag,
char *  endtag 
)

scoplib_scop_tag_content function: This function returns a freshly allocated string containing the content, in the optional tags section, between the tag 'tag' and the tag 'endtag'. If the tag 'tag' is not found, returns NULL.

References scoplib_scop::optiontags, and scoplib_scop_tag_content_from_string().

Referenced by scoplib_scop_print_dot_scop_(), and scoplib_scop_read().

char* scoplib_scop_tag_content_from_string ( char *  str,
char *  tag,
char *  endtag 
)

scoplib_scop_tag_content_from_string function: This function returns a freshly allocated string containing the content, in the given string 'str', between the tag 'tag' and the tag 'endtag'. If the tag 'tag' is not found, returns NULL.

Referenced by scoplib_scop_tag_content().


Generated on Mon Jan 11 21:20:26 2010 for ScopLib by  doxygen 1.6.1