ObjFW  Diff

Differences From Artifact [846f3a0425]:

To Artifact [354a662802]:


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
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 */
	OF_ORDERED_ASCENDING = -1,
	OFOrderedAscending = -1,
	/** Both objects are equal */
	OF_ORDERED_SAME = 0,
	OFOrderedSame = 0,
	/** The left object is bigger than the right */
	OF_ORDERED_DESCENDING = 1
} of_comparison_result_t;
	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 of_comparison_result_t (^of_comparator_t)(id _Nonnull left,
    id _Nonnull right);
typedef OFComparisonResult (^OFComparator)(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,
	OFByteOrderBigEndian,
	/** Least significant byte first (little endian) */
	OFByteOrderLittleEndian,
	/** Native byte order of the system */
	OF_BYTE_ORDER_LITTLE_ENDIAN
} of_byte_order_t;
#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
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
 */
- (of_comparison_result_t)compare: (id <OFComparing>)object;
- (OFComparisonResult)compare: (id <OFComparing>)object;
@end
#endif

#ifdef __cplusplus
extern "C" {
#endif
/**