idk anymore

This commit is contained in:
Masashi 2025-12-17 18:32:29 +05:30
commit 3257bb449e
19 changed files with 537 additions and 77 deletions

View file

@ -16,6 +16,9 @@
// ODE support
#include <ode/ode.h>
// Perlin noise support
#include "perlin/perlin.h"
// Logging levels
typedef enum suic_log_level {
SUIC_LOG_ALL = 0,
@ -326,4 +329,67 @@ void suic_player_controller_jump(suic_player_controller* player);
void suic_player_controller_get_position(suic_player_controller* player, float *x, float *y, float *z);
void suic_player_controller_set_position(suic_player_controller* player, float x, float y, float z);
/* ===== FILE I/O API ===== */
typedef void* FileHandle;
typedef enum {
FILE_READ = 0,
FILE_WRITE = 1,
FILE_APPEND = 2
} FileMode;
/* Open a file and return a handle. Returns NULL on failure. */
FileHandle suic_file_open(const char* path, FileMode mode);
/* Close a file handle */
void suic_file_close(FileHandle handle);
/* Read up to size bytes from file. Returns number of bytes read. */
int suic_file_read(FileHandle handle, void* buffer, int size);
/* Write up to size bytes to file. Returns number of bytes written. */
int suic_file_write(FileHandle handle, const void* buffer, int size);
/* Get file size in bytes. Returns -1 on failure. */
int suic_file_size(FileHandle handle);
/* ===== RANDOM NUMBER GENERATION API ===== */
/* Seed the random number generator */
void suic_random_seed(uint32_t seed);
/* Get a random integer between 0 and 2^31-1 */
uint32_t suic_random_int(void);
/* Get a random integer between min and max (inclusive) */
int suic_random_int_range(int min, int max);
/* Get a random float between 0.0 and 1.0 */
float suic_random_float(void);
/* Get a random float between min and max */
float suic_random_float_range(float min, float max);
/* ===== TIME API ===== */
/* Get current time in milliseconds since program start */
uint64_t suic_get_time_ms(void);
/* Get current time in microseconds since program start */
uint64_t suic_get_time_us(void);
/* Get current Unix timestamp in seconds */
uint64_t suic_get_unix_time(void);
/* Sleep for milliseconds */
void suic_sleep_ms(uint32_t ms);
/* ===== UUID GENERATION API ===== */
/* Generate a random UUID v4 and return as string */
const char* suic_uuid_generate_v4(void);
/* Generate a random UUID v4 from seed */
const char* suic_uuid_generate_v4_seeded(uint64_t seed);
#endif // LIBSUICMEZ_H