From 58712ee6fc47965e37cfacbaf8d6039854350473 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Tue, 5 May 2009 05:08:43 +0000 Subject: [PATCH] Add --tokens option. --- doc/mxmldoc.man | 25 ++++++++++++++++++------- mxmldoc.c | 19 +++++++++++++++++++ 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/doc/mxmldoc.man b/doc/mxmldoc.man index f9c944d..7f5304c 100644 --- a/doc/mxmldoc.man +++ b/doc/mxmldoc.man @@ -3,7 +3,7 @@ .\" .\" mxmldoc man page for mini-XML, a small XML-like file parsing library. .\" -.\" Copyright 2003-2008 by Michael Sweet. +.\" Copyright 2003-2009 by Michael Sweet. .\" .\" This program is free software; you can redistribute it and/or .\" modify it under the terms of the GNU Library General Public @@ -15,7 +15,7 @@ .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" -.TH mxmldoc 1 "Mini-XML" "28 November 2008" "Michael Sweet" +.TH mxmldoc 1 "Mini-XML" "4 May 2009" "Michael Sweet" .SH NAME mxmldoc \- mini-xml documentation generator .SH SYNOPSIS @@ -45,9 +45,9 @@ mxmldoc \- mini-xml documentation generator .I filename.html .br .B mxmldoc -[ \-\-docset +\-\-docset .I directory.docset -] [ \-\-docversion +[ \-\-docversion .I version ] [ \-\-feedname .I name @@ -70,10 +70,17 @@ mxmldoc \- mini-xml documentation generator ] .br .B mxmldoc +\-\-tokens [ +.I filename.xml +] [ +.I source file(s) +] > tokens.xml +.br +.B mxmldoc +\-\-framed +.I basename [ \-\-footer .I footerfile -] [ \-\-framed -.I basename ] [ \-\-header .I headerfile ] [ \-\-intro @@ -176,10 +183,14 @@ Sets the section/keywords in the output documentation. \-\-title title .br Sets the title of the output documentation. +.TP 5 +\-\-tokens +.br +Generates a Tokens.xml file for use with the Xcode documentation tools. .SH SEE ALSO mxml(3), Mini-XML Programmers Manual, http://www.minixml.org/ .SH COPYRIGHT -Copyright 2003-2008 by Michael Sweet. +Copyright 2003-2009 by Michael Sweet. .\" .\" End of "$Id$". .\" diff --git a/mxmldoc.c b/mxmldoc.c index 7017c74..6d4d83b 100644 --- a/mxmldoc.c +++ b/mxmldoc.c @@ -158,6 +158,8 @@ extern char **environ; #define OUTPUT_HTML 1 /* Output HTML */ #define OUTPUT_XML 2 /* Output XML */ #define OUTPUT_MAN 3 /* Output nroff/man */ +#define OUTPUT_TOKENS 4 /* Output docset Tokens.xml file */ + /* * Local functions... @@ -420,6 +422,14 @@ main(int argc, /* I - Number of command-line args */ else usage(NULL); } + else if (!strcmp(argv[i], "--tokens")) + { + /* + * Output Tokens.xml file... + */ + + mode = OUTPUT_TOKENS; + } else if (argv[i][0] == '-') { /* @@ -572,6 +582,15 @@ main(int argc, /* I - Number of command-line args */ write_man(name, section, title, footerfile, headerfile, introfile, mxmldoc); break; + + case OUTPUT_TOKENS : + fputs("\n" + "\n", stdout); + + write_tokens(stdout, mxmldoc); + + fputs("\n", stdout); + break; } /*