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


C++ EnvGetCurrentModule函数代码示例

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


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

示例1: RefreshAgendaCommand

globle void RefreshAgendaCommand(
    void *theEnv)
{
    int numArgs, error;
    struct defmodule *theModule;

    /*==============================================*/
    /* This function can have at most one argument. */
    /*==============================================*/

    if ((numArgs = EnvArgCountCheck(theEnv,(char*)"refresh-agenda",NO_MORE_THAN,1)) == -1) return;

    /*===============================================================*/
    /* If a module name is specified, then the agenda of that module */
    /* is refreshed. Otherwise, the agenda of the current module is  */
    /* refreshed.                                                    */
    /*===============================================================*/

    if (numArgs == 1)
    {
        theModule = GetModuleName(theEnv,(char*)"refresh-agenda",1,&error);
        if (error) return;
    }
    else
    {
        theModule = ((struct defmodule *) EnvGetCurrentModule(theEnv));
    }

    /*===============================================*/
    /* Refresh the agenda of the appropriate module. */
    /*===============================================*/

    EnvRefreshAgenda(theEnv,theModule);
}
开发者ID:DrItanium,项目名称:AdventureEngine,代码行数:34,代码来源:agenda.c

示例2: class

/*******************************************************************
  NAME         : EnvFindDefclass
  DESCRIPTION  : Looks up a specified class in the class hash table
                 (Only looks in current or specified module)
  INPUTS       : The name-string of the class (including module)
  RETURNS      : The address of the found class, NULL otherwise
  SIDE EFFECTS : None
  NOTES        : None
 ******************************************************************/
globle void *EnvFindDefclass( // TBD Needs to look in imported
  void *theEnv,
  const char *classAndModuleName)
  {
   SYMBOL_HN *classSymbol = NULL;
   DEFCLASS *cls;
   struct defmodule *theModule = NULL;
   const char *className;

   SaveCurrentModule(theEnv);
   className = ExtractModuleAndConstructName(theEnv,classAndModuleName);
   if (className != NULL)
     {
      classSymbol = FindSymbolHN(theEnv,ExtractModuleAndConstructName(theEnv,classAndModuleName));
      theModule = ((struct defmodule *) EnvGetCurrentModule(theEnv));
     }
   RestoreCurrentModule(theEnv);

   if (classSymbol == NULL)
     return(NULL);
   cls = DefclassData(theEnv)->ClassTable[HashClass(classSymbol)];
   while (cls != NULL)
     {
      if (cls->header.name == classSymbol)
        {
         if (cls->system || (cls->header.whichModule->theModule == theModule))
           return(cls->installed ? (void *) cls : NULL);
        }
      cls = cls->nxtHash;
     }
   return(NULL);
  }
开发者ID:Khenji55,项目名称:Computacion_UCLM,代码行数:41,代码来源:classcom.c

示例3: anywhere

/***************************************************
  NAME         : LookupDefclassByMdlOrScope
  DESCRIPTION  : Finds a class anywhere (if module
                 is specified) or in current or
                 imported modules
  INPUTS       : The class name
  RETURNS      : The class (NULL if not found)
  SIDE EFFECTS : Error message printed on
                  ambiguous references
  NOTES        : Assumes no two classes of the same
                 name are ever in the same scope
 ***************************************************/
globle DEFCLASS *LookupDefclassByMdlOrScope(
  void *theEnv,
  const char *classAndModuleName)
  {
   DEFCLASS *cls;
   const char *className;
   SYMBOL_HN *classSymbol;
   struct defmodule *theModule;

   if (FindModuleSeparator(classAndModuleName) == FALSE)
     return(LookupDefclassInScope(theEnv,classAndModuleName));

   SaveCurrentModule(theEnv);
   className = ExtractModuleAndConstructName(theEnv,classAndModuleName);
   theModule = ((struct defmodule *) EnvGetCurrentModule(theEnv));
   RestoreCurrentModule(theEnv);
   if(className == NULL)
     return(NULL);
   if ((classSymbol = FindSymbolHN(theEnv,className)) == NULL)
     return(NULL);
   cls = DefclassData(theEnv)->ClassTable[HashClass(classSymbol)];
   while (cls != NULL)
     {
      if ((cls->header.name == classSymbol) &&
          (cls->header.whichModule->theModule == theModule))
        return(cls->installed ? cls : NULL);
      cls = cls->nxtHash;
     }
   return(NULL);
  }
开发者ID:Khenji55,项目名称:Computacion_UCLM,代码行数:42,代码来源:classcom.c

示例4: UpdateDefclassesScope

/***************************************************
  NAME         : UpdateDefclassesScope
  DESCRIPTION  : This function updates the scope
                 bitmaps for existing classes when
                 a new module is defined
  INPUTS       : None
  RETURNS      : Nothing
  SIDE EFFECTS : Class scope bitmaps are updated
  NOTES        : None
 ***************************************************/
static void UpdateDefclassesScope(
    void *theEnv)
{
    register unsigned i;
    DEFCLASS *theDefclass;
    int newModuleID,count;
    char *newScopeMap;
    unsigned newScopeMapSize;
    char *className;
    struct defmodule *matchModule;

    newModuleID = (int) ((struct defmodule *) EnvGetCurrentModule(theEnv))->bsaveID;
    newScopeMapSize = (sizeof(char) * ((GetNumberOfDefmodules(theEnv) / BITS_PER_BYTE) + 1));
    newScopeMap = (char *) gm2(theEnv,newScopeMapSize);
    for (i = 0 ; i < CLASS_TABLE_HASH_SIZE ; i++)
        for (theDefclass = DefclassData(theEnv)->ClassTable[i] ;
                theDefclass != NULL ;
                theDefclass = theDefclass->nxtHash)
        {
            matchModule = theDefclass->header.whichModule->theModule;
            className = ValueToString(theDefclass->header.name);
            ClearBitString((void *) newScopeMap,newScopeMapSize);
            GenCopyMemory(char,theDefclass->scopeMap->size,
                          newScopeMap,ValueToBitMap(theDefclass->scopeMap));
            DecrementBitMapCount(theEnv,theDefclass->scopeMap);
            if (theDefclass->system)
                SetBitMap(newScopeMap,newModuleID);
            else if (FindImportedConstruct(theEnv,(char*)"defclass",matchModule,
                                           className,&count,TRUE,NULL) != NULL)
                SetBitMap(newScopeMap,newModuleID);
            theDefclass->scopeMap = (BITMAP_HN *) EnvAddBitMap(theEnv,(void *) newScopeMap,newScopeMapSize);
            IncrementBitMapCount(theDefclass->scopeMap);
        }
    rm(theEnv,(void *) newScopeMap,newScopeMapSize);
}
开发者ID:DrItanium,项目名称:AdventureEngine,代码行数:45,代码来源:classini.c

示例5: ClearDefrulesReady

static int ClearDefrulesReady(
  void *theEnv)
  {
   if (EngineData(theEnv)->ExecutingRule != NULL) return(FALSE);
   
   EnvClearFocusStack(theEnv);
   if (EnvGetCurrentModule(theEnv) == NULL) return(FALSE);

   DefruleData(theEnv)->CurrentEntityTimeTag = 0L;

   return(TRUE);
  }
开发者ID:pandaxcl,项目名称:CLIPS-unicode,代码行数:12,代码来源:rulebsc.c

示例6: PrintChangedAgenda

/*******************************************************************************
          Name:        PrintChangedAgenda
          Description: Update the agenda window
          Arguments:   None
          Returns:      
*******************************************************************************/
int PrintChangedAgenda()
  {
   void *theEnv = GetCurrentEnvironment();
   void *rule_ptr;
   char buffer[MAX_CHAR_IN_BUF];
   char *name, labelBuffer[MAX_CHAR_IN_BUF];
   Window AgendaWin;
   Display *theDisplay;
   struct defmodule* theModule = (struct defmodule *) EnvGetCurrentModule(theEnv);

   /*======================================================*/
   /* Change the name of the window to the current module. */
   /*======================================================*/
   
   AgendaWin = XtWindow(agenda);
   theDisplay = XtDisplay(agenda);
   if (theModule  != NULL)
     {
      name = EnvGetDefmoduleName(theEnv,theModule);
      strcpy(labelBuffer,"Agenda Window(");
      strcat(labelBuffer,name);
      strcat(labelBuffer,")");
     }
    else
     {
      strcpy(labelBuffer,"Agenda Window");
     }
   
   XStoreName(theDisplay,AgendaWin,labelBuffer);
   
   /*============================*/
   /* Wipe out the old contents. */
   /*============================*/

   XtSetArg(TheArgs[0], XtNstring, "");
   XtSetValues(agenda_text, TheArgs, 1);
   XawAsciiSourceFreeString(XawTextGetSource(agenda_text));

   /*============================*/
   /* Print the new agenda list. */
   /*============================*/

   rule_ptr = EnvGetNextActivation(theEnv,NULL);
   while (rule_ptr != NULL)
     {
      EnvGetActivationPPForm(theEnv,buffer,MAX_CHAR_IN_BUF - 1,rule_ptr);
      EnvPrintRouter(theEnv,"xagenda",buffer);
      EnvPrintRouter(theEnv,"xagenda", "\n");
      rule_ptr = EnvGetNextActivation(theEnv,rule_ptr);
     }
    
   return 0;
  }
开发者ID:RenRenJuan,项目名称:DACLIPS,代码行数:59,代码来源:xclips.c

示例7: PrintGenericName

/******************************************************
  NAME         : PrintGenericName
  DESCRIPTION  : Prints the name of a gneric function
                 (including the module name if the
                  generic is not in the current module)
  INPUTS       : 1) The logical name of the output
                 2) The generic functions
  RETURNS      : Nothing useful
  SIDE EFFECTS : Generic name printed
  NOTES        : None
 ******************************************************/
globle void PrintGenericName(
  void *theEnv,
  char *logName,
  DEFGENERIC *gfunc)
  {
   if (gfunc->header.whichModule->theModule != ((struct defmodule *) EnvGetCurrentModule(theEnv)))
     {
      EnvPrintRouter(theEnv,logName,EnvGetDefmoduleName(theEnv,(void *)
                        gfunc->header.whichModule->theModule));
      EnvPrintRouter(theEnv,logName,(char*)"::");
     }
   EnvPrintRouter(theEnv,logName,ValueToString((void *) gfunc->header.name));
  }
开发者ID:DrItanium,项目名称:AdventureEngine,代码行数:24,代码来源:genrcfun.c

示例8: EnvArgCountCheck

globle void *GetCurrentModuleCommand(
  void *theEnv)
  {
   struct defmodule *theModule;

   EnvArgCountCheck(theEnv,"get-current-module",EXACTLY,0);

   theModule = (struct defmodule *) EnvGetCurrentModule(theEnv);

   if (theModule == NULL) return((SYMBOL_HN *) EnvFalseSymbol(theEnv));

   return((SYMBOL_HN *) EnvAddSymbol(theEnv,ValueToString(theModule->name)));
  }
开发者ID:bigsmiles,项目名称:eventCLIPS,代码行数:13,代码来源:moduldef.c

示例9: ClearDefrulesReady

static bool ClearDefrulesReady(
  void *theEnv)
  {
   if (EngineData(theEnv)->ExecutingRule != NULL) return(false);

   if (EngineData(theEnv)->JoinOperationInProgress) return(false);

   EnvClearFocusStack(theEnv);
   if (EnvGetCurrentModule(theEnv) == NULL) return(false);

   DefruleData(theEnv)->CurrentEntityTimeTag = 1L;

   return(true);
  }
开发者ID:guitarpoet,项目名称:php-clips,代码行数:14,代码来源:rulebsc.c

示例10: GetFactListFunction

globle void GetFactListFunction(
  void *theEnv,
  DATA_OBJECT_PTR returnValue)
  {
   struct defmodule *theModule;
   DATA_OBJECT result;
   int numArgs;

   /*===========================================*/
   /* Determine if a module name was specified. */
   /*===========================================*/

   if ((numArgs = EnvArgCountCheck(theEnv,"get-fact-list",NO_MORE_THAN,1)) == -1)
     {
      EnvSetMultifieldErrorValue(theEnv,returnValue);
      return;
     }

   if (numArgs == 1)
     {
      EnvRtnUnknown(theEnv,1,&result);

      if (GetType(result) != SYMBOL)
        {
         EnvSetMultifieldErrorValue(theEnv,returnValue);
         ExpectedTypeError1(theEnv,"get-fact-list",1,"defmodule name");
         return;
        }

      if ((theModule = (struct defmodule *) EnvFindDefmodule(theEnv,DOToString(result))) == NULL)
        {
         if (strcmp("*",DOToString(result)) != 0)
           {
            EnvSetMultifieldErrorValue(theEnv,returnValue);
            ExpectedTypeError1(theEnv,"get-fact-list",1,"defmodule name");
            return;
           }

         theModule = NULL;
        }
     }
   else
     { theModule = ((struct defmodule *) EnvGetCurrentModule(theEnv)); }

   /*=====================*/
   /* Get the constructs. */
   /*=====================*/

   EnvGetFactList(theEnv,returnValue,theModule);
  }
开发者ID:noxdafox,项目名称:clips,代码行数:50,代码来源:factfun.c

示例11: PrintChangedGlobals

/*******************************************************************************
          Name:        PrintChangedGlobals
          Description: Update the global window
          Arguments:   None
          Returns:
*******************************************************************************/
int PrintChangedGlobals()
  {
   void *theEnv = GetCurrentEnvironment();
   void *dgPtr;
   int n;
   char *buffer;
   char *name,labelBuffer[MAX_CHAR_IN_BUF];
   Window GlobalWin;
   Display *theDisplay;
   struct defmodule* theModule = (struct defmodule *) EnvGetCurrentModule(theEnv);


   /* Change the name of the window to the current module */

   GlobalWin = XtWindow(globals);
   theDisplay = XtDisplay(globals);
   if (theModule  != NULL)
     {
      name = EnvGetDefmoduleName(theEnv,theModule);
      strcpy(labelBuffer,"Globals Window(");
      strcat(labelBuffer,name);
      strcat(labelBuffer,")");
     }
    else
     {
      strcpy(labelBuffer,"Globals Window");
     }
    XStoreName(theDisplay,GlobalWin,labelBuffer);

   /* Clear the old contents */

   n = 0;
   XtSetArg(TheArgs[n],XtNstring,"");n++;
   XtSetValues(globals_text,TheArgs,n);
   XawAsciiSourceFreeString(XawTextGetSource(globals_text));

   /* Print the new defglobal list */

   dgPtr = EnvGetNextDefglobal(theEnv,NULL);
   while (dgPtr != NULL)
     {
      buffer = (char *) EnvGetDefglobalPPForm(theEnv,(struct constructHeader *) dgPtr);
      EnvPrintRouter(theEnv,"xglobals",buffer);
      EnvPrintRouter(theEnv,"xglobals","\n");
      dgPtr = EnvGetNextDefglobal(theEnv,dgPtr);
     }
   
   return 0;
  }
开发者ID:RenRenJuan,项目名称:DACLIPS,代码行数:55,代码来源:xclips.c

示例12: UpdateStatusWndTitle

static void UpdateStatusWndTitle(
  HWND hwnd)
  {  
   void *theEnv = GlobalEnv;
   struct statusWindowData *theData;
   struct defmodule *theModule = (struct defmodule *) EnvGetCurrentModule(theEnv);
   char buffer[255];
       
   theData = (struct statusWindowData *) GetWindowLongPtr(hwnd,GWLP_USERDATA);
   
   if (theData == NULL) return; 
   
   sprintf(buffer,"%s (%s)",theData->baseName,EnvGetDefmoduleName(theEnv,theModule));
   SetWindowText(hwnd,buffer);
  }
开发者ID:Viriana,项目名称:SISE,代码行数:15,代码来源:Status.c

示例13: PrintChangedFacts

/*******************************************************************************
          Name:        PrintChangedFacts
          Description: Update the fact window
          Arguments:   None
          Returns:      
*******************************************************************************/
int PrintChangedFacts()
  {
   void *theEnv = GetCurrentEnvironment();
  void *fact_ptr;
  char buffer[MAX_CHAR_IN_BUF];
  char *name,labelBuffer[MAX_CHAR_IN_BUF];
  Window FactWin;
  Display *theDisplay;
  struct defmodule* theModule = (struct defmodule *) EnvGetCurrentModule(theEnv);


 /* Change the name of the window to the current module */

  FactWin = XtWindow(facts);
  theDisplay = XtDisplay(facts);
  if(theModule  != NULL)
     {
       name = EnvGetDefmoduleName(theEnv,theModule);
       strcpy(labelBuffer,"Fact Window(");
       strcat(labelBuffer,name);
       strcat(labelBuffer,")");
     }
    else
     {
       strcpy(labelBuffer,"Fact Window");
     }
  XStoreName(theDisplay,FactWin,labelBuffer);


  /* Clear the old contents */

  XtSetArg(TheArgs[0], XtNstring, "");
  XtSetValues(facts_text, TheArgs, 1);
  XawAsciiSourceFreeString(XawTextGetSource(facts_text));

  /* Print the new fact list */

  fact_ptr = EnvGetNextFact(theEnv,NULL);
  while (fact_ptr != NULL)
    {
    EnvGetFactPPForm(theEnv,buffer,MAX_CHAR_IN_BUF - 1,fact_ptr);
    EnvPrintRouter(theEnv,"xfacts",buffer);
    EnvPrintRouter(theEnv,"xfacts", "\n");
    fact_ptr = EnvGetNextFact(theEnv,fact_ptr);
    }
  return 0;
  }
开发者ID:RenRenJuan,项目名称:DACLIPS,代码行数:53,代码来源:xclips.c

示例14: PrintChangedInstances

/*******************************************************************************
          Name:        PrintChangedInstances
          Description: Update the instances window
          Arguments:   None
          Returns:
*******************************************************************************/
int PrintChangedInstances()
  {
   void *theEnv = GetCurrentEnvironment();
   int n = 0;
   void *instancePtr;
   char buffer[MAX_CHAR_IN_BUF];
   char *name, labelBuffer[MAX_CHAR_IN_BUF];
   Window InstanceWin;
   Display *theDisplay;
   struct defmodule* theModule = (struct defmodule *) EnvGetCurrentModule(theEnv);

   /* Change the name of the window to the current module */

   InstanceWin = XtWindow(instances);
   theDisplay = XtDisplay(instances);
   if (theModule != NULL)
     {
      name = EnvGetDefmoduleName(theEnv,theModule);
      strcpy(labelBuffer,"Instances Window(");
      strcat(labelBuffer,name);
      strcat(labelBuffer,")");
     }
   else
     {
      strcpy(labelBuffer,"Instances Window");
     }
   XStoreName(theDisplay,InstanceWin,labelBuffer);


   /* Clear the old contents */

   XtSetArg(TheArgs[n],XtNstring,"");n++;
   XtSetValues(instances_text,TheArgs,n);
   XawAsciiSourceFreeString(XawTextGetSource(instances_text));
   /* Print the new instance list */
   instancePtr = (void *) EnvGetNextInstance(theEnv,NULL);
   while (instancePtr != NULL)
     {
      EnvGetInstancePPForm(theEnv,buffer,MAX_CHAR_IN_BUF - 1,instancePtr);
      EnvPrintRouter(theEnv,"xinstances",buffer);
      EnvPrintRouter(theEnv,"xinstances","\n");
      instancePtr = (void *) EnvGetNextInstance(theEnv,instancePtr);
     }
  
   return 0;
  }
开发者ID:RenRenJuan,项目名称:DACLIPS,代码行数:52,代码来源:xclips.c

示例15: printed

/******************************************************
  NAME         : PrintClassName
  DESCRIPTION  : Displays a class's name
  INPUTS       : 1) Logical name of output
                 2) The class
                 3) Flag indicating whether to
                    print carriage-return at end
  RETURNS      : Nothing useful
  SIDE EFFECTS : Class name printed (and module name
                 too if class is not in current module)
  NOTES        : None
 ******************************************************/
globle void PrintClassName(
  void *theEnv,
  char *logicalName,
  DEFCLASS *theDefclass,
  intBool linefeedFlag)
  {
   if ((theDefclass->header.whichModule->theModule != ((struct defmodule *) EnvGetCurrentModule(theEnv))) &&
       (theDefclass->system == 0))
     {
      EnvPrintRouter(theEnv,logicalName,
                 EnvGetDefmoduleName(theEnv,theDefclass->header.whichModule->theModule));
      EnvPrintRouter(theEnv,logicalName,"::");
     }
   EnvPrintRouter(theEnv,logicalName,ValueToString(theDefclass->header.name));
   if (linefeedFlag)
     EnvPrintRouter(theEnv,logicalName,"\n");
  }
开发者ID:femto,项目名称:rbclips,代码行数:29,代码来源:classfun.c


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