本文整理汇总了C++中GenWrite函数的典型用法代码示例。如果您正苦于以下问题:C++ GenWrite函数的具体用法?C++ GenWrite怎么用?C++ GenWrite使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GenWrite函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: WriteBinaryHeader
static void WriteBinaryHeader(
void *theEnv,
FILE *fp)
{
GenWrite(BloadData(theEnv)->BinaryPrefixID,(unsigned long) strlen(BloadData(theEnv)->BinaryPrefixID) + 1,fp);
GenWrite(BloadData(theEnv)->BinaryVersionID,(unsigned long) strlen(BloadData(theEnv)->BinaryVersionID) + 1,fp);
}
开发者ID:Anusaaraka,项目名称:anusaaraka,代码行数:7,代码来源:bsave.c
示例2: BsaveClassLinks
/***************************************************
NAME : BsaveClassLinks
DESCRIPTION : Writes class links binary data
INPUTS : 1) The defclass
2) The binary file pointer
RETURNS : Nothing useful
SIDE EFFECTS : Defclass links binary data written
NOTES : None
***************************************************/
static void BsaveClassLinks(
struct constructHeader *theDefclass,
void *buf)
{
DEFCLASS *cls = (DEFCLASS *) theDefclass;
register unsigned i;
long dummy_class_index;
for (i = 0 ; i < cls->directSuperclasses.classCount ; i++)
{
dummy_class_index = DefclassIndex(cls->directSuperclasses.classArray[i]);
GenWrite((void *) &dummy_class_index,(UNLN) sizeof(long),(FILE *) buf);
}
LinkCount += cls->directSuperclasses.classCount;
for (i = 0 ; i < cls->directSubclasses.classCount ; i++)
{
dummy_class_index = DefclassIndex(cls->directSubclasses.classArray[i]);
GenWrite((void *) &dummy_class_index,(UNLN) sizeof(long),(FILE *) buf);
}
LinkCount += cls->directSubclasses.classCount;
for (i = 0 ; i < cls->allSuperclasses.classCount ; i++)
{
dummy_class_index = DefclassIndex(cls->allSuperclasses.classArray[i]);
GenWrite((void *) &dummy_class_index,(UNLN) sizeof(long),(FILE *) buf);
}
LinkCount += cls->allSuperclasses.classCount;
}
开发者ID:OS2World,项目名称:DEV-LISP-Clips,代码行数:36,代码来源:objbin.c
示例3: WriteNeededConstraints
globle void WriteNeededConstraints(
void *theEnv,
FILE *fp)
{
int i;
unsigned short theIndex = 0;
unsigned long int numberOfUsedConstraints = 0;
CONSTRAINT_RECORD *tmpPtr;
BSAVE_CONSTRAINT_RECORD bsaveConstraints;
/*================================*/
/* Get the number of constraints. */
/*================================*/
for (i = 0; i < SIZE_CONSTRAINT_HASH; i++)
{
for (tmpPtr = ConstraintData(theEnv)->ConstraintHashtable[i];
tmpPtr != NULL;
tmpPtr = tmpPtr->next)
{
tmpPtr->bsaveIndex = theIndex++;
numberOfUsedConstraints++;
}
}
/*=============================================*/
/* If dynamic constraint checking is disabled, */
/* then no constraints are saved. */
/*=============================================*/
if ((! EnvGetDynamicConstraintChecking(theEnv)) && (numberOfUsedConstraints != 0))
{
numberOfUsedConstraints = 0;
PrintWarningID(theEnv,"CSTRNBIN",1,FALSE);
EnvPrintRouter(theEnv,WWARNING,"Constraints are not saved with a binary image\n");
EnvPrintRouter(theEnv,WWARNING," when dynamic constraint checking is disabled.\n");
}
/*============================================*/
/* Write out the number of constraints in the */
/* constraint table followed by each of the */
/* constraints in the constraint table. */
/*============================================*/
GenWrite(&numberOfUsedConstraints,(unsigned long) sizeof(unsigned long int),fp);
if (numberOfUsedConstraints == 0) return;
for (i = 0 ; i < SIZE_CONSTRAINT_HASH; i++)
{
for (tmpPtr = ConstraintData(theEnv)->ConstraintHashtable[i];
tmpPtr != NULL;
tmpPtr = tmpPtr->next)
{
CopyToBsaveConstraintRecord(theEnv,tmpPtr,&bsaveConstraints);
GenWrite(&bsaveConstraints,
(unsigned long) sizeof(BSAVE_CONSTRAINT_RECORD),fp);
}
}
}
开发者ID:aliverobotics,项目名称:Pumas-SmallSize,代码行数:59,代码来源:cstrnbin.c
示例4: WriteNeededSymbols
globle void WriteNeededSymbols(
void *theEnv,
FILE *fp)
{
unsigned long i;
size_t length;
SYMBOL_HN **symbolArray;
SYMBOL_HN *symbolPtr;
unsigned long int numberOfUsedSymbols = 0;
size_t size = 0;
/*=================================*/
/* Get a copy of the symbol table. */
/*=================================*/
symbolArray = GetSymbolTable(theEnv);
/*======================================================*/
/* Get the number of symbols and the total string size. */
/*======================================================*/
for (i = 0; i < SYMBOL_HASH_SIZE; i++)
{
for (symbolPtr = symbolArray[i];
symbolPtr != NULL;
symbolPtr = symbolPtr->next)
{
if (symbolPtr->neededSymbol)
{
numberOfUsedSymbols++;
size += strlen(symbolPtr->contents) + 1;
}
}
}
/*=============================================*/
/* Write out the symbols and the string sizes. */
/*=============================================*/
GenWrite((void *) &numberOfUsedSymbols,(unsigned long) sizeof(unsigned long int),fp);
GenWrite((void *) &size,(unsigned long) sizeof(unsigned long int),fp);
for (i = 0; i < SYMBOL_HASH_SIZE; i++)
{
for (symbolPtr = symbolArray[i];
symbolPtr != NULL;
symbolPtr = symbolPtr->next)
{
if (symbolPtr->neededSymbol)
{
length = strlen(symbolPtr->contents) + 1;
GenWrite((void *) symbolPtr->contents,(unsigned long) length,fp);
}
}
}
}
开发者ID:Chosko,项目名称:CLIPSJNI,代码行数:56,代码来源:symblbin.c
示例5: WriteNeededFunctions
static void WriteNeededFunctions(
void *theEnv,
FILE *fp)
{
unsigned long int count = 0;
size_t space, length;
struct FunctionDefinition *functionList;
/*================================================*/
/* Assign each function an index if it is needed. */
/*================================================*/
for (functionList = GetFunctionList(theEnv);
functionList != NULL;
functionList = functionList->next)
{
if (functionList->bsaveIndex)
{ functionList->bsaveIndex = (short int) count++; }
else
{ functionList->bsaveIndex = -1; }
}
/*===================================================*/
/* Write the number of function names to be written. */
/*===================================================*/
GenWrite(&count,(unsigned long) sizeof(unsigned long int),fp);
if (count == 0)
{
GenWrite(&count,(unsigned long) sizeof(unsigned long int),fp);
return;
}
/*================================*/
/* Determine the amount of space */
/* needed for the function names. */
/*================================*/
space = FunctionBinarySize(theEnv);
GenWrite(&space,(unsigned long) sizeof(unsigned long int),fp);
/*===============================*/
/* Write out the function names. */
/*===============================*/
for (functionList = GetFunctionList(theEnv);
functionList != NULL;
functionList = functionList->next)
{
if (functionList->bsaveIndex >= 0)
{
length = strlen(ValueToString(functionList->callFunctionName)) + 1;
GenWrite(ValueToString(functionList->callFunctionName),(unsigned long) length,fp);
}
}
}
开发者ID:Anusaaraka,项目名称:anusaaraka,代码行数:56,代码来源:bsave.c
示例6: WriteNeededBitMaps
static void WriteNeededBitMaps(
void *theEnv,
FILE *fp)
{
int i;
BITMAP_HN **bitMapArray;
BITMAP_HN *bitMapPtr;
unsigned long int numberOfUsedBitMaps = 0, size = 0;
unsigned short tempSize;
/*=================================*/
/* Get a copy of the bitmap table. */
/*=================================*/
bitMapArray = GetBitMapTable(theEnv);
/*======================================================*/
/* Get the number of bitmaps and the total bitmap size. */
/*======================================================*/
for (i = 0; i < BITMAP_HASH_SIZE; i++)
{
for (bitMapPtr = bitMapArray[i];
bitMapPtr != NULL;
bitMapPtr = bitMapPtr->next)
{
if (bitMapPtr->neededBitMap)
{
numberOfUsedBitMaps++;
size += (unsigned long) (bitMapPtr->size + sizeof(unsigned short));
}
}
}
/*========================================*/
/* Write out the bitmaps and their sizes. */
/*========================================*/
GenWrite((void *) &numberOfUsedBitMaps,(unsigned long) sizeof(unsigned long int),fp);
GenWrite((void *) &size,(unsigned long) sizeof(unsigned long int),fp);
for (i = 0; i < BITMAP_HASH_SIZE; i++)
{
for (bitMapPtr = bitMapArray[i];
bitMapPtr != NULL;
bitMapPtr = bitMapPtr->next)
{
if (bitMapPtr->neededBitMap)
{
tempSize = (unsigned short) bitMapPtr->size;
GenWrite((void *) &tempSize,(unsigned long) sizeof(unsigned short),fp);
GenWrite((void *) bitMapPtr->contents,(unsigned long) bitMapPtr->size,fp);
}
}
}
}
开发者ID:Chosko,项目名称:CLIPSJNI,代码行数:56,代码来源:symblbin.c
示例7: BsaveStorage
static void BsaveStorage(
FILE *fp)
{
unsigned long space;
space = sizeof(long) * 2;
GenWrite(&space,(unsigned long) sizeof(unsigned long int),fp);
GenWrite(&NumberOfDefmodules,(unsigned long) sizeof(long int),fp);
GenWrite(&NumberOfPortItems,(unsigned long) sizeof(long int),fp);
}
开发者ID:ahmed-masud,项目名称:FuzzyCLIPS,代码行数:10,代码来源:modulbin.c
示例8: counts
/***********************************************************
NAME : BsaveStorageDeffunctions
DESCRIPTION : Writes out number of each type of structure
required for deffunctions
Space required for counts (unsigned long)
INPUTS : File pointer of binary file
RETURNS : Nothing useful
SIDE EFFECTS : Binary file adjusted
NOTES : None
***********************************************************/
static void BsaveStorageDeffunctions(
FILE *fp)
{
unsigned long space;
space = sizeof(unsigned long) * 2;
GenWrite((void *) &space,(unsigned long) sizeof(unsigned long),fp);
GenWrite((void *) &ModuleCount,(unsigned long) sizeof(long),fp);
GenWrite((void *) &DeffunctionCount,(unsigned long) sizeof(long),fp);
}
开发者ID:OS2World,项目名称:DEV-LISP-Clips,代码行数:20,代码来源:dffnxbin.c
示例9: BsaveStorage
static void BsaveStorage(
void *theEnv,
FILE *fp)
{
size_t space;
space = sizeof(long);
GenWrite(&space,sizeof(size_t),fp);
GenWrite(&FactBinaryData(theEnv)->NumberOfPatterns,sizeof(long int),fp);
}
开发者ID:DrItanium,项目名称:AdventureEngine,代码行数:10,代码来源:factbin.c
示例10: BsaveStorageObjectPatterns
/****************************************************
NAME : BsaveStorageObjectPatterns
DESCRIPTION : Writes out the number of bytes
required for object pattern bitmaps,
and the number of object pattern
alpha an intermediate nodes
INPUTS : Bsave file stream pointer
RETURNS : Nothing useful
SIDE EFFECTS : Counts written
NOTES : None
****************************************************/
static void BsaveStorageObjectPatterns(
FILE *fp)
{
UNLN space;
space = sizeof(long) * 2;
GenWrite(&space,(UNLN) sizeof(UNLN),fp);
GenWrite(&AlphaNodeCount,(UNLN) sizeof(long),fp);
GenWrite(&PatternNodeCount,(UNLN) sizeof(long),fp);
}
开发者ID:OS2World,项目名称:DEV-LISP-Clips,代码行数:21,代码来源:objrtbin.c
示例11: counts
/***********************************************************
NAME : BsaveStorageDefinstances
DESCRIPTION : Writes out number of each type of structure
required for definstances
Space required for counts (unsigned long)
INPUTS : File pointer of binary file
RETURNS : Nothing useful
SIDE EFFECTS : Binary file adjusted
NOTES : None
***********************************************************/
static void BsaveStorageDefinstances(
void *theEnv,
FILE *fp)
{
unsigned long space;
space = sizeof(unsigned long) * 2;
GenWrite((void *) &space,(unsigned long) sizeof(unsigned long),fp);
GenWrite((void *) &DefinstancesBinaryData(theEnv)->ModuleCount,(unsigned long) sizeof(long),fp);
GenWrite((void *) &DefinstancesBinaryData(theEnv)->DefinstancesCount,(unsigned long) sizeof(long),fp);
}
开发者ID:RobotJustina,项目名称:JUSTINA,代码行数:21,代码来源:dfinsbin.c
示例12: counts
/***********************************************************
NAME : BsaveStorageDeffunctions
DESCRIPTION : Writes out number of each type of structure
required for deffunctions
Space required for counts (unsigned long)
INPUTS : File pointer of binary file
RETURNS : Nothing useful
SIDE EFFECTS : Binary file adjusted
NOTES : None
***********************************************************/
static void BsaveStorageDeffunctions(
void *theEnv,
FILE *fp)
{
size_t space;
space = sizeof(unsigned long) * 2;
GenWrite((void *) &space,sizeof(size_t),fp);
GenWrite((void *) &DeffunctionBinaryData(theEnv)->ModuleCount,sizeof(unsigned long),fp);
GenWrite((void *) &DeffunctionBinaryData(theEnv)->DeffunctionCount,sizeof(unsigned long),fp);
}
开发者ID:ricksladkey,项目名称:CLIPS,代码行数:21,代码来源:dffnxbin.c
示例13: BsaveStorageObjectPatterns
/****************************************************
NAME : BsaveStorageObjectPatterns
DESCRIPTION : Writes out the number of bytes
required for object pattern bitmaps,
and the number of object pattern
alpha an intermediate nodes
INPUTS : Bsave file stream pointer
RETURNS : Nothing useful
SIDE EFFECTS : Counts written
NOTES : None
****************************************************/
static void BsaveStorageObjectPatterns(
void *theEnv,
FILE *fp)
{
size_t space;
space = sizeof(long) * 2;
GenWrite(&space,sizeof(size_t),fp);
GenWrite(&ObjectReteBinaryData(theEnv)->AlphaNodeCount,sizeof(long),fp);
GenWrite(&ObjectReteBinaryData(theEnv)->PatternNodeCount,sizeof(long),fp);
}
开发者ID:guitarpoet,项目名称:php-clips,代码行数:22,代码来源:objrtbin.c
示例14: BsaveStorage
static void BsaveStorage(
void *theEnv,
FILE *fp)
{
unsigned long space;
space = sizeof(long) * 2;
GenWrite(&space,(unsigned long) sizeof(unsigned long int),fp);
GenWrite(&DefmoduleData(theEnv)->BNumberOfDefmodules,(unsigned long) sizeof(long int),fp);
GenWrite(&DefmoduleData(theEnv)->NumberOfPortItems,(unsigned long) sizeof(long int),fp);
}
开发者ID:femto,项目名称:rbclips,代码行数:11,代码来源:modulbin.c
示例15: BsaveStorage
static void BsaveStorage(
void *theEnv,
FILE *fp)
{
unsigned long space;
space = sizeof(long) * 3;
GenWrite(&space,(unsigned long) sizeof(unsigned long int),fp);
GenWrite(&DefruleBinaryData(theEnv)->NumberOfDefruleModules,(unsigned long) sizeof(long int),fp);
GenWrite(&DefruleBinaryData(theEnv)->NumberOfDefrules,(unsigned long) sizeof(long int),fp);
GenWrite(&DefruleBinaryData(theEnv)->NumberOfJoins,(unsigned long) sizeof(long int),fp);
}
开发者ID:RobotJustina,项目名称:JUSTINA,代码行数:12,代码来源:rulebin.c
示例16: BsaveStorage
static void BsaveStorage(
FILE *fp)
{
unsigned long space;
space = sizeof(long) * 3;
GenWrite(&space,(unsigned long) sizeof(unsigned long int),fp);
GenWrite(&NumberOfDefruleModules,(unsigned long) sizeof(long int),fp);
GenWrite(&NumberOfDefrules,(unsigned long) sizeof(long int),fp);
GenWrite(&NumberOfJoins,(unsigned long) sizeof(long int),fp);
#if FUZZY_DEFTEMPLATES
GenWrite(&NumberOfPatternFuzzyValues,(unsigned long) sizeof(long int),fp);
#endif
}
开发者ID:ahmed-masud,项目名称:FuzzyCLIPS,代码行数:14,代码来源:rulebin.c
示例17: WriteNeededIntegers
globle void WriteNeededIntegers(
void *theEnv,
FILE *fp)
{
int i;
INTEGER_HN **integerArray;
INTEGER_HN *integerPtr;
unsigned long int numberOfUsedIntegers = 0;
/*==================================*/
/* Get a copy of the integer table. */
/*==================================*/
integerArray = GetIntegerTable(theEnv);
/*=============================*/
/* Get the number of integers. */
/*=============================*/
for (i = 0 ; i < INTEGER_HASH_SIZE; i++)
{
for (integerPtr = integerArray[i];
integerPtr != NULL;
integerPtr = integerPtr->next)
{
if (integerPtr->neededInteger) numberOfUsedIntegers++;
}
}
/*==========================================================*/
/* Write out the number of integers and the integer values. */
/*==========================================================*/
GenWrite(&numberOfUsedIntegers,(unsigned long) sizeof(unsigned long int),fp);
for (i = 0 ; i < INTEGER_HASH_SIZE; i++)
{
for (integerPtr = integerArray[i];
integerPtr != NULL;
integerPtr = integerPtr->next)
{
if (integerPtr->neededInteger)
{
GenWrite(&integerPtr->contents,
(unsigned long) sizeof(integerPtr->contents),fp);
}
}
}
}
开发者ID:Chosko,项目名称:CLIPSJNI,代码行数:49,代码来源:symblbin.c
示例18: BsaveMethodRestrictions
/******************************************************
NAME : BsaveMethodRestrictions
DESCRIPTION : Bsaves defgeneric methods' retrictions
INPUTS : 1) The defgeneric
2) Output data file pointer
RETURNS : Nothing useful
SIDE EFFECTS : Defgeneric methods' restrictions saved
NOTES : None
******************************************************/
static void BsaveMethodRestrictions(
struct constructHeader *theDefgeneric,
void *userBuffer)
{
DEFGENERIC *gfunc = (DEFGENERIC *) theDefgeneric;
BSAVE_RESTRICTION dummy_restriction;
RESTRICTION *rptr;
register unsigned i,j;
for (i = 0 ; i < gfunc->mcnt ; i++)
{
for (j = 0 ; j < gfunc->methods[i].restrictionCount ; j++)
{
rptr = &gfunc->methods[i].restrictions[j];
dummy_restriction.tcnt = rptr->tcnt;
if (rptr->types != NULL)
{
dummy_restriction.types = TypeCount;
TypeCount += rptr->tcnt;
}
else
dummy_restriction.types = -1L;
if (rptr->query != NULL)
{
dummy_restriction.query = ExpressionCount;
ExpressionCount += ExpressionSize(rptr->query);
}
else
dummy_restriction.query = -1L;
GenWrite((void *) &dummy_restriction,
(unsigned long) sizeof(BSAVE_RESTRICTION),(FILE *) userBuffer);
}
}
}
开发者ID:ahmed-masud,项目名称:FuzzyCLIPS,代码行数:43,代码来源:genrcbin.c
示例19: BsaveJoin
static void BsaveJoin(
FILE *fp,
struct joinNode *joinPtr)
{
struct bsaveJoinNode tempJoin;
joinPtr->marked = 0;
tempJoin.depth = joinPtr->depth;
tempJoin.rhsType = joinPtr->rhsType;
tempJoin.firstJoin = joinPtr->firstJoin;
tempJoin.logicalJoin = joinPtr->logicalJoin;
tempJoin.joinFromTheRight = joinPtr->joinFromTheRight;
tempJoin.patternIsNegated = joinPtr->patternIsNegated;
if (joinPtr->joinFromTheRight)
{ tempJoin.rightSideEntryStructure = BsaveJoinIndex(joinPtr->rightSideEntryStructure); }
else
{ tempJoin.rightSideEntryStructure = -1L; }
tempJoin.lastLevel = BsaveJoinIndex(joinPtr->lastLevel);
tempJoin.nextLevel = BsaveJoinIndex(joinPtr->nextLevel);
tempJoin.rightMatchNode = BsaveJoinIndex(joinPtr->rightMatchNode);
tempJoin.rightDriveNode = BsaveJoinIndex(joinPtr->rightDriveNode);
tempJoin.networkTest = HashedExpressionIndex(joinPtr->networkTest);
if (joinPtr->ruleToActivate != NULL)
{
tempJoin.ruleToActivate =
GetDisjunctIndex(joinPtr->ruleToActivate);
}
else
{ tempJoin.ruleToActivate = -1L; }
GenWrite(&tempJoin,(unsigned long) sizeof(struct bsaveJoinNode),fp);
}
开发者ID:ahmed-masud,项目名称:FuzzyCLIPS,代码行数:35,代码来源:rulebin.c
示例20: BsaveRestrictionTypes
/*************************************************************
NAME : BsaveRestrictionTypes
DESCRIPTION : Bsaves defgeneric methods' retrictions' types
INPUTS : 1) The defgeneric
2) Output data file pointer
RETURNS : Nothing useful
SIDE EFFECTS : Defgeneric methods' restrictions' types saved
NOTES : None
*************************************************************/
static void BsaveRestrictionTypes(
struct constructHeader *theDefgeneric,
void *userBuffer)
{
DEFGENERIC *gfunc = (DEFGENERIC *) theDefgeneric;
long dummy_type;
RESTRICTION *rptr;
register unsigned i,j,k;
for (i = 0 ; i < gfunc->mcnt ; i++)
{
for (j = 0 ; j < gfunc->methods[i].restrictionCount ; j++)
{
rptr = &gfunc->methods[i].restrictions[j];
for (k = 0 ; k < rptr->tcnt ; k++)
{
#if OBJECT_SYSTEM
dummy_type = DefclassIndex(rptr->types[k]);
#else
dummy_type = (long) ((INTEGER_HN *) rptr->types[k])->contents;
#endif
GenWrite(&dummy_type,(unsigned long) sizeof(long),(FILE *) userBuffer);
}
}
}
}
开发者ID:ahmed-masud,项目名称:FuzzyCLIPS,代码行数:35,代码来源:genrcbin.c
注:本文中的GenWrite函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论