0

Odin Rqt-close (DIRECT | 2024)

| Platform | Resource Type | Close Function | |----------|---------------|----------------| | Windows | HANDLE | CloseHandle | | Linux / macOS | file descriptor | close (syscall or libc) | | WebAssembly (WASI) | fd | fd_close |

In Odin, every open deserves a close, every create a destroy. Your future self (and your operating system) will thank you. odin rqt-close

close_resource :: proc(resource: ^Raw_Resource) when ODIN_OS == "windows" sys.windows.CloseHandle(resource.handle) else when ODIN_OS == "linux" sys.linux.close(resource.fd) resource.valid = false | Platform | Resource Type | Close Function

import "core:runtime" cleanup_my_resource :: proc(data: rawptr) handle := cast(^windows.HANDLE)data CloseHandle(handle^) every open deserves a close

init_program :: proc() my_handle := CreateFile(...) runtime.add_cleanup(cleanup_my_resource, &my_handle)

when ODIN_OS == "windows" close_fn :: proc(h: rawptr) windows.CloseHandle(transmute(windows.HANDLE)h) else when ODIN_OS == "linux" || ODIN_OS == "darwin" close_fn :: proc(fd: rawptr) sys.linux.close(transmute(int)fd)

if my_handle != INVALID_HANDLE CloseHandle(my_handle) my_handle = INVALID_HANDLE

| Platform | Resource Type | Close Function | |----------|---------------|----------------| | Windows | HANDLE | CloseHandle | | Linux / macOS | file descriptor | close (syscall or libc) | | WebAssembly (WASI) | fd | fd_close |

In Odin, every open deserves a close, every create a destroy. Your future self (and your operating system) will thank you.

close_resource :: proc(resource: ^Raw_Resource) when ODIN_OS == "windows" sys.windows.CloseHandle(resource.handle) else when ODIN_OS == "linux" sys.linux.close(resource.fd) resource.valid = false

import "core:runtime" cleanup_my_resource :: proc(data: rawptr) handle := cast(^windows.HANDLE)data CloseHandle(handle^)

init_program :: proc() my_handle := CreateFile(...) runtime.add_cleanup(cleanup_my_resource, &my_handle)

when ODIN_OS == "windows" close_fn :: proc(h: rawptr) windows.CloseHandle(transmute(windows.HANDLE)h) else when ODIN_OS == "linux" || ODIN_OS == "darwin" close_fn :: proc(fd: rawptr) sys.linux.close(transmute(int)fd)

if my_handle != INVALID_HANDLE CloseHandle(my_handle) my_handle = INVALID_HANDLE

Page information:

Download Nammina Na Madhi 🎶✨ ringtone for mobiles - one of the best ringtones! You will certainly enjoy its beautiful melody. At PHONEKY Ringtones Store, you can download ringtones of different genres, from Pop/Rock and R'NB to the Jazz, Classic and Funny mobile ringtones for any mobile phone. Download ringtones to your mobile phone directly or via computer. To see the Top 10 best ringtones for mobile phones, just sort ringtones by popularity.

Okay
Instructions:

Download ringtone to your mobile device.
1- Press and hold yor finger on the "Download" link until the save dialog appears.
If you are using a computer browser then right click on the "Download" link and click "Save target as".
2- Select "Save Link", your browser will start to download ringtone.

3- You can find and set the new ringtone in Settings > Sounds > Ringtones.
Okay