Changes In Branch 0.8
Through [cec0f072f8]
Excluding Merge-Ins
This is equivalent to a diff from
6b8b7b6a7e
to cec0f072f8
Modified ChangeLog
from [4a3a662173]
to [22a812d84f].
1
2
3
4
5
6
7
8
9
10
11
12
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
|
Legend:
* Changes of existing features or bugfixes
+ New features
ObjFW 0.8 -> ObjFW 0.8.1, 04.10.2015
* Adjust to __nullable / __nonnull being changed to _Nullable / _Nonnull in
Clang 3.7 (this fixes compilation with Clang 3.7)
* Blocks: Proper handling when called from a byref handler
* Fix compilation on Solaris
* Fix compilation for Wii, PSP and Nintendo DS
* OFProcess: Send SIGTERM on close instead of SIGKILL
* OFZIPArchive: Throw invalid format exception on failed seeks
* Make sure of_hash_seed is never initialized to 0
* Special cases for the Wii's weird network stack (fixes the tests)
* Better length checks for write / send calls
* Don't use -pedantic on platforms where it's broken by the system headers
* Documentation fixes
ObjFW 0.7.1 -> ObjFW 0.8, 14.10.2015
ObjFW 0.7.1 -> ObjFW 0.8, 14.08.2015
+ An insanely huge amount of new APIs
+ New classes: OFHTTPServer, OFINICategory, OFINIFile, OFInflate64Stream,
OFInflateStream, OFMapTable, OFRIPEMD160Hash, OFSHA224Hash, OFSHA256Hash,
OFSHA384Hash, OFSHA512Hash, OFSettings, OFStdIOStream, OFSystemInfo,
OFUDPSocket, OFZIPArchive, OFZIPArchiveEntry
+ New utils: ofzip, ofhash, ofhttp
|
︙ | | |
Modified PLATFORMS.md
from [c1c3a16d44]
to [a34b8c9875].
︙ | | |
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
-
+
|
Others
------
Basically, it should run on any POSIX system to which GCC 4 or a recent Clang
version has been ported. If not, please send an e-mail with a bug report.
If you successfully ran ObjFW on a platform not listed here, please send an
e-mail to js@webkeks.org so it can be added here!
e-mail to js@heap.zone so it can be added here!
If you have a platform on which ObjFW does not work, please contact me as well!
Forwarding
==========
|
︙ | | |
Modified README-WINDOWS.md
from [ca2228e45c]
to [d687d81e38].
︙ | | |
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
+
-
+
-
+
|
$ pacman -S autoconf automake git make
Getting, building and installing ObjFW
--------------------------------------
Start the MinGW-w64 Win32 or Win64 Shell (depening on what version you want
to build - do *not* use the MSYS2 Shell shortcut, but use the MinGW-w64 Win32
to build) and check out ObjFW:
or Win64 Shell shortcut instead!) and check out ObjFW:
$ git clone https://webkeks.org/git/objfw.git
$ git clone https://heap.zone/git/objfw.git
You can also download a release tarball if you want. Now go to the newly
checked out repository and build and install it:
$ ./autogen.sh && ./configure && make -j16 install
If everything was successfully, you can now build projects using ObjFW for
Windows using the normal `objfw-compile` and friends.
|
Modified README.md
from [3bd8b972d8]
to [cb6d312400].
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
-
+
|
ObjFW is a portable, lightweight framework for the Objective C language.
It enables you to write an application in Objective C that will run on
any platform supported by ObjFW without having to worry about
differences between operating systems or various frameworks that you
would otherwise need if you want to be portable.
See https://webkeks.org/objfw for more information.
See https://heap.zone/objfw for more information.
Installation
============
To install ObjFW, just run the following commands:
|
︙ | | |
65
66
67
68
69
70
71
72
|
65
66
67
68
69
70
71
72
|
-
+
|
Raspberry Pi.
Bugs and feature requests
=========================
If you find any bugs or have feature requests, feel free to send a
mail to js@webkeks.org!
mail to js@heap.zone!
|
Modified configure.ac
from [f7868ab464]
to [c3be66d244].
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
-
+
+
+
+
|
AC_INIT(ObjFW, 0.8-dev, js@webkeks.org)
AC_INIT(ObjFW, 0.8.1, js@heap.zone)
BUILDSYS_INIT
AS_IF([test configure.ac -nt configure], [
AC_MSG_ERROR([configure.ac is newer than configure! Run ./autogen.sh!])
])
AC_CONFIG_SRCDIR(src)
AC_CANONICAL_HOST
dnl Used to disable checking for -pedantic on some platforms where it's broken
check_pedantic="yes"
case "$host" in
*-msdosdjgpp*)
enable_shared="no"
enable_threads="no"
enable_sockets="no"
;;
|
︙ | | |
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
+
|
LIBS="$LIBS -L$DEVKITPSP/psp/sdk/lib -lpspdebug -lpspdisplay"
LIBS="$LIBS -lpspge -lpspctrl -lpspsdk -lc -lpspnet"
LIBS="$LIBS -lpspnet_inet -lpspnet_apctl -lpspnet_resolver"
LIBS="$LIBS -lpsputility -lpspuser -lpspkernel"
enable_shared="no"
enable_threads="no" # TODO
enable_sockets="no" # TODO
check_pedantic="no"
AC_SUBST(MAP_LDFLAGS, ['-Wl,-Map,$@.map'])
;;
esac
AC_LANG([Objective C])
AC_PROG_OBJC([clang gcc])
|
︙ | | |
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
+
|
OBJCFLAGS="$OBJCFLAGS -mthumb -mthumb-interwork"
CPPFLAGS="$CPPFLAGS -DARM9 -I$DEVKITPRO/libnds/include"
LDFLAGS="$LDFLAGS -specs=ds_arm9.specs"
LIBS="$LIBS -L$DEVKITPRO/libnds/lib -lfilesystem -lfat -lnds9"
enable_shared="no"
enable_threads="no" # TODO
enable_sockets="no" # TODO
check_pedantic="no"
AC_DEFINE(OF_NINTENDO_DS, 1,
[Whether we are compiling for the Nintendo DS])
AC_SUBST(MAP_LDFLAGS, ['-Wl,-Map,$@.map'])
])
CPP="$OBJCPP"
|
︙ | | |
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
|
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
|
-
+
|
])
test x"$have_asprintf" != x"yes" -a x"$ac_cv_snprintf_useful_ret" != x"yes" && \
AC_MSG_ERROR(No asprintf and no snprintf returning required space!)
AC_CHECK_FUNCS([arc4random random], break)
AC_CHECK_LIB(dl, dlopen, LIBS="$LIBS -ldl")
AC_CHECK_HEADERS(dlfcn.h)
AC_CHECK_HEADERS_ONCE(dlfcn.h)
case "$host_os" in
netbsd*)
dnl dladdr exists on NetBSD, but it is completely broken.
dnl When using it with code that uses __thread, it freezes the
dnl process so that it has to be killed using SIGKILL.
dnl When disabling __thread, it doesn't freeze, but all symbols
dnl are wrong.
|
︙ | | |
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
|
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
|
-
+
|
AC_DEFINE(OF_HAVE_THREADS, 1, [Whether we have threads])
AC_SUBST(USE_SRCS_THREADS, '${SRCS_THREADS}')
AC_ARG_ENABLE(compiler-tls,
AS_HELP_STRING([--disable-compiler-tls],
[disable compiler thread local storage]))
AS_IF([test x"$enable_compiler_tls" != x"no"], [
AC_CHECK_HEADERS(threads.h, [
AC_CHECK_HEADER(threads.h, [
AC_DEFINE(OF_HAVE_THREADS_H, 1,
[Whether we have threads.h])
])
AC_MSG_CHECKING(whether _Thread_local works)
AC_TRY_LINK([
static _Thread_local int x = 0;
|
︙ | | |
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
|
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
|
-
+
-
+
|
AC_CHECK_LIB(network, socket, LIBS="$LIBS -lnetwork")
AC_CHECK_LIB(ws2_32, main, LIBS="$LIBS -lws2_32")
AC_CHECK_HEADER(sys/socket.h, [
AC_DEFINE(OF_HAVE_SYS_SOCKET_H, 1,
[Whether we have sys/socket.h])
])
AC_CHECK_HEADERS(netinet/in.h, [
AC_CHECK_HEADER(netinet/in.h, [
AC_DEFINE(OF_HAVE_NETINET_IN_H, 1,
[Whether we have netinet/in.h])
])
AC_CHECK_HEADERS(netinet/tcp.h, [
AC_CHECK_HEADER(netinet/tcp.h, [
AC_DEFINE(OF_HAVE_NETINET_TCP_H, 1,
[Whether we have netinet/tcp.h])
])
AC_CHECK_HEADERS([arpa/inet.h netdb.h])
AC_CHECK_FUNCS([paccept accept4])
|
︙ | | |
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
|
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
|
-
+
|
;;
esac
AS_IF([test x"$have_processes" = x"yes"], [
AC_SUBST(OFPROCESS_M, "OFProcess.m")
AC_DEFINE(OF_HAVE_PROCESSES, 1, [Whether we have processes])
])
AC_CHECK_HEADERS(sys/ioctl.h)
AC_CHECK_HEADERS_ONCE([sys/ioctl.h sys/termios.h])
AS_IF([test x"$objc_runtime" = x"Apple runtime"], [
AC_CHECK_HEADER(Foundation/NSObject.h, [
AC_SUBST(FOUNDATION_COMPAT_M, "foundation-compat.m")
AC_SUBST(BRIDGE, "bridge")
AS_IF([test x"$enable_shared" != x"no"], [
|
︙ | | |
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
|
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
|
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
|
], [
AC_MSG_RESULT(yes)
], [
AC_MSG_RESULT(no)
OBJCFLAGS="$old_OBJCFLAGS"
])
AS_IF([test x"$check_pedantic" = x"yes"], [
old_OBJCFLAGS="$OBJCFLAGS"
OBJCFLAGS="$OBJCFLAGS -pedantic"
AC_MSG_CHECKING(whether -pedantic is buggy)
AC_TRY_COMPILE([
#import <stdlib.h>
old_OBJCFLAGS="$OBJCFLAGS"
OBJCFLAGS="$OBJCFLAGS -pedantic"
AC_MSG_CHECKING(whether -pedantic is buggy)
AC_TRY_COMPILE([
#import <stdlib.h>
#ifdef __has_attribute
# if __has_attribute(objc_root_class)
__attribute__((__objc_root_class__))
# endif
#endif
@interface Foo
{
void *foo;
}
@end
#ifdef __has_attribute
# if __has_attribute(objc_root_class)
__attribute__((__objc_root_class__))
# endif
#endif
@interface Foo
{
void *foo;
}
@end
@interface Bar: Foo
@end
], [], [
AC_MSG_RESULT(no)
], [
AC_MSG_RESULT(yes)
OBJCFLAGS="$old_OBJCFLAGS"
@interface Bar: Foo
@end
], [], [
AC_MSG_RESULT(no)
], [
AC_MSG_RESULT(yes)
OBJCFLAGS="$old_OBJCFLAGS"
])
])
])
AS_IF([test x"$cross_compiling" = x"yes"], [
AC_SUBST(BIN_PREFIX, "${host_alias}-")
case "$host" in
|
︙ | | |
Modified generators/TableGenerator.h
from [b13d79febb]
to [c9259e70f6].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified generators/TableGenerator.m
from [5a4e277bcb]
to [a1cc0c76e7].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified generators/copyright.h
from [47e2f6fc5d]
to [bf1c8da3a5].
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
* 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.
*/
#import "OFString.h"
#define COPYRIGHT \
@"/*\n" \
@" * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015\n" \
@" * Jonathan Schleifer <js@webkeks.org>\n" \
@" *\n" \
@" * All rights reserved.\n" \
@" *\n" \
@" * This file is part of ObjFW. It may be distributed under the terms " \
@"of the\n" \
@" * Q Public License 1.0, which can be found in the file LICENSE.QPL " \
@"included in\n" \
@" * the packaging of this file.\n" \
@" *\n" \
@" * Alternatively, it may be distributed under the terms of the GNU " \
@"General\n" \
@" * Public License, either version 2 or 3, which can be found in the " \
@"file\n" \
@" * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the " \
@"packaging of this\n" \
@" * file.\n" \
@" */\n" \
@"/*\n" \
@" * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016\n" \
@" * Jonathan Schleifer <js@heap.zone>\n" \
@" *\n" \
@" * All rights reserved.\n" \
@" *\n" \
@" * This file is part of ObjFW. It may be distributed under the terms " \
@"of the\n" \
@" * Q Public License 1.0, which can be found in the file LICENSE.QPL " \
@"included in\n" \
@" * the packaging of this file.\n" \
@" *\n" \
@" * Alternatively, it may be distributed under the terms of the GNU " \
@"General\n" \
@" * Public License, either version 2 or 3, which can be found in the " \
@"file\n" \
@" * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the " \
@"packaging of this\n" \
@" * file.\n" \
@" */\n" \
@"\n"
|
Modified src/Makefile
from [413693eb52]
to [8b4eefe1a4].
︙ | | |
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
|
SRCS_FILES = OFFile.m \
OFINICategory.m \
OFINIFile.m \
OFSettings.m \
OFZIPArchive.m \
OFZIPArchiveEntry.m
SRCS_PLUGINS = OFPlugin.m
SRCS_SOCKETS = OFHTTPClient.m \
OFHTTPRequest.m \
OFHTTPResponse.m \
OFHTTPServer.m \
OFKernelEventObserver.m \
OFStreamSocket.m \
OFTCPSocket.m \
OFUDPSocket.m \
resolver.m \
SRCS_SOCKETS = OFHTTPClient.m \
OFHTTPRequest.m \
OFHTTPResponse.m \
OFHTTPServer.m \
OFKernelEventObserver.m \
OFKernelEventObserver_LockedQueue.m \
OFStreamSocket.m \
OFTCPSocket.m \
OFUDPSocket.m \
resolver.m \
socket.m
SRCS_THREADS = OFCondition.m \
OFMutex.m \
OFRecursiveMutex.m \
OFThreadPool.m \
threading.m
|
︙ | | |
Modified src/OFApplication.h
from [ed8ed6f607]
to [b86a7582e1].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFApplication.m
from [65102b7290]
to [20cfda2453].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
|
+
|
exit(0);
}
+ (void)terminateWithStatus: (int)status
{
#ifdef _PSP
sceKernelExitGame();
abort(); /* sceKernelExitGame() is not marked noreturn */
#else
exit(status);
#endif
}
- init
{
|
︙ | | |
Modified src/OFArray.h
from [4267d7d56d]
to [2282bc611d].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFArray.m
from [ac5ec4c8c9]
to [db139bebf1].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFArray_adjacent.h
from [8b070c069d]
to [7b7f7ca2e4].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFArray_adjacent.m
from [8679aa9a9b]
to [0a88d7643b].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFArray_adjacentSubarray.h
from [35a14732b3]
to [b0e9e8d77f].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFArray_adjacentSubarray.m
from [4643f61885]
to [1abd78bce4].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFArray_subarray.h
from [5c479443ba]
to [32d1285139].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFArray_subarray.m
from [8021ce3fc8]
to [e6121c411e].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFAutoreleasePool+Private.h
from [15b3ef0a51]
to [7e3d9a000b].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFAutoreleasePool.h
from [c4fa3ea10e]
to [4ad6b8c21e].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFAutoreleasePool.m
from [4ad3cb8fc5]
to [f48e2b8969].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFBigDataArray.h
from [3e034e5ab6]
to [c044c7b83d].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFBigDataArray.m
from [bf49906bdc]
to [33d0695def].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFBlock.h
from [01e4fda855]
to [49d17ee2bf].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFBlock.m
from [c478213743]
to [cbcd129d92].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
|
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
|
-
-
-
+
-
+
-
+
-
-
-
+
-
+
-
+
|
{
int flags = flags_ & (OF_BLOCK_FIELD_IS_BLOCK |
OF_BLOCK_FIELD_IS_OBJECT | OF_BLOCK_FIELD_IS_BYREF);
if (src_ == NULL)
return;
if (flags_ & OF_BLOCK_BYREF_CALLER)
return;
switch (flags) {
case OF_BLOCK_FIELD_IS_BLOCK:
*(of_block_literal_t**)dst_ = _Block_copy(src_);
break;
case OF_BLOCK_FIELD_IS_OBJECT:
if (!(flags_ & OF_BLOCK_BYREF_CALLER))
*(id*)dst_ = [(id)src_ retain];
*(id*)dst_ = [(id)src_ retain];
break;
case OF_BLOCK_FIELD_IS_BYREF:;
of_block_byref_t *src = (of_block_byref_t*)src_;
of_block_byref_t **dst = (of_block_byref_t**)dst_;
if ((src->flags & OF_BLOCK_REFCOUNT_MASK) == 0) {
if ((*dst = malloc(src->size)) == NULL) {
alloc_failed_exception.isa =
[OFAllocFailedException class];
@throw (OFAllocFailedException*)
&alloc_failed_exception;
}
if (src->forwarding == src)
(*dst)->forwarding = *dst;
memcpy(*dst, src, src->size);
if (src->size >= sizeof(of_block_byref_t))
if (src->flags & OF_BLOCK_HAS_COPY_DISPOSE)
src->byref_keep(*dst, src);
} else
*dst = src;
(*dst)->flags++;
break;
}
}
void
_Block_object_dispose(const void *obj_, const int flags_)
{
const int flags = flags_ & (OF_BLOCK_FIELD_IS_BLOCK |
OF_BLOCK_FIELD_IS_OBJECT | OF_BLOCK_FIELD_IS_BYREF);
if (obj_ == NULL)
return;
if (flags_ & OF_BLOCK_BYREF_CALLER)
return;
switch (flags) {
case OF_BLOCK_FIELD_IS_BLOCK:
_Block_release(obj_);
break;
case OF_BLOCK_FIELD_IS_OBJECT:
if (!(flags_ & OF_BLOCK_BYREF_CALLER))
[(id)obj_ release];
[(id)obj_ release];
break;
case OF_BLOCK_FIELD_IS_BYREF:;
of_block_byref_t *obj = (of_block_byref_t*)obj_;
if ((--obj->flags & OF_BLOCK_REFCOUNT_MASK) == 0) {
if (obj->size >= sizeof(of_block_byref_t))
if (obj->flags & OF_BLOCK_HAS_COPY_DISPOSE)
obj->byref_dispose(obj);
free(obj);
}
break;
}
}
|
︙ | | |
Modified src/OFCollection.h
from [ca64037e5a]
to [5f1f118c70].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFCondition.h
from [c33a65126c]
to [aee4a4a25d].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFCondition.m
from [9412b6f2e9]
to [0472d403ca].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFConstantString.h
from [ab4546c924]
to [c56d05cdc3].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFConstantString.m
from [2aeb65a141]
to [3401be807a].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFCountedSet.h
from [5313d3ec39]
to [4c2543f7ee].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFCountedSet.m
from [0df520b24c]
to [58db5c2eab].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFCountedSet_hashtable.h
from [c4031acd18]
to [16296b7375].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFCountedSet_hashtable.m
from [cd05f3d64e]
to [9bea2042bb].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFDataArray+Hashing.h
from [9fd7a3ae5d]
to [b4891dc7e9].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFDataArray+Hashing.m
from [714d6890a9]
to [8e1b2d71a4].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFDataArray+MessagePackValue.h
from [63099f0f3d]
to [bb63a0493c].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFDataArray+MessagePackValue.m
from [f39b7ebe68]
to [d8bc2c6ad4].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFDataArray.h
from [dbaf155683]
to [6415c31d89].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFDataArray.m
from [8d104459de]
to [3e76219b6d].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFDate.h
from [5fea3d4d33]
to [e2abd5c33f].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFDate.m
from [d311cf12a2]
to [eaf0800f6c].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
|
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
|
+
+
+
+
|
- (OFString*)dateStringWithFormat: (OFConstantString*)format
{
OFString *ret;
time_t seconds = (time_t)_seconds;
struct tm tm;
size_t pageSize;
#ifndef _WIN32
char *buffer;
#else
wchar_t *buffer;
#endif
if (seconds != floor(_seconds))
@throw [OFOutOfRangeException exception];
#ifdef HAVE_GMTIME_R
if (gmtime_r(&seconds, &tm) == NULL)
@throw [OFOutOfRangeException exception];
|
︙ | | |
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
|
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
|
+
-
+
+
+
+
+
+
+
+
+
+
+
+
|
# endif
#endif
pageSize = [OFSystemInfo pageSize];
buffer = [self allocMemoryWithSize: pageSize];
@try {
#ifndef _WIN32
if (!strftime(buffer, pageSize, [format UTF8String], &tm))
if (strftime(buffer, pageSize, [format UTF8String], &tm) == 0)
@throw [OFOutOfRangeException exception];
ret = [OFString stringWithUTF8String: buffer];
#else
if (wcsftime(buffer, pageSize / sizeof(wchar_t),
[format UTF16String], &tm) == 0)
@throw [OFOutOfRangeException exception];
ret = [OFString stringWithUTF16String: buffer];
#endif
} @finally {
[self freeMemory: buffer];
}
return ret;
}
- (OFString*)localDateStringWithFormat: (OFConstantString*)format
{
OFString *ret;
time_t seconds = (time_t)_seconds;
struct tm tm;
size_t pageSize;
#ifndef _WIN32
char *buffer;
#else
wchar_t *buffer;
#endif
if (seconds != floor(_seconds))
@throw [OFOutOfRangeException exception];
#ifdef HAVE_LOCALTIME_R
if (localtime_r(&seconds, &tm) == NULL)
@throw [OFOutOfRangeException exception];
|
︙ | | |
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
|
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
|
+
-
+
+
+
+
+
+
+
+
|
# endif
#endif
pageSize = [OFSystemInfo pageSize];
buffer = [self allocMemoryWithSize: pageSize];
@try {
#ifndef _WIN32
if (!strftime(buffer, pageSize, [format UTF8String], &tm))
if (strftime(buffer, pageSize, [format UTF8String], &tm) == 0)
@throw [OFOutOfRangeException exception];
ret = [OFString stringWithUTF8String: buffer];
#else
if (wcsftime(buffer, pageSize / sizeof(wchar_t),
[format UTF16String], &tm) == 0)
@throw [OFOutOfRangeException exception];
ret = [OFString stringWithUTF16String: buffer];
#endif
} @finally {
[self freeMemory: buffer];
}
return ret;
}
|
︙ | | |
Modified src/OFDictionary.h
from [66a93812a2]
to [3657eb7ffb].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFDictionary.m
from [fae9385bda]
to [a8e28196f4].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFDictionary_hashtable.h
from [d0f64480f3]
to [bc4f1aeb21].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFDictionary_hashtable.m
from [69f9af36bb]
to [07ad349225].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFEnumerator.h
from [30b2100737]
to [28dfc5f158].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFEnumerator.m
from [a28f0074a7]
to [8e9ae58628].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFFile.h
from [03d8a7c1d4]
to [87ca2fc4a1].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
+
+
-
+
+
+
-
+
-
+
+
+
+
-
+
-
+
+
+
+
-
+
|
* @param path The new directory to change to
*/
+ (void)changeCurrentDirectoryPath: (OFString*)path;
/*!
* @brief Returns the size of the specified file.
*
* @param path The path to the file whose path should be returned
*
* @return The size of the specified file
*/
+ (of_offset_t)sizeOfFileAtPath: (OFString*)path;
/*!
* @brief Returns the last access time of the specified file.
* @brief Returns the last access time of the specified item.
*
* @param path The path to the file whose last access time should be returned
*
* @return The last access time of the specified file
* @return The last access time of the specified item
*/
+ (OFDate*)accessTimeOfItemAtPath: (OFString*)path;
/*!
* @brief Returns the last modification time of the specified file.
* @brief Returns the last modification time of the specified item.
*
* @param path The path to the file whose last modification time should be
* returned
*
* @return The last modification time of the specified file
* @return The last modification time of the specified item
*/
+ (OFDate*)modificationTimeOfItemAtPath: (OFString*)path;
/*!
* @brief Returns the last status change time of the specified file.
* @brief Returns the last status change time of the specified item.
*
* @param path The path to the file whose last status change time should be
* returned
*
* @return The last status change time of the specified file
* @return The last status change time of the specified item
*/
+ (OFDate*)statusChangeTimeOfItemAtPath: (OFString*)path;
#ifdef OF_HAVE_CHMOD
/*!
* @brief Changes the permissions of an item.
*
|
︙ | | |
280
281
282
283
284
285
286
287
288
289
290
291
292
293
|
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
|
+
|
+ (void)createSymbolicLinkAtPath: (OFString*)destination
withDestinationPath: (OFString*)source;
/*!
* @brief Returns the destination of the symbolic link at the specified path.
*
* @param path The path to the symbolic link
*
* @return The destination of the symbolic link at the specified path
*/
+ (OFString*)destinationOfSymbolicLinkAtPath: (OFString*)path;
#endif
/*!
* @brief Initializes an already allocated OFFile.
|
︙ | | |
Modified src/OFFile.m
from [2c4c5b7c7a]
to [adc8a96b76].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
+
|
#ifdef __wii__
# define BOOL OGC_BOOL
# include <fat.h>
# undef BOOL
#endif
#ifdef OF_NINTENDO_DS
# include <stdbool.h>
# include <filesystem.h>
#endif
#import "OFFile.h"
#import "OFString.h"
#import "OFArray.h"
#ifdef OF_HAVE_THREADS
|
︙ | | |
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
-
+
-
+
|
# define S_IWOTH 0
#endif
#define DEFAULT_MODE S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH
#define DIR_MODE DEFAULT_MODE | S_IXUSR | S_IXGRP | S_IXOTH
#if defined(OF_HAVE_CHOWN) && defined(OF_HAVE_THREADS)
static of_mutex_t mutex;
static of_mutex_t chownMutex;
#endif
#if !defined(HAVE_READDIR_R) && !defined(_WIN32) && defined(OF_HAVE_THREADS)
static of_mutex_t mutex;
static of_mutex_t readdirMutex;
#endif
int
of_stat(OFString *path, of_stat_t *buffer)
{
#if defined(_WIN32)
return _wstat64([path UTF16String], buffer);
|
︙ | | |
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
|
-
+
-
+
|
@implementation OFFile
+ (void)initialize
{
if (self != [OFFile class])
return;
#if defined(OF_HAVE_CHOWN) && defined(OF_HAVE_THREADS)
if (!of_mutex_new(&mutex))
if (!of_mutex_new(&chownMutex))
@throw [OFInitializationFailedException
exceptionWithClass: self];
#endif
#if !defined(HAVE_READDIR_R) && !defined(_WIN32) && defined(OF_HAVE_THREADS)
if (!of_mutex_new(&mutex))
if (!of_mutex_new(&readdirMutex))
@throw [OFInitializationFailedException
exceptionWithClass: self];
#endif
#ifdef __wii__
if (!fatInitDefault())
@throw [OFInitializationFailedException
|
︙ | | |
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
|
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
|
-
+
|
encoding = [OFSystemInfo native8BitEncoding];
if ((dir = opendir([path cStringWithEncoding: encoding])) == NULL)
@throw [OFOpenItemFailedException exceptionWithPath: path
errNo: errno];
# if !defined(HAVE_READDIR_R) && defined(OF_HAVE_THREADS)
if (!of_mutex_lock(&mutex))
if (!of_mutex_lock(&readdirMutex))
@throw [OFLockFailedException exception];
# endif
@try {
for (;;) {
struct dirent *dirent;
# ifdef HAVE_READDIR_R
|
︙ | | |
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
|
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
|
-
+
|
[files addObject: file];
objc_autoreleasePoolPop(pool);
}
} @finally {
closedir(dir);
# if !defined(HAVE_READDIR_R) && defined(OF_HAVE_THREADS)
if (!of_mutex_unlock(&mutex))
if (!of_mutex_unlock(&readdirMutex))
@throw [OFUnlockFailedException exception];
# endif
}
#else
void *pool = objc_autoreleasePoolPush();
HANDLE handle;
WIN32_FIND_DATAW fd;
|
︙ | | |
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
|
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
|
-
+
|
if (path == nil || (owner == nil && group == nil))
@throw [OFInvalidArgumentException exception];
encoding = [OFSystemInfo native8BitEncoding];
# ifdef OF_HAVE_THREADS
if (!of_mutex_lock(&mutex))
if (!of_mutex_lock(&chownMutex))
@throw [OFLockFailedException exception];
@try {
# endif
if (owner != nil) {
struct passwd *passwd;
|
︙ | | |
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
|
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
|
-
+
|
group: group
errNo: errno];
gid = group_->gr_gid;
}
# ifdef OF_HAVE_THREADS
} @finally {
if (!of_mutex_unlock(&mutex))
if (!of_mutex_unlock(&chownMutex))
@throw [OFUnlockFailedException exception];
}
# endif
if (chown([path cStringWithEncoding: encoding], uid, gid) != 0)
@throw [OFChangeOwnerFailedException exceptionWithPath: path
owner: owner
|
︙ | | |
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
|
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
|
+
+
+
-
+
-
+
-
+
|
length: (size_t)length
{
if (_fd == -1 || _atEndOfStream)
@throw [OFWriteFailedException exceptionWithObject: self
requestedLength: length];
#ifndef _WIN32
if (length > SSIZE_MAX)
@throw [OFOutOfRangeException exception];
if (write(_fd, buffer, length) < length)
if (write(_fd, buffer, length) != (ssize_t)length)
@throw [OFWriteFailedException exceptionWithObject: self
requestedLength: length
errNo: errno];
#else
if (length > UINT_MAX)
if (length > INT_MAX)
@throw [OFOutOfRangeException exception];
if (write(_fd, buffer, (unsigned int)length) < length)
if (write(_fd, buffer, (int)length) != (int)length)
@throw [OFWriteFailedException exceptionWithObject: self
requestedLength: length
errNo: errno];
#endif
}
- (of_offset_t)lowlevelSeekToOffset: (of_offset_t)offset
|
︙ | | |
Modified src/OFHTTPClient.h
from [1d478e9a98]
to [9fc7a1edbb].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFHTTPClient.m
from [10e2ede1ff]
to [9d203aa5e2].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
|
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
|
-
+
|
exceptionWithVersion: version];
status = (int)[[line substringWithRange: of_range(9, 3)] decimalValue];
serverHeaders = [OFMutableDictionary dictionary];
for (;;) {
OFString *key, *value;
OFString *key, *value, *old;
const char *lineC, *tmp;
char *keyC;
@try {
line = [socket readLine];
} @catch (OFInvalidEncodingException *e) {
@throw [OFInvalidServerReplyException exception];
|
︙ | | |
544
545
546
547
548
549
550
551
552
553
554
555
556
557
|
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
|
+
+
+
+
|
do {
tmp++;
} while (*tmp == ' ');
value = [OFString stringWithUTF8String: tmp];
old = [serverHeaders objectForKey: key];
if (old != nil)
value = [old stringByAppendingFormat: @",%@", value];
[serverHeaders setObject: value
forKey: key];
}
[serverHeaders makeImmutable];
if ([_delegate respondsToSelector:
|
︙ | | |
Modified src/OFHTTPRequest.h
from [2b094f8687]
to [88cb073e27].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFHTTPRequest.m
from [e92c282719]
to [4edf404fac].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFHTTPResponse.h
from [127c6d8f9d]
to [e8450b7b8a].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFHTTPResponse.m
from [e1187050b5]
to [c2531a2789].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFHTTPServer.h
from [0b4b52c4cd]
to [e9ed10111d].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFHTTPServer.m
from [0ddfcecf31]
to [aed0368bbf].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
|
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
|
-
+
|
_state = PARSING_HEADERS;
return true;
}
- (bool)parseHeaders: (OFString*)line
{
OFString *key, *value;
OFString *key, *value, *old;
size_t pos;
if ([line length] == 0) {
intmax_t contentLength;
@try {
contentLength = [[_headers
|
︙ | | |
495
496
497
498
499
500
501
502
503
504
505
506
507
508
|
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
|
+
+
+
+
|
key = [line substringWithRange: of_range(0, pos)];
value = [line substringWithRange:
of_range(pos + 1, [line length] - pos - 1)];
key = normalizedKey([key stringByDeletingTrailingWhitespaces]);
value = [value stringByDeletingLeadingWhitespaces];
old = [_headers objectForKey: key];
if (old != nil)
value = [old stringByAppendingFormat: @",%@", value];
[_headers setObject: value
forKey: key];
if ([key isEqual: @"Host"]) {
pos = [value
rangeOfString: @":"
options: OF_STRING_SEARCH_BACKWARDS].location;
|
︙ | | |
Modified src/OFHash.h
from [3d6ceb79ea]
to [6d0f84c905].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFINICategory+Private.h
from [57eb45a3d8]
to [1f82c2eb76].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFINICategory.h
from [e2014b9e81]
to [b6e8828c38].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFINICategory.m
from [54b832fdf6]
to [cb3bb13628].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFINIFile.h
from [0ded227d84]
to [140ee5468f].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFINIFile.m
from [7499aebd7d]
to [ebaa0e80cf].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFInflate64Stream.h
from [90b8b21020]
to [71a119fb43].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFInflate64Stream.m
from [25c8034409]
to [b2473b7a3a].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFInflateStream.h
from [b2d90d3bc7]
to [677d90ca2c].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFInflateStream.m
from [8adcdb3a6b]
to [91e7a25cd0].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFIntrospection.h
from [061b43fb0e]
to [a23f4b46cf].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFIntrospection.m
from [28d5671231]
to [2f90f7ce1e].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFJSONRepresentation.h
from [8dc534c0fd]
to [59b99a7d9c].
1
2
3
4
5
6
7
8
9
10
|
1
2
3
4
5
6
7
8
9
10
|
-
-
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
|
︙ | | |
Modified src/OFKernelEventObserver+Private.h
from [e624333841]
to [1372173ce7].
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
-
-
+
+
-
-
-
-
-
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
* 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.
*/
#import "OFKernelEventObserver.h"
OF_ASSUME_NONNULL_BEGIN
@interface OFKernelEventObserver (OF_PRIVATE_CATEGORY)
- (void)OF_addObjectForReading: (id)object;
- (void)OF_addObjectForWriting: (id)object;
- (void)OF_removeObjectForReading: (id)object;
- (void)OF_removeObjectForWriting: (id)object;
- (void)OF_processQueueAndStoreRemovedIn: (nullable OFMutableArray*)removed;
- (void)OF_processReadBuffers;
@end
OF_ASSUME_NONNULL_END
|
Modified src/OFKernelEventObserver.h
from [dd8f6e2345]
to [b2db698d51].
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
-
-
+
+
-
-
+
-
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
* 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.
*/
#import "OFObject.h"
#import "socket.h"
OF_ASSUME_NONNULL_BEGIN
@class OFMutableArray OF_GENERIC(ObjectType);
@class OFMutableDictionary OF_GENERIC(KeyType, ObjectType);
@class OFDataArray;
@class OFDate;
#ifdef OF_HAVE_THREADS
@class OFMutex;
#endif
@class OFDate;
/*!
* @protocol OFKernelEventObserverDelegate
* OFKernelEventObserver.h ObjFW/OFKernelEventObserver.h
*
* @brief A protocol that needs to be implemented by delegates for
* OFKernelEventObserver.
|
︙ | | |
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
-
-
|
*/
@interface OFKernelEventObserver: OFObject
{
OFMutableArray OF_GENERIC(id <OFReadyForReadingObserving>)
*_readObjects;
OFMutableArray OF_GENERIC(id <OFReadyForWritingObserving>)
*_writeObjects;
OFMutableArray *_queue;
OFDataArray *_queueActions;
id <OFKernelEventObserverDelegate> _delegate;
#ifdef OF_HAVE_PIPE
int _cancelFD[2];
#else
of_socket_t _cancelFD[2];
struct sockaddr_in _cancelAddr;
#endif
|
︙ | | |
Modified src/OFKernelEventObserver.m
from [b099b55bf8]
to [74500121cd].
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
-
-
+
+
-
-
-
-
+
-
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015
* Jonathan Schleifer <js@webkeks.org>
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
* 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.
*/
#define __NO_EXT_QNX
#include "config.h"
#include <assert.h>
#import "OFKernelEventObserver.h"
#import "OFKernelEventObserver+Private.h"
#import "OFArray.h"
#import "OFDictionary.h"
#import "OFStream.h"
#import "OFStream+Private.h"
#import "OFDataArray.h"
#ifndef OF_HAVE_PIPE
# import "OFStreamSocket.h"
#endif
#import "OFDate.h"
#ifdef OF_HAVE_THREADS
# import "OFMutex.h"
#endif
#import "OFDate.h"
#ifdef HAVE_KQUEUE
# import "OFKernelEventObserver_kqueue.h"
#endif
#ifdef HAVE_EPOLL
# import "OFKernelEventObserver_epoll.h"
#endif
|
︙ | | |
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
+
+
+
-
+
-
-
-
-
-
-
|
#import "OFInitializationFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFOutOfRangeException.h"
#import "socket.h"
#import "socket_helpers.h"
#ifdef __wii__
/* FIXME: Add a port registry for Wii */
static uint16_t freePort = 65535;
enum {
#endif
QUEUE_ADD = 0,
QUEUE_REMOVE = 1,
QUEUE_READ = 0,
QUEUE_WRITE = 2
};
#define QUEUE_ACTION (QUEUE_ADD | QUEUE_REMOVE)
@implementation OFKernelEventObserver
+ (void)initialize
{
if (self != [OFKernelEventObserver class])
return;
|
︙ | | |
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
|
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
-
-
-
+
-
+
|
@try {
#if !defined(OF_HAVE_PIPE) && !defined(__wii__)
socklen_t cancelAddrLen;
#endif
_readObjects = [[OFMutableArray alloc] init];
_writeObjects = [[OFMutableArray alloc] init];
_queue = [[OFMutableArray alloc] init];
_queueActions = [[OFDataArray alloc]
initWithItemSize: sizeof(int)];
#ifdef OF_HAVE_PIPE
if (pipe(_cancelFD))
@throw [OFInitializationFailedException
exceptionWithClass: [self class]];
#else
_cancelFD[0] = _cancelFD[1] = socket(AF_INET, SOCK_DGRAM, 0);
if (_cancelFD[0] == INVALID_SOCKET)
@throw [OFInitializationFailedException
exceptionWithClass: [self class]];
_cancelAddr.sin_family = AF_INET;
_cancelAddr.sin_port = 0;
_cancelAddr.sin_addr.s_addr = inet_addr("127.0.0.1");
# ifdef __wii__
_cancelAddr.sin_len = 8;
/* The Wii does not accept port 0 as "choose any free port" */
_cancelAddr.sin_port = 65535;
_cancelAddr.sin_port = freePort--;
# endif
if (bind(_cancelFD[0], (struct sockaddr*)&_cancelAddr,
sizeof(_cancelAddr)))
@throw [OFInitializationFailedException
exceptionWithClass: [self class]];
|
︙ | | |
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
|
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
|
-
+
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
{
close(_cancelFD[0]);
if (_cancelFD[1] != _cancelFD[0])
close(_cancelFD[1]);
[_readObjects release];
[_writeObjects release];
[_queue release];
[_queueActions release];
#ifdef OF_HAVE_THREADS
[_mutex release];
#endif
[super dealloc];
}
- (id <OFKernelEventObserverDelegate>)delegate
{
return _delegate;
}
- (void)setDelegate: (id <OFKernelEventObserverDelegate>)delegate
{
_delegate = delegate;
}
- (void)addObjectForReading: (id <OFReadyForReadingObserving>)object
{
#ifdef OF_HAVE_THREADS
[_mutex lock];
#endif
@try {
int qi = QUEUE_ADD | QUEUE_READ;
OF_UNRECOGNIZED_SELECTOR
[_queue addObject: object];
[_queueActions addItem: &qi];
} @finally {
#ifdef OF_HAVE_THREADS
[_mutex unlock];
#endif
}
}
[self cancel];
}
- (void)addObjectForWriting: (id <OFReadyForWritingObserving>)object
{
#ifdef OF_HAVE_THREADS
[_mutex lock];
#endif
@try {
int qi = QUEUE_ADD | QUEUE_WRITE;
OF_UNRECOGNIZED_SELECTOR
[_queue addObject: object];
[_queueActions addItem: &qi];
} @finally {
#ifdef OF_HAVE_THREADS
[_mutex unlock];
#endif
}
}
[self cancel];
}
- (void)removeObjectForReading: (id <OFReadyForReadingObserving>)object
{
#ifdef OF_HAVE_THREADS
[_mutex lock];
#endif
@try {
int qi = QUEUE_REMOVE | QUEUE_READ;
OF_UNRECOGNIZED_SELECTOR
[_queue addObject: object];
[_queueActions addItem: &qi];
} @finally {
#ifdef OF_HAVE_THREADS
[_mutex unlock];
#endif
}
[self cancel];
}
- (void)removeObjectForWriting: (id <OFReadyForWritingObserving>)object
{
#ifdef OF_HAVE_THREADS
[_mutex lock];
#endif
@try {
int qi = QUEUE_REMOVE | QUEUE_WRITE;
[_queue addObject: object];
[_queueActions addItem: &qi];
} @finally {
#ifdef OF_HAVE_THREADS
[_mutex unlock];
#endif
}
[self cancel];
}
- (void)OF_addObjectForReading: (id)object
{
OF_UNRECOGNIZED_SELECTOR
}
- (void)OF_addObjectForWriting: (id)object
{
OF_UNRECOGNIZED_SELECTOR
}
- (void)OF_removeObjectForReading: (id)object
{
OF_UNRECOGNIZED_SELECTOR
}
- (void)OF_removeObjectForWriting: (id)object
{
OF_UNRECOGNIZED_SELECTOR
}
- (void)OF_processQueueAndStoreRemovedIn: (OFMutableArray*)removed
{
#ifdef OF_HAVE_THREADS
[_mutex lock];
#endif
@try {
id const *queueObjects = [_queue objects];
int *queueActionItems = [_queueActions items];
size_t i, count = [_queue count];
for (i = 0; i < count; i++) {
id object = queueObjects[i];
int action = queueActionItems[i];
switch (action) {
case QUEUE_ADD | QUEUE_READ:
[_readObjects addObject: object];
[self OF_addObjectForReading: object];
break;
case QUEUE_ADD | QUEUE_WRITE:
[_writeObjects addObject: object];
[self OF_addObjectForWriting: object];
break;
case QUEUE_REMOVE | QUEUE_READ:
[self OF_removeObjectForReading: object];
[removed addObject: object];
[_readObjects removeObjectIdenticalTo: object];
break;
case QUEUE_REMOVE | QUEUE_WRITE:
[self OF_removeObjectForWriting: object];
[removed addObject: object];
[_writeObjects removeObjectIdenticalTo: object];
break;
default:
assert(0);
}
}
[_queue removeAllObjects];
[_queueActions removeAllItems];
} @finally {
#ifdef OF_HAVE_THREADS
[_mutex unlock];
#endif
}
}
- (void)observe
{
[self observeForTimeInterval: -1];
}
|
︙ | | |
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
|
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
|
+
-
-
+
+
+
+
+
+
|
}
- (void)cancel
{
#ifdef OF_HAVE_PIPE
OF_ENSURE(write(_cancelFD[1], "", 1) > 0);
#else
# ifndef __wii__
OF_ENSURE(sendto(_cancelFD[1], "", 1, 0, (struct sockaddr*)&_cancelAddr,
sizeof(_cancelAddr)) > 0);
OF_ENSURE(sendto(_cancelFD[1], "", 1, 0,
(struct sockaddr*)&_cancelAddr, sizeof(_cancelAddr)) > 0);
# else
OF_ENSURE(sendto(_cancelFD[1], "", 1, 0,
(struct sockaddr*)&_cancelAddr, 8) > 0);
# endif
#endif
}
- (void)OF_processReadBuffers
{
id const *objects = [_readObjects objects];
size_t i, count = [_readObjects count];
|
︙ | | |
Added src/OFKernelEventObserver_LockedQueue.h version [67a5a5872e].
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
/*
* Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
* Jonathan Schleifer <js@heap.zone>
*
* All rights reserved.
*
* This file is part of ObjFW. It may be distributed under the terms of the
* Q Public License 1.0, which can be found in the file LICENSE.QPL included in
* the packaging of this file.
*
* 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.
*/
#import "OFKernelEventObserver.h"
OF_ASSUME_NONNULL_BEGIN
@class OFMutableArray OF_GENERIC(ObjectType);
@class OFDataArray;
@interface OFKernelEventObserver_LockedQueue: OFKernelEventObserver
{
OFDataArray *_queueActions, *_queueFDs;
OFMutableArray *_queueObjects;
}
- (void)OF_addObjectForReading: (id)object
fileDescriptor: (int)fd;
- (void)OF_addObjectForWriting: (id)object
fileDescriptor: (int)fd;
- (void)OF_removeObjectForReading: (id)object
fileDescriptor: (int)fd;
- (void)OF_removeObjectForWriting: (id)object
fileDescriptor: (int)fd;
- (void)OF_processQueue;
@end
OF_ASSUME_NONNULL_END
|
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
Added src/OFKernelEventObserver_LockedQueue.m version [abbca7e630].