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.

109 lines
2.0 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. #ifndef RESOURCE_ID_H
  7. #define RESOURCE_ID_H
  8. /* structs to contain info about parsed resource ids (filenames, uids) */
  9. /**
  10. * @enum pEp_resource_id_type
  11. *
  12. * @brief TODO
  13. *
  14. */
  15. typedef enum _resource_id_type {
  16. PEP_RID_FILENAME,
  17. PEP_RID_CID
  18. } pEp_resource_id_type;
  19. typedef struct pEp_rid_list_t pEp_rid_list_t;
  20. /**
  21. * @struct pEp_rid_list_t
  22. *
  23. * @brief TODO
  24. *
  25. */
  26. struct pEp_rid_list_t {
  27. pEp_resource_id_type rid_type;
  28. char* rid;
  29. pEp_rid_list_t* next;
  30. };
  31. pEp_rid_list_t* new_rid_node(pEp_resource_id_type type, const char* resource);
  32. /**
  33. * <!-- free_rid_list() -->
  34. *
  35. * @brief TODO
  36. *
  37. * @param[in] list pEp_rid_list_t*
  38. *
  39. */
  40. void free_rid_list(pEp_rid_list_t* list);
  41. /**
  42. * <!-- parse_uri() -->
  43. *
  44. * @brief TODO
  45. *
  46. * @param[in] uri const char*
  47. *
  48. */
  49. pEp_rid_list_t* parse_uri(const char* uri);
  50. /**
  51. * <!-- build_uri() -->
  52. *
  53. * @brief TODO
  54. *
  55. * @param[in] uri_prefix const char*
  56. * @param[in] resource const char*
  57. *
  58. */
  59. char* build_uri(const char* uri_prefix, const char* resource);
  60. /**
  61. * <!-- get_resource_ptr_noown() -->
  62. *
  63. * @brief TODO
  64. *
  65. * @param[in] uri const char*
  66. *
  67. */
  68. const char* get_resource_ptr_noown(const char* uri);
  69. /**
  70. * <!-- get_resource() -->
  71. *
  72. * @brief TODO
  73. *
  74. * @param[in] uri char*
  75. *
  76. */
  77. char* get_resource(char* uri);
  78. /**
  79. * <!-- is_file_uri() -->
  80. *
  81. * @brief TODO
  82. *
  83. * @param[in] str char*
  84. *
  85. */
  86. bool is_file_uri(char* str);
  87. /**
  88. * <!-- is_cid_uri() -->
  89. *
  90. * @brief TODO
  91. *
  92. * @param[in] str const char*
  93. *
  94. */
  95. bool is_cid_uri(const char* str);
  96. #endif