当前位置: 首页>>代码示例>>C++>>正文


C++ CheckRhs函数代码示例

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


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


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