sp_rsn.h 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. #ifndef SP_RSN_H
  2. #define SP_RSN_H
  3. #pragma once
  4. /* runtime serial number */
  5. #include "sp_uid.h"
  6. #define SP_RSN_UNKNOWN 0ULL
  7. #define SP_ORIGINAL_T_UNKNOWN 0
  8. #define SP_ORIGINAL_T_TIMER 1
  9. #define SP_ORIGINAL_T_CALLBACK 2
  10. #define SP_ORIGINAL_T_USER 3
  11. #define SP_ORIGINAL_T_FRAMEWORK 4
  12. typedef struct sp_rsn_context_t {
  13. sp_uid_t previous_rsn;
  14. sp_uid_t current_rsn;
  15. int original_type;
  16. int depth;
  17. }sp_rsn_context_t;
  18. void sp_rsn_context_init_original(sp_uid_t rsn, int original_type, sp_rsn_context_t *ctx);
  19. void sp_rsn_context_init_downstream(sp_uid_t rsn, const sp_rsn_context_t *upstream, sp_rsn_context_t *ctx);
  20. sp_rsn_context_t *sp_rsn_context_create_original(sp_uid_t rsn, int original_type);
  21. sp_rsn_context_t *sp_rsn_context_create_downstream(sp_uid_t rsn, const sp_rsn_context_t *upstream);
  22. void sp_rsn_context_destroy(sp_rsn_context_t *ctx);
  23. void sp_rsn_context_copy(sp_rsn_context_t *dst_ctx, const sp_rsn_context_t *src_ctx);
  24. sp_rsn_context_t *sp_rsn_context_clone(const sp_rsn_context_t *src_ctx);
  25. #endif // SP_RSN_H