Difference between pages "r6.0.0:Lfds600 slist get next" and "r6.0.0:Lfds600 slist get user data from element"

From liblfds.org
(Difference between pages)
Jump to navigation Jump to search
m (1 revision imported)
 
m (1 revision imported)
 
Line 1: Line 1:
{{DISPLAYTITLE:r6.0.0:lfds600_slist_get_next}}
{{DISPLAYTITLE:r6.0.0:lfds600_slist_get_user_data_from_element}}
==Source Files==
==Source Files==
  /liblfds600/src/lfds600_slist/lfds600_slist_get_and_set.c
  /liblfds600/src/lfds600_slist/lfds600_slist_get_and_set.c
Line 5: Line 5:


==Prototype==
==Prototype==
  struct lfds600_slist_element *lfds600_slist_get_next( struct lfds600_slist_element *se, struct lfds600_slist_element **next_se );
  int lfds600_slist_get_user_data_from_element( struct lfds600_slist_element *se, void **user_data );


==Parameters==
==Parameters==
''struct lfds600_slist_element *se''
''struct lfds600_slist_element *se''
: A pointer to an slist element, as obtained from ''[[r6.0.0:lfds600_slist_new_head|lfds600_slist_new_head]]'', ''[[r6.0.0:lfds600_slist_new_next|lfds600_slist_new_next]]'', ''[[r6.0.0:lfds600_slist_get_head|lfds600_slist_get_head]]'', ''lfds600_slist_get_next'' or ''[[r6.0.0:lfds600_slist_get_head_and_then_next|lfds600_slist_get_head_and_then_next]]''.
: A pointer to an slist element as allocated by ''[[r6.0.0:lfds600_slist_new_head|lfds600_slist_new_head]]'' or ''[[r6.0.0:lfds600_slist_new_next|lfds600_slist_new_next]]''.


''struct lfds600_slist_element **next_se''
''void **user_data''
: A pointer to a pointer into which a pointer to the next slist element will be placed.  Set to NULL if there is no next element.
: A pointer to a pointer into which the user data will be placed.


==Return Value==
==Return Value==
Returns a pointer to the next element.  Returns NULL if there is no next element.
Returns 1 on success, 0 on failure. The only cause of failure is if you try to get the user data from an element which has been logically deleted.


==Notes==
==Notes==
It is acceptable (and expected to often occur) to use the same variable for both arguments, e.g.
This function gets the user data void pointer in the slist element.  
 
lfds600_slist_get_next( se, &se );


==See Also==
==See Also==
* [[r6.0.0:lfds600_slist|lfds600_slist]]
* [[r6.0.0:lfds600_slist|lfds600_slist]]
* [[r6.0.0:lfds600_slist_get_head|lfds600_slist_get_head]]
* [[r6.0.0:lfds600_slist_set_user_data_in_element|lfds600_slist_set_user_data_in_element]]
* [[r6.0.0:lfds600_slist_get_head_and_then_next|lfds600_slist_get_head_and_then_next]]

Latest revision as of 14:07, 4 January 2015

Source Files

/liblfds600/src/lfds600_slist/lfds600_slist_get_and_set.c
/liblfds600/inc/liblfds600.h

Prototype

int lfds600_slist_get_user_data_from_element( struct lfds600_slist_element *se, void **user_data );

Parameters

struct lfds600_slist_element *se

A pointer to an slist element as allocated by lfds600_slist_new_head or lfds600_slist_new_next.

void **user_data

A pointer to a pointer into which the user data will be placed.

Return Value

Returns 1 on success, 0 on failure. The only cause of failure is if you try to get the user data from an element which has been logically deleted.

Notes

This function gets the user data void pointer in the slist element.

See Also