|
Gama C Library
Gama C API Documentation
|
Provides general utility functions for file handling and string manipulation. More...
Go to the source code of this file.
Functions | |
| void | gmu_get_filename_base (const char *path, char *out_base, size_t out_size) |
| Extracts the base filename (filename with extension) from a full path. | |
| void | gmu_get_filename_stem (const char *path, char *out_stem, size_t out_size) |
| Extracts the filename stem (filename without extension) from a full path. | |
| int | gmu_read_file (const char *path, char **content, size_t *size) |
| Reads the entire content of a file into a dynamically allocated buffer. | |
Provides general utility functions for file handling and string manipulation.
This file contains miscellaneous helper functions that are not directly related to a specific Gama module but are useful across the engine.
| void gmu_get_filename_base | ( | const char * | path, |
| char * | out_base, | ||
| size_t | out_size ) |
Extracts the base filename (filename with extension) from a full path.
Example: path = "/home/user/image.png" -> out_base = "image.png"
| path | The full path string. |
| out_base | Buffer to store the extracted filename. |
| out_size | The size of the out_base buffer. |
| void gmu_get_filename_stem | ( | const char * | path, |
| char * | out_stem, | ||
| size_t | out_size ) |
Extracts the filename stem (filename without extension) from a full path.
Example: path = "/home/user/image.png" -> out_stem = "image"
| path | The full path string. |
| out_stem | Buffer to store the extracted filename stem. |
| out_size | The size of the out_stem buffer. |
| int gmu_read_file | ( | const char * | path, |
| char ** | content, | ||
| size_t * | size ) |
Reads the entire content of a file into a dynamically allocated buffer.
The caller is responsible for freeing the *content buffer.
| path | The path to the file to read. |
| content | A pointer to a char* that will be allocated and filled with the file's content. |
| size | A pointer to a size_t that will store the size of the read content. Can be NULL. |