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
|
/** @file */
/**
* @brief A result of a comparison.
*/
typedef enum {
/** The left object is smaller than the right */
OF_ORDERED_ASCENDING = -1,
/** Both objects are equal */
OF_ORDERED_SAME = 0,
/** The left object is bigger than the right */
OF_ORDERED_DESCENDING = 1
} of_comparison_result_t;
#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 of_comparison_result_t (^of_comparator_t)(id _Nonnull left,
id _Nonnull right);
#endif
/**
* @brief An enum for storing endianess.
*/
typedef enum {
/** Most significant byte first (big endian) */
OF_BYTE_ORDER_BIG_ENDIAN,
/** Least significant byte first (little endian) */
OF_BYTE_ORDER_LITTLE_ENDIAN
} of_byte_order_t;
/**
* @struct of_range_t OFObject.h ObjFW/OFObject.h
*
* @brief A range.
*/
struct OF_BOXABLE of_range_t {
|
|
|
|
|
<
|
|
>
>
|
>
>
>
>
|
|
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
|
/** @file */
/**
* @brief A result of a comparison.
*/
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.
*/
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 of_range_t OFObject.h ObjFW/OFObject.h
*
* @brief A range.
*/
struct OF_BOXABLE of_range_t {
|
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
|
@protocol OFComparing
/**
* @brief Compares the object to another object.
*
* @param object An object to compare the object to
* @return The result of the comparison
*/
- (of_comparison_result_t)compare: (id <OFComparing>)object;
@end
#endif
#ifdef __cplusplus
extern "C" {
#endif
/**
|
|
|
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
|
@protocol OFComparing
/**
* @brief Compares the object to another object.
*
* @param object An object to compare the object to
* @return The result of the comparison
*/
- (OFComparisonResult)compare: (id <OFComparing>)object;
@end
#endif
#ifdef __cplusplus
extern "C" {
#endif
/**
|