/*** $Id: loadlib.c,v 1.52.1.4 2009/09/09 13:17:16 roberto Exp $** Dynamic library loader for Lua** See Copyright Notice in lua.h**** This module contains an implementation of loadlib for Unix systems** that have dlfcn, an implementation for Darwin (Mac OS X), an** implementation for Windows, and a stub for other systems.*/#include <stdlib.h>#include <string.h>#define loadlib_c#define LUA_LIB#include"lua.h"#include"lauxlib.h"#include"lualib.h"/* prefix for open functions in C libraries */#define LUA_POF"luaopen_"/* separator for open functions in C libraries */#define LUA_OFSEP"_"#define LIBPREFIX"LOADLIB: "#define POF LUA_POF#define LIB_FAIL"open"/* error codes for ll_loadfunc */#define ERRLIB 1#define ERRFUNC 2#define setprogdir(L) ((void)0)static voidll_unloadlib(void*lib);static void*ll_load(lua_State *L,const char*path);static lua_CFunction ll_sym(lua_State *L,void*lib,const char*sym);