Lines Matching defs:thefile
19 static apr_status_t setptr(apr_file_t *thefile, apr_off_t pos )
24 if (thefile->direction == 1) {
25 rv = apr_file_flush_locked(thefile);
29 thefile->bufpos = thefile->direction = thefile->dataRead = 0;
32 newbufpos = pos - (thefile->filePtr - thefile->dataRead);
33 if (newbufpos >= 0 && newbufpos <= thefile->dataRead) {
34 thefile->bufpos = newbufpos;
38 if (lseek(thefile->filedes, pos, SEEK_SET) != -1) {
39 thefile->bufpos = thefile->dataRead = 0;
40 thefile->filePtr = pos;
52 APR_DECLARE(apr_status_t) apr_file_seek(apr_file_t *thefile, apr_seek_where_t where, apr_off_t *offset)
56 thefile->eof_hit = 0;
58 if (thefile->buffered) {
62 file_lock(thefile);
66 rc = setptr(thefile, *offset);
70 rc = setptr(thefile, thefile->filePtr - thefile->dataRead + thefile->bufpos + *offset);
74 rc = apr_file_info_get_locked(&finfo, APR_FINFO_SIZE, thefile);
76 rc = setptr(thefile, finfo.size + *offset);
80 *offset = thefile->filePtr - thefile->dataRead + thefile->bufpos;
82 file_unlock(thefile);
87 rv = lseek(thefile->filedes, *offset, where);