Beispiel #1
0
LUALIB_API int luaopen_base (lua_State *L) {
  base_open(L);
  luaL_openlib(L, LUA_COLIBNAME, co_funcs, 0);
  lua_newtable(L);
  lua_setglobal(L, REQTAB);
  return 0;
}
Beispiel #2
0
void luasrc_init (void) {
    if (g_bLuaInitialized)
        return;
    g_bLuaInitialized = true;

    L = lua_open();

    luaL_openlibs(L);
    base_open(L);

    luaopen_CBaseCombatWeapon(L);
    luaopen_CBaseEntity(L);
    luaopen_CBasePlayer(L);
    luaopen_Color(L);
    luaopen_ConCommand(L);
    luaopen_ConVar(L);
    luaopen_dbg(L);
    luaopen_engine(L);
    luaopen_filesystem(L);
    luaopen_gpGlobals(L);
    luaopen_cvar(L);
    luaopen_helpers(L);
    luaopen_g_pVoiceServer(L);
    luaopen_randomStr(L);
    luaopen_UTIL(L);
    luaopen_Vector(L);
    luaopen_QAngle(L);

    Msg( "Lua initialized (" LUA_VERSION ")\n" );
}
Beispiel #3
0
LUALIB_API int luaopen_base (lua_State *L) {
  base_open(L);
#if LUA_OPTIMIZE_MEMORY == 0
  luaL_register(L, LUA_COLIBNAME, co_funcs);
  return 2;
#else
  return 1;
#endif
}
Beispiel #4
0
LUALIB_API int luaopen_base (lua_State *L) {
  base_open(L);
  luaL_register(L, LUA_COLIBNAME, co_funcs);
#ifndef COCO_DISABLE
  lua_pushboolean(L, 1); 
  lua_setfield(L, -2, "coco");
#endif
  return 2;
}
Beispiel #5
0
static svn_error_t *
base_upgrade(svn_fs_t *fs, const char *path, apr_pool_t *pool,
             apr_pool_t *common_pool)
{
  const char *version_file_path;
  int old_format_number;
  svn_error_t *err;

  version_file_path = svn_dirent_join(path, FORMAT_FILE, pool);

  /* Read the old number so we've got it on hand later on. */
  err = svn_io_read_version_file(&old_format_number, version_file_path, pool);
  if (err && APR_STATUS_IS_ENOENT(err->apr_err))
    {
      /* Pre-1.2 filesystems do not have a 'format' file. */
      old_format_number = 0;
      svn_error_clear(err);
      err = SVN_NO_ERROR;
    }
  SVN_ERR(err);

  /* Bump the format file's stored version number. */
  SVN_ERR(svn_io_write_version_file(version_file_path,
                                    SVN_FS_BASE__FORMAT_NUMBER, pool));

  /* Check and see if we need to record the "bump" revision. */
  if (old_format_number < SVN_FS_BASE__MIN_FORWARD_DELTAS_FORMAT)
    {
      apr_pool_t *subpool = svn_pool_create(pool);
      svn_revnum_t youngest_rev;
      const char *value;

      /* Open the filesystem in a subpool (so we can control its
         closure) and do our fiddling.

         NOTE: By using base_open() here instead of open_databases(),
         we will end up re-reading the format file that we just wrote.
         But it's better to use the existing encapsulation of "opening
         the filesystem" rather than duplicating (or worse, partially
         duplicating) that logic here.  */
      SVN_ERR(base_open(fs, path, subpool, common_pool));

      /* Fetch the youngest rev, and record it */
      SVN_ERR(svn_fs_base__youngest_rev(&youngest_rev, fs, subpool));
      value = apr_psprintf(subpool, "%ld", youngest_rev);
      SVN_ERR(svn_fs_base__miscellaneous_set
              (fs, SVN_FS_BASE__MISC_FORWARD_DELTA_UPGRADE,
               value, subpool));
      svn_pool_destroy(subpool);
    }

  return SVN_NO_ERROR;
}
Beispiel #6
0
LUALIB_API int luaopen_base (lua_State *L) {
  int i;
  base_open(L);
  luaL_openlib(L, LUA_COLIBNAME, co_funcs, 0);
  lua_newtable(L);
  lua_setglobal(L, REQTAB);

  lua_getregistry(L);
  for (i = 0; i < LUA_NTYPES - 1; i++)
  {
    lua_pushstring(L, type_names[i]);
	lua_getdefaultmetatable(L, i);
    lua_settable(L, -3);
  }
  lua_pop(L, 1);

  return 0;
}
Beispiel #7
0
void luasrc_init (void) {
  if (g_bLuaInitialized)
	  return;
  g_bLuaInitialized = true;

  L = lua_open();

  luaL_openlibs(L);
  base_open(L);
  lcf_open(L);

  // Andrew; Someone set us up the path for great justice
  luasrc_setmodulepaths(L);

  luasrc_openlibs(L);

  Msg( "Lua initialized (" LUA_VERSION ")\n" );
}
Beispiel #8
0
void luasrc_init_gameui (void) {
  LGameUI = luaL_newstate();

  luaL_openlibs(LGameUI);
  base_open(LGameUI);
  lua_pushboolean(LGameUI, 1);
  lua_setglobal(LGameUI, "_GAMEUI");  /* set global _GAMEUI */

  luasrc_setmodulepaths(LGameUI);

  luaopen_ConCommand(LGameUI);
  luaopen_dbg(LGameUI);
  luaopen_engine(LGameUI);
  luaopen_enginevgui(LGameUI);
  luaopen_FCVAR(LGameUI);
  luaopen_KeyValues(LGameUI);
  luaopen_Panel(LGameUI);
  luaopen_surface(LGameUI);
  luaopen_vgui(LGameUI);
}
Beispiel #9
0
LUALIB_API int luaopen_base (lua_State *L) {
  base_open(L);
  luaL_register(L, LUA_COLIBNAME, co_funcs);
  return 2;
}
Beispiel #10
0
/*-------------------------------------------------------------------------*\
* Initializes all library modules.
\*-------------------------------------------------------------------------*/
LUASOCKET_API int luaopen_socket_core(lua_State *L) {
    int i;
    base_open(L);
    for (i = 0; mod[i].name; i++) mod[i].func(L);
    return 1;
}