mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
add missing headers etc
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32531 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2539d75717
commit
4f9574fc5d
4 changed files with 128 additions and 31 deletions
|
@ -1,3 +1,27 @@
|
|||
/** Definitions for block support for GNUStep
|
||||
Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNUstep Base Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __GSBlocks_h_GNUSTEP_BASE_INCLUDE
|
||||
#define __GSBlocks_h_GNUSTEP_BASE_INCLUDE
|
||||
|
||||
/* Define the has_feature pseudo-macro for GCC. */
|
||||
#ifndef __has_feature
|
||||
|
@ -5,6 +29,7 @@
|
|||
#endif
|
||||
|
||||
#if __has_feature(blocks)
|
||||
|
||||
/**
|
||||
* Defines a block type. Will work whether or not the compiler natively
|
||||
* supports blocks.
|
||||
|
@ -14,38 +39,39 @@ typedef retTy(^name)(argTys, ## __VA_ARGS__)
|
|||
/**
|
||||
* Calls a block. Works irrespective of whether the compiler supports blocks.
|
||||
*/
|
||||
#define CALL_BLOCK(block, args, ...) \
|
||||
block(args, ## __VA_ARGS__)
|
||||
/* Fall-back versions for when the compiler doesn't have native blocks support.
|
||||
*/
|
||||
#define CALL_BLOCK(block, args, ...) block(args, ## __VA_ARGS__)
|
||||
|
||||
#else
|
||||
|
||||
/* Fall-back versions for when the compiler doesn't have native blocks support.
|
||||
*/
|
||||
#if (GCC_VERSION >= 3000)
|
||||
|
||||
#define DEFINE_BLOCK_TYPE(name, retTy, argTys, ...) \
|
||||
typedef struct {\
|
||||
void *isa;\
|
||||
int flags;\
|
||||
int reserved;\
|
||||
retTy (*invoke)(void*, argTys, ## __VA_ARGS__);\
|
||||
} *name
|
||||
#define CALL_BLOCK(block, args, ...) \
|
||||
block->invoke(block, args, ## __VA_ARGS__)
|
||||
typedef struct {\
|
||||
void *isa;\
|
||||
int flags;\
|
||||
int reserved;\
|
||||
retTy (*invoke)(void*, argTys, ## __VA_ARGS__);\
|
||||
} *name
|
||||
|
||||
#define CALL_BLOCK(block, args, ...) block->invoke(block, args, ## __VA_ARGS__)
|
||||
|
||||
#else /* GCC_VERSION >= 3000 */
|
||||
|
||||
#define DEFINE_BLOCK_TYPE(name, retTy, argTys, args...) \
|
||||
typedef struct {\
|
||||
void *isa;\
|
||||
int flags;\
|
||||
int reserved;\
|
||||
retTy (*invoke)(void*, argTys, args);\
|
||||
} *name
|
||||
#define CALL_BLOCK(block, args...) \
|
||||
block->invoke(block, args)
|
||||
typedef struct {\
|
||||
void *isa;\
|
||||
int flags;\
|
||||
int reserved;\
|
||||
retTy (*invoke)(void*, argTys, args);\
|
||||
} *name
|
||||
|
||||
#define CALL_BLOCK(block, args...) block->invoke(block, args)
|
||||
|
||||
#endif /* GCC_VERSION >= 3000 */
|
||||
|
||||
#endif
|
||||
#endif /* __has_feature(blocks) */
|
||||
|
||||
#endif /* __GSBlocks_h_GNUSTEP_BASE_INCLUDE */
|
||||
|
||||
|
|
|
@ -1,15 +1,54 @@
|
|||
#import "NSObject.h"
|
||||
/* Definition of class NSRegularExpression
|
||||
Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNUstep Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
*/
|
||||
|
||||
#ifndef _NSRegularExpression_h_GNUSTEP_BASE_INCLUDE
|
||||
#define _NSRegularExpression_h_GNUSTEP_BASE_INCLUDE
|
||||
#import <GNUstepBase/GSVersionMacros.h>
|
||||
|
||||
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
||||
|
||||
#import <Foundation/NSObject.h>
|
||||
#import "GNUstepBase/GSBlocks.h"
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@class NSTextCheckingResult;
|
||||
|
||||
typedef NSUInteger NSRegularExpressionOptions;
|
||||
static const NSRegularExpressionOptions NSRegularExpressionCaseInsensitive = 1<<0;
|
||||
static const NSRegularExpressionOptions NSRegularExpressionAllowCommentsAndWhitespace = 1<<1;
|
||||
static const NSRegularExpressionOptions NSRegularExpressionIgnoreMetacharacters = 1<<2;
|
||||
static const NSRegularExpressionOptions NSRegularExpressionDotMatchesLineSeparators = 1<<3;
|
||||
static const NSRegularExpressionOptions NSRegularExpressionAnchorsMatchLines = 1<<4;
|
||||
static const NSRegularExpressionOptions NSRegularExpressionUseUnixLineSeparators = 1<<5;
|
||||
static const NSRegularExpressionOptions NSRegularExpressionUseUnicodeWordBoundaries = 1<<6;
|
||||
static const NSRegularExpressionOptions
|
||||
NSRegularExpressionCaseInsensitive = 1<<0;
|
||||
static const NSRegularExpressionOptions
|
||||
NSRegularExpressionAllowCommentsAndWhitespace = 1<<1;
|
||||
static const NSRegularExpressionOptions
|
||||
NSRegularExpressionIgnoreMetacharacters = 1<<2;
|
||||
static const NSRegularExpressionOptions
|
||||
NSRegularExpressionDotMatchesLineSeparators = 1<<3;
|
||||
static const NSRegularExpressionOptions
|
||||
NSRegularExpressionAnchorsMatchLines = 1<<4;
|
||||
static const NSRegularExpressionOptions
|
||||
NSRegularExpressionUseUnixLineSeparators = 1<<5;
|
||||
static const NSRegularExpressionOptions
|
||||
NSRegularExpressionUseUnicodeWordBoundaries = 1<<6;
|
||||
|
||||
typedef NSUInteger NSMatchingFlags;
|
||||
static const NSMatchingFlags NSMatchingProgress = 1<<0;
|
||||
|
@ -29,7 +68,7 @@ static const NSMatchingOptions NSMatchingWithoutAnchoringBounds = 1<<4;
|
|||
DEFINE_BLOCK_TYPE(GSRegexBlock, void, NSTextCheckingResult*, NSMatchingFlags, BOOL*);
|
||||
|
||||
#ifndef GSREGEXTYPE
|
||||
#define GSREGEXTYPE void
|
||||
# define GSREGEXTYPE void
|
||||
#endif
|
||||
|
||||
@interface NSRegularExpression : NSObject <NSCoding, NSCopying>
|
||||
|
@ -99,3 +138,12 @@ DEFINE_BLOCK_TYPE(GSRegexBlock, void, NSTextCheckingResult*, NSMatchingFlags, BO
|
|||
- (NSUInteger)numberOfCaptureGroups;
|
||||
#endif
|
||||
@end
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* GS_API_MACOSX */
|
||||
|
||||
#endif /* _NSRegualrExpression_h_GNUSTEP_BASE_INCLUDE */
|
||||
|
||||
|
|
|
@ -149,6 +149,7 @@ BASE_MFILES = \
|
|||
CXXException.m\
|
||||
GSArray.m \
|
||||
GSAttributedString.m \
|
||||
GSBlocks.m \
|
||||
GSConcreteValue.m \
|
||||
GSCountedSet.m \
|
||||
GSDictionary.m \
|
||||
|
|
|
@ -1,4 +1,26 @@
|
|||
#import <Foundation/NSObject.h>
|
||||
/** Implementation of GSBlocks for GNUStep
|
||||
Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNUstep Base Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
|
||||
*/
|
||||
|
||||
#import "Foundation/NSObject.h"
|
||||
|
||||
/* Declare the block copy functions ourself so that we don't depend on a
|
||||
* specific header location.
|
||||
|
|
Loading…
Reference in a new issue