~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/mf_iocache.cc

  • Committer: Olaf van der Spek
  • Date: 2011-08-13 16:39:27 UTC
  • mto: This revision was merged to the branch mainline in revision 2407.
  • Revision ID: olafvdspek@gmail.com-20110813163927-luksv0xydcqmi5pz
Refactor iocache

Show diffs side-by-side

added added

removed removed

Lines of Context:
472
472
 */
473
473
int _my_b_get(io_cache_st *info)
474
474
{
 
475
  if (info->pre_read)
 
476
    (*info->pre_read)(info);
 
477
 
475
478
  unsigned char buff;
476
 
  IO_CACHE_CALLBACK pre_read,post_read;
477
 
 
478
 
  if ((pre_read = info->pre_read))
479
 
    (*pre_read)(info);
480
 
 
481
479
  if ((*(info)->read_function)(info,&buff,1))
482
480
    return my_b_EOF;
483
481
 
484
 
  if ((post_read = info->post_read))
485
 
    (*post_read)(info);
 
482
  if (info->post_read)
 
483
    (*info->post_read)(info);
486
484
 
487
 
  return (int) (unsigned char) buff;
 
485
  return buff;
488
486
}
489
487
 
490
488
/**
549
547
 *   As all write calls to the data goes through the cache,
550
548
 *   we will never get a seek over the end of the buffer.
551
549
 */
552
 
int my_block_write(io_cache_st *info, const unsigned char *Buffer, size_t Count,
553
 
                   my_off_t pos)
 
550
static int my_block_write(io_cache_st *info, const unsigned char *Buffer, size_t Count, my_off_t pos)
554
551
{
555
552
  size_t length_local;
556
553
  int error=0;
592
589
  return error;
593
590
}
594
591
 
 
592
int io_cache_st::block_write(const void* Buffer, size_t Count, my_off_t pos)
 
593
{
 
594
  return my_block_write(this, reinterpret_cast<const unsigned char*>(Buffer), Count, pos);
 
595
}
 
596
 
595
597
/**
596
598
 * @brief
597
599
 *   Flush write cache