|
| char * | l_str_new2 (int n,...) |
| |
| char * | l_str_cat2 (char *str, int n,...) |
| |
| char * | l_str_new3 (const char *format,...) |
| |
| char * | l_str_cat3 (char *str, const char *format,...) |
| |
| LG_Path | lg_path (const char *s, lg_path_type t) |
| |
| const char * | lg_path_resolve (const LG_Path *path) |
| |
| LG_Path | lg_path_in_assets_from_fullpath_string (const char *full_path) |
| |
| LG_Path | lg_path_in_wrdir_from_fullpath_string (const char *full_path) |
| |
| lg_path_type | lg_path_get_type_from_fullpath_string (const char *full_path) |
| |
| zboolean | lg_path_string_resolve (char *path) |
| |
| const char * | lg_path_type_get_string (lg_path_type type) |
| |
| zboolean | lg_path_are_equal (const LG_Path *path1, const LG_Path *path2) |
| |
| void | lg_path_info (LG_Path *path) |
| |
| void | lg_resolved_path0_free_buffer () |
| |
| LG_Stack_i * | lg_stack_i_new (int max_n) |
| |
| void | lg_stack_i_free (LG_Stack_i *s) |
| |
| zboolean | push_i (LG_Stack_i *s, int v) |
| |
| zboolean | pop_i (LG_Stack_i *s, int *v) |
| |
| LG_Stack_f * | lg_stack_f_new (int max_n) |
| |
| void | lg_stack_f_free (LG_Stack_f *s) |
| |
| zboolean | push_f (LG_Stack_f *s, float v) |
| |
| zboolean | pop_f (LG_Stack_f *s, float *v) |
| |
| void | lg_stack_show_full_empty_errors (zboolean show_errors) |
| |
=== Only really convenient stuff ===
| LG_Path lg_path |
( |
const char * |
s, |
|
|
lg_path_type |
t |
|
) |
| |
Create a new LG_Path, ie a path and an associated type, which specify if this path is relative inside the ASSETS folder, or relative inside the APP_WRITABLE folder, or full, or a filename only, or unknown
LG_Path are LOSSLESS, CROSS-APP, AND CROSS-PLATFORM, so you should use them everywhere they are relevant
String max len = LG_PATH_MAX_LEN (see below)
In lg_goodies.h:
#define LG_PATH_MAX_LEN (512 - 1 - 1)
typedef int8_t lg_path_type;
enum {IN_ASSETS, IN_APP_WR_DIR, FULL, NAME_ONLY, UNSPECIFIED};
typedef struct __attribute__((packed, aligned(4))) {
char s[LG_PATH_MAX_LEN + 1];
lg_path_type t;
Definition lg_goodies.h:20
Usage example:
LG_Path lg_path(const char *s, lg_path_type t)
Definition lg_goodies.c:149
- Parameters
-
| s | String containing the path - if NULL, path is set to an empty string |
| t | Path type, one of IN_ASSETS, IN_APP_WR_DIR, FULL, NAME_ONLY, UNSPECIFIED - if invalid, set to UNSPECIFIED |
- Returns
- A new LG_Path
| zboolean lg_path_string_resolve |
( |
char * |
path | ) |
|
Resolve a path string (not a path) which includes "../", "./" sequences and extra '/' , making it a valid one
-> doesn't return a full path, unless string is a full path
Change path in place
This func is called internally by lg_path_resolve() but you may use it with any 'writable' string
- Parameters
-
| path | Path to resolve - will be overwritten |
- Returns
- TRUE if OK, FALSE on error (no changes applied)
| const char * lg_path_type_get_string |
( |
lg_path_type |
type | ) |
|
Get string from lg_path_type
IN_ASSETS, IN_APP_WR_DIR, FULL, NAME_ONLY, UNSPECIFIED -> 'IN_ASSETS', 'IN_APP_WR_DIR', 'FULL', 'NAME_ONLY', 'UNSPECIFIED'
- Parameters
-
- Returns
- String from lg_path_type