@@ -36,49 +36,135 @@ extern "C" {
36
36
/** exported global variable declaration section **/
37
37
38
38
/** exported function prototype section **/
39
- /* the handler of iterator */
40
- /*
41
- * Get and set value.
39
+ /**
40
+ * Get value that pointed by iterator.
41
+ * @param it_iter iterator.
42
+ * @param pv_value value.
43
+ * @return void
44
+ * @remakes it_iter must be valid and pv_value != NULL, otherwise the behavior is undefined.
45
+ */
46
+ extern void iterator_get_value (iterator_t it_iter , void * pv_value );
47
+
48
+ /**
49
+ * Set value that pointed by iterator.
50
+ * @param it_iter iterator.
51
+ * @param cpv_value value.
52
+ * @return void
53
+ * @remakes it_iter must be valid and cpv_value != NULL, otherwise the behavior is undefined.
42
54
*/
43
- extern void iterator_get_value (iterator_t t_iter , void * pv_value );
44
- extern void iterator_set_value (iterator_t t_iter , const void * cpv_value );
45
- extern const void * iterator_get_pointer (iterator_t t_iter );
55
+ extern void iterator_set_value (iterator_t it_iter , const void * cpv_value );
46
56
47
- /*
48
- * Move iterator.
57
+ /**
58
+ * Get pointer that pointed by iterator.
59
+ * @param it_iter iterator.
60
+ * @return pointer
61
+ * @remakes it_iter must be valid and must be not end(), otherwise the behavior is undefined.
49
62
*/
50
- extern iterator_t iterator_next (iterator_t t_iter );
51
- extern iterator_t iterator_prev (iterator_t t_iter );
52
- extern iterator_t iterator_next_n (iterator_t t_iter , int n_step );
53
- extern iterator_t iterator_prev_n (iterator_t t_iter , int n_step );
63
+ extern const void * iterator_get_pointer (iterator_t it_iter );
54
64
55
- /*
56
- * Relationship operator functions.
65
+ /**
66
+ * Move iterator to next position.
67
+ * @param it_iter iterator.
68
+ * @return next position.
69
+ * @remakes it_iter must be valid and must be not end(), otherwise the behavior is undefined.
70
+ */
71
+ extern iterator_t iterator_next (iterator_t it_iter );
72
+
73
+ /**
74
+ * Move iterator to previous position.
75
+ * @param it_iter iterator.
76
+ * @return previous position.
77
+ * @remakes it_iter must be valid and must be not end(), otherwise the behavior is undefined.
78
+ */
79
+ extern iterator_t iterator_prev (iterator_t it_iter );
80
+
81
+ /**
82
+ * Move iterator to next n position.
83
+ * @param it_iter iterator.
84
+ * @return next n position.
85
+ * @remakes it_iter must be valid and must be not end(), otherwise the behavior is undefined.
86
+ */
87
+ extern iterator_t iterator_next_n (iterator_t it_iter , int n_step );
88
+
89
+ /**
90
+ * Move iterator to prev n position.
91
+ * @param it_iter iterator.
92
+ * @return prev n position.
93
+ * @remakes it_iter must be valid and must be not end(), otherwise the behavior is undefined.
94
+ */
95
+ extern iterator_t iterator_prev_n (iterator_t it_iter , int n_step );
96
+
97
+ /**
98
+ * Test two iterator are equal or not.
99
+ * @param it_first first iterator.
100
+ * @param it_second second iterator.
101
+ * @return whether equal or not.
102
+ * @remakes two iterator must be valid, otherwise the behavior is undefined.
103
+ */
104
+ extern bool_t iterator_equal (iterator_t it_first , iterator_t it_second );
105
+
106
+ /**
107
+ * Test two iterator are equal or not.
108
+ * @param it_first first iterator.
109
+ * @param it_second second iterator.
110
+ * @return whether equal or not.
111
+ * @remakes two iterator must be valid, otherwise the behavior is undefined.
112
+ */
113
+ extern bool_t iterator_not_equal (iterator_t it_first , iterator_t it_second );
114
+
115
+ /**
116
+ * Test first iterator is less than second iterator.
117
+ * @param it_first first iterator.
118
+ * @param it_second second iterator.
119
+ * @return whether first iterator less than second iterator or not.
120
+ * @remakes two iterator must be valid, otherwise the behavior is undefined.
121
+ */
122
+ extern bool_t iterator_less (iterator_t it_first , iterator_t it_second );
123
+
124
+ /**
125
+ * Test first iterator is less than or equal to second iterator.
126
+ * @param it_first first iterator.
127
+ * @param it_second second iterator.
128
+ * @return whether first iterator less than or equal to second iterator or not.
129
+ * @remakes two iterator must be valid, otherwise the behavior is undefined.
130
+ */
131
+ extern bool_t iterator_less_equal (iterator_t it_first , iterator_t it_second );
132
+
133
+ /**
134
+ * Test first iterator is greater than second iterator.
135
+ * @param it_first first iterator.
136
+ * @param it_second second iterator.
137
+ * @return whether first iterator greater than second iterator or not.
138
+ * @remakes two iterator must be valid, otherwise the behavior is undefined.
139
+ */
140
+ extern bool_t iterator_greater (iterator_t it_first , iterator_t it_second );
141
+
142
+ /**
143
+ * Test first iterator is greater than or equal to second iterator.
144
+ * @param it_first first iterator.
145
+ * @param it_second second iterator.
146
+ * @return whether first iterator greater than or equal to second iterator or not.
147
+ * @remakes two iterator must be valid, otherwise the behavior is undefined.
57
148
*/
58
- extern bool_t iterator_equal (iterator_t t_iterfirst , iterator_t t_itersecond );
59
- extern bool_t iterator_not_equal (iterator_t t_iterfirst , iterator_t t_itersecond );
60
- extern bool_t iterator_less (iterator_t t_iterfirst , iterator_t t_itersecond );
61
- extern bool_t iterator_less_equal (iterator_t t_iterfirst , iterator_t t_itersecond );
62
- extern bool_t iterator_greater (iterator_t t_iterfirst , iterator_t t_itersecond );
63
- extern bool_t iterator_greater_equal (iterator_t t_iterfirst , iterator_t t_itersecond );
149
+ extern bool_t iterator_greater_equal (iterator_t it_first , iterator_t it_second );
64
150
65
151
/*
66
152
* Element random access.
67
153
*/
68
- extern void * iterator_at (iterator_t t_iter , int n_index );
154
+ extern void * iterator_at (iterator_t it_iter , int n_index );
69
155
70
156
71
157
/*
72
158
* Distance.
73
159
*/
74
- extern int iterator_minus (iterator_t t_iterfirst , iterator_t t_itersecond );
160
+ extern int iterator_minus (iterator_t it_first , iterator_t it_second );
75
161
76
162
/* the iterator auxilary function */
77
163
/*
78
164
* Advance and distance.
79
165
*/
80
- extern iterator_t iterator_advance (iterator_t t_iter , int n_step );
81
- extern int iterator_distance (iterator_t t_iterfirst , iterator_t t_itersecond );
166
+ extern iterator_t iterator_advance (iterator_t it_iter , int n_step );
167
+ extern int iterator_distance (iterator_t it_first , iterator_t it_second );
82
168
83
169
#ifdef __cplusplus
84
170
}
0 commit comments