Lines Matching full:hidden
61 context->hidden.win32io.h = INVALID_HANDLE_VALUE; /* mark this as unusable */
62 context->hidden.win32io.buffer.data = NULL;
63 context->hidden.win32io.buffer.size = 0;
64 context->hidden.win32io.buffer.left = 0;
82 context->hidden.win32io.buffer.data = (char *)SDL_malloc(READAHEAD_BUFFER_SIZE);
83 if (!context->hidden.win32io.buffer.data) {
95 SDL_free(context->hidden.win32io.buffer.data);
96 context->hidden.win32io.buffer.data = NULL;
116 SDL_free(context->hidden.win32io.buffer.data);
117 context->hidden.win32io.buffer.data = NULL;
121 context->hidden.win32io.h = h;
122 context->hidden.win32io.append = a_mode;
131 if (!context || context->hidden.win32io.h == INVALID_HANDLE_VALUE) {
137 if (whence == RW_SEEK_CUR && context->hidden.win32io.buffer.left) {
138 offset -= context->hidden.win32io.buffer.left;
140 context->hidden.win32io.buffer.left = 0;
154 file_pos = SetFilePointer(context->hidden.win32io.h,offset,NULL,win32whence);
171 if (!context || context->hidden.win32io.h == INVALID_HANDLE_VALUE || total_need<=0 || !size)
174 if (context->hidden.win32io.buffer.left > 0) {
175 void *data = (char *)context->hidden.win32io.buffer.data +
176 context->hidden.win32io.buffer.size -
177 context->hidden.win32io.buffer.left;
178 read_ahead = SDL_min(total_need, context->hidden.win32io.buffer.left);
180 context->hidden.win32io.buffer.left -= read_ahead;
191 if (!ReadFile(context->hidden.win32io.h,context->hidden.win32io.buffer.data,READAHEAD_BUFFER_SIZE,&byte_read,NULL)) {
196 SDL_memcpy(ptr, context->hidden.win32io.buffer.data, read_ahead);
197 context->hidden.win32io.buffer.size = byte_read;
198 context->hidden.win32io.buffer.left = byte_read-read_ahead;
201 if (!ReadFile(context->hidden.win32io.h,ptr,total_need,&byte_read,NULL)) {
217 if (!context || context->hidden.win32io.h==INVALID_HANDLE_VALUE || total_bytes<=0 || !size)
220 if (context->hidden.win32io.buffer.left) {
221 SetFilePointer(context->hidden.win32io.h,-context->hidden.win32io.buffer.left,NULL,FILE_CURRENT);
222 context->hidden.win32io.buffer.left = 0;
226 if (context->hidden.win32io.append) {
227 if ( SetFilePointer(context->hidden.win32io.h,0L,NULL,FILE_END) == INVALID_SET_FILE_POINTER ) {
233 if (!WriteFile(context->hidden.win32io.h,ptr,total_bytes,&byte_written,NULL)) {
245 if (context->hidden.win32io.h != INVALID_HANDLE_VALUE) {
246 CloseHandle(context->hidden.win32io.h);
247 context->hidden.win32io.h = INVALID_HANDLE_VALUE; /* to be sure */
249 if (context->hidden.win32io.buffer.data) {
250 SDL_free(context->hidden.win32io.buffer.data);
251 context->hidden.win32io.buffer.data = NULL;
265 if ( fseek(context->hidden.stdio.fp, offset, whence) == 0 ) {
266 return(ftell(context->hidden.stdio.fp));
276 nread = fread(ptr, size, maxnum, context->hidden.stdio.fp);
277 if ( nread == 0 && ferror(context->hidden.stdio.fp) ) {
286 nwrote = fwrite(ptr, size, num, context->hidden.stdio.fp);
287 if ( nwrote == 0 && ferror(context->hidden.stdio.fp) ) {
295 if ( context->hidden.stdio.autoclose ) {
297 fclose(context->hidden.stdio.fp);
313 newpos = context->hidden.mem.base+offset;
316 newpos = context->hidden.mem.here+offset;
319 newpos = context->hidden.mem.stop+offset;
325 if ( newpos < context->hidden.mem.base ) {
326 newpos = context->hidden.mem.base;
328 if ( newpos > context->hidden.mem.stop ) {
329 newpos = context->hidden.mem.stop;
331 context->hidden.mem.here = newpos;
332 return(context->hidden.mem.here-context->hidden.mem.base);
344 mem_available = (context->hidden.mem.stop - context->hidden.mem.here);
349 SDL_memcpy(ptr, context->hidden.mem.here, total_bytes);
350 context->hidden.mem.here += total_bytes;
356 if ( (context->hidden.mem.here + (num*size)) > context->hidden.mem.stop ) {
357 num = (context->hidden.mem.stop-context->hidden.mem.here)/size;
359 SDL_memcpy(context->hidden.mem.here, ptr, num*size);
360 context->hidden.mem.here += num*size;
481 rwops->hidden.stdio.fp = fp;
482 rwops->hidden.stdio.autoclose = autoclose;
498 rwops->hidden.mem.base = (Uint8 *)mem;
499 rwops->hidden.mem.here = rwops->hidden.mem.base;
500 rwops->hidden.mem.stop = rwops->hidden.mem.base+size;
515 rwops->hidden.mem.base = (Uint8 *)mem;
516 rwops->hidden.mem.here = rwops->hidden.mem.base;
517 rwops->hidden.mem.stop = rwops->hidden.mem.base+size;