本文整理汇总了C++中GenWrite函数的典型用法代码示例。如果您正苦于以下问题:C++ GenWrite函数的具体用法?C++ GenWrite怎么用?C++ GenWrite使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GenWrite函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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;
}
示例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);
}
}
}
示例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);
}
}
}
}
示例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);
}
}
}
示例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);
}
}
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}