Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!../lua/bin/lua
- -- Set libraries up
- package.path = package.path .. ';./lib/?.lua';
- package.cpath = package.cpath .. ';./lib/?.dll;./lib/?.so;';
- -- print("LUA MODULES:\n",(package.path:gsub("%;","\n\t")),"\n\nC MODULES:\n",(package.cpath:gsub("%;","\n\t")))
- libluaph = require 'libluaph1'
- url = require "url"
- inifile = require "inifile"
- pprint = require "pprint"
- require "lib" -- our main functions will be imported into the global namespace
- -- globals ---------------------------------------------------------------------
- log = nil -- file handle for log file
- log_buffer = "" -- string buffer, holds log data until we can open the log file
- -- ... a bunch of other globals
- if OS == nil then OS = "Linux" end -- change this when debugging outside the C wrapper to your environment
- --[[
- find the directory of the current executable
- make sure to handle the scripting environment as well as the
- compiled C file propperly
- set the base directory as environment variable PH_HOME
- ]]--
- PH_HOME = basename(libluaph.realpath(arg[0]))
- print("PH_HOME: ", PH_HOME)
- libluaph.setenv("PH_HOME", PH_HOME);
- print(os.getenv("PH_HOME"))
- print(libluaph.getenv("PH_HOME"))
- os.exit(0)
Advertisement
Add Comment
Please, Sign In to add comment