/* Function: al_make_path_absolute */ bool al_make_path_absolute(ALLEGRO_PATH *path) { ALLEGRO_PATH *cwd_path; int i; ASSERT(path); if (path_is_absolute(path)) { return true; } cwd_path = al_get_current_directory(); if (!cwd_path) return false; al_set_path_drive(path, al_get_path_drive(cwd_path)); for (i = al_get_path_num_components(cwd_path) - 1; i >= 0; i--) { al_insert_path_component(path, 0, al_get_path_component(cwd_path, i)); } al_destroy_path(cwd_path); return true; }
static int allua_Path_get_drive(lua_State * L) { ALLUA_path path = allua_check_path(L, 1); lua_pushstring(L, al_get_path_drive(path)); return 1; }