Difference between pages "r7.1.1:Macro LFDS711 LIST ASU GET START AND THEN NEXT" and "r7.1.1:Macro LFDS711 LIST ASU GET USER STATE FROM STATE"
(Difference between pages)
Jump to navigation
Jump to search
m (1 revision imported) |
m (1 revision imported) |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:macro | {{DISPLAYTITLE:macro LFDS711_LIST_ASU_GET_USER_STATE_FROM_STATE}} | ||
==Source File== | ==Source File== | ||
└───liblfds711 | └───liblfds711 | ||
Line 7: | Line 7: | ||
==Opaque Structures== | ==Opaque Structures== | ||
struct [[r7.1.1:struct lfds711_list_asu_state|lfds711_list_asu_state]]; | struct [[r7.1.1:struct lfds711_list_asu_state|lfds711_list_asu_state]]; | ||
==Macro== | ==Macro== | ||
#define | #define LFDS711_LIST_ASU_GET_USER_STATE_FROM_STATE( list_asu_state ) | ||
==Parameters== | ==Parameters== | ||
''list_asu_state'' | ''list_asu_state'' | ||
: | : An initialized ''struct lfds711_list_asu_state''. Not a pointer to it - the struct itself. | ||
==Return Value== | ==Return Value== | ||
Returns a ''void *'', the ''user_state'' argument from ''[[r7.1.1:function lfds711_list_asu_init_valid_on_current_logical_core|lfds711_list_asu_init_valid_on_current_logical_core]]''. | |||
==Notes== | |||
The user state value can only be set the once, when the data structure instance is initialized. | |||
As with all ''liblfds'' macros, the macro operates on the structure itself, not a pointer to it. | As with all ''liblfds'' macros, the macro operates on the structure itself, not a pointer to it. | ||
==Example== | ==Example== | ||
#include "liblfds711.h" | |||
#include <stdio.h> | |||
#include <string.h> | |||
int main() | |||
{ | |||
char | |||
list_asu_name[64] = "Do You Love Me"; | |||
struct lfds711_list_asu_state | |||
lasus; | |||
void | |||
*user_state; | |||
lfds711_misc_library_init_valid_on_current_logical_core(); | |||
lfds711_list_asu_init_valid_on_current_logical_core( &lasus, NULL, (void *) list_asu_name ); | |||
user_state = LFDS711_LIST_ASU_GET_USER_STATE_FROM_STATE( lasus ); | |||
printf( "list_asu name is \"%s\"\n", (char *) user_state ); | |||
lfds711_list_asu_cleanup( &lasus, NULL ); | |||
lfds711_misc_library_cleanup(); | |||
return( EXIT_SUCCESS ); | |||
} | |||
==See Also== | ==See Also== | ||
* [[r7.1.1:List (add-only, singly-linked, unordered)|List (add-only, singly-linked, unordered)]] | * [[r7.1.1:List (add-only, singly-linked, unordered)|List (add-only, singly-linked, unordered)]] |
Latest revision as of 18:12, 16 February 2017
Source File
└───liblfds711 └───inc └───liblfds711 lfds711_list_addonly_singlylinked_unordered.h
Opaque Structures
struct lfds711_list_asu_state;
Macro
#define LFDS711_LIST_ASU_GET_USER_STATE_FROM_STATE( list_asu_state )
Parameters
list_asu_state
- An initialized struct lfds711_list_asu_state. Not a pointer to it - the struct itself.
Return Value
Returns a void *, the user_state argument from lfds711_list_asu_init_valid_on_current_logical_core.
Notes
The user state value can only be set the once, when the data structure instance is initialized.
As with all liblfds macros, the macro operates on the structure itself, not a pointer to it.
Example
#include "liblfds711.h" #include <stdio.h> #include <string.h> int main() { char list_asu_name[64] = "Do You Love Me"; struct lfds711_list_asu_state lasus; void *user_state; lfds711_misc_library_init_valid_on_current_logical_core(); lfds711_list_asu_init_valid_on_current_logical_core( &lasus, NULL, (void *) list_asu_name ); user_state = LFDS711_LIST_ASU_GET_USER_STATE_FROM_STATE( lasus ); printf( "list_asu name is \"%s\"\n", (char *) user_state ); lfds711_list_asu_cleanup( &lasus, NULL ); lfds711_misc_library_cleanup(); return( EXIT_SUCCESS ); }