| 81 | } |
| 82 | |
| 83 | static sf_count_t seek( sf_count_t offset, int whence, void* userData ) { |
| 84 | ci::IStreamCinder* stream = static_cast<ci::IStreamCinder*>( userData ); |
| 85 | switch( whence ) { |
| 86 | case SEEK_SET: |
| 87 | stream->seekAbsolute( offset ); |
| 88 | break; |
| 89 | |
| 90 | case SEEK_CUR: |
| 91 | stream->seekRelative( offset ); |
| 92 | break; |
| 93 | |
| 94 | case SEEK_END: { |
| 95 | size_t absOffset = stream->size() - offset; |
| 96 | stream->seekAbsolute( absOffset ); |
| 97 | } |
| 98 | break; |
| 99 | |
| 100 | default : |
| 101 | stream->seekAbsolute( 0 ); |
| 102 | break; |
| 103 | } |
| 104 | return stream->tell(); |
| 105 | } |
| 106 | |
| 107 | static sf_count_t read( void* ptr, sf_count_t count, void* userData ) { |
| 108 | ci::IStreamCinder* stream = static_cast<ci::IStreamCinder*>( userData ); |
nothing calls this directly
no test coverage detected