CFBase.odin 684 B

12345678910111213141516171819202122232425262728293031323334
  1. package CoreFoundation
  2. foreign import CoreFoundation "system:CoreFoundation.framework"
  3. TypeID :: distinct uint
  4. OptionFlags :: distinct uint
  5. HashCode :: distinct uint
  6. Index :: distinct int
  7. TypeRef :: distinct rawptr
  8. Range :: struct {
  9. location: Index,
  10. length: Index,
  11. }
  12. foreign CoreFoundation {
  13. // Releases a Core Foundation object.
  14. CFRelease :: proc(cf: TypeRef) ---
  15. }
  16. // Releases a Core Foundation object.
  17. Release :: proc {
  18. ReleaseObject,
  19. ReleaseString,
  20. }
  21. ReleaseObject :: #force_inline proc(cf: TypeRef) {
  22. CFRelease(cf)
  23. }
  24. // Releases a Core Foundation string.
  25. ReleaseString :: #force_inline proc(theString: String) {
  26. CFRelease(TypeRef(theString))
  27. }