Ejemplo n.º 1
0
/***************************************************
  NAME         : CheckMethodExists
  DESCRIPTION  : Finds the array index of the
                  specified method and prints out
                  error message if not found
  INPUTS       : 1) Calling function
                 2) Generic function address
                 3) Index of method
  RETURNS      : Method array index (-1 if not found)
  SIDE EFFECTS : None
  NOTES        : None
 ***************************************************/
globle int CheckMethodExists(
  char *fname,
  DEFGENERIC *gfunc,
  int mi)
  {
   int fi;

   fi = FindMethodByIndex(gfunc,(unsigned) mi);
   if (fi == -1)
     {
      PrintErrorID("GENRCFUN",2,FALSE);
      PrintRouter(WERROR,"Unable to find method ");
      PrintRouter(WERROR,GetDefgenericName((void *) gfunc));
      PrintRouter(WERROR," #");
      PrintLongInteger(WERROR,(long) mi);
      PrintRouter(WERROR," in function ");
      PrintRouter(WERROR,fname);
      PrintRouter(WERROR,".\n");
      SetEvaluationError(TRUE);
     }
   return(fi);
  }
Ejemplo n.º 2
0
/***************************************************
  NAME         : CheckMethodExists
  DESCRIPTION  : Finds the array index of the
                  specified method and prints out
                  error message if not found
  INPUTS       : 1) Calling function
                 2) Generic function address
                 3) Index of method
  RETURNS      : Method array index (-1 if not found)
  SIDE EFFECTS : None
  NOTES        : None
 ***************************************************/
globle long CheckMethodExists(
  void *theEnv,
  char *fname,
  DEFGENERIC *gfunc,
  long mi)
  {
   long fi;

   fi = FindMethodByIndex(gfunc,mi);
   if (fi == -1)
     {
      PrintErrorID(theEnv,(char*)"GENRCFUN",2,FALSE);
      EnvPrintRouter(theEnv,WERROR,(char*)"Unable to find method ");
      EnvPrintRouter(theEnv,WERROR,EnvGetDefgenericName(theEnv,(void *) gfunc));
      EnvPrintRouter(theEnv,WERROR,(char*)" #");
      PrintLongInteger(theEnv,WERROR,mi);
      EnvPrintRouter(theEnv,WERROR,(char*)" in function ");
      EnvPrintRouter(theEnv,WERROR,fname);
      EnvPrintRouter(theEnv,WERROR,(char*)".\n");
      SetEvaluationError(theEnv,TRUE);
     }
   return(fi);
  }