#include <mex/config2mxstruct.h>
#include <base/user_info.h>

void mexFunction ( int n_output, mxArray *output[], int n_input, const mxArray *input[] ) {
	if (n_input>0){
		string filename = mxArray2string(input[0]);
		try{
			UImxConfig C (filename.c_str());
			if (n_output>0)
				output[0] = mxDuplicateArray(C.mxconfig);
		}catch(SettingException xcptn){
			cout<<"Error in:" + string(xcptn.getPath()) <<endl;
		}
		catch(exception e){
			cout <<"Error: " << e.what() <<endl;
		}
	}
}
