Changeset 192
- Timestamp:
- Feb 19, 2006 1:28:21 AM (19 years ago)
- Location:
- pjproject/trunk/pjlib/include/pj
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/include/pj/list.h
r107 r192 251 251 252 252 /** 253 * Traverse the list to get the number of elements in the list. 254 * 255 * @param list The list head. 256 * 257 * @return Number of elements. 258 */ 259 PJ_IDECL(pj_size_t) pj_list_size(pj_list_type *list); 260 261 262 /** 253 263 * @} 254 264 */ -
pjproject/trunk/pjlib/include/pj/list_i.h
r66 r192 117 117 } 118 118 119 120 PJ_IDEF(pj_size_t) pj_list_size(pj_list_type *list) 121 { 122 pj_list *node = (pj_list*) ((pj_list*)list)->next; 123 pj_size_t count = 0; 124 125 while (node != list) { 126 ++count; 127 node = node->next; 128 } 129 130 return count; 131 } 132
Note: See TracChangeset
for help on using the changeset viewer.