1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 8.0.0.0 for Windows">
7<META http-equiv="Content-Style-Type" content="text/css">
8<title>FS_COMMAND_READFILE</title>
9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">FS_COMMAND_READFILE <img src="../../image/NTR.gif"align="middle"><img src="../../image/TWL.gif" align="middle"></h1>
15<h2>Definition</h2>
16
17<dl>
18  <dd>
19  <BR>
20  <CODE>FSResult FS_ARCHIVE_PROC_FUNC(FSFile *p_file, FSCommandType command /*
21  = FS_COMMAND_READFILE */);<br>
22  </CODE><br>
23  </dd>
24</dl>
25
26<H2>Description</H2>
27<P>Operating specifications for the archive command <code>FS_COMMAND_READFILE</code> are shown below: <BR> <BR>
28
29<HR>
30<B>Arguments passed to this command</B>
31<BLOCKQUOTE>
32<PRE>This command takes as a command argument the variable <code>arg.readfile</code> that is stored in <code>p_file</code>.<br />
33This variable is defined in <code>nitro/fs/file.h</code> as shown below:
34
35typedef struct
36{
37    void    *dst;
38    u32     len_org;
39    u32     len;
40} FSReadFileInfo;</code> </PRE>
41</BLOCKQUOTE>
42<BLOCKQUOTE>Argument content is listed below:
43</BLOCKQUOTE>
44<CENTER>
45<TABLE border="1" width="50%">
46  <TBODY>
47    <TR>
48      <TD style="text-align : center;" width="95">Arguments</TD>
49      <TD style="text-align : center;" width="522">Content</TD>
50    </TR>
51    <TR>
52      <TD width="95" style="text-align : center;">dst</TD>
53      <TD width="522">Points to the transfer destination memory address where read data is stored.</TD>
54    </TR>
55    <TR>
56      <TD style="text-align : center;">len_org</TD>
57      <TD>Indicates the size of data to read (bytes), using the specified value as is.</TD>
58    </TR>
59    <TR>
60      <TD style="text-align : center;">len</TD>
61      <TD>Specifies the size of data to read (bytes), using the value that is adjusted by the file size at the time that the command is called.</TD>
62    </TR>
63  </TBODY>
64</TABLE>
65</CENTER>
66<BR>
67<HR>
68<B>Actions required of this command</B>
69<BLOCKQUOTE>
70<PRE><code>p_file</code> is a handle that always holds file information in <code>prop.file</code>.<br />
71Based on <code>p_file</code>'s <code>prog.file</code> variable, the command makes the following settings:
72
73Transfers <code>len</code> bytes of data from the archive offset position indicated by <code>prop.file.pos</code>, to memory at <code>dst</code>.
74  Adds value of <code>len</code> to <code>prop.file.pos</code>.<br />
75
76  The value len is adjusted from the specified value, taking <code>prop.file.bottom</code> into consideration.
77  If you want to run a special process when a write exceeds the file size,
78  you can use the original value that is stored in <code>len_org</code>.</PRE>
79</BLOCKQUOTE>
80<HR>
81<B>Default Implementation</B>
82<BLOCKQUOTE>Uses the archive read callback function to transfer <code>len</code> bytes from the base offset position indicated by <code>prop.file.pos</code> to <code>dst</code>. Adds value of <code>len</code> to <code>prop.file.pos</code>.<br /></BLOCKQUOTE>
83<HR>
84<B>Command Results</B><BR>
85
86<BLOCKQUOTE>
87<PRE>If <code>FS_RESULT_SUCCESS</code> is returned by the command, it will be determined that the transfer process for <code>len</code> bytes completed properly.
88When anything else is returned by the command, it will be determined that transfer failed due to some error.</PRE>
89</BLOCKQUOTE>
90<HR>
91<B>Functions that use this command</B><BR>
92<BLOCKQUOTE>FS_ReadFile FS_ReadFileAsync</BLOCKQUOTE>
93<h2>See Also</h2>
94<p><code><a href="../fs_archive_type.html">FSArchive</a></code>, <code><a href="../fs_archive_proc_func_type.html">FS_ARCHIVE_PROC_FUNC</a></code>, <code><a href="../fs_command_type_const.html">FS_COMMAND_*</a></code>, <code><a href="../archive/FS_SetArchiveProc.html">FS_SetArchiveProc</a></code></p>
95
96<H2>Revision History</H2>
97<P>2004/07/12 Initial version.</P>
98<hr><p>CONFIDENTIAL</p></body>
99</html>
100