mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
*** empty log message ***
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11131 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
fe43e94318
commit
fa8bf26a94
7 changed files with 108 additions and 22 deletions
|
@ -113,7 +113,7 @@ ReturnTypeEqualsReturnType (vacallReturnTypeInfo *a, vacallReturnTypeInfo *b)
|
|||
#define GSI_MAP_RELEASE_KEY(X) ;
|
||||
#define GSI_MAP_RELEASE_VAL(X) ;
|
||||
|
||||
#import <base/GSIMap.h>
|
||||
#include <base/GSIMap.h>
|
||||
|
||||
/* This determines the number of precomputed
|
||||
callback data entries. The list is indexed
|
||||
|
|
|
@ -22,11 +22,11 @@
|
|||
*/
|
||||
|
||||
#include "config.h"
|
||||
#import <base/preface.h>
|
||||
#import <Foundation/NSProtocolChecker.h>
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSInvocation.h>
|
||||
#import <Foundation/NSMethodSignature.h>
|
||||
#include <base/preface.h>
|
||||
#include <Foundation/NSProtocolChecker.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSInvocation.h>
|
||||
#include <Foundation/NSMethodSignature.h>
|
||||
|
||||
@implementation NSProtocolChecker
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#import <Foundation/Foundation.h>
|
||||
#import <objc/Protocol.h>
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <objc/Protocol.h>
|
||||
|
||||
@interface Foo: NSObject
|
||||
{
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
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.
|
||||
If not, write to the Free Software Foundation,
|
||||
|
@ -31,6 +30,7 @@
|
|||
NSCharacterSet *spacenl; // Blanks excluding newline
|
||||
}
|
||||
|
||||
- (NSString*) output: (NSDictionary*)d;
|
||||
- (BOOL) output: (NSDictionary*)d file: (NSString*)name;
|
||||
- (void) outputMethod: (NSDictionary*)d to: (NSMutableString*)str;
|
||||
- (void) outputUnit: (NSDictionary*)d to: (NSMutableString*)str;
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
return self;
|
||||
}
|
||||
|
||||
- (BOOL) output: (NSDictionary*)d file: (NSString*)name
|
||||
- (NSString*) output: (NSDictionary*)d
|
||||
{
|
||||
NSMutableString *str = [NSMutableString stringWithCapacity: 10240];
|
||||
NSDictionary *classes;
|
||||
|
@ -260,6 +260,12 @@
|
|||
|
||||
[str appendString: @" </body>\n"];
|
||||
[str appendString: @"</gsdoc>\n"];
|
||||
return str;
|
||||
}
|
||||
|
||||
- (BOOL) output: (NSDictionary*)d file: (NSString*)name
|
||||
{
|
||||
NSString *str = [self output: d];
|
||||
|
||||
return [str writeToFile: name atomically: YES];
|
||||
}
|
||||
|
@ -814,19 +820,59 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* We want param=value sequences to be standardised to
|
||||
* not have spaces around the equals sign.
|
||||
*/
|
||||
if (*ptr == '=')
|
||||
{
|
||||
elideSpace = YES;
|
||||
if (optr[-1] == ' ')
|
||||
{
|
||||
optr--;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
elideSpace = NO;
|
||||
}
|
||||
*optr++ = *ptr++;
|
||||
elideSpace = NO;
|
||||
}
|
||||
}
|
||||
if (*ptr == '>')
|
||||
{
|
||||
/*
|
||||
* remove space immediately before closing bracket.
|
||||
*/
|
||||
if (optr[-1] == ' ')
|
||||
{
|
||||
optr--;
|
||||
}
|
||||
*optr++ = *ptr++;
|
||||
}
|
||||
if (optr != buf)
|
||||
{
|
||||
NSString *tmp;
|
||||
|
||||
tmp = [NSString stringWithCharacters: buf length: ptr - buf];
|
||||
/*
|
||||
* Ensure that elements with no content ('/>' endings)
|
||||
* are standardised to have a space before their terminators.
|
||||
*/
|
||||
if (optr[-2] == '/' && optr[-3] != ' ')
|
||||
{
|
||||
unsigned len = ptr - buf;
|
||||
unichar c[len + 1];
|
||||
|
||||
memcpy(c, buf, (len+1)*sizeof(unichar));
|
||||
c[len-2] = ' ';
|
||||
c[len-1] = '/';
|
||||
c[len] = '>';
|
||||
tmp = [NSString stringWithCharacters: c length: len+1];
|
||||
}
|
||||
else
|
||||
{
|
||||
tmp = [NSString stringWithCharacters: buf length: ptr - buf];
|
||||
}
|
||||
[a addObject: tmp];
|
||||
}
|
||||
buf = ptr;
|
||||
|
|
|
@ -139,6 +139,13 @@
|
|||
#include "AGSParser.h"
|
||||
#include "AGSOutput.h"
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#if HAVE_LIBXML
|
||||
#include <Foundation/GSXML.h>
|
||||
|
||||
static int XML_ELEMENT_NODE;
|
||||
#endif
|
||||
|
||||
int
|
||||
main(int argc, char **argv, char **env)
|
||||
|
@ -191,6 +198,7 @@ main(int argc, char **argv, char **env)
|
|||
NSString *ddir;
|
||||
NSString *sdir;
|
||||
NSString *file;
|
||||
NSString *generated;
|
||||
|
||||
file = [[arg lastPathComponent] stringByDeletingPathExtension];
|
||||
|
||||
|
@ -229,7 +237,39 @@ main(int argc, char **argv, char **env)
|
|||
[parser parseFile: sdir isSource: YES];
|
||||
}
|
||||
|
||||
[output output: [parser info] file: ddir];
|
||||
generated = [output output: [parser info]];
|
||||
|
||||
#if HAVE_LIBXML
|
||||
{
|
||||
NSData *data;
|
||||
GSXMLParser *parser;
|
||||
|
||||
/*
|
||||
* Cache XML node information.
|
||||
*/
|
||||
XML_ELEMENT_NODE
|
||||
= [GSXMLNode typeFromDescription: @"XML_ELEMENT_NODE"];
|
||||
|
||||
data = [generated dataUsingEncoding: NSUTF8StringEncoding];
|
||||
parser = [GSXMLParser parser];
|
||||
[parser substituteEntities: YES];
|
||||
[parser doValidityChecking: YES];
|
||||
if ([parser parse: data] == NO || [parser parse: nil] == NO)
|
||||
{
|
||||
NSLog(@"WARNING %@ did not produce a valid document", arg);
|
||||
}
|
||||
if (![[[[parser doc] root] name] isEqualToString: @"gsdoc"])
|
||||
{
|
||||
NSLog(@"not a gsdoc document - because name node is %@",
|
||||
[[[parser doc] root] name]);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if ([generated writeToFile: ddir atomically: YES] == NO)
|
||||
{
|
||||
NSLog(@"Sorry unable to write %@", ddir);
|
||||
}
|
||||
}
|
||||
else if ([arg hasSuffix: @".m"])
|
||||
{
|
||||
|
|
|
@ -18,15 +18,15 @@
|
|||
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSAutoreleasePool.h>
|
||||
#import <Foundation/NSData.h>
|
||||
#import <Foundation/NSDictionary.h>
|
||||
#import <Foundation/NSException.h>
|
||||
#import <Foundation/NSFileManager.h>
|
||||
#import <Foundation/NSProcessInfo.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <Foundation/NSArray.h>
|
||||
#include <Foundation/NSAutoreleasePool.h>
|
||||
#include <Foundation/NSData.h>
|
||||
#include <Foundation/NSDictionary.h>
|
||||
#include <Foundation/NSException.h>
|
||||
#include <Foundation/NSFileManager.h>
|
||||
#include <Foundation/NSProcessInfo.h>
|
||||
#include <Foundation/NSString.h>
|
||||
|
||||
int
|
||||
main(int argc, char** argv, char **env)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue