ObjFW  Check-in [88b19eae2c]

Overview
Comment:Allow boxing of most structs
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 88b19eae2c930c66e9b1f27761ea316f62ccb3c4f477eaf5d7c9a62663c288c3
User & Date: js on 2018-01-21 02:20:49
Other Links: manifest | tags
Context
2018-01-21
03:02
OFValue: Conform to OFCopying check-in: 6ca5d172b9 user: js tags: trunk
02:20
Allow boxing of most structs check-in: 88b19eae2c user: js tags: trunk
02:02
README.md: Update for removed Xcode project check-in: 95f945430a user: js tags: trunk
Changes

Modified Doxyfile from [99508566f6] to [91048eb344].

1
2
3
4
5
6
7
8
9

10
11
12
13
14
15
16
PROJECT_NAME = "ObjFW"
OUTPUT_DIRECTORY = docs/
INPUT = src src/exceptions
FILE_PATTERNS = *.h *.m
HTML_OUTPUT = .
GENERATE_LATEX = NO
HIDE_UNDOC_CLASSES = YES
HIDE_UNDOC_MEMBERS = YES
PREDEFINED = DOXYGEN				\

	     OF_CONSUMED			\
	     OF_DESIGNATED_INITIALIZER		\
	     OF_GENERIC(...)=			\
	     OF_HAVE_BLOCKS			\
	     OF_HAVE_FILES			\
	     OF_HAVE_SANDBOX			\
	     OF_HAVE_SOCKETS			\









>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
PROJECT_NAME = "ObjFW"
OUTPUT_DIRECTORY = docs/
INPUT = src src/exceptions
FILE_PATTERNS = *.h *.m
HTML_OUTPUT = .
GENERATE_LATEX = NO
HIDE_UNDOC_CLASSES = YES
HIDE_UNDOC_MEMBERS = YES
PREDEFINED = DOXYGEN				\
	     OF_BOXABLE				\
	     OF_CONSUMED			\
	     OF_DESIGNATED_INITIALIZER		\
	     OF_GENERIC(...)=			\
	     OF_HAVE_BLOCKS			\
	     OF_HAVE_FILES			\
	     OF_HAVE_SANDBOX			\
	     OF_HAVE_SOCKETS			\

Modified src/OFHTTPRequest.h from [96bca5878e] to [c71064978e].

51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

/*!
 * @struct of_http_request_protocol_version_t \
 *	   OFHTTPRequest.h ObjFW/OFHTTPRequest.h
 *
 * @brief The HTTP version of the HTTP request.
 */
typedef struct {
	/*! The major of the HTTP version */
	uint8_t major;
	/*! The minor of the HTTP version */
	uint8_t minor;
} of_http_request_protocol_version_t;

/*!







|







51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

/*!
 * @struct of_http_request_protocol_version_t \
 *	   OFHTTPRequest.h ObjFW/OFHTTPRequest.h
 *
 * @brief The HTTP version of the HTTP request.
 */
typedef struct OF_BOXABLE {
	/*! The major of the HTTP version */
	uint8_t major;
	/*! The minor of the HTTP version */
	uint8_t minor;
} of_http_request_protocol_version_t;

/*!

Modified src/OFObject.h from [607adabcb5] to [2ac0a8962b].

72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
} of_byte_order_t;

/*!
 * @struct of_range_t OFObject.h ObjFW/OFObject.h
 *
 * @brief A range.
 */
typedef struct {
	/*! The start of the range */
	size_t location;
	/*! The length of the range */
	size_t length;
} of_range_t;

/*!







|







72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
} of_byte_order_t;

/*!
 * @struct of_range_t OFObject.h ObjFW/OFObject.h
 *
 * @brief A range.
 */
typedef struct OF_BOXABLE {
	/*! The start of the range */
	size_t location;
	/*! The length of the range */
	size_t length;
} of_range_t;

/*!
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
typedef double of_time_interval_t;

/*!
 * @struct of_point_t OFObject.h ObjFW/OFObject.h
 *
 * @brief A point.
 */
typedef struct {
	/*! The x coordinate of the point */
	float x;
	/*! The y coordinate of the point */
	float y;
} of_point_t;

/*!







|







104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
typedef double of_time_interval_t;

/*!
 * @struct of_point_t OFObject.h ObjFW/OFObject.h
 *
 * @brief A point.
 */
typedef struct OF_BOXABLE {
	/*! The x coordinate of the point */
	float x;
	/*! The y coordinate of the point */
	float y;
} of_point_t;

/*!
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
}

/*!
 * @struct of_dimension_t OFObject.h ObjFW/OFObject.h
 *
 * @brief A dimension.
 */
typedef struct {
	/*! The width of the dimension */
	float width;
	/*! The height of the dimension */
	float height;
} of_dimension_t;

/*!







|







131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
}

/*!
 * @struct of_dimension_t OFObject.h ObjFW/OFObject.h
 *
 * @brief A dimension.
 */
typedef struct OF_BOXABLE {
	/*! The width of the dimension */
	float width;
	/*! The height of the dimension */
	float height;
} of_dimension_t;

/*!
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
}

/*!
 * @struct of_rectangle_t OFObject.h ObjFW/OFObject.h
 *
 * @brief A rectangle.
 */
typedef struct {
	/*! The point from where the rectangle originates */
	of_point_t origin;
	/*! The size of the rectangle */
	of_dimension_t size;
} of_rectangle_t;

/*!







|







158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
}

/*!
 * @struct of_rectangle_t OFObject.h ObjFW/OFObject.h
 *
 * @brief A rectangle.
 */
typedef struct OF_BOXABLE {
	/*! The point from where the rectangle originates */
	of_point_t origin;
	/*! The size of the rectangle */
	of_dimension_t size;
} of_rectangle_t;

/*!

Modified src/OFOptionsParser.h from [7c1588b205] to [bd8f1c9286].

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
OF_ASSUME_NONNULL_BEGIN

/*!
 * @struct of_options_parser_option_t OFOptionsParser.h ObjFW/OFOptionsParser.h
 *
 * @brief An option which can be parsed by an @ref OFOptionsParser.
 */
typedef struct of_options_parser_option_t {
	/*! The short version (e.g. `-v`) of the option or `\0` for none. */
	of_unichar_t shortOption;

	/*!
	 * The long version (e.g. `--verbose`) of the option or `nil` for none.
	 */
	OFString *__unsafe_unretained _Nullable longOption;







|







23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
OF_ASSUME_NONNULL_BEGIN

/*!
 * @struct of_options_parser_option_t OFOptionsParser.h ObjFW/OFOptionsParser.h
 *
 * @brief An option which can be parsed by an @ref OFOptionsParser.
 */
typedef struct {
	/*! The short version (e.g. `-v`) of the option or `\0` for none. */
	of_unichar_t shortOption;

	/*!
	 * The long version (e.g. `--verbose`) of the option or `nil` for none.
	 */
	OFString *__unsafe_unretained _Nullable longOption;

Modified src/OFUDPSocket.h from [5df4f71a3e] to [b58e2745e2].

27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@class OFUDPSocket;

/*!
 * @struct of_udp_socket_address_t OFUDPSocket.h ObjFW/OFUDPSocket.h
 *
 * @brief A struct which represents a host / port pair for a UDP socket.
 */
typedef struct {
	struct sockaddr_storage address;
	socklen_t length;
} of_udp_socket_address_t;

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief A block which is called when the host / port pair for the UDP socket







|







27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
@class OFUDPSocket;

/*!
 * @struct of_udp_socket_address_t OFUDPSocket.h ObjFW/OFUDPSocket.h
 *
 * @brief A struct which represents a host / port pair for a UDP socket.
 */
typedef struct OF_BOXABLE {
	struct sockaddr_storage address;
	socklen_t length;
} of_udp_socket_address_t;

#ifdef OF_HAVE_BLOCKS
/*!
 * @brief A block which is called when the host / port pair for the UDP socket

Modified src/macros.h from [3d82ab1985] to [eade3d2bc3].

266
267
268
269
270
271
272






273
274
275
276
277
278
279

#if __has_attribute(__objc_designated_initializer__)
# define OF_DESIGNATED_INITIALIZER \
    __attribute__((__objc_designated_initializer__))
#else
# define OF_DESIGNATED_INITIALIZER
#endif







#if __has_attribute(__swift_name__)
# define OF_SWIFT_NAME(name) __attribute__((__swift_name__(name)))
#else
# define OF_SWIFT_NAME(name)
#endif








>
>
>
>
>
>







266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285

#if __has_attribute(__objc_designated_initializer__)
# define OF_DESIGNATED_INITIALIZER \
    __attribute__((__objc_designated_initializer__))
#else
# define OF_DESIGNATED_INITIALIZER
#endif

#if __has_attribute(__objc_boxable__)
# define OF_BOXABLE __attribute__((__objc_boxable__))
#else
# define OF_BOXABLE
#endif

#if __has_attribute(__swift_name__)
# define OF_SWIFT_NAME(name) __attribute__((__swift_name__(name)))
#else
# define OF_SWIFT_NAME(name)
#endif