macro LFDS710_QUEUE_UMM_GET_USER_STATE_FROM_STATE

From liblfds.org
Jump to: navigation, search

Source File

└───liblfds710
    └───inc
        └───liblfds710
                lfds710_queue_umm.h

Macro

#define LFDS710_QUEUE_UMM_GET_USER_STATE_FROM_STATE( queue_umm_state )

Parameters

queue_umm_state

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

Return Value

Returns a void *, the user_state argument from lfds710_umm_queue_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 <string.h>
#include "liblfds710.h"

int main()
{
  char
    queue_name[64] = "People Ain't No Good";

  struct lfds710_queue_umm_element
    qumme_dummy;
 
  struct lfds710_queue_umm_state
    qumms;

  void
    *user_state;

  lfds710_queue_umm_init_valid_on_current_logical_core( &qumms, &qumme_dummy, (void *) queue_name );

  user_state = LFDS710_QUEUE_GET_USER_STATE_FROM_STATE( qumms );

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

  lfds710_queue_umm_cleanup( &qumms, NULL );

  return( EXIT_SUCCESS );
}

See Also