File: _coder_wind_api.c

    1   /*
    2    * _coder_wind_api.c
    3    *
    4    * Code generation for function '_coder_wind_api'
    5    *
    6    */
    7   
    8   /* Include files */
    9   #include "rt_nonfinite.h"
   10   #include "wind.h"
   11   #include "_coder_wind_api.h"
   12   #include "wind_emxutil.h"
   13   #include "wind_data.h"
   14   
   15   /* Variable Definitions */
   16   static emlrtRTEInfo b_emlrtRTEI = { 1, 1, "_coder_wind_api", "" };
   17   
   18   /* Function Declarations */
   19   static real_T b_emlrt_marshallIn(const emlrtStack *sp, const mxArray *u, const
   20     emlrtMsgIdentifier *parentId);
   21   static const mxArray *b_emlrt_marshallOut(const emxArray_real_T *u);
   22   static real_T c_emlrt_marshallIn(const emlrtStack *sp, const mxArray *src, const
   23     emlrtMsgIdentifier *msgId);
   24   static real_T emlrt_marshallIn(const emlrtStack *sp, const mxArray *tWin, const
   25     char_T *identifier);
   26   static const mxArray *emlrt_marshallOut(const real_T u);
   27   
   28   /* Function Definitions */
   29   static real_T b_emlrt_marshallIn(const emlrtStack *sp, const mxArray *u, const
   30     emlrtMsgIdentifier *parentId)
   31   {
   32     real_T y;
   33     y = c_emlrt_marshallIn(sp, emlrtAlias(u), parentId);
   34     emlrtDestroyArray(&u);
   35     return y;
   36   }
   37   
   38   static const mxArray *b_emlrt_marshallOut(const emxArray_real_T *u)
   39   {
   40     const mxArray *y;
   41     const mxArray *m1;
   42     static const int32_T iv0[2] = { 0, 0 };
   43   
   44     y = NULL;
   45     m1 = emlrtCreateNumericArray(2, iv0, mxDOUBLE_CLASS, mxREAL);
   46     mxSetData((mxArray *)m1, (void *)u->data);
   47     emlrtSetDimensions((mxArray *)m1, u->size, 2);
   48     emlrtAssign(&y, m1);
   49     return y;
   50   }
   51   
   52   static real_T c_emlrt_marshallIn(const emlrtStack *sp, const mxArray *src, const
   53     emlrtMsgIdentifier *msgId)
   54   {
   55     real_T ret;
   56     static const int32_T dims = 0;
   57     emlrtCheckBuiltInR2012b(sp, msgId, src, "double", false, 0U, &dims);
   58     ret = *(real_T *)mxGetData(src);
   59     emlrtDestroyArray(&src);
   60     return ret;
   61   }
   62   
   63   static real_T emlrt_marshallIn(const emlrtStack *sp, const mxArray *tWin, const
   64     char_T *identifier)
   65   {
   66     real_T y;
   67     emlrtMsgIdentifier thisId;
   68     thisId.fIdentifier = identifier;
   69     thisId.fParent = NULL;
   70     thisId.bParentIsCell = false;
   71     y = b_emlrt_marshallIn(sp, emlrtAlias(tWin), &thisId);
   72     emlrtDestroyArray(&tWin);
   73     return y;
   74   }
   75   
   76   static const mxArray *emlrt_marshallOut(const real_T u)
   77   {
   78     const mxArray *y;
   79     const mxArray *m0;
   80     y = NULL;
   81     m0 = emlrtCreateDoubleScalar(u);
   82     emlrtAssign(&y, m0);
   83     return y;
   84   }
   85   
   86   void wind_api(const mxArray * const prhs[3], const mxArray *plhs[3])
   87   {
   88     emxArray_real_T *inx;
   89     real_T tWin;
   90     real_T fs;
   91     real_T nmic;
   92     real_T nWin;
   93     real_T nInc;
   94     emlrtStack st = { NULL, NULL, NULL };
   95   
   96     st.tls = emlrtRootTLSGlobal;
   97     emlrtHeapReferenceStackEnterFcnR2012b(&st);
   98     emxInit_real_T(&st, &inx, 2, &b_emlrtRTEI, true);
   99   
  100     /* Marshall function inputs */
  101     tWin = emlrt_marshallIn(&st, emlrtAliasP(prhs[0]), "tWin");
  102     fs = emlrt_marshallIn(&st, emlrtAliasP(prhs[1]), "fs");
  103     nmic = emlrt_marshallIn(&st, emlrtAliasP(prhs[2]), "nmic");
  104   
  105     /* Invoke the target function */
  106     wind(&st, tWin, fs, nmic, &nWin, &nInc, inx);
  107   
  108     /* Marshall function outputs */
  109     plhs[0] = emlrt_marshallOut(nWin);
  110     plhs[1] = emlrt_marshallOut(nInc);
  111     plhs[2] = b_emlrt_marshallOut(inx);
  112     inx->canFreeData = false;
  113     emxFree_real_T(&inx);
  114     emlrtHeapReferenceStackLeaveFcnR2012b(&st);
  115   }
  116   
  117   /* End of code generation (_coder_wind_api.c) */
  118