//
// MATLAB Compiler: 2.2
// Date: Wed Mar 10 16:44:47 2004
// Arguments: "-B" "macro_default" "-O" "all" "-O" "fold_scalar_mxarrays:on"
// "-O" "fold_non_scalar_mxarrays:on" "-O" "optimize_integer_for_loops:on" "-O"
// "array_indexing:on" "-O" "optimize_conditionals:on" "-p" "-W" "main" "-L"
// "Cpp" "-t" "-T" "link:exe" "-h" "libmmfile.mlib" "-B" "sglcpp" "-p" "-W"
// "main" "-L" "Cpp" "-t" "-T" "link:exe" "-h" "libmmfile.mlib" "-W" "mainhg"
// "libmwsglm.mlib" "hier_community.m" "Default.m" "Stop_Simulation.m"
// "Call_SaveLoad_Fig.m" "SaveLoad_Fig.m" "SaveLoad.m" "Load_Population_Data.m"
// "Save_Population_Data.m" "Start_hier_community.m" "MyInline.m" "My_Eval.m"
// "isnumber.m" "Find_Var.m" "Change_Number_of_Populations.m"
// "Switch_Populations.m" "Store_Parameters.m" 
//
#include "Call_SaveLoad_Fig.hpp"
#include "SaveLoad.hpp"
#include "SaveLoad_Fig.hpp"
#include "libmatlbm.hpp"

static mxChar _array1_[152] = { 'R', 'u', 'n', '-', 't', 'i', 'm', 'e', ' ',
                                'E', 'r', 'r', 'o', 'r', ':', ' ', 'F', 'i',
                                'l', 'e', ':', ' ', 'C', 'a', 'l', 'l', '_',
                                'S', 'a', 'v', 'e', 'L', 'o', 'a', 'd', '_',
                                'F', 'i', 'g', ' ', 'L', 'i', 'n', 'e', ':',
                                ' ', '1', ' ', 'C', 'o', 'l', 'u', 'm', 'n',
                                ':', ' ', '1', ' ', 'T', 'h', 'e', ' ', 'f',
                                'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', '"',
                                'C', 'a', 'l', 'l', '_', 'S', 'a', 'v', 'e',
                                'L', 'o', 'a', 'd', '_', 'F', 'i', 'g', '"',
                                ' ', 'w', 'a', 's', ' ', 'c', 'a', 'l', 'l',
                                'e', 'd', ' ', 'w', 'i', 't', 'h', ' ', 'm',
                                'o', 'r', 'e', ' ', 't', 'h', 'a', 'n', ' ',
                                't', 'h', 'e', ' ', 'd', 'e', 'c', 'l', 'a',
                                'r', 'e', 'd', ' ', 'n', 'u', 'm', 'b', 'e',
                                'r', ' ', 'o', 'f', ' ', 'o', 'u', 't', 'p',
                                'u', 't', 's', ' ', '(', '0', ')', '.' };
static mwArray _mxarray0_ = mclInitializeString(152, _array1_);

static mxChar _array3_[151] = { 'R', 'u', 'n', '-', 't', 'i', 'm', 'e', ' ',
                                'E', 'r', 'r', 'o', 'r', ':', ' ', 'F', 'i',
                                'l', 'e', ':', ' ', 'C', 'a', 'l', 'l', '_',
                                'S', 'a', 'v', 'e', 'L', 'o', 'a', 'd', '_',
                                'F', 'i', 'g', ' ', 'L', 'i', 'n', 'e', ':',
                                ' ', '1', ' ', 'C', 'o', 'l', 'u', 'm', 'n',
                                ':', ' ', '1', ' ', 'T', 'h', 'e', ' ', 'f',
                                'u', 'n', 'c', 't', 'i', 'o', 'n', ' ', '"',
                                'C', 'a', 'l', 'l', '_', 'S', 'a', 'v', 'e',
                                'L', 'o', 'a', 'd', '_', 'F', 'i', 'g', '"',
                                ' ', 'w', 'a', 's', ' ', 'c', 'a', 'l', 'l',
                                'e', 'd', ' ', 'w', 'i', 't', 'h', ' ', 'm',
                                'o', 'r', 'e', ' ', 't', 'h', 'a', 'n', ' ',
                                't', 'h', 'e', ' ', 'd', 'e', 'c', 'l', 'a',
                                'r', 'e', 'd', ' ', 'n', 'u', 'm', 'b', 'e',
                                'r', ' ', 'o', 'f', ' ', 'i', 'n', 'p', 'u',
                                't', 's', ' ', '(', '1', ')', '.' };
static mwArray _mxarray2_ = mclInitializeString(151, _array3_);

static mxChar _array5_[10] = { 'I', 'N', 'I', 'T', 'I',
                               'A', 'L', 'I', 'Z', 'E' };
static mwArray _mxarray4_ = mclInitializeString(10, _array5_);
static mwArray _mxarray6_ = mclInitializeCharVector(0, 0, (mxChar *)NULL);

static mxChar _array8_[9] = { 'C', 'H', 'A', 'N', 'G', 'E', 'D', 'I', 'R' };
static mwArray _mxarray7_ = mclInitializeString(9, _array8_);

void InitializeModule_Call_SaveLoad_Fig() {
}

void TerminateModule_Call_SaveLoad_Fig() {
}

static void MCall_SaveLoad_Fig(mwArray action);

_mexLocalFunctionTable _local_function_table_Call_SaveLoad_Fig
  = { 0, (mexFunctionTableEntry *)NULL };

//
// The function "Call_SaveLoad_Fig" contains the normal interface for the
// "Call_SaveLoad_Fig" M-function from file
// "C:\shu\hier_community_exe\Call_SaveLoad_Fig.m" (lines 1-6). This function
// processes any input arguments and passes them to the implementation version
// of the function, appearing above.
//
void Call_SaveLoad_Fig(mwArray action) {
    MCall_SaveLoad_Fig(action);
}

//
// The function "mlxCall_SaveLoad_Fig" contains the feval interface for the
// "Call_SaveLoad_Fig" M-function from file
// "C:\shu\hier_community_exe\Call_SaveLoad_Fig.m" (lines 1-6). The feval
// function calls the implementation version of Call_SaveLoad_Fig through this
// function. This function processes any input arguments and passes them to the
// implementation version of the function, appearing above.
//
void mlxCall_SaveLoad_Fig(int nlhs,
                          mxArray * plhs[],
                          int nrhs,
                          mxArray * prhs[]) {
    MW_BEGIN_MLX();
    {
        mwArray mprhs[1];
        int i;
        if (nlhs > 0) {
            error(_mxarray0_);
        }
        if (nrhs > 1) {
            error(_mxarray2_);
        }
        for (i = 0; i < 1 && i < nrhs; ++i) {
            mprhs[i] = mwArray(prhs[i], 0);
        }
        for (; i < 1; ++i) {
            mprhs[i].MakeDIN();
        }
        MCall_SaveLoad_Fig(mprhs[0]);
    }
    MW_END_MLX();
}

//
// The function "MCall_SaveLoad_Fig" is the implementation version of the
// "Call_SaveLoad_Fig" M-function from file
// "C:\shu\hier_community_exe\Call_SaveLoad_Fig.m" (lines 1-6). It contains the
// actual compiled code for that M-function. It is a static function and must
// only be called from one of the interface functions, appearing below.
//
//
// function Call_SaveLoad_Fig(action)
//
static void MCall_SaveLoad_Fig(mwArray action) {
    mwLocalFunctionTable save_local_function_table_
      (&_local_function_table_Call_SaveLoad_Fig);
    mwArray ans(mclGetUninitializedArray());
    mwArray currdir(mclGetUninitializedArray());
    //
    // 
    // currdir=cd;
    //
    currdir = Ncd(1, mwArray::DIN);
    //
    // SaveLoad_Fig;
    //
    ans.EqAns(NSaveLoad_Fig(0));
    //
    // SaveLoad(currdir,'INITIALIZE',action);
    //
    SaveLoad(
      mwVarargin(mwVv(currdir, "currdir"), _mxarray4_, mwVa(action, "action")));
    //
    // SaveLoad('','CHANGEDIR');
    //
    SaveLoad(mwVarargin(_mxarray6_, _mxarray7_));
}
