You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
1.8 KiB

  1. /**
  2. * @file resource_id.h
  3. * @brief resource id (filenames, uids) structs and access/generation/manipulation functions
  4. * @license GNU General Public License 3.0 - see LICENSE.txt
  5. */
  6. #pragma once
  7. /* structs to contain info about parsed resource ids (filenames, uids) */
  8. /**
  9. * @enum pEp_resource_id_type
  10. *
  11. * @brief TODO
  12. *
  13. */
  14. typedef enum _resource_id_type {
  15. PEP_RID_FILENAME,
  16. PEP_RID_CID
  17. } pEp_resource_id_type;
  18. typedef struct pEp_rid_list_t pEp_rid_list_t;
  19. /**
  20. * @struct pEp_rid_list_t
  21. *
  22. * @brief TODO
  23. *
  24. */
  25. struct pEp_rid_list_t {
  26. pEp_resource_id_type rid_type;
  27. char* rid;
  28. pEp_rid_list_t* next;
  29. };
  30. pEp_rid_list_t* new_rid_node(pEp_resource_id_type type, const char* resource);
  31. /**
  32. * <!-- free_rid_list() -->
  33. *
  34. * @brief TODO
  35. *
  36. * @param[in] *list pEp_rid_list_t
  37. *
  38. */
  39. void free_rid_list(pEp_rid_list_t* list);
  40. /**
  41. * <!-- parse_uri() -->
  42. *
  43. * @brief TODO
  44. *
  45. * @param[in] *uri constchar
  46. *
  47. */
  48. pEp_rid_list_t* parse_uri(const char* uri);
  49. /**
  50. * <!-- build_uri() -->
  51. *
  52. * @brief TODO
  53. *
  54. * @param[in] *uri_prefix constchar
  55. * @param[in] *resource constchar
  56. *
  57. */
  58. char* build_uri(const char* uri_prefix, const char* resource);
  59. /**
  60. * <!-- get_resource_ptr_noown() -->
  61. *
  62. * @brief TODO
  63. *
  64. * @param[in] *uri constchar
  65. *
  66. */
  67. const char* get_resource_ptr_noown(const char* uri);
  68. /**
  69. * <!-- get_resource() -->
  70. *
  71. * @brief TODO
  72. *
  73. * @param[in] *uri char
  74. *
  75. */
  76. char* get_resource(char* uri);
  77. /**
  78. * <!-- is_file_uri() -->
  79. *
  80. * @brief TODO
  81. *
  82. * @param[in] *str char
  83. *
  84. */
  85. bool is_file_uri(char* str);
  86. /**
  87. * <!-- is_cid_uri() -->
  88. *
  89. * @brief TODO
  90. *
  91. * @param[in] *str constchar
  92. *
  93. */
  94. bool is_cid_uri(const char* str);