示例#1
0
文件: path.c 项目: sesc4mt/mvcdecoder
/* 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;
}
示例#2
0
文件: path.c 项目: trezker/allua
static int allua_Path_insert_component(lua_State * L)
{
   ALLUA_path path = allua_check_path(L, 1);
   int i = luaL_checkint(L, 2);
   const char *s = luaL_checkstring(L, 3);

   al_insert_path_component(path, i, s);

   return 0;
}