ObjFW  Diff

Differences From Artifact [289c822ada]:

To Artifact [00a9d26e5f]:


12
13
14
15
16
17
18


19
20
21
22
23
24
25
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"



#ifndef DOXYGEN
@class OFEnumerator OF_GENERIC(ObjectType);
@class OFArray OF_GENERIC(ObjectType);
#endif

/*!
 * @protocol OFEnumerating OFEnumerator.h ObjFW/OFEnumerator.h







>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#import "OFObject.h"

OF_ASSUME_NONNULL_BEGIN

#ifndef DOXYGEN
@class OFEnumerator OF_GENERIC(ObjectType);
@class OFArray OF_GENERIC(ObjectType);
#endif

/*!
 * @protocol OFEnumerating OFEnumerator.h ObjFW/OFEnumerator.h
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#else
# ifndef DOXYGEN
#  define ObjectType id
# endif
@interface OFEnumerator: OFObject
#endif
/*!
 * @brief Returns the next object.
 *
 * @return The next object
 */
- (ObjectType)nextObject;

/*!
 * @brief Returns an array of all remaining objects in the collection.
 *
 * @return An array of all remaining objects in the collection
 */
- (OFArray OF_GENERIC(ObjectType)*)allObjects;







|

|

|







48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#else
# ifndef DOXYGEN
#  define ObjectType id
# endif
@interface OFEnumerator: OFObject
#endif
/*!
 * @brief Returns the next object or nil if there is none left.
 *
 * @return The next object or nil if there is none left
 */
- (nullable ObjectType)nextObject;

/*!
 * @brief Returns an array of all remaining objects in the collection.
 *
 * @return An array of all remaining objects in the collection
 */
- (OFArray OF_GENERIC(ObjectType)*)allObjects;
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
 */
#define of_fast_enumeration_state_t NSFastEnumerationState
#ifndef NSINTEGER_DEFINED
typedef struct {
	/// Arbitrary state information for the enumeration
	unsigned long state;
	/// Pointer to a C array of objects to return
	__unsafe_unretained id *itemsPtr;
	/// Arbitrary state information to detect mutations
	unsigned long *mutationsPtr;
	/// Additional arbitrary state information
	unsigned long extra[5];
} of_fast_enumeration_state_t;
#endif

/*!
 * @protocol OFFastEnumeration OFEnumerator.h ObjFW/OFEnumerator.h







|

|







88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
 */
#define of_fast_enumeration_state_t NSFastEnumerationState
#ifndef NSINTEGER_DEFINED
typedef struct {
	/// Arbitrary state information for the enumeration
	unsigned long state;
	/// Pointer to a C array of objects to return
	__unsafe_unretained __nullable id *__nullable itemsPtr;
	/// Arbitrary state information to detect mutations
	__nullable unsigned long *mutationsPtr;
	/// Additional arbitrary state information
	unsigned long extra[5];
} of_fast_enumeration_state_t;
#endif

/*!
 * @protocol OFFastEnumeration OFEnumerator.h ObjFW/OFEnumerator.h
114
115
116
117
118
119
120
121

122
123


 * @param state Context information for the enumeration
 * @param objects A pointer to an array where to put the objects
 * @param count The number of objects that can be stored at objects
 * @return The number of objects returned in objects or 0 when the enumeration
 *	   finished.
 */
- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state
			   objects: (__unsafe_unretained id*)objects

			     count: (int)count;
@end









|
>


>
>
116
117
118
119
120
121
122
123
124
125
126
127
128
 * @param state Context information for the enumeration
 * @param objects A pointer to an array where to put the objects
 * @param count The number of objects that can be stored at objects
 * @return The number of objects returned in objects or 0 when the enumeration
 *	   finished.
 */
- (int)countByEnumeratingWithState: (of_fast_enumeration_state_t*)state
			   objects: (__unsafe_unretained __nonnull id
					*__nonnull)objects
			     count: (int)count;
@end

OF_ASSUME_NONNULL_END