예제 #1
0
globle void ClearCommand(
  void *theEnv)
  {
   if (EnvArgCountCheck(theEnv,"clear",EXACTLY,0) == -1) return;
   EnvClear(theEnv);
   return;
  }
예제 #2
0
nsresult
nsPrintJobVMSCmdPS::FinishSubmission()
{
    NS_PRECONDITION(GetDestHandle(), "No destination file handle");
    NS_PRECONDITION(!GetDestination().IsEmpty(), "No destination");

    /* Close the temporary file handle */
    fclose(GetDestHandle());
    SetDestHandle(nsnull);

    /* construct the print command */
    nsCAutoString printFileName;
    nsresult rv = mTempFile->GetNativePath(printFileName);
    if (NS_SUCCEEDED(rv)) {
        nsCAutoString cmd(GetDestination());
        cmd += " "; cmd += printFileName; cmd += ".";

        /* Set up the environment. */
        if (PR_SUCCESS != EnvLock())
            return NS_ERROR_OUT_OF_MEMORY;
        if (!mPrinterName.IsEmpty())
            EnvSetPrinter(mPrinterName);

        /* Run the print command */
        int presult = system(cmd.get());

        /* Clean up */
        EnvClear();
        mTempFile->Remove(PR_FALSE);

        rv = (!WIFEXITED(presult) || (EXIT_SUCCESS != WEXITSTATUS(presult)))
            ? NS_ERROR_GFX_PRINTER_CMD_FAILURE : NS_OK;
    }
    return rv;
}
예제 #3
0
void ClearCommand(
  UDFContext *context,
  CLIPSValue *returnValue)
  {
   EnvClear(UDFContextEnvironment(context));
   return;
  }
예제 #4
0
파일: constrct.c 프로젝트: atrniv/CLIPS
globle void ClearCommand(
  void *theEnv,
  EXEC_STATUS)
  {
   if (EnvArgCountCheck(theEnv,execStatus,"clear",EXACTLY,0) == -1) return;
   EnvClear(theEnv,execStatus);
   return;
  }
예제 #5
0
/**
 * Launch the print command using popen(), then copy the print job data
 * to the pipe. See nsIPrintJobPS.h and nsPrintJobPS.h for details.
 */
nsresult
nsPrintJobPipePS::StartSubmission(FILE **aHandle)
{
    NS_PRECONDITION(aHandle, "aHandle is NULL");
    NS_PRECONDITION(!GetDestination().IsEmpty(), "No destination");
    NS_PRECONDITION(!GetDestHandle(), "Already have a destination handle");

    if (PR_SUCCESS != EnvLock())
        return NS_ERROR_OUT_OF_MEMORY;  // Couldn't allocate the object?
    if (!mPrinterName.IsEmpty())
        EnvSetPrinter(mPrinterName);

    FILE *destPipe = popen(GetDestination().get(), "w");
    EnvClear();
    if (!destPipe)
        return NS_ERROR_GFX_PRINTER_CMD_FAILURE;
    SetDestHandle(destPipe);
    *aHandle = destPipe;
    return NS_OK;
}
예제 #6
0
globle void Clear()
  {
   EnvClear(GetCurrentEnvironment());
  }  
예제 #7
0
파일: envrnmnt.c 프로젝트: noxdafox/clips
static void EnvInitializeEnvironment(
  void *vtheEnvironment,
  struct symbolHashNode **symbolTable,
  struct floatHashNode **floatTable,
  struct integerHashNode **integerTable,
  struct bitMapHashNode **bitmapTable,
  struct externalAddressHashNode **externalAddressTable)
  {
   struct environmentData *theEnvironment = (struct environmentData *) vtheEnvironment;
   
   /*================================================*/
   /* Don't allow the initialization to occur twice. */
   /*================================================*/

   if (theEnvironment->initialized) return;
     
   /*================================*/
   /* Initialize the memory manager. */
   /*================================*/

   InitializeMemory(theEnvironment);

   /*===================================================*/
   /* Initialize environment data for various features. */
   /*===================================================*/
   
   InitializeCommandLineData(theEnvironment);
#if CONSTRUCT_COMPILER && (! RUN_TIME)
   InitializeConstructCompilerData(theEnvironment);
#endif
   InitializeConstructData(theEnvironment);
   InitializeEvaluationData(theEnvironment);
   InitializeExternalFunctionData(theEnvironment);
   InitializePrettyPrintData(theEnvironment);
   InitializePrintUtilityData(theEnvironment);
   InitializeScannerData(theEnvironment);
   InitializeSystemDependentData(theEnvironment);
   InitializeUserDataData(theEnvironment);
   InitializeUtilityData(theEnvironment);
#if DEBUGGING_FUNCTIONS
   InitializeWatchData(theEnvironment);
#endif
   
   /*===============================================*/
   /* Initialize the hash tables for atomic values. */
   /*===============================================*/

   InitializeAtomTables(theEnvironment,symbolTable,floatTable,integerTable,bitmapTable,externalAddressTable);

   /*=========================================*/
   /* Initialize file and string I/O routers. */
   /*=========================================*/

   InitializeDefaultRouters(theEnvironment);

   /*=========================================================*/
   /* Initialize some system dependent features such as time. */
   /*=========================================================*/

   InitializeNonportableFeatures(theEnvironment);

   /*=============================================*/
   /* Register system and user defined functions. */
   /*=============================================*/

   SystemFunctionDefinitions(theEnvironment);
   UserFunctions();
   EnvUserFunctions(theEnvironment);

   /*====================================*/
   /* Initialize the constraint manager. */
   /*====================================*/

   InitializeConstraints(theEnvironment);

   /*==========================================*/
   /* Initialize the expression hash table and */
   /* pointers to specific functions.          */
   /*==========================================*/

   InitExpressionData(theEnvironment);

   /*===================================*/
   /* Initialize the construct manager. */
   /*===================================*/

#if ! RUN_TIME
   InitializeConstructs(theEnvironment);
#endif

   /*=====================================*/
   /* Initialize the defmodule construct. */
   /*=====================================*/

   AllocateDefmoduleGlobals(theEnvironment);

   /*===================================*/
   /* Initialize the defrule construct. */
   /*===================================*/

#if DEFRULE_CONSTRUCT
   InitializeDefrules(theEnvironment);
#endif

   /*====================================*/
   /* Initialize the deffacts construct. */
   /*====================================*/

#if DEFFACTS_CONSTRUCT
   InitializeDeffacts(theEnvironment);
#endif

   /*=====================================================*/
   /* Initialize the defgeneric and defmethod constructs. */
   /*=====================================================*/

#if DEFGENERIC_CONSTRUCT
   SetupGenericFunctions(theEnvironment);
#endif

   /*=======================================*/
   /* Initialize the deffunction construct. */
   /*=======================================*/

#if DEFFUNCTION_CONSTRUCT
   SetupDeffunctions(theEnvironment);
#endif

   /*=====================================*/
   /* Initialize the defglobal construct. */
   /*=====================================*/

#if DEFGLOBAL_CONSTRUCT
   InitializeDefglobals(theEnvironment);
#endif

   /*=======================================*/
   /* Initialize the deftemplate construct. */
   /*=======================================*/

#if DEFTEMPLATE_CONSTRUCT
   InitializeDeftemplates(theEnvironment);
#endif

   /*=============================*/
   /* Initialize COOL constructs. */
   /*=============================*/

#if OBJECT_SYSTEM
   SetupObjectSystem(theEnvironment);
#endif

   /*=====================================*/
   /* Initialize the defmodule construct. */
   /*=====================================*/

   InitializeDefmodules(theEnvironment);

   /*======================================================*/
   /* Register commands and functions for development use. */
   /*======================================================*/

#if DEVELOPER
   DeveloperCommands(theEnvironment);
#endif

   /*=========================================*/
   /* Install the special function primitives */
   /* used by procedural code in constructs.  */
   /*=========================================*/

   InstallProcedurePrimitives(theEnvironment);

   /*==============================================*/
   /* Install keywords in the symbol table so that */
   /* they are available for command completion.   */
   /*==============================================*/

   InitializeKeywords(theEnvironment);

   /*========================*/
   /* Issue a clear command. */
   /*========================*/
   
   EnvClear(theEnvironment);

   /*=============================*/
   /* Initialization is complete. */
   /*=============================*/

   theEnvironment->initialized = TRUE;
  }
예제 #8
0
파일: CLIPSDLL32.c 프로젝트: atrniv/CLIPS
void __declspec(dllexport) CALL_CONV __EnvClear(
  void *theEnv)
  {
   EnvClear(theEnv);
  }
예제 #9
0
파일: constrct.c 프로젝트: atrniv/CLIPS
globle void Clear(EXEC_STATUS)
  {
   EnvClear(GetCurrentEnvironment(),execStatus);
  }