Datasheet
API in C using winsock
69
DEBUG ? printf("readBlock\n") : 0;
do
{
stSentence = readSentence(fdSock);
DEBUG ? printf("readSentence succeeded.\n") : 0;
addSentenceToBlock(&stBlock, &stSentence);
DEBUG ? printf("addSentenceToBlock succeeded\n") : 0;
} while (stSentence.iReturnValue == 0);
DEBUG ? printf("readBlock completed successfully\n") : 0;
return stBlock;
}
/********************************************************************
* Initialize a new block
* Set iLength to 0.
********************************************************************/
void initializeBlock(struct Block *stBlock)
{
DEBUG ? printf("initializeBlock\n") : 0;
stBlock->iLength = 0;
}
/********************************************************************
* Clear an existing block
* Free all sentences in the Block struct and set iLength to 0.
********************************************************************/
void clearBlock(struct Block *stBlock)
{
DEBUG ? printf("clearBlock\n") : 0;
free(stBlock->stSentence);
initializeBlock(&stBlock);
}










