示例#1
0
/*************************************************************************
 *                                                                       *
 * Fill the output buffer with records                                   *
 * Buffer holds an integer number of whole records                       *
 *  (buffer size is a multiple of record size)                           *
 *                                                                       *
 *************************************************************************/
int FillBuffer(char *Buffer, int BufferSize, long long Record, long long MaxRecord)
    {   
    int RecordCount = 0;
    do  {
        gen_rec((struct record *) &Buffer[RecordCount*RecordSize]);
        Record++;
        RecordCount++;
        }while ((RecordCount < RecordsPerBuffer) && (Record < MaxRecord));

    return (RecordCount);
}
示例#2
0
/*
 * fill the output buffer with records
 * buffer holds an integer number of whole records
 * (buffer size is a multiple of record size)
 */
static int 
fill_buf(char *buf)
{
	long cnt;	//BUG #10
	record_t *rec = (record_t *)buf;

	for (cnt = 0; (cnt < buf_nrec) 			//BUG #9
		&& ((cur_rec + cnt) < rec_max); cnt++)
		gen_rec(rec + cnt);

	return cnt;
}
示例#3
0
/*
 * fill the output buffer with records
 * buffer holds an integer number of whole records
 * (buffer size is a multiple of record size)
 */
static int 
fill_buf(char *buf)
{
	int cnt;
	record_t *rec = (record_t *)buf;

	for (cnt = 0; (cnt <= buf_nrec) 
		&& ((cur_rec + cnt) < rec_max); cnt++)
		gen_rec(rec + cnt);

	return cnt;
}