Difference between revisions of "r7.1.1:Macro LFDS711 STACK GET USER STATE FROM STATE"

From liblfds.org
Jump to navigation Jump to search
m (1 revision imported)
 
(No difference)

Latest revision as of 20:16, 17 February 2017

Source Files

└───liblfds711
    └───inc
        └───liblfds711
                lfds711_stack.h

Opaque Structures

struct lfds711_stack_state;

Macro

#define LFDS711_STACK_GET_USER_STATE_FROM_STATE( stack_state )

Parameters

stack_state

An initialized struct lfds711_stack_state. Not a pointer to it - the struct itself.

Return Value

Returns a void *, the user_state argument from lfds711_stack_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 <stdio.h>
#include "liblfds711.h"

int main()
{
  char
    stack_name[64] = "Duane Dibbley";

  struct lfds711_stack_state
    ss;

  void
    *user_state;

  lfds711_misc_library_init_valid_on_current_logical_core();

  lfds711_stack_init_valid_on_current_logical_core( &ss, (void *) stack_name );

  user_state = LFDS711_STACK_GET_USER_STATE_FROM_STATE( ss );

  printf( "stack name is \"%s\"\n", (char *) user_state );

  lfds711_stack_cleanup( &ss, NULL );

  lfds711_misc_library_cleanup();

  return( EXIT_SUCCESS );
}

See Also