00001 /*******************************************************/ 00002 /* "C" Language Integrated Production System */ 00003 /* */ 00004 /* CLIPS Version 6.24 07/01/05 */ 00005 /* */ 00006 /* MAIN MODULE */ 00007 /*******************************************************/ 00008 00009 /*************************************************************/ 00010 /* Purpose: */ 00011 /* */ 00012 /* Principal Programmer(s): */ 00013 /* Gary D. Riley */ 00014 /* */ 00015 /* Contributing Programmer(s): */ 00016 /* */ 00017 /* Revision History: */ 00018 /* */ 00019 /* 6.24: Moved UserFunctions and EnvUserFunctions to */ 00020 /* the new userfunctions.c file. */ 00021 /* */ 00022 /*************************************************************/ 00023 00024 /***************************************************************************/ 00025 /* */ 00026 /* Permission is hereby granted, free of charge, to any person obtaining */ 00027 /* a copy of this software and associated documentation files (the */ 00028 /* "Software"), to deal in the Software without restriction, including */ 00029 /* without limitation the rights to use, copy, modify, merge, publish, */ 00030 /* distribute, and/or sell copies of the Software, and to permit persons */ 00031 /* to whom the Software is furnished to do so. */ 00032 /* */ 00033 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS */ 00034 /* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ 00035 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT */ 00036 /* OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY */ 00037 /* CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES */ 00038 /* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN */ 00039 /* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF */ 00040 /* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ 00041 /* */ 00042 /***************************************************************************/ 00043 00044 #include <stdio.h> 00045 #include "setup.h" 00046 #include "clips.h" 00047 00048 int main(int,char *[]); 00049 void UserFunctions(void); 00050 void EnvUserFunctions(void *); 00051 00052 /****************************************/ 00053 /* main: Starts execution of the expert */ 00054 /* system development environment. */ 00055 /****************************************/ 00056 int main( 00057 int argc, 00058 char *argv[]) 00059 { 00060 void *theEnv; 00061 00062 theEnv = CreateEnvironment(); 00063 RerouteStdin(theEnv,argc,argv); 00064 CommandLoop(theEnv); 00065 00066 /*==================================================================*/ 00067 /* Control does not normally return from the CommandLoop function. */ 00068 /* However if you are embedding CLIPS, have replaced CommandLoop */ 00069 /* with your own embedded calls that will return to this point, and */ 00070 /* are running software that helps detect memory leaks, you need to */ 00071 /* add function calls here to deallocate memory still being used by */ 00072 /* CLIPS. If you have a multi-threaded application, no environments */ 00073 /* can be currently executing. If the ALLOW_ENVIRONMENT_GLOBALS */ 00074 /* flag in setup.h has been set to TRUE (the default value), you */ 00075 /* call the DeallocateEnvironmentData function which will call */ 00076 /* DestroyEnvironment for each existing environment and then */ 00077 /* deallocate the remaining data used to keep track of allocated */ 00078 /* environments. Otherwise, you must explicitly call */ 00079 /* DestroyEnvironment for each environment you create. */ 00080 /*==================================================================*/ 00081 00082 /* DeallocateEnvironmentData(); */ 00083 /* DestroyEnvironment(theEnv); */ 00084 00085 return(-1); 00086 }
1.5.6