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_KEY(X) ;
|
||||||
#define GSI_MAP_RELEASE_VAL(X) ;
|
#define GSI_MAP_RELEASE_VAL(X) ;
|
||||||
|
|
||||||
#import <base/GSIMap.h>
|
#include <base/GSIMap.h>
|
||||||
|
|
||||||
/* This determines the number of precomputed
|
/* This determines the number of precomputed
|
||||||
callback data entries. The list is indexed
|
callback data entries. The list is indexed
|
||||||
|
|
|
@ -22,11 +22,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#import <base/preface.h>
|
#include <base/preface.h>
|
||||||
#import <Foundation/NSProtocolChecker.h>
|
#include <Foundation/NSProtocolChecker.h>
|
||||||
#import <Foundation/NSException.h>
|
#include <Foundation/NSException.h>
|
||||||
#import <Foundation/NSInvocation.h>
|
#include <Foundation/NSInvocation.h>
|
||||||
#import <Foundation/NSMethodSignature.h>
|
#include <Foundation/NSMethodSignature.h>
|
||||||
|
|
||||||
@implementation NSProtocolChecker
|
@implementation NSProtocolChecker
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#import <Foundation/Foundation.h>
|
#include <Foundation/Foundation.h>
|
||||||
#import <objc/Protocol.h>
|
#include <objc/Protocol.h>
|
||||||
|
|
||||||
@interface Foo: NSObject
|
@interface Foo: NSObject
|
||||||
{
|
{
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
as published by the Free Software Foundation; either version 2
|
as published by the Free Software Foundation; either version 2
|
||||||
of the License, or (at your option) any later version.
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public
|
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 library; see the file COPYING.LIB.
|
||||||
If not, write to the Free Software Foundation,
|
If not, write to the Free Software Foundation,
|
||||||
|
@ -31,6 +30,7 @@
|
||||||
NSCharacterSet *spacenl; // Blanks excluding newline
|
NSCharacterSet *spacenl; // Blanks excluding newline
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString*) output: (NSDictionary*)d;
|
||||||
- (BOOL) output: (NSDictionary*)d file: (NSString*)name;
|
- (BOOL) output: (NSDictionary*)d file: (NSString*)name;
|
||||||
- (void) outputMethod: (NSDictionary*)d to: (NSMutableString*)str;
|
- (void) outputMethod: (NSDictionary*)d to: (NSMutableString*)str;
|
||||||
- (void) outputUnit: (NSDictionary*)d to: (NSMutableString*)str;
|
- (void) outputUnit: (NSDictionary*)d to: (NSMutableString*)str;
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) output: (NSDictionary*)d file: (NSString*)name
|
- (NSString*) output: (NSDictionary*)d
|
||||||
{
|
{
|
||||||
NSMutableString *str = [NSMutableString stringWithCapacity: 10240];
|
NSMutableString *str = [NSMutableString stringWithCapacity: 10240];
|
||||||
NSDictionary *classes;
|
NSDictionary *classes;
|
||||||
|
@ -260,6 +260,12 @@
|
||||||
|
|
||||||
[str appendString: @" </body>\n"];
|
[str appendString: @" </body>\n"];
|
||||||
[str appendString: @"</gsdoc>\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];
|
return [str writeToFile: name atomically: YES];
|
||||||
}
|
}
|
||||||
|
@ -814,19 +820,59 @@
|
||||||
}
|
}
|
||||||
else
|
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++;
|
*optr++ = *ptr++;
|
||||||
elideSpace = NO;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (*ptr == '>')
|
if (*ptr == '>')
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* remove space immediately before closing bracket.
|
||||||
|
*/
|
||||||
|
if (optr[-1] == ' ')
|
||||||
|
{
|
||||||
|
optr--;
|
||||||
|
}
|
||||||
*optr++ = *ptr++;
|
*optr++ = *ptr++;
|
||||||
}
|
}
|
||||||
if (optr != buf)
|
if (optr != buf)
|
||||||
{
|
{
|
||||||
NSString *tmp;
|
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];
|
[a addObject: tmp];
|
||||||
}
|
}
|
||||||
buf = ptr;
|
buf = ptr;
|
||||||
|
|
|
@ -139,6 +139,13 @@
|
||||||
#include "AGSParser.h"
|
#include "AGSParser.h"
|
||||||
#include "AGSOutput.h"
|
#include "AGSOutput.h"
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
|
#if HAVE_LIBXML
|
||||||
|
#include <Foundation/GSXML.h>
|
||||||
|
|
||||||
|
static int XML_ELEMENT_NODE;
|
||||||
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv, char **env)
|
main(int argc, char **argv, char **env)
|
||||||
|
@ -191,6 +198,7 @@ main(int argc, char **argv, char **env)
|
||||||
NSString *ddir;
|
NSString *ddir;
|
||||||
NSString *sdir;
|
NSString *sdir;
|
||||||
NSString *file;
|
NSString *file;
|
||||||
|
NSString *generated;
|
||||||
|
|
||||||
file = [[arg lastPathComponent] stringByDeletingPathExtension];
|
file = [[arg lastPathComponent] stringByDeletingPathExtension];
|
||||||
|
|
||||||
|
@ -229,7 +237,39 @@ main(int argc, char **argv, char **env)
|
||||||
[parser parseFile: sdir isSource: YES];
|
[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"])
|
else if ([arg hasSuffix: @".m"])
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,15 +18,15 @@
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#include <Foundation/Foundation.h>
|
||||||
#import <Foundation/NSArray.h>
|
#include <Foundation/NSArray.h>
|
||||||
#import <Foundation/NSAutoreleasePool.h>
|
#include <Foundation/NSAutoreleasePool.h>
|
||||||
#import <Foundation/NSData.h>
|
#include <Foundation/NSData.h>
|
||||||
#import <Foundation/NSDictionary.h>
|
#include <Foundation/NSDictionary.h>
|
||||||
#import <Foundation/NSException.h>
|
#include <Foundation/NSException.h>
|
||||||
#import <Foundation/NSFileManager.h>
|
#include <Foundation/NSFileManager.h>
|
||||||
#import <Foundation/NSProcessInfo.h>
|
#include <Foundation/NSProcessInfo.h>
|
||||||
#import <Foundation/NSString.h>
|
#include <Foundation/NSString.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char** argv, char **env)
|
main(int argc, char** argv, char **env)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue