Mercurial > repos > blastem
comparison util.c @ 1485:369da70ee2c2 nuklear_ui
Filter file list in Nuklear UI
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 26 Nov 2017 18:33:36 -0800 |
parents | d82af64c94d2 |
children | c416ace65ff1 |
comparison
equal
deleted
inserted
replaced
1484:d82af64c94d2 | 1485:369da70ee2c2 |
---|---|
266 if (!lastdot || (lastslash && lastslash > lastdot)) { | 266 if (!lastdot || (lastslash && lastslash > lastdot)) { |
267 //no extension | 267 //no extension |
268 return NULL; | 268 return NULL; |
269 } | 269 } |
270 return strdup(lastdot+1); | 270 return strdup(lastdot+1); |
271 } | |
272 | |
273 uint8_t path_matches_extensions(char *path, char **ext_list, uint32_t num_exts) | |
274 { | |
275 char *ext = path_extension(path); | |
276 if (!ext) { | |
277 return 0; | |
278 } | |
279 uint32_t extidx; | |
280 for (extidx = 0; extidx < num_exts; extidx++) | |
281 { | |
282 if (!strcasecmp(ext, ext_list[extidx])) { | |
283 return 1; | |
284 } | |
285 } | |
286 return 0; | |
271 } | 287 } |
272 | 288 |
273 char * path_dirname(char *path) | 289 char * path_dirname(char *path) |
274 { | 290 { |
275 char *lastslash = NULL; | 291 char *lastslash = NULL; |