~ubuntu-branches/ubuntu/precise/liboggz/precise

« back to all changes in this revision

Viewing changes to src/liboggz/oggz_io.c

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Wilkinson
  • Date: 2005-04-16 01:19:44 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050416011944-5ipwrrc260ihkpp8
Tags: 0.9.1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
  if (oggz->file != NULL) {
58
58
    if ((bytes = fread (buf, 1, n, oggz->file)) == 0) {
59
59
      if (ferror (oggz->file)) {
60
 
        return OGGZ_ERR_SYSTEM;
 
60
        return (size_t) OGGZ_ERR_SYSTEM;
61
61
      }
62
62
    }
63
63
  }
64
64
 
65
65
  else if ((io = oggz->io) != NULL) {
66
 
    if (io->read == NULL) return -1;
 
66
    if (io->read == NULL) return (size_t) -1;
67
67
    bytes = io->read (io->read_user_handle, buf, n);
68
68
  }
69
69
 
70
 
  else return OGGZ_ERR_INVALID;
 
70
  else return (size_t) OGGZ_ERR_INVALID;
71
71
 
72
72
  return bytes;
73
73
}
83
83
  }
84
84
 
85
85
  else if ((io = oggz->io) != NULL) {
86
 
    if (io->write == NULL) return -1;
 
86
    if (io->write == NULL) return (size_t) -1;
87
87
    bytes = io->write (io->write_user_handle, buf, n);
88
88
  }
89
89
 
90
 
  else return OGGZ_ERR_INVALID;
91
 
  
 
90
  else return (size_t) OGGZ_ERR_INVALID;
 
91
 
92
92
  return bytes;
93
93
}
94
94
 
96
96
oggz_io_seek (OGGZ * oggz, long offset, int whence)
97
97
{
98
98
  OggzIO * io;
99
 
  
 
99
 
100
100
  if (oggz->file != NULL) {
101
101
    if (fseek (oggz->file, offset, whence) == -1) {
102
102
      if (errno == ESPIPE) {
124
124
{
125
125
  OggzIO * io;
126
126
  long offset;
127
 
  
 
127
 
128
128
  if (oggz->file != NULL) {
129
129
    if ((offset = ftell (oggz->file)) == -1) {
130
130
      if (errno == ESPIPE) {