/** * \brief Initialize Intermediate Process. */ int ip_init(struct intermediate *conf, uint32_t ip_id) { int ret; /* Initialize plugin */ xmlChar *ip_params = NULL; xmlDocDumpMemory(conf->xml_conf->xmldata, &ip_params, NULL); conf->intermediate_init((char *) ip_params, conf, ip_id, template_mgr, &(conf->plugin_config)); if (conf->plugin_config == NULL) { MSG_ERROR(msg_module, "Unable to initialize intermediate process"); return -1; } free(ip_params); /* start main thread */ ret = pthread_create(&(conf->thread_id), NULL, ip_loop, (void *)conf); if (ret != 0) { MSG_ERROR(msg_module, "Unable to create thread for intermediate process"); return -1; } return 0; }
/** * sim_xml_config_to_string * @xmlconfig: a #SimXmlConfig object. * * Get the given XML config contents as a XML string. * * Returns: the XML string representing the structure and contents of the * given #SimXmlConfig object. The returned value must be freed when no * longer needed. */ gchar * sim_xml_config_to_string (SimXmlConfig *xmlconfig) { xmlDocPtr doc; xmlNodePtr root; xmlChar *xml; gint size; gchar *retval; g_return_val_if_fail (SIM_IS_XML_CONFIG (xmlconfig), NULL); /* create the top node */ doc = xmlNewDoc ((xmlChar *) "1.0"); //xmlChar is a typedef to unsigned char. Needed to avoid stupid warnings root = xmlNewDocNode (doc, NULL, (xmlChar *) OBJECT_CONFIG, NULL); xmlDocSetRootElement (doc, root); /* save to memory */ xmlDocDumpMemory (doc, &xml, &size); xmlFreeDoc (doc); if (!xml) { g_message ("Could not dump XML file to memory"); return NULL; } retval = g_strdup ((gchar *)xml); free (xml); return retval; }
static xmlChar * makeCloneXML(const char *origxml, const char *newname) { xmlDocPtr doc = NULL; xmlXPathContextPtr ctxt = NULL; xmlXPathObjectPtr obj = NULL; xmlChar *newxml = NULL; int size; doc = virXMLParseStringCtxt(origxml, _("(volume_definition)"), &ctxt); if (!doc) goto cleanup; obj = xmlXPathEval(BAD_CAST "/volume/name", ctxt); if (obj == NULL || obj->nodesetval == NULL || obj->nodesetval->nodeTab == NULL) goto cleanup; xmlNodeSetContent(obj->nodesetval->nodeTab[0], (const xmlChar *)newname); xmlDocDumpMemory(doc, &newxml, &size); cleanup: xmlXPathFreeObject(obj); xmlXPathFreeContext(ctxt); xmlFreeDoc(doc); return newxml; }
char* data_manager_getAsString (data_manager_t self, char buffer[], int id) { xmlDoc* doc = NULL; xmlNode* root_element = NULL; doc = xmlNewDoc ("1.0"); root_element = xmlNewNode (NULL, "directors"); xmlDocSetRootElement (doc, root_element); int qDirs = list_getSize(self->directors); for (int i = 0; i < qDirs; i++) { if (id == i || id == -1) director_toXmlNode (list_get (self->directors, i, NULL), doc, root_element); } xmlChar* pMem = NULL; int size = 0; xmlDocDumpMemory(doc, &pMem, &size); strcpy(buffer, pMem); free(pMem); xmlFreeDoc (doc); return buffer; }
int messageCreateCommandMessage(char *date, char *command, char *message, int messageMaxSize) { xmlChar *s; xmlDocPtr doc = NULL; /* document pointer */ xmlNodePtr root_node = NULL;/* node pointers */ int result; int messageSize; LIBXML_TEST_VERSION; doc = xmlNewDoc(BAD_CAST "1.0"); root_node = xmlNewNode(NULL, BAD_CAST "command"); //watch out xmlDocSetRootElement(doc, root_node); xmlNodeSetContent(root_node, BAD_CAST command); xmlSetProp(root_node, BAD_CAST "date",BAD_CAST date); xmlDocDumpMemory(doc, &s, &messageSize); if( messageSize + 1 <= messageMaxSize) { strcpy((char *) message, (char *) s); result = messageSize + 1; } else result = -1; xmlFree(s); xmlFreeDoc(doc); xmlCleanupParser(); return result; }
static char* generate_share_request_body(Share *share) { xmlChar *buf = NULL; xmlDocPtr doc; xmlNodePtr node , fnode , root; char size[16]; char body[] = "<share-content></share-content>"; doc = xmlParseMemory(body , strlen(body)); root = xmlDocGetRootElement(doc); xmlNewProp(root , BAD_CAST "id" , BAD_CAST share->guid); node = xmlNewChild(root , NULL , BAD_CAST "caps" , NULL); xmlNewProp(node , BAD_CAST "modes" , BAD_CAST "block;relay;p2p;p2pV2;relayV2;p2pV3;scV2"); xmlNewProp(node , BAD_CAST "max-size" , BAD_CAST "2097151"); node = xmlNewChild(root , NULL , BAD_CAST "client" , NULL); xmlNewProp(node , BAD_CAST "outer-ip" , BAD_CAST ""); xmlNewProp(node , BAD_CAST "inner-ip" , BAD_CAST "59.64.128.102:1429;"); xmlNewProp(node , BAD_CAST "port" , BAD_CAST "443"); node = xmlNewChild(root , NULL , BAD_CAST "fileinfo" , NULL); fnode = xmlNewChild(node , NULL , BAD_CAST "transmit" , NULL); xmlNewProp(fnode , BAD_CAST "type" , BAD_CAST "p2p"); xmlNewProp(fnode , BAD_CAST "session-id" , BAD_CAST share->sessionid); fnode = xmlNewChild(node , NULL , BAD_CAST "file" , NULL); xmlNewProp(fnode , BAD_CAST "name" , BAD_CAST share->filename); memset(size, 0, sizeof(size)); xmlNewProp(fnode , BAD_CAST "size" , BAD_CAST size); xmlNewProp(fnode , BAD_CAST "url" , BAD_CAST ""); xmlNewProp(fnode , BAD_CAST "md5" , BAD_CAST share->md5); xmlNewProp(fnode , BAD_CAST "id" , BAD_CAST share->guid); xmlNewProp(fnode , BAD_CAST "p2ptorelay" , BAD_CAST "1"); xmlNewProp(fnode , BAD_CAST "file-type" , BAD_CAST "unknown"); xmlDocDumpMemory(doc , &buf , NULL); xmlFreeDoc(doc); return xml_convert(buf); }
int ofcds_rollback(void *UNUSED(data)) { xmlChar *data; int size, ret; struct nc_err *e; if (rollback.type == NC_DATASTORE_ERROR) { nc_verb_error("No data to rollback"); return EXIT_FAILURE; } /* dump data for copy-config */ if (rollback.doc) { xmlDocDumpMemory(rollback.doc, &data, &size); } else { data = xmlStrdup(BAD_CAST ""); } rollbacking = 1; ret = ofcds_copyconfig(NULL, rollback.type, NC_DATASTORE_CONFIG, (char *) data, &e); rollbacking = 0; if (ret) { nc_err_free(e); } xmlFree(data); return ret; }
xmlChar * LocalPackage::getPackageXMLNodeXPtr(int * bufsize) { xmlChar *membuf; if (!__doc) fprintf(stderr, "OOPS: NULL __doc in getPackageXMLNodeXPtr\n"); xmlDocDumpMemory(this->__doc, &membuf, bufsize); return membuf; }
char* PluginXmlOptions::dumpXmlDocToMemory(xmlDocPtr xmlDoc) { xmlChar *tempBuffer; int tempBufferSize; char *xml = NULL; xmlDocDumpMemory(xmlDoc, &tempBuffer, &tempBufferSize); // remove carriage returns (even though libxml was instructed not to format the XML) xmlChar* bufferChar = tempBuffer; int bufferCharIndex = 0; while (*bufferChar != '\0') { if (*bufferChar == '\n') { memmove(bufferChar, bufferChar + 1, tempBufferSize - bufferCharIndex); tempBufferSize--; } else if (*bufferChar == '\"') *bufferChar = '\''; bufferChar++; bufferCharIndex++; } xml = new char[tempBufferSize + 1]; memcpy(xml, tempBuffer, tempBufferSize); xml[tempBufferSize] = 0; return xml; }
void tst(void) { #if YAZ_HAVE_XML2 xmlChar *buf_out; int len_out; xmlDocPtr doc; xmlNodePtr top; #if 0 const char *val = "jordb" "\xe6" "r"; /* makes xmlDocDumpMemory hang .. */ #else const char *val = "jordbaer"; /* OK */ #endif doc = xmlNewDoc(BAD_CAST "1.0"); YAZ_CHECK(doc); top = xmlNewNode(0, BAD_CAST "top"); YAZ_CHECK(top); xmlNewTextChild(top, 0, BAD_CAST "sub", BAD_CAST val); xmlDocSetRootElement(doc, top); xmlDocDumpMemory(doc, &buf_out, &len_out); #if 0 printf("%*s", len_out, buf_out); #endif /* YAZ_HAVE_XML2 */ #endif }
char *gen_export_nfe_xml(NFE *nfe){ int rc, buffersize; xmlTextWriterPtr writer; xmlDocPtr doc; xmlChar *xmlbuf; writer = xmlNewTextWriterDoc(&doc, 0); if (writer == NULL) return NULL; xmlTextWriterStartDocument(writer, NULL, "UTF-8", NULL); rc = xmlTextWriterStartElement(writer, BAD_CAST "nfeProc"); if (rc < 0) return NULL; rc = xmlTextWriterWriteAttribute(writer, BAD_CAST "versao", BAD_CAST NFE_VERSAO); if (rc < 0) return NULL; rc = xmlTextWriterWriteRaw(writer, BAD_CAST nfe->xml); if (rc < 0) return NULL; rc = xmlTextWriterWriteRaw(writer, BAD_CAST nfe->protocolo->xml); if (rc < 0) return NULL; rc = xmlTextWriterEndElement(writer); if (rc < 0) return NULL; xmlTextWriterEndDocument(writer); xmlDocDumpMemory(doc, &xmlbuf, &buffersize); return (char*)xmlbuf; }
char * DataHandler_convertToXml(DataHandler_t self, char * buff) { xmlDoc * doc = NULL; xmlNode * root = NULL; xmlChar * str = NULL; doc = xmlNewDoc("1.0"); root = xmlNewNode(NULL, "patients"); xmlDocSetRootElement(doc, root); int numberOfPatients = List_getSize(self->patients); for(int i = 0; i < numberOfPatients; i++) { patient_convertToXml(List_get(self->patients, i, NULL), doc, root); } xmlDocDumpMemory(doc, &str, NULL); strcpy(buff, str); free(str); xmlFreeDoc(doc); return buff; }
str BATXMLdocument(bat *ret, const bat *bid) { BAT *b, *bn; BUN p, q; BATiter bi; size_t size = BUFSIZ; str buf = GDKmalloc(size); const char *err = OPERATION_FAILED; if (buf == NULL) throw(MAL,"xml.document",MAL_MALLOC_FAIL); if ((b = BATdescriptor(*bid)) == NULL) { GDKfree(buf); throw(MAL, "xml.document", INTERNAL_BAT_ACCESS); } prepareResult(bn, b, TYPE_xml, "document", GDKfree(buf)); bi = bat_iterator(b); BATloop(b, p, q) { const char *t = (const char *) BUNtail(bi, p); xmlDocPtr doc; int len; xmlChar *s; if (strNil(t)) { bunfastapp(bn, str_nil); bn->T->nonil = 0; continue; } len = (int) strlen(t); doc = xmlParseMemory(t, len); if (doc == NULL) { err = OPERATION_FAILED XML_PARSE_ERROR; goto bunins_failed; } xmlDocDumpMemory(doc, &s, &len); xmlFreeDoc(doc); if ((size_t) len + 2 >= size) { GDKfree(buf); size = (size_t) len + 128; buf = GDKmalloc(size); if (buf == NULL) { err= MAL_MALLOC_FAIL; goto bunins_failed; } } buf[0] = 'D'; strcpy(buf + 1, (char *) s); bunfastapp(bn, buf); } GDKfree(buf); finalizeResult(ret, bn, b); return MAL_SUCCEED; bunins_failed: GDKfree(buf); BBPunfix(b->batCacheid); BBPunfix(bn->batCacheid); throw(MAL, "xml.document", "%s", err); }
METHOD Xml_dump(Ctx *ctx, knh_sfp_t *sfp) { xmlDocPtr doc = (xmlDocPtr) p_cptr(sfp[0]); xmlChar* ret; int size; xmlDocDumpMemory(doc,&ret,&size); KNH_RETURN(ctx, sfp, new_String(ctx, B((char*)ret), NULL)); }
QString KSXSLHandler::parse(QString xmlString) { //check if the message is allready a HTML if(xmlString.find("<?xml version='1.0' encoding='UTF-8'?>")==-1) { return xmlString; } QStringList temp=KSData::instance()->getPartOfSpeech(); for(QStringList::Iterator count=temp.begin();count!=temp.end();count++) { xmlString.replace("<type>"+QString::number(KSData::instance()->getPartOfSpeechId(*count))+"</type>", "<type>"+*count+"</type>"); } QCString xmlCString=xmlString.utf8(); QString result; xmlDocPtr xmlDoc=xmlParseMemory(xmlCString, xmlCString.length()); if(xmlDoc) { if(styleSheet) { static QCString appPath( QString::fromLatin1("\"%1\"").arg( KApplication::kApplication()->dirs()->findDirs("appdata", QString::fromLatin1("styles/data") ).front() ).utf8() ); static const char* params[3] = { "appdata", appPath, NULL }; xmlDocPtr xmlResult=xsltApplyStylesheet(styleSheet, xmlDoc, params); if(xmlResult) { xmlChar *temp; int size; xmlDocDumpMemory(xmlResult, &temp, &size); result=QString::fromUtf8(QCString((char *)temp, size+1)); xmlFree(temp); xmlFreeDoc(xmlResult); } else { kdWarning() << "There is no phrase." << endl; } } else { kdWarning() << "No stylesheet loaded." << endl; } } else { kdWarning() << "Wrong XML format." << endl; } xmlFreeDoc(xmlDoc); xmlDoc=0; return result; }
gchar * e_publish_uri_to_xml (EPublishUri *uri) { xmlDocPtr doc; xmlNodePtr root; gchar *enabled, *frequency, *format; GSList *calendars = NULL; xmlChar *xml_buffer; gchar *returned_buffer; gint xml_buffer_size; g_return_val_if_fail (uri != NULL, NULL); g_return_val_if_fail (uri->location != NULL, NULL); doc = xmlNewDoc ((const guchar *)"1.0"); root = xmlNewDocNode (doc, NULL, (const guchar *)"uri", NULL); enabled = g_strdup_printf ("%d", uri->enabled); frequency = g_strdup_printf ("%d", uri->publish_frequency); format = g_strdup_printf ("%d", uri->publish_format); xmlSetProp (root, (const guchar *)"location", (guchar *) uri->location); xmlSetProp (root, (const guchar *)"enabled", (guchar *) enabled); xmlSetProp (root, (const guchar *)"frequency", (guchar *) frequency); xmlSetProp (root, (const guchar *)"format", (guchar *) format); xmlSetProp (root, (const guchar *)"publish_time", (guchar *) uri->last_pub_time); g_free (format); format = g_strdup_printf ("%d", uri->fb_duration_value); xmlSetProp (root, (xmlChar *)"fb_duration_value", (xmlChar *) format); if (uri->fb_duration_type == FB_DURATION_DAYS) xmlSetProp (root, (xmlChar *)"fb_duration_type", (xmlChar *)"days"); else if (uri->fb_duration_type == FB_DURATION_MONTHS) xmlSetProp (root, (xmlChar *)"fb_duration_type", (xmlChar *)"months"); else xmlSetProp (root, (xmlChar *)"fb_duration_type", (xmlChar *)"weeks"); for (calendars = uri->events; calendars != NULL; calendars = g_slist_next (calendars)) { xmlNodePtr node; node = xmlNewChild (root, NULL, (const guchar *)"event", NULL); xmlSetProp (node, (const guchar *)"uid", calendars->data); } xmlDocSetRootElement (doc, root); xmlDocDumpMemory (doc, &xml_buffer, &xml_buffer_size); xmlFreeDoc (doc); returned_buffer = g_malloc (xml_buffer_size + 1); memcpy (returned_buffer, xml_buffer, xml_buffer_size); returned_buffer[xml_buffer_size] = '\0'; xmlFree (xml_buffer); g_free (enabled); g_free (frequency); g_free (format); return returned_buffer; }
int dialog_offline_body(str* body, str** offline_body) { xmlDocPtr doc= NULL; xmlNodePtr node; xmlErrorPtr xml_error; str* new_body = NULL; char *err_msg; int rc = OFFB_STATUS_ERROR; if (!offline_body) { LM_ERR("invalid parameter"); return OFFB_STATUS_ERROR; } *offline_body = NULL; doc= xmlParseMemory(body->s, body->len); if(doc== NULL) { GET_LAST_XML_ERROR(xml_error, err_msg); LM_ERR("xml memory parsing failed: %s\n", err_msg); goto done; } node= xmlDocGetNodeByName(doc, "dialog", NULL); if(node== NULL) { LM_DBG("no dialog nodes found"); rc = OFFB_STATUS_NO_DIALOG; goto done; } node= xmlNodeGetChildByName(node, "state"); if(node== NULL) { LM_ERR("while extracting state node\n"); goto done; } xmlNodeSetContent(node, (const unsigned char*)"terminated"); new_body = (str*)pkg_malloc(sizeof(str)); if(new_body == NULL) { LM_ERR("No more pkg memory"); goto done; } memset(new_body, 0, sizeof(str)); xmlDocDumpMemory(doc,(xmlChar**)(void*)&new_body->s, &new_body->len); *offline_body = new_body; rc = OFFB_STATUS_OK; done: if (doc) xmlFreeDoc(doc); return rc; }
int dialoginfo_process_body(struct publ_info* publ, str** fin_body, int ver, str* tuple) { xmlNodePtr node = NULL; xmlDocPtr doc = NULL; char* version; str* body = NULL; int len; doc = xmlParseMemory(publ->body->s, publ->body->len); if (doc == NULL) { LM_ERR("while parsing xml memory\n"); goto error; } /* change version */ node = doc->children; if (node == NULL) { LM_ERR("while extracting dialog-info node\n"); goto error; } version = int2str(ver, &len); version[len] = '\0'; if (!xmlNewProp(node, BAD_CAST "version", BAD_CAST version)) { LM_ERR("while setting version attribute\n"); goto error; } body = (str*)pkg_malloc(sizeof(str)); if (body == NULL) { LM_ERR("NO more memory left\n"); goto error; } memset(body, 0, sizeof(str)); xmlDocDumpMemory(doc, (xmlChar**)(void*)&body->s, &body->len); LM_DBG(">>> publish body: >%*s<\n", body->len, body->s); xmlFreeDoc(doc); *fin_body = body; if (*fin_body == NULL) LM_DBG("NULL fin_body\n"); xmlMemoryDump(); xmlCleanupParser(); return 1; error: if (doc) xmlFreeDoc(doc); if (body) pkg_free(body); xmlMemoryDump(); xmlCleanupParser(); return -1; }
void stats_sendxml(client_t *client) { int bytes; stats_event_t *event; stats_event_t *queue; xmlDocPtr doc; xmlNodePtr node, srcnode; int len; xmlChar *buff = NULL; source_xml_t *snd; source_xml_t *src_nodes = NULL; queue = NULL; _dump_stats_to_queue(&queue); doc = xmlNewDoc("1.0"); node = xmlNewDocNode(doc, NULL, "icestats", NULL); xmlDocSetRootElement(doc, node); event = _get_event_from_queue(&queue); while (event) { if (event->source == NULL) { xmlNewChild(node, NULL, event->name, event->value); } else { srcnode = _find_xml_node(event->source, &src_nodes, node); xmlNewChild(srcnode, NULL, event->name, event->value); } _free_event(event); event = _get_event_from_queue(&queue); } xmlDocDumpMemory(doc, &buff, &len); xmlFreeDoc(doc); client->respcode = 200; bytes = sock_write(client->con->sock, "HTTP/1.0 200 OK\r\n" "Content-Length: %d\r\n" "Content-Type: text/xml\r\n" "\r\n", len); if (bytes > 0) client->con->sent_bytes += bytes; else goto send_error; bytes = sock_write_bytes(client->con->sock, buff, len); if (bytes > 0) client->con->sent_bytes += bytes; send_error: while (src_nodes) { snd = src_nodes->next; free(src_nodes->mount); free(src_nodes); src_nodes = snd; } if (buff) xmlFree(buff); }
char* writeDocumentToString(Document *doc) { writeDocument(doc); // WARNING: Does not check for proper xmlChar* allocation xmlChar* out; int s; xmlDocDumpMemory(OUTPUT, &out, &s); cleanupSBOLWriter(); return (char *)out; }
/** * oseacomm_xml_build_message: * @object: the object to convert * * Builds a message from @object, returning a string with the generated xml message. * * Return value: xml message to be sent **/ OseaCommXmlMessage * oseacomm_xml_build_message (OseaCommXmlObject *object) { OseaCommXmlMessage *message; g_return_val_if_fail (object, FALSE); g_return_val_if_fail (object->doc, FALSE); message = g_new (OseaCommXmlMessage, 1); xmlDocDumpMemory (object->doc, (xmlChar **) &(message->content), &(message->len)); return message; }
void wi_p7_message_serialize(wi_p7_message_t *p7_message) { if(p7_message->serialization == WI_P7_XML) { if(p7_message->xml_buffer) { xmlFree(p7_message->xml_buffer); p7_message->xml_buffer = NULL; } xmlDocDumpMemory(p7_message->xml_doc, &p7_message->xml_buffer, &p7_message->xml_length); } }
void Local::Heap::save () const { xmlChar *buffer = NULL; int doc_size = 0; xmlDocDumpMemory (doc.get (), &buffer, &doc_size); contacts_settings->set_string (ROSTER_KEY, (const char *)buffer); xmlFree (buffer); }
void Local::Heap::save () const { xmlChar *buffer = NULL; int size = 0; xmlDocDumpMemory (doc.get (), &buffer, &size); gm_conf_set_string (KEY, (const char *)buffer); xmlFree (buffer); }
/* * call-seq: * serialize * * Serialize this document */ static VALUE serialize(VALUE self) { xmlDocPtr doc; xmlChar *buf; int size; Data_Get_Struct(self, xmlDoc, doc); xmlDocDumpMemory(doc, &buf, &size); VALUE rb_str = rb_str_new((char *)buf, (long)size); xmlFree(buf); return rb_str; }
void LM::Bank::save () const { xmlChar* buffer = NULL; int size = 0; xmlDocDumpMemory (doc, &buffer, &size); gm_conf_set_string (JABBER_KEY, (const char *)buffer); xmlFree (buffer); }
void RL::Cluster::save () const { xmlChar* buffer = NULL; int bsize = 0; xmlDocDumpMemory (doc.get (), &buffer, &bsize); contacts_settings->set_string (RL_KEY, (const char *)buffer); xmlFree (buffer); }
void OPENLDAP::Source::save () { xmlChar *buffer = NULL; int size = 0; xmlDocDumpMemory (doc, &buffer, &size); gm_conf_set_string (KEY, (const char *)buffer); xmlFree (buffer); }
static void gda_web_pstmt_dispose (GObject *object) { GdaWebPStmt *pstmt = (GdaWebPStmt *) object; g_return_if_fail (GDA_IS_PSTMT (pstmt)); GdaWebPStmtPrivate *priv = gda_web_pstmt_get_instance_private (pstmt); if (priv->pstmt_hash) { GdaConnection *cnc = NULL; WebConnectionData *cdata; cnc = g_weak_ref_get (&priv->cnc); if (cnc != NULL) { cdata = (WebConnectionData*) gda_connection_internal_get_provider_data_error (cnc, NULL); if (!cdata) goto next; /* send command to deallocate prepared statement */ xmlDocPtr doc; xmlNodePtr root, cmdnode; gchar *token; doc = xmlNewDoc (BAD_CAST "1.0"); root = xmlNewNode (NULL, BAD_CAST "request"); xmlDocSetRootElement (doc, root); token = _gda_web_compute_token (cdata); xmlNewChild (root, NULL, BAD_CAST "token", BAD_CAST token); g_free (token); cmdnode = xmlNewChild (root, NULL, BAD_CAST "cmd", BAD_CAST "UNPREPARE"); xmlNewChild (cmdnode, NULL, BAD_CAST "preparehash", BAD_CAST priv->pstmt_hash); xmlChar *cmde; xmlDocPtr replydoc; int size; gchar status; xmlDocDumpMemory (doc, &cmde, &size); xmlFreeDoc (doc); replydoc = _gda_web_send_message_to_frontend (cnc, cdata, MESSAGE_UNPREPARE, (gchar*) cmde, cdata->key, &status); xmlFree (cmde); if (replydoc) xmlFreeDoc (replydoc); } next: /* free memory */ g_free (priv->pstmt_hash); } /* chain to parent class */ G_OBJECT_CLASS (gda_web_pstmt_parent_class)->finalize (object); }
char * ofcds_getconfig(void *UNUSED(data), NC_DATASTORE target, struct nc_err **error) { xmlChar *config_data = NULL; switch (target) { case NC_DATASTORE_RUNNING: /* If there is no id of the capable-switch (no configuration data were * provided), continue as there is no OVSDB */ return ofc_get_config_data(); case NC_DATASTORE_STARTUP: if (!gds_startup) { config_data = xmlStrdup(BAD_CAST ""); } else { xmlDocDumpMemory(gds_startup, &config_data, NULL); } break; case NC_DATASTORE_CANDIDATE: if (!gds_cand) { config_data = xmlStrdup(BAD_CAST ""); } else { xmlDocDumpMemory(gds_cand, &config_data, NULL); } break; default: nc_verb_error("Invalid <get-config> source."); *error = nc_err_new(NC_ERR_BAD_ELEM); nc_err_set(*error, NC_ERR_PARAM_INFO_BADELEM, "source"); } return (char *) config_data; }