コード例 #1
0
ファイル: filecom.c プロジェクト: DrItanium/AdventureEngine
globle intBool EnvDribbleOn(
    void *theEnv,
    char *fileName)
{
    /*==============================*/
    /* If a dribble file is already */
    /* open, then close it.         */
    /*==============================*/

    if (FileCommandData(theEnv)->DribbleFP != NULL)
    {
        EnvDribbleOff(theEnv);
    }

    /*========================*/
    /* Open the dribble file. */
    /*========================*/

    FileCommandData(theEnv)->DribbleFP = GenOpen(theEnv,fileName,(char*)"w");
    if (FileCommandData(theEnv)->DribbleFP == NULL)
    {
        OpenErrorMessage(theEnv,(char*)"dribble-on",fileName);
        return(0);
    }

    /*============================*/
    /* Create the dribble router. */
    /*============================*/

    EnvAddRouter(theEnv,(char*)"dribble", 40,
                 FindDribble, PrintDribble,
                 GetcDribble, UngetcDribble,
                 ExitDribble);

    FileCommandData(theEnv)->DribbleCurrentPosition = 0;

    /*================================================*/
    /* Call the dribble status function. This is used */
    /* by some of the machine specific interfaces to  */
    /* do things such as changing the wording of menu */
    /* items from "Turn Dribble On..." to             */
    /* "Turn Dribble Off..."                          */
    /*================================================*/

    if (FileCommandData(theEnv)->DribbleStatusFunction != NULL)
    {
        (*FileCommandData(theEnv)->DribbleStatusFunction)(theEnv,TRUE);
    }

    /*=====================================*/
    /* Return TRUE to indicate the dribble */
    /* file was successfully opened.       */
    /*=====================================*/

    return(TRUE);
}
コード例 #2
0
ファイル: xclips.c プロジェクト: RenRenJuan/DACLIPS
/*******************************************************************************
          Name:        XclipsExit
          Description: exit CLIPS in case of abnormal exit 
          Arguments:   num - unused
          Returns:       
*******************************************************************************/
int XclipsExit(
  void *theEnv,
  int num)
  {
   EnvDribbleOff(theEnv);
   EnvDeleteRouter(theEnv,"wclips");
   XtDestroyApplicationContext(app_con);
   ReleaseLogTable();
   exit(0);
  }
コード例 #3
0
ファイル: filecom.c プロジェクト: ricksladkey/CLIPS
globle int DribbleOffCommand(
  void *theEnv)
  {
   if (EnvArgCountCheck(theEnv,"dribble-off",EXACTLY,0) == -1) return(FALSE);
   return(EnvDribbleOff(theEnv));
  }