static int allua_Path_get_tail(lua_State * L) { ALLUA_path path = allua_check_path(L, 1); lua_pushstring(L, al_get_path_tail(path)); return 1; }
static ALLEGRO_PATH *maybe_parent_dir(const ALLEGRO_PATH *path) { ALLEGRO_PATH *path2; if (!path) return NULL; if (!is_build_config_name(al_get_path_tail(path))) return NULL; path2 = al_clone_path(path); if (path2) { al_drop_path_tail(path2); al_set_path_filename(path2, NULL); ALLEGRO_DEBUG("Also searching %s\n", al_path_cstr(path2, '\\')); } return path2; }
/* drop build configuration directory tail */ static ALLEGRO_PATH *get_resources_path(void) { ALLEGRO_PATH *path; const char *last; path = al_get_standard_path(ALLEGRO_RESOURCES_PATH); if (!path) return al_create_path(""); /* If the last directory component is the name of an MSVC build * configuration, then drop it. */ last = al_get_path_tail(path); if (last && (0 == strcmp(last, "Debug") || 0 == strcmp(last, "Release") || 0 == strcmp(last, "RelWithDebInfo") || 0 == strcmp(last, "Profile"))) { al_drop_path_tail(path); } return path; }