50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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
104
105
106
107
108
109
110
111
|
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
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
104
105
106
107
108
109
110
|
-
+
-
+
-
+
-
+
-
-
+
|
OF_ASSUME_NONNULL_BEGIN
/** @file */
/**
* @brief A result of a comparison.
*/
typedef enum OFComparisonResult {
typedef enum {
/** The left object is smaller than the right */
OFOrderedAscending = -1,
/** Both objects are equal */
OFOrderedSame = 0,
/** The left object is bigger than the right */
OFOrderedDescending = 1
} OFComparisonResult;
#ifdef OF_HAVE_BLOCKS
/**
* @brief A comparator to compare two objects.
*
* @param left The left object
* @param right The right object
* @return The order of the objects
*/
typedef OFComparisonResult (^OFComparator)(id _Nonnull left, id _Nonnull right);
#endif
/**
* @brief An enum for storing endianess.
* @brief An enum for representing endianess.
*/
typedef enum OFByteOrder {
typedef enum {
/** Most significant byte first (big endian) */
OFByteOrderBigEndian,
/** Least significant byte first (little endian) */
OFByteOrderLittleEndian,
/** Native byte order of the system */
#ifdef OF_BIG_ENDIAN
OFByteOrderNative = OFByteOrderBigEndian
#else
OFByteOrderNative = OFByteOrderLittleEndian
#endif
} OFByteOrder;
/**
* @struct OFRange OFObject.h ObjFW/OFObject.h
*
* @brief A range.
*/
struct OF_BOXABLE OFRange {
typedef struct OF_BOXABLE {
/** The start of the range */
size_t location;
/** The length of the range */
size_t length;
};
typedef struct OFRange OFRange;
} OFRange;
/**
* @brief Creates a new OFRange.
*
* @param start The starting index of the range
* @param length The length of the range
* @return An OFRangeith the specified start and length
|
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
|
-
+
-
-
+
|
typedef double OFTimeInterval;
/**
* @struct OFPoint OFObject.h ObjFW/OFObject.h
*
* @brief A point.
*/
struct OF_BOXABLE OFPoint {
typedef struct OF_BOXABLE {
/** The x coordinate of the point */
float x;
/** The y coordinate of the point */
float y;
};
typedef struct OFPoint OFPoint;
} OFPoint;
/**
* @brief Creates a new OFPoint.
*
* @param x The x coordinate of the point
* @param y The x coordinate of the point
* @return An OFPoint with the specified coordinates
|
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
|
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
|
-
+
-
-
+
|
}
/**
* @struct OFSize OFObject.h ObjFW/OFObject.h
*
* @brief A size.
*/
struct OF_BOXABLE OFSize {
typedef struct OF_BOXABLE {
/** The width of the size */
float width;
/** The height of the size */
float height;
};
typedef struct OFSize OFSize;
} OFSize;
/**
* @brief Creates a new OFSize.
*
* @param width The width of the size
* @param height The height of the size
* @return An OFSize with the specified width and height
|
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
|
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
|
-
+
-
-
+
|
}
/**
* @struct OFRect OFObject.h ObjFW/OFObject.h
*
* @brief A rectangle.
*/
struct OF_BOXABLE OFRect {
typedef struct OF_BOXABLE {
/** The point from where the rectangle originates */
OFPoint origin;
/** The size of the rectangle */
OFSize size;
};
typedef struct OFRect OFRect;
} OFRect;
/**
* @brief Creates a new OFRect.
*
* @param x The x coordinate of the top left corner of the rectangle
* @param y The y coordinate of the top left corner of the rectangle
* @param width The width of the rectangle
|