lfitem.h 476 B

1234567891011121314151617181920212223
  1. #pragma once
  2. /* This data structure holds one item, and returns you the old item when you replace it
  3. it's sort of a "stack of 1" */
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. typedef struct lfitem_struct_t
  8. {
  9. void * volatile item;
  10. } lfitem_value_t, *lfitem_t;
  11. void lfitem_init(lfitem_t item);
  12. void *lfitem_get(lfitem_t item);
  13. void *lfitem_set(lfitem_t item, const void *value);
  14. void *lfitem_set_if_zero(lfitem_t item, void *value);
  15. #ifdef __cplusplus
  16. }
  17. #endif