obs-missing-files.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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, void *data);
  20. struct obs_missing_file;
  21. struct obs_missing_files;
  22. typedef struct obs_missing_file obs_missing_file_t;
  23. typedef struct obs_missing_files obs_missing_files_t;
  24. enum obs_missing_file_src { OBS_MISSING_FILE_SOURCE, OBS_MISSING_FILE_SCRIPT };
  25. EXPORT obs_missing_files_t *obs_missing_files_create();
  26. EXPORT obs_missing_file_t *obs_missing_file_create(const char *path, obs_missing_file_cb callback, int src_type,
  27. void *src, void *data);
  28. EXPORT void obs_missing_files_add_file(obs_missing_files_t *files, obs_missing_file_t *file);
  29. EXPORT size_t obs_missing_files_count(obs_missing_files_t *files);
  30. EXPORT obs_missing_file_t *obs_missing_files_get_file(obs_missing_files_t *files, int idx);
  31. EXPORT void obs_missing_files_destroy(obs_missing_files_t *files);
  32. EXPORT void obs_missing_files_append(obs_missing_files_t *dst, obs_missing_files_t *src);
  33. EXPORT void obs_missing_file_issue_callback(obs_missing_file_t *file, const char *new_path);
  34. EXPORT const char *obs_missing_file_get_path(obs_missing_file_t *file);
  35. EXPORT const char *obs_missing_file_get_source_name(obs_missing_file_t *file);
  36. EXPORT void obs_missing_file_release(obs_missing_file_t *file);
  37. EXPORT void obs_missing_file_destroy(obs_missing_file_t *file);
  38. #ifdef __cplusplus
  39. }
  40. #endif