Set up the fonctions comment block, boring but useful, Daniel.
diff --git a/SAX.c b/SAX.c
index b3583cf..4732cd8 100644
--- a/SAX.c
+++ b/SAX.c
@@ -1,5 +1,7 @@
/*
* SAX.c : Default SAX handler to build a tree.
+ *
+ * Daniel Veillard <Daniel.Veillard@w3.org>
*/
#include <stdio.h>
@@ -10,31 +12,60 @@
/* #define DEBUG_SAX */
-/*
+/**
+ * getPublicId:
+ * @ctxt: An XML parser context
+ *
* Return the public ID e.g. "-//SGMLSOURCE//DTD DEMO//EN"
+ *
+ * return values: a CHAR *
*/
-const CHAR *getPublicId(xmlParserCtxtPtr ctxt) {
+const CHAR *
+getPublicId(xmlParserCtxtPtr ctxt)
+{
return(NULL);
}
-/*
+/**
+ * getSystemId:
+ * @ctxt: An XML parser context
+ *
* Return the system ID, basically URI or filename e.g.
- * http://www.sgmlsource.com/dtds/memo.dtd
+ * http://www.sgmlsource.com/dtds/memo.dtd
+ *
+ * return values: a CHAR *
*/
-const CHAR *getSystemId(xmlParserCtxtPtr ctxt) {
+const CHAR *
+getSystemId(xmlParserCtxtPtr ctxt)
+{
return(ctxt->input->filename);
}
-/*
+/**
+ * getLineNumber:
+ * @ctxt: An XML parser context
+ *
* Return the line number of the current parsing point.
+ *
+ * return values: an int
*/
-int getLineNumber(xmlParserCtxtPtr ctxt) {
+int
+getLineNumber(xmlParserCtxtPtr ctxt)
+{
return(ctxt->input->line);
}
-/*
+
+/**
+ * getColumnNumber:
+ * @ctxt: An XML parser context
+ *
* Return the column number of the current parsing point.
+ *
+ * return values: an int
*/
-int getColumnNumber(xmlParserCtxtPtr ctxt) {
+int
+getColumnNumber(xmlParserCtxtPtr ctxt)
+{
return(ctxt->input->col);
}
@@ -46,12 +77,20 @@
getPublicId, getSystemId, getLineNumber, getColumnNumber
};
-/*
+/**
+ * resolveEntity:
+ * @ctxt: An XML parser context
+ * @publicId: The public ID of the entity
+ * @systemId: The system ID of the entity
+ *
* Special entity resolver, better left to the parser, it has
* more context than the application layer.
+ *
+ * return values: an int
*/
-xmlParserInputPtr resolveEntity(xmlParserCtxtPtr ctxt,
- const CHAR *publicId, const CHAR *systemId) {
+xmlParserInputPtr
+resolveEntity(xmlParserCtxtPtr ctxt, const CHAR *publicId, const CHAR *systemId)
+{
#ifdef DEBUG_SAX
fprintf(stderr, "SAX.resolveEntity(%s, %s)\n", publicId, systemId);
@@ -59,63 +98,114 @@
return(NULL);
}
-/*
+/**
+ * notationDecl:
+ * @ctxt: An XML parser context
+ * @name: The name of the notation
+ * @publicId: The public ID of the entity
+ * @systemId: The system ID of the entity
+ *
* What to do when a notation declaration has been parsed.
* TODO Not handled currently.
+ *
+ * return values:
*/
-void notationDecl(xmlParserCtxtPtr ctxt, const CHAR *name,
- const CHAR *publicId, const CHAR *systemId) {
+void
+notationDecl(xmlParserCtxtPtr ctxt, const CHAR *name,
+ const CHAR *publicId, const CHAR *systemId)
+{
#ifdef DEBUG_SAX
fprintf(stderr, "SAX.notationDecl(%s, %s, %s)\n", name, publicId, systemId);
#endif
}
-/*
+/**
+ * unparsedEntityDecl:
+ * @ctxt: An XML parser context
+ * @name: The name of the entity
+ * @publicId: The public ID of the entity
+ * @systemId: The system ID of the entity
+ * @notationName: the name of the notation
+ *
* What to do when an unparsed entity declaration is parsed
* TODO Create an Entity node.
+ *
+ * return values:
*/
-void unparsedEntityDecl(xmlParserCtxtPtr ctxt, const CHAR *name,
- const CHAR *publicId, const CHAR *systemId,
- const CHAR *notationName) {
+void
+unparsedEntityDecl(xmlParserCtxtPtr ctxt, const CHAR *name,
+ const CHAR *publicId, const CHAR *systemId,
+ const CHAR *notationName)
+{
#ifdef DEBUG_SAX
fprintf(stderr, "SAX.unparsedEntityDecl(%s, %s, %s, %s)\n",
name, publicId, systemId, notationName);
#endif
}
-/*
+/**
+ * setDocumentLocator:
+ * @ctxt: An XML parser context
+ * @loc: A SAX Locator
+ *
* Receive the document locator at startup, actually xmlDefaultSAXLocator
* Everything is available on the context, so this is useless in our case.
+ *
+ * return values:
*/
-void setDocumentLocator(xmlParserCtxtPtr ctxt, xmlSAXLocatorPtr loc) {
+void
+setDocumentLocator(xmlParserCtxtPtr ctxt, xmlSAXLocatorPtr loc)
+{
#ifdef DEBUG_SAX
fprintf(stderr, "SAX.setDocumentLocator()\n");
#endif
}
-/*
+/**
+ * startDocument:
+ * @ctxt: An XML parser context
+ *
* called when the document start being processed.
+ *
+ * return values:
*/
-void startDocument(xmlParserCtxtPtr ctxt) {
+void
+startDocument(xmlParserCtxtPtr ctxt)
+{
#ifdef DEBUG_SAX
fprintf(stderr, "SAX.startDocument()\n");
#endif
}
-/*
+/**
+ * endDocument:
+ * @ctxt: An XML parser context
+ *
* called when the document end has been detected.
+ *
+ * return values:
*/
-void endDocument(xmlParserCtxtPtr ctxt) {
+void
+endDocument(xmlParserCtxtPtr ctxt)
+{
#ifdef DEBUG_SAX
fprintf(stderr, "SAX.endDocument()\n");
#endif
}
-/*
+/**
+ * startElement:
+ * @ctxt: An XML parser context
+ * @name: The element name
+ *
* called when an opening tag has been processed.
* TODO We currently have a small pblm with the arguments ...
+ *
+ * return values:
*/
-void startElement(xmlParserCtxtPtr ctxt, const CHAR *name) {
+void
+startElement(xmlParserCtxtPtr ctxt, const CHAR *name)
+{
xmlNodePtr parent;
#ifdef DEBUG_SAX
@@ -128,21 +218,38 @@
}
-/*
+/**
+ * endElement:
+ * @ctxt: An XML parser context
+ * @name: The element name
+ *
* called when the end of an element has been detected.
+ *
+ * return values:
*/
-void endElement(xmlParserCtxtPtr ctxt, const CHAR *name) {
+void
+endElement(xmlParserCtxtPtr ctxt, const CHAR *name)
+{
#ifdef DEBUG_SAX
fprintf(stderr, "SAX.endElement(%s)\n", name);
#endif
}
-/*
+/**
+ * characters:
+ * @ctxt: An XML parser context
+ * @ch: a CHAR string
+ * @start: the first char in the string
+ * @len: the number of CHAR
+ *
* receiving some chars from the parser.
* Question: how much at a time ???
+ *
+ * return values:
*/
-void characters(xmlParserCtxtPtr ctxt, const CHAR *ch,
- int start, int len) {
+void
+characters(xmlParserCtxtPtr ctxt, const CHAR *ch, int start, int len)
+{
xmlNodePtr lastChild;
#ifdef DEBUG_SAX
@@ -167,22 +274,41 @@
}
}
-/*
+/**
+ * ignorableWhitespace:
+ * @ctxt: An XML parser context
+ * @ch: a CHAR string
+ * @start: the first char in the string
+ * @len: the number of CHAR
+ *
* receiving some ignorable whitespaces from the parser.
* Question: how much at a time ???
+ *
+ * return values:
*/
-void ignorableWhitespace(xmlParserCtxtPtr ctxt, const CHAR *ch,
- int start, int len) {
+void
+ignorableWhitespace(xmlParserCtxtPtr ctxt, const CHAR *ch, int start, int len)
+{
#ifdef DEBUG_SAX
fprintf(stderr, "SAX.ignorableWhitespace(%.30s, %d, %d)\n", ch, start, len);
#endif
}
-/*
- * A processing instruction has beem parsed.
+/**
+ * processingInstruction:
+ * @ctxt: An XML parser context
+ * @target: the target name
+ * @data: the PI data's
+ * @len: the number of CHAR
+ *
+ * A processing instruction has been parsed.
+ *
+ * return values:
*/
-void processingInstruction(xmlParserCtxtPtr ctxt, const CHAR *target,
- const CHAR *data) {
+void
+processingInstruction(xmlParserCtxtPtr ctxt, const CHAR *target,
+ const CHAR *data)
+{
#ifdef DEBUG_SAX
fprintf(stderr, "SAX.processingInstruction(%s, %s)\n", target, data);
#endif
@@ -205,7 +331,16 @@
xmlParserError,
};
-void xmlDefaultSAXHandlerInit(void) {
+/**
+ * xmlDefaultSAXHandlerInit:
+ *
+ * Initialize the default SAX handler
+ *
+ * return values:
+ */
+void
+xmlDefaultSAXHandlerInit(void)
+{
xmlDefaultSAXHandler.resolveEntity = resolveEntity;
xmlDefaultSAXHandler.notationDecl = notationDecl;
xmlDefaultSAXHandler.unparsedEntityDecl = unparsedEntityDecl;