~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/table.cc

  • Committer: Monty Taylor
  • Date: 2008-12-08 10:34:49 UTC
  • mto: This revision was merged to the branch mainline in revision 670.
  • Revision ID: monty@inaugust.com-20081208103449-4rz1ffja67yfcdgc
Removed my_seek, my_tell, my_fwrite, my_fseek.

Show diffs side-by-side

added added

removed removed

Lines of Context:
465
465
  error= 3;
466
466
  if (!(pos=get_form_pos(file,head,(TYPELIB*) 0)))
467
467
    goto err;                                   /* purecov: inspected */
468
 
  my_seek(file,pos,MY_SEEK_SET,MYF(0));
 
468
  lseek(file,pos,SEEK_SET);
469
469
  if (my_read(file,forminfo,288,MYF(MY_NABP)))
470
470
    goto err;
471
471
 
517
517
 
518
518
  /* Read keyinformation */
519
519
  key_info_length= (uint) uint2korr(head+28);
520
 
  my_seek(file,(ulong) uint2korr(head+6),MY_SEEK_SET,MYF(0));
 
520
  lseek(file,(ulong) uint2korr(head+6),SEEK_SET);
521
521
  if (read_string(file,(unsigned char**) &disk_buff,key_info_length))
522
522
    goto err;                                   /* purecov: inspected */
523
523
  if (disk_buff[0] & 0x80)
737
737
  if (pread(file, record, (size_t) share->reclength, record_offset) == 0)
738
738
    goto err;                                   /* purecov: inspected */
739
739
 
740
 
  my_seek(file,pos+288,MY_SEEK_SET,MYF(0));
 
740
  lseek(file,pos+288,SEEK_SET);
741
741
 
742
742
  share->fields= uint2korr(forminfo+258);
743
743
  pos= uint2korr(forminfo+260);                 /* Length of all screens */
1899
1899
  if (names)
1900
1900
  {
1901
1901
    length=uint2korr(head+4);
1902
 
    my_seek(file,64L,MY_SEEK_SET,MYF(0));
 
1902
    lseek(file,64,SEEK_SET);
1903
1903
    if (!(buf= (unsigned char*) malloc(length+a_length+names*4)) ||
1904
1904
        my_read(file, buf+a_length, (size_t) (length+names*4),
1905
1905
                MYF(MY_NABP)))
1959
1959
                     const char *newname)
1960
1960
{
1961
1961
  uint32_t i,bufflength,maxlength,n_length,length,names;
1962
 
  ulong endpos,newpos;
 
1962
  off_t endpos,newpos;
1963
1963
  unsigned char buff[IO_SIZE];
1964
1964
  unsigned char *pos;
1965
1965
 
1973
1973
  {                                             /* Expand file */
1974
1974
    newpos+=IO_SIZE;
1975
1975
    int4store(fileinfo+10,newpos);
1976
 
    endpos=(ulong) my_seek(file,0L,MY_SEEK_END,MYF(0));/* Copy from file-end */
 
1976
    endpos= lseek(file,0,SEEK_END);/* Copy from file-end */
1977
1977
    bufflength= (uint) (endpos & (IO_SIZE-1));  /* IO_SIZE is a power of 2 */
1978
1978
 
1979
1979
    while (endpos > maxlength)
1980
1980
    {
1981
 
      my_seek(file,(ulong) (endpos-bufflength),MY_SEEK_SET,MYF(0));
 
1981
      lseek(file,(off_t) (endpos-bufflength),SEEK_SET);
1982
1982
      if (my_read(file, buff, bufflength, MYF(MY_NABP+MY_WME)))
1983
1983
        return(0L);
1984
 
      my_seek(file,(ulong) (endpos-bufflength+IO_SIZE),MY_SEEK_SET,
1985
 
                   MYF(0));
 
1984
      lseek(file,(off_t) (endpos-bufflength+IO_SIZE),SEEK_SET);
1986
1985
      if ((my_write(file, buff,bufflength,MYF(MY_NABP+MY_WME))))
1987
1986
        return(0);
1988
1987
      endpos-=bufflength; bufflength=IO_SIZE;
1989
1988
    }
1990
1989
    memset(buff, 0, IO_SIZE);                   /* Null new block */
1991
 
    my_seek(file,(ulong) maxlength,MY_SEEK_SET,MYF(0));
 
1990
    lseek(file,(ulong) maxlength,SEEK_SET);
1992
1991
    if (my_write(file,buff,bufflength,MYF(MY_NABP+MY_WME)))
1993
1992
        return(0L);
1994
1993
    maxlength+=IO_SIZE;                         /* Fix old ref */
2008
2007
  }
2009
2008
  else
2010
2009
    strxmov((char*) buff,newname,"/",NULL); /* purecov: inspected */
2011
 
  my_seek(file,63L+(ulong) n_length,MY_SEEK_SET,MYF(0));
 
2010
  lseek(file, 63 + n_length,SEEK_SET);
2012
2011
  if (my_write(file, buff, (size_t) length+1,MYF(MY_NABP+MY_WME)) ||
2013
2012
      (names && my_write(file,(unsigned char*) (*formnames->type_names+n_length-1),
2014
2013
                         names*4, MYF(MY_NABP+MY_WME))) ||