本文整理汇总了C++中raptor_free_uri函数的典型用法代码示例。如果您正苦于以下问题:C++ raptor_free_uri函数的具体用法?C++ raptor_free_uri怎么用?C++ raptor_free_uri使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了raptor_free_uri函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: raptor_rss_common_terminate
void
raptor_rss_common_terminate(raptor_world* world) {
int i;
if(--world->rss_common_initialised)
return;
if(world->rss_types_info_uris) {
for(i = 0; i< RAPTOR_RSS_COMMON_SIZE; i++) {
if(world->rss_types_info_uris[i])
raptor_free_uri(world->rss_types_info_uris[i]);
}
RAPTOR_FREE(raptor_uri* array, world->rss_types_info_uris);
world->rss_types_info_uris = NULL;
}
if(world->rss_fields_info_uris) {
for(i = 0; i< RAPTOR_RSS_FIELDS_SIZE; i++) {
if(world->rss_fields_info_uris[i])
raptor_free_uri(world->rss_fields_info_uris[i]);
}
RAPTOR_FREE(raptor_uri* array, world->rss_fields_info_uris);
world->rss_fields_info_uris = NULL;
}
if(world->rss_namespaces_info_uris) {
for(i = 0; i < RAPTOR_RSS_NAMESPACES_SIZE;i++) {
if(world->rss_namespaces_info_uris[i])
raptor_free_uri(world->rss_namespaces_info_uris[i]);
}
RAPTOR_FREE(raptor_uri* array, world->rss_namespaces_info_uris);
world->rss_namespaces_info_uris = NULL;
}
}
开发者ID:Anchakor,项目名称:raptor,代码行数:33,代码来源:raptor_rss_common.c
示例2: rdf_database_read_file
/*****
** Lee el archivo que contiene las tripletas RDF
** y hace el llamado a la funcion save_triple() para guardarlos
*****/
void rdf_database_read_file(rdf_database db, const char *file)
{
raptor_world *world = NULL;
unsigned char *uri_string;
raptor_uri *uri, *base_uri;
// parser
world = raptor_new_world();
rdf_parser = raptor_new_parser(world, "rdfxml");
// seteo funcion handler para cada nodo
raptor_parser_set_statement_handler(rdf_parser, (void*)db, save_triple);
uri_string = raptor_uri_filename_to_uri_string(file);
uri = raptor_new_uri(world, uri_string);
base_uri = raptor_uri_copy(uri);
// empieza parseo y guardado en memoria
raptor_parser_parse_file(rdf_parser, uri, base_uri);
// liberar ram
raptor_free_parser(rdf_parser);
raptor_free_uri(base_uri);
raptor_free_uri(uri);
raptor_free_memory(uri_string);
raptor_free_world(world);
}
开发者ID:eaanaba,项目名称:rdf_project,代码行数:31,代码来源:rdf_parser.c
示例3: main
int
main(int argc, char *argv[])
{
#ifdef HAVE_RAPTOR
raptor_world *world = NULL;
raptor_parser* rdf_parser = NULL;
unsigned char *uri_string;
raptor_uri *uri, *base_uri;
world = raptor_new_world();
rdf_parser = raptor_new_parser(world, "ntriples");
raptor_parser_set_statement_handler(rdf_parser, NULL, print_triple);
uri_string = raptor_uri_filename_to_uri_string(argv[1]);
uri = raptor_new_uri(world, uri_string);
base_uri = raptor_uri_copy(uri);
raptor_parser_parse_file(rdf_parser, uri, base_uri);
raptor_free_parser(rdf_parser);
raptor_free_uri(base_uri);
raptor_free_uri(uri);
raptor_free_memory(uri_string);
raptor_free_world(world);
#endif
return EXIT_SUCCESS;
}
开发者ID:rdmpage,项目名称:hdt-cpp,代码行数:32,代码来源:rdfprint.cpp
示例4: load_nquad_file
DllExport int call_conv load_nquad_file(CTXTdecl)
{
char *filename = p2c_string(reg_term(CTXTdecl 1));
unsigned char *uri_string;
raptor_uri *uri, *base_uri;
world = raptor_new_world();
rdf_parser = raptor_new_parser(world, "nquads");
raptor_parser_set_statement_handler(rdf_parser, NULL, handle_term);
uri_string = raptor_uri_filename_to_uri_string(filename);
uri = raptor_new_uri(world, uri_string);
base_uri = raptor_uri_copy(uri);
raptor_parser_parse_file(rdf_parser, uri, base_uri);
raptor_free_parser(rdf_parser);
raptor_free_uri(base_uri);
raptor_free_uri(uri);
raptor_free_memory(uri_string);
raptor_free_world(world);
return 1;
}
开发者ID:kkoch986,项目名称:XSB-B--Tree-Library,代码行数:29,代码来源:nq_parse.c
示例5: assert_uri_to_relative
static int
assert_uri_to_relative(const char *base, const char *uri, const char *relative)
{
unsigned char *output;
int result;
raptor_uri* base_uri=NULL;
raptor_uri* reference_uri=raptor_new_uri((const unsigned char*)uri);
size_t length=0;
if(base)
base_uri=raptor_new_uri((const unsigned char*)base);
output=raptor_uri_to_relative_counted_uri_string(base_uri, reference_uri,
&length);
result=strcmp(relative, (const char*)output);
if (result) {
fprintf(stderr,
"%s: raptor_uri_string_to_relative_uri_string FAILED: base='%s', uri='%s', expected='%s', got='%s'\n",
program, base, uri, relative, output);
RAPTOR_FREE(cstring, output);
return 1;
}
RAPTOR_FREE(cstring, output);
raptor_free_uri(base_uri);
raptor_free_uri(reference_uri);
return 0;
}
开发者ID:Kirushanr,项目名称:audacity,代码行数:27,代码来源:raptor_uri.c
示例6: raptor_free_www
/**
* raptor_free_www:
* @www: WWW object.
*
* Destructor - destroy a #raptor_www object.
**/
void
raptor_free_www(raptor_www* www)
{
/* free context */
if(www->type) {
if(www->free_type)
RAPTOR_FREE(cstring, www->type);
www->type = NULL;
}
if(www->user_agent) {
RAPTOR_FREE(cstring, www->user_agent);
www->user_agent = NULL;
}
if(www->cache_control) {
RAPTOR_FREE(cstring, www->cache_control);
www->cache_control = NULL;
}
if(www->proxy) {
RAPTOR_FREE(cstring, www->proxy);
www->proxy = NULL;
}
if(www->http_accept) {
RAPTOR_FREE(cstring, www->http_accept);
www->http_accept = NULL;
}
#ifdef RAPTOR_WWW_LIBCURL
raptor_www_curl_free(www);
#endif
#ifdef RAPTOR_WWW_LIBXML
raptor_www_libxml_free(www);
#endif
#ifdef RAPTOR_WWW_LIBFETCH
raptor_www_libfetch_free(www);
#endif
if(www->uri)
raptor_free_uri(www->uri);
if(www->final_uri)
raptor_free_uri(www->final_uri);
RAPTOR_FREE(www, www);
}
开发者ID:nevali,项目名称:raptor,代码行数:54,代码来源:raptor_www.c
示例7: raptor_free_term
/**
* raptor_free_term:
* @term: #raptor_term object
*
* Destructor - destroy a raptor_term object.
*
**/
void
raptor_free_term(raptor_term *term)
{
if(!term)
return;
if(--term->usage)
return;
switch(term->type) {
case RAPTOR_TERM_TYPE_URI:
if(term->value.uri) {
raptor_free_uri(term->value.uri);
term->value.uri = NULL;
}
break;
case RAPTOR_TERM_TYPE_BLANK:
if(term->value.blank.string) {
RAPTOR_FREE(cstring, (void*)term->value.blank.string);
term->value.blank.string = NULL;
}
break;
case RAPTOR_TERM_TYPE_LITERAL:
if(term->value.literal.string) {
RAPTOR_FREE(cstring, (void*)term->value.literal.string);
term->value.literal.string = NULL;
}
if(term->value.literal.datatype) {
raptor_free_uri(term->value.literal.datatype);
term->value.literal.datatype = NULL;
}
if(term->value.literal.language) {
RAPTOR_FREE(cstring, (void*)term->value.literal.language);
term->value.literal.language = NULL;
}
break;
case RAPTOR_TERM_TYPE_UNKNOWN:
default:
break;
}
RAPTOR_FREE(term, (void*)term);
}
开发者ID:nevali,项目名称:raptor,代码行数:55,代码来源:raptor_term.c
示例8: raptor_free_sax2
/**
* raptor_free_sax2:
* @sax2: SAX2 object
*
* Destructor - destroy a SAX2 object
*/
void
raptor_free_sax2(raptor_sax2 *sax2)
{
raptor_xml_element *xml_element;
if(!sax2)
return;
#ifdef RAPTOR_XML_LIBXML
if(sax2->xc) {
raptor_libxml_free(sax2->xc);
sax2->xc = NULL;
}
#endif
while( (xml_element = raptor_xml_element_pop(sax2)) )
raptor_free_xml_element(xml_element);
raptor_namespaces_clear(&sax2->namespaces);
if(sax2->base_uri)
raptor_free_uri(sax2->base_uri);
raptor_object_options_clear(&sax2->options);
RAPTOR_FREE(raptor_sax2, sax2);
}
开发者ID:JervenBolleman,项目名称:raptor,代码行数:33,代码来源:raptor_sax2.c
示例9: main
int main(int argc, char *argv[]) {
fsp_link *link;
fs_query_state *qs;
fs_query *qr;
raptor_uri *bu;
int i;
#ifdef LINUX
mtrace();
#endif
link = fsp_open_link("ukgov_finances_cra", NULL, FS_OPEN_HINT_RW);
raptor_init();
fs_hash_init(fsp_hash_type(link));
bu = raptor_new_uri((unsigned char *)"local:");
fsp_no_op(link, 0);
qs = fs_query_init(link);
for (i=0;i<atoi(argv[1]);i++) {
//printf("--------- %d ----------\n", i);
qr = fs_query_execute(qs, link, bu, QUERY, 0, 3, 0);
fs_query_free(qr);
fs_query_cache_flush(qs, 0);
}
fs_query_fini(qs);
raptor_free_uri(bu);
raptor_finish();
fsp_close_link(link);
#ifdef LINUX
muntrace();
#endif
}
开发者ID:TomT0m,项目名称:py4s,代码行数:34,代码来源:memory_test.c
示例10: raptor_serializer_start_to_string
/**
* raptor_serializer_start_to_string:
* @rdf_serializer: the #raptor_serializer
* @uri: base URI or NULL if no base URI is required
* @string_p: pointer to location to hold string
* @length_p: pointer to location to hold length of string (or NULL)
*
* Start serializing to a string.
*
* Return value: non-0 on failure.
**/
int
raptor_serializer_start_to_string(raptor_serializer *rdf_serializer,
raptor_uri *uri,
void **string_p, size_t *length_p)
{
if(rdf_serializer->base_uri)
raptor_free_uri(rdf_serializer->base_uri);
if(uri)
rdf_serializer->base_uri = raptor_uri_copy(uri);
else
rdf_serializer->base_uri = NULL;
rdf_serializer->locator.uri = rdf_serializer->base_uri;
rdf_serializer->locator.line = rdf_serializer->locator.column = 0;
rdf_serializer->iostream = raptor_new_iostream_to_string(rdf_serializer->world,
string_p, length_p,
NULL);
if(!rdf_serializer->iostream)
return 1;
rdf_serializer->free_iostream_on_end = 1;
if(rdf_serializer->factory->serialize_start)
return rdf_serializer->factory->serialize_start(rdf_serializer);
return 0;
}
开发者ID:Distrotech,项目名称:raptor,代码行数:39,代码来源:raptor_serialize.c
示例11: raptor_free_xml_element
/**
* raptor_free_xml_element:
* @element: XML Element
*
* Destructor - destroy a raptor_xml_element object.
**/
void
raptor_free_xml_element(raptor_xml_element *element)
{
unsigned int i;
if(!element)
return;
for(i = 0; i < element->attribute_count; i++)
if(element->attributes[i])
raptor_free_qname(element->attributes[i]);
if(element->attributes)
RAPTOR_FREE(raptor_qname_array, element->attributes);
if(element->content_cdata_sb)
raptor_free_stringbuffer(element->content_cdata_sb);
if(element->base_uri)
raptor_free_uri(element->base_uri);
if(element->xml_language)
RAPTOR_FREE(char*, element->xml_language);
raptor_free_qname(element->name);
if(element->declared_nspaces)
raptor_free_sequence(element->declared_nspaces);
RAPTOR_FREE(raptor_element, element);
}
开发者ID:Distrotech,项目名称:raptor,代码行数:37,代码来源:raptor_xml.c
示例12: raptor_serializer_start_to_filename
/**
* raptor_serializer_start_to_filename:
* @rdf_serializer: the #raptor_serializer
* @filename: filename to serialize to
*
* Start serializing to a filename.
*
* Return value: non-0 on failure.
**/
int
raptor_serializer_start_to_filename(raptor_serializer *rdf_serializer,
const char *filename)
{
unsigned char *uri_string = raptor_uri_filename_to_uri_string(filename);
if(!uri_string)
return 1;
if(rdf_serializer->base_uri)
raptor_free_uri(rdf_serializer->base_uri);
rdf_serializer->base_uri = raptor_new_uri(rdf_serializer->world, uri_string);
rdf_serializer->locator.uri = rdf_serializer->base_uri;
rdf_serializer->locator.line = rdf_serializer->locator.column = 0;
RAPTOR_FREE(char*, uri_string);
rdf_serializer->iostream = raptor_new_iostream_to_filename(rdf_serializer->world,
filename);
if(!rdf_serializer->iostream)
return 1;
rdf_serializer->free_iostream_on_end = 1;
if(rdf_serializer->factory->serialize_start)
return rdf_serializer->factory->serialize_start(rdf_serializer);
return 0;
}
开发者ID:Distrotech,项目名称:raptor,代码行数:37,代码来源:raptor_serialize.c
示例13: raptor_rss_model_clear
void
raptor_rss_model_clear(raptor_rss_model* rss_model)
{
int i;
raptor_rss_item* item;
for(i = 0; i< RAPTOR_RSS_COMMON_SIZE; i++) {
item = rss_model->common[i];
while(item) {
raptor_rss_item *next = item->next;
raptor_free_rss_item(item);
item = next;
}
}
item = rss_model->items;
while(item) {
raptor_rss_item *next = item->next;
raptor_free_rss_item(item);
item = next;
}
rss_model->last = rss_model->items = NULL;
for(i = 0; i< RAPTOR_RSS_N_CONCEPTS; i++) {
raptor_uri* concept_uri = rss_model->concepts[i];
if(concept_uri) {
raptor_free_uri(concept_uri);
rss_model->concepts[i] = NULL;
}
}
}
开发者ID:Anchakor,项目名称:raptor,代码行数:32,代码来源:raptor_rss_common.c
示例14: raptor_serializer_start_to_iostream
/**
* raptor_serializer_start_to_iostream:
* @rdf_serializer: the #raptor_serializer
* @uri: base URI or NULL if no base URI is required
* @iostream: #raptor_iostream to write serialization to
*
* Start serialization to an iostream with given base URI
*
* The passed in @iostream does not become owned by the serializer
* and can be used by the caller after serializing is done. It
* must be destroyed by the caller.
*
* Return value: non-0 on failure.
**/
int
raptor_serializer_start_to_iostream(raptor_serializer *rdf_serializer,
raptor_uri *uri, raptor_iostream *iostream)
{
if(rdf_serializer->base_uri)
raptor_free_uri(rdf_serializer->base_uri);
if(!iostream)
return 1;
if(uri)
uri = raptor_uri_copy(uri);
rdf_serializer->base_uri = uri;
rdf_serializer->locator.uri = uri;
rdf_serializer->locator.line = rdf_serializer->locator.column = 0;
rdf_serializer->iostream = iostream;
rdf_serializer->free_iostream_on_end = 0;
if(rdf_serializer->factory->serialize_start)
return rdf_serializer->factory->serialize_start(rdf_serializer);
return 0;
}
开发者ID:Distrotech,项目名称:raptor,代码行数:39,代码来源:raptor_serialize.c
示例15: ser_emit_triple
static void
ser_emit_triple(void* user_data,
const char* subject, int subject_type,
const char* predicate_nspace, const char* predicate_name,
const char *object, int object_type,
const char *datatype_uri)
{
raptor_serializer* serializer = (raptor_serializer*)user_data;
raptor_statement s; /* static */
raptor_uri* predicate_ns_uri;
raptor_uri* predicate_uri;
raptor_statement_init(&s, rworld);
if(subject_type == FLICKCURL_TERM_TYPE_RESOURCE)
s.subject = raptor_new_term_from_uri_string(rworld, (const unsigned char*)subject);
else /* blank node */
s.subject = raptor_new_term_from_blank(rworld, (const unsigned char*)subject);
predicate_ns_uri = raptor_new_uri(rworld, (const unsigned char*)predicate_nspace);
predicate_uri = raptor_new_uri_from_uri_local_name(rworld, predicate_ns_uri,
(const unsigned char*)predicate_name);
s.predicate = raptor_new_term_from_uri(rworld, predicate_uri);
raptor_free_uri(predicate_uri);
raptor_free_uri(predicate_ns_uri);
if(object_type == FLICKCURL_TERM_TYPE_RESOURCE)
s.object = (void*)raptor_new_term_from_uri_string(rworld, (const unsigned char*)object);
else if(object_type == FLICKCURL_TERM_TYPE_BLANK)
s.object = raptor_new_term_from_blank(rworld, (const unsigned char*)subject);
else {
/* literal */
raptor_uri* raptor_datatype_uri = NULL;
if(datatype_uri)
raptor_datatype_uri = raptor_new_uri(rworld, (const unsigned char*)datatype_uri);
s.object = raptor_new_term_from_literal(rworld, (const unsigned char*)object, raptor_datatype_uri, NULL /* language */);
raptor_free_uri(raptor_datatype_uri);
}
raptor_serializer_serialize_statement(serializer, &s);
raptor_statement_clear(&s);
}
开发者ID:jcsogo,项目名称:flickcurl,代码行数:47,代码来源:flickrdf.c
示例16: librdf_free_uri
/**
* librdf_free_uri:
* @uri: #librdf_uri object
*
* Destructor - destroy a #librdf_uri object.
*
**/
void
librdf_free_uri(librdf_uri* uri)
{
if(!uri)
return;
raptor_free_uri(uri);
}
开发者ID:Distrotech,项目名称:librdf,代码行数:15,代码来源:rdf_uri.c
示例17: main
int main (int argc, char *argv[])
{
const char *program = raptor_basename(argv[0]);
raptor_world *world;
const char *uri_string;
raptor_www *www;
const char *user_agent = "raptor_www_test/0.1";
raptor_uri *uri;
void *string = NULL;
size_t string_length = 0;
if(argc > 1)
uri_string = argv[1];
else
uri_string = "http://librdf.org/";
world = raptor_new_world();
if(!world || raptor_world_open(world))
exit(1);
uri = raptor_new_uri(world, (const unsigned char*)uri_string);
if(!uri) {
fprintf(stderr, "%s: Failed to create Raptor URI for %s\n",
program, uri_string);
exit(1);
}
www = raptor_new_www(world);
raptor_www_set_content_type_handler(www, write_content_type, (void*)stderr);
raptor_www_set_user_agent(www, user_agent);
/* start retrieval (always a GET) */
if(raptor_www_fetch_to_string(www, uri,
&string, &string_length, malloc)) {
fprintf(stderr, "%s: WWW fetch failed\n", program);
} else {
#if defined(RAPTOR_DEBUG) && RAPTOR_DEBUG > 1
fprintf(stderr, "%s: HTTP response status %d\n",
program, www->status_code);
fprintf(stderr, "%s: Returned %d bytes of content\n",
program, (int)string_length);
#endif
}
if(string)
free(string);
raptor_free_www(www);
raptor_free_uri(uri);
raptor_free_world(world);
return 0;
}
开发者ID:Distrotech,项目名称:raptor,代码行数:57,代码来源:raptor_www_test.c
示例18: rasqal_finish_datatypes
static void
rasqal_finish_datatypes(void) {
int i;
for(i = 0; i< RASQAL_XSD_DATATYPES_SIZE; i++)
if(rasqal_xsd_datatypes[i].uri)
raptor_free_uri(rasqal_xsd_datatypes[i].uri);
for(i = 0; i< RASQAL_XSD_DATATYPE_FNS_SIZE; i++)
if(rasqal_xsd_datatype_fns[i].uri)
raptor_free_uri(rasqal_xsd_datatype_fns[i].uri);
if(raptor_xpfo_base_uri)
raptor_free_uri(raptor_xpfo_base_uri);
if(rasqal_sparql_op_namespace_uri)
raptor_free_uri(rasqal_sparql_op_namespace_uri);
}
开发者ID:sengels,项目名称:rasqal,代码行数:18,代码来源:rasqal_xsd_datatypes.c
示例19: raptor_free_base_id_set
/**
* raptor_free_base_id_set:
* @set: #raptor_base_id_set
*
* INTERNAL - Destructor - Free a Base ID Set.
*
**/
static void
raptor_free_base_id_set(raptor_base_id_set *base)
{
if(base->tree)
raptor_free_avltree(base->tree);
if(base->uri)
raptor_free_uri(base->uri);
RAPTOR_FREE(raptor_base_id_set, base);
}
开发者ID:nevali,项目名称:raptor,代码行数:16,代码来源:raptor_set.c
示例20: calloc
fs_metadata *fs_metadata_open(const char *kb)
{
fs_metadata *m = calloc(1, sizeof(fs_metadata));
gchar *fs_md_file_uri_format;
fs_md_file_uri_format = g_strconcat("file://",
fs_get_md_file_format(),
NULL);
m->size = 16;
m->length = 0;
m->entries = calloc(m->size, sizeof(struct m_entry));
m->uri = g_strdup_printf(fs_md_file_uri_format, kb);
g_free(fs_md_file_uri_format);
int fd;
if ((fd = open(m->uri + 7, FS_O_NOATIME | O_CREAT, FS_FILE_MODE)) == -1) {
fs_error(LOG_CRIT, "failed to touch metadata file %s: %s",
m->uri, strerror(errno));
free(m);
return NULL;
}
close(fd);
m->rw = raptor_new_world();
if (!m->rw) {
fs_error(LOG_CRIT, "failed to initialise raptor");
free(m);
return NULL;
}
raptor_parser *rdf_parser = raptor_new_parser(m->rw, "turtle");
raptor_parser_set_statement_handler(rdf_parser, m, parse_stmt);
char *uri = strdup(m->uri);
raptor_uri *ruri = raptor_new_uri(m->rw, (unsigned char *) uri);
raptor_uri *muri = raptor_new_uri(m->rw, (unsigned char *) uri);
free(uri);
if (raptor_parser_parse_uri(rdf_parser, ruri, muri)) {
fs_error(LOG_ERR, "failed to parse metadata file “%s”", m->uri);
return NULL;
}
raptor_free_parser(rdf_parser);
raptor_free_uri(ruri);
raptor_free_uri(muri);
return m;
}
开发者ID:garlik,项目名称:4store,代码行数:44,代码来源:metadata.c
注:本文中的raptor_free_uri函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论