ObjFW  Check-in [7239333455]

Overview
Comment:Move definition of restricted to OFObject.h.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 72393334559251190ef7b75e8ff824a7ec932dc6ef648102e848d6f0e74db1e7
User & Date: js on 2012-10-03 15:41:10
Other Links: manifest | tags
Context
2012-10-03
15:47
Move ObjC feature checks to OFObject.h. check-in: 2edae50b86 user: js tags: trunk
15:41
Move definition of restricted to OFObject.h. check-in: 7239333455 user: js tags: trunk
2012-10-02
11:20
More property cleanup. check-in: 7261ba5bd1 user: js tags: trunk
Changes

Modified src/OFObject.h from [171eb78051] to [d0b36af00e].

32
33
34
35
36
37
38






39
40
41
42
43
44
45
#else
# import <objc/objc.h>
#endif

#ifdef OF_APPLE_RUNTIME
# import <objc/runtime.h>
#endif







#ifndef __has_feature
# define __has_feature(x) 0
#endif

#if __has_feature(objc_bool)
# undef YES







>
>
>
>
>
>







32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#else
# import <objc/objc.h>
#endif

#ifdef OF_APPLE_RUNTIME
# import <objc/runtime.h>
#endif

#if defined(__GNUC__)
# define restrict __restrict__
#elif __STDC_VERSION__ < 199901L
# define restrict
#endif

#ifndef __has_feature
# define __has_feature(x) 0
#endif

#if __has_feature(objc_bool)
# undef YES

Modified src/OFString.h from [6666093c89] to [189c6c26d9].

24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <stdarg.h>
#include <inttypes.h>

#import "OFObject.h"
#import "OFSerialization.h"
#import "OFJSONRepresentation.h"

#import "macros.h"

@class OFConstantString;

typedef uint32_t of_unichar_t;

/**
 * \brief The encoding of a string.
 */







<
<







24
25
26
27
28
29
30


31
32
33
34
35
36
37
#include <stdarg.h>
#include <inttypes.h>

#import "OFObject.h"
#import "OFSerialization.h"
#import "OFJSONRepresentation.h"



@class OFConstantString;

typedef uint32_t of_unichar_t;

/**
 * \brief The encoding of a string.
 */

Modified src/OFXMLParser.m from [f9b1934552] to [2183cd8116].

32
33
34
35
36
37
38

39
40
41
42
43
44
45
#import "OFFile.h"

#import "OFInitializationFailedException.h"
#import "OFMalformedXMLException.h"
#import "OFUnboundNamespaceException.h"

#import "autorelease.h"


typedef void (*state_function)(id, SEL, const char*, size_t*, size_t*);
static SEL selectors[OF_XMLPARSER_NUM_STATES];
static state_function lookupTable[OF_XMLPARSER_NUM_STATES];

static OF_INLINE void
cache_append(OFDataArray *cache, const char *string,







>







32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#import "OFFile.h"

#import "OFInitializationFailedException.h"
#import "OFMalformedXMLException.h"
#import "OFUnboundNamespaceException.h"

#import "autorelease.h"
#import "macros.h"

typedef void (*state_function)(id, SEL, const char*, size_t*, size_t*);
static SEL selectors[OF_XMLPARSER_NUM_STATES];
static state_function lookupTable[OF_XMLPARSER_NUM_STATES];

static OF_INLINE void
cache_append(OFDataArray *cache, const char *string,

Modified src/exceptions/OFAlreadyConnectedException.m from [1362a72420] to [71611b6537].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
#include "config.h"

#import "OFAlreadyConnectedException.h"
#import "OFString.h"
#import "OFTCPSocket.h"

#import "OFNotImplementedException.h"



@implementation OFAlreadyConnectedException
+ exceptionWithClass: (Class)class_
	      socket: (OFTCPSocket*)socket
{
	return [[[self alloc] initWithClass: class_
				     socket: socket] autorelease];







>
>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "config.h"

#import "OFAlreadyConnectedException.h"
#import "OFString.h"
#import "OFTCPSocket.h"

#import "OFNotImplementedException.h"

#import "common.h"

@implementation OFAlreadyConnectedException
+ exceptionWithClass: (Class)class_
	      socket: (OFTCPSocket*)socket
{
	return [[[self alloc] initWithClass: class_
				     socket: socket] autorelease];

Modified src/exceptions/OFEnumerationMutationException.m from [fc215b7c9c] to [83a60bc830].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFEnumerationMutationException.h"
#import "OFString.h"

#import "OFNotImplementedException.h"



@implementation OFEnumerationMutationException
+ exceptionWithClass: (Class)class_
	      object: (id)object
{
	return [[[self alloc] initWithClass: class_
				     object: object] autorelease];







>
>







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

#include "config.h"

#import "OFEnumerationMutationException.h"
#import "OFString.h"

#import "OFNotImplementedException.h"

#import "common.h"

@implementation OFEnumerationMutationException
+ exceptionWithClass: (Class)class_
	      object: (id)object
{
	return [[[self alloc] initWithClass: class_
				     object: object] autorelease];

Modified src/exceptions/OFHTTPRequestFailedException.m from [562128a903] to [3fcf583711].

19
20
21
22
23
24
25

26
27
28
29
30
31
32
#import "OFHTTPRequestFailedException.h"
#import "OFString.h"
#import "OFHTTPRequest.h"

#import "OFNotImplementedException.h"

#import "autorelease.h"


@implementation OFHTTPRequestFailedException
+ exceptionWithClass: (Class)class_
	     request: (OFHTTPRequest*)request
	      result: (OFHTTPRequestResult*)result
{
	return [[[self alloc] initWithClass: class_







>







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#import "OFHTTPRequestFailedException.h"
#import "OFString.h"
#import "OFHTTPRequest.h"

#import "OFNotImplementedException.h"

#import "autorelease.h"
#import "common.h"

@implementation OFHTTPRequestFailedException
+ exceptionWithClass: (Class)class_
	     request: (OFHTTPRequest*)request
	      result: (OFHTTPRequestResult*)result
{
	return [[[self alloc] initWithClass: class_

Modified src/exceptions/OFHashAlreadyCalculatedException.m from [e7d621d895] to [5cc304779c].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
#include "config.h"

#import "OFHashAlreadyCalculatedException.h"
#import "OFString.h"
#import "OFHash.h"

#import "OFNotImplementedException.h"



@implementation OFHashAlreadyCalculatedException
+ exceptionWithClass: (Class)class_
		hash: (OFHash*)hash
{
	return [[[self alloc] initWithClass: class_
				       hash: hash] autorelease];







>
>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "config.h"

#import "OFHashAlreadyCalculatedException.h"
#import "OFString.h"
#import "OFHash.h"

#import "OFNotImplementedException.h"

#import "common.h"

@implementation OFHashAlreadyCalculatedException
+ exceptionWithClass: (Class)class_
		hash: (OFHash*)hash
{
	return [[[self alloc] initWithClass: class_
				       hash: hash] autorelease];

Modified src/exceptions/OFMalformedXMLException.m from [aacdd770af] to [188cd280eb].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
#include "config.h"

#import "OFMalformedXMLException.h"
#import "OFString.h"
#import "OFXMLParser.h"

#import "OFNotImplementedException.h"



@implementation OFMalformedXMLException
+ exceptionWithClass: (Class)class_
	      parser: (OFXMLParser*)parser
{
	return [[[self alloc] initWithClass: class_
				     parser: parser] autorelease];







>
>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "config.h"

#import "OFMalformedXMLException.h"
#import "OFString.h"
#import "OFXMLParser.h"

#import "OFNotImplementedException.h"

#import "common.h"

@implementation OFMalformedXMLException
+ exceptionWithClass: (Class)class_
	      parser: (OFXMLParser*)parser
{
	return [[[self alloc] initWithClass: class_
				     parser: parser] autorelease];

Modified src/exceptions/OFNotConnectedException.m from [f07b495d09] to [497115d130].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
#include "config.h"

#import "OFNotConnectedException.h"
#import "OFString.h"
#import "OFTCPSocket.h"

#import "OFNotImplementedException.h"



@implementation OFNotConnectedException
+ exceptionWithClass: (Class)class_
	      socket: (OFStreamSocket*)socket
{
	return [[[self alloc] initWithClass: class_
				     socket: socket] autorelease];







>
>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "config.h"

#import "OFNotConnectedException.h"
#import "OFString.h"
#import "OFTCPSocket.h"

#import "OFNotImplementedException.h"

#import "common.h"

@implementation OFNotConnectedException
+ exceptionWithClass: (Class)class_
	      socket: (OFStreamSocket*)socket
{
	return [[[self alloc] initWithClass: class_
				     socket: socket] autorelease];

Modified src/exceptions/OFSetOptionFailedException.m from [f34ccd222c] to [c014ab807a].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
#include "config.h"

#import "OFSetOptionFailedException.h"
#import "OFString.h"
#import "OFStream.h"

#import "OFNotImplementedException.h"



@implementation OFSetOptionFailedException
+ exceptionWithClass: (Class)class_
	      stream: (OFStream*)stream
{
	return [[[self alloc] initWithClass: class_
				     stream: stream] autorelease];







>
>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "config.h"

#import "OFSetOptionFailedException.h"
#import "OFString.h"
#import "OFStream.h"

#import "OFNotImplementedException.h"

#import "common.h"

@implementation OFSetOptionFailedException
+ exceptionWithClass: (Class)class_
	      stream: (OFStream*)stream
{
	return [[[self alloc] initWithClass: class_
				     stream: stream] autorelease];

Modified src/exceptions/OFUnboundNamespaceException.m from [b6bf1c09c7] to [0ff95d0b7b].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFUnboundNamespaceException.h"
#import "OFString.h"

#import "OFNotImplementedException.h"



@implementation OFUnboundNamespaceException
+ exceptionWithClass: (Class)class_
	   namespace: (OFString*)ns
{
	return [[[self alloc] initWithClass: class_
				  namespace: ns] autorelease];







>
>







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

#include "config.h"

#import "OFUnboundNamespaceException.h"
#import "OFString.h"

#import "OFNotImplementedException.h"

#import "common.h"

@implementation OFUnboundNamespaceException
+ exceptionWithClass: (Class)class_
	   namespace: (OFString*)ns
{
	return [[[self alloc] initWithClass: class_
				  namespace: ns] autorelease];

Modified src/exceptions/OFUnsupportedProtocolException.m from [a5d3f9d2cc] to [54d143c6c3].

17
18
19
20
21
22
23


24
25
26
27
28
29
30
#include "config.h"

#import "OFUnsupportedProtocolException.h"
#import "OFString.h"
#import "OFURL.h"

#import "OFNotImplementedException.h"



@implementation OFUnsupportedProtocolException
+ exceptionWithClass: (Class)class_
		 URL: (OFURL*)url
{
	return [[[self alloc] initWithClass: class_
					URL: url] autorelease];







>
>







17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "config.h"

#import "OFUnsupportedProtocolException.h"
#import "OFString.h"
#import "OFURL.h"

#import "OFNotImplementedException.h"

#import "common.h"

@implementation OFUnsupportedProtocolException
+ exceptionWithClass: (Class)class_
		 URL: (OFURL*)url
{
	return [[[self alloc] initWithClass: class_
					URL: url] autorelease];

Modified src/exceptions/OFUnsupportedVersionException.m from [c1cbaf7fe4] to [bf02225514].

16
17
18
19
20
21
22


23
24
25
26
27
28
29

#include "config.h"

#import "OFUnsupportedVersionException.h"
#import "OFString.h"

#import "OFNotImplementedException.h"



@implementation OFUnsupportedVersionException
+ exceptionWithClass: (Class)class_
	     version: (OFString*)version
{
	return [[[self alloc] initWithClass: class_
				    version: version] autorelease];







>
>







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

#include "config.h"

#import "OFUnsupportedVersionException.h"
#import "OFString.h"

#import "OFNotImplementedException.h"

#import "common.h"

@implementation OFUnsupportedVersionException
+ exceptionWithClass: (Class)class_
	     version: (OFString*)version
{
	return [[[self alloc] initWithClass: class_
				    version: version] autorelease];

Modified src/exceptions/common.h from [0e109eabd1] to [694e7d8b34].

11
12
13
14
15
16
17


18
19
20
21
22
23
24
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include <string.h>



#ifndef _WIN32
#if !defined(HAVE_THREADSAFE_GETADDRINFO) && !defined(_PSP)
# include <netdb.h>
#endif
# include <errno.h>
# define GET_ERRNO	errno







>
>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include <string.h>

#import "macros.h"

#ifndef _WIN32
#if !defined(HAVE_THREADSAFE_GETADDRINFO) && !defined(_PSP)
# include <netdb.h>
#endif
# include <errno.h>
# define GET_ERRNO	errno

Modified src/macros.h from [427e7a37b9] to [037045a86a].

37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#else
# define OF_INLINE inline
# define OF_LIKELY(cond) cond
# define OF_UNLIKELY(cond) cond
# define OF_CONST_FUNC
#endif

#if defined(__GNUC__)
# define restrict __restrict__
#elif __STDC_VERSION__ < 199901L
# define restrict
#endif

/* Required to build universal binaries on OS X */
#if __BIG_ENDIAN__ || __LITTLE_ENDIAN__
# if __BIG_ENDIAN__ && __LITTLE_ENDIAN__
#  error __BIG_ENDIAN__ and __LITTLE_ENDIAN__ defined!
# endif
# undef OF_BIG_ENDIAN
# if __BIG_ENDIAN__







<
<
<
<
<
<







37
38
39
40
41
42
43






44
45
46
47
48
49
50
#else
# define OF_INLINE inline
# define OF_LIKELY(cond) cond
# define OF_UNLIKELY(cond) cond
# define OF_CONST_FUNC
#endif







/* Required to build universal binaries on OS X */
#if __BIG_ENDIAN__ || __LITTLE_ENDIAN__
# if __BIG_ENDIAN__ && __LITTLE_ENDIAN__
#  error __BIG_ENDIAN__ and __LITTLE_ENDIAN__ defined!
# endif
# undef OF_BIG_ENDIAN
# if __BIG_ENDIAN__

Modified src/of_asprintf.h from [1ac911f233] to [48fccc86da].

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#include <stdarg.h>

#import "macros.h"

#ifdef __cplusplus
extern "C" {
#endif
extern int of_asprintf(char**, const char*, ...);
extern int of_vasprintf(char**, const char*, va_list);
#ifdef __cplusplus
}
#endif







<
<








19
20
21
22
23
24
25


26
27
28
29
30
31
32
33
#endif
#ifndef __STDC_CONSTANT_MACROS
# define __STDC_CONSTANT_MACROS
#endif

#include <stdarg.h>



#ifdef __cplusplus
extern "C" {
#endif
extern int of_asprintf(char**, const char*, ...);
extern int of_vasprintf(char**, const char*, va_list);
#ifdef __cplusplus
}
#endif

Modified tests/OFArrayTests.m from [550ae86871] to [ed442f3f94].

18
19
20
21
22
23
24


25
26
27
28
29
30
31

#import "OFArray.h"
#import "OFString.h"
#import "OFAutoreleasePool.h"

#import "OFEnumerationMutationException.h"
#import "OFOutOfRangeException.h"



#import "TestsAppDelegate.h"

static OFString *module = @"OFArray";
static OFString *c_ary[] = {
	@"Foo",
	@"Bar",







>
>







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

#import "OFArray.h"
#import "OFString.h"
#import "OFAutoreleasePool.h"

#import "OFEnumerationMutationException.h"
#import "OFOutOfRangeException.h"

#import "macros.h"

#import "TestsAppDelegate.h"

static OFString *module = @"OFArray";
static OFString *c_ary[] = {
	@"Foo",
	@"Bar",

Modified tests/OFDataArrayTests.m from [742e94e327] to [eae28a70a3].

19
20
21
22
23
24
25


26
27
28
29
30
31
32
#include <string.h>

#import "OFDataArray.h"
#import "OFString.h"
#import "OFAutoreleasePool.h"

#import "OFOutOfRangeException.h"



#import "TestsAppDelegate.h"

static OFString *module;
const char *str = "Hello!";

@implementation TestsAppDelegate (OFDataArrayTests)







>
>







19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <string.h>

#import "OFDataArray.h"
#import "OFString.h"
#import "OFAutoreleasePool.h"

#import "OFOutOfRangeException.h"

#import "macros.h"

#import "TestsAppDelegate.h"

static OFString *module;
const char *str = "Hello!";

@implementation TestsAppDelegate (OFDataArrayTests)

Modified tests/OFStringTests.m from [12bf7dfb21] to [bea59f49f7].

25
26
27
28
29
30
31


32
33
34
35
36
37
38
#import "OFURL.h"
#import "OFAutoreleasePool.h"

#import "OFInvalidArgumentException.h"
#import "OFInvalidEncodingException.h"
#import "OFInvalidFormatException.h"
#import "OFOutOfRangeException.h"



#import "TestsAppDelegate.h"

static OFString *module = @"OFString";
static OFString* whitespace[] = {
	@" \r \t\n\t \tasd  \t \t\t\r\n",
	@" \t\t  \t\t  \t \t"







>
>







25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#import "OFURL.h"
#import "OFAutoreleasePool.h"

#import "OFInvalidArgumentException.h"
#import "OFInvalidEncodingException.h"
#import "OFInvalidFormatException.h"
#import "OFOutOfRangeException.h"

#import "macros.h"

#import "TestsAppDelegate.h"

static OFString *module = @"OFString";
static OFString* whitespace[] = {
	@" \r \t\n\t \tasd  \t \t\t\r\n",
	@" \t\t  \t\t  \t \t"