Esempio n. 1
0
/*zw: read the transformation function from .scop file*/
char* candl_program_read_scop_transform(FILE* file){
    scoplib_scop_p scop;
    scop = scoplib_scop_read(file);
    char* candl_opts = scoplib_scop_tag_content(scop, "<candl>", "</candl>");
    scoplib_scop_free(scop);
    if (!candl_opts)
        return NULL;
    char* transformation = scoplib_scop_tag_content_from_string(candl_opts, "<Transformation>", "</Transformation>");
    free (candl_opts);
    if (! transformation)
        return NULL;
    else
        return transformation;
}
Esempio n. 2
0
/**
 * 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.
 */
char*
scoplib_scop_tag_content(scoplib_scop_p scop, char* tag, char* endtag)
{
  return scoplib_scop_tag_content_from_string(scop->optiontags, tag, endtag);
}