Updating to the newest clips version(6.30).
#include "clips.h"
#define BUFFER_SIZE 1024
int main( int argc, char *argv[]){
DATA_OBJECT factlist;
char factBuffer[BUFFER_SIZE+1];
int end,i;
void *multifieldPtr;
void *theEnv;
theEnv = CreateEnvironment();
EnvBuild(theEnv, "(deffacts initial (colors red green blue) (animals cat dog chicken))");
EnvReset(theEnv);
EnvGetFactList(theEnv,&factlist,NULL);
if (GetType(factlist) == MULTIFIELD)
{
end = GetDOEnd(factlist);
multifieldPtr = GetValue(factlist);
for (i = GetDOBegin(factlist); i <= end; i++)
{
EnvGetFactPPForm(theEnv, factBuffer,BUFFER_SIZE,GetMFValue(multifieldPtr,i));
printf("%s\n",factBuffer);
}
}
return(-1);
}
You can compile with:
make -f makefile.lib
gcc <source file name> -L./ -lclips -lm -o <executable name>