ObjFW  Check-in [05ccd59b38]

Overview
Comment:Merge trunk into 1.0 branch
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | 1.0
Files: files | file ages | folders
SHA3-256: 05ccd59b38c2f20756a4687ad99a5269809ccfd99a2805564e7ec3e23c2459c6
User & Date: js on 2023-10-08 07:41:54
Other Links: branch diff | manifest | tags
Context
2023-10-08
08:05
Merge trunk into 1.0 branch check-in: a820714178 user: js tags: 1.0
07:41
Merge trunk into 1.0 branch check-in: 05ccd59b38 user: js tags: 1.0
2023-10-02
22:38
README.md: Remove paragraph about opening the repo check-in: 0dc8f1b5cd user: js tags: trunk
2023-09-14
19:12
Set version to 1.0.3 check-in: 25b38d0c06 user: js tags: 1.0, 1.0.3-release
Changes

Modified README.md from [af3f3c85c5] to [ab455f4c69].

1
2
3
4
5
6
7
8
9
10
11
12
13

14
15
16
17
18
19
20
21
22
23
24
There are three ways you are probably reading this right now:

 * On [ObjFW](https://objfw.nil.im/)'s homepage, via Fossil's web interface
 * On [GitHub](https://github.com/ObjFW/ObjFW)
 * Via an editor or pager, by opening `README.md` from a clone or tarball

ObjFW is developed using Fossil, so if you are reading this on GitHub or any
other place, you are most likely using a mirror.


<h1 id="table-of-contents">Table of Contents</h1>

 * [What is ObjFW?](#what)

 * [License](#license)
 * [Releases](#releases)
 * [Cloning the repository](#cloning)
 * [Installation](#installation)
   * [macOS and iOS](#macos-and-ios)
     * [Building as a framework](#building-framework)
     * [Using the macOS or iOS framework in Xcode](#framework-in-xcode)
     * [Broken Xcode versions](#broken-xcode-versions)
   * [Windows](#windows)
     * [Getting MSYS2](#getting-msys2)
     * [Setting up MSYS2](#setting-up-msys2)













>



|







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
There are three ways you are probably reading this right now:

 * On [ObjFW](https://objfw.nil.im/)'s homepage, via Fossil's web interface
 * On [GitHub](https://github.com/ObjFW/ObjFW)
 * Via an editor or pager, by opening `README.md` from a clone or tarball

ObjFW is developed using Fossil, so if you are reading this on GitHub or any
other place, you are most likely using a mirror.


<h1 id="table-of-contents">Table of Contents</h1>

 * [What is ObjFW?](#what)
 * [Installation](#installation)
 * [License](#license)
 * [Releases](#releases)
 * [Cloning the repository](#cloning)
 * [Building from source](#building-from-source)
   * [macOS and iOS](#macos-and-ios)
     * [Building as a framework](#building-framework)
     * [Using the macOS or iOS framework in Xcode](#framework-in-xcode)
     * [Broken Xcode versions](#broken-xcode-versions)
   * [Windows](#windows)
     * [Getting MSYS2](#getting-msys2)
     * [Setting up MSYS2](#setting-up-msys2)
70
71
72
73
74
75
76























77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
     leading to bugs. ObjFW fixes this by making exceptions a first class
     citizen.

  ObjFW also comes with its own lightweight and extremely fast Objective-C
  runtime, which in real world use cases was found to be significantly faster
  than both GNU's and Apple's runtime.

























<h1 id="license">License</h1>

  ObjFW is released under three licenses:

   * [QPL](LICENSE.QPL)
   * [GPLv2](LICENSE.GPLv2)
   * [GPLv3](LICENSE.GPLv3)

  The QPL allows you to use ObjFW in any open source project. Because the GPL
  does not allow using code under any other license, ObjFW is also available
  under the GPLv2 and GPLv3 to allow GPL-licensed projects to use ObjFW.

  You can pick under which of those three licenses you want to use ObjFW. If
  none of them work for you, contact me and we can find a solution.


<h1 id="releases">Releases</h1>

  Releases of ObjFW, as well as changelogs and the accompanying documentation
  can be found [here](https://objfw.nil.im/wiki?name=Releases).


<h1 id="cloning">Cloning the repository</h1>

  ObjFW is developed in a [Fossil](https://fossil-scm.org) repository, with
  automatic incremental exports to Git. This means you can either clone the







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>



















|







71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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
     leading to bugs. ObjFW fixes this by making exceptions a first class
     citizen.

  ObjFW also comes with its own lightweight and extremely fast Objective-C
  runtime, which in real world use cases was found to be significantly faster
  than both GNU's and Apple's runtime.


<h1 id="installation">Installation</h1>

  ObjFW packages are available for various operating systems and can be
  installed as following:

  Operating System | Command
  -----------------|---------------------------------------------
  Alpine Linux     | `doas apk add objfw`
  CRUX             | `sudo prt-get depinst objfw`
  Fedora           | `sudo dnf install objfw`
  FreeBSD          | `sudo pkg install objfw`
  Haiku            | `pkgman install objfw`
  Haiku (gcc2h)    | `pkgman install objfw_x86`
  macOS (Homebrew) | `brew install objfw`
  macOS (pkgsrc)   | `cd $PKGSRCDIR/devel/objfw && make install`
  NetBSD           | `cd /usr/pkgsrc/devel/objfw && make install`
  OpenBSD          | `doas pkg_add objfw`
  OpenIndiana      | `sudo pkg install developer/objfw`

  If your operating system is not listed, you can
  <a href="#building-from-source">build ObjFW from source</a>.  


<h1 id="license">License</h1>

  ObjFW is released under three licenses:

   * [QPL](LICENSE.QPL)
   * [GPLv2](LICENSE.GPLv2)
   * [GPLv3](LICENSE.GPLv3)

  The QPL allows you to use ObjFW in any open source project. Because the GPL
  does not allow using code under any other license, ObjFW is also available
  under the GPLv2 and GPLv3 to allow GPL-licensed projects to use ObjFW.

  You can pick under which of those three licenses you want to use ObjFW. If
  none of them work for you, contact me and we can find a solution.


<h1 id="releases">Releases</h1>

  Releases of ObjFW, as well as change logs and the accompanying documentation,
  can be found [here](https://objfw.nil.im/wiki?name=Releases).


<h1 id="cloning">Cloning the repository</h1>

  ObjFW is developed in a [Fossil](https://fossil-scm.org) repository, with
  automatic incremental exports to Git. This means you can either clone the
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
140
141
142
143
144
145
146
147
148
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

  You can then use Fossil's web interface to browse the timeline, tickets,
  wiki pages, etc.:

    $ cd objfw
    $ fossil ui

  It's also possible to open the same local repository multiple times, so that
  you have multiple working directories all backed by the same local
  repository.

  In order to verify the signature of the currently checked out checkin, you
  can use:

    $ fossil artifact current | gpg --verify

  Please note that not all checkins are signed, as the signing key only resides
  on trusted systems. This means that checkins I perform on e.g. Windows are
  unsigned. However, usually it should not take long until there is another
  signed checkin. Alternatively, you can go back until the last signed checkin
  and review changes from there on.

<h2 id="cloning-git">Git</h2>

  To clone the Git repository, use the following:

    $ git clone https://github.com/ObjFW/ObjFW

  Git commits are not signed, so if you want to check the signature of an
  individual commit, branch head or tag, please use Fossil.

<h1 id="installation">Installation</h1>

  To install ObjFW, just run the following commands:

    $ ./configure
    $ make
    $ make check
    $ sudo make install

  In case you checked out ObjFW from the Fossil or Git repository, you need to
  run the following command first:

    $ ./autogen.sh

<h2 id="macos-and-ios">macOS and iOS</h2>

<h3 id="building-framework">Building as a framework</h3>

  When building for macOS or iOS, everything is built as a `.framework` by
  default if `--disable-shared` has not been specified to `./configure`. The
  frameworks will end up in `$PREFIX/Library/Frameworks`.

  To build for macOS, just follow the
  <a href="#installation">regular instructions</a> above.

  To build for iOS, follow the regular instructions, but instead of
  `./configure` do something like this:

    $ clang="xcrun --sdk iphoneos clang"
    $ export OBJC="$clang -arch arm64e -arch arm64"
    $ export OBJCPP="$clang -arch arm64e -E"







<
<
<
<




















|

|




















|







137
138
139
140
141
142
143




144
145
146
147
148
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

  You can then use Fossil's web interface to browse the timeline, tickets,
  wiki pages, etc.:

    $ cd objfw
    $ fossil ui





  In order to verify the signature of the currently checked out checkin, you
  can use:

    $ fossil artifact current | gpg --verify

  Please note that not all checkins are signed, as the signing key only resides
  on trusted systems. This means that checkins I perform on e.g. Windows are
  unsigned. However, usually it should not take long until there is another
  signed checkin. Alternatively, you can go back until the last signed checkin
  and review changes from there on.

<h2 id="cloning-git">Git</h2>

  To clone the Git repository, use the following:

    $ git clone https://github.com/ObjFW/ObjFW

  Git commits are not signed, so if you want to check the signature of an
  individual commit, branch head or tag, please use Fossil.

<h1 id="building-from-source">Building from source</h1>

  To build ObjFW from source and install it, just run the following commands:

    $ ./configure
    $ make
    $ make check
    $ sudo make install

  In case you checked out ObjFW from the Fossil or Git repository, you need to
  run the following command first:

    $ ./autogen.sh

<h2 id="macos-and-ios">macOS and iOS</h2>

<h3 id="building-framework">Building as a framework</h3>

  When building for macOS or iOS, everything is built as a `.framework` by
  default if `--disable-shared` has not been specified to `./configure`. The
  frameworks will end up in `$PREFIX/Library/Frameworks`.

  To build for macOS, just follow the
  <a href="#building-from-source">regular instructions</a> above.

  To build for iOS, follow the regular instructions, but instead of
  `./configure` do something like this:

    $ clang="xcrun --sdk iphoneos clang"
    $ export OBJC="$clang -arch arm64e -arch arm64"
    $ export OBJCPP="$clang -arch arm64e -E"

Modified src/OFHTTPClient.m from [e9090ece5a] to [f5ef5b6f99].

174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
		authorization = [OFString stringWithFormat:
		    @"Basic %@", authorizationData.stringByBase64Encoding];

		[headers setObject: authorization forKey: @"Authorization"];
	}

	if ([headers objectForKey: @"User-Agent"] == nil)
		[headers setObject: @"Something using ObjFW "
				    @"<https://objfw.nil.im/>"
			    forKey: @"User-Agent"];

	if (request.protocolVersion.major == 1 &&
	    request.protocolVersion.minor == 0 &&
	    [headers objectForKey: @"Connection"] == nil)
		[headers setObject: @"keep-alive" forKey: @"Connection"];








|
|







174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
		authorization = [OFString stringWithFormat:
		    @"Basic %@", authorizationData.stringByBase64Encoding];

		[headers setObject: authorization forKey: @"Authorization"];
	}

	if ([headers objectForKey: @"User-Agent"] == nil)
		[headers setObject: @"OFHTTPClient (ObjFW's HTTP client class "
				    @"<https://objfw.nil.im/>)"
			    forKey: @"User-Agent"];

	if (request.protocolVersion.major == 1 &&
	    request.protocolVersion.minor == 0 &&
	    [headers objectForKey: @"Connection"] == nil)
		[headers setObject: @"keep-alive" forKey: @"Connection"];

Modified src/OFSystemInfo.m from [0621210a4b] to [2ae1048a93].

156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#elif defined(OF_DJGPP)
	operatingSystemName = [[OFString alloc]
	    initWithCString: _os_flavor
		   encoding: OFStringEncodingASCII];
#elif defined(HAVE_SYS_UTSNAME_H) && defined(HAVE_UNAME)
	struct utsname name;

	if (uname(&name) != 0)
		return;

	operatingSystemName = [[OFString alloc]
	    initWithCString: name.sysname
		   encoding: [OFLocale encoding]];
#endif
}







|







156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#elif defined(OF_DJGPP)
	operatingSystemName = [[OFString alloc]
	    initWithCString: _os_flavor
		   encoding: OFStringEncodingASCII];
#elif defined(HAVE_SYS_UTSNAME_H) && defined(HAVE_UNAME)
	struct utsname name;

	if (uname(&name) == -1)
		return;

	operatingSystemName = [[OFString alloc]
	    initWithCString: name.sysname
		   encoding: [OFLocale encoding]];
#endif
}
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
	    initWithFormat: @"%u.%u", _osmajor, _osminor];
#elif defined(OF_WII) || defined(NINTENDO_3DS) || defined(OF_NINTENDO_DS) || \
    defined(OF_PSP)
	/* Intentionally nothing */
#elif defined(HAVE_SYS_UTSNAME_H) && defined(HAVE_UNAME)
	struct utsname name;

	if (uname(&name) != 0)
		return;

	operatingSystemVersion = [[OFString alloc]
	    initWithCString: name.release
		   encoding: [OFLocale encoding]];
#endif
}







|







253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
	    initWithFormat: @"%u.%u", _osmajor, _osminor];
#elif defined(OF_WII) || defined(NINTENDO_3DS) || defined(OF_NINTENDO_DS) || \
    defined(OF_PSP)
	/* Intentionally nothing */
#elif defined(HAVE_SYS_UTSNAME_H) && defined(HAVE_UNAME)
	struct utsname name;

	if (uname(&name) == -1)
		return;

	operatingSystemVersion = [[OFString alloc]
	    initWithCString: name.release
		   encoding: [OFLocale encoding]];
#endif
}

Modified tests/OFMatrix4x4Tests.m from [953b65c5c6] to [351b3bb4a8].

76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
	    [OFMatrix4x4 matrixWithValues: (const float [4][4]){
		{  9000, 10000, 11000, 12000 },
		{ 20200, 22800, 25400, 28000 },
		{ 31400, 35600, 39800, 44000 },
		{ 42600, 48400, 54200, 60000 }
	    }]])

	TEST(@"[-translateWithVector:]",
	    (matrix2 = [OFMatrix4x4 identityMatrix]) &&
	    R([matrix2 translateWithVector: OFMakeVector3D(1, 2, 3)]) &&
	    R(point =
	    [matrix2 transformedVector: OFMakeVector4D(2, 3, 4, 1)]) &&
	    point.x == 3 && point.y == 5 && point.z == 7 && point.w == 1)

	TEST(@"-[scaleWithVector:]",







|







76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
	    [OFMatrix4x4 matrixWithValues: (const float [4][4]){
		{  9000, 10000, 11000, 12000 },
		{ 20200, 22800, 25400, 28000 },
		{ 31400, 35600, 39800, 44000 },
		{ 42600, 48400, 54200, 60000 }
	    }]])

	TEST(@"-[translateWithVector:]",
	    (matrix2 = [OFMatrix4x4 identityMatrix]) &&
	    R([matrix2 translateWithVector: OFMakeVector3D(1, 2, 3)]) &&
	    R(point =
	    [matrix2 transformedVector: OFMakeVector4D(2, 3, 4, 1)]) &&
	    point.x == 3 && point.y == 5 && point.z == 7 && point.w == 1)

	TEST(@"-[scaleWithVector:]",

Modified utils/ofarc/localization/de.json from [173fef355f] to [8efe141d12].










1
2
3
4
5
6
7









{
    "usage": [
        "Benutzung: %[prog] -[acCfhlnpqtvx] archiv.zip [datei1 datei2 ...]"
    ],
    "full_usage": [
        "Optionen:\n",
        "    -a  --append      Zu Archiv hinzufügen\n",
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
 * German localization for ofarc.
 *
 * Copyright (c) 2017-2023 Jonathan Schleifer <js@nil.im>
 *
 * Permission to use, copy, modify, and/or distribute this localization for
 * any purpose with or without fee is hereby granted.
 */

{
    "usage": [
        "Benutzung: %[prog] -[acCfhlnpqtvx] archiv.zip [datei1 datei2 ...]"
    ],
    "full_usage": [
        "Optionen:\n",
        "    -a  --append      Zu Archiv hinzufügen\n",

Modified utils/ofarc/localization/localizations.json from [1722bb6119] to [3b7bf346d5].










1
2
3
4
5
6
7









{
    "de": {
        "": "de"
    },
    "deutsch": {
        "": "de"
    },
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
 * Localization mapping for ofarc.
 *
 * Copyright (c) 2017-2023 Jonathan Schleifer <js@nil.im>
 *
 * Permission to use, copy, modify, and/or distribute this mapping for any
 * purpose with or without fee is hereby granted.
 */

{
    "de": {
        "": "de"
    },
    "deutsch": {
        "": "de"
    },

Modified utils/ofdns/localization/de.json from [86f1735865] to [00f9ddff1d].










1
2
3
4
5
6
7









{
    "usage": "Benutzung: %[prog] -[chst] domain1 [domain2 ...]",
    "full_usage": [
        "Optionen:\n",
        "    -c  --class   Die anzufragende DNS-Klasse (standardmäßig IN)\n",
        "    -h  --help    Diese Hilfe anzeigen\n",
        "    -s  --server  Der abzufragende Server\n",
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
 * German localization for ofdns.
 *
 * Copyright (c) 2020-2023 Jonathan Schleifer <js@nil.im>
 *
 * Permission to use, copy, modify, and/or distribute this localization for
 * any purpose with or without fee is hereby granted.
 */

{
    "usage": "Benutzung: %[prog] -[chst] domain1 [domain2 ...]",
    "full_usage": [
        "Optionen:\n",
        "    -c  --class   Die anzufragende DNS-Klasse (standardmäßig IN)\n",
        "    -h  --help    Diese Hilfe anzeigen\n",
        "    -s  --server  Der abzufragende Server\n",

Modified utils/ofdns/localization/localizations.json from [1722bb6119] to [48cf40147f].










1
2
3
4
5
6
7









{
    "de": {
        "": "de"
    },
    "deutsch": {
        "": "de"
    },
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
 * Localization mapping for ofdns.
 *
 * Copyright (c) 2020-2023 Jonathan Schleifer <js@nil.im>
 *
 * Permission to use, copy, modify, and/or distribute this mapping for any
 * purpose with or without fee is hereby granted.
 */

{
    "de": {
        "": "de"
    },
    "deutsch": {
        "": "de"
    },

Modified utils/ofhash/localization/de.json from [e3d21e1de1] to [90f618c8e5].










1
2
3
4
5
6
7









{
    "usage": [
        "Benutzung: %[prog] [--md5] [--ripemd160] [--sha1] [--sha224] ",
        "[--sha256] [--sha384] [--sha512] datei1 [datei2 ...]"
    ],
    "unknown_long_option": "%[prog]: Unbekannte Option: --%[opt]",
    "unknown_option": "%[prog]: Unbekannte Option: -%[opt]",
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
 * German localization for ofhash.
 *
 * Copyright (c) 2017-2023 Jonathan Schleifer <js@nil.im>
 *
 * Permission to use, copy, modify, and/or distribute this localization for
 * any purpose with or without fee is hereby granted.
 */

{
    "usage": [
        "Benutzung: %[prog] [--md5] [--ripemd160] [--sha1] [--sha224] ",
        "[--sha256] [--sha384] [--sha512] datei1 [datei2 ...]"
    ],
    "unknown_long_option": "%[prog]: Unbekannte Option: --%[opt]",
    "unknown_option": "%[prog]: Unbekannte Option: -%[opt]",

Modified utils/ofhash/localization/localizations.json from [1722bb6119] to [6d7174d6b9].










1
2
3
4
5
6
7









{
    "de": {
        "": "de"
    },
    "deutsch": {
        "": "de"
    },
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
 * Localization mapping for ofhash.
 *
 * Copyright (c) 2017-2023 Jonathan Schleifer <js@nil.im>
 *
 * Permission to use, copy, modify, and/or distribute this mapping for any
 * purpose with or without fee is hereby granted.
 */

{
    "de": {
        "": "de"
    },
    "deutsch": {
        "": "de"
    },

Modified utils/ofhttp/localization/de.json from [380be9aeb8] to [c2800d271b].










1
2
3
4
5
6
7









{
    "usage": "Benutzung: %[prog] -[cehHmoOPqv] iri1 [iri2 ...]",
    "full_usage": [
        "Optionen:\n",
        "    -b  --body             Angegebene Datei als Body übergeben\n",
        "                           (- für Standard-Eingabe)\n",
        "    -c  --continue         Download von existierender Datei ",
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
 * German localization for ofhttp.
 *
 * Copyright (c) 2017-2023 Jonathan Schleifer <js@nil.im>
 *
 * Permission to use, copy, modify, and/or distribute this localization for
 * any purpose with or without fee is hereby granted.
 */

{
    "usage": "Benutzung: %[prog] -[cehHmoOPqv] iri1 [iri2 ...]",
    "full_usage": [
        "Optionen:\n",
        "    -b  --body             Angegebene Datei als Body übergeben\n",
        "                           (- für Standard-Eingabe)\n",
        "    -c  --continue         Download von existierender Datei ",

Modified utils/ofhttp/localization/localizations.json from [1722bb6119] to [fed01a059f].










1
2
3
4
5
6
7









{
    "de": {
        "": "de"
    },
    "deutsch": {
        "": "de"
    },
>
>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*
 * Localization mapping for ofhttp.
 *
 * Copyright (c) 2017-2023 Jonathan Schleifer <js@nil.im>
 *
 * Permission to use, copy, modify, and/or distribute this mapping for any
 * purpose with or without fee is hereby granted.
 */

{
    "de": {
        "": "de"
    },
    "deutsch": {
        "": "de"
    },