comparison util.h @ 2156:237068a25523

Added UI for setting firmware paths
author Michael Pavone <pavone@retrodev.com>
date Thu, 28 Apr 2022 18:41:16 -0700
parents 441d5d6cea2f
children bdd83b47d78a
comparison
equal deleted inserted replaced
2152:c3ee42c89b27 2156:237068a25523
47 //Returns the basename of a path with th extension (if any) stripped 47 //Returns the basename of a path with th extension (if any) stripped
48 char * basename_no_extension(const char *path); 48 char * basename_no_extension(const char *path);
49 //Returns the extension from a path or NULL if there is no extension 49 //Returns the extension from a path or NULL if there is no extension
50 char *path_extension(char const *path); 50 char *path_extension(char const *path);
51 //Returns true if the given path matches one of the extensions in the list 51 //Returns true if the given path matches one of the extensions in the list
52 uint8_t path_matches_extensions(char *path, char **ext_list, uint32_t num_exts); 52 uint8_t path_matches_extensions(char *path, const char **ext_list, uint32_t num_exts);
53 //Returns the directory portion of a path or NULL if there is no directory part 53 //Returns the directory portion of a path or NULL if there is no directory part
54 char *path_dirname(const char *path); 54 char *path_dirname(const char *path);
55 //Gets the smallest power of two that is >= a certain value, won't work for values > 0x80000000 55 //Gets the smallest power of two that is >= a certain value, won't work for values > 0x80000000
56 uint32_t nearest_pow2(uint32_t val); 56 uint32_t nearest_pow2(uint32_t val);
57 //Should be called by main with the value of argv[0] for use by get_exe_dir 57 //Should be called by main with the value of argv[0] for use by get_exe_dir