• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setprogdir函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setprogdir函数的典型用法代码示例。如果您正苦于以下问题:C++ setprogdir函数的具体用法?C++ setprogdir怎么用?C++ setprogdir使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setprogdir函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: setpath

static void setpath (lua_State *L, const char *fieldname, const char *envname,
                                   const char *def) {
  (void)envname;
  lua_pushstring(L, def);  /* use default */
  setprogdir(L);
  lua_setfield(L, -2, fieldname);
}
开发者ID:Rockbox,项目名称:rockbox,代码行数:7,代码来源:loadlib.c


示例2: setpath

static void setpath (lua_State *L, const char* fieldname, const char* envname,
                                   const char* def) {
  const char* path = getenv(envname);
  if (path == nullptr)  /* no environment variable? */
    lua_pushstring(L, def);  /* use default */
  else {
    /* replace ";;" by ";AUXMARK;" and then AUXMARK by default path */
    path = luaL_gsub(L, path, LUA_PATHSEP LUA_PATHSEP,
                              LUA_PATHSEP AUXMARK LUA_PATHSEP);
    luaL_gsub(L, path, AUXMARK, def);
    lua_remove(L, -2);
  }
  setprogdir(L);
  lua_setfield(L, -2, fieldname);
}
开发者ID:Isaacssv552,项目名称:ufoai,代码行数:15,代码来源:loadlib.cpp


示例3: setpath

static void setpath(lua_State *L, const char *fieldname, const char *envname,
		    const char *def)
{
  const char *path = getenv(envname);
  if (path == NULL) {
    lua_pushstring(L, def);
  } else {
    path = luaL_gsub(L, path, LUA_PATHSEP LUA_PATHSEP,
			      LUA_PATHSEP AUXMARK LUA_PATHSEP);
    luaL_gsub(L, path, AUXMARK, def);
    lua_remove(L, -2);
  }
  setprogdir(L);
  lua_setfield(L, -2, fieldname);
}
开发者ID:ghisguth,项目名称:lua-cmake-source,代码行数:15,代码来源:lib_package.c


示例4: setpath

static void setpath (lua_State *L, const char *fieldname, const wchar_t *envname,
                                   const wchar_t *def) {
  const wchar_t *path = _wgetenv(envname);
  if (path == NULL)  /* no environment variable? */
    lua_pushlstring(L, (const char*)def, sizeof(wchar_t)*(1+wcslen(def)));  /* use default */
  else {
    /* replace ";;" by ";AUXMARK;" and then AUXMARK by default path */
    path = LF_Gsub(L, path, LUA_PATHSEP LUA_PATHSEP,
                            LUA_PATHSEP AUXMARK LUA_PATHSEP);
    LF_Gsub(L, path, AUXMARK, def);
    lua_remove(L, -2);
  }
  setprogdir(L);
  push_utf8_string(L, (const wchar_t*)lua_tostring(L, -1), -1);
  lua_remove(L, -2);
  lua_setfield(L, -2, fieldname);
}
开发者ID:gvsurenderreddy,项目名称:LuaFAR,代码行数:17,代码来源:uloadlib51.c


示例5: setpath

static void setpath (lua_State *L, const char *fieldname, const char *envname,
                                   const char *def) {
#if !defined(_XBOX_VER) && !defined(PS3) && !defined(DURANGO) && !defined(ORBIS)
  const char *path = getenv(envname);
#else
  const char *path = NULL;
#endif
  if (path == NULL)  /* no environment variable? */
    lua_pushstring(L, def);  /* use default */
  else {
    /* replace ";;" by ";AUXMARK;" and then AUXMARK by default path */
    path = luaL_gsub(L, path, LUA_PATHSEP LUA_PATHSEP,
                              LUA_PATHSEP AUXMARK LUA_PATHSEP);
    luaL_gsub(L, path, AUXMARK, def);
    lua_remove(L, -2);
  }
  setprogdir(L);
  lua_setfield(L, -2, fieldname);
}
开发者ID:aronarts,项目名称:FireNET,代码行数:19,代码来源:loadlib.c


示例6: setpath

static void setpath(lua_State *L, const char *fieldname, const char *envname,
		    const char *def, int noenv)
{
#if LJ_TARGET_CONSOLE
  const char *path = NULL;
  UNUSED(envname);
#else
  const char *path = getenv(envname);
#endif
  if (path == NULL || noenv) {
    lua_pushstring(L, def);
  } else {
    path = luaL_gsub(L, path, LUA_PATHSEP LUA_PATHSEP,
			      LUA_PATHSEP AUXMARK LUA_PATHSEP);
    luaL_gsub(L, path, AUXMARK, def);
    lua_remove(L, -2);
  }
  setprogdir(L);
  lua_setfield(L, -2, fieldname);
}
开发者ID:qyqx,项目名称:BerryBots,代码行数:20,代码来源:lib_package.c


示例7: setpath

static void setpath (lua_State *L, const char *fieldname, const char *envname,
                                   const char *def) {
#ifdef SYSLINUX
  const char *path = NULL;
#else
  const char *path = getenv(envname);
#endif
  (void)envname;     /* Shut up gcc */
  if (path == NULL)  /* no environment variable? */
    lua_pushstring(L, def);  /* use default */
  else {
    /* replace ";;" by ";AUXMARK;" and then AUXMARK by default path */
    path = luaL_gsub(L, path, LUA_PATHSEP LUA_PATHSEP,
                              LUA_PATHSEP AUXMARK LUA_PATHSEP);
    luaL_gsub(L, path, AUXMARK, def);
    lua_remove(L, -2);
  }
  setprogdir(L);
  lua_setfield(L, -2, fieldname);
}
开发者ID:1stMaster,项目名称:syslinux,代码行数:20,代码来源:loadlib.c


示例8: setpath

static void setpath (lua_State *L, const char *fieldname, const char *envname1,
                                   const char *envname2, const char *def) {
#if 0 // XXX TODO
  const char *path = getenv(envname1);
  if (path == NULL)  /* no environment variable? */
    path = getenv(envname2);  /* try alternative name */
  if (path == NULL || noenv(L))  /* no environment variable? */
    lua_pushstring(L, def);  /* use default */
  else {
    /* replace ";;" by ";AUXMARK;" and then AUXMARK by default path */
    path = luaL_gsub(L, path, LUA_PATH_SEP LUA_PATH_SEP,
                              LUA_PATH_SEP AUXMARK LUA_PATH_SEP);
    luaL_gsub(L, path, AUXMARK, def);
    lua_remove(L, -2);
  }
  setprogdir(L);
  lua_setfield(L, -2, fieldname);
#endif 
  throw "Not implemented";
}
开发者ID:pnapieralski,项目名称:LuaRT,代码行数:20,代码来源:loadlib.cpp


示例9: setpath

/*
** Set a path
*/
static void setpath (lua_State *L, const char *fieldname,
                                   const char *envname,
                                   const char *dft) {
  const char *nver = lua_pushfstring(L, "%s%s", envname, LUA_VERSUFFIX);
  const char *path = getenv(nver);  /* use versioned name */
  if (path == NULL)  /* no environment variable? */
    path = getenv(envname);  /* try unversioned name */
  if (path == NULL || noenv(L))  /* no environment variable? */
    lua_pushstring(L, dft);  /* use default */
  else {
    /* replace ";;" by ";AUXMARK;" and then AUXMARK by default path */
    path = luaL_gsub(L, path, LUA_PATH_SEP LUA_PATH_SEP,
                              LUA_PATH_SEP AUXMARK LUA_PATH_SEP);
    luaL_gsub(L, path, AUXMARK, dft);
    lua_remove(L, -2); /* remove result from 1st 'gsub' */
  }
  setprogdir(L);
  lua_setfield(L, -3, fieldname);  /* package[fieldname] = path value */
  lua_pop(L, 1);  /* pop versioned variable name */
}
开发者ID:AMDmi3,项目名称:widelands,代码行数:23,代码来源:loadlib.c


示例10: setpath

static void setpath (lua_State *L, const char *fieldname, const char *envname1,
                                   const char *envname2, const char *def) {
#if defined(WINAPI_FAMILY_PARTITION)
  const char *path = NULL;
#else
  const char *path = getenv(envname1);
  if (path == NULL)  /* no environment variable? */
    path = getenv(envname2);  /* try alternative name */
#endif

  if (path == NULL || noenv(L))  /* no environment variable? */
    lua_pushstring(L, def);  /* use default */
  else {
    /* replace ";;" by ";AUXMARK;" and then AUXMARK by default path */
    path = luaL_gsub(L, path, LUA_PATH_SEP LUA_PATH_SEP,
                              LUA_PATH_SEP AUXMARK LUA_PATH_SEP);
    luaL_gsub(L, path, AUXMARK, def);
    lua_remove(L, -2);
  }
  setprogdir(L);
  lua_setfield(L, -2, fieldname);
}
开发者ID:littlesome,项目名称:xLua,代码行数:22,代码来源:loadlib.c



注:本文中的setprogdir函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setprogname函数代码示例发布时间:2022-05-30
下一篇:
C++ setproctitle函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap