obs-missing-files.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /******************************************************************************
  2. Copyright (C) 2019 by Dillon Pentz <[email protected]>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ******************************************************************************/
  14. #pragma once
  15. #include "util/c99defs.h"
  16. #ifdef __cplusplus
  17. extern "C" {
  18. #endif
  19. typedef void (*obs_missing_file_cb)(void *src, const char *new_path,
  20. void *data);
  21. struct obs_missing_file;
  22. struct obs_missing_files;
  23. typedef struct obs_missing_file obs_missing_file_t;
  24. typedef struct obs_missing_files obs_missing_files_t;
  25. enum obs_missing_file_src { OBS_MISSING_FILE_SOURCE, OBS_MISSING_FILE_SCRIPT };
  26. EXPORT obs_missing_files_t *obs_missing_files_create();
  27. EXPORT obs_missing_file_t *obs_missing_file_create(const char *path,
  28. obs_missing_file_cb callback,
  29. int src_type, void *src,
  30. void *data);
  31. EXPORT void obs_missing_files_add_file(obs_missing_files_t *files,
  32. obs_missing_file_t *file);
  33. EXPORT size_t obs_missing_files_count(obs_missing_files_t *files);
  34. EXPORT obs_missing_file_t *
  35. obs_missing_files_get_file(obs_missing_files_t *files, int idx);
  36. EXPORT void obs_missing_files_destroy(obs_missing_files_t *files);
  37. EXPORT void obs_missing_files_append(obs_missing_files_t *dst,
  38. obs_missing_files_t *src);
  39. EXPORT void obs_missing_file_issue_callback(obs_missing_file_t *file,
  40. const char *new_path);
  41. EXPORT const char *obs_missing_file_get_path(obs_missing_file_t *file);
  42. EXPORT const char *obs_missing_file_get_source_name(obs_missing_file_t *file);
  43. EXPORT void obs_missing_file_release(obs_missing_file_t *file);
  44. EXPORT void obs_missing_file_destroy(obs_missing_file_t *file);
  45. #ifdef __cplusplus
  46. }
  47. #endif