From be1d13c7911cf7936578b96a2e9c92dd3ffac754 Mon Sep 17 00:00:00 2001 From: CaS Date: Tue, 18 Dec 2001 11:09:38 +0000 Subject: [PATCH] Various fizes git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11805 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 +++- Source/GSXML.m | 24 ++++++++----- Tools/AGSHtml.h | 4 +-- Tools/AGSHtml.m | 4 +-- Tools/AGSIndex.h | 4 +-- Tools/AGSIndex.m | 4 +-- Tools/AGSOutput.h | 5 +-- Tools/AGSOutput.m | 7 ++-- Tools/AGSParser.h | 16 ++++++--- Tools/AGSParser.m | 4 +-- Tools/autogsdoc.m | 83 +++++++++++++++++++++++++++++++++---------- Tools/gsdoc-0_6_7.dtd | 2 +- 12 files changed, 114 insertions(+), 49 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6b480e895..a732dd7cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2001-12-18 Richard Frith-Macdonald + * Source/GSXML.m: Bugfixes in setting parse behavior ... now turns + on validation properly. * Tools/gsdoc-0_6_7.dtd: added 'scope' to index element and added a 'title' type to list files in a project. * Tools/AGSHtml.h: @@ -8,7 +10,9 @@ element with both file and project scope. * Tools/autogsdoc.m: Clean up a little and handle gsdoc files listed as source files better .... now looks for them in the - source directory. + source directory. Added automatic generation of an 'index' file + for a project where the first source file listed in the project + is not a gsdoc file. 2001-12-17 Richard Frith-Macdonald diff --git a/Source/GSXML.m b/Source/GSXML.m index a18c22abe..f2026fd84 100644 --- a/Source/GSXML.m +++ b/Source/GSXML.m @@ -1354,26 +1354,32 @@ static NSString *endMarker = @"At end of incremental parse"; - (BOOL) substituteEntities: (BOOL)yesno { - BOOL result = ((xmlParserCtxtPtr)lib)->replaceEntities ? YES : NO; + int oldVal; + int newVal = (yesno == YES) ? 1 : 0; - ((xmlParserCtxtPtr)lib)->replaceEntities = (yesno == YES) ? 1 : 0; - return result; + xmlGetFeature((xmlParserCtxtPtr)lib, "substitute entities", (void*)&oldVal); + xmlSetFeature((xmlParserCtxtPtr)lib, "substitute entities", (void*)&newVal); + return (oldVal == 1) ? YES : NO; } - (BOOL) keepBlanks: (BOOL)yesno { - BOOL result = ((xmlParserCtxtPtr)lib)->keepBlanks ? YES : NO; + int oldVal; + int newVal = (yesno == YES) ? 1 : 0; - ((xmlParserCtxtPtr)lib)->keepBlanks = (yesno == YES) ? 1 : 0; - return result; + xmlGetFeature((xmlParserCtxtPtr)lib, "keep blanks", (void*)&oldVal); + xmlSetFeature((xmlParserCtxtPtr)lib, "keep blanks", (void*)&newVal); + return (oldVal == 1) ? YES : NO; } - (BOOL) doValidityChecking: (BOOL)yesno { - BOOL result = ((xmlParserCtxtPtr)lib)->validate ? YES : NO; + int oldVal; + int newVal = (yesno == YES) ? 1 : 0; - ((xmlParserCtxtPtr)lib)->validate = (yesno == YES) ? 1 : 0; - return result; + xmlGetFeature((xmlParserCtxtPtr)lib, "validate", (void*)&oldVal); + xmlSetFeature((xmlParserCtxtPtr)lib, "validate", (void*)&newVal); + return (oldVal == 1) ? YES : NO; } - (BOOL) getWarnings: (BOOL)yesno diff --git a/Tools/AGSHtml.h b/Tools/AGSHtml.h index e8f041a92..7c96c3f3c 100644 --- a/Tools/AGSHtml.h +++ b/Tools/AGSHtml.h @@ -10,13 +10,13 @@ This file is part of the GNUstep Project - This library is free software; you can redistribute it and/or + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. You should have received a copy of the GNU General Public - License along with this library; see the file COPYING.LIB. + License along with this program; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index 4e4745557..fbf9fdfa8 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -8,13 +8,13 @@ This file is part of the GNUstep Project - This library is free software; you can redistribute it and/or + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. You should have received a copy of the GNU General Public - License along with this library; see the file COPYING.LIB. + License along with this program; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. diff --git a/Tools/AGSIndex.h b/Tools/AGSIndex.h index d99e649a7..1e9e7aab1 100644 --- a/Tools/AGSIndex.h +++ b/Tools/AGSIndex.h @@ -10,13 +10,13 @@ This file is part of the GNUstep Project - This library is free software; you can redistribute it and/or + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. You should have received a copy of the GNU General Public - License along with this library; see the file COPYING.LIB. + License along with this program; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. diff --git a/Tools/AGSIndex.m b/Tools/AGSIndex.m index fd6ccd693..f02fd0560 100644 --- a/Tools/AGSIndex.m +++ b/Tools/AGSIndex.m @@ -8,13 +8,13 @@ This file is part of the GNUstep Project - This library is free software; you can redistribute it and/or + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. You should have received a copy of the GNU General Public - License along with this library; see the file COPYING.LIB. + License along with this program; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. diff --git a/Tools/AGSOutput.h b/Tools/AGSOutput.h index 970c07d24..5b22c689e 100644 --- a/Tools/AGSOutput.h +++ b/Tools/AGSOutput.h @@ -10,12 +10,13 @@ This file is part of the GNUstep Project - This library is free software; you can redistribute it and/or + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. + You should have received a copy of the GNU General Public - License along with this library; see the file COPYING.LIB. + License along with this program; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. diff --git a/Tools/AGSOutput.m b/Tools/AGSOutput.m index 5eeba5344..8487a7fed 100644 --- a/Tools/AGSOutput.m +++ b/Tools/AGSOutput.m @@ -8,13 +8,13 @@ This file is part of the GNUstep Project - This library is free software; you can redistribute it and/or + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. You should have received a copy of the GNU General Public - License along with this library; see the file COPYING.LIB. + License along with this program; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -254,7 +254,8 @@ static BOOL snuggleStart(NSString *t) } else { - [str appendString: @"Automatically generated documentation"]; + [str appendFormat: @"%@ autogsdoc generated documentation", + [info objectForKey: @"base"]]; } [str appendString: @"\n"]; } diff --git a/Tools/AGSParser.h b/Tools/AGSParser.h index 4753d364d..7eb79b47f 100644 --- a/Tools/AGSParser.h +++ b/Tools/AGSParser.h @@ -10,22 +10,28 @@ This file is part of the GNUstep Project - This library is free software; you can redistribute it and/or + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. You should have received a copy of the GNU General Public - License along with this library; see the file COPYING.LIB. + License along with this program; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + This is the AGSParser class ... and some autogsdoc examples. - The AGSParser class is designed to produce a property-list - which can be handled by AGSOutput ... one class is not much - use without the other. + + AGSParser front page +

+ The AGSParser class is designed to produce a property-list + which can be handled by AGSOutput ... one class is not much + use without the other. +

+
*/ diff --git a/Tools/AGSParser.m b/Tools/AGSParser.m index 951003b72..dc69a22ed 100644 --- a/Tools/AGSParser.m +++ b/Tools/AGSParser.m @@ -8,13 +8,13 @@ This file is part of the GNUstep Project - This library is free software; you can redistribute it and/or + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. You should have received a copy of the GNU General Public - License along with this library; see the file COPYING.LIB. + License along with this program; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. diff --git a/Tools/autogsdoc.m b/Tools/autogsdoc.m index 61e8d166e..c1edc179a 100644 --- a/Tools/autogsdoc.m +++ b/Tools/autogsdoc.m @@ -8,13 +8,13 @@ This file is part of the GNUstep Project - This library is free software; you can redistribute it and/or + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. You should have received a copy of the GNU General Public - License along with this library; see the file COPYING.LIB. + License along with this program; see the file COPYING.LIB. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. @@ -262,13 +262,16 @@
Inter-document linkage

- When supplied with a list of documents to process, the tool will - set up linkage between documents using the gsdoc 'prev', 'next', - and 'up' attributes. + When supplied with a list of files to process, the tool will + set up linkage between resulting documents using the gsdoc + 'prev', 'next', and 'up' attributes.

- The first document processed will be the 'up' link for all - subsequent documents. + If the first file listed on the command line is a gsdoc document, + it will be assumed to be the 'top' document and will be referenced + in the 'up' link for all subsequent documents.
+ Otherwise, autogsdoc will generate an index file called 'index.gsdoc' + which will be used as the 'top' file.

The 'prev' and 'next' links will be set up to link the documents @@ -313,6 +316,7 @@ main(int argc, char **argv, char **env) NSString *up = nil; NSString *prev = nil; BOOL showDependencies = YES; + BOOL haveAutoIndex = NO; CREATE_AUTORELEASE_POOL(outer); CREATE_AUTORELEASE_POOL(pool); @@ -566,6 +570,47 @@ main(int argc, char **argv, char **env) } } + if (up == nil) + { + if (isDocumentation == YES) + { + ASSIGN(up, file); + } + else + { + NSString *upFile = [documentationDirectory + stringByAppendingPathComponent: @"index.gsdoc"]; + + if ([mgr isReadableFileAtPath: upFile] == NO) + { + NSString *upString = [NSString stringWithFormat: + @"\n" + @"\n" + @"\n" + @" \n" + @" %@ project reference\n" + @" \n" + @" \n" + @" \n" + @" \n" + @" \n" + @" \n" + @" \n" + @"\n", + file, project]; + + if ([upString writeToFile: upFile atomically: YES] == NO) + { + NSLog(@"Unable to write %@", upFile); + } + } + haveAutoIndex = YES; + ASSIGN(up, @"index"); + } + } + if (isDocumentation == NO) { /* @@ -638,14 +683,7 @@ main(int argc, char **argv, char **env) * Set up linkage for this file. */ [[parser info] setObject: file forKey: @"base"]; - if (up == nil) - { - ASSIGN(up, file); - } - else - { - [[parser info] setObject: up forKey: @"up"]; - } + [[parser info] setObject: up forKey: @"up"]; if (prev != nil) { [[parser info] setObject: prev forKey: @"prev"]; @@ -740,13 +778,22 @@ main(int argc, char **argv, char **env) } /* - * accumulate project index info into global index + * Accumulate project index info into global index */ [indexer mergeRefs: [prjRefs refs] override: YES]; - for (i = 1; i < [args count]; i++) + for (i = (haveAutoIndex ? 0 : 1); i < [args count]; i++) { - NSString *arg = [args objectAtIndex: i]; + NSString *arg; + + if (i == 0) + { + arg = @"index.gsdoc"; // Auto generated. + } + else + { + arg = [args objectAtIndex: i]; + } if ([arg hasPrefix: @"-"]) { diff --git a/Tools/gsdoc-0_6_7.dtd b/Tools/gsdoc-0_6_7.dtd index fbaae6b0f..a0df3e203 100644 --- a/Tools/gsdoc-0_6_7.dtd +++ b/Tools/gsdoc-0_6_7.dtd @@ -496,7 +496,7 @@