• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ CheckRhs函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中CheckRhs函数的典型用法代码示例。如果您正苦于以下问题:C++ CheckRhs函数的具体用法?C++ CheckRhs怎么用?C++ CheckRhs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了CheckRhs函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: sci_getsystemmetrics

/*--------------------------------------------------------------------------*/
int sci_getsystemmetrics(char *fname, unsigned long l)
{
    char *param = NULL;
    int nIndex = -1;
    int m1 = 0;
    int n1 = 0;
    int l1 = 0;

    CheckRhs(1, 1);

    if (GetType(1) != sci_strings)
    {
        Scierror(999, _("%s: Wrong type for input argument #%d: String expected.\n"), fname, 1);
        return 0;
    }

    GetRhsVar(1, STRING_DATATYPE, &m1, &n1, &l1);
    param = cstk(l1);

    nIndex = getnIndexFromString(param);
    if ( nIndex > -1 )
    {
        int one = 1;
        CreateVar(Rhs + 1, MATRIX_OF_INTEGER_DATATYPE, &one, &one, &l1);
        *istk(l1) = GetSystemMetrics(nIndex);
        LhsVar(1) = Rhs + 1;

        PutLhsVar();
    }
    else
    {
        Scierror(999, _("%s: Wrong value for input argument: %s.\n"), fname, _("see help"));
    }
    return 0;
}
开发者ID:ASP1234,项目名称:Scilabv5.5.2,代码行数:36,代码来源:sci_getsystemmetrics.c


示例2: sci_librarieslist

/*--------------------------------------------------------------------------*/
int sci_librarieslist(char *fname, unsigned long fname_len)
{
    char **libraries = NULL;
    int sizelibraries = 0;

    CheckRhs(0, 0);
    CheckLhs(0, 1);

    libraries = getlibrarieslist(&sizelibraries);

    if (libraries)
    {
        int m = 0, n = 0;
        m = sizelibraries;
        n = 1;
        CreateVarFromPtr(Rhs + 1, MATRIX_OF_STRING_DATATYPE, &m, &n, libraries);
    }
    else
    {
        int m = 0, n = 0, l = 0;
        CreateVarFromPtr(Rhs + 1, MATRIX_OF_DOUBLE_DATATYPE, &n, &m, &l);
    }

    LhsVar(1) = Rhs + 1;

    freeArrayOfString(libraries, sizelibraries);

    PutLhsVar();
    return 0;
}
开发者ID:ZhanlinWang,项目名称:scilab,代码行数:31,代码来源:sci_librarieslist.c


示例3: sci_loadXcos

/*
 * Stub function to load the gateway
 */
int sci_loadXcos(char *fname, unsigned long fname_len)
{
    CheckRhs(0, 1);
    LhsVar(1) = 0;
    PutLhsVar();
    return 0;
}
开发者ID:rossdrummond,项目名称:scilab,代码行数:10,代码来源:sci_loadXcos.cpp


示例4: sci_iswaitingforinput

/*--------------------------------------------------------------------------*/
int sci_iswaitingforinput(char *fname, unsigned long fname_len)
{
    BOOL res = FALSE;
    int un = 1, outIndex = 0;

    Rhs = Max(Rhs, 0);
    CheckRhs(0, 1);
    CheckLhs(0, 1);

    if (getScilabMode() == SCILAB_STD)
    {
        res = ConsoleIsWaitingForInput();
    }
    else
    {
        sciprint(_("%s: Not implemented in this mode.\n"), fname);
    }

    CreateVar(Rhs + 1, MATRIX_OF_BOOLEAN_DATATYPE, &un, &un, &outIndex);
    *istk(outIndex) = res;

    LhsVar(1) = Rhs + 1;
    PutLhsVar();
    return 0;
}
开发者ID:ZhanlinWang,项目名称:scilab,代码行数:26,代码来源:sci_iswaitingforinput.c


示例5: int_imread

int int_imread(char * fname)
{
  int mR, nR, lR;

  IplImage * pImage;

  CheckRhs(1, 1);
  CheckLhs(1, 1);

  GetRhsVar(1, "c", &mR, &nR, &lR);

  // fix default mode for compatibility with previous version of SIVP
  pImage = cvLoadImage(cstk(lR), 1);

  /* if load image failed */
  if(pImage == NULL)
    {
      Scierror(999, "%s: Can not open file %s.\r\n", fname, cstk(lR));
      return -1;
    }

  IplImg2Mat(pImage, 2);

  LhsVar(1) = 2;

  cvReleaseImage(&pImage);

  return 0;
}
开发者ID:acbalingit,项目名称:scilab-sivp,代码行数:29,代码来源:imread.cpp


示例6: sci_fromjava

/*--------------------------------------------------------------------------*/
int sci_fromjava(char *fname, unsigned long fname_len)
{
    static int n1;
    int *paramoutINT = (int*)MALLOC(sizeof(int) + 1);

    Rhs = Max(0, Rhs);
    CheckRhs(0, 0);
    CheckLhs(1, 1);

    if ( IsFromJava() )
    {
        *paramoutINT = (int)(TRUE);
    }
    else
    {
        *paramoutINT = (int)(FALSE);
    }

    n1 = 1;
    CreateVarFromPtr(Rhs + 1, MATRIX_OF_BOOLEAN_DATATYPE, &n1, &n1, &paramoutINT);
    if (paramoutINT)
    {
        FREE(paramoutINT);
        paramoutINT = NULL;
    }
    LhsVar(1) = Rhs + 1;
    PutLhsVar();

    return 0;
}
开发者ID:ZhanlinWang,项目名称:scilab,代码行数:31,代码来源:sci_fromjava.c


示例7: sci_bug_11046

int sci_bug_11046(char *fname)
{
    CheckRhs(0, 0);
    sciprint("Overload call macro\n"); // %_myscifun
    OverLoad(0);
    return 0;
}
开发者ID:ASP1234,项目名称:Scilabv5.5.2,代码行数:7,代码来源:bug_11046.c


示例8: sip_get_verbose_int

SipExport int
sip_get_verbose_int(char *fname)
{
   int rout,cout,
       minlhs=1, maxlhs=1, minrhs=0, maxrhs=0;

   char *pout;

   CheckRhs(minrhs,maxrhs);
   CheckLhs(minlhs,maxlhs);

   switch (sip_verbose) {
      case SIP_WORDY:
         pout = "wordy";
         break;
      case SIP_QUIET:
         pout = "quiet";
         break;
      default:
         sip_error("BUG: internal variable has invalid value (please report)");
         break;
   }

   cout = 1;
   rout = strlen(pout);
   CreateVarFromPtr(1, "c", &rout, &cout, &pout);

   LhsVar(1)=1;
   
   return true;
}
开发者ID:madhavan902,项目名称:siptoolbox,代码行数:31,代码来源:misc_int.c


示例9: sci_gethistoryfile

/*--------------------------------------------------------------------------*/
int sci_gethistoryfile(char *fname, unsigned long fname_len)
{
    char *filename = NULL;
    int m1 = 0, n1 = 0;

    CheckRhs(0, 0) ;
    CheckLhs(0, 1) ;

    filename = getFilenameScilabHistory();

    if (filename)
    {
        n1 = 1;
        m1 = (int)strlen(filename);
        CreateVarFromPtr(Rhs + 1, STRING_DATATYPE, &m1, &n1, &filename);
        if (filename)
        {
            FREE(filename);
            filename = NULL;
        }
        LhsVar(1) = Rhs + 1;
        PutLhsVar();
    }
    else
    {
        Scierror(999, _("%s: An error occurred: %s\n"), fname, _("filename not defined."));
    }
    return 0;
}
开发者ID:ASP1234,项目名称:Scilabv5.5.2,代码行数:30,代码来源:sci_gethistoryfile.c


示例10: interface_gravite

int interface_gravite(char *fname)
{
  static int un = 1, nddl = N_DOF;
  static int n, nbis;
  static int q, G;

  /*    Define minls=1, maxlhs, minrhs, maxrhs   */
  static int minlhs = 1, minrhs = 1, maxlhs = 1, maxrhs = 1;

  /*   Check rhs and lhs   */
  CheckRhs(minrhs, maxrhs) ;
  CheckLhs(minlhs, maxlhs) ;

  GetRhsVar(1, "d", &n, &nbis, &q);
  if (n * nbis != N_DOF)
  {
    sciprint("Wrong size!\r\n");
    Error(999);
    return 0;
  }

  CreateVar(2, "d", &nddl, &un, &G);

  modele_gravite(stk(q), stk(G));

  LhsVar(1) = 2;
  return 0;
}
开发者ID:radarsat1,项目名称:siconos,代码行数:28,代码来源:interfaces.c


示例11: TagsInterface

int TagsInterface(char *fname)
{
  static int one = 1, ndof = NDOF;
  static int n, nbis;
  static int q, N;

  /*    Define minls=1, maxlhs, minrhs, maxrhs   */
  static int minlhs = 1, minrhs = 2, maxlhs = 1, maxrhs = 2;

  /*   Check rhs and lhs   */
  CheckRhs(minrhs, maxrhs) ;
  CheckLhs(minlhs, maxlhs) ;

  GetRhsVar(1, "d", &n, &nbis, &q);
  if (n * nbis != NDOF)
  {
    sciprint("Wrong size!\r\n");
    Error(999);
    return 0;
  }


  CreateVar(2, "d", &ndof, &one, &N);

  Tags(stk(N), stk(q));

  LhsVar(1) = 2;

  return 0;
}
开发者ID:radarsat1,项目名称:siconos,代码行数:30,代码来源:ScilabInterface.c


示例12: sci_timer

/*--------------------------------------------------------------------------*/
int sci_timer(char *fname,unsigned long fname_len)
{
	double timerval = 0;

	Rhs = Max(0, Rhs);
	CheckLhs(0,1);
	CheckRhs(0,0);

	timerval = scilab_timer();

	if (timerval >= 0.)
	{
		int l1 = 0, n1 = 1;

		CreateVar(Rhs+1,MATRIX_OF_DOUBLE_DATATYPE, &n1, &n1,&l1);
		*stk(l1) = (double)timerval;

		LhsVar(1) = Rhs+1;
		PutLhsVar();
	}
	else
	{
		Scierror(999,_("%s: An error occurred.\n"), fname);
	}

	return 0;
}
开发者ID:rossdrummond,项目名称:scilab,代码行数:28,代码来源:sci_timer.c


示例13: C2F

/*--------------------------------------------------------------------------*/ 
int C2F(sci_getlanguagealias)(char *fname,unsigned long fname_len)
{
	static int l1,n1,m1;
	char *Output=NULL;

	CheckRhs(0,0);
	CheckLhs(0,1);

	Output=getlanguagealias();

	if (Output)
	{
		n1=1;
		CreateVarFromPtr( Rhs+1,STRING_DATATYPE,(m1=(int)strlen(Output), &m1),&n1,&Output);
		LhsVar(1) = Rhs+1;
		PutLhsVar();;	
		if (Output) {FREE(Output);Output=NULL;}
	}
	else
	{
		m1=0;
		n1=0;
		l1=0;
		CreateVar(Rhs+1,MATRIX_OF_DOUBLE_DATATYPE,  &m1, &n1, &l1);
		LhsVar(1)=Rhs+1;
		PutLhsVar();;
		return 0;
	}

	
	return 0;
}
开发者ID:rossdrummond,项目名称:scilab,代码行数:33,代码来源:sci_getlanguagealias.c


示例14: sci_deletefile

/*--------------------------------------------------------------------------*/
int sci_deletefile(char *fname,unsigned long fname_len)
{
	CheckRhs(1,1);
	CheckLhs(1,1);

	if (GetType(1) == sci_strings)
	{
		int m1,n1,l1;
		char *VarName=NULL;

		GetRhsVar(1,STRING_DATATYPE,&m1,&n1,&l1);
		/* Bug 3089 */
		VarName = cstk(l1);

		n1=1;
		if ( deleteafile(VarName) )
		{
			CreateVar(Rhs+1,MATRIX_OF_BOOLEAN_DATATYPE, &n1,&n1,&l1);
			*istk(l1)=(int)(TRUE);
		}
		else
		{
			CreateVar(Rhs+1,MATRIX_OF_BOOLEAN_DATATYPE, &n1,&n1,&l1);
			*istk(l1)=(int)(FALSE);
		}

		LhsVar(1)=Rhs+1;
		PutLhsVar();
	}
	else
	{
		Scierror(999,_("%s: Wrong type for input argument: A string expected.\n"),fname);
	}
	return 0;
}
开发者ID:rossdrummond,项目名称:scilab,代码行数:36,代码来源:sci_deletefile.c


示例15: sci_ctree2

/*--------------------------------------------------------------------------*/
int sci_ctree2(char *fname, unsigned long fname_len)
{
    int one = 1, ipvec = 0, nvec = 0, mvec = 0, noin = 0, moin = 0, ipoin = 0, noinr = 0, moinr = 0, ipoinr = 0;
    int ndep = 0, mdep = 0, ipdep = 0, ndepuptr = 0, mdepuptr = 0, ipdepuptr = 0, ipord = 0, ipok = 0, n = 0, nord = 0;

    CheckRhs(5, 5);
    CheckLhs(2, 2);

    GetRhsVar(1, MATRIX_OF_INTEGER_DATATYPE, &nvec, &mvec, &ipvec);
    GetRhsVar(2, MATRIX_OF_INTEGER_DATATYPE, &noin, &moin, &ipoin);
    GetRhsVar(3, MATRIX_OF_INTEGER_DATATYPE, &noinr, &moinr, &ipoinr);
    GetRhsVar(4, MATRIX_OF_INTEGER_DATATYPE, &ndep, &mdep, &ipdep);
    GetRhsVar(5, MATRIX_OF_INTEGER_DATATYPE, &ndepuptr, &mdepuptr, &ipdepuptr);
    n = nvec * mvec;
    CreateVar(6, MATRIX_OF_INTEGER_DATATYPE, &n, &one, &ipord);
    CreateVar(7, MATRIX_OF_INTEGER_DATATYPE, &one, &one, &ipok);

    ctree2(istk(ipvec), n, istk(ipdep), istk(ipdepuptr), istk(ipoin), istk(ipoinr), istk(ipord), &nord, istk(ipok));

    *istk(iadr(C2F(intersci).iwhere[5]) + 1) = nord;

    LhsVar(1) = 6;
    LhsVar(2) = 7;

    PutLhsVar();

    return 0;
}
开发者ID:ASP1234,项目名称:Scilabv5.5.2,代码行数:29,代码来源:sci_ctree2.c


示例16: InertiaInterface

int InertiaInterface(char *fname)
{
    static int ndof = NDOF;
    static int n, nbis;
    static int q, M;

    /*    Define minls=1, maxlhs, minrhs, maxrhs   */
    static int minlhs = 1, minrhs = 1, maxlhs = 1, maxrhs = 1;

    /*   Check rhs and lhs   */
    CheckRhs(minrhs, maxrhs) ;
    CheckLhs(minlhs, maxlhs) ;

    GetRhsVar(1, "d", &n, &nbis, &q);
    if (n * nbis != NDOF)
    {
        sciprint("Wrong size!\r\n");
        Error(999);
        return 0;
    }

    CreateVar(2, "d", &ndof, &ndof, &M);

    Inertia(stk(M), stk(q));

    LhsVar(1) = 2;
    return 0;
}
开发者ID:radarsat1,项目名称:siconos,代码行数:28,代码来源:ScilabInterface.c


示例17: cdf_generic

int cdf_generic(char *fname, void* pvApiCtx, struct cdf_descriptor *cdf)
{
    int iErr = 0;
    struct cdf_item const * it;
    char *option;

    CheckRhs(cdf->minrhs, cdf->maxrhs);
    CheckLhs(cdf->minlhs, cdf->maxlhs);
    option = create_string(pvApiCtx, 1);
    for (it = cdf->items; it != cdf->end_item; ++it)
    {
        if (strcmp(option, it->option) == 0)
        {
            /* "which" argument (5th) inferred from position in item list */
            iErr = CdfBase(fname, pvApiCtx, it->inarg, it->oarg, it->shift, it - cdf->items + 1, cdf->fun);
            break;
        }
    }

    destroy_string(option);
    if (it == cdf->end_item)
    {
        /* no target found */
        char *optlist;
        optlist = cdf_options(cdf);
        Scierror(999, _("%s: Wrong value for input argument #%d: Must be in the set {%s}.\n"), fname, 1, optlist);
        FREE(optlist);
        return 1;
    }

    return iErr;
}
开发者ID:leowzukw,项目名称:scilab-mirror,代码行数:32,代码来源:CdfBase.c


示例18: sci_type

/*--------------------------------------------------------------------------*/
int sci_type(char *fname, void* pvApiCtx)
{
    SciErr sciErr;
    int* piAddr	= NULL;
    int iType		= 0;
    int iRet = 0;

    CheckRhs(1, 1);
    CheckLhs(1, 1);

    sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
    if (sciErr.iErr)
    {
        printError(&sciErr, 0);
        return 0;
    }

    sciErr = getVarType(pvApiCtx, piAddr, &iType);
    if (sciErr.iErr)
    {
        printError(&sciErr, 0);
        return 0;
    }

    iRet = createMatrixOfDoubleFromInteger(pvApiCtx, Rhs + 1, 1, 1, &iType);
    if (iRet)
    {
        return 0;
    }

    LhsVar(1) = Rhs + 1;
    PutLhsVar();
    return 0;
}
开发者ID:scitao,项目名称:scilab,代码行数:35,代码来源:sci_type.c


示例19: sci_exec_if

int sci_exec_if(char *fname)
{
    static int l1, m1, n1;
    void *p_sci;
    static int l2, m2, n2;
    static int minrhs=2, maxrhs=2;
    static int err;

    debug_3 ("[sci_exec_if] ..................... \r\n");
    CheckRhs(minrhs,maxrhs);
    // example: pfir1
    m1=1;
    n1=1;
    GetRhsVar(1,"p",&m1,&n1,&l1);
    // example: SCI_RESET
    GetRhsVar(2, "i", &m2, &n2, &l2);
    p_sci = (void *) ((unsigned long int) *stk(l1));
    sci_exec_ifcpp(p_sci, *(istk(l2)));
    if (sci_err) {
        sciprint("\n%s:\n info:%d\n",sci_err_msg,sci_info);
        Scierror(999,"%s failed err=%d", fname, sci_err);
        return 0;
    }
    debug_3 ("[sci_exec_if] +++++++++++++++++++++ \r\n");
    return 0;
}
开发者ID:maki63,项目名称:c_sci,代码行数:26,代码来源:c_sci_if.c


示例20: sci_loadfftwlibrary

/*--------------------------------------------------------------------------*/ 
int sci_loadfftwlibrary(char *fname,unsigned long fname_len)
{
	static int l1,n1,m1;
	char *FFTWLibname=NULL;

	CheckRhs(1,1);

	if (GetType(1) == sci_strings)
	{
		GetRhsVar(1,STRING_DATATYPE,&m1,&n1,&l1);
		FFTWLibname=cstk(l1);
		setfftwlibname(FFTWLibname);

		n1=1;
		if ( LoadFFTWLibrary(FFTWLibname) )
		{
			CreateVar(Rhs+1,MATRIX_OF_BOOLEAN_DATATYPE, &n1,&n1,&l1);
			*istk(l1)=(int)(TRUE);
		}
		else
		{
			CreateVar(Rhs+1,MATRIX_OF_BOOLEAN_DATATYPE, &n1,&n1,&l1);
			*istk(l1)=(int)(FALSE);
		}

		LhsVar(1)=Rhs+1;
		PutLhsVar();
	}
	else
	{
		 Scierror(999,_("%s: Wrong type for input argument #%d: A string expected.\n"),fname,1);
	}
	return(0);
}
开发者ID:vinayrajchoudhary,项目名称:scilab,代码行数:35,代码来源:sci_loadfftwlibrary.c



注:本文中的CheckRhs函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ CheckShutdown函数代码示例发布时间:2022-05-30
下一篇:
C++ CheckResult函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap