int main() { struct stud_node *head; int min_score; head=Creat_Stu_Doc(); scanf("%d",&min_score); head=DeleteDoc(head,min_score); Ptrint_Stu_Doc(head); return 0; }
bool XMLInOut::SetupDoc(void) { DeleteDoc(); /* Create a new XML buffer, to which the XML document will be * written */ buf = xmlBufferCreate(); if (buf == NULL) { cout << "testXmlwriterMemory: Error creating the xml buffer\n" << endl; return false; } /* Create a new XmlWriter for memory, with no compression. * Remark: there is no compression for this kind of xmlTextWriter */ writer = xmlNewTextWriterMemory(buf, 0); if (writer == NULL) { cout << "testXmlwriterMemory: Error creating the xml writer\n" << endl; return false; } if (xmlTextWriterSetIndent(writer, 1) < 0) return false; /* Start the document with the xml default for the version, * encoding ISO 8859-1 and the default for the standalone * declaration. */ /* rc = xmlTextWriterStartDocument(writer, NULL, "ISO-8859-1", NULL); if (rc < 0) { printf ("testXmlwriterMemory: Error at xmlTextWriterStartDocument\n"); return false; } */ if (AddElement("neuron-brain") < 0) return false; if (AddElement("MACROGROUP") < 0) return false; // Important addition. When doing a MarkSection(), the # bytes wont be valid for what your // intuition tells you. The above <MACROGROUP> at this stage isn't closed due to possible // content and attributes. The comment forces things to "end" making the buffer ok for marking. if (AddComment("The Real Group of commands starts here.") < 0) return false; MarkSection(); return true; }
/* Delete a chain of WordNodes at a certain WordNode of hash table * @toDeleteHead: the head of the chain of WordNodes at a index * @result: Returns 1 if the delete is successful, and 0 if not. */ int DeleteDocChain(DocNode *docDeleteHead){ while(docDeleteHead){ docDeleteHead = DeleteDoc(docDeleteHead); } return 1; }
XMLInOut::~XMLInOut() { DeleteDoc(); }