1
10
13
14
20
21
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
97
98
99
100
101
102
103
104
105
106
107
108
109
116
117
118
119
120
121
122
124
130
136
137
138
144
145
162
163
...
...
...
#define FX_SOURCE_CODE
#include "fx_api.h"
#include "fx_system.h"
#include "fx_directory.h"
#include "fx_file.h"
#include "fx_utility.h"
5 includes
...
...
UINT _fx_file_extended_relative_seek(FX_FILE *file_ptr, ULONG64 byte_offset, UINT seek_from)
{
#ifndef FX_MEDIA_STATISTICS_DISABLE
FX_MEDIA *media_ptr;
if (file_ptr -> fx_file_id != FX_FILE_ID)
{
return(FX_NOT_OPEN);
}if (file_ptr -> fx_file_id != FX_FILE_ID) { ... }
media_ptr = file_ptr -> fx_file_media_ptr;
media_ptr -> fx_media_file_relative_seeks++;/* ... */
#endif
FX_TRACE_IN_LINE_INSERT(FX_TRACE_FILE_RELATIVE_SEEK, file_ptr, byte_offset, seek_from, file_ptr -> fx_file_current_file_offset, FX_TRACE_FILE_EVENTS, 0, 0)
if (seek_from == FX_SEEK_BEGIN)
{
/* ... */
return(_fx_file_extended_seek(file_ptr, byte_offset));
}if (seek_from == FX_SEEK_BEGIN) { ... }
else if (seek_from == FX_SEEK_END)
{
/* ... */
if (byte_offset >= file_ptr -> fx_file_current_file_size)
{
return(_fx_file_extended_seek(file_ptr, ((ULONG64) 0)));
}if (byte_offset >= file_ptr -> fx_file_current_file_size) { ... }
else
{
return(_fx_file_extended_seek(file_ptr, file_ptr -> fx_file_current_file_size - byte_offset));
}else { ... }
}else if (seek_from == FX_SEEK_END) { ... }
else if (seek_from == FX_SEEK_FORWARD)
{
return(_fx_file_extended_seek(file_ptr, file_ptr -> fx_file_current_file_offset + byte_offset));
}else if (seek_from == FX_SEEK_FORWARD) { ... }
else
{
if (byte_offset >= file_ptr -> fx_file_current_file_offset)
{
return(_fx_file_extended_seek(file_ptr, ((ULONG64) 0)));
}if (byte_offset >= file_ptr -> fx_file_current_file_offset) { ... }
else
{
return(_fx_file_extended_seek(file_ptr, file_ptr -> fx_file_current_file_offset - byte_offset));
}else { ... }
}else { ... }
}{ ... }