Changeset 2471
- Timestamp:
- 08/19/07 03:21:16 (1 year ago)
- Files:
-
- plugins/opie-sync/src/opie_xml.c (modified) (1 diff)
- plugins/opie-sync/src/opie_xml.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/opie-sync/src/opie_xml.c
r2466 r2471 416 416 } 417 417 418 int opie_xml_save_to_fd(xmlDoc *doc, int fd) {419 if (ftruncate(fd, 0) == -1) {420 perror("ftruncate");421 }422 423 xmlOutputBuffer *buf = xmlOutputBufferCreateFd(fd, NULL);424 /* Prevent the fd from being closed after writing */425 buf->closecallback = NULL;426 /* Write the XML */427 int bytes = xmlSaveFormatFileTo(buf, doc, NULL, 1);428 return bytes;429 }430 431 418 char *opie_xml_category_name_to_id(xmlDoc *categories_doc, xmlNode *categories_node, const char *name) { 432 419 xmlNode *category_node = categories_node->xmlChildrenNode; plugins/opie-sync/src/opie_xml.h
r2461 r2471 51 51 char *opie_xml_get_uid(xmlNode *node); 52 52 void opie_xml_set_uid(xmlNode *node, const char *uid); 53 int opie_xml_save_to_fd(xmlDoc *doc, int fd);54 53 void opie_xml_category_ids_to_names(xmlDoc *categories_doc, xmlNode *change_node); 55 54 void opie_xml_category_names_to_ids(xmlDoc *categories_doc, xmlNode *change_node);
