record.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #pragma once
  2. #include <stdbool.h>
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. /* Initialize record storage
  7. * For internal use only.
  8. */
  9. void furi_record_init();
  10. /* Create record
  11. * @param name - record name
  12. * @param data - data pointer
  13. * @note Thread safe. Create and destroy must be executed from the same thread.
  14. */
  15. void furi_record_create(const char* name, void* data);
  16. /* Destroy record
  17. * @param name - record name
  18. * @return true if successful, false if still have holders or thread is not owner.
  19. * @note Thread safe. Create and destroy must be executed from the same thread.
  20. */
  21. bool furi_record_destroy(const char* name);
  22. /* Open record
  23. * @param name - record name
  24. * @return pointer to the record
  25. * @note Thread safe. Open and close must be executed from the same thread.
  26. * Suspends caller thread till record appear
  27. */
  28. void* furi_record_open(const char* name);
  29. /* Close record
  30. * @param name - record name
  31. * @note Thread safe. Open and close must be executed from the same thread.
  32. */
  33. void furi_record_close(const char* name);
  34. #ifdef __cplusplus
  35. }
  36. #endif