Reorganize

This commit is contained in:
2026-01-19 20:50:02 -06:00
parent ccde0a4cc6
commit 3250398b96
4 changed files with 19 additions and 22 deletions

36
szlib/helper_procs.odin Normal file
View File

@@ -0,0 +1,36 @@
package szlib
import sp "core:path/slashpath"
import "core:crypto"
import "core:encoding/uuid"
import "core:os/os2"
get_data_directory :: proc() -> (result: string, error: os2.Error) {
exe_dir, err := os2.get_executable_directory(context.allocator)
if err != os2.General_Error.None {
return "", error
}
data_path := sp.join({exe_dir, "data"})
if (!os2.is_directory(data_path))
{
mkdir_err := os2.make_directory(data_path)
if mkdir_err != os2.General_Error.None
{
return "", mkdir_err
}
}
return data_path, os2.General_Error.None
}
create_uuid :: proc() -> string {
new_uuid: string
{
context.random_generator = crypto.random_generator()
new_uuid = uuid.to_string_allocated(uuid.generate_v7())
}
return new_uuid
}