BPTR setup_config( struct opusftp_globals *ogp ) { BPTR lfp = NULL; struct ftp_config *oc; BPTR lock; oc = &ogp->og_oc; // initialise blank config and read config from disk if (!get_global_options(ogp)) { set_config_to_default(oc); // check for old config and read if there if ((lock = Lock(CONFIGFILE, ACCESS_READ))) { UnLock(lock); read_old_config(oc); } } // Open log file if (*oc->oc_logname && oc->oc_enable_log) { if ((lfp = Open( oc->oc_logname, MODE_NEWFILE ))) ogp->og_log_open=TRUE; } return lfp; }
static int _set_global_option(lua_State * L) { options o = get_global_options(L); push_options(L, o); lua_insert(L, 1); options_update(L); o = to_options(L, -1); set_global_options(L, o); return 0; }
static int _get_global_options(lua_State * L) { return push_options(L, get_global_options(L)); }