2
0

exr_errors.odin 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. package vendor_openexr
  2. when ODIN_OS == .Windows {
  3. foreign import lib "OpenEXRCore-3_1.lib"
  4. } else {
  5. foreign import lib "system:OpenEXRCore-3_1"
  6. }
  7. import "core:c"
  8. #assert(size_of(c.int) == size_of(i32))
  9. /** Error codes that may be returned by various functions. */
  10. /** Return type for all functions. */
  11. result_t :: enum i32 {
  12. SUCCESS = 0,
  13. OUT_OF_MEMORY,
  14. MISSING_CONTEXT_ARG,
  15. INVALID_ARGUMENT,
  16. ARGUMENT_OUT_OF_RANGE,
  17. FILE_ACCESS,
  18. FILE_BAD_HEADER,
  19. NOT_OPEN_READ,
  20. NOT_OPEN_WRITE,
  21. HEADER_NOT_WRITTEN,
  22. READ_IO,
  23. WRITE_IO,
  24. NAME_TOO_LONG,
  25. MISSING_REQ_ATTR,
  26. INVALID_ATTR,
  27. NO_ATTR_BY_NAME,
  28. ATTR_TYPE_MISMATCH,
  29. ATTR_SIZE_MISMATCH,
  30. SCAN_TILE_MIXEDAPI,
  31. TILE_SCAN_MIXEDAPI,
  32. MODIFY_SIZE_CHANGE,
  33. ALREADY_WROTE_ATTRS,
  34. BAD_CHUNK_LEADER,
  35. CORRUPT_CHUNK,
  36. INCORRECT_PART,
  37. INCORRECT_CHUNK,
  38. USE_SCAN_DEEP_WRITE,
  39. USE_TILE_DEEP_WRITE,
  40. USE_SCAN_NONDEEP_WRITE,
  41. USE_TILE_NONDEEP_WRITE,
  42. INVALID_SAMPLE_DATA,
  43. FEATURE_NOT_IMPLEMENTED,
  44. UNKNOWN,
  45. }
  46. error_code_t :: result_t
  47. @(link_prefix="exr_", default_calling_convention="c")
  48. foreign lib {
  49. /** @brief Return a static string corresponding to the specified error code.
  50. *
  51. * The string should not be freed (it is compiled into the binary).
  52. */
  53. get_default_error_message :: proc(code: result_t) -> cstring ---
  54. /** @brief Return a static string corresponding to the specified error code.
  55. *
  56. * The string should not be freed (it is compiled into the binary).
  57. */
  58. get_error_code_as_string :: proc(code: result_t) -> cstring ---
  59. }