Difference between pages "r7.0.0:Macro LFDS700 HASH A SET VALUE IN ELEMENT" and "r7.0.0:Macro LFDS700 HASH A GET VALUE FROM ELEMENT"

From liblfds.org
(Difference between pages)
Jump to navigation Jump to search
 
(Created page with "{{DISPLAYTITLE:macro LFDS700_HASH_A_GET_KEY_FROM_ELEMENT}} ==Source File== └───liblfds700 └───inc └───liblfds700 lfds70...")
 
Line 1: Line 1:
{{DISPLAYTITLE:macro LFDS700_HASH_A_SET_VALUE_IN_ELEMENT}}
{{DISPLAYTITLE:macro LFDS700_HASH_A_GET_KEY_FROM_ELEMENT}}
==Source File==
==Source File==
  └───liblfds700
  └───liblfds700
Line 7: Line 7:


==Macro==
==Macro==
  #define LFDS700_HASH_A_SET_VALUE_IN_ELEMENT( hash_a_element, new_value )
  #define LFDS700_HASH_A_GET_KEY_FROM_ELEMENT( hash_a_element )


==Parameters==
==Parameters==
''hash_a_element''
''hash_a_element''
: A ''struct lfds700_hash_a_element''.  Not a pointer to it - the struct itself.
: A ''struct lfds700_hash_a_element''.  Not a pointer to it - the struct itself.
''new_value''
: A void pointer, which the value in ''hash_a_element'' is set to.


==Return Value==
==Return Value==
No return value.
Returns a void pointer, the key from the element.


==Example==
==Example==
char
  random_data[10];
  struct lfds700_hash_a_element
  struct lfds700_hash_a_element
   haw;
   haw;
   
   
  LFDS700_HASH_A_SET_VALUE_IN_ELEMENT( haw, (void *) random_data );
  void
  *key;
key = LFDS700_HASH_A_GET_KEY_FROM_ELEMENT( haw );


==Notes==
==Notes==
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.
The value is set atomically, and so can be used at any time, on an element in the hash or before it enters the hash, unlike setting a key, which can only be done before an element enters the hash.


==See Also==
==See Also==
[[r7.0.0:Hash (add-only)|Hash (add-only)]]
[[r7.0.0:Hash (add-only)|Hash (add-only)]]

Latest revision as of 00:35, 8 December 2015

Source File

└───liblfds700
    └───inc
        └───liblfds700
                lfds700_hash_addonly.h

Macro

#define LFDS700_HASH_A_GET_KEY_FROM_ELEMENT( hash_a_element )

Parameters

hash_a_element

A struct lfds700_hash_a_element. Not a pointer to it - the struct itself.

Return Value

Returns a void pointer, the key from the element.

Example

struct lfds700_hash_a_element
  haw;

void
  *key;

key = LFDS700_HASH_A_GET_KEY_FROM_ELEMENT( haw );

Notes

As with all liblfds macros, the macro operates on the structure itself, not a pointer to it.

See Also

Hash (add-only)