summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2013-02-02 05:03:25 (GMT)
committerH. Peter Anvin <hpa@linux.intel.com>2013-02-02 05:03:25 (GMT)
commitcd0479de803614ba46ee7e6a3d223dddf30e8753 (patch)
tree02f996a1198957c3889a780297c2b3000b2c61b6
parente2b2812508ed47e78889d782df8838a288e5b09b (diff)
downloadabc8000-old-cd0479de803614ba46ee7e6a3d223dddf30e8753.zip
abc8000-old-cd0479de803614ba46ee7e6a3d223dddf30e8753.tar.gz
abc8000-old-cd0479de803614ba46ee7e6a3d223dddf30e8753.tar.bz2
abc8000-old-cd0479de803614ba46ee7e6a3d223dddf30e8753.tar.xz
Update FAT driver to version 0.09b
-rw-r--r--data/sysrom/fat/doc/00index_e.html32
-rw-r--r--data/sysrom/fat/doc/00index_j.html35
-rw-r--r--data/sysrom/fat/doc/css_e.css25
-rw-r--r--data/sysrom/fat/doc/css_j.css26
-rw-r--r--data/sysrom/fat/doc/en/appnote.html153
-rw-r--r--data/sysrom/fat/doc/en/chdir.html57
-rw-r--r--data/sysrom/fat/doc/en/chdrive.html28
-rw-r--r--data/sysrom/fat/doc/en/chmod.html67
-rw-r--r--data/sysrom/fat/doc/en/close.html38
-rw-r--r--data/sysrom/fat/doc/en/dinit.html14
-rw-r--r--data/sysrom/fat/doc/en/dioctl.html32
-rw-r--r--data/sysrom/fat/doc/en/dread.html37
-rw-r--r--data/sysrom/fat/doc/en/dstat.html14
-rw-r--r--data/sysrom/fat/doc/en/dwrite.html30
-rw-r--r--data/sysrom/fat/doc/en/eof.html62
-rw-r--r--data/sysrom/fat/doc/en/error.html62
-rw-r--r--data/sysrom/fat/doc/en/fattime.html10
-rw-r--r--data/sysrom/fat/doc/en/fdisk.html97
-rw-r--r--data/sysrom/fat/doc/en/filename.html44
-rw-r--r--data/sysrom/fat/doc/en/forward.html100
-rw-r--r--data/sysrom/fat/doc/en/getcwd.html48
-rw-r--r--data/sysrom/fat/doc/en/getfree.html69
-rw-r--r--data/sysrom/fat/doc/en/getlabel.html82
-rw-r--r--data/sysrom/fat/doc/en/gets.html30
-rw-r--r--data/sysrom/fat/doc/en/lseek.html103
-rw-r--r--data/sysrom/fat/doc/en/mkdir.html60
-rw-r--r--data/sysrom/fat/doc/en/mkfs.html73
-rw-r--r--data/sysrom/fat/doc/en/mount.html36
-rw-r--r--data/sysrom/fat/doc/en/open.html121
-rw-r--r--data/sysrom/fat/doc/en/opendir.html55
-rw-r--r--data/sysrom/fat/doc/en/printf.html47
-rw-r--r--data/sysrom/fat/doc/en/putc.html24
-rw-r--r--data/sysrom/fat/doc/en/puts.html24
-rw-r--r--data/sysrom/fat/doc/en/rc.html86
-rw-r--r--data/sysrom/fat/doc/en/read.html56
-rw-r--r--data/sysrom/fat/doc/en/readdir.html81
-rw-r--r--data/sysrom/fat/doc/en/rename.html75
-rw-r--r--data/sysrom/fat/doc/en/sdir.html28
-rw-r--r--data/sysrom/fat/doc/en/setlabel.html89
-rw-r--r--data/sysrom/fat/doc/en/sfatfs.html63
-rw-r--r--data/sysrom/fat/doc/en/sfile.html46
-rw-r--r--data/sysrom/fat/doc/en/sfileinfo.html26
-rw-r--r--data/sysrom/fat/doc/en/size.html62
-rw-r--r--data/sysrom/fat/doc/en/stat.html56
-rw-r--r--data/sysrom/fat/doc/en/sync.html38
-rw-r--r--data/sysrom/fat/doc/en/tell.html62
-rw-r--r--data/sysrom/fat/doc/en/truncate.html40
-rw-r--r--data/sysrom/fat/doc/en/unlink.html70
-rw-r--r--data/sysrom/fat/doc/en/utime.html65
-rw-r--r--data/sysrom/fat/doc/en/write.html56
-rw-r--r--data/sysrom/fat/doc/img/f1.pngbin1145 -> 1414 bytes
-rw-r--r--data/sysrom/fat/doc/img/layers3.pngbin0 -> 2379 bytes
-rw-r--r--data/sysrom/fat/doc/img/modules.pngbin0 -> 5034 bytes
-rw-r--r--data/sysrom/fat/doc/img/rwtest3.pngbin0 -> 3011 bytes
-rw-r--r--data/sysrom/fat/doc/ja/appnote.html154
-rw-r--r--data/sysrom/fat/doc/ja/chdir.html63
-rw-r--r--data/sysrom/fat/doc/ja/chdrive.html28
-rw-r--r--data/sysrom/fat/doc/ja/chmod.html69
-rw-r--r--data/sysrom/fat/doc/ja/close.html36
-rw-r--r--data/sysrom/fat/doc/ja/dinit.html14
-rw-r--r--data/sysrom/fat/doc/ja/dioctl.html28
-rw-r--r--data/sysrom/fat/doc/ja/dread.html26
-rw-r--r--data/sysrom/fat/doc/ja/dstat.html12
-rw-r--r--data/sysrom/fat/doc/ja/dwrite.html28
-rw-r--r--data/sysrom/fat/doc/ja/eof.html62
-rw-r--r--data/sysrom/fat/doc/ja/error.html62
-rw-r--r--data/sysrom/fat/doc/ja/fattime.html6
-rw-r--r--data/sysrom/fat/doc/ja/fdisk.html97
-rw-r--r--data/sysrom/fat/doc/ja/filename.html50
-rw-r--r--data/sysrom/fat/doc/ja/forward.html97
-rw-r--r--data/sysrom/fat/doc/ja/getcwd.html48
-rw-r--r--data/sysrom/fat/doc/ja/getfree.html65
-rw-r--r--data/sysrom/fat/doc/ja/getlabel.html82
-rw-r--r--data/sysrom/fat/doc/ja/gets.html28
-rw-r--r--data/sysrom/fat/doc/ja/lseek.html105
-rw-r--r--data/sysrom/fat/doc/ja/mkdir.html60
-rw-r--r--data/sysrom/fat/doc/ja/mkfs.html75
-rw-r--r--data/sysrom/fat/doc/ja/mount.html36
-rw-r--r--data/sysrom/fat/doc/ja/open.html114
-rw-r--r--data/sysrom/fat/doc/ja/opendir.html57
-rw-r--r--data/sysrom/fat/doc/ja/printf.html48
-rw-r--r--data/sysrom/fat/doc/ja/putc.html24
-rw-r--r--data/sysrom/fat/doc/ja/puts.html26
-rw-r--r--data/sysrom/fat/doc/ja/rc.html86
-rw-r--r--data/sysrom/fat/doc/ja/read.html55
-rw-r--r--data/sysrom/fat/doc/ja/readdir.html83
-rw-r--r--data/sysrom/fat/doc/ja/rename.html76
-rw-r--r--data/sysrom/fat/doc/ja/sdir.html28
-rw-r--r--data/sysrom/fat/doc/ja/setlabel.html89
-rw-r--r--data/sysrom/fat/doc/ja/sfatfs.html63
-rw-r--r--data/sysrom/fat/doc/ja/sfile.html46
-rw-r--r--data/sysrom/fat/doc/ja/sfileinfo.html20
-rw-r--r--data/sysrom/fat/doc/ja/size.html62
-rw-r--r--data/sysrom/fat/doc/ja/stat.html60
-rw-r--r--data/sysrom/fat/doc/ja/sync.html36
-rw-r--r--data/sysrom/fat/doc/ja/tell.html62
-rw-r--r--data/sysrom/fat/doc/ja/truncate.html39
-rw-r--r--data/sysrom/fat/doc/ja/unlink.html71
-rw-r--r--data/sysrom/fat/doc/ja/utime.html67
-rw-r--r--data/sysrom/fat/doc/ja/write.html55
-rw-r--r--data/sysrom/fat/doc/updates.txt18
-rw-r--r--data/sysrom/fat/src/00readme.txt14
-rw-r--r--data/sysrom/fat/src/diskio.h46
-rw-r--r--data/sysrom/fat/src/ff.c1002
-rw-r--r--data/sysrom/fat/src/ff.h121
-rw-r--r--data/sysrom/fat/src/ffconf.h30
-rw-r--r--data/sysrom/fat/src/option/cc932.c16
-rw-r--r--data/sysrom/fat/src/option/cc936.c10
-rw-r--r--data/sysrom/fat/src/option/cc949.c10
-rw-r--r--data/sysrom/fat/src/option/cc950.c10
-rw-r--r--data/sysrom/fat/src/option/ccsbcs.c540
-rw-r--r--data/sysrom/fat/src/option/syscall.c42
-rw-r--r--data/sysrom/fat/src/option/unicode.c17
113 files changed, 3976 insertions, 3232 deletions
diff --git a/data/sysrom/fat/doc/00index_e.html b/data/sysrom/fat/doc/00index_e.html
index 0297276..70e45ee 100644
--- a/data/sysrom/fat/doc/00index_e.html
+++ b/data/sysrom/fat/doc/00index_e.html
@@ -3,14 +3,16 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
-<meta name="description" content="Open souece FAT file system module for embedded projects">
+<meta name="description" content="Open source FAT file system module for embedded projects">
+<link rel="start" title="Site Top" href="../../">
+<link rel="up" title="Freewares" href="../../fsw_e.html">
<link rel="alternate" hreflang="ja" title="Japanese version" href="00index_j.html">
<link rel="stylesheet" href="css_e.css" type="text/css" media="screen" title="ELM Default">
-<title>ELM - FatFs Generic File System Module</title>
+<title>FatFs - Generic FAT File System Module</title>
</head>
<body>
-<h1>FatFs Generic File System Module</h1>
+<h1>FatFs - Generic FAT File System Module</h1>
<hr>
<div class="abst">
@@ -45,7 +47,7 @@
<li><a href="en/close.html">f_close</a> - Close a file</li>
<li><a href="en/read.html">f_read</a> - Read file</li>
<li><a href="en/write.html">f_write</a> - Write file</li>
-<li><a href="en/lseek.html">f_lseek</a> - Move read/write pointer, Expand file zize</li>
+<li><a href="en/lseek.html">f_lseek</a> - Move read/write pointer, Expand file size</li>
<li><a href="en/truncate.html">f_truncate</a> - Truncate file size</li>
<li><a href="en/sync.html">f_sync</a> - Flush cached data</li>
<li><a href="en/opendir.html">f_opendir</a> - Open a directory</li>
@@ -57,22 +59,29 @@
<li><a href="en/chmod.html">f_chmod</a> - Change attribute</li>
<li><a href="en/utime.html">f_utime</a> - Change timestamp</li>
<li><a href="en/rename.html">f_rename</a> - Rename/Move a file or directory</li>
-<li><a href="en/mkfs.html">f_mkfs</a> - Create a file system on the drive</li>
-<li><a href="en/forward.html">f_forward</a> - Forward file data to the stream directly</li>
<li><a href="en/chdir.html">f_chdir</a> - Change current directory</li>
<li><a href="en/chdrive.html">f_chdrive</a> - Change current drive</li>
<li><a href="en/getcwd.html">f_getcwd</a> - Retrieve the current directory</li>
+<li><a href="en/getlabel.html">f_getlabel</a> - Get volume label</li>
+<li><a href="en/setlabel.html">f_setlabel</a> - Set volume label</li>
+<li><a href="en/forward.html">f_forward</a> - Forward file data to the stream directly</li>
+<li><a href="en/mkfs.html">f_mkfs</a> - Create a file system on the drive</li>
+<li><a href="en/fdisk.html">f_fdisk</a> - Divide a physical drive</li>
<li><a href="en/gets.html">f_gets</a> - Read a string</li>
<li><a href="en/putc.html">f_putc</a> - Write a character</li>
<li><a href="en/puts.html">f_puts</a> - Write a string</li>
<li><a href="en/printf.html">f_printf</a> - Write a formatted string</li>
+<li><a href="en/tell.html">f_tell</a> - Get the current read/write pointer</li>
+<li><a href="en/eof.html">f_eof</a> - Test for end-of-file on a file</li>
+<li><a href="en/size.html">f_size</a> - Get size of a file</li>
+<li><a href="en/error.html">f_error</a> - Test for an error on a file</li>
</ul>
</div>
<div class="para">
<h3>Disk I/O Interface</h3>
-<p>Since the FatFs module is completely separated from disk I/O layer, it requires following functions at least to access the physical media. When O/S related feature is enabled, it will require process/memory functions in addition. However the low level disk I/O module is not a part of FatFs module so that it must be provided by user. The sample drivers are also available in the resources.</p>
+<p>Since the FatFs module is completely separated from disk I/O layer, it requires following functions at least to access the physical media. When O/S related feature is enabled, it will require process/memory functions in addition. However the low level disk I/O module is not a part of FatFs module, so that it must be provided by user. The sample drivers are also available in the resources.</p>
<ul>
<li><a href="en/dinit.html">disk_initialize</a> - Initialize disk drive</li>
<li><a href="en/dstat.html">disk_status</a> - Get disk status</li>
@@ -89,17 +98,10 @@
<p>The FatFs module is a free software opened for education, research and development. You can use, modify and/or redistribute it for personal projects or commercial products without any restriction under your responsibility. For further information, refer to the application note.</p>
<ul>
<li><a href="http://elm-chan.org/fsw/ff/bd/"><em>FatFs User Forum</em></a></li>
-<li>Read first: <a href="en/appnote.html">FatFs module application note</a></li>
-<li>Download: <a href="ffsample.zip">FatFs sample projects</a> (AVR, PIC24, LPC2000, H8/300H, SH-2A, V850ES and Win32)</li>
-<li><a href="http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/arm_memcards/index.html">ARM-Projects by Martin THOMAS</a> (examples for LPC2000, AT91SAM and STM32)</li>
-<li><a href="http://www.microsoft.com/whdc/system/platform/firmware/fatgen.mspx">FAT32 Specification by Microsoft</a> (The reference document on FAT file system)</li>
-<li><a href="http://elm-chan.org/docs/mmc/mmc_e.html">How to Use MMC/SDC</a></li>
-<li><a href="img/rwtest.png">Benchmark 1</a> (ATmega64/9.2MHz with MMC via SPI, HDD/CFC via GPIO)</li>
-<li><a href="img/rwtest2.png">Benchmark 2</a> (LPC2368/72MHz with MMC via MCI)</li>
+<li>Read first: <a href="en/appnote.html">FatFs module application note</a> <span class="mfd">January 23, 2014</span></li>
</ul>
</div>
-<hr>
</body>
</html>
diff --git a/data/sysrom/fat/doc/00index_j.html b/data/sysrom/fat/doc/00index_j.html
index ecd5cc7..c6df265 100644
--- a/data/sysrom/fat/doc/00index_j.html
+++ b/data/sysrom/fat/doc/00index_j.html
@@ -3,7 +3,9 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<meta http-equiv="Content-Style-Type" content="text/css">
-<meta name="description" content="組み込みシステム向けFATファイル・システム">
+<meta name="description" content="組み込みシステム向け汎用FATファイル・システム">
+<link rel="start" title="Site Top" href="../../index_j.html">
+<link rel="up" title="Freewares" href="../../fsw.html">
<link rel="alternate" hreflang="en" title="英文" href="00index_e.html">
<link rel="stylesheet" href="css_j.css" type="text/css" media="screen" title="ELM Default">
<title>ELM - FatFs 汎用FATファイルシステム・モジュール</title>
@@ -37,7 +39,7 @@
<div class="para">
<h3>上位レイヤ・インターフェース</h3>
-<p>FatFsモジュールは、次のファイル操作関数(API)を提供します。つまり、このリストはFatFsにできることをシンプルに示しています。</p>
+<p>FatFsモジュールは、アプリケーション・レイヤに対し、次のファイル操作関数(API)を提供します。つまり、このリストはFatFsにできることをシンプルに示しています。</p>
<ul>
<li><a href="ja/mount.html">f_mount</a> - ワークエリアの登録・削除</li>
<li><a href="ja/open.html">f_open</a> - ファイルのオープン・作成</li>
@@ -56,27 +58,34 @@
<li><a href="ja/chmod.html">f_chmod</a> - ファイル/ディレクトリの属性の変更</li>
<li><a href="ja/utime.html">f_utime</a> - ファイル/ディレクトリのタイムスタンプの変更</li>
<li><a href="ja/rename.html">f_rename</a> - ファイル/ディレクトリの名前変更・移動</li>
-<li><a href="ja/mkfs.html">f_mkfs</a> - ディスクのフォーマット</li>
<li><a href="ja/chdir.html">f_chdir</a> - カレント・ディレクトリの変更</li>
<li><a href="ja/chdrive.html">f_chdrive</a> - カレント・ドライブの変更</li>
<li><a href="ja/getcwd.html">f_getcwd</a> - カレント・ディレクトリの取得</li>
+<li><a href="ja/getlabel.html">f_getlabel</a> - ボリューム・ラベルの取得</li>
+<li><a href="ja/setlabel.html">f_setlabel</a> - ボリューム・ラベルの設定</li>
<li><a href="ja/forward.html">f_forward</a> - ファイル・データをストリーム関数に転送</li>
+<li><a href="ja/mkfs.html">f_mkfs</a> - 論理ドライブのフォーマット</li>
+<li><a href="ja/fdisk.html">f_fdisk</a> - 物理ドライブの分割</li>
<li><a href="ja/gets.html">f_gets</a> - 文字列の読み出し</li>
<li><a href="ja/putc.html">f_putc</a> - 文字の書き込み</li>
<li><a href="ja/puts.html">f_puts</a> - 文字列の書き込み</li>
<li><a href="ja/printf.html">f_printf</a> - 書式化文字列の書き込み</li>
+<li><a href="ja/tell.html">f_tell</a> - 現在のリード/ライト・ポインタの取得</li>
+<li><a href="ja/eof.html">f_eof</a> - ファイル終端の有無の取得</li>
+<li><a href="ja/size.html">f_size</a> - ファイル・サイズの取得</li>
+<li><a href="ja/error.html">f_error</a> - ファイルのエラーの有無の取得</li>
</ul>
</div>
<div class="para">
<h3>下位レイヤ・インターフェース</h3>
-<p>FatFsモジュールは、物理ドライブ等へのアクセスのため、下位レイヤに少なくとも次のインターフェースを要求します。使用する記録メディアに対応したディスクI/Oモジュールは、ユーザによって用意される必要があります。OS関連機能を有効にしたときは、加えてプロセス・メモリ関連関数も必要になります。資料にドライバを含むサンプル・プロジェクトあり。</p>
+<p>FatFsモジュールは、単なるファイル・システム・レイヤなので、メディア制御レイヤは含まれません。使用するメディアに対応した制御関数は、ユーザによって提供される必要があります。FatFsモジュールは、下位レイヤに対し少なくとも次のインターフェースを要求します。OS関連機能を有効にしたときは、加えてプロセス/メモリ関連関数も必要になります。サンプル・プロジェクトに下位レイヤの実装例を示します。</p>
<ul>
-<li><a href="ja/dinit.html">disk_initialize</a> - ディスク・ドライブの初期化</li>
-<li><a href="ja/dstat.html">disk_status</a> - ディスク・ドライブの状態取得</li>
-<li><a href="ja/dread.html">disk_read</a> - ディスクからの読み込み</li>
-<li><a href="ja/dwrite.html">disk_write</a> - ディスクへの書き込み</li>
+<li><a href="ja/dinit.html">disk_initialize</a> - ドライブの初期化</li>
+<li><a href="ja/dstat.html">disk_status</a> - ドライブの状態取得</li>
+<li><a href="ja/dread.html">disk_read</a> - データの読み出し</li>
+<li><a href="ja/dwrite.html">disk_write</a> - データの書き込み</li>
<li><a href="ja/dioctl.html">disk_ioctl</a> - その他のドライブ制御</li>
<li><a href="ja/fattime.html">get_fattime</a> - 日付・時刻の取得</li>
</ul>
@@ -88,18 +97,10 @@
<p>FatFsモジュールはフリー・ソフトウェアとして教育・研究・開発用に公開しています。どのような利用目的(個人利用から商用まで)でも使用・改変・配布について一切の制限はありませんが、全て利用者の責任の下での利用とします。詳しくはアプリケーション・ノートを参照してください。</p>
<ul>
<li><a href="http://elm-chan.org/fsw/ff/bd/"><em>FatFsユーザ・フォーラム</em></a></li>
-<li>最初に読め: <a href="ja/appnote.html">FatFsモジュール・アプリケーション・ノート</a></li>
-<li>ダウンロード: <a href="ffsample.zip">サンプル・プロジェクト</a> (AVR, PIC24, LPC2000, H8/300H, SH-2A, V850ES and Win32)</li>
-<li><a href="http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/arm_memcards/index.html">ARM-Projects by Martin THOMAS</a> (examples for LPC2000, AT91SAM and STM32)</li>
-<li><a href="http://www.microsoft.com/whdc/system/platform/firmware/fatgen.mspx">FATファイル・システム仕様書 by Microsoft</a> (FATの理解・実装に必要な唯一のリファレンス)</li>
-<li><a href="http://elm-chan.org/docs/fat.html">FATファイル・システム概要</a> (↑を読むためのガイド)</li>
-<li><a href="http://elm-chan.org/docs/mmc/mmc.html">MMCの使いかた</a></li>
-<li><a href="img/rwtest.png">パフォーマンス・テスト1</a> (ATmega64/9.2MHz with MMC via SPI, HDD/CFC via GPIO)</li>
-<li><a href="img/rwtest2.png">パフォーマンス・テスト2</a> (LPC2368/72MHz with MMC via MCI)</li>
+<li>最初に読め: <a href="ja/appnote.html">FatFsモジュール・アプリケーション・ノート</a> <span class="mfd">2013. 1. 24</span></li>
</ul>
</div>
-<hr>
</body>
</html>
diff --git a/data/sysrom/fat/doc/css_e.css b/data/sysrom/fat/doc/css_e.css
index a3603a7..a8a3c7e 100644
--- a/data/sysrom/fat/doc/css_e.css
+++ b/data/sysrom/fat/doc/css_e.css
@@ -3,26 +3,29 @@ body {margin: 8px; background-color: #e0ffff; font-color: black; font-family: se
a:link {color: blue;}
a:visited {color: darkmagenta;}
a:hover {background-color: #a0ffff;}
-a:active {color: darkmagenta; position: relative; top: 1px; left: 1px;}
+a:active {color: darkmagenta; overflow: hidden; outline:none; position: relative; top: 1px; left: 1px;}
abbr {border-width: 1px;}
p {margin: 0 0 0.3em 1em;}
em {font-style: normal; font-weight: bold; margin: 0 0.1em;}
-pre em {font-style: italic; font-weight: normal;}
strong {}
-pre {border: 1px dashed gray; margin: 0.5em 1em; padding: 0.5em; line-height: 1.2em; background-color: white;}
-pre span {color: green;}
-tt {margin: 0 0.2em;}
+pre {border: 1px dashed gray; margin: 0.5em 1em; padding: 0.5em; line-height: 1.2em; font-size: 85%; font-family: "Consolas", "Courier New", monospace; background-color: white;}
+pre span.c {color: green;}
+pre span.k {color: blue;}
+pre span.arg {font-style: italic;}
+tt {margin: 0 0.2em; font-size: 0.85em; font-family: "Consolas", "Courier New", monospace; }
+tt.arg {font-style: italic;}
ol {margin: 0 2.5em;}
ul {margin: 0 2em;}
dl {margin: 0 1em;}
-dt {font-family: monospace;}
-dl.par dt {margin: 0.5em 0 0 0 ; font-style: italic; }
-dl.ret dt {margin: 0.5em 0 0 0 ; font-weight: bold;}
dd {margin: 0 2em;}
+dt {font-size: 0.85em; font-family: "Consolas", "Courier New", monospace;}
+dl.par dt {margin: 0.5em 0 0 0 ; font-style: italic; }
+dl.ret dt {margin: 0.5em 0 0 0 ; font-size: 0.85em; font-family: "Consolas", "Courier New", monospace;}
hr {border-width: 1px; margin: 1em;}
div.abst {font-family: sans-serif;}
div.para {clear: both; font-family: serif;}
+div.ret a {font-size: 0.85em; font-family: "Consolas", "Courier New", monospace; }
.equ {text-indent: 0; margin: 1em 2em 1em;}
.indent {margin-left: 2em;}
.rset {float: right; margin: 0 0 0.5em 0.5em;}
@@ -38,7 +41,7 @@ h1 {line-height: 1em; font-size: 2em; font-family: sans-serif; padding: 0.3em 0
p.hdd {float: right; text-align: right; margin-top: 0.5em;}
hr.hds {clear: both; margin-bottom: 1em;}
-h2 {font-size: 1.5em; color: blueviolet; font-family: sans-serif; margin: 0 0 0.5em;}
+h2 {font-size: 2em; font-family: sans-serif; background-color: #d8d8FF; padding: 0.5em 0.5em; margin: 0 0 0.5em;}
h3 {font-size: 1.5em; font-family: sans-serif; margin: 1.5em 0 0.5em;}
h4 {font-size: 1.2em; font-family: sans-serif; margin: 1em 0 0.2em;}
h5 {font-size: 1em; font-family: sans-serif; margin: 0.5em 0 0em;}
@@ -49,8 +52,8 @@ small {font-size: 80%;}
table {margin: 0.5em 1em; border-collapse: collapse; border: 2px solid black; }
th {background-color: white; border-style: solid; border-width: 1px 1px 2px; border-color: black; padding: 0 3px; vertical-align: top; white-space: nowrap;}
td {background-color: white; border: 1px solid black; padding: 0 3px; vertical-align: top; line-height: 1.3em;}
-table.lst td:first-child {font-family: monospace;}
-table.lst2 td {font-family: monospace;}
+table.lst td:first-child {font-size: 0.85em; font-family: "Consolas", "Courier New", monospace;}
+table.lst2 td {font-size: 0.85em; font-family: "Consolas", "Courier New", monospace;}
table caption {font-family: sans-serif; font-weight: bold;}
tr.lst3 td { border-width: 2px 1px 1px; }
diff --git a/data/sysrom/fat/doc/css_j.css b/data/sysrom/fat/doc/css_j.css
index aee713b..4899609 100644
--- a/data/sysrom/fat/doc/css_j.css
+++ b/data/sysrom/fat/doc/css_j.css
@@ -6,23 +6,25 @@ body {margin: 8px; background-color: #e0ffff; font-color: black; font-family:"M
a:link {color: blue;}
a:visited {color: darkmagenta;}
a:hover {background-color: #a0ffff;}
-a:active {color: darkmagenta; position: relative; top: 1px; left: 1px;}
+a:active {color: darkmagenta; overflow: hidden; outline:none; position: relative; top: 1px; left: 1px;}
abbr {border-width: 1px;}
p {text-indent: 1em; margin: 0 0 0.3em 0.5em;}
em {font-style: normal; font-weight: bold; margin: 0 0.1em;}
-pre em {font-style: italic; font-weight: normal;}
strong {}
-pre {border: 1px dashed gray; margin: 0.5em 1em; padding: 0.5em; line-height: 1.2em; letter-spacing: 0; background-color: white;}
-pre span {color: green;}
-tt {margin: 0 0.2em; letter-spacing: 0;}
+pre {border: 1px dashed gray; margin: 0.5em 1em; padding: 0.5em; line-height: 1.2em; letter-spacing: 0; font-size: 0.85em; font-family: "Consolas", "Courier New", "MS ゴシック", monospace; background-color: white;}
+pre span.c {color: green;}
+pre span.k {color: blue;}
+pre span.arg {font-style: italic;}
+tt {margin: 0 0.2em; letter-spacing: 0; font-size: 0.85em; font-family: "Consolas", "Courier New", "MS ゴシック", monospace;}
+tt.arg {font-style: italic;}
ol {margin: 0 2.5em;}
ul {margin: 0 2em;}
dl {margin: 0 1em;}
-dt {font-family: monospace;}
-dl.par dt {margin: 0.5em 0 0 0 ; font-style: italic; letter-spacing: 0;}
-dl.ret dt {margin: 0.5em 0 0 0 ; font-family: monospace; letter-spacing: 0; font-weight: bold;}
dd {margin: 0 2em;}
+dt {font-size: 0.85em; font-family: "Consolas", "Courier New", "MS ゴシック", monospace;}
+dl.par dt {margin: 0.5em 0 0 0 ; font-style: italic; letter-spacing: 0;}
+dl.ret dt {margin: 0.5em 0 0 0 ; font-size: 0.85em; font-family: "Consolas", "Courier New", "MS ゴシック", monospace; letter-spacing: 0; }
hr {border-width: 1px; margin: 1em;}
div.abst {font-family: "MS Pゴシック",sans-serif;}
div.para {clear: both; font-family: "MS P明朝",serif;}
@@ -41,7 +43,7 @@ h1 {line-height: 1em; font-size: 2em; font-family: sans-serif; padding: 0.3em 0
p.hdd {float: right; text-align: right; margin-top: 0.5em;}
hr.hds {clear: both; margin-bottom: 1em;}
-h2 {font-size: 1.5em; color: blueviolet; font-family: "MS Pゴシック",sans-serif; margin: 0 0 0.5em;}
+h2 {font-size: 2em; font-family: "MS Pゴシック",sans-serif; background-color: #d8d8FF; padding: 0.5em 0.5em; margin: 0 0 0.5em;}
h3 {font-size: 1.5em; font-family: "MS Pゴシック",sans-serif; margin: 1.5em 0 0.5em;}
h4 {font-size: 1.2em; font-family: "MS Pゴシック",sans-serif; margin: 1em 0 0.2em;}
h5 {font-size: 1em; font-family: "MS Pゴシック",sans-serif; margin: 0.5em 0 0em;}
@@ -52,9 +54,9 @@ small {font-size: 80%;}
table {margin: 0.5em 1em; border-collapse: collapse; border: 2px solid black; letter-spacing: 0;}
th {background-color: white; border-style: solid; border-width: 1px 1px 2px; border-color: black; padding: 0 3px; vertical-align: top;}
td {background-color: white; border: 1px solid black; padding: 0 3px; vertical-align: top; line-height: 1.3em;}
-table.lst td:first-child {font-family: monospace; white-space: nowrap;}
-table.lst2 td {font-family: monospace; white-space: nowrap;}
+table.lst td:first-child {font-size: 0.85em; font-family: "Consolas", "Courier New", monospace; white-space: nowrap;}
+table.lst2 td {font-size: 0.85em; font-family: "Consolas", "Courier New", monospace; white-space: nowrap;}
table caption {font-family: sans-serif; font-weight: bold;}
-tr.lst3 td { border-width: 2px 1px 1px; }
+tr.lst3 td {border-width: 2px 1px 1px; }
p.foot {clear: both; text-indent: 0; margin: 1em 0.5em 1em;}
diff --git a/data/sysrom/fat/doc/en/appnote.html b/data/sysrom/fat/doc/en/appnote.html
index 5654bcd..cd9f0c8 100644
--- a/data/sysrom/fat/doc/en/appnote.html
+++ b/data/sysrom/fat/doc/en/appnote.html
@@ -39,28 +39,22 @@ The FatFs module is a middleware which is written in ANSI C (C89). There is no p
The FatFs module assumes that size of char/short/long are 8/16/32 bit and int is 16 or 32 bit. These correspondence are defined in integer.h. This will not be a problem on most compilers. When any conflict with existing definitions is occured, you must resolve it with care.</li>
</ul>
+<h4>System organizations</h4>
+<p>The dependency diagram shown below is a typical configuration of the embedded system with FatFs module.</p>
+<p><img src="../img/modules.png" width="507" height="224" alt="dependency diagram"></p>
+
<h4>Which function is required?</h4>
<p>You need to provide only low level disk I/O functions that required by FatFs module and nothing else. If a working disk module for the target is already existing, you need to write only glue functions to attach it to the FatFs module. If not, you need to port any other disk module or write it from scratch. All defined functions are not that always required. For example, disk write function is not required in read-only configuration. Following table shows which function is required depends on configuration options.</p>
<table class="lst2">
<tr><th>Function</th><th>Required when:</th><th>Note</th></tr>
-<tr><td>disk_initialize</td><td>Always</td><td rowspan="10">Disk I/O functions.<br>Samples available in ffsample.zip.<br>There are many implementations on the web.</td></tr>
-<tr><td>disk_status</td><td>Always</td></tr>
-<tr><td>disk_read</td><td>Always</td></tr>
-<tr><td>disk_write</td><td>_FS_READONLY == 0</td></tr>
-<tr><td>disk_ioctl (CTRL_SYNC)</td><td>_FS_READONLY == 0</td></tr>
-<tr><td>disk_ioctl (GET_SECTOR_COUNT)</td><td>_USE_MKFS == 1</td></tr>
-<tr><td>disk_ioctl (GET_SECTOR_SIZE)</td><td>_MAX_SS &gt;= 1024</td></tr>
-<tr><td>disk_ioctl (GET_BLOCK_SIZE)</td><td>_USE_MKFS == 1</td></tr>
+<tr><td>disk_initialize<br>disk_status<br>disk_read</td><td>Always</td><td rowspan="5">Disk I/O functions.<br>Samples available in ffsample.zip.<br>There are many implementations on the web.</td></tr>
+<tr><td>disk_write<br>get_fattime<br>disk_ioctl (CTRL_SYNC)</td><td>_FS_READONLY == 0</td></tr>
+<tr><td>disk_ioctl (GET_SECTOR_COUNT)<br>disk_ioctl (GET_BLOCK_SIZE)</td><td>_USE_MKFS == 1</td></tr>
+<tr><td>disk_ioctl (GET_SECTOR_SIZE)</td><td>_MAX_SS &gt; 512</td></tr>
<tr><td>disk_ioctl (CTRL_ERASE_SECTOR)</td><td>_USE_ERASE == 1</td></tr>
-<tr><td>get_fattime</td><td>_FS_READONLY == 0</td></tr>
-<tr><td>ff_convert</td><td>_USE_LFN &gt;= 1</td><td rowspan="2">Unicode support functions.<br>Available in option/cc*.c.</td></tr>
-<tr><td>ff_wtoupper</td><td>_USE_LFN &gt;= 1</td></tr>
-<tr><td>ff_cre_syncobj</td><td>_FS_REENTRANT == 1</td><td rowspan="6">O/S dependent functions.<br>Samples available in option/syscall.c.</td></tr>
-<tr><td>ff_del_syncobj</td><td>_FS_REENTRANT == 1</td></tr>
-<tr><td>ff_req_grant</td><td>_FS_REENTRANT == 1</td></tr>
-<tr><td>ff_rel_grant</td><td>_FS_REENTRANT == 1</td></tr>
-<tr><td>ff_mem_alloc</td><td>_USE_LFN == 3</td></tr>
-<tr><td>ff_mem_free</td><td>_USE_LFN == 3</td></tr>
+<tr><td>ff_convert<br>ff_wtoupper</td><td>_USE_LFN &gt;= 1</td><td>Unicode support functions.<br>Available in option/cc*.c.</td></tr>
+<tr><td>ff_cre_syncobj<br>ff_del_syncobj<br>ff_req_grant<br>ff_rel_grant</td><td>_FS_REENTRANT == 1</td><td rowspan="2">O/S dependent functions.<br>Samples available in option/syscall.c.</td></tr>
+<tr><td>ff_mem_alloc<br>ff_mem_free</td><td>_USE_LFN == 3</td></tr>
</table>
</div>
@@ -78,21 +72,23 @@ The FatFs module assumes that size of char/short/long are 8/16/32 bit and int is
</div>
<div class="para" id="memory">
-<h3>Memory Usage (R0.08a)</h3>
+<h3>Memory Usage</h3>
<table class="lst2">
-<tr><th></th><th>AVR</th><th>H8/300H</th><th>PIC24</th><th>V850ES</th><th>SH-2A</th><th>ARM7</th><th>x86</th></tr>
-<tr><td>Compiler</td><td>WinAVR(gcc)</td><td>CH38</td><td>C30(gcc)</td><td>CA850</td><td>SHC</td><td>WinARM(gcc)</td><td>VC6</td></tr>
-<tr><td>_WORD_ACCESS</td><td>1</td><td>0</td><td>0</td><td>1</td><td>0</td><td>0</td><td>1</td></tr>
-<tr class="lst3"><td>text (Full, R/W)</td><td>12646</td><td>10686</td><td>11430</td><td>7732</td><td>8752</td><td>10560</td><td>7545</td></tr>
-<tr> <td>text (Min, R/W)</td><td>8306</td><td>6986</td><td>7413</td><td>4938</td><td>5576</td><td>6680</td><td>4923</td></tr>
-<tr><td>text (Full, R/O)</td><td>5960</td><td>4876</td><td>5250</td><td>3554</td><td>3804</td><td>4688</td><td>3450</td></tr>
-<tr> <td>text (Min, R/O)</td><td>4366</td><td>3770</td><td>3939</td><td>2684</td><td>2940</td><td>3452</td><td>2664</td></tr>
-<tr><td>bss</td><td>D*2 + 2</td><td>D*4 + 2</td><td>D*2 + 2</td><td>D*4 + 2</td><td>D*4 + 2</td><td>D*4 + 2</td><td>D*4 + 2</td></tr>
-<tr><td>Work area<br>(_FS_TINY == 0)</td><td>D*560 +<br>F*544</td><td>D*560 +<br>F*550</td><td>D*560 +<br>F*544</td><td>D*560 +<br>F*550</td><td>D*560 +<br>F*550</td><td>D*560 +<br>F*550</td><td>D*560 +<br>F*550</td></tr>
-<tr><td>Work area<br>(_FS_TINY == 1)</td><td>D*560 +<br>F*32</td><td>D*560 +<br>F*36</td><td>D*560 +<br>F*32</td><td>D*560 +<br>F*36</td><td>D*560 +<br>F*36</td><td>D*560 +<br>F*36</td><td>D*560 +<br>F*36</td></tr>
+<tr><th></th><th>ARM7<small><br>32bit</small></th><th>ARM7<small><br>Thumb</small></th><th>CM3<small><br>Thumb-2</small></th><th>AVR</th><th>H8/300H</th><th>PIC24</th><th>RL78</th><th>V850ES</th><th>SH-2A</th><th>RX600</th><th>IA-32</th></tr>
+<tr><td>Compiler</td><td>GCC</td><td>GCC</td><td>GCC</td><td>GCC</td><td>CH38</td><td>C30</td><td>CC78K0R</td><td>CA850</td><td>SHC</td><td>RXC</td><td>VC6</td></tr>
+<tr><td>_WORD_ACCESS</td><td>0</td><td>0</td><td>0</td><td>1</td><td>0</td><td>0</td><td>0</td><td>1</td><td>0</td><td>1</td><td>1</td></tr>
+<!-- *ARM *Thumb *CM3 *AVR *H8 *PIC24 RL78 *V850ES *SH-2A *RX600 *IA-32 -->
+<tr class="lst3"><td>text (Full, R/W)</td><td>10395</td><td>7037</td><td>6555</td><td>13362</td><td>10609</td><td>11364</td><td>12884</td><td>7814</td><td>8783</td><td>5826</td><td>7659</td></tr>
+<tr> <td>text (Min, R/W)</td> <td>6519</td><td>4747</td><td>4315</td> <td>8608</td> <td>7043</td> <td>7539</td> <td>8860</td><td>5070</td><td>5723</td><td>3821</td><td>5038</td></tr>
+<tr> <td>text (Full, R/O)</td> <td>4563</td><td>3147</td><td>2911</td> <td>6174</td> <td>4925</td> <td>5340</td> <td>6136</td><td>3628</td><td>3863</td><td>2721</td><td>3534</td></tr>
+<tr> <td>text (Min, R/O)</td> <td>3311</td><td>2463</td><td>2209</td> <td>4610</td> <td>3817</td> <td>4029</td> <td>4641</td><td>2762</td><td>3003</td><td>2068</td><td>2722</td></tr>
+<tr> <td>bss</td><td>D*4 + 2</td><td>D*4 + 2</td><td>D*4 + 2</td><td>D*2 + 2</td><td>D*4 + 2</td><td>D*2 + 2</td><td>D*2 + 2</td><td>D*4 + 2</td><td>D*4 + 2</td><td>D*4 + 2</td><td>D*4 + 2</td></tr>
+<tr> <td>Work area<br>(_FS_TINY == 0)</td><td>V*564 +<br>F*550</td><td>V*564 +<br>F*550</td><td>V*564 +<br>F*550</td><td>V*564 +<br>F*544</td><td>V*564 +<br>F*550</td><td>V*564 +<br>F*544</td><td>V*564 +<br>F*544</td><td>V*564 +<br>F*544</td><td>V*564 +<br>F*550</td><td>V*564 +<br>F*550</td><td>V*564 +<br>F*550</td></tr>
+<tr><td>Work area<br>(_FS_TINY == 1)</td><td>V*564 +<br>F*36</td><td>V*564 +<br>F*36</td><td>V*564 +<br>F*36</td><td>V*564 +<br>F*32</td><td>V*564 +<br>F*36</td><td>V*564 +<br>F*32</td><td>V*564 +<br>F*32</td><td>V*564 +<br>F*36</td><td>V*564 +<br>F*36</td><td>V*564 +<br>F*36</td><td>V*564 +<br>F*36</td></tr>
</table>
-<p>These are the memory usage on some target systems with following condition. The memory sizes are in unit of byte, D means number of volumes and F means number of open files. All samples are optimezed in code size.</p>
+<p>These are the memory usage on some target systems with following condition. The memory sizes are in unit of byte, <em>V</em> means number of mounted volumes and <em>F</em> means number of open files. All samples are optimezed in code size.</p>
<pre>
+FatFs R0.09b options:
_FS_READONLY 0 (R/W), 1 (R/O)
_FS_MINIMIZE 0 (Full function), 3 (Minimized function)
_USE_STRFUNC 0 (Disable string functions)
@@ -102,10 +98,12 @@ _USE_FASTSEEK 0 (Disable fast seek feature)
_CODE_PAGE 932 (Japanese Shift-JIS)
_USE_LFN 0 (Disable LFN)
_MAX_SS 512 (Fixed sector size)
-_FS_RPATH 0 (Disable relative path)
+_FS_RPATH 0 (Disable relative path feature)
+_FS_LABEL 0 (Disable volume label functions)
+_VOLUMES D (Number of logical drives to be used)
_MULTI_PARTITION 0 (Single partition per drive)
_FS_REENTRANT 0 (Disable reentrancy)
-_FS_SHARE 0 (Disable shareing control)
+_FS_LOCK 0 (Disable shareing control)
</pre>
</div>
@@ -113,34 +111,37 @@ _FS_SHARE 0 (Disable shareing control)
<h3>Module Size Reduction</h3>
<p>Follwing table shows which API function is removed by configuration options for the module size reduction.</p>
<table class="lst2">
-<tr><td rowspan="2">Function</td><td colspan="3">_FS_MINIMIZE</td><td>_FS_READONLY</td><td>_USE_STRFUNC</td><td colspan="2">_FS_RPATH</td><td>_USE_MKFS</td><td>_USE_FORWARD</td></tr>
-<tr><td>1</td><td>2</td><td>3</td><td>1</td><td>0</td><td>0</td><td>1</td><td>0</td><td>0</td></tr>
-<tr class="lst3"><td>f_mount</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_open</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_close</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_read</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_write</td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_sync</td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_lseek</td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_opendir</td><td></td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_readdir</td><td></td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_stat</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_getfree</td><td>x</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_truncate</td><td>x</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_unlink</td><td>x</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_mkdir</td><td>x</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_chmod</td><td>x</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_utime</td><td>x</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_rename</td><td>x</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_chdir</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td></tr>
-<tr><td>f_chdrive</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td></tr>
-<tr><td>f_getcwd</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td>x</td><td></td><td></td></tr>
-<tr><td>f_mkfs</td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td>x</td><td></td></tr>
-<tr><td>f_forward</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>x</td></tr>
-<tr><td>f_putc</td><td></td><td></td><td></td><td>x</td><td>x</td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_puts</td><td></td><td></td><td></td><td>x</td><td>x</td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_printf</td><td></td><td></td><td></td><td>x</td><td>x</td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_gets</td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td></tr>
+<tr><td rowspan="2">Function</td><td colspan="4">_FS_MINIMIZE</td><td colspan="2">_FS_READONLY</td><td colspan="2">_USE_STRFUNC</td><td colspan="3">_FS_RPATH</td><td colspan="2">_FS_LABEL</td><td colspan="2">_USE_MKFS</td><td colspan="2">_USE_FORWARD</td><td colspan="2">_MULTI_PARTITION</td></tr>
+<tr><td>0</td><td>1</td><td>2</td><td>3</td><td>0</td><td>1</td><td>0&nbsp;&nbsp;</td><td>1/2</td><td>0</td><td>1</td><td>2</td><td>0</td><td>1</td><td>0</td><td>1</td><td>0</td><td>1</td><td>0</td><td>1</td></tr>
+<tr class="lst3"><td>f_mount</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_open</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_close</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_read</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_write</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_sync</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_lseek</td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_opendir</td><td></td><td></td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_readdir</td><td></td><td></td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_stat</td><td></td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_getfree</td><td></td><td>x</td><td>x</td><td>x</td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_truncate</td><td></td><td>x</td><td>x</td><td>x</td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_unlink</td><td></td><td>x</td><td>x</td><td>x</td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_mkdir</td><td></td><td>x</td><td>x</td><td>x</td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_chmod</td><td></td><td>x</td><td>x</td><td>x</td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_utime</td><td></td><td>x</td><td>x</td><td>x</td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_rename</td><td></td><td>x</td><td>x</td><td>x</td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_chdir</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_chdrive</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_getcwd</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_getlabel</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_setlabel</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_forward</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td></tr>
+<tr><td>f_mkfs</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_fdisk</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td>x</td><td></td></tr>
+<tr><td>f_putc</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_puts</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_printf</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_gets</td><td></td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
</table>
</div>
@@ -156,34 +157,34 @@ _FS_SHARE 0 (Disable shareing control)
<tr><td>949(Korean)</td><td>+139K</td></tr>
<tr><td>950(Big5)</td><td>+111K</td></tr>
</table>
-<p>When the LFN feature is enabled, the module size will be increased depends on the selected code page. Right table shows how many bytes increased when LFN feature is enabled with some code pages. We are the Japanese, Chinese and Korean have tens of thousands of characters. Unfortunately, it requires a huge OEM-Unicode bidirectional conversion table and the module size will be drastically increased that shown in the table. As the result, the FatFs with LFN feature with DBCS will not able to be implemented to most 8-bit microcontrollers. <small>This is the reason why I had not been interested in implementing the LFN feature for a long time :-)</small></p>
-<p>Note that the LFN feature on the FAT file system is a patent of Microsoft Corporation. When enable it on the commercial products, a license from Microsoft may be required depends on the final destination.</p>
+<p>When the LFN feature is enabled, the module size will be increased depends on the selected code page. Right table shows how many bytes increased when LFN feature is enabled with some code pages. Especially, in the CJK region, tens of thousands of characters are being used. Unfortunately, it requires a huge OEM-Unicode bidirectional conversion table and the module size will be drastically increased that shown in the table. As the result, the FatFs with LFN feature with those code pages will not able to be implemented to most 8-bit microcontrollers.</p>
+<p>Note that the LFN feature on the FAT file system is a patent of Microsoft Corporation. This is not the case on FAT32 but most FAT32 drivers include the LFN feature. FatFs can swich the LFN feature off by configuration option. When enable LFN feature on the commercial products, a license from Microsoft may be required depends on the final destination.</p>
</div>
<div class="para" id="unicode">
<h3>Unicode API</h3>
-<p>FatFs supports ANSI/OEM code set on the API in default but FatFs can also switch the code set to Unicode. For more information, refer to the description in the <a href="filename.html">file name</a>.</p>
+<p>In default, FatFs supports ANSI/OEM code set on the API but FatFs can also switch the code set to Unicode. This means the FatFs supports the True LFN feature. For more information, refer to the description in the <a href="filename.html">file name</a>.</p>
</div>
<div class="para" id="reentrant">
<h3>Re-entrancy</h3>
-<p>The file operations to the different volume is always re-entrant ant can work simultaneously. The file operations to the same volume is not re-entrant but it can also be configured to thread-safe with <tt>_FS_REENTRANT</tt> option. In this case, also the OS dependent synchronization object control functions, ff_cre_syncobj, ff_del_syncobj, ff_req_grant and ff_rel_grant must be added to the project.</p>
-<p>When a file function is called while the volume is in use by any other task, the access is blocked until the task leaves file function. If wait time exceeded a period defined by <tt>_TIMEOUT</tt>, the file function will abort with <tt>FR_TIMEOUT</tt>. The timeout feature might not be supported on some RTOS.</p>
-<p>There is an exception on f_mount and f_mkfs function. These functions are not re-entrant to the same volume. When use these functions, all other task must close the corresponding file on the volume and avoid to access the volume.</p>
-<p>Note that this section describes on the re-entrancy of the FatFs module itself. There is no assumtion on the re-entrancy of low level disk I/O module.</p>
+<p>The file operations to the different volume is always re-entrant and can work simultaneously. The file operations to the same volume is not re-entrant but it can also be configured to thread-safe with <tt>_FS_REENTRANT</tt> option. In this case, also the OS dependent synchronization object control functions, <tt>ff_cre_syncobj(), ff_del_syncobj(), ff_req_grant() and ff_rel_grant()</tt> must be added to the project.</p>
+<p>When a file function is called while the volume is in use by any other task, the file function is suspended until that task leaves file function. If wait time exceeded a period defined by <tt>_TIMEOUT</tt>, the file function will abort with <tt>FR_TIMEOUT</tt>. The timeout feature might not be supported on some RTOS.</p>
+<p>There is an exception on <tt>f_mount()</tt> and <tt>f_mkfs()</tt> function. These functions are not re-entrant to the same volume. When use these functions, all other task must close the corresponding file on the volume and avoid to access the volume.</p>
+<p>Note that this section describes on the re-entrancy of the FatFs module itself but also the low level disk I/O layer must be re-entrant.</p>
</div>
<div class="para" id="dup">
<h3>Duplicated File Access</h3>
-<p>FatFs module does not support the shareing controls of duplicated file access in default. It is permitted when open method to a file is only read mode. The duplicated open in write mode to a file is always prohibited and open file must not be renamed, deleted, otherwise the FAT structure on the volume can be collapted. Also current directory must not be deleted.</p>
-<p>The file shareing control can also be available when <tt>_FS_SHARE</tt> is set to 1 or grater. In this case, if any open, rename or remove that violating the file shareing rule that described above is attempted, the file function will fail with <tt>FR_LOCKED</tt>.</p>
+<p>FatFs module does not support the shareing controls of duplicated file access in default. It is permitted when open method to a file is only read mode. The duplicated open in write mode to a file is always prohibited and open file must not be renamed, deleted, or the FAT structure on the volume can be collapted.</p>
+<p>The file shareing control can also be available when <tt>_FS_LOCK</tt> is set to 1 or grater. The value specifies the number of files to manage simultaneously. In this case, if any open, rename or remove that violating the file shareing rule that described above is attempted, the file function will fail with <tt>FR_LOCKED</tt>. If number of open files gets larger than <tt>_FS_LOCK</tt>, the <tt>f_open()</tt> function will fail with <tt>FR_TOO_MANY_OPEN_FILES</tt>.</p>
</div>
<div class="para" id="fs1">
<h3>Performance Effective File Access</h3>
-<p>For good performance on reading/writing files on the small embedded system, application programmer should consider what process is done in the FatFs module. The file data on the disk is transferred in following sequence by f_read function.</p>
+<p>For good performance on reading/writing files on the small embedded system, application programmer should consider what process is done in the FatFs module. The file data on the disk is transferred in following sequence by <tt>f_read()</tt> function.</p>
<p>Figure 1. Sector miss-aligned read (short)<br>
-<img src="../img/f1.png" width="490" height="73" alt="">
+<img src="../img/f1.png" width="490" height="110" alt="">
</p>
<p>Figure 2. Sector miss-aligned read (long)<br>
<img src="../img/f2.png" width="490" height="140" alt="">
@@ -192,7 +193,7 @@ _FS_SHARE 0 (Disable shareing control)
<img src="../img/f3.png" width="490" height="119" alt="">
</p>
<p>The file I/O buffer means a sector buffer to read/write a partial data on the sector. The sector buffer is either file private sector buffer on each file object or shared sector buffer on the file system object. The buffer configuration option <tt>_FS_TINY</tt> determins which sector buffer is used for the file data transfer. When tiny buffer (1) is selected, data memory consumption is reduced 512 bytes each file object. In this case, FatFs module uses only a sector buffer on the file system object for file data transfer and FAT/directory access. The disadvantage of the tiny buffer configuration is: the FAT data cached in the sector buffer will be lost by file data transfer and it must be reloaded at every cluster boundary. However it will be suitable for most application from view point of the decent performance and low memory comsumption.</p>
-<p>Figure 1 shows that partial sector data is transferred via the file I/O buffer. On long data transfer shown in Figure 2, middle of transfer data that covers one or more sector is transferred to application buffer directly. Figure 3 shows that the case of entier transfer data is aligned to the sector boundary. In this case, file I/O buffer is not used. On the direct transfer, the maximum extent of sectors are read with disk_read function at a time but the multi sector transfer never across the cluster boundary even if it is contiguous.</p>
+<p>Figure 1 shows that partial sector data is transferred via the file I/O buffer. On long data transfer shown in Figure 2, middle of transfer data that covers one or more sector is transferred to application buffer directly. Figure 3 shows that the case of entier transfer data is aligned to the sector boundary. In this case, file I/O buffer is not used. On the direct transfer, the maximum extent of sectors are read with <tt>disk_read()</tt> function at a time but the multi sector transfer never across the cluster boundary even if it is contiguous.</p>
<p>Therefore taking effort to sector aligned read/write accesss avoids buffered data transfer and the read/write performance will be improved. Besides the effect, cached FAT data will not be flushed by file data transfer on the tiny configuration so that it can achieve same performance as non-tiny configuration with small memory footprint.</p>
</div>
@@ -204,9 +205,9 @@ _FS_SHARE 0 (Disable shareing control)
Figure 6. Comparison between Multiple/Single Sector Write<br>
<img src="../img/f6.png" width="630" height="148" alt="fig.6">
</div>
-<p>The write throughput of the flash memory media becomes the worst at single sector write and it increases proportional to the number of sectors per a write transaction. This effect more appers at more fast bus clock and its ratio often becomes grater than ten. The number of write transaction also affects the life time of the media. Therefore the application program should write the data in large block as possible. The ideal block size is cluster size or power of 2 bytes and the byte offset should be aligned to the block. Of course all layers between the application and the media must support multiple sector write feature, however most of open-source disk drivers lack it. Do not split a multiple sector write request into single sector writes or the write throughput gets poor. Note that FatFs module and its sample disk drivers supprt multiple sector read/write.</p>
+<p>The write throughput of the flash memory media becomes the worst at single sector write and it increases proportional to the number of sectors per a write transaction. This effect more appers at more fast bus clock and its ratio often becomes grater than ten. The number of write transaction also affects the life time of the media. Therefore the application program should write the data in large block as possible. The ideal block size is cluster size or power of 2 bytes and the byte offset should be aligned to the block. Of course all layers between the application and the media must support multiple sector write feature, however most of open-source disk drivers lack it. Do not split a multiple sector write request into single sector writes or the write throughput gets poor. Note that FatFs module and its sample disk drivers supprt multiple sector read/write feature.</p>
<h4>Forcing Memory Erase</h4>
-<p>When remove a file via f_remove function, the data clusters occupied by the file are maeked 'free' on the FAT. But the data sectors containing the file data are not that applied any process so that the file data left occupies a part of the media as live blocks. If the file data is forced erased on removing the file, the number of free blocks on the media will be increased. This may skip internal block erase operation to the data block on next write. As the result the write performance might be improved. To enable this feature, set <tt>_USE_ERASE</tt> to 1. Note that this is a feature with expectation of internal process of the flash memory media. It may not always effective and f_remove function will take a time on removing a large file.</p>
+<p>When remove a file with <tt>f_remove()</tt> function, the data clusters occupied by the file are marked 'free' on the FAT. But the data sectors containing the file data are not that applied any process, so that the file data left occupies a part of the flash memory array as live blocks. If the file data is forced erased on removing the file, the number of free blocks on the flash memory will be increased. This may skip internal block erase operation to the data block on next write. As the result the write performance might be improved. To enable this feature, set <tt>_USE_ERASE</tt> to 1. Note that this is a feature with expectation of internal process of the flash memory media. It may not always effective and f_remove function will take a time on removing a large file.</p>
</div>
<div class="para" id="critical">
@@ -229,20 +230,20 @@ Figure 5. Minimized critical section<br>
<li>A file created as new or in overwritten remains with no content.</li>
<li>Efficiency of disk use gets worse due to lost clusters.</li>
</ul>
-<p>Each case does not affect the files that not in write mode open. To minimize risk of data loss, the critical section can be minimized like shown in Figure 5 by minimizing the time that file is opened in write mode or using f_sync function properly.</p>
+<p>Each case does not affect the files that not in write mode open. To minimize risk of data loss, the critical section can be minimized like shown in Figure 5 by minimizing the time that file is opened in write mode or using <tt>f_sync()</tt> function properly.</p>
</div>
<div class="para" id="license">
<h3>About FatFs License</h3>
<p>This is a copy of the FatFs license document that included in the source codes.</p>
<pre>/*----------------------------------------------------------------------------/
-/ FatFs - FAT file system module R0.08a (C)ChaN, 2010
+/ FatFs - FAT file system module R0.09b (C)ChaN, 2013
/-----------------------------------------------------------------------------/
/ FatFs module is a generic FAT file system module for small embedded systems.
/ This is a free software that opened for education, research and commercial
/ developments under license policy of following trems.
/
-/ Copyright (C) 2010, ChaN, all right reserved.
+/ Copyright (C) 2013, ChaN, all right reserved.
/
/ * The FatFs module is a free software and there is NO WARRANTY.
/ * No restriction on use. You can use, modify and redistribute it for
diff --git a/data/sysrom/fat/doc/en/chdir.html b/data/sysrom/fat/doc/en/chdir.html
index ba56cc7..f65b8be 100644
--- a/data/sysrom/fat/doc/en/chdir.html
+++ b/data/sysrom/fat/doc/en/chdir.html
@@ -11,74 +11,67 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_chdir</h2>
<p>The f_chdir function changes the current directory of a drive.</p>
<pre>
FRESULT f_chdir (
- const TCHAR* <em>Path</em> <span>/* Pointer to the path name */</span>
+ const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] Path name */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>Path</dt>
+<dt>path</dt>
<dd>Pointer to the null-terminated string that specifies a <a href="filename.html">directory</a> to go.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>The function succeeded.</dd>
-<dt>FR_NO_PATH</dt>
-<dd>Could not find the path.</dd>
-<dt>FR_INVALID_NAME</dt>
-<dd>The path name is invalid.</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>The drive number is invalid.</dd>
-<dt>FR_NOT_READY</dt>
-<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>The function failed due to an error in the disk function.</dd>
-<dt>FR_INT_ERR</dt>
-<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>The logical drive has no work area.</dd>
-<dt>FR_NO_FILESYSTEM</dt>
-<dd>There is no valid FAT volume on the drive.</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#np">FR_NO_PATH</a>,
+<a href="rc.html#in">FR_INVALID_NAME</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>,
+<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The f_chdir function changes the current directory of the logical drive. The current directory of a drive is initialized to the root directory when the drive is auto-mounted. Note that the current directory is retained in the each file system object so that it also affects other tasks that using the drive.</p>
+<p>The <tt>f_chdir()</tt> function changes the current directory of the logical drive. The current directory of a drive is initialized to the root directory when the drive is auto-mounted. Note that the current directory is retained in the each file system object so that it also affects other tasks that using the drive.</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_FS_RPATH >= 1</tt>.</p>
</div>
-<div class="para">
+<div class="para use">
<h4>Example</h4>
<pre>
- <span>/* Change current direcoty of the current drive (dir1 under root dir) */</span>
+ <span class="c">/* Change current direcoty of the current drive (dir1 under root dir) */</span>
f_chdir("/dir1");
- <span>/* Change current direcoty of drive 2 (parent dir) */</span>
+ <span class="c">/* Change current direcoty of drive 2 (parent dir) */</span>
f_chdir("2:..");
</pre>
</div>
-<div class="para">
+<div class="para ref">
<h4>See Also</h4>
<p><tt><a href="chdrive.html">f_chdrive</a>, <a href="getcwd.html">f_getcwd</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/en/chdrive.html b/data/sysrom/fat/doc/en/chdrive.html
index acb04a0..7f4f5d3 100644
--- a/data/sysrom/fat/doc/en/chdrive.html
+++ b/data/sysrom/fat/doc/en/chdrive.html
@@ -11,48 +11,46 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_chdrive</h2>
<p>The f_chdrive function changes the current drive.</p>
<pre>
FRESULT f_chdrive (
- BYTE <em>Drive</em> <span>/* Logical drive number */</span>
+ BYTE <span class="arg">drv</span> <span class="c">/* [IN] Logical drive number */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>Drive</dt>
+<dt>drv</dt>
<dd>Specifies the <a href="filename.html">logical drive number</a> to be set as the current drive.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>The function succeeded.</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>The drive number is invalid.</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The f_chdrive function changes the current drive. The initial value of the current drive number is 0. Note that the current drive is retained in a static variable so that it also affects other tasks that using the file functions.</p>
+<p>The <tt>f_chdrive()</tt> function changes the current drive. The initial value of the current drive number is 0. Note that the current drive is retained in a static variable so that it also affects other tasks that using the file functions.</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_FS_RPATH >= 1</tt>.</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>See Also</h4>
<p><tt><a href="chdir.html">f_chdir</a>, <a href="getcwd.html">f_getcwd</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/en/chmod.html b/data/sysrom/fat/doc/en/chmod.html
index 78b7961..db35d3b 100644
--- a/data/sysrom/fat/doc/en/chmod.html
+++ b/data/sysrom/fat/doc/en/chmod.html
@@ -11,24 +11,24 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_chmod</h2>
<p>The f_chmod function changes the attribute of a file or directory.</p>
<pre>
FRESULT f_chmod (
- const TCHAR* <em>FileName</em>, <span>/* Pointer to the file or directory */</span>
- BYTE <em>Attribute</em>, <span>/* Attribute flags */</span>
- BYTE <em>AttributeMask</em> <span>/* Attribute masks */</span>
+ const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] Object name */</span>
+ BYTE <span class="arg">attr</span>, <span class="c">/* [IN] Attribute flags */</span>
+ BYTE <span class="arg">mask</span> <span class="c">/* [IN] Attribute masks */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>FileName</dt>
+<dt>path</dt>
<dd>Pointer to the null-terminated string that specifies a <a href="filename.html">file or directory</a> to be changed</dd>
-<dt>Attribute</dt>
+<dt>attr</dt>
<dd>Attribute flags to be set in one or more combination of the following flags. The specified flags are set and others are cleard.<br>
<table class="lst">
<tr><th>Attribute</th><th>Description</th></tr>
@@ -38,57 +38,48 @@ FRESULT f_chmod (
<tr><td>AM_HID</td><td>Hidden</td></tr>
</table>
</dd>
-<dt>AttributeMask</dt>
+<dt>mask</dt>
<dd>Attribute mask that specifies which attribute is changed. The specified aattributes are set or cleard.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>The function succeeded.</dd>
-<dt>FR_NO_FILE</dt>
-<dd>Could not find the file.</dd>
-<dt>FR_NO_PATH</dt>
-<dd>Could not find the path.</dd>
-<dt>FR_INVALID_NAME</dt>
-<dd>The file name is invalid.</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>The drive number is invalid.</dd>
-<dt>FR_NOT_READY</dt>
-<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
-<dt>FR_WRITE_PROTECTED</dt>
-<dd>The medium is write protected.</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>The function failed due to an error in the disk function.</dd>
-<dt>FR_INT_ERR</dt>
-<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>The logical drive has no work area.</dd>
-<dt>FR_NO_FILESYSTEM</dt>
-<dd>There is no valid FAT volume on the drive.</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#ok">FR_NO_FILE</a>,
+<a href="rc.html#np">FR_NO_PATH</a>,
+<a href="rc.html#in">FR_INVALID_NAME</a>,
+<a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>,
+<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The f_chmod function changes the attribute of a file or directory.</p>
+<p>The <tt>f_chmod()</tt> function changes the attribute of a file or directory.</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_FS_MINIMIZE == 0</tt>.</p>
</div>
-<div class="para">
+<div class="para use">
<h4>Example</h4>
<pre>
- <span>/* Set read-only flag, clear archive flag and others are retained. */</span>
+ <span class="c">/* Set read-only flag, clear archive flag and others are retained. */</span>
f_chmod("file.txt", AR_RDO, AR_RDO | AR_ARC);
</pre>
</div>
diff --git a/data/sysrom/fat/doc/en/close.html b/data/sysrom/fat/doc/en/close.html
index 4b88670..2af3c94 100644
--- a/data/sysrom/fat/doc/en/close.html
+++ b/data/sysrom/fat/doc/en/close.html
@@ -11,55 +11,51 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_close</h2>
<p>The f_close function closes an open file.</p>
<pre>
FRESULT f_close (
- FIL* <em>FileObject</em> <span>/* Pointer to the file object structure */</span>
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] Pointer to the file object */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameter</h4>
<dl class="par">
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>Pointer to the open file object structure to be closed.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>The file object has been closed successfuly.</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>The function failed due to an error in the disk function.</dd>
-<dt>FR_INT_ERR</dt>
-<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
-<dt>FR_NOT_READY</dt>
-<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
-<dt>FR_INVALID_OBJECT</dt>
-<dd>The file object is invalid.</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#io">FR_INVALID_OBJECT</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The f_close function closes an open file object. If any data has been written to the file, the cached information of the file is written back to the disk. After the function succeeded, the file object is no longer valid and it can be discarded.</p>
+<p>The <tt>f_close()</tt> function closes an open file object. If any data has been written to the file, the cached information of the file is written back to the disk. After the function succeeded, the file object is no longer valid and it can be discarded.</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Always available.</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>See Also</h4>
<p><tt><a href="open.html">f_open</a>, <a href="read.html">f_read</a>, <a href="write.html">f_write</a>, <a href="sync.html">f_sync</a>, <a href="sfile.html">FIL</a>, <a href="sfatfs.html">FATFS</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/en/dinit.html b/data/sysrom/fat/doc/en/dinit.html
index fbbe393..5eb8fa9 100644
--- a/data/sysrom/fat/doc/en/dinit.html
+++ b/data/sysrom/fat/doc/en/dinit.html
@@ -11,34 +11,34 @@
<body>
-<div class="para">
+<div class="para func">
<h2>disk_initialize</h2>
<p>The disk_initialize function initializes the disk drive.</p>
<pre>
DSTATUS disk_initialize (
- BYTE <em>Drive</em> <span>/* Physical drive number */</span>
+ BYTE <span class="arg">pdrv</span> <span class="c">/* [IN] Physical drive number */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameter</h4>
<dl class="par">
-<dt>Drive</dt>
+<dt>pdrv</dt>
<dd>Specifies the physical drive number to initialize.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
<p>This function returns a disk status as the result. For details of the disk status, refer to the <a href="dstat.html">disk_status</a> function.</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
<p>The disk_initialize function initializes a physical drive and put it ready to read/write. When the function succeeded, <tt>STA_NOINIT</tt> flag in the return value is cleard.</p>
-<p><em>Application program should not call this function, or FAT structure on the volume can be collapted. To re-initialize the file system, use f_mount function.</em>This function is called on volume mount process in the FatFs module to manage the media change.</p>
+<p><em>Application program MUST NOT call this function, or FAT structure on the volume can be corrapted. To re-initialize the file system, use f_mount function instead.</em>This function is called on volume mount process in the FatFs module to manage the media change.</p>
</div>
<p class="foot"><a href="../00index_e.html">Return</a></p>
diff --git a/data/sysrom/fat/doc/en/dioctl.html b/data/sysrom/fat/doc/en/dioctl.html
index d049afc..6a06dd7 100644
--- a/data/sysrom/fat/doc/en/dioctl.html
+++ b/data/sysrom/fat/doc/en/dioctl.html
@@ -11,32 +11,32 @@
<body>
-<div class="para">
+<div class="para func">
<h2>disk_ioctl</h2>
-<p>The disk_ioctl function cntrols device specified features and miscellaneous functions other than disk read/write.</p>
+<p>The disk_ioctl function cntrols device specific features and miscellaneous functions other than generic read/write.</p>
<pre>
DRESULT disk_ioctl (
- BYTE <em>Drive</em>, <span>/* Drive number */</span>
- BYTE <em>Command</em>, <span>/* Control command code */</span>
- void* <em>Buffer</em> <span>/* Parameter and data buffer */</span>
+ BYTE <span class="arg">pdrv</span>, <span class="c">/* [IN] Drive number */</span>
+ BYTE <span class="arg">cmd</span>, <span class="c">/* [IN] Control command code */</span>
+ void* <span class="arg">buff</span> <span class="c">/* [I/O] Parameter and data buffer */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>Drive</dt>
+<dt>pdrv</dt>
<dd>Specifies the drive number (0-9).</dd>
-<dt>Command</dt>
+<dt>cmd</dt>
<dd>Specifies the command code.</dd>
-<dt>Buffer</dt>
+<dt>buff</dt>
<dd>Pointer to the parameter buffer depends on the command code. When it is not used, specify a NULL pointer.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Value</h4>
<dl class="ret">
<dt>RES_OK (0)</dt>
@@ -44,23 +44,23 @@ DRESULT disk_ioctl (
<dt>RES_ERROR</dt>
<dd>Any error occured.</dd>
<dt>RES_PARERR</dt>
-<dd>Invalid command code.</dd>
+<dd>Invalid command code or parameter.</dd>
<dt>RES_NOTRDY</dt>
<dd>The disk drive has not been initialized.</dd>
</dl>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
<p>The FatFs module uses only device independent commands described below. Any device dependent function is not used.</p>
<table class="lst">
<tr><th>Command</th><th>Description</th></tr>
<tr><td>CTRL_SYNC</td><td>Make sure that the disk drive has finished pending write process. When the disk I/O module has a write back cache, flush the dirty sector immediately. This command is not used in read-only configuration.</td></tr>
-<tr><td>GET_SECTOR_SIZE</td><td>Returns sector size of the drive into the WORD variable pointed by <tt>Buffer</tt>. This command is not used in fixed sector size configuration, <tt>_MAX_SS</tt> is 512.</td></tr>
-<tr><td>GET_SECTOR_COUNT</td><td>Returns number of available sectors on the drive into the DWORD variable pointed by <tt>Buffer</tt>. This command is used by only f_mkfs function to determine the volume size to be created.</td></tr>
-<tr><td>GET_BLOCK_SIZE</td><td>Returns erase block size of the flash memory in unit of sector into the DWORD variable pointed by <tt>Buffer</tt>. The allowable value is 1 to 32768 in power of 2. Return 1 if the erase block size is unknown or disk devices. This command is used by only f_mkfs function and it attempts to align data area to the erase block boundary.</td></tr>
-<tr><td>CTRL_ERASE_SECTOR</td><td>Erases a part of the flash memory specified by a DWORD array {&lt;start sector&gt;, &lt;end sector&gt;} pointed by <tt>Buffer</tt>. When this feature is not supported or not a flash memory media, this command has no effect. The FatFs does not check the result code and the file function is not affected even if the sectors are not erased well. This command is called on removing a cluster chain when <tt>_USE_ERASE</tt> is 1.</td></tr>
+<tr><td>GET_SECTOR_SIZE</td><td>Returns sector size of the drive into the <tt>WORD</tt> variable pointed by <tt>Buffer</tt>. This command is not used in fixed sector size configuration, <tt>_MAX_SS</tt> is 512.</td></tr>
+<tr><td>GET_SECTOR_COUNT</td><td>Returns number of available sectors on the drive into the <tt>DWORD</tt> variable pointed by <tt class="arg">buff</tt>. This command is used by only <tt>f_mkfs()</tt> function to determine the volume size to be created.</td></tr>
+<tr><td>GET_BLOCK_SIZE</td><td>Returns erase block size of the flash memory in unit of sector into the <tt>DWORD</tt> variable pointed by <tt class="arg">buff</tt>. The allowable value is 1 to 32768 in power of 2. Return 1 if the erase block size is unknown or disk devices. This command is used by only <tt>f_mkfs()</tt> function and it attempts to align data area to the erase block boundary.</td></tr>
+<tr><td>CTRL_ERASE_SECTOR</td><td>Erases a part of the flash memory specified by a <tt>DWORD</tt> array {&lt;start sector&gt;, &lt;end sector&gt;} pointed by <tt class="arg">buff</tt>. This is similar command to Trim command of ATA command set. When this feature is not supported or not a flash memory media, this command has no effect. The FatFs does not check the result code and the file function is not affected even if the sectors are not erased well. This command is called on removing a cluster chain when <tt>_USE_ERASE</tt> is 1.</td></tr>
</table>
</div>
diff --git a/data/sysrom/fat/doc/en/dread.html b/data/sysrom/fat/doc/en/dread.html
index ca26548..e82696d 100644
--- a/data/sysrom/fat/doc/en/dread.html
+++ b/data/sysrom/fat/doc/en/dread.html
@@ -11,35 +11,35 @@
<body>
-<div class="para">
+<div class="para func">
<h2>disk_read</h2>
<p>The disk_read function reads sector(s) from the disk drive.</p>
<pre>
DRESULT disk_read (
- BYTE <em>Drive</em>, <span>/* Physical drive number */</span>
- BYTE* <em>Buffer</em>, <span>/* Pointer to the read data buffer */</span>
- DWORD <em>SectorNumber</em>, <span>/* Start sector number */</span>
- BYTE <em>SectorCount</em> <span>/* Number of sectros to read */</span>
+ BYTE <span class="arg">pdrv</span>, <span class="c">/* [IN] Physical drive number */</span>
+ BYTE* <span class="arg">buff</span>, <span class="c">/* [OUT] Pointer to the read data buffer */</span>
+ DWORD <span class="arg">sector</span>, <span class="c">/* [IN] Start sector number */</span>
+ BYTE <span class="arg">count</span> <span class="c">/* [IN] Number of sectros to read */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>Drive</dt>
+<dt>pdrv</dt>
<dd>Specifies the physical drive number.</dd>
-<dt>Buffer</dt>
-<dd>Pointer to the byte array to store the read data. The buffer size of number of bytes to be read, sector size * sector count, is required. Note that the memory address specified by FatFs is not that always aligned to word boundary. If the hardware does not support misaligned data transfer, it must be solved in this function.</dd>
-<dt>SectorNumber</dt>
+<dt>buff</dt>
+<dd>Pointer to the <em>byte array</em> to store the read data. The size of buffer must be in sector size * sector count.</dd>
+<dt>sector</dt>
<dd>Specifies the start sector number in logical block address (LBA).</dd>
-<dt>SectorCount</dt>
-<dd>Specifies number of sectors to read. The value can be 1 to 128.</dd>
+<dt>count</dt>
+<dd>Specifies number of sectors to read. The value can be 1 to 128. Generally, a multiple sector transfer request must not be split into single sector transactions to the device, or you may not get good read performance.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Value</h4>
<dl class="ret">
<dt>RES_OK (0)</dt>
@@ -54,6 +54,17 @@ DRESULT disk_read (
</div>
+<div class="para desc">
+<h4>Description</h4>
+<p>The specified memory address is not that always aligned to word boundary because the type of pointer is defined as <tt>BYTE</tt>. The misaligned read/write request can occure at <a href="appnote.html#fs1">direct transfer</a>. If the bus architecture, especially DMA controller, does not allow misaligned memory access, it should be solved in this function. There are some workarounds described below to avoid this problem.</p>
+<ul>
+<li>Convert word transfer to byte transfer in this function. - Recommended.</li>
+<li>On <tt>f_read()</tt>, avoid long read request that includes a whole of sector. - Direct transfer will never occure.</li>
+<li>On <tt>f_read(fp, buff, btr, &amp;br)</tt>, make sure that <tt>(((UINT)buff &amp; 3) == (f_tell(fp) &amp; 3))</tt> is true. - Word aligned direct transfer is guaranteed.</li>
+</ul>
+</div>
+
+
<p class="foot"><a href="../00index_e.html">Return</a></p>
</body>
</html>
diff --git a/data/sysrom/fat/doc/en/dstat.html b/data/sysrom/fat/doc/en/dstat.html
index 72ae576..9974a24 100644
--- a/data/sysrom/fat/doc/en/dstat.html
+++ b/data/sysrom/fat/doc/en/dstat.html
@@ -11,35 +11,35 @@
<body>
-<div class="para">
+<div class="para func">
<h2>disk_status</h2>
<p>The disk_status function returns the current disk status.</p>
<pre>
DSTATUS disk_status (
- BYTE <em>Drive</em> <span>/* Physical drive number */</span>
+ BYTE <span class="arg">pdrv</span> <span class="c">/* [IN] Physical drive number */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameter</h4>
<dl class="par">
-<dt>Drive</dt>
+<dt>pdrv</dt>
<dd>Specifies the physical drive number to be confirmed.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
<p>The disk status is returned in combination of following flags. FatFs refers only <tt>STA_NOINIT</tt> and <tt>STA_PROTECTED</tt>.</p>
<dl class="ret">
<dt>STA_NOINIT</dt>
-<dd>Indicates that the disk drive has not been initialized. This flag is set on: system reset, disk removal and disk_initialize function failed, and cleared on: disk_initialize function succeeded.</dd>
+<dd>Indicates that the disk drive is not initialized. This flag is set on system reset, media removal, media change and <tt>disk_initialize()</tt> function failed. The flag is cleared on disk_initialize function succeeded. Media change that occurs asynchronously must be captured and reflect it to the status flags, or auto-mount feature will not work correctly. When media change detection is not supported, application program should clear the file system object with <tt>f_mount()</tt> function after the media change.</dd>
<dt>STA_NODISK</dt>
<dd>Indicates that no medium in the drive. This is always cleared on fixed disk drive.</dd>
<dt>STA_PROTECTED</dt>
-<dd>Indicates that the medium is write protected. This is always cleared on the drive that does not support write protect notch. Not valid when <tt>STA_NODISK</tt> is set.</dd>
+<dd>Indicates that the medium is write protected. This is always cleared on the drive that does not support write protect notch. Not valid while <tt>STA_NODISK</tt> is set.</dd>
</dl>
</div>
diff --git a/data/sysrom/fat/doc/en/dwrite.html b/data/sysrom/fat/doc/en/dwrite.html
index b27fd7a..d3550b2 100644
--- a/data/sysrom/fat/doc/en/dwrite.html
+++ b/data/sysrom/fat/doc/en/dwrite.html
@@ -11,35 +11,35 @@
<body>
-<div class="para">
+<div class="para func">
<h2>disk_write</h2>
<p>The disk_write writes sector(s) to the disk.</p>
<pre>
DRESULT disk_write (
- BYTE <em>Drive</em>, <span>/* Physical drive number */</span>
- const BYTE* <em>Buffer</em>, <span>/* Pointer to the write data (may be non aligned) */</span>
- DWORD <em>SectorNumber</em>, <span>/* Sector number to write */</span>
- BYTE <em>SectorCount</em> <span>/* Number of sectors to write */</span>
+ BYTE <span class="arg">drv</span>, <span class="c">/* [IN] Physical drive number */</span>
+ const BYTE* <span class="arg">buff</span>, <span class="c">/* [IN] Write data (may be non aligned) */</span>
+ DWORD <span class="arg">sector</span>, <span class="c">/* [IN] Sector number to write */</span>
+ BYTE <span class="arg">count</span> <span class="c">/* [IN] Number of sectors to write */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>Drive</dt>
+<dt>pdrv</dt>
<dd>Specifies the physical drive number.</dd>
-<dt>Buffer</dt>
-<dd>Pointer to the byte array to be written. Note that the memory address specified by FatFs is not that always aligned to word boundary. If the hardware does not support misaligned data transfer, it must be solved in this function.</dd>
-<dt>SectorNumber</dt>
+<dt>buff</dt>
+<dd>Pointer to the <em>byte array</em> to be written.</dd>
+<dt>sector</dt>
<dd>Specifies the start sector number in logical block address (LBA).</dd>
-<dt>SectorCount</dt>
-<dd>Specifies the number of sectors to write. The value can be 1 to 128.</dd>
+<dt>count</dt>
+<dd>Specifies the number of sectors to write. The value can be 1 to 128. Generally, a multiple sector transfer request must not be split into single sector transactions to the device, or you will never get good write performance.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
<dl class="ret">
<dt>RES_OK (0)</dt>
@@ -56,9 +56,9 @@ DRESULT disk_write (
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>This function is not required in read only configuration.</p>
+<p>This function is not required in read only configuration. The specified memory address is not that always aligned to word boundary because the type of pointer is defined as <tt>BYTE</tt>. For more information, read <a href="dread.html">description in disk_read function</a>.</p>
</div>
diff --git a/data/sysrom/fat/doc/en/eof.html b/data/sysrom/fat/doc/en/eof.html
new file mode 100644
index 0000000..384c8d8
--- /dev/null
+++ b/data/sysrom/fat/doc/en/eof.html
@@ -0,0 +1,62 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="FatFs" href="../00index_e.html">
+<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/eof.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<title>FatFs - f_eof</title>
+</head>
+
+<body>
+
+<div class="para func">
+<h2>f_eof</h2>
+<p>The f_eof function tests for end-of-file on a file.</p>
+<pre>
+int f_eof (
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] File object */</span>
+);
+</pre>
+</div>
+
+
+<div class="para arg">
+<h4>Parameters</h4>
+<dl class="par">
+<dt>fp</dt>
+<dd>Pointer to the open file object structure.</dd>
+</dl>
+</div>
+
+
+<div class="para ret">
+<h4>Return Values</h4>
+<p>The <tt>f_eof()</tt> function returns a non-zero value if the read/write pointer has reached end of the file; otherwise it returns a zero.</p>
+</div>
+
+
+<div class="para desc">
+<h4>Description</h4>
+<p>In this revision, this function is implemented as a macro.</p>
+<pre>
+<span class="k">#define</span> f_eof(fp) (((fp)->fptr) == ((fp)->fsize) ? 1 : 0)
+</pre>
+</div>
+
+
+<div class="para comp">
+<h4>QuickInfo</h4>
+<p>Always available.</p>
+</div>
+
+
+<div class="para ref">
+<h4>See Also</h4>
+<p><tt><a href="open.html">f_open</a>, <a href="lseek.html">f_lseek</a>, <a href="sfile.html">FIL</a></tt></p>
+</div>
+
+<p class="foot"><a href="../00index_e.html">Return</a></p>
+</body>
+</html>
diff --git a/data/sysrom/fat/doc/en/error.html b/data/sysrom/fat/doc/en/error.html
new file mode 100644
index 0000000..d9c4474
--- /dev/null
+++ b/data/sysrom/fat/doc/en/error.html
@@ -0,0 +1,62 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="FatFs" href="../00index_e.html">
+<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/error.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<title>FatFs - f_error</title>
+</head>
+
+<body>
+
+<div class="para func">
+<h2>f_error</h2>
+<p>The f_error tests for an error on a file.</p>
+<pre>
+int f_error (
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] File object */</span>
+);
+</pre>
+</div>
+
+
+<div class="para arg">
+<h4>Parameters</h4>
+<dl class="par">
+<dt>fp</dt>
+<dd>Pointer to the open file object structure.</dd>
+</dl>
+</div>
+
+
+<div class="para ret">
+<h4>Return Values</h4>
+<p>Returns a non-zero value if an error has occured; otherwise it returns a zero.</p>
+</div>
+
+
+<div class="para desc">
+<h4>Description</h4>
+<p>In this revision, this function is implemented as a macro.</p>
+<pre>
+<span class="k">#define</span> f_error(fp) (((fp)->flag & FA__ERROR) ? 1 : 0)
+</pre>
+</div>
+
+
+<div class="para comp">
+<h4>QuickInfo</h4>
+<p>Always available.</p>
+</div>
+
+
+<div class="para ref">
+<h4>See Also</h4>
+<p><tt><a href="open.html">f_open</a>, <a href="sfile.html">FIL</a></tt></p>
+</div>
+
+<p class="foot"><a href="../00index_e.html">Return</a></p>
+</body>
+</html>
diff --git a/data/sysrom/fat/doc/en/fattime.html b/data/sysrom/fat/doc/en/fattime.html
index e726731..c42cd5d 100644
--- a/data/sysrom/fat/doc/en/fattime.html
+++ b/data/sysrom/fat/doc/en/fattime.html
@@ -11,7 +11,7 @@
<body>
-<div class="para">
+<div class="para func">
<h2>get_fattime</h2>
<p>The get_fattime function gets current time.</p>
<pre>
@@ -20,9 +20,9 @@ DWORD get_fattime (void);
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Value</h4>
-<p>Currnet time is returned with packed into a DWORD value. The bit field is as follows:</p>
+<p>Currnet time is returned with packed into a <tt>DWORD</tt> value. The bit field is as follows:</p>
<dl class="ret">
<dt>bit31:25</dt>
<dd>Year from 1980 (0..127)</dd>
@@ -40,9 +40,9 @@ DWORD get_fattime (void);
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The get_fattime function must return any valid time even if the system does not support a real time clock. If a zero is returned, the file will not have a valid time. This fucntion is not required in read only configuration.</p>
+<p>The <tt>get_fattime()</tt> function must return any valid time even if the system does not support a real time clock. If a zero is returned, the file will not have a valid time. This fucntion is not required in read only configuration.</p>
</div>
diff --git a/data/sysrom/fat/doc/en/fdisk.html b/data/sysrom/fat/doc/en/fdisk.html
new file mode 100644
index 0000000..1138f87
--- /dev/null
+++ b/data/sysrom/fat/doc/en/fdisk.html
@@ -0,0 +1,97 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="FatFs" href="../00index_e.html">
+<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/fdisk.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<title>FatFs - f_fdisk</title>
+</head>
+
+<body>
+
+<div class="para func">
+<h2>f_fdisk</h2>
+<p>The f_fdisk fucntion divides a physical drive.</p>
+<pre>
+FRESULT f_fdisk (
+ BYTE <span class="arg">pdrv</span>, <span class="c">/* [IN] Physical drive number */</span>
+ const DWORD <em>part[]</em>, <span class="c">/* [IN] Partition size */</span>
+ void* <span class="arg">work</span> <span class="c">/* [IN] Work area */</span>
+);
+</pre>
+</div>
+
+<div class="para arg">
+<h4>Parameters</h4>
+<dl class="par">
+<dt>pdrv</dt>
+<dd>Specifies the <em>physical drive</em> to be divided.</dd>
+<dt>part[]</dt>
+<dd>Partition map table. It must have four items.</dd>
+<dt>work</dt>
+<dd>Pointer to the function work area. The size must be at least <tt>_MAX_SS</tt> bytes.</dd>
+</dl>
+</div>
+
+<div class="para ret">
+<h4>Return Values</h4>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
+<a href="rc.html#ip">FR_INVALID_PARAMETER</a>
+</p>
+</div>
+
+<div class="para desc">
+<h4>Description</h4>
+<p>The <tt>f_fdisk()</tt> function creates a partition table into the MBR of the physical drive. The partitioning rule is in generic FDISK format so that it can create upto four primary partitions. Extended partition is not supported. The <tt class="arg">part[]</tt> array with four items specifies how to divide the physical drive. The first item specifies the size of first primary partition and fourth item specifies the fourth primary partition. If the value is less than or equal to 100, it means percentage of the partition in the entire disk space. If it is larger than 100, it means partition size in unit of sector.</p>
+</div>
+
+<div class="para comp">
+<h4>QuickInfo</h4>
+<p>Available when <tt>_FS_READOLNY == 0</tt>, <tt>_USE_MKFS == 1</tt> and <tt>_MULTI_PARTITION == 1</tt>.</p>
+</div>
+
+<div class="para use">
+<h4>Example</h4>
+<pre>
+ <span class="c">/* Volume management table defined by user (required when _MULTI_PARTITION == 1) */</span>
+
+ PARTITION VolToPart[] = {
+ {0, 1}, <span class="c">/* Logical drive 0 ==> Physical drive 0, 1st partition */</span>
+ {0, 2}, <span class="c">/* Logical drive 1 ==> Physical drive 0, 2nd partition */</span>
+ {1, 0} <span class="c">/* Logical drive 2 ==> Physical drive 1, auto detection */</span>
+ };
+</pre>
+<pre>
+ <span class="c">/* Initialize a brand-new disk drive mapped to physical drive 0 */</span>
+
+ FATFS Fatfs;
+ DWORD plist[] = {50, 50, 0, 0}; <span class="c">/* Divide drive into two partitions */</span>
+ BYTE work[_MAX_SS];
+
+ f_fdisk(0, plist, work); <span class="c">/* Divide physical drive 0 */</span>
+
+ f_mount(0, &amp;Fatfs);
+ f_mkfs(0, 0, 0); <span class="c">/* Create an FAT volume on the logical drive 0. 2nd argument is ignored. */</span>
+ f_mount(0, 0);
+
+ f_mount(1, &amp;Fatfs);
+ f_mkfs(1, 0, 0);
+ f_mount(1, 0);
+
+</pre>
+</div>
+
+<div class="para ref">
+<h4>See Also</h4>
+<p><a href="filename.html#vol">Volume management</a>, <a href="mkfs.html"><tt>f_mkfs</tt></a></p>
+</div>
+
+<p class="foot"><a href="../00index_e.html">Return</a></p>
+</body>
+</html>
diff --git a/data/sysrom/fat/doc/en/filename.html b/data/sysrom/fat/doc/en/filename.html
index a13b296..b825c45 100644
--- a/data/sysrom/fat/doc/en/filename.html
+++ b/data/sysrom/fat/doc/en/filename.html
@@ -10,15 +10,16 @@
</head>
<body>
+<h1>Path Names</h1>
-<div class="para">
+<div class="para" id="nam">
<h3>Format of the path names</h3>
-<p>The path name format on the FatFs module is similer to the filename specs of DOS/Windos as follows:</p>
-<p><tt>"[drive#:][/]directory/file"</tt></p>
-<p>The FatFs module supports long file name (LFN) and 8.3 format file name (SFN). The LFN can be used when LFN feature is enabled <tt>(_USE_LFN &gt; 0)</tt>. The sub directories are separated with a \ or / in the same way as DOS/Windows API. Only a difference is that the logical drive is specified in a numeral with a colon. When the drive number is omitted, it is assumed as default drive (0 or current drive).</p>
-<p>Control characters (\0 to \x1F) are recognized as end of the path name. Leading/embedded spaces in the path name are valid as a part of the name on LFN configuration but they are recognized as end of the path name on non-LFN configuration. Trailing spaces and dots are ignored.</p>
-<p>In default configuration <tt>(_FS_RPATH == 0)</tt>, it does not have a concept of current directory like OS oriented file system. All objects on the volume are always specified in full path name that follows from the root directory. Dot directory names are not allowed. Heading separator is ignored and it can be exist or omitted. The default drive number is fixed to 0.</p>
-<p>When relative path feature is enabled <tt>(_FS_RPATH == 1)</tt>, specified path is followed from the root directory if a heading separator is exist. If not, it is followed from the current directory set with <a href="chdir.html">f_chdir</a> function. Dot names are also allowed for the path name. The default drive is the current drive set with <a href="chdrive.html">f_chdrive</a> function.</p>
+<p>The format of path name on the FatFs module is similer to the filename specs of DOS/Windos as follows:</p>
+<pre>"[drive#:][/]directory/file"</pre>
+<p>The FatFs module supports long file name (LFN) and 8.3 format file name (SFN). The LFN can be used when LFN feature is enabled (<tt>_USE_LFN &gt; 0</tt>). The sub directories are separated with a \ or / in the same way as DOS/Windows API. Duplicated separators are skipped and ignored. Only a difference is that the logical drive is specified in a numeral with a colon. When the drive number is omitted, it is assumed as <em>default drive</em> (drive 0 or current drive).</p>
+<p>Control characters (<tt>'\0'</tt> to <tt>'\x1F'</tt>) are recognized as end of the path name. Leading/embedded spaces in the path name are valid as a part of the name on LFN configuration but they are recognized as end of the path name on non-LFN configuration. Trailing spaces and dots are ignored.</p>
+<p>In default configuration (<tt>_FS_RPATH == 0</tt>), it does not have a concept of current directory like OS oriented file system. All objects on the volume are always specified in full path name that follows from the root directory. Dot directory names are not allowed. Heading separator is ignored and it can be exist or omitted. The default drive number is fixed to 0.</p>
+<p>When relative path feature is enabled (<tt>_FS_RPATH == 1</tt>), specified path is followed from the root directory if a heading separator is exist. If not, it is followed from the current directory set with <a href="chdir.html">f_chdir</a> function. Dot names are also allowed for the path name. The default drive is the current drive set with <a href="chdrive.html">f_chdrive</a> function.</p>
<table class="lst2">
<tr><td>Path name</td><td>_FS_RPATH == 0</td><td>_FS_RPATH == 1</td></tr>
<tr class="lst3"><td>file.txt</td><td>A file in the root directory of the drive 0</td><td>A file in the current directory of the current drive</td></tr>
@@ -37,36 +38,35 @@
</div>
<p><br></p>
-<div class="para">
+<div class="para" id="uni">
<h3>Unicode API</h3>
-<p>The path names are input/output in either ANSI/OEM code (SBCS/DBCS) or Unicode depends on the configuration options. The type of arguments that specifies the file names are defined as <tt>TCHAR</tt> which is an alias of <tt>char</tt> in default. The code set of the file name string is the ANSI/OEM code set specifid by <tt>_CODE_PAGE</tt>. When <tt>_LFN_UNICODE</tt> is set to 1 under LFN configuration, the type of the <tt>TCHAR</tt> is switched to <tt>unsigned short</tt> (UCS-2 character) to support Unicode. In this case, the LFN feature is fully supported and the Unicode specific characters, such as 笨昶亂笨。笘ク笘ュ, can also be used for the path name. It also affects data types and encoding of the string I/O functions. To define literal strings, <tt>_T(s)</tt> and <tt>_TEXT(s)</tt> macro are available to select either ANSI/OEM or Unicode automatically. The code shown below is an example to define the literal strings.</p>
+<p>The path names are input/output in either ANSI/OEM code (SBCS/DBCS) or Unicode depends on the configuration options. The type of arguments that specifies the file names are defined as <tt>TCHAR</tt> which is an alias of <tt>char</tt> in default. The code set of the file name string is the ANSI/OEM code set specifid by <tt>_CODE_PAGE</tt>. When <tt>_LFN_UNICODE</tt> is set to 1, the type of the <tt>TCHAR</tt> is switched to <tt>WCHAR, unsigned short</tt> (UCS-2 character) to support Unicode. In this case, the LFN feature is fully supported and the Unicode specific characters, such as 笨昶亂笨。笘ク笘ュ, can also be used for the path name. It also affects data types and encoding of the string I/O functions. To define literal strings, <tt>_T(s)</tt> and <tt>_TEXT(s)</tt> macro are available to select either ANSI/OEM or Unicode automatically. The code shown below is an example to define the literal strings.</p>
<pre>
- f_open(fp, "filename.txt", FA_READ); <span>/* ANSI/OEM only */</span>
- f_open(fp, L"filename.txt", FA_READ); <span>/* Unicode only */</span>
- f_open(fp, _T("filename.txt"), FA_READ); <span>/* Changed automatically */</span>
+ f_open(fp, "filename.txt", FA_READ); <span class="c">/* ANSI/OEM only */</span>
+ f_open(fp, L"filename.txt", FA_READ); <span class="c">/* Unicode only */</span>
+ f_open(fp, _T("filename.txt"), FA_READ); <span class="c">/* Changed by configuration */</span>
</pre>
</div>
<p><br></p>
-<div class="para">
+<div class="para" id="vol">
<h3>Correspondence between logical and physical drives</h3>
-<p>The FatFs module has work areas that called <em>file system object</em> for each volume (logical drive). In default, the logical drive is bound to the physical drive that has same drive number, and the first partition is mounted. When <tt>_MULTI_PARTITION == 1</tt> is specified in configuration option, each individual logical drive can be bound to any physical drive/partition. In this case, a drive number resolution table must be defined as follows:</p>
+<p>The FatFs module has work areas that called <em>file system object</em> for each volume (logical drive). In default, each logical drive is bound to the physical drive that has same drive number. It attempts to mount a volume as SFD format and first FDISK partition. When <tt>_MULTI_PARTITION &gt;= 1</tt> is specified in configuration option, each individual logical drive is bound to any physical drive/partition. In this case, a volume management table must be defined by user. It is used to resolve relationship between logical drives and partitions as follows:</p>
<pre>
Example: Logical drive 0-2 are assigned to three pri-partitions on the physical drive 0 (fixed disk)
Logical drive 3 is assigned to physical drive 1 (removable disk)
-const PARTITION Drives[] = {
- {0, 0}, <span>/* Logical drive 0 ==> Physical drive 0, 1st partition */</span>
- {0, 1}, <span>/* Logical drive 1 ==> Physical drive 0, 2nd partition */</span>
- {0, 2}, <span>/* Logical drive 2 ==> Physical drive 0, 3rd partition */</span>
- {1, 0} <span>/* Logical drive 3 ==> Physical drive 1 */</span>
+PARTITION VolToPart[] = {
+ {0, 1}, <span class="c">/* Logical drive 0 ==> Physical drive 0, 1st partition */</span>
+ {0, 2}, <span class="c">/* Logical drive 1 ==> Physical drive 0, 2nd partition */</span>
+ {0, 3}, <span class="c">/* Logical drive 2 ==> Physical drive 0, 3rd partition */</span>
+ {1, 0} <span class="c">/* Logical drive 3 ==> Physical drive 1 (auto detection) */</span>
};
</pre>
<p>There are some considerations when use <tt>_MULTI_PARTITION</tt> configuration.</p>
<ul>
-<li>Only pri-partition (0-3) can be mounted.</li>
-<li>When the physical drive has no partition table (SFD format), the partition number is ignored.</li>
-<li>The physical drive that has two or more logical drives must be a fixed drive.</li>
+<li>Only four pri-partitions can be mounted. Extended partition is not supported.</li>
+<li>The physical drive that has two or more partitions must be non-removable class.</li>
</ul>
</div>
diff --git a/data/sysrom/fat/doc/en/forward.html b/data/sysrom/fat/doc/en/forward.html
index 5286b58..714c48d 100644
--- a/data/sysrom/fat/doc/en/forward.html
+++ b/data/sysrom/fat/doc/en/forward.html
@@ -11,88 +11,82 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_forward</h2>
<p>The f_forward function reads the file data and forward it to the data streaming device.</p>
<pre>
FRESULT f_forward (
- FIL* <em>FileObject</em>, <span>/* File object */</span>
- UINT (*<em>Func</em>)(const BYTE*,UINT), <span>/* Data streaming function */</span>
- UINT <em>ByteToFwd</em>, <span>/* Number of bytes to forward */</span>
- UINT* <em>ByteFwd</em> <span>/* Number of bytes forwarded */</span>
+ FIL* <span class="arg">fp</span>, <span class="c">/* [IN] File object */</span>
+ UINT (*<span class="arg">func</span>)(const BYTE*,UINT), <span class="c">/* [IN] Data streaming function */</span>
+ UINT <span class="arg">btf</span>, <span class="c">/* [IN] Number of bytes to forward */</span>
+ UINT* <span class="arg">bf</span> <span class="c">/* [OUT] Number of bytes forwarded */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>Pointer to the open file object.</dd>
-<dt>Func</dt>
+<dt>func</dt>
<dd>Pointer to the user-defined data streaming function. For details, refer to the sample code.</dd>
-<dt>ByteToFwd</dt>
-<dd>Number of bytes to forward in range of UINT.</dd>
-<dt>ByteFwd</dt>
-<dd>Pointer to the UINT variable to return number of bytes forwarded.</dd>
+<dt>btf</dt>
+<dd>Number of bytes to forward in range of <tt>UINT</tt>.</dd>
+<dt>bf</dt>
+<dd>Pointer to the <tt>UINT</tt> variable to return number of bytes forwarded.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>The function succeeded.</dd>
-<dt>FR_DENIED</dt>
-<dd>The function denied due to the file has been opened in non-read mode.</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>The function failed due to an error in the disk function.</dd>
-<dt>FR_INT_ERR</dt>
-<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
-<dt>FR_NOT_READY</dt>
-<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
-<dt>FR_INVALID_OBJECT</dt>
-<dd>The file object is invalid.</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#io">FR_INVALID_OBJECT</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The f_forward function reads the data from the file and forward it to the outgoing stream without data buffer. This is suitable for small memory system because it does not require any data buffer at application module. The file pointer of the file object increases in number of bytes forwarded. In case of <tt>*ByteFwd &lt; ByteToFwd</tt> without error, it means the requested bytes could not be transferred due to end of file or stream goes busy during data transfer.</p>
+<p>The <tt>f_forward()</tt> function reads the data from the file and forward it to the outgoing stream without data buffer. This is suitable for small memory system because it does not require any data buffer at application module. The file pointer of the file object increases in number of bytes forwarded. In case of <tt class="arg">*bf</tt> is less than <tt class="arg">btf</tt> without error, it means the requested bytes could not be transferred due to end of file or stream goes busy during data transfer.</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_USE_FORWARD == 1</tt> and <tt>_FS_TINY == 1</tt>.</p>
</div>
-<div class="para">
+<div class="para use">
<h4>Example (Audio playback)</h4>
<pre>
-<span>/*------------------------------------------------------------------------*/</span>
-<span>/* Sample code of data transfer function to be called back from f_forward */</span>
-<span>/*------------------------------------------------------------------------*/</span>
+<span class="c">/*------------------------------------------------------------------------*/</span>
+<span class="c">/* Sample code of data transfer function to be called back from f_forward */</span>
+<span class="c">/*------------------------------------------------------------------------*/</span>
-UINT out_stream ( <span>/* Returns number of bytes sent or stream status */</span>
- const BYTE *p, <span>/* Pointer to the data block to be sent */</span>
- UINT btf <span>/* &gt;0: Transfer call (Number of bytes to be sent). 0: Sense call */</span>
+UINT out_stream ( <span class="c">/* Returns number of bytes sent or stream status */</span>
+ const BYTE *p, <span class="c">/* Pointer to the data block to be sent */</span>
+ UINT btf <span class="c">/* &gt;0: Transfer call (Number of bytes to be sent). 0: Sense call */</span>
)
{
UINT cnt = 0;
- if (btf == 0) { <span>/* Sense call */</span>
- <span>/* Return stream status (0: Busy, 1: Ready) */</span>
- <span>/* When once it returned ready to sense call, it must accept a byte at least */</span>
- <span>/* at subsequent transfer call, or f_forward will fail with FR_INT_ERROR. */</span>
+ if (btf == 0) { <span class="c">/* Sense call */</span>
+ <span class="c">/* Return stream status (0: Busy, 1: Ready) */</span>
+ <span class="c">/* When once it returned ready to sense call, it must accept a byte at least */</span>
+ <span class="c">/* at subsequent transfer call, or f_forward will fail with FR_INT_ERR. */</span>
if (FIFO_READY) cnt = 1;
}
- else { <span>/* Transfer call */</span>
- do { <span>/* Repeat while there is any data to be sent and the stream is ready */</span>
+ else { <span class="c">/* Transfer call */</span>
+ do { <span class="c">/* Repeat while there is any data to be sent and the stream is ready */</span>
FIFO_PORT = *p++;
cnt++;
} while (cnt &lt; btf &amp;&amp; FIFO_READY);
@@ -102,32 +96,32 @@ UINT out_stream ( <span>/* Returns number of bytes sent or stream status */</s
}
-<span>/*------------------------------------------------------------------------*/</span>
-<span>/* Sample code using f_forward function */</span>
-<span>/*------------------------------------------------------------------------*/</span>
+<span class="c">/*------------------------------------------------------------------------*/</span>
+<span class="c">/* Sample code using f_forward function */</span>
+<span class="c">/*------------------------------------------------------------------------*/</span>
FRESULT play_file (
- char *fn <span>/* Pointer to the audio file name to be played */</span>
+ char *fn <span class="c">/* Pointer to the audio file name to be played */</span>
)
{
FRESULT rc;
FIL fil;
UINT dmy;
- <span>/* Open the audio file in read only mode */</span>
+ <span class="c">/* Open the audio file in read only mode */</span>
rc = f_open(&amp;fil, fn, FA_READ);
if (rc) return rc;
- <span>/* Repeat until the file pointer reaches end of the file */</span>
+ <span class="c">/* Repeat until the file pointer reaches end of the file */</span>
while (rc == FR_OK &amp;&amp; fil.fptr &lt; fil.fsize) {
- <span>/* any other processes... */</span>
+ <span class="c">/* any other processes... */</span>
- <span>/* Fill output stream periodicaly or on-demand */</span>
+ <span class="c">/* Fill output stream periodicaly or on-demand */</span>
rc = f_forward(&amp;fil, out_stream, 1000, &amp;dmy);
}
- <span>/* Close the file and return */</span>
+ <span class="c">/* Close the file and return */</span>
f_close(&amp;fil);
return rc;
}
@@ -135,7 +129,7 @@ FRESULT play_file (
</div>
-<div class="para">
+<div class="para ref">
<h4>See Also</h4>
<p><tt><a href="open.html">f_open</a>, <a href="gets.html">fgets</a>, <a href="write.html">f_write</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/en/getcwd.html b/data/sysrom/fat/doc/en/getcwd.html
index 6eba503..71833ab 100644
--- a/data/sysrom/fat/doc/en/getcwd.html
+++ b/data/sysrom/fat/doc/en/getcwd.html
@@ -11,62 +11,56 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_getcwd</h2>
<p>The f_getcwd function retrieves the current directory.</p>
<pre>
FRESULT f_getcwd (
- TCHAR* <em>Buffer</em>, <span>/* Pointer to the buffer */</span>
- UINT <em>BufferLen</em> <span>/* The length of the buffer */</span>
+ TCHAR* <span class="arg">buff</span>, <span class="c">/* [OUT] Buffer to return path name */</span>
+ UINT <span class="arg">len</span> <span class="c">/* [IN] The length of the buffer */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>Buffer</dt>
+<dt>buff</dt>
<dd>Pointer to the buffer to receive the current directory string.</dd>
-<dt>BufferLen</dt>
+<dt>len</dt>
<dd>Size of the buffer in unit of TCHAR.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>The function succeeded.</dd>
-<dt>FR_NOT_READY</dt>
-<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>The function failed due to an error in the disk function.</dd>
-<dt>FR_INT_ERR</dt>
-<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>The logical drive has no work area.</dd>
-<dt>FR_NO_FILESYSTEM</dt>
-<dd>There is no valid FAT volume on the drive.</dd>
-<dt>FR_NOT_ENOUGH_CORE</dt>
-<dd>Insufficient size of Buffer.</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>,
+<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The f_getcwd function retrieves the current directory of the current drive in full path string including drive number.</p>
+<p>The <tt>f_getcwd()</tt> function retrieves the current directory of the current drive in full path string including drive number.</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_FS_RPATH == 2</tt>.</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>See Also</h4>
<p><tt><a href="chdrive.html">f_chdrive</a>, <a href="chdir.html">f_chdir</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/en/getfree.html b/data/sysrom/fat/doc/en/getfree.html
index 04ae6cb..9e6423b 100644
--- a/data/sysrom/fat/doc/en/getfree.html
+++ b/data/sysrom/fat/doc/en/getfree.html
@@ -11,88 +11,81 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_getfree</h2>
<p>The f_getfree function gets number of the free clusters.</p>
<pre>
FRESULT f_getfree (
- const TCHAR* <em>Path</em>, <span>/* Logical drive number */</span>
- DWORD* <em>Clusters</em>, <span>/* Pointer to the variable to store number of free clusters */</span>
- FATFS** <em>FileSystemObject</em> <span>/* Pointer to pointer to file system object */</span>
+ const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] Logical drive number */</span>
+ DWORD* <span class="arg">nclst</span>, <span class="c">/* [OUT] Number of free clusters */</span>
+ FATFS** <span class="arg">fatfs</span> <span class="c">/* [OUT] Corresponding file system object */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>Path</dt>
-<dd>Pinter to the null-terminated string that specifies the <a href="filename.html">logical drive</a>.</dd>
-<dt>Clusters</dt>
-<dd>Pointer to the DWORD variable to store number of free clusters.</dd>
-<dt>FileSystemObject</dt>
+<dt>path</dt>
+<dd>Pinter to the null-terminated string that specifies the <a href="filename.html">logical drive</a>. A null-string means the current drive.</dd>
+<dt>nclst</dt>
+<dd>Pointer to the <tt>DWORD</tt> variable to store number of free clusters.</dd>
+<dt>fatfs</dt>
<dd>Pointer to pointer that to store a pointer to the corresponding file system object.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>The function succeeded. The <tt><em>*Clusters</em></tt> has number of free clusters and <tt><em>*FileSystemObject</em></tt> points the file system object.</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>The drive number is invalid.</dd>
-<dt>FR_NOT_READY</dt>
-<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>The function failed due to an error in the disk function.</dd>
-<dt>FR_INT_ERR</dt>
-<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>The logical drive has no work area.</dd>
-<dt>FR_NO_FILESYSTEM</dt>
-<dd>There is no valid FAT partition on the drive.</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Descriptions</h4>
-<p>The f_getfree function gets number of free clusters on the drive. The member <tt>csize</tt> in the file system object is refrecting number of sectors per cluster, so that the free space in unit of sector can be calcurated with this. When FSInfo structure on FAT32 volume is not in sync, this function can return an incorrect free cluster count.</p>
+<p>The <tt>f_getfree()</tt> function gets number of free clusters on the drive. The member <tt>csize</tt> in the file system object is refrecting number of sectors per cluster, so that the free space in unit of sector can be calcurated with this. When FSInfo structure on FAT32 volume is not in sync, this function can return an incorrect free cluster count.</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_FS_MINIMIZE == 0</tt>.</p>
</div>
-<div class="para">
+<div class="para use">
<h4>Example</h4>
<pre>
FATFS *fs;
DWORD fre_clust, fre_sect, tot_sect;
- <span>/* Get volume information and free clusters of drive 1 */</span>
+ <span class="c">/* Get volume information and free clusters of drive 1 */</span>
res = f_getfree("1:", &amp;fre_clust, &amp;fs);
if (res) die(res);
- <span>/* Get total sectors and free sectors */</span>
+ <span class="c">/* Get total sectors and free sectors */</span>
tot_sect = (fs->n_fatent - 2) * fs->csize;
fre_sect = fre_clust * fs->csize;
- <span>/* Print free space in unit of KB (assuming 512 bytes/sector) */</span>
- printf("%lu KB total drive space.\n"
- "%lu KB available.\n",
- fre_sect / 2, tot_sect / 2);
+ <span class="c">/* Print free space in unit of KiB (assuming 512 bytes/sector) */</span>
+ printf("%lu KB total drive space.\n%lu KB available.\n",
+ tot_sect / 2, fre_sect / 2);
</pre>
</div>
-<div class="para">
+<div class="para ref">
<h4>See Also</h4>
<p><tt><a href="sfatfs.html">FATFS</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/en/getlabel.html b/data/sysrom/fat/doc/en/getlabel.html
new file mode 100644
index 0000000..aa006bd
--- /dev/null
+++ b/data/sysrom/fat/doc/en/getlabel.html
@@ -0,0 +1,82 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="FatFs" href="../00index_e.html">
+<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/getlabel.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<title>FatFs - f_getlabel</title>
+</head>
+
+<body>
+
+<div class="para func">
+<h2>f_getlabel</h2>
+<p>The f_getlabel function returns volume label and volume serial number of a drive.</p>
+<pre>
+FRESULT f_getlabel (
+ const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] Path name */</span>
+ TCHAR* <span class="arg">buff</span>, <span class="c">/* [OUT] Volume label */</span>
+ DWORD* <span class="arg">sn</span> <span class="c">/* [OUT] Volume serial number */</span>
+);
+</pre>
+</div>
+
+<div class="para arg">
+<h4>Parameters</h4>
+<dl class="par">
+<dt>path</dt>
+<dd>Pointer to the nul-terminated string specifying the logical drive. Null-string specifies the default drive.</dd>
+<dt>buff</dt>
+<dd>Pointer to the buffer to store the volume label. The buffer size must be at least 12 items. If no volume label, a nul-string will be returned. Set null pointer if this information is not needed.</dd>
+<dt>sn</dt>
+<dd>Pointer to the <tt>DWORD</tt> variable to store the volume serial number. Set null pointer if this information is not needed.</dd>
+</dl>
+</div>
+
+
+<div class="para ret">
+<h4>Return Values</h4>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>
+</p>
+</div>
+
+
+<div class="para comp">
+<h4>QuickInfo</h4>
+<p>Available when <tt>_USE_LABEL == 1</tt>.</p>
+</div>
+
+
+<div class="para use">
+<h4>Example</h4>
+<pre>
+ TCHAR str[12];
+
+ <span class="c">/* Get volume label of the default drive */</span>
+ f_getlabel("", str, 0);
+
+ <span class="c">/* Get volume label of the drive 2 */</span>
+ f_getlabel("2:", str, 0);
+</pre>
+</div>
+
+
+<div class="para ref">
+<h4>See Also</h4>
+<tt><a href="setlabel.html">f_setlabel</a></tt>
+</div>
+
+
+<p class="foot"><a href="../00index_e.html">Return</a></p>
+</body>
+</html>
diff --git a/data/sysrom/fat/doc/en/gets.html b/data/sysrom/fat/doc/en/gets.html
index dcb1790..a7f6a77 100644
--- a/data/sysrom/fat/doc/en/gets.html
+++ b/data/sysrom/fat/doc/en/gets.html
@@ -11,51 +11,51 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_gets</h2>
<p>The f_gets reads a string from the file.</p>
<pre>
TCHAR* f_gets (
- TCHAR* <em>Str</em>, <span>/* Read buffer */</span>
- int <em>Size</em>, <span>/* Size of the read buffer */</span>
- FIL* <em>FileObject</em> <span>/* File object */</span>
+ TCHAR* <span class="arg">buff</span>, <span class="c">/* [OUT] Read buffer */</span>
+ int <span class="arg">len</span>, <span class="c">/* [IN] Size of the read buffer */</span>
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] File object */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>Str</dt>
+<dt>str</dt>
<dd>Pointer to read buffer to store the read string.</dd>
-<dt>Size</dt>
+<dt>len</dt>
<dd>Size of the read buffer in unit of character.</dd>
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>Pointer to the open file object structure.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<p>When the function succeeded, <tt>Str</tt> will be returuned.</p>
+<p>When the function succeeded, <tt class="arg">str</tt> will be returuned.</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The f_gets() is a wrapper function of <a href="read.html">f_read()</a>. The read operation continues until a <tt>'\n'</tt> is stored, reached end of the file or the buffer is filled with <tt>Size - 1</tt> characters. The read string is terminated with a <tt>'\0'</tt>. When no character to read or any error occured during read operation, f_gets() returns a null pointer. The end of file and error status can be examined with <tt>f_eof()</tt> and <tt>f_error()</tt> macros.</p>
-<p>When the FatFs is configured to Unicode API (<tt>_LFN_UNICODE == 1</tt>), the file is read in UTF-8 encoding and stored it to the buffer in UCS-2. If not the case, the file will be read in one byte per character without any code conversion.</p>
+<p>The <tt>f_gets()</tt> function is a wrapper function of <a href="read.html">f_read()</a> function. The read operation continues until a <tt>'\n'</tt> is stored, reached end of the file or the buffer is filled with <tt>len - 1</tt> characters. The read string is terminated with a <tt>'\0'</tt>. When no character to read or any error occured during read operation, it returns a null pointer. The status of eof and error can be examined with <tt>f_eof()</tt> and <tt>f_error()</tt> macros.</p>
+<p>When the FatFs is configured to Unicode API (<tt>_LFN_UNICODE == 1</tt>), the file is read in assumption of UTF-8 encoding and stored it to the buffer in UCS-2. If not the case, the file will be read in one byte per character without any code conversion.</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_USE_STRFUNC</tt> is 1 or 2. When it is set to 2, <tt>'\r'</tt>s contained in the file are stripped out.</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>See Also</h4>
<p><tt><a href="open.html">f_open</a>, <a href="read.html">f_read</a>, <a href="putc.html">f_putc</a>, <a href="puts.html">f_puts</a>, <a href="printf.html">f_printf</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/en/lseek.html b/data/sysrom/fat/doc/en/lseek.html
index bcda346..3b57f0f 100644
--- a/data/sysrom/fat/doc/en/lseek.html
+++ b/data/sysrom/fat/doc/en/lseek.html
@@ -11,115 +11,116 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_lseek</h2>
-<p>The f_lseek function moves the file read/write pointer of an open file object. It can also be used to increase the file size (cluster pre-allocation).</p>
+<p>The f_lseek function moves the file read/write pointer of an open file object. It can also be used to increase the file size (cluster pre-allocation). </p>
<pre>
FRESULT f_lseek (
- FIL* <em>FileObject</em>, <span>/* Pointer to the file object structure */</span>
- DWORD <em>Offset</em> <span>/* File offset in unit of byte */</span>
+ FIL* <span class="arg">fp</span>, <span class="c">/* [IN] File object */</span>
+ DWORD <span class="arg">ofs</span> <span class="c">/* [IN] File offset in unit of byte */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>Pointer to the open file object.</dd>
-<dt>Offset</dt>
+<dt>ofs</dt>
<dd>Number of bytes where from start of the file</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>The function succeeded.</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>The function failed due to an error in the disk function.</dd>
-<dt>FR_INT_ERR</dt>
-<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
-<dt>FR_NOT_READY</dt>
-<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
-<dt>FR_INVALID_OBJECT</dt>
-<dd>The file object is invalid.</dd>
-<dt>FR_NOT_ENOUGH_CORE</dt>
-<dd>Insufficient size of link map table for the file.</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#io">FR_INVALID_OBJECT</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The f_lseek function moves the file read/write pointer of an open file. The offset can be specified in only origin from top of the file. When an offset above the file size is specified in write mode, the file size is increased and the data in the expanded area is undefined. This is suitable to create a large file quickly, for fast write operation. After the f_lseek function succeeded, member fptr in the file object should be checked in order to make sure the read/write pointer has been moved correctry. In case of fptr is not the expected value, either of followings has been occured.</p>
+<p>The <tt>f_lseek()</tt> function moves the file read/write pointer of an open file. The offset can be specified in only origin from top of the file. When an offset above the file size is specified in write mode, the file size is increased to the offset and the data in the expanded area is undefined. This is suitable to create a large file quickly, for fast write operation. After the <tt>f_lseek()</tt> function succeeded, current read/write pointer should be checked in order to make sure the read/write pointer has been moved correctry. In case of the current read/write pointer is not the expected value, either of followings has been occured.</p>
<ul>
-<li>End of file. The specified Offset was clipped at the file size because the file has been opened in read-only mode.</li>
+<li>End of file. The specified <tt class="arg">ofs</tt> was clipped at end of the file because the file has been opened in read-only mode.</li>
<li>Disk full. There is insufficient free space on the volume to expand the file size.</li>
</ul>
-<p>When <tt>_USE_FASTSEEK</tt> is set to 1 and <tt>cltbl</tt> member in the file object is not NULL, the fast seek feature is enabled. This feature enables fast backward/long seek operations without FAT access by cluster link information stored on the user defined table. The cluster link information must be created prior to do the fast seek. The required size of the table is (number of fragments + 1) * 2 items. For example, when the file is fragmented in 5, 12 items will be required to store the cluster link information. The file size cannot be expanded when the fast seek feature is enabled.</p>
+<p>Fast seek feature is enabled when <tt>_USE_FASTSEEK</tt> is set to 1 and the member <tt>cltbl</tt> in the file object is not NULL. This feature enables fast backward/long seek operations without FAT access by using cluster link map table (CLMT). It is also applied to f_read/f_write functions. In this mode, the file size cannot be increased by <tt>f_write()/f_lseek()</tt> functions.</p>
+<p>The CLMT must be created in the user defined <tt>DWORD</tt> array prior to use fast seek feature. To create the CLMT, set pointer to the <tt>DWORD</tt> array to the member <tt>cltbl</tt> in the file object, set the array size in unit of items into the first item and call the <tt>f_lseek()</tt> function with <tt class="arg">ofs</tt><tt> = CREATE_LINKMAP</tt>. After the function succeeded and CLMT is created, no FAT access is occured in subsequent <tt>f_read()/f_write()/f_lseek()</tt> functions to the file. If the function failed with <tt>FR_NOT_ENOUGH_CORE</tt>, the given array size is insufficient for the file and the required items is returned into the first item of the array. The required array size is (number of fragments + 1) * 2 items. For example, when the file is fragmented in 5, 12 items will be required for the CLMT.</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_FS_MINIMIZE &lt;= 2</tt>.</p>
</div>
-<div class="para">
+<div class="para use">
<h4>Example</h4>
<pre>
- <span>/* Move to offset of 5000 from top of the file */</span>
+ <span class="c">/* Open file */</span>
+ file = malloc(sizeof (FIL));
+ if (!file) ...
+ res = f_open(file, "file.dat", FA_READ|FA_WRITE);
+ if (res) ...
+
+ <span class="c">/* Move to offset of 5000 from top of the file */</span>
res = f_lseek(file, 5000);
- <span>/* Move to end of the file to append data */</span>
- res = f_lseek(file, file-&gt;fsize);
+ <span class="c">/* Move to end of the file to append data */</span>
+ res = f_lseek(file, f_size(file));
- <span>/* Forward 3000 bytes */</span>
- res = f_lseek(file, file-&gt;fptr + 3000);
+ <span class="c">/* Forward 3000 bytes */</span>
+ res = f_lseek(file, f_tell(file) + 3000);
- <span>/* Rewind 2000 bytes (take care on overflow) */</span>
- res = f_lseek(file, file-&gt;fptr - 2000);
+ <span class="c">/* Rewind 2000 bytes (take care on overflow) */</span>
+ res = f_lseek(file, f_tell(file) - 2000);
</pre>
<pre>
- <span>/* Cluster pre-allocation (to prevent buffer overrun on streaming write) */</span>
+ <span class="c">/* Cluster pre-allocation (to prevent buffer overrun on streaming write) */</span>
- res = f_open(file, recfile, FA_CREATE_NEW | FA_WRITE); <span>/* Create a file */</span>
+ res = f_open(file, recfile, FA_CREATE_NEW | FA_WRITE); <span class="c">/* Create a file */</span>
- res = f_lseek(file, PRE_SIZE); <span>/* Pre-allocate clusters */</span>
- if (res || file-&gt;fptr != PRE_SIZE) ... <span>/* Check if the file size has been increased correctly */</span>
+ res = f_lseek(file, PRE_SIZE); <span class="c">/* Expand file size (cluster pre-allocation) */</span>
+ if (res || f_tell(file) != PRE_SIZE) ... <span class="c">/* Check if the file has been expanded */</span>
- res = f_lseek(file, DATA_START); <span>/* Record data stream without cluster allocation delay */</span>
- ...
+ res = f_lseek(file, DATA_START); <span class="c">/* Record data stream WITHOUT cluster allocation delay */</span>
+ ... <span class="c">/* DATA_START and write block size should be aligned to sector boundary */</span>
- res = f_truncate(file); <span>/* Truncate unused area */</span>
- res = f_lseek(file, 0); <span>/* Put file header */</span>
+ res = f_truncate(file); <span class="c">/* Truncate unused area */</span>
+ res = f_lseek(file, 0); <span class="c">/* Put file header */</span>
...
res = f_close(file);
</pre>
<pre>
- <span>/* Using fast seek feature */</span>
+ <span class="c">/* Using fast seek feature */</span>
- DWORD lktbl[SZ_TBL]; <span>/* Link map table buffer */</span>
+ DWORD lktbl[SZ_TBL]; <span class="c">/* Link map table buffer */</span>
- res = f_lseek(&amp;file, ofs1); <span>/* This is normal seek (file.cltbl == NULL on file open) */</span>
+ res = f_lseek(file, ofs1); <span class="c">/* This is normal seek (file.cltbl is nulled on file open) */</span>
- file.cltbl = lktbl; <span>/* Enable fast seek feature */</span>
- lktbl[0] = SZ_TBL; <span>/* Set table size to the first item */</span>
- res = f_lseek(&amp;file, CREATE_LINKMAP); <span>/* Create cluster link map table */</span>
+ file.cltbl = lktbl; <span class="c">/* Enable fast seek feature */</span>
+ lktbl[0] = SZ_TBL; <span class="c">/* Set table size */</span>
+ res = f_lseek(file, CREATE_LINKMAP); <span class="c">/* Create CLMT */</span>
...
- res = f_lseek(&amp;file, ofs2); <span>/* This is fast seek (file.cltbl != NULL) */</span>
+ res = f_lseek(file, ofs2); <span class="c">/* This is fast seek (file.cltbl != NULL) */</span>
</pre>
</div>
-<div class="para">
+<div class="para ref">
<h4>See Also</h4>
<p><tt><a href="open.html">f_open</a>, <a href="truncate.html">f_truncate</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/en/mkdir.html b/data/sysrom/fat/doc/en/mkdir.html
index 3427cd8..c2c1f4d 100644
--- a/data/sysrom/fat/doc/en/mkdir.html
+++ b/data/sysrom/fat/doc/en/mkdir.html
@@ -11,69 +11,59 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_mkdir</h2>
<p>The f_mkdir function creates a new directory.</p>
<pre>
FRESULT f_mkdir (
- const TCHAR* <em>DirName</em> <span>/* Pointer to the directory name */</span>
+ const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] Directory name */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameter</h4>
<dl class="par">
-<dt>DirName</dt>
+<dt>path</dt>
<dd>Pointer to the null-terminated string that specifies the <a href="filename.html">directory name</a> to create. </dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Value</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>The function succeeded.</dd>
-<dt>FR_NO_PATH</dt>
-<dd>Could not find the path.</dd>
-<dt>FR_INVALID_NAME</dt>
-<dd>The path name is invalid.</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>The drive number is invalid.</dd>
-<dt>FR_DENIED</dt>
-<dd>The directory cannot be created due to directory table or disk is full.</dd>
-<dt>FR_EXIST</dt>
-<dd>A file or directory that has same name is already existing.</dd>
-<dt>FR_NOT_READY</dt>
-<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
-<dt>FR_WRITE_PROTECTED</dt>
-<dd>The medium is write protected.</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>The function failed due to an error in the disk function.</dd>
-<dt>FR_INT_ERR</dt>
-<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>The logical drive has no work area.</dd>
-<dt>FR_NO_FILESYSTEM</dt>
-<dd>There is no valid FAT volume on the drive.</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#np">FR_NO_PATH</a>,
+<a href="rc.html#in">FR_INVALID_NAME</a>,
+<a href="rc.html#de">FR_DENIED</a>,
+<a href="rc.html#ex">FR_EXIST</a>,
+<a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>,
+<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The f_mkdir function creates a new directory.</p>
+<p>This function creates a new directory.</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_FS_MINIMIZE == 0</tt>.</p>
</div>
-<div class="para">
+<div class="para use">
<h4>Example</h4>
<pre>
res = f_mkdir("sub1");
diff --git a/data/sysrom/fat/doc/en/mkfs.html b/data/sysrom/fat/doc/en/mkfs.html
index 1dee045..5e0c727 100644
--- a/data/sysrom/fat/doc/en/mkfs.html
+++ b/data/sysrom/fat/doc/en/mkfs.html
@@ -11,69 +11,62 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_mkfs</h2>
-<p>The f_mkfs fucntion creates a file system on the drive.</p>
+<p>The f_mkfs fucntion creates an FAT file system on the logical drive.</p>
<pre>
FRESULT f_mkfs (
- BYTE <em>Drive</em>, <span>/* Logical drive number */</span>
- BYTE <em>PartitioningRule</em>, <span>/* Partitioning rule */</span>
- UINT <em>AllocSize</em> <span>/* Size of the allocation unit */</span>
+ BYTE <span class="arg">vol</span>, <span class="c">/* [IN] Logical drive number */</span>
+ BYTE <span class="arg">sfd</span>, <span class="c">/* [IN] Partitioning rule */</span>
+ UINT <span class="arg">au</span> <span class="c">/* [IN] Size of the allocation unit */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>Drive</dt>
-<dd>Logical drive number (0-9) to be formatted.</dd>
-<dt>PartitioningRule</dt>
-<dd>When 0 is given, a partition table is created into the master boot record and a primary DOS partition is created and then an FAT volume is created on the partition. This is called FDISK format and used for harddisk and memory cards. When 1 is given, the FAT volume starts from the first sector on the drive without partition table. This is called <abbr title="Super Floppy Disk">SFD</abbr> format and used for floppy disk and most optical disk.</dd>
-<dt>AllocSize</dt>
-<dd>Force the allocation unit (cluter) size in unit of byte. The value must be power of 2 and between the sector size and 128 times sector size. When invalid value is specified, the cluster size is determined depends on the volume size.</dd>
+<dt>vol</dt>
+<dd>Logical drive number to be formatted. (0 to <tt>_VOLUMES - 1</tt>)</dd>
+<dt>sfd</dt>
+<dd>Specifies partitioning rule (FDISK(0) or SFD(1)). This argument is ignored on some case.</dd>
+<dt>au</dt>
+<dd>Force the size of allocation unit (cluter) in unit of byte. The value must be sector size * n (n = 1 to 128 and power of 2). When a zero is given, the cluster size is determined depends on the volume size.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>The function succeeded.</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>The drive number is invalid.</dd>
-<dt>FR_NOT_READY</dt>
-<dd>The drive cannot work due to any reason.</dd>
-<dt>FR_WRITE_PROTECTED</dt>
-<dd>The drive is write protected.</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>The logical drive has no work area.</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>The function failed due to an error in the disk function.</dd>
-<dt>FR_MKFS_ABORTED</dt>
-<dd>The function aborted before start in format due to a reason as follows.
-<ul>
-<li>The disk size is too small.</li>
-<li>Invalid parameter was given to any parameter.</li>
-<li>Not allowable cluster size for this drive. This can occure when number of clusters gets near the 0xFF7 and 0xFFF7.</li>
-</ul>
-</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ma">FR_MKFS_ABORTED</a>,
+<a href="rc.html#ip">FR_INVALID_PARAMETER</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The f_mkfs function creates an FAT volume on the drive. There are two partitioning rules, FDISK and SFD, for removable media. The FDISK format is recommended for the most case. This function currently <em>does not support multiple partition</em>, so that existing partitions on the physical dirve will be deleted and re-created a new partition occupies entire disk space.</p>
+<p>The <tt>f_mkfs()</tt> function creates an FAT volume on the logical drive. When FDISK format is specified, a primary partition occupies the entire disk space is created and then an FAT volume is created on the partition. When SFD format is specified, the FAT volume starts from the first sector of the physical drive.</p>
+<p>If the logical drive is being bound to any partition (1-4) by multiple partition feature (<tt>_MULTI_PARTITION</tt>), the FAT volume is created into the specified partition. In this case, the second argument <tt class="arg">sfd</tt> is ignored. The physical drive must have been partitioned with f_fdisk function or any other partitioning tool prior to use this function.</p>
+<p>Note that there are two partitioning rules, FDISK and SFD. The FDISK partitioning is usually used for harddisk, MMC, SDC and CFC. It can divide a physical drive into one or more partitions with a partition table on the MBR. However Windows does not support multiple partition on the removable media. The SFD is non-partitioned method. The FAT volume starts from the first sector on the physical drive without partition table. It is used for floppy disk, Microdrive, optical disk and super-floppy media.</p>
<p>The FAT sub-type, FAT12/FAT16/FAT32, is determined by number of clusters on the volume and nothing else, according to the FAT specification issued by Microsoft. Thus which FAT sub-type is selected, is depends on the volume size and the specified cluster size. The cluster size affects performance of the file system and large cluster increases the performance.</p>
-<p>When the number of clusters gets near the FAT sub-type boundaries, the function can fail with FR_MKFS_ABORTED.</p>
+<p>When the number of clusters gets near the FAT sub-type boundaries, the function can fail with <tt>FR_MKFS_ABORTED</tt>.</p>
</div>
-
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_FS_READOLNY == 0</tt> and <tt>_USE_MKFS == 1</tt>.</p>
</div>
+<div class="para ref">
+<h4>See Also</h4>
+<p><tt><a href="filename.html#vol">Volume management</a>, <a href="fdisk.html">f_fdisk</a></tt></p>
+</div>
<p class="foot"><a href="../00index_e.html">Return</a></p>
</body>
diff --git a/data/sysrom/fat/doc/en/mount.html b/data/sysrom/fat/doc/en/mount.html
index dd3406e..8ddd583 100644
--- a/data/sysrom/fat/doc/en/mount.html
+++ b/data/sysrom/fat/doc/en/mount.html
@@ -11,52 +11,50 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_mount</h2>
<p>The f_mount fucntion registers/unregisters a work area to the FatFs module.</p>
<pre>
FRESULT f_mount (
- BYTE <em>Drive</em>, <span>/* Logical drive number */</span>
- FATFS* <em>FileSystemObject</em> <span>/* Pointer to the work area */</span>
+ BYTE <span class="arg">vol</span>, <span class="c">/* [IN] Logical drive number */</span>
+ FATFS* <span class="arg">fatfs</span> <span class="c">/* [IN] File system object */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>Drive</dt>
-<dd>Logical drive number (0-9) to register/unregister the work area.</dd>
-<dt>FileSystemObject</dt>
+<dt>vol</dt>
+<dd>Logical drive number to register/unregister the work area. (0 to <tt>_VOLUMES - 1</tt>)</dd>
+<dt>fatfs</dt>
<dd>Pointer to the work area (file system object) to be registered.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>The function succeeded.</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>The drive number is invalid.</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The f_mount function registers/unregisters a work area to the FatFs module. The work area must be given to the each volume with this function prior to use any other file function. To unregister a work area, specify a NULL to the <em>FileSystemObject</em>, and then the work area can be discarded.</p>
-<p>This function always succeeds regardless of the drive status. No media access is occured in this function and it only initializes the given work area and registers its address to the internal table. The volume mount process is performed on first file access after f_mount function or media change.</p>
+<p>The <tt>f_mount()</tt> function registers/unregisters a work area to the FatFs module. The work area must be given to the each volume with this function prior to use any other file function. To unregister a work area, specify a NULL to the <tt class="arg">fatfs</tt>, and then the work area can be discarded.</p>
+<p>This function always succeeds regardless of the drive status. No media access is occured in this function. It only clears (uninitialize) the given work area and registers its address to the internal table. It can also be used to force cleared the registered work area of a logical drive. The volume mount process, initialize physical drive, detect the FAT volume and initialize the work area, is performed on first volume access when one or both of the work area and physical drive is not initalized.</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Always available.</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>See Also</h4>
<p><tt><a href="sfatfs.html">FATFS</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/en/open.html b/data/sysrom/fat/doc/en/open.html
index 8fcea28..c095162 100644
--- a/data/sysrom/fat/doc/en/open.html
+++ b/data/sysrom/fat/doc/en/open.html
@@ -11,35 +11,35 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_open</h2>
<p>The f_open function creates a <em>file object</em> to be used to access the file.</p>
<pre>
FRESULT f_open (
- FIL* <em>FileObject</em>, <span>/* Pointer to the blank file object structure */</span>
- const TCHAR* <em>FileName</em>, <span>/* Pointer to the file neme */</span>
- BYTE <em>ModeFlags</em> <span>/* Mode flags */</span>
+ FIL* <span class="arg">fp</span>, <span class="c">/* [OUT] File object structure */</span>
+ const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] File name */</span>
+ BYTE <span class="arg">mode</span> <span class="c">/* [IN] Mode flags */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>Pointer to the file object structure to be created.</dd>
-<dt>FileName</dt>
+<dt>path</dt>
<dd>Pointer to a null-terminated string that specifies the <a href="filename.html">file name</a> to create or open.</dd>
-<dt>ModeFlags</dt>
+<dt>mode</dt>
<dd>Specifies the type of access and open method for the file. It is specified by a combination of following flags.<br>
<table class="lst">
<tr><th>Value</th><th>Description</th></tr>
-<tr><td>FA_READ</td><td>Specifies read access to the object. Data can be read from the file.<br>Combine with FA_WRITE for read-write access.</td></tr>
-<tr><td>FA_WRITE</td><td>Specifies write access to the object. Data can be written to the file.<br>Combine with FA_READ for read-write access.</td></tr>
+<tr><td>FA_READ</td><td>Specifies read access to the object. Data can be read from the file. Combine with <tt>FA_WRITE</tt> for read-write access.</td></tr>
+<tr><td>FA_WRITE</td><td>Specifies write access to the object. Data can be written to the file. Combine with <tt>FA_READ</tt> for read-write access.</td></tr>
<tr><td>FA_OPEN_EXISTING</td><td>Opens the file. The function fails if the file is not existing. (Default)</td></tr>
<tr><td>FA_OPEN_ALWAYS</td><td>Opens the file if it is existing. If not, a new file is created.<br>
-To append data to the file, use f_lseek function after file open in this method.</td></tr>
-<tr><td>FA_CREATE_NEW</td><td>Creates a new file. The function fails if the file is already existing.</td></tr>
+To append data to the file, use <a href="lseek.html"><tt>f_lseek()</tt></a> function after file open in this method.</td></tr>
+<tr><td>FA_CREATE_NEW</td><td>Creates a new file. The function fails with <tt>FR_EXIST</tt> if the file is existing.</td></tr>
<tr><td>FA_CREATE_ALWAYS</td><td>Creates a new file. If the file is existing, it is truncated and overwritten.</td></tr>
</table>
</dd>
@@ -47,94 +47,81 @@ To append data to the file, use f_lseek function after file open in this method.
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>The function succeeded and the file object is valid.</dd>
-<dt>FR_NO_FILE</dt>
-<dd>Could not find the file.</dd>
-<dt>FR_NO_PATH</dt>
-<dd>Could not find the path.</dd>
-<dt>FR_INVALID_NAME</dt>
-<dd>The file name is invalid.</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>The drive number is invalid.</dd>
-<dt>FR_EXIST</dt>
-<dd>The file is already existing.</dd>
-<dt>FR_DENIED</dt>
-<dd>The required access was denied due to one of the following reasons:
-<ul><li>Write mode open against a read-only file.</li>
-<li>File cannot be created due to a read-only file or same directory name is existing.</li>
-<li>File cannot be created due to the directory table or volume is full.</li></ul></dd>
-<dt>FR_NOT_READY</dt>
-<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
-<dt>FR_WRITE_PROTECTED</dt>
-<dd>Write mode open or creation under the medium is write protected.</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>The function failed due to an error in the disk function.</dd>
-<dt>FR_INT_ERR</dt>
-<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>The logical drive has no work area.</dd>
-<dt>FR_NO_FILESYSTEM</dt>
-<dd>There is no valid FAT volume on the drive.</dd>
-<dt>FR_LOCKED</dt>
-<dd>The function was rejected due to file shareing policy.</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#ok">FR_NO_FILE</a>,
+<a href="rc.html#np">FR_NO_PATH</a>,
+<a href="rc.html#in">FR_INVALID_NAME</a>,
+<a href="rc.html#de">FR_DENIED</a>,
+<a href="rc.html#ex">FR_EXIST</a>,
+<a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>,
+<a href="rc.html#lo">FR_LOCKED</a>,
+<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>,
+<a href="rc.html#tf">FR_TOO_MANY_OPEN_FILES</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>A file object is created when the function succeeded. The file object is used for subsequent read/write functions to refer to the file. When close an open file object, use <a href="close.html">f_close</a> function. If the modified file is not closed, the file data can be collapsed.</p>
-<p>Before using any file function, a work area (file system object) must be given to the logical drive with <a href="mount.html">f_mount</a> function. All file functions can work after this procedure.</p>
+<p>After <tt>f_open()</tt> function succeeded, the file object is valid. The file object is used for subsequent read/write functions to identify the file. If the file is modified and not closed, the file data will be collapted. To close an open file, use <a href="close.html"><tt>f_close()</tt></a> function. </p>
+<p>If duplicated file open is needed, read <a href="appnote.html#dup">here</a> carefully. However duplicated open of a file with write mode flags is always prohibited.</p>
+<p>Before using any file function, a work area (file system object) must be registered to the logical drive with <a href="mount.html"><tt>f_mount()</tt></a> function. All API functions except for <a href="fdisk.html"><tt>f_fdisk()</tt></a> function can work after this procedure.</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Always available. The mode flags, <tt>FA_WRITE, FA_CREATE_ALWAYS, FA_CREATE_NEW and FA_OPEN_ALWAYS</tt>, are not available when <tt>_FS_READONLY == 1</tt>.</p>
</div>
-<div class="para">
+<div class="para use">
<h4>Example (File Copy)</h4>
<pre>
void main (void)
{
- FATFS fs[2]; <span>/* Work area (file system object) for logical drives */</span>
- FIL fsrc, fdst; <span>/* file objects */</span>
- BYTE buffer[4096]; <span>/* file copy buffer */</span>
- FRESULT res; <span>/* FatFs function common result code */</span>
- UINT br, bw; <span>/* File read/write count */</span>
+ FATFS fs[2]; <span class="c">/* Work area (file system object) for logical drives */</span>
+ FIL fsrc, fdst; <span class="c">/* file objects */</span>
+ BYTE buffer[4096]; <span class="c">/* file copy buffer */</span>
+ FRESULT res; <span class="c">/* FatFs function common result code */</span>
+ UINT br, bw; <span class="c">/* File read/write count */</span>
- <span>/* Register work area for logical drives */</span>
+ <span class="c">/* Register work area for each volume (Always succeeds regardless of disk status) */</span>
f_mount(0, &amp;fs[0]);
f_mount(1, &amp;fs[1]);
- <span>/* Open source file on the drive 1 */</span>
+ <span class="c">/* Open source file on the drive 1 */</span>
res = f_open(&amp;fsrc, "1:srcfile.dat", FA_OPEN_EXISTING | FA_READ);
if (res) die(res);
- <span>/* Create destination file on the drive 0 */</span>
+ <span class="c">/* Create destination file on the drive 0 */</span>
res = f_open(&amp;fdst, "0:dstfile.dat", FA_CREATE_ALWAYS | FA_WRITE);
if (res) die(res);
- <span>/* Copy source to destination */</span>
+ <span class="c">/* Copy source to destination */</span>
for (;;) {
- res = f_read(&amp;fsrc, buffer, sizeof(buffer), &amp;br); <span>/* Read a chunk of src file */</span>
- if (res || br == 0) break; <span>/* error or eof */</span>
- res = f_write(&amp;fdst, buffer, br, &amp;bw); <span>/* Write it to the dst file */</span>
- if (res || bw &lt; br) break; <span>/* error or disk full */</span>
+ res = f_read(&amp;fsrc, buffer, sizeof buffer, &amp;br); <span class="c">/* Read a chunk of src file */</span>
+ if (res || br == 0) break; <span class="c">/* error or eof */</span>
+ res = f_write(&amp;fdst, buffer, br, &amp;bw); <span class="c">/* Write it to the dst file */</span>
+ if (res || bw &lt; br) break; <span class="c">/* error or disk full */</span>
}
- <span>/* Close open files */</span>
+ <span class="c">/* Close open files */</span>
f_close(&amp;fsrc);
f_close(&amp;fdst);
- <span>/* Unregister work area prior to discard it */</span>
+ <span class="c">/* Unregister work area prior to discard it */</span>
f_mount(0, NULL);
f_mount(1, NULL);
}
@@ -142,7 +129,7 @@ void main (void)
</div>
-<div class="para">
+<div class="para ref">
<h4>See Also</h4>
<p><tt><a href="read.html">f_read</a>, <a href="write.html">f_write</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a>, <a href="sfatfs.html">FATFS</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/en/opendir.html b/data/sysrom/fat/doc/en/opendir.html
index 7e9b029..8747637 100644
--- a/data/sysrom/fat/doc/en/opendir.html
+++ b/data/sysrom/fat/doc/en/opendir.html
@@ -11,66 +11,59 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_opendir</h2>
<p>The f_opendir function opens a directory.</p>
<pre>
FRESULT f_opendir (
- DIR* <em>DirObject</em>, <span>/* Pointer to the blank directory object structure */</span>
- const TCHAR* <em>DirName</em> <span>/* Pointer to the directory name */</span>
+ DIR* <span class="arg">dj</span>, <span class="c">/* [OUT] Blank directory object */</span>
+ const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] Directory name */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>DirObject</dt>
+<dt>dj</dt>
<dd>Pointer to the blank directory object to be created.</dd>
-<dt>DirName</dt>
+<dt>path</dt>
<dd>Pinter to the null-terminated string that specifies the <a href="filename.html">directory name</a> to be opened.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>The function succeeded and the directory object is created. It is used for subsequent calls to read the directory entries.</dd>
-<dt>FR_NO_PATH</dt>
-<dd>Could not find the path.</dd>
-<dt>FR_INVALID_NAME</dt>
-<dd>The path name is invalid.</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>The drive number is invalid.</dd>
-<dt>FR_NOT_READY</dt>
-<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>The function failed due to an error in the disk function.</dd>
-<dt>FR_INT_ERR</dt>
-<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>The logical drive has no work area.</dd>
-<dt>FR_NO_FILESYSTEM</dt>
-<dd>There is no valid FAT volume on the drive.</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#np">FR_NO_PATH</a>,
+<a href="rc.html#in">FR_INVALID_NAME</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>,
+<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The f_opendir function opens an exsisting directory and creates the directory object for subsequent calls. The directory object structure can be discarded at any time without any procedure.</p>
+<p>The <tt>f_opendir()</tt> function opens an exsisting directory and creates the directory object for subsequent calls. The directory object structure can be discarded at any time without any procedure.</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_FS_MINIMIZE &lt;= 1</tt>.</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>See Also</h4>
<p><tt><a href="readdir.html">f_readdir</a>, <a href="sdir.html">DIR</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/en/printf.html b/data/sysrom/fat/doc/en/printf.html
index fe62ab4..6509bdb 100644
--- a/data/sysrom/fat/doc/en/printf.html
+++ b/data/sysrom/fat/doc/en/printf.html
@@ -11,24 +11,24 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_printf</h2>
<p>The f_printf function writes formatted string to the file.</p>
<pre>
int f_printf (
- FIL* <em>FileObject</em>, <span>/* File object */</span>
- const TCHAR* <em>Foramt</em>, <span>/* Format stirng */</span>
+ FIL* <span class="arg">fp</span>, <span class="c">/* [IN] File object */</span>
+ const TCHAR* <span class="arg">fmt</span>, <span class="c">/* [IN] Format stirng */</span>
...
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>Pointer to the open file object structure.</dd>
-<dt>Format</dt>
+<dt>fmt</dt>
<dd>Pointer to the null terminated format string.</dd>
<dt>...</dt>
<dd>Optional arguments.</dd>
@@ -37,45 +37,50 @@ int f_printf (
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
<p>When the function succeeded, number of characters written is returned. When the function failed due to disk full or any error, an <tt>EOF (-1)</tt> will be returned.</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The f_printf() is a wrapper function of <a href="putc.html">f_putc()</a> and <a href="puts.html">f_puts()</a>. The format control directive is a sub-set of standard library shown as follos:</p>
+<p>The <tt>f_printf()</tt> is a wrapper function of <a href="putc.html"><tt>f_putc()</tt></a> and <a href="puts.html"><tt>f_puts()</tt></a>. The format control directive is a sub-set of standard library shown as follos:</p>
<ul>
<li>Type: <tt>c C s S d D u U x X b B</tt></li>
<li>Size: <tt>l L</tt></li>
-<li>Flag: <tt>0</tt></li>
+<li>Flag: <tt>0 -</tt></li>
</ul>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_USE_STRFUNC</tt> is 1 or 2. When it is set to 2, <tt>'\n'</tt>s contained in the output are converted to <tt>"\r\n"</tt>.</p>
-<p>When the FatFs is configured to Unicode API (<tt>_LFN_UNICODE == 1</tt>), the generated UCS-2 characters are written to the file in UTF-8 encoding. If not the case, the byte characters will be written directly.</p>
+<p>When the FatFs is configured to Unicode API (<tt>_LFN_UNICODE == 1</tt>), the generated UCS-2 string is written to the file in UTF-8 encoding. If not the case, the byte characters will be written directly.</p>
</div>
-<div class="para">
+<div class="para use">
<h4>Example</h4>
<pre>
- f_printf(&amp;fil, "%6d", -200); <span>/* " -200" */</span>
- f_printf(&amp;fil, "%02u", 5); <span>/* "05" */</span>
- f_printf(&amp;fil, "%ld", 12345678L); <span>/* "12345678" */</span>
- f_printf(&amp;fil, "%08lX", 1194684UL); <span>/* "00123ABC" */</span>
- f_printf(&amp;fil, "%08b", 0x55); <span>/* "01010101" */</span>
- f_printf(&amp;fil, "%s", "String"); <span>/* "String" */</span>
- f_printf(&amp;fil, "%c", 'a'); <span>/* "a" */</span>
+ f_printf(&amp;fil, "%d", 1234); <span class="c">/* "1234" */</span>
+ f_printf(&amp;fil, "%6d,%3d%%", -200, 5); <span class="c">/* " -200, 5%" */</span>
+ f_printf(&amp;fil, "%-6u", 100); <span class="c">/* "100 " */</span>
+ f_printf(&amp;fil, "%ld", 12345678L); <span class="c">/* "12345678" */</span>
+ f_printf(&amp;fil, "%04x", 0xA3); <span class="c">/* "00a3" */</span>
+ f_printf(&amp;fil, "%08LX", 0x123ABC); <span class="c">/* "00123ABC" */</span>
+ f_printf(&amp;fil, "%016b", 0x550F); <span class="c">/* "0101010100001111" */</span>
+ f_printf(&amp;fil, "%s", "String"); <span class="c">/* "String" */</span>
+ f_printf(&amp;fil, "%-4s", "abc"); <span class="c">/* "abc " */</span>
+ f_printf(&amp;fil, "%4s", "abc"); <span class="c">/* " abc" */</span>
+ f_printf(&amp;fil, "%c", 'a'); <span class="c">/* "a" */</span>
+ f_printf(&amp;fil, "%f", 10.0); <span class="c">/* f_printf lacks floating point support */</span>
</pre>
</div>
-<div class="para">
+<div class="para ref">
<h4>See Also</h4>
<p><tt><a href="open.html">f_open</a>, <a href="putc.html">f_putc</a>, <a href="puts.html">f_puts</a>, <a href="gets.html">f_gets</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/en/putc.html b/data/sysrom/fat/doc/en/putc.html
index 486e77f..ebb9eed 100644
--- a/data/sysrom/fat/doc/en/putc.html
+++ b/data/sysrom/fat/doc/en/putc.html
@@ -11,48 +11,48 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_putc</h2>
<p>The f_putc funciton puts a character to the file.</p>
<pre>
int f_putc (
- TCHAR <em>Chr</em>, <span>/* A character to put */</span>
- FIL* <em>FileObject</em> <span>/* File object */</span>
+ TCHAR <span class="arg">chr</span>, <span class="c">/* [IN] A character to put */</span>
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] File object */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>Chr</dt>
+<dt>chr</dt>
<dd>A character to be put.</dd>
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>Pointer to the open file object structuer.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<p>When the character was written successfuly, the function returns the character. When the function failed due to disk full or any error, an <tt>EOF (-1)</tt> will be returned.</p>
+<p>When the character was written successfuly, the function returns 1. When the function failed due to disk full or any error, an <tt>EOF (-1)</tt> will be returned.</p>
<p>When the FatFs is configured to Unicode API (<tt>_LFN_UNICODE == 1</tt>), the UCS-2 character is written to the file in UTF-8 encoding. If not the case, the byte will be written directly.</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The f_putc() is a wrapper function of <a href="write.html">f_write()</a>.</p>
+<p>The <tt>f_putc()</tt> function is a wrapper function of <a href="write.html"><tt>f_write()</tt></a> function.</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_USE_STRFUNC</tt> is 1 or 2. When it is set to 2, a <tt>'\n'</tt> is converted to <tt>"\r\n"</tt>.</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>See Also</h4>
<p><tt><a href="open.html">f_open</a>, <a href="puts.html">f_puts</a>, <a href="printf.html">f_printf</a>, <a href="gets.html">f_gets</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/en/puts.html b/data/sysrom/fat/doc/en/puts.html
index 15d9a30..c14695b 100644
--- a/data/sysrom/fat/doc/en/puts.html
+++ b/data/sysrom/fat/doc/en/puts.html
@@ -11,48 +11,48 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_puts</h2>
<p>The f_puts function writes a string to the file.</p>
<pre>
int f_puts (
- const TCHAR* <em>Str</em>, <span>/* String */</span>
- FIL* <em>FileObject</em> <span>/* File object */</span>
+ const TCHAR* <span class="arg">str</span>, <span class="c">/* [IN] String */</span>
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] File object */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>Str</dt>
+<dt>str</dt>
<dd>Pointer to the null terminated string to be written. The null character will not be written.</dd>
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>Pointer to the open file object structure.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Value</h4>
-<p>When the function succeeded, number of characters written that is not minus value is returned. When the function failed due to disk full or any error, an <tt>EOF (-1)</tt> will be returned.</p>
+<p>When the function succeeded, number of characters written that is not minus value is returned. When the write operation is aborted due to disk full or any error, an <tt>EOF (-1)</tt> will be returned.</p>
<p>When the FatFs is configured to Unicode API (<tt>_LFN_UNICODE == 1</tt>), the UCS-2 string is written to the file in UTF-8 encoding. If not the case, the byte stream will be written directly.</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The f_puts() is a wrapper function of <a href="putc.html">f_putc()</a>.</p>
+<p>The <tt>f_puts()</tt> function is a wrapper function of <a href="putc.html"><tt>f_putc()</tt></a> function.</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_USE_STRFUNC</tt> is 1 or 2. When it is set to 2, <tt>'\n'</tt>s contained in the string are converted to <tt>"\r\n"</tt>.</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>See Also</h4>
<p><tt><a href="open.html">f_open</a>, <a href="putc.html">f_putc</a>, <a href="printf.html">f_printf</a>, <a href="gets.html">f_gets</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/en/rc.html b/data/sysrom/fat/doc/en/rc.html
new file mode 100644
index 0000000..576e454
--- /dev/null
+++ b/data/sysrom/fat/doc/en/rc.html
@@ -0,0 +1,86 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="FatFs" href="../00index_e.html">
+<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/rc.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<title>FatFs - Return Codes</title>
+</head>
+
+<body>
+<h1>Return Code of the File Functions</h1>
+<p>On the FatFs API, most of file functions return common result code as enum type <tt>FRESULT</tt>. When a function succeeded, it returns zero, otherwise returns non-zero value that indicates type of error.</p>
+
+<dl class="ret">
+<dt id="ok">FR_OK (0)</dt>
+<dd>The function succeeded.</dd>
+<dt id="de">FR_DISK_ERR</dt>
+<dd>An unrecoverable error occured in the lower layer (disk I/O functions).</dd>
+<dt id="ie">FR_INT_ERR</dt>
+<dd>Assertion failed. An insanity is detected in the internal process. One of the following possibilities are suspected.
+<ul>
+<li>There is any error of the FAT structure on the volume.</li>
+<li>Work area (file system object, file object or etc...) is broken by stack overflow or any other application. This is the reason in most case.</li>
+<li>An <tt>FR_DISK_ERR</tt> has occured on the file object.</li>
+</ul>
+</dd>
+<dt id="nr">FR_NOT_READY</dt>
+<dd>The disk drive cannot work due to incorrect medium removal or <tt>disk_initialize()</tt> function failed.</dd>
+<dt id="nf">FR_NO_FILE</dt>
+<dd>Could not find the file.</dd>
+<dt id="np">FR_NO_PATH</dt>
+<dd>Could not find the path.</dd>
+<dt id="in">FR_INVALID_NAME</dt>
+<dd>The given string is invalid as the <a href="filename.html">path name</a>.</dd>
+<dt id="dn">FR_DENIED</dt>
+<dd>The required access was denied due to one of the following reasons:
+<ul>
+<li>Write mode open against the read-only file.</li>
+<li>Deleting the read-only file or directory.</li>
+<li>Deleting the non-empty directory or current directory.</li>
+<li>Reading the file opened without <tt>FA_READ</tt> flag.</li>
+<li>Any modification to the file opened without <tt>FA_WRITE</tt> flag.</li>
+<li>Could not create the file or directory due to the directory table is full.</li>
+<li>Could not create the directory due to the volume is full.</li>
+</ul>
+</dd>
+<dt id="ex">FR_EXIST</dt>
+<dd>Any file or directory that has the same name is already existing.</dd>
+<dt id="io">FR_INVALID_OBJECT</dt>
+<dd>The given file/directory object is invalid.</dd>
+<dt id="wp">FR_WRITE_PROTECTED</dt>
+<dd>Any write mode action against the write-protected media.</dd>
+<dt id="id">FR_INVALID_DRIVE</dt>
+<dd>Invalid drive number is specified. (Related option: <tt>_VOLUMES</tt>)</dd>
+<dt id="ne">FR_NOT_ENABLED</dt>
+<dd>Work area for the logical drive has not been registered by <tt>f_mount()</tt> function.</dd>
+<dt id="ns">FR_NO_FILESYSTEM</dt>
+<dd>There is no valid FAT volume on the drive.</dd>
+<dt id="ma">FR_MKFS_ABORTED</dt>
+<dd>The <tt>f_mkfs()</tt> function aborted before start in format due to a reason as follows:
+<ul>
+<li>The disk size is too small.</li>
+<li>Not allowable cluster size for this disk. This can occure when number of clusters gets near the 0xFF7 and 0xFFF7.</li>
+</ul>
+</dd>
+<dt id="tm">FR_TIMEOUT</dt>
+<dd>The function canceled due to a timeout of <a href="appnote.html#reentrant">thread-safe control</a>. (Related option: <tt>_TIMEOUT</tt>)</dd>
+<dt id="lo">FR_LOCKED</dt>
+<dd>The file access is rejected by <a href="appnote.html#dup">file sharing control</a>. (Related option: <tt>_FS_LOCK</tt>)</dd>
+<dt id="nc">FR_NOT_ENOUGH_CORE</dt>
+<dd>Not enough memory for the operation. There is one of the following reasons:
+<ul>
+<li>Could not allocate a memory for LFN working buffer. (Related option: <tt>_USE_LFN</tt>)</li>
+<li>Given CLMT is insufficient size for the required size.</li>
+</ul>
+</dd>
+<dt id="tf">FR_TOO_MANY_OPEN_FILES</dt>
+<dd>Number of open files has been reached maximum value and no more file can be opened. (Related option: <tt>_FS_LOCK</tt>)</dd>
+<dt id="ip">FR_INVALID_PARAMETER</dt>
+<dd>The given parameter is invalid or there is any inconsistent.</dd>
+</dl>
+
+</body>
+</html>
diff --git a/data/sysrom/fat/doc/en/read.html b/data/sysrom/fat/doc/en/read.html
index 9e454fc..5acf85a 100644
--- a/data/sysrom/fat/doc/en/read.html
+++ b/data/sysrom/fat/doc/en/read.html
@@ -11,66 +11,60 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_read</h2>
<p>The f_read function reads data from a file.</p>
<pre>
FRESULT f_read (
- FIL* <em>FileObject</em>, <span>/* Pointer to the file object structure */</span>
- void* <em>Buffer</em>, <span>/* Pointer to the buffer to store read data */</span>
- UINT <em>ByteToRead</em>, <span>/* Number of bytes to read */</span>
- UINT* <em>ByteRead</em> <span>/* Pointer to the variable to return number of bytes read */</span>
+ FIL* <span class="arg">fp</span>, <span class="c">/* [IN] File object */</span>
+ void* <span class="arg">buff</span>, <span class="c">/* [OUT] Buffer to store read data */</span>
+ UINT <span class="arg">btr</span>, <span class="c">/* [IN] Number of bytes to read */</span>
+ UINT* <span class="arg">br</span> <span class="c">/* [OUT] Number of bytes read */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>Pointer to the open file object.</dd>
-<dt>Buffer</dt>
+<dt>buff</dt>
<dd>Pointer to the buffer to store read data</dd>
-<dt>ByteToRead</dt>
-<dd>Number of bytes to read in range of UINT.</dd>
-<dt>ByteRead</dt>
-<dd>Pointer to the UINT variable to return number of bytes read. The value is always valid after the function call regardless of the result.</dd>
+<dt>btr</dt>
+<dd>Number of bytes to read in range of <tt>UINT</tt> type.</dd>
+<dt>br</dt>
+<dd>Pointer to the <tt>UINT</tt> variable to return number of bytes read. The value is always valid after the function call regardless of the result.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>The function succeeded.</dd>
-<dt>FR_DENIED</dt>
-<dd>The function denied due to the file has been opened in non-read mode.</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>The function failed due to an error in the disk function.</dd>
-<dt>FR_INT_ERR</dt>
-<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
-<dt>FR_NOT_READY</dt>
-<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
-<dt>FR_INVALID_OBJECT</dt>
-<dd>The file object is invalid.</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#io">FR_INVALID_OBJECT</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The file pointer of the file object increases in number of bytes read. After the function succeeded, <tt>*ByteRead</tt> should be checked to detect the end of file. In case of <tt>*ByteRead &lt; ByteToRead</tt>, it means the read/write pointer reached end of the file during read operation.</p>
+<p>The file read/write pointer of the file object advances number of bytes read. After the function succeeded, <tt class="arg">*br</tt> should be checked to detect the end of file. In case of <tt class="arg">*br</tt> is less than <tt class="arg">btr</tt>, it means the read/write pointer reached end of the file during read operation.</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Always available.</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>See Also</h4>
<p><tt><a href="open.html">f_open</a>, <a href="gets.html">fgets</a>, <a href="write.html">f_write</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/en/readdir.html b/data/sysrom/fat/doc/en/readdir.html
index cec8f61..a01219c 100644
--- a/data/sysrom/fat/doc/en/readdir.html
+++ b/data/sysrom/fat/doc/en/readdir.html
@@ -11,94 +11,93 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_readdir</h2>
<p>The f_readdir function reads directory entries.</p>
<pre>
FRESULT f_readdir (
- DIR* <em>DirObject</em>, <span>/* Pointer to the open directory object */</span>
- FILINFO* <em>FileInfo</em> <span>/* Pointer to the file information structure */</span>
+ DIR* <span class="arg">dj</span>, <span class="c">/* [IN] Directory object */</span>
+ FILINFO* <span class="arg">fno</span> <span class="c">/* [OUT] File information structure */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>DirObject</dt>
+<dt>dj</dt>
<dd>Pointer to the open directory object.</dd>
-<dt>FileInfo</dt>
+<dt>fno</dt>
<dd>Pointer to the file information structure to store the read item.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>The function succeeded.</dd>
-<dt>FR_NOT_READY</dt>
-<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>The function failed due to an error in the disk function.</dd>
-<dt>FR_INT_ERR</dt>
-<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
-<dt>FR_INVALID_OBJECT</dt>
-<dd>The directory object is invalid.</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#io">FR_INVALID_OBJECT</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>,
+<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The f_readdir function reads directory entries in sequence. All items in the directory can be read by calling f_readdir function repeatedly. When all directory entries have been read and no item to read, the function returns a null string into <tt>f_name[]</tt> member without any error. When a null pointer is given to the <tt>FileInfo</tt>, the read index of the directory object will be rewinded.</p>
-<p>When LFN feature is enabled, <tt>lfname</tt> and <tt>lfsize</tt> in the file information structure must be initialized with valid value prior to use the f_readdir function. The <tt>lfname</tt> is a pointer to the string buffer to return the long file name. The <tt>lfsize</tt> is the size of the string buffer in unit of character. If either the size of read buffer or LFN working buffer is insufficient for the LFN or the object has no LFN, a null string will be returned to the LFN read buffer. If the LFN contains any charactrer that cannot be converted to OEM code, a null string will be returned but this is not the case on Unicode API configuration. When <tt>lfname</tt> is a NULL, nothing of the LFN is returned. When the object has no LFN, any small capitals can be contained in the SFN.</p>
-<p>When relative path feature is enabled <tt>(_FS_RPATH == 1)</tt>, "." and ".." entries are not filtered out and it will appear in the read entries.</p>
+<p>The <tt>f_readdir()</tt> function reads directory items, file and directory, in sequence. All items in the directory can be read by calling <tt>f_readdir()</tt> function repeatedly. When all directory items have been read and no item to read, the function returns a null string into <tt>fname[]</tt> member without any error. When a null pointer is given to the <tt class="arg">fno</tt>, the read index of the directory object will be rewinded.</p>
+<p>When LFN feature is enabled, <tt>lfname</tt> and <tt>lfsize</tt> in the file information structure must be initialized with valid value prior to use the this function. The <tt>lfname</tt> is a pointer to the string buffer to return the long file name. The <tt>lfsize</tt> is the size of the string buffer in unit of <tt>TCHAR</tt>. If either the size of read buffer or LFN working buffer is insufficient for the LFN or the object has no LFN, a null string will be returned to the LFN read buffer. If the LFN contains any charactrer that cannot be converted to OEM code, a null string will be returned but this is not the case on Unicode API configuration. When <tt>lfname</tt> is a null, nothing of the LFN is returned. When the object has no LFN, some small capitals can be contained in the SFN in the <tt>fname[]</tt>.</p>
+<p>When relative path feature is enabled (<tt>_FS_RPATH == 1</tt>), dot entries ("." and "..") are not filtered out and they will appear in the read items.</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_FS_MINIMIZE &lt;= 1</tt>.</p>
</div>
-<div class="para">
+<div class="para use">
<h4>Sample Code</h4>
<pre>
-FRESULT scan_files (char* path)
+FRESULT scan_files (
+ char* path <span class="c">/* Start node to be scanned (also used as work area) */</span>
+)
{
FRESULT res;
FILINFO fno;
DIR dir;
int i;
- char *fn;
-#if _USE_LFN
- static char lfn[_MAX_LFN * (_DF1S ? 2 : 1) + 1];
+ char *fn; <span class="c">/* This function is assuming non-Unicode cfg. */</span>
+<span class="k">#if</span> _USE_LFN
+ static char lfn[_MAX_LFN + 1];
fno.lfname = lfn;
- fno.lfsize = sizeof(lfn);
-#endif
+ fno.lfsize = sizeof lfn;
+<span class="k">#endif</span>
- res = f_opendir(&amp;dir, path);
+ res = f_opendir(&amp;dir, path); <span class="c">/* Open the directory */</span>
if (res == FR_OK) {
i = strlen(path);
for (;;) {
- res = f_readdir(&amp;dir, &amp;fno);
- if (res != FR_OK || fno.fname[0] == 0) break;
- if (fno.fname[0] == '.') continue;
-#if _USE_LFN
+ res = f_readdir(&amp;dir, &amp;fno); <span class="c">/* Read a directory item */</span>
+ if (res != FR_OK || fno.fname[0] == 0) break; <span class="c">/* Break on error or end of dir */</span>
+ if (fno.fname[0] == '.') continue; <span class="c">/* Ignore dot entry */</span>
+<span class="k">#if</span> _USE_LFN
fn = *fno.lfname ? fno.lfname : fno.fname;
-#else
+<span class="k">#else</span>
fn = fno.fname;
-#endif
- if (fno.fattrib &amp; AM_DIR) {
+<span class="k">#endif</span>
+ if (fno.fattrib &amp; AM_DIR) { <span class="c">/* It is a directory */</span>
sprintf(&amp;path[i], "/%s", fn);
res = scan_files(path);
if (res != FR_OK) break;
path[i] = 0;
- } else {
+ } else { <span class="c">/* It is a file. */</span>
printf("%s/%s\n", path, fn);
}
}
@@ -110,7 +109,7 @@ FRESULT scan_files (char* path)
</div>
-<div class="para">
+<div class="para ref">
<h4>See Also</h4>
<p><tt><a href="opendir.html">f_opendir</a>, <a href="stat.html">f_stat</a>, <a href="sfileinfo.html">FILINFO</a>, <a href="sdir.html">DIR</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/en/rename.html b/data/sysrom/fat/doc/en/rename.html
index 91c518b..3b609a6 100644
--- a/data/sysrom/fat/doc/en/rename.html
+++ b/data/sysrom/fat/doc/en/rename.html
@@ -11,86 +11,75 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_rename</h2>
<p>Renames an object.</p>
<pre>
FRESULT f_rename (
- const TCHAR* <em>OldName</em>, <span>/* Pointer to old object name */</span>
- const TCHAR* <em>NewName</em> <span>/* Pointer to new object name */</span>
+ const TCHAR* <span class="arg">old_name</span>, <span class="c">/* [IN] Old object name */</span>
+ const TCHAR* <span class="arg">new_name</span> <span class="c">/* [IN] New object name */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>OldName</dt>
+<dt>old_name</dt>
<dd>Pointer to a null-terminated string specifies the old <a href="filename.html">object name</a> to be renamed.</dd>
-<dt>NewName</dt>
+<dt>new_name</dt>
<dd>Pointer to a null-terminated string specifies the new object name without drive number.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>The function succeeded.</dd>
-<dt>FR_NO_FILE</dt>
-<dd>Could not find the old name.</dd>
-<dt>FR_NO_PATH</dt>
-<dd>Could not find the path.</dd>
-<dt>FR_INVALID_NAME</dt>
-<dd>The file name is invalid.</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>The drive number is invalid.</dd>
-<dt>FR_NOT_READY</dt>
-<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
-<dt>FR_EXIST</dt>
-<dd>The new name is colliding with an existing name.</dd>
-<dt>FR_DENIED</dt>
-<dd>The new name could not be created due to any reason.</dd>
-<dt>FR_WRITE_PROTECTED</dt>
-<dd>The medium is write protected.</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>The function failed due to an error in the disk function.</dd>
-<dt>FR_INT_ERR</dt>
-<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>The logical drive has no work area.</dd>
-<dt>FR_NO_FILESYSTEM</dt>
-<dd>There is no valid FAT volume on the drive.</dd>
-<dt>FR_LOCKED</dt>
-<dd>The function was rejected due to file shareing policy.</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#ok">FR_NO_FILE</a>,
+<a href="rc.html#np">FR_NO_PATH</a>,
+<a href="rc.html#in">FR_INVALID_NAME</a>,
+<a href="rc.html#de">FR_DENIED</a>,
+<a href="rc.html#ex">FR_EXIST</a>,
+<a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>,
+<a href="rc.html#lo">FR_LOCKED</a>,
+<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>Renames an object and can also move it to other directory. The logical drive number is determined by old name, new name must not contain a logical drive number. <em>Do not rename open objects</em>.</p>
+<p>Renames an object (file or directory) and can also move it to other directory. The logical drive number is determined by old name, new name must not contain a logical drive number. <em>Do not rename open objects</em> or directry table can be collapted.</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_FS_MINIMIZE == 0</tt>.</p>
</div>
-<div class="para">
+<div class="para use">
<h4>Example</h4>
<pre>
- <span>/* Rename an object */</span>
+ <span class="c">/* Rename an object */</span>
f_rename("oldname.txt", "newname.txt");
- <span>/* Rename and move an object to other directory */</span>
+ <span class="c">/* Rename and move an object to other directory */</span>
f_rename("oldname.txt", "dir1/newname.txt");
</pre>
</div>
+
<p class="foot"><a href="../00index_e.html">Return</a></p>
</body>
</html>
diff --git a/data/sysrom/fat/doc/en/sdir.html b/data/sysrom/fat/doc/en/sdir.html
index 06dd74c..5b16937 100644
--- a/data/sysrom/fat/doc/en/sdir.html
+++ b/data/sysrom/fat/doc/en/sdir.html
@@ -13,21 +13,21 @@
<div class="para">
<h2>DIR</h2>
-<p>The <tt>DIR</tt> structure is used for the work area to read a directory by f_oepndir, f_readdir function. There is no member that can be changed by application.</p>
+<p>The <tt>DIR</tt> structure is used for the work area to read a directory by <tt>f_oepndir()/f_readdir()</tt> function. Application program must not modify any member in this structure.</p>
<pre>
-typedef struct {
- FATFS* fs; <span>/* Pointer to the owner file system object */</span>
- WORD id; <span>/* Owner file system mount ID */</span>
- WORD index; <span>/* Directory index number to be read/write next */</span>
- DWORD sclust; <span>/* Table start cluster (0:Root dir) */</span>
- DWORD clust; <span>/* Current cluster */</span>
- DWORD sect; <span>/* Current sector */</span>
- BYTE* dir; <span>/* Pointer to the current SFN entry in the win[] */</span>
- BYTE* fn; <span>/* Pointer to the SFN (in/out) {file[8],ext[3],status[1]} */</span>
-#if _USE_LFN
- WCHAR* lfn; <span>/* Pointer to the LFN working buffer */</span>
- WORD lfn_idx; <span>/* Last matched LFN index (0xFFFF:No LFN) */</span>
-#endif
+<span class="k">typedef</span> <span class="k">struct</span> {
+ FATFS* fs; <span class="c">/* Pointer to the owner file system object */</span>
+ WORD id; <span class="c">/* Owner file system mount ID */</span>
+ WORD index; <span class="c">/* Index of directory entry to start to search next */</span>
+ DWORD sclust; <span class="c">/* Table start cluster (0:Root dir) */</span>
+ DWORD clust; <span class="c">/* Current cluster */</span>
+ DWORD sect; <span class="c">/* Current sector */</span>
+ BYTE* dir; <span class="c">/* Pointer to the current SFN entry in the win[] */</span>
+ BYTE* fn; <span class="c">/* Pointer to the SFN (in/out) {file[8],ext[3],status[1]} */</span>
+<span class="k">#if</span> _USE_LFN
+ WCHAR* lfn; <span class="c">/* Pointer to the LFN working buffer */</span>
+ WORD lfn_idx; <span class="c">/* Index of last matched LFN entry (0xFFFF:No LFN) */</span>
+<span class="k">#endif</span>
} DIR;
</pre>
</div>
diff --git a/data/sysrom/fat/doc/en/setlabel.html b/data/sysrom/fat/doc/en/setlabel.html
new file mode 100644
index 0000000..eaeda54
--- /dev/null
+++ b/data/sysrom/fat/doc/en/setlabel.html
@@ -0,0 +1,89 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="FatFs" href="../00index_e.html">
+<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/setlabel.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<title>FatFs - f_setlabel</title>
+</head>
+
+<body>
+
+<div class="para func">
+<h2>f_setlabel</h2>
+<p>The f_setlabel function sets/removes the label of a volume.</p>
+<pre>
+FRESULT f_setlabel (
+ const TCHAR* <span class="arg">name</span> <span class="c">/* [IN] Volume label to be set */</span>
+);
+</pre>
+</div>
+
+<div class="para arg">
+<h4>Parameters</h4>
+<dl class="par">
+<dt>name</dt>
+<dd>Pointer to the nul-terminated string specifying the volume label to be set.</dd>
+</dl>
+</div>
+
+
+<div class="para ret">
+<h4>Return Values</h4>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#in">FR_INVALID_NAME</a>,
+<a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>
+</p>
+</div>
+
+
+<div class="para desc">
+<h4>Description</h4>
+<p>When the string has a drive number, the volume label will be set to the volume specified by the drive number. If the volume label is a null-string, the volume label on the volume will be removed. The format of the volume label is similar to the SFN but there are some difference shown below:</p>
+<ul>
+<li>11 bytes or less in length as local character code.</li>
+<li>Cannot contain period.</li>
+<li>Can contain spaces anywhere in the name.</li>
+</ul>
+</div>
+
+<div class="para comp">
+<h4>QuickInfo</h4>
+<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_USE_LABEL == 1</tt>.</p>
+</div>
+
+
+<div class="para use">
+<h4>Example</h4>
+<pre>
+ <span class="c">/* Set volume label to the default drive */</span>
+ f_setlabel("DATA DISK");
+
+ <span class="c">/* Set volume label to the drive 2 */</span>
+ f_setlabel("2:DISK 3 OF 4");
+
+ <span class="c">/* Remove volume label of the drive 2 */</span>
+ f_setlabel("2:");
+</pre>
+</div>
+
+
+<div class="para ref">
+<h4>See Also</h4>
+<tt><a href="getlabel.html">f_getlabel</a></tt>
+</div>
+
+
+<p class="foot"><a href="../00index_e.html">Return</a></p>
+</body>
+</html>
diff --git a/data/sysrom/fat/doc/en/sfatfs.html b/data/sysrom/fat/doc/en/sfatfs.html
index bb3b174..ba0bb56 100644
--- a/data/sysrom/fat/doc/en/sfatfs.html
+++ b/data/sysrom/fat/doc/en/sfatfs.html
@@ -13,38 +13,39 @@
<div class="para">
<h2>FATFS</h2>
-<p>The <tt>FATFS</tt> structure holds dynamic work area of individual logical drives. It is given by application program and registerd/unregisterd to the FatFs module with f_mount function. Following members are in standard configuration. There is no member that can be changed from the application program.</p>
+<p>The <tt>FATFS</tt> structure (file system object) holds dynamic work area of individual logical drives. It is given by application program and registerd/unregisterd to the FatFs module with <tt>f_mount()</tt> function. Initialization is done on first API call after <tt>f_mount()</tt> function or media change. Application program must not modify any member in this structure.</p>
<pre>
-typedef struct {
- BYTE fs_type; <span>/* FAT sub-type (0:Not mounted) */</span>
- BYTE drv; <span>/* Physical drive number */</span>
- BYTE csize; <span>/* Sectors per cluster (1,2,4...128) */</span>
- BYTE n_fats; <span>/* Number of FAT copies (1,2) */</span>
- BYTE wflag; <span>/* win[] dirty flag */</span>
- BYTE fsi_flag; <span>/* fsinfo dirty flag */</span>
- WORD id; <span>/* File system mount ID */</span>
- WORD n_rootdir; <span>/* Number of root directory entries (FAT12/16) */</span>
-#if _MAX_SS != 512
- WORD ssize; <span>/* Sector size (512,1024,2048,4096) */</span>
-#endif
-#if _FS_REENTRANT
- _SYNC_t sobj; <span>/* Identifier of sync object */</span>
-#endif
-#if !_FS_READONLY
- DWORD last_clust; <span>/* Last allocated cluster */</span>
- DWORD free_clust; <span>/* Number of free clusters */</span>
- DWORD fsi_sector; <span>/* fsinfo sector (FAT32) */</span>
-#endif
-#if _FS_RPATH
- DWORD cdir; <span>/* Current directory cluster (0:root) */</span>
-#endif
- DWORD n_fatent; <span>/* Number of FAT entries (= number of clusters + 2) */</span>
- DWORD fsize; <span>/* Sectors per FAT */</span>
- DWORD fatbase; <span>/* FAT area start sector */</span>
- DWORD dirbase; <span>/* Root directory area start sector (FAT32: cluster#) */</span>
- DWORD database; <span>/* Data area start sector */</span>
- DWORD winsect; <span>/* Current sector appearing in the win[] */</span>
- BYTE win[_MAX_SS]; <span>/* Disk access window for Directory, FAT (and Data on tiny cfg) */</span>
+<span class="k">typedef</span> <span class="k">struct</span> {
+ BYTE fs_type; <span class="c">/* FAT sub-type (0:Not mounted) */</span>
+ BYTE drv; <span class="c">/* Physical drive number */</span>
+ BYTE csize; <span class="c">/* Sectors per cluster (1,2,4...128) */</span>
+ BYTE n_fats; <span class="c">/* Number of FAT copies (1,2) */</span>
+ BYTE wflag; <span class="c">/* win[] dirty flag */</span>
+ BYTE fsi_flag; <span class="c">/* fsinfo dirty flag */</span>
+ WORD id; <span class="c">/* File system mount ID */</span>
+ WORD n_rootdir; <span class="c">/* Number of root directory entries (FAT12/16) */</span>
+<span class="k">#if</span> _MAX_SS != 512
+ WORD ssize; <span class="c">/* Sector size (512,1024,2048 or 4096) */</span>
+<span class="k">#endif</span>
+<span class="k">#if</span> _FS_REENTRANT
+ _SYNC_t sobj; <span class="c">/* Identifier of sync object */</span>
+<span class="k">#endif</span>
+<span class="k">#if</span> !_FS_READONLY
+ DWORD last_clust; <span class="c">/* Last allocated cluster */</span>
+ DWORD free_clust; <span class="c">/* Number of free clusters */</span>
+ DWORD fsi_sector; <span class="c">/* fsinfo sector (FAT32) */</span>
+<span class="k">#endif</span>
+<span class="k">#if</span> _FS_RPATH
+ DWORD cdir; <span class="c">/* Current directory cluster (0:root) */</span>
+<span class="k">#endif</span>
+ DWORD n_fatent; <span class="c">/* Number of FAT entries (== Number of clusters + 2) */</span>
+ DWORD fsize; <span class="c">/* Sectors per FAT */</span>
+ DWORD volbase; <span class="c">/* Volume start sector */</span>
+ DWORD fatbase; <span class="c">/* FAT area start sector */</span>
+ DWORD dirbase; <span class="c">/* Root directory area start sector (FAT32: Cluster#) */</span>
+ DWORD database; <span class="c">/* Data area start sector */</span>
+ DWORD winsect; <span class="c">/* Current sector appearing in the win[] */</span>
+ BYTE win[_MAX_SS]; <span class="c">/* Disk access window for Directory, FAT (and file data on tiny cfg) */</span>
} FATFS;
</pre>
</div>
diff --git a/data/sysrom/fat/doc/en/sfile.html b/data/sysrom/fat/doc/en/sfile.html
index 70415fd..476498b 100644
--- a/data/sysrom/fat/doc/en/sfile.html
+++ b/data/sysrom/fat/doc/en/sfile.html
@@ -13,32 +13,32 @@
<div class="para">
<h2>FIL</h2>
-<p>The FIL structure (file object) holds state of an open file. It is created by f_open function and discarded by f_close function. There is no member that can be changed by the application program except for <tt>cltbl</tt>. Note that a sector buffer is defined in this structure under non-tiny configuration so that the FIL structures should not be defined as auto variable.</p>
+<p>The <tt>FIL</tt> structure (file object) holds state of an open file. It is created by <tt>f_open()</tt> function and discarded by <tt>f_close()</tt> function. Application program must not modify any member in this structure except for <tt>cltbl</tt>. Note that a sector buffer is defined in this structure under non-tiny configuration, so that the <tt>FIL</tt> structures should not be defined as auto variable.</p>
<pre>
-typedef struct {
- FATFS* fs; <span>/* Pointer to the owner file system object */</span>
- WORD id; <span>/* Owner file system mount ID */</span>
- BYTE flag; <span>/* File status flags */</span>
+<span class="k">typedef</span> <span class="k">struct</span> {
+ FATFS* fs; <span class="c">/* Pointer to the owner file system object */</span>
+ WORD id; <span class="c">/* Owner file system mount ID */</span>
+ BYTE flag; <span class="c">/* File status flags */</span>
BYTE pad1;
- DWORD fptr; <span>/* File read/write pointer (Byte offset origin from top of the file) */</span>
- DWORD fsize; <span>/* File size */</span>
- DWORD org_clust; <span>/* File start cluster */</span>
- DWORD curr_clust; <span>/* Current cluster */</span>
- DWORD dsect; <span>/* Current data sector */</span>
-#if !_FS_READONLY
- DWORD dir_sect; <span>/* Sector containing the directory entry */</span>
- BYTE* dir_ptr; <span>/* Ponter to the directory entry in the window */</span>
-#endif
-#if _USE_FASTSEEK
- DWORD* cltbl; <span>/* Pointer to the cluster link map table (Nulled on file open) */</span>
-#endif
-#if _FS_SHARE
- UINT lockid; <span>/* File lock ID */</span>
-#endif
-#if !_FS_TINY
- BYTE buf[_MAX_SS]; <span>/* Data read/write buffer */</span>
-#endif
+ DWORD fptr; <span class="c">/* File read/write pointer (Byte offset origin from top of the file) */</span>
+ DWORD fsize; <span class="c">/* File size */</span>
+ DWORD sclust; <span class="c">/* File start cluster */</span>
+ DWORD clust; <span class="c">/* Current cluster */</span>
+ DWORD dsect; <span class="c">/* Current data sector */</span>
+<span class="k">#if</span> !_FS_READONLY
+ DWORD dir_sect; <span class="c">/* Sector containing the directory entry */</span>
+ BYTE* dir_ptr; <span class="c">/* Ponter to the directory entry in the window */</span>
+<span class="k">#endif</span>
+<span class="k">#if</span> _USE_FASTSEEK
+ DWORD* cltbl; <span class="c">/* Pointer to the cluster link map table (Nulled on file open) */</span>
+<span class="k">#endif</span>
+<span class="k">#if</span> _FS_SHARE
+ UINT lockid; <span class="c">/* File lock ID */</span>
+<span class="k">#endif</span>
+<span class="k">#if</span> !_FS_TINY
+ BYTE buf[_MAX_SS]; <span class="c">/* Data read/write buffer */</span>
+<span class="k">#endif</span>
} FIL;
</pre>
diff --git a/data/sysrom/fat/doc/en/sfileinfo.html b/data/sysrom/fat/doc/en/sfileinfo.html
index fe60405..5a3c997 100644
--- a/data/sysrom/fat/doc/en/sfileinfo.html
+++ b/data/sysrom/fat/doc/en/sfileinfo.html
@@ -13,18 +13,18 @@
<div class="para">
<h2>FILINFO</h2>
-<p>The <tt>FILINFO</tt> structure holds a file information returned by f_stat and f_readdir function.</p>
+<p>The <tt>FILINFO</tt> structure holds a file information returned by <tt>f_readdir()</tt> and <tt>f_stat()</tt> function.</p>
<pre>
-typedef struct {
- DWORD fsize; <span>/* File size */</span>
- WORD fdate; <span>/* Last modified date */</span>
- WORD ftime; <span>/* Last modified time */</span>
- BYTE fattrib; <span>/* Attribute */</span>
- TCHAR fname[13]; <span>/* Short file name (8.3 format) */</span>
-#if _USE_LFN
- TCHAR* lfname; <span>/* Pointer to the LFN buffer */</span>
- int lfsize; <span>/* Size of the LFN buffer in unit of TCHAR */</span>
-#endif
+<span class="k">typedef struct</span> {
+ DWORD fsize; <span class="c">/* File size */</span>
+ WORD fdate; <span class="c">/* Last modified date */</span>
+ WORD ftime; <span class="c">/* Last modified time */</span>
+ BYTE fattrib; <span class="c">/* Attribute */</span>
+ TCHAR fname[13]; <span class="c">/* Short file name (8.3 format) */</span>
+<span class="k">#if</span> _USE_LFN
+ TCHAR* lfname; <span class="c">/* Pointer to the LFN buffer */</span>
+ int lfsize; <span class="c">/* Size of the LFN buffer in unit of TCHAR */</span>
+<span class="k">#endif</span>
} FILINFO;
</pre>
</div>
@@ -32,7 +32,7 @@ typedef struct {
<h4>Members</h4>
<dl>
<dt>fsize</dt>
-<dd>Indicates size of the file in unit of byte. This is always zero when it is a directory.</dd>
+<dd>Indicates size of the file in unit of byte. Always zero for directories.</dd>
<dt>fdate</dt>
<dd>Indicates the date that the file was modified or the directory was created.<br>
<dl>
@@ -62,7 +62,7 @@ typedef struct {
<dt>lfname</dt>
<dd>Pointer to the LFN buffer to store the read LFN. This member must be initialized by application prior to use this structure. Not available on non-LFN configuration.</dd>
<dt>lfsize</dt>
-<dd>Size of the LFN buffer in unit of chars. This member must be initialized by application prior to use this structure. Not available on non-LFN configuration.</dd>
+<dd>Size of the LFN buffer in unit of TCHAR. This member must be initialized by application prior to use this structure. Not available on non-LFN configuration.</dd>
</dl>
<p class="foot"><a href="../00index_e.html">Return</a></p>
diff --git a/data/sysrom/fat/doc/en/size.html b/data/sysrom/fat/doc/en/size.html
new file mode 100644
index 0000000..bb786c6
--- /dev/null
+++ b/data/sysrom/fat/doc/en/size.html
@@ -0,0 +1,62 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="FatFs" href="../00index_e.html">
+<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/size.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<title>FatFs - f_size</title>
+</head>
+
+<body>
+
+<div class="para func">
+<h2>f_size</h2>
+<p>The f_size function gets the size of a file.</p>
+<pre>
+DWORD f_size (
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] File object */</span>
+);
+</pre>
+</div>
+
+
+<div class="para arg">
+<h4>Parameters</h4>
+<dl class="par">
+<dt>fp</dt>
+<dd>Pointer to the open file object structure.</dd>
+</dl>
+</div>
+
+
+<div class="para ret">
+<h4>Return Values</h4>
+<p>Returns the size of the file in unit of byte.</p>
+</div>
+
+
+<div class="para desc">
+<h4>Description</h4>
+<p>In this revision, the <tt>f_size()</tt> function is implemented as a macro.</p>
+<pre>
+<span class="k">#define</span> f_size(fp) ((fp)->fsize)
+</pre>
+</div>
+
+
+<div class="para comp">
+<h4>QuickInfo</h4>
+<p>Always available.</p>
+</div>
+
+
+<div class="para ref">
+<h4>See Also</h4>
+<p><tt><a href="open.html">f_open</a>, <a href="lseek.html">f_lseek</a>, <a href="sfile.html">FIL</a></tt></p>
+</div>
+
+<p class="foot"><a href="../00index_e.html">Return</a></p>
+</body>
+</html>
diff --git a/data/sysrom/fat/doc/en/stat.html b/data/sysrom/fat/doc/en/stat.html
index 0807990..05296f9 100644
--- a/data/sysrom/fat/doc/en/stat.html
+++ b/data/sysrom/fat/doc/en/stat.html
@@ -11,62 +11,54 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_stat</h2>
<p>The f_stat gets the file status.</p>
<pre>
FRESULT f_stat (
- const TCHAR* <em>FileName</em>, <span>/* Pointer to the file or directory name */</span>
- FILINFO* <em>FileInfo</em> <span>/* Pointer to the FILINFO structure */</span>
+ const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] Object name */</span>
+ FILINFO* <span class="arg">fno</span> <span class="c">/* [OUT] FILINFO structure */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>FileName</dt>
+<dt>path</dt>
<dd>Pointer to the null-terminated string that specifies the <a href="filename.html">file or directory</a> to get its information.</dd>
-<dt>FileInfo</dt>
+<dt>fno</dt>
<dd>Pointer to the blank <tt>FILINFO</tt> structure to store the information.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>The function succeeded.</dd>
-<dt>FR_NO_FILE</dt>
-<dd>Could not find the file or directory.</dd>
-<dt>FR_NO_PATH</dt>
-<dd>Could not find the path.</dd>
-<dt>FR_INVALID_NAME</dt>
-<dd>The file name is invalid.</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>The drive number is invalid.</dd>
-<dt>FR_NOT_READY</dt>
-<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>The function failed due to an error in the disk function.</dd>
-<dt>FR_INT_ERR</dt>
-<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>The logical drive has no work area.</dd>
-<dt>FR_NO_FILESYSTEM</dt>
-<dd>There is no valid FAT volume on the drive.</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#ok">FR_NO_FILE</a>,
+<a href="rc.html#np">FR_NO_PATH</a>,
+<a href="rc.html#in">FR_INVALID_NAME</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>,
+<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The f_stat gets the information of a file or directory. For details of the infomation, refer to the <tt>FILINFO</tt> structure and <a href="readdir.html">f_readdir</a> function. This function is not supported in minimization level of &gt;= 1.</p>
+<p>The <tt>f_stat()</tt> function gets the size, timestamp and attribute of a file or directory. For details of the infomation, refer to the <tt>FILINFO</tt> structure and <a href="readdir.html"><tt>f_readdir()</tt></a> function. This function is not supported in minimization level of &gt;= 1.</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>References</h4>
<p><tt><a href="opendir.html">f_opendir</a>, <a href="readdir.html">f_readdir</a>, <a href="sfileinfo.html">FILINFO</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/en/sync.html b/data/sysrom/fat/doc/en/sync.html
index 4a42e7b..c3eff8d 100644
--- a/data/sysrom/fat/doc/en/sync.html
+++ b/data/sysrom/fat/doc/en/sync.html
@@ -11,55 +11,51 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_sync</h2>
<p>The f_sync function flushes the cached information of a writing file.</p>
<pre>
FRESULT f_sync (
- FIL* <em>FileObject</em> <span>/* Pointer to the file object */</span>
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] File object */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameter</h4>
<dl class="par">
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>Pointer to the open file object to be flushed.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>The function succeeded.</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>The function failed due to an error in the disk function.</dd>
-<dt>FR_INT_ERR</dt>
-<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
-<dt>FR_NOT_READY</dt>
-<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
-<dt>FR_INVALID_OBJECT</dt>
-<dd>The file object is invalid.</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#io">FR_INVALID_OBJECT</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The f_sync function performs the same process as f_close function but the file is left opened and can continue read/write/seek operations to the file. This is suitable for the applications that open files for a long time in write mode, such as data logger. Performing f_sync of periodic or immediataly after f_write can minimize the risk of data loss due to a sudden blackout or an unintentional disk removal. However f_sync immediataly before f_close has no advantage because f_close performs f_sync in it. In other words, the differnce between those functions is that the file object is invalidated or not. </p>
+<p>The <tt>f_sync()</tt> function performs the same process as <tt>f_close()</tt> function but the file is left opened and can continue read/write/seek operations to the file. This is suitable for the applications that open files for a long time in write mode, such as data logger. Performing <tt>f_sync()</tt> function of periodic or immediataly after <tt>f_write()</tt> function can minimize the risk of data loss due to a sudden blackout or an unintentional media removal. However the <tt>f_sync()</tt> function immediataly before <tt>f_close()</tt> function has no advantage because it performs <tt>f_sync()</tt> function in it. In other words, the differnce between those functions is that the file object is invalidated or not. </p>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_FS_READONLY == 0</tt>.</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>See Also</h4>
<p><tt><a href="close.html">f_close</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/en/tell.html b/data/sysrom/fat/doc/en/tell.html
new file mode 100644
index 0000000..93d03c9
--- /dev/null
+++ b/data/sysrom/fat/doc/en/tell.html
@@ -0,0 +1,62 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="FatFs" href="../00index_e.html">
+<link rel="alternate" hreflang="ja" title="Japanese" href="../ja/tell.html">
+<link rel="stylesheet" href="../css_e.css" type="text/css" media="screen" title="ELM Default">
+<title>FatFs - f_tell</title>
+</head>
+
+<body>
+
+<div class="para func">
+<h2>f_tell</h2>
+<p>The f_tell function gets the current read/write pointer of a file.</p>
+<pre>
+DWORD f_tell (
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] File object */</span>
+);
+</pre>
+</div>
+
+
+<div class="para arg">
+<h4>Parameters</h4>
+<dl class="par">
+<dt>fp</dt>
+<dd>Pointer to the open file object structure.</dd>
+</dl>
+</div>
+
+
+<div class="para ret">
+<h4>Return Values</h4>
+<p>Returns current read/write pointer of the file.</p>
+</div>
+
+
+<div class="para desc">
+<h4>Description</h4>
+<p>In this revision, the <tt>f_tell()</tt> function is implemented as a macro.</p>
+<pre>
+<span class="k">#define</span> f_tell(fp) ((fp)->fptr)
+</pre>
+</div>
+
+
+<div class="para comp">
+<h4>QuickInfo</h4>
+<p>Always available.</p>
+</div>
+
+
+<div class="para ref">
+<h4>See Also</h4>
+<p><tt><a href="open.html">f_open</a>, <a href="lseek.html">f_lseek</a>, <a href="sfile.html">FIL</a></tt></p>
+</div>
+
+<p class="foot"><a href="../00index_e.html">Return</a></p>
+</body>
+</html>
diff --git a/data/sysrom/fat/doc/en/truncate.html b/data/sysrom/fat/doc/en/truncate.html
index 69f17dc..7dc980d 100644
--- a/data/sysrom/fat/doc/en/truncate.html
+++ b/data/sysrom/fat/doc/en/truncate.html
@@ -11,57 +11,51 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_truncate</h2>
<p>The f_truncate function truncates the file size.</p>
<pre>
FRESULT f_truncate (
- FIL* <em>FileObject</em> <span>/* Pointer to the file object */</span>
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] File object */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameter</h4>
<dl class="par">
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>Pointer to the open file object to be truncated.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>The function succeeded.</dd>
-<dt>FR_DENIED</dt>
-<dd>The file has been opened in read-only mode.</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>The function failed due to an error in the disk function.</dd>
-<dt>FR_INT_ERR</dt>
-<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
-<dt>FR_NOT_READY</dt>
-<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
-<dt>FR_INVALID_OBJECT</dt>
-<dd>The file object is invalid.</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#io">FR_INVALID_OBJECT</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The f_truncate function truncates the file size to the current file read/write point. This function has no effect if the file read/write pointer is already pointing end of the file.</p>
+<p>The <tt>f_truncate()</tt> function truncates the file size to the current file read/write pointer. This function has no effect if the file read/write pointer is already pointing end of the file.</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_FS_MINIMIZE == 0</tt>.</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>See Also</h4>
<p><tt><a href="open.html">f_open</a>, <a href="lseek.html">f_lseek</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/en/unlink.html b/data/sysrom/fat/doc/en/unlink.html
index cd5ab66..885f211 100644
--- a/data/sysrom/fat/doc/en/unlink.html
+++ b/data/sysrom/fat/doc/en/unlink.html
@@ -11,66 +11,60 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_unlink</h2>
-<p>The f_unlink function removes an object.</p>
+<p>The f_unlink function removes a file or directory.</p>
<pre>
FRESULT f_unlink (
- const TCHAR* <em>FileName</em> <span>/* Pointer to the object name */</span>
+ const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] Object name */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameter</h4>
<dl class="par">
-<dt>FileName</dt>
+<dt>path</dt>
<dd>Pointer to the null-terminated string that specifies an <a href="filename.html">object</a> to be removed.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>The function succeeded.</dd>
-<dt>FR_NO_FILE</dt>
-<dd>Could not find the file or directory.</dd>
-<dt>FR_NO_PATH</dt>
-<dd>Could not find the path.</dd>
-<dt>FR_INVALID_NAME</dt>
-<dd>The path name is invalid.</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>The drive number is invalid.</dd>
-<dt>FR_DENIED</dt>
-<dd>The function was denied due to either of following reasons:
-<ul><li>The object has read-only attribute</li><li>Not empty directory</li><li>Current directory</li></ul></dd>
-<dt>FR_NOT_READY</dt>
-<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
-<dt>FR_WRITE_PROTECTED</dt>
-<dd>The medium is write protected.</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>The function failed due to an error in the disk function.</dd>
-<dt>FR_INT_ERR</dt>
-<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>The logical drive has no work area.</dd>
-<dt>FR_NO_FILESYSTEM</dt>
-<dd>There is no valid FAT volume on the drive.</dd>
-<dt>FR_LOCKED</dt>
-<dd>The function was rejected due to file shareing policy.</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#ok">FR_NO_FILE</a>,
+<a href="rc.html#np">FR_NO_PATH</a>,
+<a href="rc.html#in">FR_INVALID_NAME</a>,
+<a href="rc.html#de">FR_DENIED</a>,
+<a href="rc.html#ex">FR_EXIST</a>,
+<a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>,
+<a href="rc.html#lo">FR_LOCKED</a>,
+<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The f_unlink function removes an object. <em>Do not remove open objects and current directory</em>.</p>
+<p>
+If condition of the object to be removed is applicable to the following terms, the function will fail with error.<ul>
+<li>The object must not have read-only attribute (<tt>AM_RDO</tt>) or the function will be rejected with <tt>FR_DENIED</tt>.</li>
+<li>The directory must be empty and must not be current directory or the function will be rejected with <tt>FR_DENIED</tt>.</li>
+<li>The file must not have been opened or the <em>FAT volume can be collapted</em>. It will able to be rejected with <tt>FR_LOCKED</tt> when <a href="appnote.html#dup">file shareing control</a> is enabled.</li>
+</ul>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_FS_MINIMIZE == 0</tt>.</p>
</div>
diff --git a/data/sysrom/fat/doc/en/utime.html b/data/sysrom/fat/doc/en/utime.html
index 135952c..edb2b29 100644
--- a/data/sysrom/fat/doc/en/utime.html
+++ b/data/sysrom/fat/doc/en/utime.html
@@ -11,68 +11,59 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_utime</h2>
<p>The f_utime function changes the timestamp of a file or directory.</p>
<pre>
FRESULT f_utime (
- const TCHAR* <em>FileName</em>, <span>/* Pointer to the file or directory path */</span>
- const FILINFO* <em>TimeDate</em> <span>/* Time and data to be set */</span>
+ const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] Object name */</span>
+ const FILINFO* <span class="arg">fno</span> <span class="c">/* [IN] Time and data to be set */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>FileName</dt>
+<dt>path</dt>
<dd>Pointer to the null-terminated string that specifies a <a href="filename.html">file or directory</a> to be changed.</dd>
-<dt>TimeDate</dt>
+<dt>fno</dt>
<dd>Pointer to the file information structure that has a timestamp to be set in member fdate and ftime. Do not care any other members.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>The function succeeded.</dd>
-<dt>FR_NO_FILE</dt>
-<dd>Could not find the file.</dd>
-<dt>FR_NO_PATH</dt>
-<dd>Could not find the path.</dd>
-<dt>FR_INVALID_NAME</dt>
-<dd>The file name is invalid.</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>The drive number is invalid.</dd>
-<dt>FR_NOT_READY</dt>
-<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
-<dt>FR_WRITE_PROTECTED</dt>
-<dd>The medium is write protected.</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>The function failed due to an error in the disk function.</dd>
-<dt>FR_INT_ERR</dt>
-<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>The logical drive has no work area.</dd>
-<dt>FR_NO_FILESYSTEM</dt>
-<dd>There is no valid FAT volume on the drive.</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#ok">FR_NO_FILE</a>,
+<a href="rc.html#np">FR_NO_PATH</a>,
+<a href="rc.html#in">FR_INVALID_NAME</a>,
+<a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>,
+<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The f_utime function changes the timestamp of a file or directory</p>
+<p>The <tt>f_utime()</tt> function changes the timestamp of a file or directory</p>
</div>
-<div class="para">
+<div class="para use">
<h4>Example</h4>
<pre>
FRESULT set_timestamp (
- char *obj, <span>/* Pointer to the file name */</span>
+ char *obj, <span class="c">/* Pointer to the file name */</span>
int year,
int month,
int mday,
@@ -92,13 +83,13 @@ FRESULT set_timestamp (
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_FS_READONLY == 0</tt> and <tt>_FS_MINIMIZE == 0</tt>.</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>See Also</h4>
<p><tt><a href="stat.html">f_stat</a>, <a href="sfileinfo.html">FILINFO</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/en/write.html b/data/sysrom/fat/doc/en/write.html
index faba416..925fd56 100644
--- a/data/sysrom/fat/doc/en/write.html
+++ b/data/sysrom/fat/doc/en/write.html
@@ -11,66 +11,60 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_write</h2>
<p>The f_write writes data to a file.</p>
<pre>
FRESULT f_write (
- FIL* <em>FileObject</em>, <span>/* Pointer to the file object structure */</span>
- const void* <em>Buffer</em>, <span>/* Pointer to the data to be written */</span>
- UINT <em>ByteToWrite</em>, <span>/* Number of bytes to write */</span>
- UINT* <em>ByteWritten</em> <span>/* Pointer to the variable to return number of bytes written */</span>
+ FIL* <span class="arg">fp</span>, <span class="c">/* [IN] Pointer to the file object structure */</span>
+ const void* <span class="arg">buff</span>, <span class="c">/* [IN] Pointer to the data to be written */</span>
+ UINT <span class="arg">btw</span>, <span class="c">/* [IN] Number of bytes to write */</span>
+ UINT* <span class="arg">bw</span> <span class="c">/* [OUT] Pointer to the variable to return number of bytes written */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>Parameters</h4>
<dl class="par">
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>Pointer to the open file object structure.</dd>
-<dt>Buffer</dt>
+<dt>buff</dt>
<dd>Pointer to the data to be written.</dd>
-<dt>ByteToWrite</dt>
-<dd>Specifies number of bytes to write in range of UINT.</dd>
-<dt>ByteWritten</dt>
-<dd>Pointer to the UINT variable to return the number of bytes written. The value is always valid after the function call regardless of the result.</dd>
+<dt>btw</dt>
+<dd>Specifies number of bytes to write in range of <tt>UINT</tt> type.</dd>
+<dt>bw</dt>
+<dd>Pointer to the <tt>UINT</tt> variable to return the number of bytes written. The value is always valid after the function call regardless of the result.</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>Return Values</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>The function succeeded.</dd>
-<dt>FR_DENIED</dt>
-<dd>The function denied due to the file has been opened in non-write mode.</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>The function failed due to an error in the disk function.</dd>
-<dt>FR_INT_ERR</dt>
-<dd>The function failed due to a wrong FAT structure or an internal error.</dd>
-<dt>FR_NOT_READY</dt>
-<dd>The disk drive cannot work due to no medium in the drive or any other reason.</dd>
-<dt>FR_INVALID_OBJECT</dt>
-<dd>The file object is invalid.</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#io">FR_INVALID_OBJECT</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>Description</h4>
-<p>The read/write pointer in the file object is increased in number of bytes written. After the function succeeded, <tt>*ByteWritten</tt> should be checked to detect the disk full. In case of <tt>*ByteWritten &lt; ByteToWrite</tt>, it means the volume got full during the write operation. The function can take a time when the volume is full or close to full.</p>
+<p>The read/write pointer of the file object advances number of bytes written. After the function succeeded, <tt class="arg">*bw</tt> should be checked to detect the disk full. In case of <tt class="arg">*bw</tt> is less than <tt class="arg">btw</tt>, it means the volume got full during the write operation. The function can take a time when the volume is full or close to full.</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>QuickInfo</h4>
<p>Available when <tt>_FS_READONLY == 0</tt>.</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>See Also</h4>
<p><tt><a href="open.html">f_open</a>, <a href="read.html">f_read</a>, <a href="putc.html">fputc</a>, <a href="puts.html">fputs</a>, <a href="printf.html">fprintf</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/img/f1.png b/data/sysrom/fat/doc/img/f1.png
index 42cc271..5191700 100644
--- a/data/sysrom/fat/doc/img/f1.png
+++ b/data/sysrom/fat/doc/img/f1.png
Binary files differ
diff --git a/data/sysrom/fat/doc/img/layers3.png b/data/sysrom/fat/doc/img/layers3.png
new file mode 100644
index 0000000..ac439b0
--- /dev/null
+++ b/data/sysrom/fat/doc/img/layers3.png
Binary files differ
diff --git a/data/sysrom/fat/doc/img/modules.png b/data/sysrom/fat/doc/img/modules.png
new file mode 100644
index 0000000..546839a
--- /dev/null
+++ b/data/sysrom/fat/doc/img/modules.png
Binary files differ
diff --git a/data/sysrom/fat/doc/img/rwtest3.png b/data/sysrom/fat/doc/img/rwtest3.png
new file mode 100644
index 0000000..cbaa3d1
--- /dev/null
+++ b/data/sysrom/fat/doc/img/rwtest3.png
Binary files differ
diff --git a/data/sysrom/fat/doc/ja/appnote.html b/data/sysrom/fat/doc/ja/appnote.html
index 3969dfc..cb6c71e 100644
--- a/data/sysrom/fat/doc/ja/appnote.html
+++ b/data/sysrom/fat/doc/ja/appnote.html
@@ -30,36 +30,32 @@
<div class="para" id="port">
<h3>繝昴シ繝繧」繝ウ繧ー縺ョ髫帙↓驟肴ョ縺吶∋縺阪%縺ィ</h3>
+
<h4>遘サ讀阪ョ髫帙ョ蜑肴署譚。莉カ</h4>
<p>FatFs繝「繧ク繝・繝シ繝ォ縺ッ遘サ讀肴ァ縺ォ髢「縺励※谺。縺ョ轤ケ繧貞燕謠舌→縺励※縺縺セ縺吶</p>
<ul>
<li>蜃ヲ逅邉サ縺ッANSI C貅匁侠縺ァ縺ゅk縺薙→縲<br>
-FatFs繝「繧ク繝・繝シ繝ォ縺ッANSI C(C89)貅匁侠縺ァ險倩ソー縺輔l縺ヲ縺繧九ョ縺ァ縲、NSI C縺ォ貅匁侠縺励◆縺セ縺ィ繧ゅ↑繧ウ繝ウ繝代う繝ゥ縺ェ繧臥音縺ォ蜃ヲ逅邉サ萓晏ュ倥↓縺ェ繧狗せ縺ッ縺ゅj縺セ縺帙s縲</li>
+FatFs繝「繧ク繝・繝シ繝ォ縺ッANSI C(C89)貅匁侠縺ァ險倩ソー縺輔l縺ヲ縺繧九ョ縺ァ縲∵勸騾壹ョC繧ウ繝ウ繝代う繝ゥ縺ェ繧臥音縺ォ蜃ヲ逅邉サ萓晏ュ倥↓縺ェ繧狗せ縺ッ縺ゅj縺セ縺帙s縲</li>
<li>char/short/long縺ョ繧オ繧、繧コ縺ッ縲√◎繧後◇繧8/16/32繝薙ャ繝医〒縲(nt縺ッ16縺セ縺溘ッ32繝薙ャ繝医〒縺ゅk縺薙→縲<br>
-繧オ繧、繧コ繧呈守、コ縺吶k謨エ謨ー縺ョ蝙九′ integer.h 蜀縺ァ螳夂セゥ縺輔l縺ヲ縺縺セ縺吶よ紛謨ー縺ョ蝙九→繧オ繧、繧コ縺ォ髢「縺励※縺ッ縲√∪縺」縺ィ縺縺ェ蜃ヲ逅邉サ縺ェ繧牙撫鬘後↑縺縺ッ縺壹〒縺吶′縲∵里蟄倥ョ螳夂セゥ縺ィ陦晉ェ√@縺溷エ蜷医ッ繝ヲ繝シ繧カ縺ォ繧医▲縺ヲ隗」豎コ縺輔l縺ェ縺代l縺ー縺ェ繧翫∪縺帙s縲</li>
+縺薙l縺ォ縺、縺縺ヲ繧ゅ√∪縺」縺ィ縺縺ェ蜃ヲ逅邉サ縺ェ繧牙撫鬘後↑縺縺ッ縺壹〒縺吶FatFs繝「繧ク繝・繝シ繝ォ縺ァ菴ソ逕ィ縺輔l繧九し繧、繧コ繧呈守、コ縺吶k謨エ謨ー蝙九′ integer.h 蜀縺ァ螳夂セゥ縺輔l縺ヲ縺縺セ縺吶′縲∵里蟄倥ョ螳夂セゥ縺ィ陦晉ェ√@縺溷エ蜷医ッ繝ヲ繝シ繧カ縺ォ繧医▲縺ヲ隗」豎コ縺輔l縺ェ縺代l縺ー縺ェ繧翫∪縺帙s縲</li>
</ul>
+
+<h4>繧キ繧ケ繝繝讒区</h4>
+<p>荳九↓遉コ縺吩セ晏ュ倬未菫ょ峙縺ッ縲:atFs繝「繧ク繝・繝シ繝ォ蛻ゥ逕ィ縺ョ邨縺ソ霎シ縺ソ繧キ繧ケ繝繝縺ォ縺翫¢繧倶サ」陦ィ逧縺ェ讒区舌r遉コ縺励∪縺吶</p>
+<p><img src="../img/modules.png" width="507" height="224" alt="繧キ繧ケ繝繝讒区仙峙"></p>
+
<h4>繝ヲ繝シ繧カ縺ョ菴懈舌☆繧矩未謨ー</h4>
-<p>蠢隕√↑縺ョ縺ッ FatFs繝「繧ク繝・繝シ繝ォ縺ョ隕∵アゅ☆繧九ョ繧」繧ケ繧ッ髢「謨ー繧堤畑諢上☆繧九%縺ィ縺縺代〒縲√◎繧御サ・螟悶↓縺吶k縺薙→縺ッ縺ゅj縺セ縺帙s縲よ里縺ォ蜍穂ス懊@縺ヲ縺繧九ョ繧」繧ケ繧ッ髢「謨ー縺後≠繧九↑繧峨◎縺ョ API繧 FatFs縺ォ蜷医o縺帙k縺縺代〒貂医∩縺セ縺吶′縲∫┌縺蝣エ蜷医ッ縺サ縺九°繧臥ァサ讀阪☆繧九°縲∵怙蛻昴°繧画嶌縺上°縺吶k蠢隕√′縺ゅj縺セ縺吶ょョ夂セゥ縺輔l縺ヲ縺繧句ィ縺ヲ縺ョ髢「謨ー縺悟クク縺ォ蠢隕√↑繧上¢縺ァ縺ッ縺ゅj縺セ縺帙s縲ゆセ九∴縺ー縲√Μ繝シ繝峨サ繧ェ繝ウ繝ェ繝シ讒区舌〒縺ッ譖ク縺崎セシ縺ソ邉サ髢「謨ー縺ッ蠢隕√≠繧翫∪縺帙s縲よャ。縺ョ陦ィ縺ォ讒区舌が繝励す繝ァ繝ウ縺ィ隕∵アゅ&繧後k髢「謨ー縺ョ蟇セ蠢懊r遉コ縺励∪縺吶</p>
+<p>蠢隕√↑縺ョ縺ッ FatFs繝「繧ク繝・繝シ繝ォ縺ョ隕∵アゅ☆繧九ョ繧」繧ケ繧ッ髢「謨ー繧堤畑諢上☆繧九%縺ィ縺縺代〒縲√◎繧御サ・螟悶↓縺吶k縺薙→縺ッ縺ゅj縺セ縺帙s縲よ里縺ォ蜍穂ス懊@縺ヲ縺繧九ョ繧」繧ケ繧ッ髢「謨ー縺後≠繧九↑繧峨√◎縺ョ API繧 FatFs縺ォ蜷医o縺帙k縺九げ繝ォ繝シ髢「謨ー縺ァ縺、縺ェ縺舌□縺代〒貂医∩縺セ縺吶′縲∫┌縺蝣エ蜷医ッ縺サ縺九°繧臥ァサ讀阪☆繧九°譛蛻昴°繧画嶌縺上°縺吶k蠢隕√′縺ゅj縺セ縺吶ょョ夂セゥ縺輔l縺ヲ縺繧句ィ縺ヲ縺ョ髢「謨ー縺悟クク縺ォ蠢隕√↑繧上¢縺ァ縺ッ縺ゅj縺セ縺帙s縲ゆセ九∴縺ー縲√Μ繝シ繝峨サ繧ェ繝ウ繝ェ繝シ讒区舌〒縺ッ譖ク縺崎セシ縺ソ邉サ髢「謨ー縺ッ蠢隕√≠繧翫∪縺帙s縲よャ。縺ョ陦ィ縺ォ讒区舌が繝励す繝ァ繝ウ縺ィ隕∵アゅ&繧後k髢「謨ー縺ョ蟇セ蠢懊r遉コ縺励∪縺吶</p>
<table class="lst2">
<tr><th>繝ヲ繝シ繧カ菴懈宣未謨ー</th><th>蠢隕√→縺ェ繧区擅莉カ</th><th>蛯呵</th></tr>
-<tr><td>disk_initialize</td><td>蟶ク譎</td><td rowspan="10">ffsample.zip (繧オ繝ウ繝励Ν)<br>縺昴ョ莉殆eb荳翫↓螟壽焚</td></tr>
-<tr><td>disk_status</td><td>蟶ク譎</td></tr>
-<tr><td>disk_read</td><td>蟶ク譎</td></tr>
-<tr><td>disk_write</td><td>_FS_READONLY == 0</td></tr>
-<tr><td>disk_ioctl (CTRL_SYNC)</td><td>_FS_READONLY == 0</td></tr>
-<tr><td>disk_ioctl (GET_SECTOR_COUNT)</td><td>_USE_MKFS == 1</td></tr>
+<tr><td>disk_initialize<br>disk_status<br>disk_read</td><td>蟶ク譎</td><td rowspan="5">ffsample.zip (繧オ繝ウ繝励Ν)<br>縺昴ョ莉殆eb荳翫↓螟壽焚</td></tr>
+<tr><td>disk_write<br>get_fattime<br>disk_ioctl (CTRL_SYNC)</td><td>_FS_READONLY == 0</td></tr>
+<tr><td>disk_ioctl (GET_SECTOR_COUNT)<br>disk_ioctl (GET_BLOCK_SIZE)</td><td>_USE_MKFS == 1</td></tr>
<tr><td>disk_ioctl (GET_SECTOR_SIZE)</td><td>_MAX_SS &gt;= 1024</td></tr>
-<tr><td>disk_ioctl (GET_BLOCK_SIZE)</td><td>_USE_MKFS == 1</td></tr>
<tr><td>disk_ioctl (CTRL_ERASE_SECTOR)</td><td>_USE_ERASE == 1</td></tr>
-<tr><td>get_fattime</td><td>_FS_READONLY == 0</td></tr>
-<tr><td>ff_convert</td><td>_USE_LFN &gt;= 1</td><td rowspan="2">option/cc*.c</td></tr>
-<tr><td>ff_wtoupper</td><td>_USE_LFN &gt;= 1</td></tr>
-<tr><td>ff_cre_syncobj</td><td>_FS_REENTRANT == 1</td><td rowspan="6">option/syscall.c (繧オ繝ウ繝励Ν)</td></tr>
-<tr><td>ff_del_syncobj</td><td>_FS_REENTRANT == 1</td></tr>
-<tr><td>ff_req_grant</td><td>_FS_REENTRANT == 1</td></tr>
-<tr><td>ff_rel_grant</td><td>_FS_REENTRANT == 1</td></tr>
-<tr><td>ff_mem_alloc</td><td>_USE_LFN == 3</td></tr>
-<tr><td>ff_mem_free</td><td>_USE_LFN == 3</td></tr>
+<tr><td>ff_convert<br>ff_wtoupper</td><td>_USE_LFN &gt;= 1</td><td>option/cc*.c</td></tr>
+<tr><td>ff_cre_syncobj<br>ff_rel_grant<br>ff_req_grant<br>ff_del_syncobj</td><td>_FS_REENTRANT == 1</td><td rowspan="2">option/syscall.c (繧オ繝ウ繝励Ν)</td></tr>
+<tr><td>ff_mem_alloc<br>ff_mem_free</td><td>_USE_LFN == 3</td></tr>
</table>
</div>
@@ -77,21 +73,23 @@ FatFs繝「繧ク繝・繝シ繝ォ縺ッANSI C(C89)貅匁侠縺ァ險倩ソー縺輔l縺ヲ縺繧九ョ縺ァ縲、NSI C
</div>
<div class="para" id="memory">
-<h3>繝。繝「繝ェ菴ソ逕ィ驥 (R0.08a)</h3>
-<p>谺。縺ョ陦ィ縺ォ縺縺上▽縺九ョ繧ソ繝シ繧イ繝繝医↓縺翫¢繧九Γ繝「繝ェ菴ソ逕ィ驥上ョ萓九r遉コ縺励∪縺吶ゅユ繧ケ繝域凾縺ョ讒区舌が繝励す繝ァ繝ウ縺ッ縺昴ョ荳九ョ騾壹j縺ァ縺吶よ焚蛟、縺ョ蜊倅ス阪ッ繝舌う繝医〒縲<em>D</em>縺ッ隲也炊繝懊Μ繝・繝シ繝謨ー縲<em>F</em>縺ッ蜷梧凾繧ェ繝シ繝励Φ繝サ繝輔ぃ繧、繝ォ謨ー繧堤、コ縺励∪縺吶ゅさ繝ウ繝代う繝ゥ縺ョ譛驕ゥ蛹悶が繝励す繝ァ繝ウ縺ッ繧ウ繝シ繝峨サ繧オ繧、繧コ縺ィ縺励※縺縺セ縺吶</p>
+<h3>繝。繝「繝ェ菴ソ逕ィ驥</h3>
+<p>谺。縺ョ陦ィ縺ォ縺縺上▽縺九ョ繧ソ繝シ繧イ繝繝医↓縺翫¢繧九Γ繝「繝ェ菴ソ逕ィ驥上ョ萓九r遉コ縺励∪縺吶ゅユ繧ケ繝域凾縺ョ讒区舌が繝励す繝ァ繝ウ縺ッ縺昴ョ荳九ョ騾壹j縺ァ縺吶よ焚蛟、縺ョ蜊倅ス阪ッ繝舌う繝医〒縲<em>V</em>縺ッ蜷梧凾繝槭え繝ウ繝医サ繝懊Μ繝・繝シ繝謨ー縲<em>F</em>縺ッ蜷梧凾繧ェ繝シ繝励Φ繝サ繝輔ぃ繧、繝ォ謨ー繧堤、コ縺励∪縺吶ゅさ繝ウ繝代う繝ゥ縺ョ譛驕ゥ蛹悶が繝励す繝ァ繝ウ縺ッ繧ウ繝シ繝峨サ繧オ繧、繧コ縺ィ縺励※縺縺セ縺吶</p>
<table class="lst2">
-<tr><th></th><th>AVR</th><th>H8/300H</th><th>PIC24</th><th>V850ES</th><th>SH-2A</th><th>ARM7</th><th>x86</th></tr>
-<tr><td>Compiler</td><td>WinAVR(gcc)</td><td>CH38</td><td>C30(gcc)</td><td>CA850</td><td>SHC</td><td>WinARM(gcc)</td><td>VC6</td></tr>
-<tr><td>_WORD_ACCESS</td><td>1</td><td>0</td><td>0</td><td>1</td><td>0</td><td>0</td><td>1</td></tr>
-<tr class="lst3"><td>text (Full, R/W)</td><td>12646</td><td>10686</td><td>11430</td><td>7732</td><td>8752</td><td>10560</td><td>7545</td></tr>
-<tr> <td>text (Min, R/W)</td><td>8306</td><td>6986</td><td>7413</td><td>4938</td><td>5576</td><td>6680</td><td>4923</td></tr>
-<tr><td>text (Full, R/O)</td><td>5960</td><td>4876</td><td>5250</td><td>3554</td><td>3804</td><td>4688</td><td>3450</td></tr>
-<tr> <td>text (Min, R/O)</td><td>4366</td><td>3770</td><td>3939</td><td>2684</td><td>2940</td><td>3452</td><td>2664</td></tr>
-<tr><td>bss</td><td>D*2 + 2</td><td>D*4 + 2</td><td>D*2 + 2</td><td>D*4 + 2</td><td>D*4 + 2</td><td>D*4 + 2</td><td>D*4 + 2</td></tr>
-<tr><td>Work area<br>(_FS_TINY == 0)</td><td>D*560 +<br>F*544</td><td>D*560 +<br>F*550</td><td>D*560 +<br>F*544</td><td>D*560 +<br>F*550</td><td>D*560 +<br>F*550</td><td>D*560 +<br>F*550</td><td>D*560 +<br>F*550</td></tr>
-<tr><td>Work area<br>(_FS_TINY == 1)</td><td>D*560 +<br>F*32</td><td>D*560 +<br>F*36</td><td>D*560 +<br>F*32</td><td>D*560 +<br>F*36</td><td>D*560 +<br>F*36</td><td>D*560 +<br>F*36</td><td>D*560 +<br>F*36</td></tr>
+<tr><th></th><th>ARM7<small><br>32bit</small></th><th>ARM7<small><br>Thumb</small></th><th>CM3<small><br>Thumb-2</small></th><th>AVR</th><th>H8/300H</th><th>PIC24</th><th>RL78</th><th>V850ES</th><th>SH-2A</th><th>RX600</th><th>IA-32</th></tr>
+<tr><td>Compiler</td><td>GCC</td><td>GCC</td><td>GCC</td><td>GCC</td><td>CH38</td><td>C30</td><td>CC78K0R</td><td>CA850</td><td>SHC</td><td>RXC</td><td>VC6</td></tr>
+<tr><td>_WORD_ACCESS</td><td>0</td><td>0</td><td>0</td><td>1</td><td>0</td><td>0</td><td>0</td><td>1</td><td>0</td><td>1</td><td>1</td></tr>
+<!-- *ARM *Thumb *CM3 *AVR *H8 *PIC24 RL78 *V850ES *SH-2A *RX600 *IA-32 -->
+<tr class="lst3"><td>text (Full, R/W)</td><td>10395</td><td>7037</td><td>6555</td><td>13362</td><td>10609</td><td>11364</td><td>12884</td><td>7814</td><td>8783</td><td>5826</td><td>7659</td></tr>
+<tr> <td>text (Min, R/W)</td> <td>6519</td><td>4747</td><td>4315</td> <td>8608</td> <td>7043</td> <td>7539</td> <td>8860</td><td>5070</td><td>5723</td><td>3821</td><td>5038</td></tr>
+<tr> <td>text (Full, R/O)</td> <td>4563</td><td>3147</td><td>2911</td> <td>6174</td> <td>4925</td> <td>5340</td> <td>6136</td><td>3628</td><td>3863</td><td>2721</td><td>3534</td></tr>
+<tr> <td>text (Min, R/O)</td> <td>3311</td><td>2463</td><td>2209</td> <td>4610</td> <td>3817</td> <td>4029</td> <td>4641</td><td>2762</td><td>3003</td><td>2068</td><td>2722</td></tr>
+<tr> <td>bss</td><td>D*4 + 2</td><td>D*4 + 2</td><td>D*4 + 2</td><td>D*2 + 2</td><td>D*4 + 2</td><td>D*2 + 2</td><td>D*2 + 2</td><td>D*4 + 2</td><td>D*4 + 2</td><td>D*4 + 2</td><td>D*4 + 2</td></tr>
+<tr> <td>Work area<br>(_FS_TINY == 0)</td><td>V*564 +<br>F*550</td><td>V*564 +<br>F*550</td><td>V*564 +<br>F*550</td><td>V*564 +<br>F*544</td><td>V*564 +<br>F*550</td><td>V*564 +<br>F*544</td><td>V*564 +<br>F*544</td><td>V*564 +<br>F*544</td><td>V*564 +<br>F*550</td><td>V*564 +<br>F*550</td><td>V*564 +<br>F*550</td></tr>
+<tr><td>Work area<br>(_FS_TINY == 1)</td><td>V*564 +<br>F*36</td><td>V*564 +<br>F*36</td><td>V*564 +<br>F*36</td><td>V*564 +<br>F*32</td><td>V*564 +<br>F*36</td><td>V*564 +<br>F*32</td><td>V*564 +<br>F*32</td><td>V*564 +<br>F*36</td><td>V*564 +<br>F*36</td><td>V*564 +<br>F*36</td><td>V*564 +<br>F*36</td></tr>
</table>
<pre>
+FatFs R0.09b options:
_FS_READONLY 0 (R/W), 1 (R/O)
_FS_MINIMIZE 0 (Full function), 3 (Minimized function)
_USE_STRFUNC 0 (Disable string functions)
@@ -101,10 +99,12 @@ _USE_FASTSEEK 0 (Disable fast seek feature)
_CODE_PAGE 932 (Japanese Shift-JIS)
_USE_LFN 0 (Disable LFN)
_MAX_SS 512 (Fixed sector size)
-_FS_RPATH 0 (Disable relative path)
+_FS_RPATH 0 (Disable relative path feature)
+_FS_LABEL 0 (Disable volume label functions)
+_VOLUMES D (Number of logical drives to be used)
_MULTI_PARTITION 0 (Single partition per drive)
_FS_REENTRANT 0 (Disable reentrancy)
-_FS_SHARE 0 (Disable shareing control)
+_FS_LOCK 0 (Disable file lock control)
</pre>
</div>
@@ -112,40 +112,44 @@ _FS_SHARE 0 (Disable shareing control)
<h3>繝「繧ク繝・繝シ繝ォ繝サ繧オ繧、繧コ縺ョ邵ョ蟆</h3>
<p>谺。縺ョ陦ィ縺ッ讒区舌が繝励す繝ァ繝ウ縺ョ險ュ螳壼、縺ォ繧医j縺ゥ縺ョ讖溯ス縺悟炎髯、縺輔l繧九°繧堤、コ縺励∪縺吶</p>
<table class="lst2">
-<tr><td rowspan="2">Function</td><td colspan="3">_FS_MINIMIZE</td><td>_FS_READONLY</td><td>_USE_STRFUNC</td><td>_FS_RPATH</td><td>_USE_MKFS</td><td>_USE_FORWARD</td></tr>
-<tr><td>1</td><td>2</td><td>3</td><td>1</td><td>0</td><td>0</td><td>0</td><td>0</td></tr>
-<tr class="lst3"><td>f_mount</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_open</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_close</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_read</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_write</td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_sync</td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_lseek</td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_opendir</td><td></td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_readdir</td><td></td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_stat</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_getfree</td><td>x</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_truncate</td><td>x</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_unlink</td><td>x</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_mkdir</td><td>x</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_chmod</td><td>x</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_utime</td><td>x</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_rename</td><td>x</td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td></tr>
-<tr><td>f_chdir</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td></tr>
-<tr><td>f_chdrive</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td></tr>
-<tr><td>f_mkfs</td><td></td><td></td><td></td><td>x</td><td></td><td></td><td>x</td><td></td></tr>
-<tr><td>f_forward</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>x</td></tr>
-<tr><td>f_putc</td><td></td><td></td><td></td><td>x</td><td>x</td><td></td><td></td><td></td></tr>
-<tr><td>f_puts</td><td></td><td></td><td></td><td>x</td><td>x</td><td></td><td></td><td></td></tr>
-<tr><td>f_printf</td><td></td><td></td><td></td><td>x</td><td>x</td><td></td><td></td><td></td></tr>
-<tr><td>f_gets</td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td></tr>
+<tr><td rowspan="2">Function</td><td colspan="4">_FS_MINIMIZE</td><td colspan="2">_FS_READONLY</td><td colspan="2">_USE_STRFUNC</td><td colspan="3">_FS_RPATH</td><td colspan="2">_FS_LABEL</td><td colspan="2">_USE_MKFS</td><td colspan="2">_USE_FORWARD</td><td colspan="2">_MULTI_PARTITION</td></tr>
+<tr><td>0</td><td>1</td><td>2</td><td>3</td><td>0</td><td>1</td><td>0&nbsp;&nbsp;</td><td>1/2</td><td>0</td><td>1</td><td>2</td><td>0</td><td>1</td><td>0</td><td>1</td><td>0</td><td>1</td><td>0/1</td><td>2</td></tr>
+<tr class="lst3"><td>f_mount</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_open</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_close</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_read</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_write</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_sync</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_lseek</td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_opendir</td><td></td><td></td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_readdir</td><td></td><td></td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_stat</td><td></td><td>x</td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_getfree</td><td></td><td>x</td><td>x</td><td>x</td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_truncate</td><td></td><td>x</td><td>x</td><td>x</td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_unlink</td><td></td><td>x</td><td>x</td><td>x</td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_mkdir</td><td></td><td>x</td><td>x</td><td>x</td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_chmod</td><td></td><td>x</td><td>x</td><td>x</td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_utime</td><td></td><td>x</td><td>x</td><td>x</td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_rename</td><td></td><td>x</td><td>x</td><td>x</td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_chdir</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_chdrive</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_getcwd</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_getlabel</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_setlabel</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_forward</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td></tr>
+<tr><td>f_mkfs</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_fdisk</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td>x</td><td></td></tr>
+<tr><td>f_putc</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_puts</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_printf</td><td></td><td></td><td></td><td></td><td></td><td>x</td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
+<tr><td>f_gets</td><td></td><td></td><td></td><td></td><td></td><td></td><td>x</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
</table>
</div>
<div class="para" id="lfn">
<h3>髟キ縺繝輔ぃ繧、繝ォ蜷</h3>
-<p>FatFs繝「繧ク繝・繝シ繝ォ縺ッR0.07縺九i髟キ縺繝輔ぃ繧、繝ォ蜷(LFN)繧偵し繝昴シ繝医@縺セ縺励◆縲ゅヵ繧。繧、繝ォ縺ォ莉倥¢繧峨l縺2縺、縺ョ逡ー縺ェ繧句錐蜑(遏ュ縺繝輔ぃ繝ォ蜷阪→髟キ縺繝輔ぃ繧、繝ォ蜷)縺ッ縲’_readdir髢「謨ー繧帝勁縺上ヵ繧。繧、繝ォ謫堺ス憺未謨ー縺ォ縺翫>縺ヲ騾城℃縺ァ縺吶LFN讖溯ス繧呈怏蜉ケ縺ォ縺吶k縺ォ縺ッ縲<tt>_USE_LFN</tt>繧1,2縺セ縺溘ッ3縺ォ險ュ螳壹@縲ゞnicode螟画鋤髢「謨ー<tt>ff_convert(), ff_wtoupper()</tt>繧偵励Ο繧ク繧ァ繧ッ繝医↓霑ス蜉縺励∪縺吶ゅ%繧後i縺ョ髢「謨ー縺ッ縲<tt>option/cc*.c</tt>縺ォ蜷ォ縺セ繧後※縺縺セ縺吶LFN讖溯ス縺ッ縲∝刈縺医※縺ゅk遞句コヲ縺ョ繝ッ繝シ繧ッ繝サ繧ィ繝ェ繧「(LFN謫堺ス懊ヰ繝繝輔ぃ)繧貞ソ隕√→縺励∪縺吶ゅヰ繝繝輔ぃ髟キ縺ッ菴ソ逕ィ縺ァ縺阪k繝。繝「繝ェ縺ォ蠢懊§縺ヲ<tt>_MAX_LFN</tt>繧ェ繝励す繝ァ繝ウ縺ァ讒区舌&繧後k縺薙→縺後〒縺阪∪縺吶LFN縺ョ髟キ縺輔ッ譛螟ァ255譁蟄励↓驕斐☆繧九ョ縺ァ縲´FN螳悟ィ蟇セ蠢懊ョ縺溘a縺ォ縺ッ<tt>_MAX_LFN</tt>縺ッ255縺ォ險ュ螳壹&繧後k縺ケ縺阪〒縺吶ゆク弱∴繧峨l縺溘ヵ繧。繧、繝ォ蜷阪↓蟇セ縺励※繝舌ャ繝輔ぃ髟キ縺御ク崎カウ縺励◆蝣エ蜷医√ヵ繧。繧、繝ォ髢「謨ー縺ッ<tt>FR_INVALID_NAME</tt>縺ァ螟ア謨励@縺セ縺吶</p>
-<p>LFN讖溯ス繧偵Μ繧ィ繝ウ繝医Λ繝ウ繝域ァ区舌〒菴ソ逕ィ縺吶k蝣エ蜷医ッ縲<tt>_USE_LFN</tt>縺ッ2縺セ縺溘ッ3縺ォ險ュ螳壹&繧後↑縺代l縺ー縺ェ繧翫∪縺帙s縲ゅ%縺ョ蝣エ蜷医√ヵ繧。繧、繝ォ髢「謨ー縺ッ繝舌ャ繝輔ぃ繧偵せ繧ソ繝繧ッ繧繝偵シ繝励↓遒コ菫昴@縺セ縺吶ゅヰ繝繝輔ぃ繝サ繧オ繧、繧コ縺ッ縲<tt>(_MAX_LFN + 1) * 2</tt>繝舌う繝医↓縺ェ繧九ョ縺ァ縲√せ繧ソ繝繧ッ遲峨ョ繧オ繧、繧コ縺ッ縺昴l繧定諷ョ縺励◆蜊∝縺ェ繧オ繧、繧コ縺ァ縺ェ縺代l縺ー縺ェ繧翫∪縺帙s縲</p>
+<p>FatFs繝「繧ク繝・繝シ繝ォ縺ッR0.07縺九i髟キ縺繝輔ぃ繧、繝ォ蜷(LFN)繧偵し繝昴シ繝医@縺セ縺励◆縲ゅヵ繧。繧、繝ォ縺ォ莉倥¢繧峨l縺2縺、縺ョ逡ー縺ェ繧句錐蜑(遏ュ縺繝輔ぃ繝ォ蜷阪→髟キ縺繝輔ぃ繧、繝ォ蜷)縺ッ縲<tt>f_readdir()</tt>繧帝勁縺上ヵ繧。繧、繝ォ謫堺ス憺未謨ー縺ォ縺翫>縺ヲ騾城℃縺ァ縺吶LFN讖溯ス繧呈怏蜉ケ縺ォ縺吶k縺ォ縺ッ縲<tt>_USE_LFN</tt>繧1,2縺セ縺溘ッ3縺ォ險ュ螳壹@縲ゞnicode螟画鋤髢「謨ー<tt>ff_convert(), ff_wtoupper()</tt>繧偵励Ο繧ク繧ァ繧ッ繝医↓霑ス蜉縺励∪縺吶ゅ%繧後i縺ョ髢「謨ー縺ッ縲<tt>option/cc*.c</tt>縺ォ蜷ォ縺セ繧後※縺縺セ縺吶LFN讖溯ス縺ッ縲∝刈縺医※縺ゅk遞句コヲ縺ョ繝ッ繝シ繧ッ繝サ繧ィ繝ェ繧「(LFN謫堺ス懊ヰ繝繝輔ぃ)繧貞ソ隕√→縺励∪縺吶ゅヰ繝繝輔ぃ髟キ縺ッ菴ソ逕ィ縺ァ縺阪k繝。繝「繝ェ縺ォ蠢懊§縺ヲ<tt>_MAX_LFN</tt>繧ェ繝励す繝ァ繝ウ縺ァ讒区舌&繧後k縺薙→縺後〒縺阪∪縺吶LFN縺ョ髟キ縺輔ッ譛螟ァ255譁蟄励↓驕斐☆繧九ョ縺ァ縲´FN螳悟ィ蟇セ蠢懊ョ縺溘a縺ォ縺ッ<tt>_MAX_LFN</tt>縺ッ255縺ォ險ュ螳壹&繧後k縺ケ縺阪〒縺吶ゆク弱∴繧峨l縺溘ヵ繧。繧、繝ォ蜷阪↓蟇セ縺励※繝舌ャ繝輔ぃ髟キ縺御ク崎カウ縺励◆蝣エ蜷医√ヵ繧。繧、繝ォ髢「謨ー縺ッ<tt>FR_INVALID_NAME</tt>縺ァ螟ア謨励@縺セ縺吶</p>
+<p>菴輔i縺九ョ繝ェ繧ィ繝ウ繝医Λ繝ウ繝育憾諷九ョ荳九〒LFN讖溯ス繧剃スソ逕ィ縺吶k蝣エ蜷医ッ縲<tt>_USE_LFN</tt>縺ッ2縺セ縺溘ッ3縺ォ險ュ螳壹&繧後↑縺代l縺ー縺ェ繧翫∪縺帙s縲ゅ%縺ョ蝣エ蜷医√ヵ繧。繧、繝ォ髢「謨ー縺ッ繝舌ャ繝輔ぃ繧偵せ繧ソ繝繧ッ繧繝偵シ繝励↓遒コ菫昴@縺セ縺吶ゅヰ繝繝輔ぃ繝サ繧オ繧、繧コ縺ッ縲<tt>(_MAX_LFN + 1) * 2</tt>繝舌う繝医↓縺ェ繧九ョ縺ァ縲√せ繧ソ繝繧ッ遲峨ョ繧オ繧、繧コ縺ッ縺昴l繧定諷ョ縺励◆蜊∝縺ェ繧オ繧、繧コ縺ァ縺ェ縺代l縺ー縺ェ繧翫∪縺帙s縲</p>
<table class="lst2 rset">
<caption>LFN cfg on ARM7</caption>
<tr><th>繧ウ繝シ繝峨壹シ繧ク</th><th>繧ウ繝シ繝峨し繧、繧コ[bytes]</th></tr>
@@ -155,8 +159,8 @@ _FS_SHARE 0 (Disable shareing control)
<tr><td>949(Korean)</td><td>+139857</td></tr>
<tr><td>950(Big5)</td><td>+111497</td></tr>
</table>
-<p>LFN讖溯ス縺ョ荳頑焔縺ェ菴ソ縺譁ケ縺ッ縲√◎繧後r菴ソ繧上↑縺縺ィ縺縺縺薙→縺ァ縺吶ょョ滄圀縲∫オ縺ソ霎シ縺ソ逕ィ騾斐〒縺ッLFN讖溯ス縺後←縺縺励※繧ょソ隕√↓縺ェ繧九→縺縺縺薙→縺ッ縺サ縺ィ繧薙←辟。縺縺ッ縺壹〒縺吶LFN繧呈怏蜉ケ縺ォ縺吶k縺ィ縲驕ク謚槭&繧後◆繧ウ繝シ繝峨サ繝壹シ繧ク縺ォ蠢懊§縺ヲ繝「繧ク繝・繝シ繝ォ繝サ繧オ繧、繧コ縺悟「怜、ァ縺輔l縺セ縺吶ょ承縺ョ陦ィ縺ォ蜷繧ウ繝シ繝峨サ繝壹シ繧ク縺ォ縺翫¢繧記FN繧呈怏蜉ケ縺ォ縺励◆縺ィ縺阪ョ繝「繧ク繝・繝シ繝ォ繝サ繧オ繧、繧コ縺ョ驕輔>繧堤、コ縺励∪縺吶らァ√◆縺。譌・譛ャ莠コ縲∽クュ蝗ス莠コ縺翫h縺ウ髻灘嵜莠コ縺ッ謨ー荳縺ョ譁蟄励r謖√■縺セ縺吶ゆク榊ケク縺ェ縺薙→縺ォ縲√◎繧後ッ蟾ィ螟ァ縺ェOEMシ攻nicode逶ク莠貞、画鋤繝繝シ繝悶Ν繧定ヲ∵アゅ@縲√Δ繧ク繝・繝シ繝ォ繝サ繧オ繧、繧コ縺ッ蜉逧縺ォ蠅怜、ァ縺輔l縺セ縺吶ゅ◎縺ョ邨先棡縲´FN繧呈怏蜉ケ縺ォ縺励◆FatFs繝「繧ク繝・繝シ繝ォ縺ッ縲、VR繧貞性繧谿縺ゥ縺ョ8繝薙ャ繝医サ繝槭う繧ウ繝ウ縺ォ繧、繝ウ繝励Μ繝。繝ウ繝医&繧後k縺薙→縺後〒縺阪∪縺帙s縲<small>縺薙l縺ッ髟キ縺髢鍋ァ√′LFN繧偵う繝ウ繝励Μ繝。繝ウ繝医☆繧九%縺ィ縺ォ闊亥袖繧呈戟縺」縺ヲ縺薙↑縺九▲縺溽炊逕ア縺ァ縺吶</small></p>
-<p>豕ィ: 繝槭う繧ッ繝ュ繧ス繝輔ヨ遉セ縺ッFAT繝輔ぃ繧、繝ォ繝サ繧キ繧ケ繝繝縺ォ縺、縺縺ヲ縺縺上▽縺九ョ迚ケ險ア繧剃ソ晄怏縺励※縺縺セ縺吶ゅ>縺壹l繧LFN縺ョ螳溯」縺ォ髢「縺吶k繧ゅョ縺ァ縲´FN讖溯ス縺ォ蟇セ縺励※$0.25/unit縺ョ繝ゥ繧、繧サ繝ウ繧ケ譁吶r隕∵アゅ@縺ヲ縺縺セ縺吶ゅ%縺ョ縺溘a縲∝膚逕ィ陬ス蜩√〒LFN讖溯ス譛牙柑縺ォ縺吶k縺ィ縺阪ッ縲∵怙邨ゆサ募髄蝨ー縺ォ繧医▲縺ヲ縺ッ繝ゥ繧、繧サ繝ウ繧ケ縺悟ソ隕√°繧ら衍繧後∪縺帙s縲</p>
+<p>LFN讖溯ス縺ョ荳頑焔縺ェ菴ソ縺譁ケ縺ッ縲√◎繧後r菴ソ繧上↑縺縺ィ縺縺縺薙→縺ァ縺吶ょョ滄圀縲∫オ縺ソ霎シ縺ソ逕ィ騾斐〒縺ッLFN讖溯ス縺後←縺縺励※繧ょソ隕√↓縺ェ繧九→縺縺縺薙→縺ッ縺サ縺ィ繧薙←辟。縺縺ッ縺壹〒縺吶LFN繧呈怏蜉ケ縺ォ縺吶k縺ィ縲驕ク謚槭&繧後◆繧ウ繝シ繝峨サ繝壹シ繧ク縺ォ蠢懊§縺ヲ繝「繧ク繝・繝シ繝ォ繝サ繧オ繧、繧コ縺悟「怜、ァ縺輔l縺セ縺吶ょ承縺ョ陦ィ縺ォ蜷繧ウ繝シ繝峨サ繝壹シ繧ク縺ォ縺翫¢繧記FN繧呈怏蜉ケ縺ォ縺励◆縺ィ縺阪ョ繝「繧ク繝・繝シ繝ォ繝サ繧オ繧、繧コ縺ョ驕輔>繧堤、コ縺励∪縺吶ら音縺ォ縲,JK蝨ー蝓溘〒縺ッ謨ー荳縺ョ譁蟄励′菴ソ繧上l縺ヲ縺縺セ縺吶′縲∽ク榊ケク縺ェ縺薙→縺ォ縺昴l縺ッ蟾ィ螟ァ縺ェOEMシ攻nicode逶ク莠貞、画鋤繝繝シ繝悶Ν繧定ヲ∵アゅ@縲√Δ繧ク繝・繝シ繝ォ繝サ繧オ繧、繧コ縺ッ蜉逧縺ォ蠅怜、ァ縺輔l縺セ縺吶ゅ◎縺ョ邨先棡縲√◎繧後i縺ョ繧ウ繝シ繝峨サ繝壹シ繧ク縺ォ縺翫>縺ヲLFN繧呈怏蜉ケ縺ォ縺励◆FatFs繝「繧ク繝・繝シ繝ォ縺ッ縲、VR繧貞性繧谿縺ゥ縺ョ8繝薙ャ繝医サ繝槭う繧ウ繝ウ縺ォ繧、繝ウ繝励Μ繝。繝ウ繝医&繧後k縺薙→縺後〒縺阪∪縺帙s縲</p>
+<p>豕ィ: 繝槭う繧ッ繝ュ繧ス繝輔ヨ遉セ縺ッFAT繝輔ぃ繧、繝ォ繝サ繧キ繧ケ繝繝縺ォ縺、縺縺ヲ縺縺上▽縺九ョ迚ケ險ア繧剃ソ晄怏縺励※縺縺セ縺吶ゅ>縺壹l繧LFN縺ョ螳溯」縺ォ髢「縺吶k繧ゅョ縺ァ縲´FN讖溯ス縺ォ蟇セ縺励※$0.25/unit縺ョ繝ゥ繧、繧サ繝ウ繧ケ譁吶r隕∵アゅ@縺ヲ縺縺セ縺吶よ怙霑代ョFAT32繝峨Λ繧、繝舌ョ螟壹¥縺ッLFN讖溯ス繧貞性繧薙〒縺繧九◆繧√√◎繧後i縺ョ菴ソ逕ィ縺ォ蠖薙◆縺」縺ヲ繝ゥ繧、繧サ繝ウ繧ケ縺悟ソ隕√↓縺ェ繧翫∪縺吶′縲:atFs縺ァ縺ッLFN讖溯ス縺ョ譛牙柑繝サ辟。蜉ケ繧剃ササ諢上↓讒区舌〒縺阪∪縺吶ゅ%縺ョ縺溘a縲∝膚逕ィ陬ス蜩√〒LFN讖溯ス繧呈怏蜉ケ縺ォ縺吶k縺ィ縺阪ッ縲∵怙邨ゆサ募髄蝨ー縺ォ繧医▲縺ヲ縺ッ繝ゥ繧、繧サ繝ウ繧ケ縺悟ソ隕√°繧ら衍繧後∪縺帙s縲</p>
</div>
<div class="para" id="jap">
@@ -166,28 +170,28 @@ _FS_SHARE 0 (Disable shareing control)
<div class="para" id="unicode">
<h3>Unicode蜈・蜃コ蜉帙∈縺ョ蟇セ蠢</h3>
-<p>繝輔ぃ繧、繝ォ髢「謨ー縺ョ繝輔ぃ繧、繝ォ蜷榊・蜃コ蜉帙ッ繝繝輔か繝ォ繝医〒縺ッ ANSI/OEM繧ウ繝シ繝峨〒縺吶′縲√%繧後rUnicode縺ォ蛻繧頑崛縺医k縺薙→繧ゅ〒縺阪∪縺吶6nicode繝輔ぃ繧、繝ォ蜷阪↓髢「縺吶k隧ウ邏ー縺ッ縲<a href="filename.html">繝輔ぃ繧、繝ォ蜷</a>繧貞盾辣ァ縺励※縺上□縺輔>縲</p>
+<p>API荳翫↓縺翫¢繧九ヵ繧。繧、繝ォ蜷阪ョ蜈・蜃コ蜉帙ッ繝繝輔か繝ォ繝医〒縺ッANSI/OEM繧ウ繝シ繝峨〒陦後o繧後∪縺吶′縲√%繧後rUnicode縺ォ蛻繧頑崛縺医k縺薙→繧ゅ〒縺阪∪縺吶ゅ▽縺セ繧翫√%繧後ッFatFs縺鍬FN讖溯ス縺ォ螳悟ィ蟇セ蠢懊@縺ヲ縺繧九%縺ィ繧呈э蜻ウ縺励∪縺吶6nicode縺ョ繝輔ぃ繧、繝ォ蜷阪↓髢「縺吶k隧ウ邏ー縺ッ縲<a href="filename.html">繝輔ぃ繧、繝ォ蜷</a>繧貞盾辣ァ縺励※縺上□縺輔>縲</p>
</div>
<div class="para" id="reentrant">
<h3>繝ェ繧ィ繝ウ繝医Λ繝ウ繧キ繝シ</h3>
<p>莠偵>縺ォ逡ー縺ェ繧九懊Μ繝・繝シ繝縺ォ蟇セ縺吶k繝輔ぃ繧、繝ォ謫堺ス懊ッ繝ェ繧ィ繝ウ繝医Λ繝ウ繝医〒縲∝クク縺ォ蜷梧凾蟷ウ陦後↓蜍穂ス懊〒縺阪∪縺吶ょ酔縺倥懊Μ繝・繝シ繝縺ォ蟇セ縺励※縺ッ繝繝輔か繝ォ繝医〒縺ッ繝ェ繧ィ繝ウ繝医Λ繝ウ繝医〒縺ッ縺ゅj縺セ縺帙s縺後<tt>_FS_REENTRANT</tt>繧ェ繝励す繝ァ繝ウ縺ァ繝ェ繧ィ繝ウ繝医Λ繝ウ繝(繧ケ繝ャ繝繝峨サ繧サ繝シ繝)縺ォ縺吶k縺薙→縺ッ縺ァ縺阪∪縺吶ゅ%縺ョ蝣エ蜷医^S萓晏ュ倥ョ蜷梧悄繧ェ繝悶ず繧ァ繧ッ繝域桃菴憺未謨ー<tt>ff_cre_syncobj, ff_del_syncobj, ff_req_grant</tt> 縺ィ <tt>ff_rel_grant</tt>繧ゅ∪縺溘励Ο繧ク繧ァ繧ッ繝医↓霑ス蜉縺輔l縺ェ縺代l縺ー縺ェ繧翫∪縺帙s縲ゅし繝ウ繝励Ν繝サ繧ウ繝シ繝峨→隗」隱ャ縺ッ<tt>option/syncobj.c</tt>縺ォ縺ゅj縺セ縺吶</p>
-<p>縺ゅk繧ソ繧ケ繧ッ縺後懊Μ繝・繝シ繝繧剃スソ逕ィ荳ュ縺ォ莉悶ョ繧ソ繧ケ繧ッ縺九i縺昴ョ繝懊Μ繝・繝シ繝縺ォ蟇セ縺吶k繝輔ぃ繧、繝ォ髢「謨ー縺悟他縺ウ蜃コ縺輔l繧九→縲√◎縺ョ繧「繧ッ繧サ繧ケ縺ッ蜈医ョ繧ソ繧ケ繧ッ縺後ヵ繧。繧、繝ォ髢「謨ー繧呈栢縺代k縺セ縺ァ繝悶Ο繝繧ッ縺輔l縺セ縺吶ゅb縺励∝セ縺。譎る俣縺<tt>_TIMEOUT</tt>縺ァ謖螳壹&繧後◆譛滄俣繧定カ翫☆縺ィ縲√◎縺ョ髢「謨ー縺ッ<tt>FR_TIMEOUT</tt>縺ァ繧「繝懊シ繝医@縺セ縺吶ゅ>縺上▽縺九ョRTOS縺ァ縺ッ繧ソ繧、繝繧「繧ヲ繝域ゥ溯ス縺ッ繧オ繝昴シ繝医&繧後↑縺縺九b遏・繧後∪縺帙s縲</p>
+<p>縺薙ョ蝣エ蜷医√≠繧九ち繧ケ繧ッ縺後懊Μ繝・繝シ繝繧剃スソ逕ィ荳ュ縺ォ莉悶ョ繧ソ繧ケ繧ッ縺九i縺昴ョ繝懊Μ繝・繝シ繝縺ォ蟇セ縺吶k繝輔ぃ繧、繝ォ髢「謨ー縺悟他縺ウ蜃コ縺輔l繧九→縲√◎縺ョ繧「繧ッ繧サ繧ケ縺ッ蜈医ョ繧ソ繧ケ繧ッ縺後ヵ繧。繧、繝ォ髢「謨ー繧呈栢縺代k縺セ縺ァ繝悶Ο繝繧ッ縺輔l縺セ縺吶ゅb縺励∝セ縺。譎る俣縺<tt>_TIMEOUT</tt>縺ァ謖螳壹&繧後◆譛滄俣繧定カ翫☆縺ィ縲√◎縺ョ髢「謨ー縺ッ<tt>FR_TIMEOUT</tt>縺ァ繧「繝懊シ繝医@縺セ縺吶ゅ>縺上▽縺九ョRTOS縺ァ縺ッ繧ソ繧、繝繧「繧ヲ繝域ゥ溯ス縺ッ繧オ繝昴シ繝医&繧後↑縺縺九b遏・繧後∪縺帙s縲</p>
<p>縺イ縺ィ縺、縺ョ萓句、悶′<tt>f_mount()</tt>縺ィ<tt>f_mkfs()</tt>縺ォ縺ゅj縺セ縺吶ゅ%繧後i縺ョ髢「謨ー縺ッ蜷後§繝懊Μ繝・繝シ繝縺ォ蟇セ縺励※繝ェ繧ィ繝ウ繝医Λ繝ウ繝医〒縺ッ縺ゅj縺セ縺帙s縲ゅ%繧後i縺ョ髢「謨ー繧剃スソ逕ィ縺吶k縺ィ縺阪ッ縲√い繝励Μ繧ア繝シ繧キ繝ァ繝ウ繝サ繝ャ繝吶Ν縺ァ謗剃サ門宛蠕。縺励↑縺代l縺ー縺ェ繧翫∪縺帙s縲</p>
<p>豕ィ: 縺薙ョ繧サ繧ッ繧キ繝ァ繝ウ縺ッFatFs繝「繧ク繝・繝シ繝ォ縺昴l閾ェ菴薙ョ繝ェ繧ィ繝ウ繝医Λ繝ウ繧キ繝シ縺ォ縺、縺縺ヲ隱ャ譏弱@縺ヲ縺縺セ縺吶ゅョ繧」繧ケ繧ッI/O繝「繧ク繝・繝シ繝ォ縺ョ繝ェ繧ィ繝ウ繝医Λ繝ウ繧キ繝シ縺ォ髢「縺励※縺ッ菴輔ョ蜑肴署繧ゅ≠繧翫∪縺帙s縲</p>
</div>
<div class="para" id="dup">
<h3>螟夐阪ヵ繧。繧、繝ォ繝サ繧「繧ッ繧サ繧ケ</h3>
-<p>FatFs繝「繧ク繝・繝シ繝ォ縺ァ縺ッ繝繝輔か繝ォ繝医〒縺ッ螟夐阪い繧ッ繧サ繧ケ蛻カ蠕。讖溯ス繧偵し繝昴シ繝医@縺ヲ縺縺セ縺帙s縲ゅヵ繧。繧、繝ォ縺ォ蟇セ縺吶k螟夐阪い繧ッ繧サ繧ケ縺ッ縲√◎縺ョ繧「繧ッ繧サ繧ケ繝サ繝「繝シ繝峨↓繧医▲縺ヲ蛻カ髯舌&繧後∪縺吶ゆク縺、縺ョ繝輔ぃ繧、繝ォ縺ォ蟇セ縺吶k螟夐阪が繝シ繝励Φ縺ッ縲√◎繧後i縺悟ィ縺ヲ繝ェ繝シ繝峨サ繝「繝シ繝峨ョ縺ィ縺阪↓髯舌▲縺ヲ險ア蜿ッ縺輔l縺セ縺吶よ嶌縺崎セシ縺ソ繝「繝シ繝峨r蜷ォ繧螟夐阪が繝シ繝励Φ縲√∪縺滄幕縺九l縺ヲ縺繧九ヵ繧。繧、繝ォ縺ォ蟇セ縺吶k繝ェ繝阪シ繝繧蜑企勁縲√き繝ャ繝ウ繝医サ繝繧」繝ャ繧ッ繝医Μ縺ョ蜑企勁繧定。後▲縺ヲ縺ッ縺ェ繧翫∪縺帙s縲ゅ&繧ゅ↑縺縺ィ縲√◎縺ョ繝懊Μ繝・繝シ繝縺ョFAT讒矩縺檎エ螢翫&繧後k蜿ッ閭ス諤ァ縺後≠繧翫∪縺吶</p>
-<p><tt>_FS_SHARE</tt>縺ォ1莉・荳翫ョ蛟、繧偵そ繝繝医☆繧九%縺ィ縺ォ繧医j縲√ヵ繧。繧、繝ォ蜊倅ス阪ョ謗剃サ門宛蠕。繧定ェ蜍輔〒陦後≧縺薙→繧ゅ〒縺阪∪縺吶ゅ%縺ョ蝣エ蜷医∽ク願ィ倥ョ繝ォ繝シ繝ォ繧堤エ縺」縺溘が繝シ繝励Φ繝サ繝ェ繝阪シ繝繝サ蜑企勁繧定ゥヲ縺ソ繧九→縲√◎縺ョ髢「謨ー縺ッ<tt>FR_LOCKED</tt>縺ァ螟ア謨励@縺セ縺吶</p>
+<p>FatFs繝「繧ク繝・繝シ繝ォ縺ァ縺ッ繝繝輔か繝ォ繝医〒縺ッ螟夐阪い繧ッ繧サ繧ケ蛻カ蠕。讖溯ス繧偵し繝昴シ繝医@縺ヲ縺縺セ縺帙s縲ゅヵ繧。繧、繝ォ縺ォ蟇セ縺吶k螟夐阪い繧ッ繧サ繧ケ縺ッ縲√◎縺ョ繧「繧ッ繧サ繧ケ繝サ繝「繝シ繝峨↓繧医▲縺ヲ蛻カ髯舌&繧後∪縺吶ゆク縺、縺ョ繝輔ぃ繧、繝ォ縺ォ蟇セ縺吶k螟夐阪が繝シ繝励Φ縺ッ縲√◎繧後i縺悟ィ縺ヲ繝ェ繝シ繝峨サ繝「繝シ繝峨ョ縺ィ縺阪↓髯舌▲縺ヲ險ア蜿ッ縺輔l縺セ縺吶よ嶌縺崎セシ縺ソ繝「繝シ繝峨r蜷ォ繧螟夐阪が繝シ繝励Φ縲√∪縺滄幕縺九l縺ヲ縺繧九ヵ繧。繧、繝ォ縺ォ蟇セ縺吶k繝ェ繝阪シ繝繧蜑企勁繧定。後▲縺ヲ縺ッ縺ェ繧翫∪縺帙s縲ゅ&繧ゅ↑縺縺ィ縲√◎縺ョ繝懊Μ繝・繝シ繝縺ョFAT讒矩縺檎エ螢翫&繧後k蜿ッ閭ス諤ァ縺後≠繧翫∪縺吶</p>
+<p><tt>_FS_LOCK</tt>縺ォ1莉・荳翫ョ蛟、(蛟、縺ッ蜷梧凾縺ォ邂。逅縺ァ縺阪k繝輔ぃ繧、繝ォ謨ー)繧偵そ繝繝医☆繧九%縺ィ縺ァ螟夐阪い繧ッ繧サ繧ケ蛻カ蠕。讖溯ス縺梧怏蜉ケ縺ォ縺ェ繧翫√ヵ繧。繧、繝ォ蜊倅ス阪ョ謗剃サ門宛蠕。繧定ェ蜍輔〒陦後≧縺薙→繧ゅ〒縺阪∪縺吶ゅ%縺ョ蝣エ蜷医∽ク願ィ倥ョ繝ォ繝シ繝ォ繧堤エ縺」縺溘が繝シ繝励Φ繝サ繝ェ繝阪シ繝繝サ蜑企勁繧定ゥヲ縺ソ繧九→縲√◎縺ョ髢「謨ー縺ッ<tt>FR_LOCKED</tt>縺ァ螟ア謨励@縺セ縺吶<tt>_FS_LOCK</tt>繧定カ翫∴縺滓焚縺ョ繝輔ぃ繧、繝ォ繧偵が繝シ繝励Φ縺励h縺縺ィ縺吶k縺ィ縲<tt>FR_TOO_MANY_OPEN_FILES</tt>縺ァ螟ア謨励@縺セ縺吶</p>
</div>
<div class="para" id="fs1">
<h3>蜉ケ邇逧縺ェ繝輔ぃ繧、繝ォ繝サ繧「繧ッ繧サ繧ケ</h3>
-<p>蟆剰ヲ乗ィ。縺ェ邨霎シ繧キ繧ケ繝繝縺ァ縺ョ繝輔ぃ繧、繝ォ縺ョ隱ュ縺ソ譖ク縺阪↓縺翫¢繧句柑邇縺ョ濶ッ縺繧「繧ッ繧サ繧ケ縺ョ縺溘a縲√い繝励Μ繧ア繝シ繧キ繝ァ繝ウ繝サ繝励Ο繧ー繝ゥ繝槭ッFatFs繝「繧ク繝・繝シ繝ォ縺ョ荳ュ縺ァ縺ゥ縺ョ繧医≧縺ェ蜃ヲ逅縺瑚。後o繧後※縺繧九°閠諷ョ縺吶∋縺阪〒縺吶ゅせ繝医Ξ繝シ繧ク荳翫ョ繝繝シ繧ソ縺ッf_read髢「謨ー縺ォ繧医j谺。縺ョ繧キ繝シ繧ア繝ウ繧ケ縺ァ霆「騾√&繧後∪縺吶</p>
+<p>蟆剰ヲ乗ィ。縺ェ邨霎シ繧キ繧ケ繝繝縺ァ縺ョ繝輔ぃ繧、繝ォ縺ョ隱ュ縺ソ譖ク縺阪↓縺翫¢繧句柑邇縺ョ濶ッ縺繧「繧ッ繧サ繧ケ縺ョ縺溘a縲√い繝励Μ繧ア繝シ繧キ繝ァ繝ウ繝サ繝励Ο繧ー繝ゥ繝槭ッFatFs繝「繧ク繝・繝シ繝ォ縺ョ荳ュ縺ァ縺ゥ縺ョ繧医≧縺ェ蜃ヲ逅縺瑚。後o繧後※縺繧九°閠諷ョ縺吶∋縺阪〒縺吶ゅせ繝医Ξ繝シ繧ク荳翫ョ繝繝シ繧ソ縺ッ<tt>f_read()</tt>縺ォ繧医j谺。縺ョ繧キ繝シ繧ア繝ウ繧ケ縺ァ霆「騾√&繧後∪縺吶</p>
<p>蝗ウ1. 繧サ繧ッ繧ソ繝サ繝溘せ繧「繝ゥ繧、繝ウ繝峨サ繝ェ繝シ繝 (繧キ繝ァ繝シ繝)<br>
-<img src="../img/f1.png" width="490" height="73" alt="fig.1">
+<img src="../img/f1.png" width="490" height="110" alt="fig.1">
</p>
<p>蝗ウ2. 繧サ繧ッ繧ソ繝サ繝溘せ繧「繝ゥ繧、繝ウ繝峨サ繝ェ繝シ繝 (繝ュ繝ウ繧ー)<br>
<img src="../img/f2.png" width="490" height="140" alt="fig.2">
@@ -196,7 +200,7 @@ _FS_SHARE 0 (Disable shareing control)
<img src="../img/f3.png" width="490" height="119" alt="fig.3">
</p>
<p>繝輔ぃ繧、繝ォI/O繝舌ャ繝輔ぃ縺ッ繧サ繧ッ繧ソ縺ョ荳驛ィ縺ョ繝繝シ繧ソ繧定ェュ縺ソ譖ク縺阪☆繧九◆繧√ョ繧サ繧ッ繧ソ繝サ繝舌ャ繝輔ぃ繧呈э蜻ウ縺励∪縺吶ゅそ繧ッ繧ソ繝サ繝舌ャ繝輔ぃ縺ッ縲√◎繧後◇繧後ョ繝輔ぃ繧、繝ォ繝サ繧ェ繝悶ず繧ァ繧ッ繝亥縺ョ繝励Λ繧、繝吶シ繝医サ繧サ繧ッ繧ソ繝サ繝舌ャ繝輔ぃ縺セ縺溘ッ繝輔ぃ繧、繝ォ繝サ繧キ繧ケ繝繝繝サ繧ェ繝悶ず繧ァ繧ッ繝亥縺ョ蜈ア譛峨そ繧ッ繧ソ繝サ繝舌ャ繝輔ぃ縺ョ縺ゥ縺。繧峨°縺ァ縺吶ゅヰ繝繝輔ぃ讒区舌が繝励す繝ァ繝ウ縺ョ<tt>_FS_TINY</tt>縺ッ縲√ョ繝シ繧ソ霆「騾√↓縺ゥ縺。繧峨r菴ソ縺縺九r豎コ螳壹@縺セ縺吶ゅち繧、繝九シ繝サ繝舌ャ繝輔ぃ(1)縺碁∈謚槭&繧後k縺ィ繝繝シ繧ソ繝サ繝。繝「繝ェ縺ョ豸郁イサ縺ッ縺昴l縺槭l縺ョ繝輔ぃ繧、繝ォ繝サ繧ェ繝悶ず繧ァ繧ッ繝医〒512繝舌う繝域ク帛ー代&繧後∪縺吶ゅ%縺ョ蝣エ蜷医:atFs繝「繧ク繝・繝シ繝ォ縺ッ繝輔ぃ繧、繝ォ繝サ繝繝シ繧ソ縺ョ霆「騾√→FAT/繝繧」繝ャ繧ッ繝医Μ繝サ繧「繧ッ繧サ繧ケ縺ォ繝輔ぃ繧、繝ォ繝サ繧キ繧ケ繝繝繝サ繧ェ繝悶ず繧ァ繧ッ繝亥縺ョ繧サ繧ッ繧ソ繝サ繝舌ャ繝輔ぃ縺縺代r菴ソ逕ィ縺励∪縺吶ゅち繧、繝九シ繝サ繝舌ャ繝輔ぃ縺ョ谺轤ケ縺ッ縲√そ繧ッ繧ソ繝サ繝舌ャ繝輔ぃ縺ォ繧ュ繝」繝繧キ繝・縺輔l縺檳AT繝繝シ繧ソ縺後ヵ繧。繧、繝ォ繝サ繝繝シ繧ソ縺ョ霆「騾√↓繧医j螟ア繧上l縲√け繝ゥ繧ケ繧ソ蠅逡後ョ豈弱↓繝ェ繝ュ繝シ繝峨&繧後↑縺代l縺ー縺ェ繧峨↑縺縺薙→縺ァ縺吶ゅ〒繧ゅ∵が縺上↑縺諤ァ閭ス縺ィ蟆代↑縺繝。繝「繝ェ豸郁イサ縺ョ隕也せ縺九i螟壹¥縺ョ繧「繝励Μ繧ア繝シ繧キ繝ァ繝ウ縺ォ驕ゥ縺吶k縺ァ縺励g縺縲</p>
-<p>蝗ウ1縺ッ繧サ繧ッ繧ソ縺ョ荳驛ィ縺ョ繝繝シ繧ソ縺後ヵ繧。繧、繝ォI/O繝舌ャ繝輔ぃ繧堤オ檎罰縺ァ霆「騾√&繧後k縺薙→繧堤、コ縺励∪縺吶ょ峙2縺ォ遉コ縺輔l繧矩聞縺繝繝シ繧ソ縺ョ霆「騾√〒縺ッ縲∬サ「騾√ョ繝シ繧ソ縺ョ荳ュ髢薙ョ1繧サ繧ッ繧ソ縺セ縺溘ッ縺昴l莉・荳翫ョ繧サ繧ッ繧ソ縺ォ縺セ縺溘′繧玖サ「騾√ョ繝シ繧ソ縺後い繝励Μ繧ア繝シ繧キ繝ァ繝ウ繝サ繝舌ャ繝輔ぃ縺ォ逶エ謗・霆「騾√&繧後※縺縺セ縺吶ょ峙3縺ッ霆「騾√ョ繝シ繧ソ蜈ィ菴薙′繧サ繧ッ繧ソ蠅逡後↓繧「繝ゥ繧、繝。繝ウ繝医&繧後※縺繧句エ蜷医r遉コ縺励※縺縺セ縺吶ゅ%縺ョ蝣エ蜷医√ヵ繧。繧、繝ォI/O繝舌ャ繝輔ぃ縺ッ菴ソ逕ィ縺輔l縺セ縺帙s縲ら峩謗・霆「騾√↓縺翫>縺ヲ縺ッ譛螟ァ縺ョ遽蝗イ縺ョ繧サ繧ッ繧ソ縺慧isk_read髢「謨ー縺ァ荳蠎ヲ縺ォ隱ュ縺ソ霎シ縺セ繧後∪縺吶′縲√け繝ゥ繧ケ繧ソ蠅逡後r雜翫∴繧九槭Ν繝√サ繧サ繧ッ繧ソ霆「騾√ッ縺昴l縺碁團謗・縺ァ縺ゅ▲縺ヲ繧り。後o繧後∪縺帙s縲</p>
+<p>蝗ウ1縺ッ繧サ繧ッ繧ソ縺ョ荳驛ィ縺ョ繝繝シ繧ソ縺後ヵ繧。繧、繝ォI/O繝舌ャ繝輔ぃ繧堤オ檎罰縺ァ霆「騾√&繧後k縺薙→繧堤、コ縺励∪縺吶ょ峙2縺ォ遉コ縺輔l繧矩聞縺繝繝シ繧ソ縺ョ霆「騾√〒縺ッ縲∬サ「騾√ョ繝シ繧ソ縺ョ荳ュ髢薙ョ1繧サ繧ッ繧ソ縺セ縺溘ッ縺昴l莉・荳翫ョ繧サ繧ッ繧ソ縺ォ縺セ縺溘′繧玖サ「騾√ョ繝シ繧ソ縺後い繝励Μ繧ア繝シ繧キ繝ァ繝ウ繝サ繝舌ャ繝輔ぃ縺ォ逶エ謗・霆「騾√&繧後※縺縺セ縺吶ょ峙3縺ッ霆「騾√ョ繝シ繧ソ蜈ィ菴薙′繧サ繧ッ繧ソ蠅逡後↓繧「繝ゥ繧、繝。繝ウ繝医&繧後※縺繧句エ蜷医r遉コ縺励※縺縺セ縺吶ゅ%縺ョ蝣エ蜷医√ヵ繧。繧、繝ォI/O繝舌ャ繝輔ぃ縺ッ菴ソ逕ィ縺輔l縺セ縺帙s縲ら峩謗・霆「騾√↓縺翫>縺ヲ縺ッ譛螟ァ縺ョ遽蝗イ縺ョ繧サ繧ッ繧ソ縺<tt>disk_read()</tt>縺ァ荳蠎ヲ縺ォ隱ュ縺ソ霎シ縺セ繧後∪縺吶′縲√け繝ゥ繧ケ繧ソ蠅逡後r雜翫∴繧九槭Ν繝√サ繧サ繧ッ繧ソ霆「騾√ッ縺昴l縺碁團謗・縺ァ縺ゅ▲縺ヲ繧り。後o繧後∪縺帙s縲</p>
<p>縺薙ョ繧医≧縺ォ縲√そ繧ッ繧ソ縺ォ繧「繝ゥ繧、繝。繝ウ繝医@縺溘ヵ繧。繧、繝ォ縺ョ隱ュ縺ソ譖ク縺阪∈縺ョ驟肴ョ縺ッ繝舌ャ繝輔ぃ邨檎罰縺ョ繝繝シ繧ソ霆「騾√r驕ソ縺代∬ェュ縺ソ譖ク縺肴ァ閭ス縺ッ謾ケ蝟縺輔l繧九〒縺励g縺縲ゅ◎縺ョ蜉ケ譫懊↓蜉縺医√ち繧、繝九シ讒区舌〒繧ュ繝」繝繧キ繝・縺輔l縺檳AT繝繝シ繧ソ縺後ヵ繧。繧、繝ォ繝サ繝繝シ繧ソ縺ョ霆「騾√↓繧医j繝輔Λ繝繧キ繝・縺輔l縺壹髱槭ち繧、繝九シ讒区舌→蜷後§諤ァ閭ス繧貞ー上&縺ェ繝。繝「繝ェ繝サ繝輔ャ繝医励Μ繝ウ繝医〒驕疲舌〒縺阪∪縺吶</p>
</div>
@@ -215,7 +219,7 @@ _FS_SHARE 0 (Disable shareing control)
<div class="para" id="critical">
<h3>繧ッ繝ェ繝√き繝ォ繝サ繧サ繧ッ繧キ繝ァ繝ウ</h3>
-<p>繧ケ繝医Ξ繝シ繧ク荳翫ョFAT讒矩繧呈桃菴懊@縺ヲ縺繧矩比クュ縺ァ縲∝●髮サ縲∽ク肴ュ」縺ェ繝。繝繧」繧「縺ョ蜿悶j螟悶@縲∝屓蠕ゥ荳崎ス縺ェ繝繝シ繧ソ繝サ繧ィ繝ゥ繝シ遲峨ョ髫懷ョウ縺檎匱逕溘☆繧九→縲∝ヲ逅縺御クュ騾泌濠遶ッ縺ェ迥カ諷九〒荳ュ譁ュ縺輔l縲√◎縺ョ邨先棡縺ィ縺励※FAT讒矩縺檎エ螢翫&繧後k蜿ッ閭ス諤ァ縺後≠繧翫∪縺吶よャ。縺ォFatFs繝「繧ク繝・繝シ繝ォ縺ォ縺翫¢繧九け繝ェ繝√き繝ォ繝サ繧サ繧ッ繧キ繝ァ繝ウ縺ィ縲√◎縺ョ髢薙ョ髫懷ョウ縺ォ繧医j襍キ縺阪≧繧九お繝ゥ繝シ縺ョ迥カ諷九r遉コ縺励∪縺吶</p>
+<p>繧ケ繝医Ξ繝シ繧ク荳翫ョFAT讒矩繧呈桃菴懊@縺ヲ縺繧矩比クュ縺ァ縲∝●髮サ縲∽ク肴ュ」縺ェ繝。繝繧」繧「縺ョ蜿悶j螟悶@縲∝屓蠕ゥ荳崎ス縺ェ繝繝シ繧ソ繝サ繧ィ繝ゥ繝シ遲峨ョ髫懷ョウ縺檎匱逕溘☆繧九→縲∝ヲ逅縺御クュ騾泌濠遶ッ縺ェ迥カ諷九〒荳ュ譁ュ縺輔l縲√◎縺ョ邨先棡縺ィ縺励※FAT繝懊Μ繝・繝シ繝縺ョ讒矩縺檎エ螢翫&繧後k蜿ッ閭ス諤ァ縺後≠繧翫∪縺吶よャ。縺ォFatFs繝「繧ク繝・繝シ繝ォ縺ォ縺翫¢繧九け繝ェ繝√き繝ォ繝サ繧サ繧ッ繧キ繝ァ繝ウ縺ィ縲√◎縺ョ髢薙ョ髫懷ョウ縺ォ繧医j襍キ縺阪≧繧九お繝ゥ繝シ縺ョ迥カ諷九r遉コ縺励∪縺吶</p>
<div class="lset">
蝗ウ4. 髟キ縺繧ッ繝ェ繝√き繝ォ繝サ繧サ繧ッ繧キ繝ァ繝ウ<br>
<img src="../img/f4.png" width="320" height="436" alt="fig.4">
@@ -233,20 +237,20 @@ _FS_SHARE 0 (Disable shareing control)
<li>譁ー隕上∪縺溘ッ荳頑嶌縺阪〒菴懈舌&繧後◆繝輔ぃ繧、繝ォ縺ョ髟キ縺輔′繧シ繝ュ縺ォ縺ェ縺」縺ヲ谿九k縲</li>
<li>繝ュ繧ケ繝医メ繧ァ繝シ繝ウ縺ョ逋コ逕溘↓繧医j繝懊Μ繝・繝シ繝縺ョ蛻ゥ逕ィ蜉ケ邇縺梧が蛹悶☆繧九</li>
</ul>
-<p>縺縺壹l繧よ嶌縺崎セシ縺ソ荳ュ繧謫堺ス懷ッセ雎。縺ァ縺ェ縺繝輔ぃ繧、繝ォ縺ォ縺ッ蠖ア髻ソ縺ッ縺ゅj縺セ縺帙s縲ゅ%繧後i縺ョ繧ッ繝ェ繝√き繝ォ繝サ繧サ繧ッ繧キ繝ァ繝ウ縺ッ縲√ヵ繧。繧、繝ォ繧呈嶌縺崎セシ縺ソ繝「繝シ繝峨〒髢九>縺ヲ縺繧区凾髢薙r譛蟆城剞縺ォ縺吶k縺九’_sync()繧帝←螳應スソ逕ィ縺吶k縺薙→縺ァ蝗ウ5縺ョ繧医≧縺ォ繝ェ繧ケ繧ッ繧呈怙蟆丞喧縺吶k縺薙→縺後〒縺阪∪縺吶</p>
+<p>縺縺壹l繧よ嶌縺崎セシ縺ソ荳ュ繧謫堺ス懊ョ蟇セ雎。縺ァ縺ェ縺繝輔ぃ繧、繝ォ縺ォ縺ッ蠖ア髻ソ縺ッ縺ゅj縺セ縺帙s縲ゅ%繧後i縺ョ繧ッ繝ェ繝√き繝ォ繝サ繧サ繧ッ繧キ繝ァ繝ウ縺ッ縲√ヵ繧。繧、繝ォ繧呈嶌縺崎セシ縺ソ繝「繝シ繝峨〒髢九>縺ヲ縺繧区凾髢薙r譛蟆城剞縺ォ縺吶k縺九<tt>f_sync()</tt>繧帝←螳應スソ逕ィ縺吶k縺薙→縺ァ蝗ウ5縺ョ繧医≧縺ォ繝ェ繧ケ繧ッ繧呈怙蟆丞喧縺吶k縺薙→縺後〒縺阪∪縺吶</p>
</div>
<div class="para" id="license">
<h3>FatFs縺ョ繝ゥ繧、繧サ繝ウ繧ケ縺ォ縺、縺縺ヲ</h3>
<p>繧ス繝シ繧ケ繝サ繝輔ぃ繧、繝ォ縺ョ繝倥ャ繝縺ォ繝ゥ繧、繧サ繝ウ繧ケ譚。莉カ縺瑚ィ倩ソー縺輔l縺ヲ縺繧九ョ縺ァ縲∝茜逕ィ縺ョ髫帙ッ縺昴l縺ォ蠕薙≧縺薙→縲り恭隱槭r隱ュ繧√↑縺譁ケ縺ョ縺溘a縺ォ莉・荳九↓譌・譛ャ隱櫁ィウ繧堤、コ縺励※縺翫″縺セ縺吶</p>
<pre>/*----------------------------------------------------------------------------/
-/ FatFs - FAT file system module R0.08a (C)ChaN, 2010
+/ FatFs - FAT file system module R0.09b (C)ChaN, 2013
/-----------------------------------------------------------------------------/
/ FatFs繝「繧ク繝・繝シ繝ォ縺ッ縲∝ー剰ヲ乗ィ。縺ェ邨縺ソ霎シ縺ソ繧キ繧ケ繝繝蜷代¢縺ョ豎守畑FAT繝輔ぃ繧、繝ォ繧キ繧ケ繝繝繝サ
/ 繝「繧ク繝・繝シ繝ォ縺ァ縺吶ゅ%繧後ッ繝輔Μ繝シ繝サ繧ス繝輔ヨ繧ヲ繧ァ繧「縺ィ縺励※縲∵蕗閧イ繝サ遐皮ゥカ繝サ髢狗匱縺ョ縺溘a縺ォ
/ 莉・荳九ョ繝ゥ繧、繧サ繝ウ繧ケ繝サ繝昴Μ繧キ繝シ縺ョ荳九〒蜈ャ髢九&繧後※縺縺セ縺吶
/
-/ Copyright (C) 2010, ChaN, all right reserved.
+/ Copyright (C) 2013, ChaN, all right reserved.
/
/ * FatFs繝「繧ク繝・繝シ繝ォ縺ッ繝輔Μ繝シ繝サ繧ス繝輔ヨ繧ヲ繧ァ繧「縺ァ縺ゅj縲√∪縺<em>辟。菫晁ィシ縺ァ縺</em>縲
/ * 逕ィ騾斐↓蛻カ髯舌ッ縺ゅj縺セ縺帙s縲<em>縺ゅ↑縺溘ョ雋ャ莉サ縺ョ荳九↓縺翫>縺ヲ</em>縲∝倶ココ逧繝サ髱槫霧蛻ゥ逧縺ェ
diff --git a/data/sysrom/fat/doc/ja/chdir.html b/data/sysrom/fat/doc/ja/chdir.html
index fc66f55..00bf37d 100644
--- a/data/sysrom/fat/doc/ja/chdir.html
+++ b/data/sysrom/fat/doc/ja/chdir.html
@@ -11,78 +11,67 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_chdir</h2>
<p>カレント・ディレクトリを変更します。</p>
<pre>
FRESULT f_chdir (
- const XCHAR* <em>Path</em> <span>/* ディレクトリ名へのポインタ */</span>
+ const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] ディレクトリ名へのポインタ */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>Path</dt>
-<dd>移動対象のディレクトリの<a href="filename.html">パス名</a>の入った<tt>'\0'</tt>で終わる文字列を指定します。</dd>
+<dt>path</dt>
+<dd>移動対象のディレクトリの<a href="filename.html">パス名</a>を示すヌル文字<tt>'\0'</tt>終端の文字列を指定します。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>正常終了。</dd>
-<dt>FR_NO_FILE</dt>
-<dd>ファイルが見つからない。</dd>
-<dt>FR_NO_PATH</dt>
-<dd>パスが見つからない。</dd>
-<dt>FR_INVALID_NAME</dt>
-<dd>パス名が不正。</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>ドライブ番号が不正。</dd>
-<dt>FR_NOT_READY</dt>
-<dd>メディアがセットされていないなど、物理ドライブが動作不能状態。</dd>
-<dt>FR_WRITE_PROTECTED</dt>
-<dd>メディアが書き込み禁止状態。</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>ディスク・エラーによる失敗。</dd>
-<dt>FR_INT_ERR</dt>
-<dd>不正なFAT構造または内部エラーによる失敗。</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>その論理ドライブにワーク・エリアが与えられていない。</dd>
-<dt>FR_NO_FILESYSTEM</dt>
-<dd>有効なFATボリュームが見つからない。</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#ok">FR_NO_FILE</a>,
+<a href="rc.html#np">FR_NO_PATH</a>,
+<a href="rc.html#in">FR_INVALID_NAME</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
-<p>f_chdir関数は各ボリュームのカレント・ディレクトリを変更します。カレント・ディレクトリはファイル・システム・オブジェクトの初期化が行われたとき、ルート・ディレクトリに設定されます。カレント・ディレクトリは、ファイル・システム・オブジェクトに記録されるため、そのボリュームを使用する全てのタスクに対して影響を与えます。</p>
+<p>各ボリュームのカレント・ディレクトリを変更します。カレント・ディレクトリはファイル・システム・オブジェクトの初期化が行われたとき、ルート・ディレクトリに設定されます。カレント・ディレクトリは、ファイル・システム・オブジェクトに記録されるため、そのボリュームを使用する全てのタスクに対して影響を与えます。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p><tt>_FS_RPATH == 1</tt>のときに使用可能となります。</p>
</div>
-<div class="para">
+<div class="para exa">
<h4>使用例</h4>
<pre>
- // カレント・ドライブのカレント・ディレクトリを変更 (ルート下のdir1へ)
+ <span class="c">/* カレント・ドライブのカレント・ディレクトリを変更 (ルート下のdir1へ) */</span>
f_chdir("/dir1");
- // ドライブ2のカレント・ディレクトリを変更 (親ディレクトリへ)
+ <span class="c">/* ドライブ2のカレント・ディレクトリを変更 (親ディレクトリへ) */</span>
f_chdir("2:..");
</pre>
</div>
-<div class="para">
+<div class="para ref">
<h4>参照</h4>
<p><tt><a href="chdrive.html">f_chdrive</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/ja/chdrive.html b/data/sysrom/fat/doc/ja/chdrive.html
index 8344a3e..054f5e1 100644
--- a/data/sysrom/fat/doc/ja/chdrive.html
+++ b/data/sysrom/fat/doc/ja/chdrive.html
@@ -11,49 +11,47 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_chdrive</h2>
<p>カレント・ドライブを変更します。</p>
<pre>
FRESULT f_chdrive (
- BYTE <em>Drive</em> <span>/* 論理ドライブ番号 */</span>
+ BYTE <span class="arg">vol</span> <span class="c">/* [IN] 論理ドライブ番号 */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>Drive</dt>
+<dt>vol</dt>
<dd>カレント・ドライブに設定する<a href="filename.html">論理ドライブ番号</a>を指定します。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>正常終了。</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>ドライブ番号が不正。</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
-<p>f_chdrive関数はカレント・ドライブを変更します。システム起動時の初期値は0です。この設定はFatFsモジュールの静的変数に記録されるため、全てのタスクに対して影響を与えます。</p>
+<p>カレント・ドライブを変更します。システム起動時の初期値は0です。この設定はFatFsモジュールの静的変数に記録されるため、全てのタスクに対して影響を与えます。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p><tt>_FS_RPATH == 1</tt>のときに使用可能となります。</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>参照</h4>
<p><tt><a href="chdir.html">f_chdir</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/ja/chmod.html b/data/sysrom/fat/doc/ja/chmod.html
index a9b13e0..13240a9 100644
--- a/data/sysrom/fat/doc/ja/chmod.html
+++ b/data/sysrom/fat/doc/ja/chmod.html
@@ -11,24 +11,24 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_chmod</h2>
<p>ファイルまたはディレクトリの属性を変更します。</p>
<pre>
FRESULT f_chmod (
- const TCHAR* <em>FileName</em>, <span>/* ファイルまたはディレクトリ名へのポインタ */</span>
- BYTE <em>Attribute</em>, <span>/* 設定値 */</span>
- BYTE <em>AttributeMask</em> <span>/* 変更マスク */</span>
+ const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] ファイルまたはディレクトリ名へのポインタ */</span>
+ BYTE <span class="arg">attr</span>, <span class="c">/* [IN] 設定値 */</span>
+ BYTE <span class="arg">mask</span> <span class="c">/* [IN] 変更マスク */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>FileName</dt>
-<dd>属性変更対象のファイルまたはディレクトリの<a href="filename.html">パス名</a>の入った<tt>'\0'</tt>で終わる文字列を指定します。</dd>
-<dt>Attribute</dt>
+<dt>path</dt>
+<dd>属性変更対象のファイルまたはディレクトリ<a href="filename.html">パス名</a>を示すヌル文字<tt>'\0'</tt>終端の文字列を指定します。</dd>
+<dt>attr</dt>
<dd>設定する属性。指定可能な属性は次の通りで、これらの組み合わせで指定します。指定されなかった属性は解除されます。<br>
<table class="lst">
<tr><th>値</th><th>意味</th></tr>
@@ -38,57 +38,48 @@ FRESULT f_chmod (
<tr><td>AM_HID</td><td>ヒドゥン</td></tr>
</table>
</dd>
-<dt>AttributeMask</dt>
-<dd>変更する属性のマスク。指定した属性が設定または解除され、指定されなかった属性は状態が保持されます。<tt>Attribute</tt>と同じ値を使います。</dd>
+<dt>mask</dt>
+<dd>変更する属性のマスク。指定した属性が設定または解除され、指定されなかった属性は状態が保持されます。<tt class="arg">attr</tt>と同じ値を使います。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>正常終了。</dd>
-<dt>FR_NO_FILE</dt>
-<dd>ファイルが見つからない。</dd>
-<dt>FR_NO_PATH</dt>
-<dd>パスが見つからない。</dd>
-<dt>FR_INVALID_NAME</dt>
-<dd>パス名が不正。</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>ドライブ番号が不正。</dd>
-<dt>FR_NOT_READY</dt>
-<dd>メディアがセットされていないなど、物理ドライブが動作不能状態。</dd>
-<dt>FR_WRITE_PROTECTED</dt>
-<dd>メディアが書き込み禁止状態。</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>ディスク・エラーによる失敗。</dd>
-<dt>FR_INT_ERR</dt>
-<dd>不正なFAT構造または内部エラーによる失敗。</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>その論理ドライブにワーク・エリアが与えられていない。</dd>
-<dt>FR_NO_FILESYSTEM</dt>
-<dd>有効なFATボリュームが見つからない。</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#ok">FR_NO_FILE</a>,
+<a href="rc.html#np">FR_NO_PATH</a>,
+<a href="rc.html#in">FR_INVALID_NAME</a>,
+<a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>,
+<a href="rc.html#lo">FR_LOCKED</a>,
+<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
<p>ファイルまたはディレクトリの属性を変更します。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_FS_MINIMIZE == 0</tt>のとき使用可能です。</p>
</div>
-<div class="para">
+<div class="para use">
<h4>使用例</h4>
<pre>
- <span>/* リードオンリーをセット、アーカイブをクリア、その他は変更しない */</span>
+ <span class="c">/* リードオンリーをセット、アーカイブをクリア、その他は変更しない */</span>
f_chmod("file.txt", AM_RDO, AM_RDO | AM_ARC);
</pre>
</div>
diff --git a/data/sysrom/fat/doc/ja/close.html b/data/sysrom/fat/doc/ja/close.html
index b435628..4cc4bae 100644
--- a/data/sysrom/fat/doc/ja/close.html
+++ b/data/sysrom/fat/doc/ja/close.html
@@ -11,55 +11,51 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_close</h2>
<p>ファイルを閉じます。</p>
<pre>
FRESULT f_close (
- FIL* <em>FileObject</em> <span>/* ファイル・オブジェクトへのポインタ */</span>
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] ファイル・オブジェクトへのポインタ */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>閉じようとするファイルのファイル・オブジェクト構造体へのポインタを指定します。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>正常終了。</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>ディスク・エラーによる失敗。</dd>
-<dt>FR_INT_ERR</dt>
-<dd>不正なFAT構造または内部エラーによる失敗。</dd>
-<dt>FR_NOT_READY</dt>
-<dd>メディアがセットされていないなど、物理ドライブが動作不能状態。</dd>
-<dt>FR_INVALID_OBJECT</dt>
-<dd>無効なファイル・オブジェクト。</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#io">FR_INVALID_OBJECT</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
<p>ファイルを閉じます。何らかの書き込みの行われたファイルの場合、キャッシュされた状態(リード/ライト・バッファ上のデータ、変更されたFATやディレクトリ項目)はディスクに書き戻されます。関数が正常終了すると、そのファイル・オブジェクトは無効になり、そのメモリも解放できます。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p>全ての構成で使用可能です。</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>参照</h4>
<tt><a href="open.html">f_open</a>, <a href="read.html">f_read</a>, <a href="write.html">f_write</a>, <a href="sync.html">f_sync</a>, <a href="sfile.html">FIL</a>, <a href="sfatfs.html">FATFS</a></tt>
</div>
diff --git a/data/sysrom/fat/doc/ja/dinit.html b/data/sysrom/fat/doc/ja/dinit.html
index 6d74091..6386f2a 100644
--- a/data/sysrom/fat/doc/ja/dinit.html
+++ b/data/sysrom/fat/doc/ja/dinit.html
@@ -11,34 +11,34 @@
<body>
-<div class="para">
+<div class="para func">
<h2>disk_initialize</h2>
<p>ディスク・ドライブを初期化します。</p>
<pre>
DSTATUS disk_initialize (
- BYTE <em>Drive</em> <span>/* 物理ドライブ番号 */</span>
+ BYTE <span class="arg">pdrv</span> <span class="c">/* [IN] 物理ドライブ番号 */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>Drive</dt>
+<dt>pdrv</dt>
<dd>初期化する物理ドライブ番号(0-9)を指定します。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
<p>この関数は戻り値としてディスク・ステータスを返します。ディスク・ステータスの詳細に関しては<tt><a href="dstat.html">disk_status()</a></tt>を参照してください。</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
<p>ディスク・ドライブを初期化します。関数が成功すると、戻り値の<tt>STA_NOINIT</tt>フラグがクリアされます。</p>
-<p><em>アプリケーションからこの関数を呼び出すと、FATボリュームが破壊される可能性があります。エラー等により再初期化が必要なときは、<tt>f_mount()</tt>を使用します。</em>FatFsモジュールは、自動マウント動作により、必要に応じてこの関数を呼び出します。</p>
+<p><em>アプリケーションからはこの関数を呼び出してはなりません。さもないと、FATボリュームが破壊されます。エラー等により再初期化が必要なときは、<tt>f_mount()</tt>を使用してください。</em>FatFsモジュールは、自動マウント動作により、必要に応じてこの関数を呼び出します。</p>
</div>
<p class="foot"><a href="../00index_j.html">戻る</a></p>
diff --git a/data/sysrom/fat/doc/ja/dioctl.html b/data/sysrom/fat/doc/ja/dioctl.html
index 83f5d50..db6cadb 100644
--- a/data/sysrom/fat/doc/ja/dioctl.html
+++ b/data/sysrom/fat/doc/ja/dioctl.html
@@ -11,31 +11,31 @@
<body>
-<div class="para">
+<div class="para func">
<h2>disk_ioctl</h2>
<p>セクタの読み書き以外のディスク・ドライブ自体に対する様々な制御をします。</p>
<pre>
DRESULT disk_ioctl (
- BYTE <em>Drive</em>, <span>/* 物理ドライブ番号 */</span>
- BYTE <em>Command</em>, <span>/* 制御コマンド */</span>
- void* <em>Buffer</em> <span>/* データ受け渡しバッファ */</span>
+ BYTE <span class="arg">pdrv</span>, <span class="c">/* [IN] 物理ドライブ番号 */</span>
+ BYTE <span class="arg">cmd</span>, <span class="c">/* [IN] 制御コマンド */</span>
+ void* <span class="arg">buff</span> <span class="c">/* [I/O] データ受け渡しバッファ */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>Drive</dt>
+<dt>pdrv</dt>
<dd>物理ドライブ番号(0-9)を指定します。</dd>
-<dt>Command</dt>
+<dt>cmd</dt>
<dd>制御コマンド・コードを指定します。</dd>
-<dt>Buffer</dt>
+<dt>buff</dt>
<dd>制御コマンドに依存したパラメータを授受するバッファを指すポインタを指定します。データの授受のないコマンドの場合は、NULLを指定します。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
<dl class="ret">
<dt>RES_OK (0)</dt>
@@ -49,16 +49,16 @@ DRESULT disk_ioctl (
</dl>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
<p>物理ドライブの種類によりサポートされるコマンドは異なりますが、FatFsモジュールでは、次の汎用コマンドのみ使用し、特定のハードウェアに依存した制御は行いません。</p>
<table class="lst">
<tr><th>コマンド</th><th>解説</th></tr>
<tr><td>CTRL_SYNC</td><td>ドライブがデータの書き込み処理を完了するのを待ちます。また、ライト・バック・キャッシュが存在する場合は、書き込まれていないデータを即時書き戻します。リード・オンリー構成では使用されません。</td></tr>
-<tr><td>GET_SECTOR_SIZE</td><td><tt>Buffer</tt>の指すWORD変数にドライブのセクタ・サイズを返します。セクタ・サイズが固定(<tt>_MAX_SS</tt>が512)のときはこのコマンドは使われません。</td></tr>
-<tr><td>GET_SECTOR_COUNT</td><td><tt>Buffer</tt>の指すDWORD変数にドライブ上の総セクタ数を返します。f_mkfs関数内で作成するボリュームのサイズを決定するために使用されます。</td></tr>
-<tr><td>GET_BLOCK_SIZE</td><td>フラッシュ・メモリの消去ブロック・サイズを<tt>Buffer</tt>の指すDWORD変数にセクタ単位で返します。1から32768でかつ2の累乗の値でなければなりません。不明な場合またはフラッシュ・メモリ以外のメディアでは1を返します。f_mkfs関数内でのみ使用され、ボリュームのデータ領域はこの境界にアライメントされます。</td></tr>
-<tr><td>CTRL_ERASE_SECTOR</td><td>フラッシュ・メモリの一部の領域を消去します。<tt>Buffer</tt>の指すDWORD配列には消去する領域 {開始セクタ,終了セクタ} を指定して呼び出します。この機能をサポートしない場合やフラッシュ・メモリ以外のメディアでは何もしません。この機能の戻り値はチェックされず、また、指定領域の消去が完全に行われなかったとしてもファイル・システムの動作には影響ありません。<tt>_USE_ERASE</tt>が1のとき、クラスタが解放されるときに呼び出されます。</td></tr>
+<tr><td>GET_SECTOR_SIZE</td><td><tt class="arg">buff</tt>の指す<tt>WORD</tt>変数にドライブのセクタ・サイズを返します。セクタ・サイズが固定(<tt>_MAX_SS</tt>が512)のときはこのコマンドは使われません。</td></tr>
+<tr><td>GET_SECTOR_COUNT</td><td><tt class="arg">buff</tt>の指す<tt>DWORD</tt>変数にドライブ上の総セクタ数を返します。<tt>f_mkfs()</tt>内で作成するボリュームのサイズを決定するために使用されます。</td></tr>
+<tr><td>GET_BLOCK_SIZE</td><td>フラッシュ・メモリの消去ブロック・サイズを<tt class="arg">buff</tt>の指すDWORD変数にセクタ単位で返します。1から32768でかつ2の累乗の値でなければなりません。不明な場合またはフラッシュ・メモリ以外のメディアでは1を返します。<tt>f_mkfs()</tt>内でのみ使用され、ボリュームのデータ領域はこの境界にアライメントされます。</td></tr>
+<tr><td>CTRL_ERASE_SECTOR</td><td>フラッシュ・メモリの一部の領域を消去します。<tt class="arg">buff</tt>の指す<tt>DWORD</tt>配列には消去する領域 {開始セクタ,終了セクタ} を指定して呼び出します。これは、ATAコマンド・セットのTrimコマンドと等価で、<tt>_USE_ERASE</tt>が1のとき、クラスタが解放されるときに呼び出されます。この機能をサポートしない場合やフラッシュ・メモリ以外のメディアでは何もしません。この機能の戻り値はチェックされず、また、指定領域の消去が完全に行われなかったとしてもFatFsの動作には影響ありません。</td></tr>
</table>
</div>
diff --git a/data/sysrom/fat/doc/ja/dread.html b/data/sysrom/fat/doc/ja/dread.html
index 1843623..6a0860b 100644
--- a/data/sysrom/fat/doc/ja/dread.html
+++ b/data/sysrom/fat/doc/ja/dread.html
@@ -11,35 +11,35 @@
<body>
-<div class="para">
+<div class="para func">
<h2>disk_read</h2>
<p>ディスクからセクタを読み出します。</p>
<pre>
DRESULT disk_read (
- BYTE <em>Drive</em>, <span>/* 物理ドライブ番号 */</span>
- BYTE* <em>Buffer</em>, <span>/* 読み出しバッファへのポインタ */</span>
- DWORD <em>SectorNumber</em>, <span>/* 読み出し開始セクタ番号 */</span>
- BYTE <em>SectorCount</em> <span>/* 読み出しセクタ数 */</span>
+ BYTE <span class="arg">pdrv</span>, <span class="c">/* [IN] 物理ドライブ番号 */</span>
+ BYTE* <span class="arg">buff</span>, <span class="c">/* [OUT] 読み出しバッファへのポインタ */</span>
+ DWORD <span class="arg">sector</span>, <span class="c">/* [IN] 読み出し開始セクタ番号 */</span>
+ BYTE <span class="arg">count</span> <span class="c">/* [IN] 読み出しセクタ数 */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>Drive</dt>
+<dt>pdrv</dt>
<dd>物理ドライブ番号(0-9)を指定します。</dd>
-<dt>Buffer</dt>
-<dd>ディスクから読み出したデータを格納するバイト配列で、読み出されるバイト数分のサイズが必要です。FatFsの指定するアドレスはアライメントされているとは限りません。</dd>
-<dt>SectorNumber</dt>
+<dt>buff</dt>
+<dd>ディスクから読み出したデータを格納する<em>バイト配列</em>で、読み出されるバイト数分のサイズが必要です。指定されるアドレスはワード・アライメントされているとは限りません。</dd>
+<dt>sector</dt>
<dd>読み出しを開始するセクタ番号。LBAで指定します。</dd>
-<dt>SectorCount</dt>
-<dd>読み出すセクタ数。 1〜128の範囲で設定します</dd>
+<dt>count</dt>
+<dd>読み出すセクタ数。 1〜128の範囲で指定します。一般的に、複数セクタの転送要求はデバイスに対して可能な限りマルチ・セクタ転送しなければなりません。複数のシングル・セクタ転送に分解した場合、読み出し速度が低下します。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
<dl class="ret">
<dt>RES_OK (0)</dt>
diff --git a/data/sysrom/fat/doc/ja/dstat.html b/data/sysrom/fat/doc/ja/dstat.html
index bd3f323..79b1485 100644
--- a/data/sysrom/fat/doc/ja/dstat.html
+++ b/data/sysrom/fat/doc/ja/dstat.html
@@ -11,31 +11,31 @@
<body>
-<div class="para">
+<div class="para func">
<h2>disk_status</h2>
<p>ディスク・ドライブの状態を取得します。</p>
<pre>
DSTATUS disk_status (
- BYTE <em>Drive</em> <span>/* 物理ドライブ番号 */</span>
+ BYTE <span class="arg">pdrv</span> <span class="c">/* [IN] 物理ドライブ番号 */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>Drive</dt>
+<dt>pdrv</dt>
<dd>ステータスを取得する物理ドライブ番号を指定します。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
<p>物理ドライブの状態が次のフラグの組み合わせの値で返されます。</p>
<dl class="ret">
<dt>STA_NOINIT</dt>
-<dd>ドライブが初期化されていないことを示すフラグ。システム・リセットやメディアの取り外し等でセットされ、disk_initialize() の正常終了でクリア、失敗でセットされます。</dd>
+<dd>ドライブが初期化されていないことを示すフラグ。システム・リセットやメディアの取り外し等でセットされ、<tt>disk_initialize()</tt>の正常終了でクリア、失敗でセットされます。</dd>
<dt>STA_NODISK</dt>
<dd>メディアがセットされていないことを示すフラグ。メディアが取り外されている間はセットされ、メディアがセットされている間はクリアされます。固定ディスクでは常にクリアされています。</dd>
<dt>STA_PROTECTED</dt>
diff --git a/data/sysrom/fat/doc/ja/dwrite.html b/data/sysrom/fat/doc/ja/dwrite.html
index f2f129e..04a811e 100644
--- a/data/sysrom/fat/doc/ja/dwrite.html
+++ b/data/sysrom/fat/doc/ja/dwrite.html
@@ -11,35 +11,35 @@
<body>
-<div class="para">
+<div class="para func">
<h2>disk_write</h2>
<p>ディスクにデータを書き込みます。</p>
<pre>
DRESULT disk_write (
- BYTE <em>Drive</em>, /* 物理ドライブ番号 */
- const BYTE* <em>Buffer</em>, /* 書き込むデータへのポインタ */
- DWORD <em>SectorNumber</em>, /* 書き込み開始セクタ番号 */
- BYTE <em>SectorCount</em> /* 書き込みセクタ数 */
+ BYTE <span class="arg">pdrv</span>, <span class="c">/* [IN] 物理ドライブ番号 */</span>
+ const BYTE* <span class="arg">buff</span>, <span class="c">/* [IN] 書き込むデータへのポインタ */</span>
+ DWORD <span class="arg">sector</span>, <span class="c">/* [IN] 書き込み開始セクタ番号 */</span>
+ BYTE <span class="arg">count</span> <span class="c">/* [IN] 書き込みセクタ数 */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>Drive</dt>
+<dt>pdrv</dt>
<dd>物理ドライブ番号(0-9)を指定します。</dd>
-<dt>Buffer</dt>
-<dd>ディスクに書き込むバイト配列を指定します。FatFsの指定するアドレスはアライメントされているとは限りません。</dd>
-<dt>SectorNumber</dt>
+<dt>buff</dt>
+<dd>ディスクに書き込む<em>バイト配列</em>を指定します。指定されるアドレスはワード・アライメントされているとは限りません。</dd>
+<dt>sector</dt>
<dd>書き込みを開始するセクタ番号。LBAで指定します。</dd>
-<dt>SectorCount</dt>
-<dd>書き込むセクタ数。 1〜128で設定します。</dd>
+<dt>count</dt>
+<dd>書き込むセクタ数。 1〜128で指定します。一般的に、複数セクタの転送要求はデバイスに対して可能な限りマルチ・セクタ転送しなければなりません。複数のシングル・セクタ転送に分解した場合、書き込み速度は極端に低下します。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
<dl class="ret">
<dt>RES_OK (0)</dt>
@@ -56,7 +56,7 @@ DRESULT disk_write (
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
<p>リード・オンリー構成ではこの関数は必要とされません。</p>
</div>
diff --git a/data/sysrom/fat/doc/ja/eof.html b/data/sysrom/fat/doc/ja/eof.html
new file mode 100644
index 0000000..b1f0e1a
--- /dev/null
+++ b/data/sysrom/fat/doc/ja/eof.html
@@ -0,0 +1,62 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="ja">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="FatFs" href="../00index_j.html">
+<link rel="alternate" hreflang="en" title="English" href="../en/eof.html">
+<link rel="stylesheet" href="../css_j.css" type="text/css" media="screen" title="ELM Default">
+<title>FatFs - f_eof</title>
+</head>
+
+<body>
+
+<div class="para func">
+<h2>f_eof</h2>
+<p>リード/ライト・ポインタがファイル終端に達しているかどうか調べます。.</p>
+<pre>
+int f_eof (
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] ファイル・オブジェクト */</span>
+);
+</pre>
+</div>
+
+
+<div class="para arg">
+<h4>引数</h4>
+<dl class="par">
+<dt>fp</dt>
+<dd>ファイル・オブジェクト構造体へのポインタを指定します。</dd>
+</dl>
+</div>
+
+
+<div class="para ret">
+<h4>戻り値</h4>
+<p>リード/ライト・ポインタがファイル終端にあり読み出すデータがない場合は、0以外の値を返します。それ以外の時は0を返します。</p>
+</div>
+
+
+<div class="para desc">
+<h4>解説</h4>
+<p>f_eof関数は、現リビジョンではマクロとして実装されています。</p>
+<pre>
+<span class="k">#define</span> f_eof(fp) (((fp)->fptr) == ((fp)->fsize) ? 1 : 0)
+</pre>
+</div>
+
+
+<div class="para comp">
+<h4>対応情報</h4>
+<p>常に使用可能。</p>
+</div>
+
+
+<div class="para ref">
+<h4>参照</h4>
+<p><tt><a href="open.html">f_open</a>, <a href="lseek.html">f_lseek</a>, <a href="sfile.html">FIL</a></tt></p>
+</div>
+
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
+</body>
+</html>
diff --git a/data/sysrom/fat/doc/ja/error.html b/data/sysrom/fat/doc/ja/error.html
new file mode 100644
index 0000000..d7076c9
--- /dev/null
+++ b/data/sysrom/fat/doc/ja/error.html
@@ -0,0 +1,62 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="ja">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="FatFs" href="../00index_j.html">
+<link rel="alternate" hreflang="en" title="English" href="../en/error.html">
+<link rel="stylesheet" href="../css_j.css" type="text/css" media="screen" title="ELM Default">
+<title>FatFs - f_error</title>
+</head>
+
+<body>
+
+<div class="para func">
+<h2>f_error</h2>
+<p>エラー発生の有無を調べます。</p>
+<pre>
+int f_error (
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] ファイル・オブジェクト */</span>
+);
+</pre>
+</div>
+
+
+<div class="para arg">
+<h4>引数</h4>
+<dl class="par">
+<dt>fp</dt>
+<dd>ファイル・オブジェクト構造体へのポインタを指定します。</dd>
+</dl>
+</div>
+
+
+<div class="para ret">
+<h4>戻り値</h4>
+<p>ファイル操作中のエラーで処理が中断されている場合は、0以外の値を返します。それ以外の時は0を返します。</p>
+</div>
+
+
+<div class="para desc">
+<h4>解説</h4>
+<p>f_error関数は、現リビジョンではマクロとして実装されています。</p>
+<pre>
+<span class="k">#define</span> f_error(fp) (((fp)->flag & FA__ERROR) ? 1 : 0)
+</pre>
+</div>
+
+
+<div class="para comp">
+<h4>対応情報</h4>
+<p>常に使用可能。</p>
+</div>
+
+
+<div class="para ref">
+<h4>参照</h4>
+<p><tt><a href="open.html">f_open</a>, <a href="sfile.html">FIL</a></tt></p>
+</div>
+
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
+</body>
+</html>
diff --git a/data/sysrom/fat/doc/ja/fattime.html b/data/sysrom/fat/doc/ja/fattime.html
index f9a1f94..7c94165 100644
--- a/data/sysrom/fat/doc/ja/fattime.html
+++ b/data/sysrom/fat/doc/ja/fattime.html
@@ -11,7 +11,7 @@
<body>
-<div class="para">
+<div class="para func">
<h2>get_fattime</h2>
<p>現在時刻を取得します。</p>
<pre>
@@ -20,7 +20,7 @@ DWORD get_fattime (void);
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
<p>現在のローカル・タイムが<tt>DWORD</tt>値にパックされて返されます。ビット・フィールドは次に示すようになります。</p>
<dl>
@@ -40,7 +40,7 @@ DWORD get_fattime (void);
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
<p>RTCをサポートしないシステムでも、何らかの日付として有効な値を返さなければなりません。0を返した場合、そのファイルは日付を持ちません。リード・オンリー構成ではこの関数は必要とされません。</p>
</div>
diff --git a/data/sysrom/fat/doc/ja/fdisk.html b/data/sysrom/fat/doc/ja/fdisk.html
new file mode 100644
index 0000000..3c50241
--- /dev/null
+++ b/data/sysrom/fat/doc/ja/fdisk.html
@@ -0,0 +1,97 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="ja">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="FatFs" href="../00index_j.html">
+<link rel="alternate" hreflang="en" title="English" href="../en/fdisk.html">
+<link rel="stylesheet" href="../css_j.css" type="text/css" media="screen" title="ELM Default">
+<title>FatFs - f_fdisk</title>
+</head>
+
+<body>
+
+<div class="para func">
+<h2>f_fdisk</h2>
+<p>物理ドライブを分割します。</p>
+<pre>
+FRESULT f_fdisk (
+ BYTE <span class="arg">pdrv</span>, <span class="c">/* [IN] 物理ドライブ番号 */</span>
+ const DWORD <em>part[]</em>, <span class="c">/* [IN] 区画マップ・テーブル */</span>
+ void* <span class="arg">work</span> <span class="c">/* [-] ワークエリア */</span>
+);
+</pre>
+</div>
+
+<div class="para arg">
+<h4>引数</h4>
+<dl class="par">
+<dt>pdrv</dt>
+<dd>分割する<em>物理ドライブ</em>を指定します。</dd>
+<dt>part[]</dt>
+<dd>区画マップ・テーブルへのポインタを指定します。</dd>
+<dt>work</dt>
+<dd>ワークエリアへのポインタを指定します。サイズは<tt>_MAX_SS</tt>バイト必要です。</dd>
+</dl>
+</div>
+
+<div class="para ret">
+<h4>戻り値</h4>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
+<a href="rc.html#ip">FR_INVALID_PARAMETER</a>
+</p>
+</div>
+
+<div class="para desc">
+<h4>説明</h4>
+<p>この関数は、指定された物理ドライブのMBRに区画テーブルを作成します。区画分けは一般的なFDISK形式で行うため、最大4つの基本区画を作成することができます。拡張区画には対応していません。区画マップテーブル<tt class="arg">part[]</tt>にはドライブをどのように分割するか指定して渡します。この配列は4つの項目から成り、先頭の項目が1番目の、最後の項目が4番目の区画のサイズを示します。値が100以下の場合、ドライブの総容量に対する割合をパーセント単位で指定します。100を超える値の場合はセクタ数の直接指定になります。</p>
+</div>
+
+<div class="para comp">
+<h4>対応情報</h4>
+<p><tt>_FS_READOLNY == 0</tt> で <tt>_USE_MKFS == 1</tt> で <tt>_MULTI_PARTITION == 1</tt> のとき使用可能です。</p>
+</div>
+
+<div class="para use">
+<h4>使用例</h4>
+<pre>
+ <span class="c">/* ユーザ定義のボリューム管理テーブル (_MULTI_PARTITION == 1 のとき必要) */</span>
+
+ PARTITION VolToPart[] = {
+ {0, 1}, <span class="c">/* 論理ドライブ 0 ==> 物理ドライブ 0, 第1区画 */</span>
+ {0, 2}, <span class="c">/* 論理ドライブ 1 ==> 物理ドライブ 0, 第2区画 */</span>
+ {1, 0} <span class="c">/* 論理ドライブ 2 ==> 物理ドライブ 1, 自動検出 */</span>
+ };
+</pre>
+<pre>
+ <span class="c">/* 新しい物理ドライブ(0)の初期化 */</span>
+
+ FATFS Fatfs;
+ DWORD plist[] = {50, 50, 0, 0}; <span class="c">/* 2分割 */</span>
+ BYTE work[_MAX_SS];
+
+ f_fdisk(0, plist, work); <span class="c">/* 物理ドライブ 0 の分割 */</span>
+
+ f_mount(0, &amp;Fatfs);
+ f_mkfs(0, 0, 0); <span class="c">/* 論理ドライブ 0 の初期化. 第二引数は無視される. */</span>
+ f_mount(0, 0);
+
+ f_mount(1, &amp;Fatfs);
+ f_mkfs(1, 0, 0);
+ f_mount(1, 0);
+
+</pre>
+</div>
+
+<div class="para ref">
+<h4>See Also</h4>
+<p><tt><a href="filename.html#vol">Volume management</a>, <a href="mkfs.html">f_mkfs</a></tt></p>
+</div>
+
+<p class="foot"><a href="../00index_j.html">Return</a></p>
+</body>
+</html>
diff --git a/data/sysrom/fat/doc/ja/filename.html b/data/sysrom/fat/doc/ja/filename.html
index 7faa08e..ac5f3d1 100644
--- a/data/sysrom/fat/doc/ja/filename.html
+++ b/data/sysrom/fat/doc/ja/filename.html
@@ -6,20 +6,21 @@
<link rel="up" title="FatFs" href="../00index_j.html">
<link rel="alternate" hreflang="en" title="English" href="../en/filename.html">
<link rel="stylesheet" href="../css_j.css" type="text/css" media="screen" title="ELM Default">
-<title>FatFs - 繝輔ぃ繧、繝ォ繝サ繝繧」繝ャ繧ッ繝医Μ縺ョ謖螳壽婿豕</title>
+<title>FatFs - 繝代せ蜷阪ョ繝輔か繝シ繝槭ャ繝</title>
</head>
<body>
-<div class="para">
-<h3>繝輔ぃ繧、繝ォ繝サ繝繧」繝ャ繧ッ繝医Μ縺ョ謖螳壽婿豕</h3>
-<p>FatFs繝「繧ク繝・繝シ繝ォ縺ァ縺ョ繝輔ぃ繧、繝ォ縲√ョ繧」繝ャ繧ッ繝医Μ縲√ラ繝ゥ繧、繝悶ョ謖螳壽婿豕輔ッDOS/Windows縺ィ縺サ縺シ蜷後§縺ァ縺吶ゅヱ繧ケ蜷阪ョ繝輔か繝シ繝槭ャ繝医ッ谺。縺ョ騾壹j縺ァ縺吶</p>
-<p><tt>"[隲也炊繝峨Λ繧、繝也分蜿キ:][/]繝繧」繝ャ繧ッ繝医Μ蜷/繝輔ぃ繧、繝ォ蜷"</tt></p>
-<p>FatFs繝「繧ク繝・繝シ繝ォ縺ッ髟キ縺繝輔ぃ繧、繝ォ蜷(LFN)縺翫h縺ウ8.3蠖「蠑上ヵ繧。繧、繝ォ蜷(SFN)縺ォ蟇セ蠢懊@縺ヲ縺縺セ縺吶LFN縺ッ縲<tt>(_USE_LFN &gt; 0)</tt>縺ョ縺ィ縺堺スソ逕ィ蜿ッ閭ス縺ォ縺ェ繧翫∪縺吶DOS/Windows縺ィ縺ョ驕輔>縺ッ縲√ョ繧」繝ャ繧ッ繝医Μ繝サ繧サ繝代Ξ繝シ繧ソ縺ィ隲也炊繝峨Λ繧、繝也分蜿キ縺ョ謖螳壹〒縺吶ゅョ繧」繝ャ繧ッ繝医Μ繝サ繧サ繝代Ξ繝シ繧ソ縺ォ縺ッ / 縺セ縺溘ッ \ 繧剃スソ逕ィ縺励∪縺吶りォ也炊繝峨Λ繧、繝也分蜿キ縺ッ縲'0'ス'9'縺ョ荳譁蟄励ョ謨ー蟄励→繧ウ繝ュ繝ウ縺ァ謖螳壹@縲∫怐逡・縺励◆蝣エ蜷医ッ繝繝輔か繝ォ繝医サ繝峨Λ繧、繝(0縺セ縺溘ッ繧ォ繝ャ繝ウ繝医サ繝峨Λ繧、繝)縺碁∈謚槭&繧後∪縺吶</p>
-<p>Nul譁蟄励→蛻カ蠕。譁蟄(\0ス杤x1F)縺ッ縲√ヱ繧ケ蜷阪ョ邨らォッ縺ィ縺励※隱崎ュ倥&繧後∪縺吶ゅヱ繧ケ蜷阪↓蜈郁。後≠繧九>縺ッ荳ュ縺ォ蜷ォ縺セ繧後k繧ケ繝壹シ繧ケ縺ッ縲´FN讒区舌〒縺ッ蜷榊燕縺ョ荳驛ィ縺ィ縺励※譛牙柑縺ァ縺吶′縲髱朖FN讒区舌〒縺ッ繝代せ蜷阪ョ邨らォッ縺ィ縺励※隱崎ュ倥&繧後∪縺吶</p>
-<p>讓呎コ匁ァ区<tt>(_FS_RPATH == 0)</tt>縺ョ縺ィ縺阪ッ縲∝ィ縺ヲ縺ョ繧ェ繝悶ず繧ァ繧ッ繝医′繝ォ繝シ繝医サ繝繧」繝ャ繧ッ繝医Μ縺九i霎ソ繧狗オカ蟇セ繝代せ縺ァ謖螳壹&繧後∪縺吶0S謖蜷代↑繧ォ繝ャ繝ウ繝医サ繝繧」繝ャ繧ッ繝医Μ縺ィ縺縺讎ょソオ縺ッ辟。縺上√∪縺溘ラ繝繝医サ繝繧」繝ャ繧ッ繝医Μ(&quot;.&quot;繧&quot;..&quot;)縺ッ菴ソ逕ィ縺ァ縺阪∪縺帙s縲ゅヱ繧ケ蜷榊磯ュ縺ョ繧サ繝代Ξ繝シ繧ソ縺ッ辟。隕悶&繧後∪縺吶ゅョ繝輔か繝ォ繝医サ繝峨Λ繧、繝也分蜿キ縺ッ蟶ク縺ォ0縺ォ縺ェ繧翫∪縺吶</p>
-<p>逶ク蟇セ繝代せ繧呈怏蜉ケ<tt>(_FS_RPATH == 1)</tt>縺ォ縺励◆縺ィ縺阪ッ縲∝郁。後☆繧九そ繝代Ξ繝シ繧ソ縺ョ譛臥┌縺ォ繧医▲縺ヲ讀懃エ「髢句ァ九ョ繧」繝ャ繧ッ繝医Μ縺悟、峨o繧翫√そ繝代Ξ繝シ繧ソ縺後≠繧句エ蜷医ッ繝ォ繝シ繝医サ繝繧」繝ャ繧ッ繝医Μ縺九i縲∫┌縺蝣エ蜷医ッ<a href="chdir.html">f_chdir髢「謨ー</a>縺ァ險ュ螳壹&繧後k繧ォ繝ャ繝ウ繝医サ繝繧」繝ャ繧ッ繝医Μ縺九i縺ォ縺ェ繧翫∪縺吶ゅ∪縺溘ヱ繧ケ蜷阪↓繝峨ャ繝医サ繝繧」繝ャ繧ッ繝医Μ縺御スソ逕ィ縺ァ縺阪∪縺吶ゅョ繝輔か繝ォ繝医サ繝峨Λ繧、繝也分蜿キ縺ッ<a href="chdrive.html">f_chdrive髢「謨ー</a>縺ァ險ュ螳壹&繧後◆蛟、縺ィ縺ェ繧翫∪縺吶</p>
+<h1>繝代せ蜷阪ョ繝輔か繝シ繝槭ャ繝</h1>
+<div class="para" id="nam">
+<h3>繝輔ぃ繧、繝ォ繝サ繝繧」繝ャ繧ッ繝医Μ蜷</h3>
+<p>FatFs繝「繧ク繝・繝シ繝ォ縺ァ縺ョ繝輔ぃ繧、繝ォ縲√ョ繧」繝ャ繧ッ繝医Μ縲√ラ繝ゥ繧、繝悶ョ謖螳壽婿豕輔ッDOS/Windows API縺ィ縺サ縺シ蜷後§縺ァ縺吶ゅヱ繧ケ蜷阪ョ繝輔か繝シ繝槭ャ繝医ッ谺。縺ョ騾壹j縺ァ縺吶</p>
+<pre>"[隲也炊繝峨Λ繧、繝也分蜿キ:][/]繝繧」繝ャ繧ッ繝医Μ蜷/繝輔ぃ繧、繝ォ蜷"</pre>
+<p>FatFs繝「繧ク繝・繝シ繝ォ縺ッ髟キ縺繝輔ぃ繧、繝ォ蜷(LFN)縺翫h縺ウ8.3蠖「蠑上ヵ繧。繧、繝ォ蜷(SFN)縺ォ蟇セ蠢懊@縺ヲ縺縺セ縺吶LFN縺ッ縲(<tt>_USE_LFN &gt; 0</tt>)縺ョ縺ィ縺堺スソ逕ィ蜿ッ閭ス縺ォ縺ェ繧翫∪縺吶ゅョ繧」繝ャ繧ッ繝医Μ繝サ繧サ繝代Ξ繝シ繧ソ縺ォ縺ッDOS/Windows API縺ィ蜷後§縺<tt>'/'</tt>縺ィ<tt>'\'</tt>繧剃スソ逕ィ縺励∪縺吶る」邯壹@縺溘そ繝代Ξ繝シ繧ソ縺ッ辟。隕悶&繧1蛟九→縺励※謇ア繧上l縺セ縺吶ょ髪荳縺ョ驕輔>縺ッ縲∬ォ也炊繝峨Λ繧、繝悶ョ謖螳壹□縺代〒縺吶りォ也炊繝峨Λ繧、繝也分蜿キ縺ッ縲<tt>'0'</tt>ス<tt>'9'</tt>縺ョ荳譁蟄励ョ謨ー蟄励→繧ウ繝ュ繝ウ縺ァ謖螳壹@縲∫怐逡・縺励◆蝣エ蜷医ッ<em>繝繝輔か繝ォ繝医サ繝峨Λ繧、繝</em>(0縺セ縺溘ッ繧ォ繝ャ繝ウ繝医サ繝峨Λ繧、繝)縺碁∈謚槭&繧後∪縺吶</p>
+<p>繝後Ν譁蟄励→蛻カ蠕。譁蟄(<tt>'\0'</tt>ス<tt>'\x1F'</tt>)縺ッ縲√ヱ繧ケ蜷阪ョ邨らォッ縺ィ縺励※隱崎ュ倥&繧後∪縺吶ゅヱ繧ケ蜷阪↓蜈郁。後≠繧九>縺ッ荳ュ縺ォ蜷ォ縺セ繧後k繧ケ繝壹シ繧ケ縺ッ縲´FN讒区舌〒縺ッ蜷榊燕縺ョ荳驛ィ縺ィ縺励※譛牙柑縺ァ縺吶′縲髱朖FN讒区舌〒縺ッ繧ケ繝壹シ繧ケ縺ッ繝代せ蜷阪ョ邨らォッ縺ィ縺励※隱崎ュ倥&繧後∪縺吶</p>
+<p>讓呎コ匁ァ区(<tt>_FS_RPATH == 0</tt>)縺ョ縺ィ縺阪ッ縲∝ィ縺ヲ縺ョ繧ェ繝悶ず繧ァ繧ッ繝医′繝ォ繝シ繝医サ繝繧」繝ャ繧ッ繝医Μ縺九i霎ソ繧狗オカ蟇セ繝代せ縺ァ謖螳壹&繧後∪縺吶0S謖蜷代↑繧ォ繝ャ繝ウ繝医サ繝繧」繝ャ繧ッ繝医Μ縺ィ縺縺讎ょソオ縺ッ辟。縺上√∪縺溘ラ繝繝医サ繝繧」繝ャ繧ッ繝医Μ(&quot;.&quot;繧&quot;..&quot;)縺ッ菴ソ逕ィ縺ァ縺阪∪縺帙s縲ゅヱ繧ケ蜷榊磯ュ縺ョ繧サ繝代Ξ繝シ繧ソ縺ッ辟。隕悶&繧後∪縺吶ゅョ繝輔か繝ォ繝医サ繝峨Λ繧、繝也分蜿キ縺ッ蟶ク縺ォ0縺ォ縺ェ繧翫∪縺吶</p>
+<p>逶ク蟇セ繝代せ繧呈怏蜉ケ(<tt>_FS_RPATH == 1</tt>)縺ォ縺励◆縺ィ縺阪ッ縲∝郁。後☆繧九そ繝代Ξ繝シ繧ソ縺ョ譛臥┌縺ォ繧医▲縺ヲ讀懃エ「髢句ァ九ョ繧」繝ャ繧ッ繝医Μ縺悟、峨o繧翫√そ繝代Ξ繝シ繧ソ縺後≠繧句エ蜷医ッ繝ォ繝シ繝医サ繝繧」繝ャ繧ッ繝医Μ縺九i縲∫┌縺蝣エ蜷医ッ<a href="chdir.html">f_chdir髢「謨ー</a>縺ァ險ュ螳壹&繧後k繧ォ繝ャ繝ウ繝医サ繝繧」繝ャ繧ッ繝医Μ縺九i縺ォ縺ェ繧翫∪縺吶ゅ∪縺溘ヱ繧ケ蜷阪↓繝峨ャ繝医サ繝繧」繝ャ繧ッ繝医Μ縺御スソ逕ィ縺ァ縺阪∪縺吶ゅョ繝輔か繝ォ繝医サ繝峨Λ繧、繝也分蜿キ縺ッ<a href="chdrive.html">f_chdrive髢「謨ー</a>縺ァ險ュ螳壹&繧後◆蛟、縺ィ縺ェ繧翫∪縺吶</p>
<table class="lst2">
-<tr><td>繝代せ蜷</td><td>_FS_RPATH == 0</td><td>_FS_RPATH == 1</td></tr>
+<tr><td>繝代せ蜷阪ョ萓</td><td>_FS_RPATH == 0</td><td>_FS_RPATH == 1</td></tr>
<tr class="lst3"><td>file.txt</td><td>繝峨Λ繧、繝0縺ョ繝ォ繝シ繝医サ繝繧」繝ャ繧ッ繝医Μ荳九ョ繝輔ぃ繧、繝ォ</td><td>繧ォ繝ャ繝ウ繝医サ繝峨Λ繧、繝悶ョ繧ォ繝ャ繝ウ繝医サ繝繧」繝ャ繧ッ繝医Μ荳九ョ繝輔ぃ繧、繝ォ</td></tr>
<tr><td>/file.txt</td><td>繝峨Λ繧、繝0縺ョ繝ォ繝シ繝医サ繝繧」繝ャ繧ッ繝医Μ荳九ョ繝輔ぃ繧、繝ォ</td><td>繧ォ繝ャ繝ウ繝医サ繝峨Λ繧、繝悶ョ繝ォ繝シ繝医サ繝繧」繝ャ繧ッ繝医Μ荳九ョ繝輔ぃ繧、繝ォ</td></tr>
<tr><td></td><td>繝峨Λ繧、繝0縺ョ繝ォ繝シ繝医サ繝繧」繝ャ繧ッ繝医Μ</td><td>繧ォ繝ャ繝ウ繝医サ繝峨Λ繧、繝悶ョ繧ォ繝ャ繝ウ繝医サ繝繧」繝ャ繧ッ繝医Μ</td></tr>
@@ -35,36 +36,35 @@
</div>
<p><br></p>
-<div class="para">
+<div class="para" id="uni">
<h3>Unicode API</h3>
-<p>繝輔ぃ繧、繝ォ髢「謨ー縺ョ蜈・蜃コ蜉帙ョ縺縺。繝輔ぃ繧、繝ォ蜷阪d繝代せ蜷阪r謖螳壹☆繧句シ墓焚縺ョ蝙九ッ縲<tt>TCHAR</tt>縺ァ螳夂セゥ縺輔l縺ヲ縺縺セ縺吶′縲√%繧後ッ<tt>char</tt>縺ョ繧ィ繝ェ繧「繧ケ縺ォ縺ェ縺」縺ヲ縺縺セ縺吶ゅ◎縺励※縲<tt>_CODE_PAGE</tt>縺ァ謖螳壹&繧後k ANSI/OEM繧ウ繝シ繝(SBCS縺セ縺溘ッDBCS)縺ョ譁蟄怜励→縺励※謇ア繧上l縺セ縺吶ゅヵ繧。繧、繝ォ蜷榊・蜃コ蜉帙rUnicode縺ィ縺吶k讒区(LFN讒区舌〒縲√°縺、<tt>_LFN_UNICODE</tt>繧 1)縺ォ縺励◆縺ィ縺阪ッ縲<tt>TCHAR</tt>縺ッ繝ッ繧、繝画枚蟄(<tt>unsigned short</tt>)縺ォ蛻繧頑崛繧上j縲√ヱ繧ケ蜷阪↓Unicode繧剃スソ逕ィ縺吶k繧医≧縺ォ縺ェ繧翫∪縺吶ゅ%繧後↓繧医j LFN繝輔Ν蟇セ蠢懊→縺ェ繧翫、NSI/OEM繧ウ繝シ繝峨↓縺ェ縺譁蟄(縺溘→縺医ー 笨昶亂笨。笘ク笘ュ縺ェ縺ゥ)繧ゆスソ逕ィ縺ァ縺阪∪縺吶ゅ%縺ョ險ュ螳壹ッ譁蟄怜怜・蜃コ蜉幃未謨ー縺ョ繝繝シ繧ソ蝙九→繧ィ繝ウ繧ウ繝シ繝繧」繝ウ繧ー縺ォ繧ょスア髻ソ繧剃ク弱∴縺セ縺吶ゅΜ繝繝ゥ繝ォ譁蟄怜励r螳夂セゥ縺吶k縺ィ縺阪∵ャ。縺ォ遉コ縺吶h縺縺ォ<tt>_T(s)</tt>縺翫h縺ウ<tt>_TEXT(s)</tt>繝槭け繝ュ繧剃スソ縺」縺ヲANSI/OEM縺ィUnicode繧定ェ蜍募繧頑崛縺医☆繧九%縺ィ縺後〒縺阪∪縺吶</p>
+<p>繝輔ぃ繧、繝ォ髢「謨ー縺ョ蜈・蜃コ蜉帙ョ縺縺。繝輔ぃ繧、繝ォ蜷阪d繝代せ蜷阪r謖螳壹☆繧句シ墓焚縺ョ蝙九ッ縲<tt>TCHAR</tt>縺ァ螳夂セゥ縺輔l縺ヲ縺縺セ縺吶′縲√%繧後ッ騾壼クク縺ッ<tt>char</tt>縺ョ繧ィ繝ェ繧「繧ケ縺ォ縺ェ縺」縺ヲ縺縺セ縺吶ゅ◎縺励※縲<tt>_CODE_PAGE</tt>縺ァ謖螳壹&繧後kANSI/OEM繧ウ繝シ繝(SBCS縺セ縺溘ッDBCS)縺ョ譁蟄怜励→縺励※謇ア繧上l縺セ縺吶ゅヵ繧。繧、繝ォ蜷榊・蜃コ蜉帙rUnicode縺ィ縺吶k讒区(<tt>_LFN_UNICODE == 1</tt>)縺ォ縺励◆縺ィ縺阪ッ縲<tt>TCHAR</tt>縺ッ繝ッ繧、繝画枚蟄(<tt>WCHAR, unsigned short</tt>)縺ォ蛻繧頑崛繧上j縲√ヱ繧ケ蜷阪ョ蜈・蜃コ蜉帙↓Unicode繧剃スソ逕ィ縺吶k繧医≧縺ォ縺ェ繧翫∪縺吶ゅ%繧後↓繧医jLFN隕乗シ縺ォ螳悟ィ蟇セ蠢懊→縺ェ繧翫、NSI/OEM繧ウ繝シ繝峨↓縺ェ縺譁蟄(縺溘→縺医ー 笨昶亂笨。笘ク笘ュ縺ェ縺ゥ)繧ゆスソ逕ィ縺ァ縺阪∪縺吶ゅ%縺ョ險ュ螳壹ッ譁蟄怜怜・蜃コ蜉幃未謨ー縺ョ繝繝シ繧ソ蝙九→繧ィ繝ウ繧ウ繝シ繝繧」繝ウ繧ー縺ォ繧ょスア髻ソ繧剃ク弱∴縺セ縺吶ゅΜ繝繝ゥ繝ォ譁蟄怜励r螳夂セゥ縺吶k縺ィ縺阪∵ャ。縺ォ遉コ縺吶h縺縺ォ<tt>_T(s)</tt>縺翫h縺ウ<tt>_TEXT(s)</tt>繝槭け繝ュ繧剃スソ縺」縺ヲANSI/OEM縺ィUnicode繧定ェ蜍募繧頑崛縺医☆繧九%縺ィ縺後〒縺阪∪縺吶</p>
<pre>
- f_open(fp, "filename.txt", FA_READ); <span>/* ANSI/OEM蟆ら畑繧ウ繝シ繝 */</span>
- f_open(fp, L"filename.txt", FA_READ); <span>/* Unicode蟆ら畑繧ウ繝シ繝 */</span>
- f_open(fp, _T("filename.txt"), FA_READ); <span>/* 荳。逕ィ繧ウ繝シ繝 */</span>
+ f_open(fp, "filename.txt", FA_READ); <span class="c">/* ANSI/OEM蟆ら畑繧ウ繝シ繝 */</span>
+ f_open(fp, L"filename.txt", FA_READ); <span class="c">/* Unicode蟆ら畑繧ウ繝シ繝 */</span>
+ f_open(fp, _T("filename.txt"), FA_READ); <span class="c">/* 荳。逕ィ繧ウ繝シ繝(閾ェ蜍募繧頑崛縺) */</span>
</pre>
</div>
<p><br></p>
-<div class="para">
+<div class="para" id="vol">
<h3>隲也炊繝峨Λ繧、繝(繝懊Μ繝・繝シ繝)縺ィ迚ゥ逅繝峨Λ繧、繝(繝繧」繧ケ繧ッ陬鄂ョ)縺ョ蟇セ蠢</h3>
-<p>繝繝輔か繝ォ繝医ョ讒区舌〒縺ッ縲√◎繧後◇繧後ョ隲也炊繝峨Λ繧、繝悶ッ蜷後§逡ェ蜿キ縺ョ迚ゥ逅繝峨Λ繧、繝悶↓1:1縺ァ邨舌ウ縺、縺代i繧後※縺縺ヲ縲∫黄逅繝峨Λ繧、繝悶ョ蜈磯ュ縺ョ蛹コ逕サ縺ォ縺ゅk繝懊Μ繝・繝シ繝縺後槭え繝ウ繝医&繧後∪縺吶<tt>_MULTI_PARTITION</tt>縺ォ 1繧呈欠螳壹☆繧九→縲∝九縺ョ隲也炊繝峨Λ繧、繝悶↓蟇セ縺励※蛟句挨縺ォ迚ゥ逅繝峨Λ繧、繝也分蜿キ繝サ蛹コ逕サ繧呈欠螳壹〒縺阪k繧医≧縺ォ縺ェ繧翫∪縺吶ゅ%縺ョ讒区舌〒縺ッ縲∬ォ也炊繝峨Λ繧、繝悶→蛹コ逕サ縺ョ蟇セ蠢懊r隗」豎コ縺吶k縺溘a縺ョ繝繝シ繝悶Ν繧呈ャ。縺ォ遉コ縺吶h縺縺ォ螳夂セゥ縺吶k蠢隕√′縺ゅj縺セ縺吶</p>
+<p>繝繝輔か繝ォ繝医ョ讒区舌〒縺ッ縲√◎繧後◇繧後ョ隲也炊繝峨Λ繧、繝悶ッ蜷後§逡ェ蜿キ縺ョ迚ゥ逅繝峨Λ繧、繝悶↓1:1縺ァ邨舌ウ縺、縺代i繧後※縺縺ヲ縲ヾFD縺ィ縺励※縺セ縺溘ッ隨ャ1蛹コ逕サ縺ョ繝懊Μ繝・繝シ繝縺後槭え繝ウ繝医&繧後∪縺吶<tt>_MULTI_PARTITION</tt>縺ォ 1莉・荳翫r謖螳壹☆繧九→縲∝九縺ョ隲也炊繝峨Λ繧、繝悶↓蟇セ縺励※蛟句挨縺ォ迚ゥ逅繝峨Λ繧、繝也分蜿キ繝サ蛹コ逕サ繧呈欠螳壹〒縺阪k繧医≧縺ォ縺ェ繧翫∪縺吶ゅ%縺ョ讒区舌〒縺ッ縲∬ォ也炊繝峨Λ繧、繝悶→蛹コ逕サ縺ョ蟇セ蠢懊r隗」豎コ縺吶k縺溘a縺ョ繝繝シ繝悶Ν繧呈ャ。縺ォ遉コ縺吶h縺縺ォ螳夂セゥ縺吶k蠢隕√′縺ゅj縺セ縺吶</p>
<pre>
萓:隲也炊繝峨Λ繧、繝0ス2繧堤黄逅繝峨Λ繧、繝0(蝗コ螳壹ョ繧」繧ケ繧ッ)縺ョ3縺、縺ョ蝓コ譛ャ蛹コ逕サ縺ォ蜑イ繧雁ス薙※縲
隲也炊繝峨Λ繧、繝3繧堤黄逅繝峨Λ繧、繝1(繝ェ繝繝シ繝舌ヶ繝ォ繝サ繝繧」繧ケ繧ッ)縺ォ蜑イ繧雁ス薙※繧句エ蜷医
-const PARTITION Drives[] = {
- {0, 0}, <span>/* Logical drive 0 ==> Physical drive 0, 1st partition */</span>
- {0, 1}, <span>/* Logical drive 1 ==> Physical drive 0, 2nd partition */</span>
- {0, 2}, <span>/* Logical drive 2 ==> Physical drive 0, 3rd partition */</span>
- {1, 0} <span>/* Logical drive 3 ==> Physical drive 1 */</span>
+PARTITION VolToPart[] = {
+ {0, 1}, <span class="c">/* 隲也炊繝峨Λ繧、繝 0 ==> 迚ゥ逅繝峨Λ繧、繝 0, 隨ャ1蛹コ逕サ */</span>
+ {0, 2}, <span class="c">/* 隲也炊繝峨Λ繧、繝 1 ==> 迚ゥ逅繝峨Λ繧、繝 0, 隨ャ2蛹コ逕サ */</span>
+ {0, 3}, <span class="c">/* 隲也炊繝峨Λ繧、繝 2 ==> 迚ゥ逅繝峨Λ繧、繝 0, 隨ャ3蛹コ逕サ */</span>
+ {1, 0} <span class="c">/* 隲也炊繝峨Λ繧、繝 3 ==> 迚ゥ逅繝峨Λ繧、繝 1, 閾ェ蜍墓、懷コ */</span>
};
</pre>
<p>隍謨ー蛹コ逕サ謖螳壹r菴ソ逕ィ縺吶k蝣エ蜷医∵ャ。縺ョ轤ケ縺ォ豕ィ諢上@縺ェ縺代l縺ー縺ェ繧翫∪縺帙s縲
<ul>
-<li>謖螳壼庄閭ス縺ェ蛹コ逕サ縺ッ蝓コ譛ャ蛹コ逕サ(0ス3)縺ョ縺ソ縲</li>
-<li>迚ゥ逅繝峨Λ繧、繝悶′SFD蠖「蠑(蛹コ逕サ繝繝シ繝悶Ν辟。縺)縺ョ蝣エ蜷医∝玄逕サ謖螳壹ッ辟。隕悶&繧後k縲</li>
-<li>隍謨ー縺ョ隲也炊繝峨Λ繧、繝悶r謖√▽迚ゥ逅繝峨Λ繧、繝悶ッ縲∝崋螳壹ョ繧」繧ケ繧ッ縺ァ縺ェ縺代l縺ー縺ェ繧峨↑縺縲</li>
+<li>繝槭え繝ウ繝亥庄閭ス縺ェ蛹コ逕サ縺ッ蝓コ譛ャ蛹コ逕サ縺ョ縺ソ縺ァ縲∵僑蠑オ蛹コ逕サ蜀縺ォ縺ッ蟇セ蠢懊@縺ェ縺縲</li>
+<li>隍謨ー縺ョ蛹コ逕サ繧呈戟縺、迚ゥ逅繝峨Λ繧、繝悶ッ縲髱槭Μ繝繝シ繝舌ヶ繝ォ縺ァ縺ェ縺代l縺ー縺ェ繧峨↑縺縲</li>
</ul>
</div>
diff --git a/data/sysrom/fat/doc/ja/forward.html b/data/sysrom/fat/doc/ja/forward.html
index 95a4177..ffb2e60 100644
--- a/data/sysrom/fat/doc/ja/forward.html
+++ b/data/sysrom/fat/doc/ja/forward.html
@@ -11,88 +11,83 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_forward</h2>
<p>ファイルからデータを読み出し、送信ストリームに直接転送します。</p>
<pre>
FRESULT f_forward (
- FIL* <em>FileObject</em>, <span>/* ファイル・オブジェクト構造体 */</span>
- UINT (*<em>Func</em>)(const BYTE*,UINT), <span>/* データ転送関数 */</span>
- UINT <em>ByteToFwd</em>, <span>/* 転送するバイト数 */</span>
- UINT* <em>ByteFwd</em> <span>/* 転送されたバイト数 */</span>
+ FIL* <span class="arg">fp</span>, <span class="c">/* [IN] ファイル・オブジェクト構造体 */</span>
+ UINT (*<span class="arg">func</span>)(const BYTE*,UINT), <span class="c">/* [IN] データ転送関数 */</span>
+ UINT <span class="arg">btf</span>, <span class="c">/* [IN] 転送するバイト数 */</span>
+ UINT* <span class="arg">bf</span> <span class="c">/* [OUT] 転送されたバイト数 */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>ファイル・オブジェクト構造体へのポインタを指定します。</dd>
-<dt>Func</dt>
+<dt>func</dt>
<dd>データを渡すユーザ定義関数へのポインタを指定します。この関数の仕様はサンプルを参照してください。</dd>
-<dt>ByteToRead</dt>
+<dt>btf</dt>
<dd>転送するバイト数(0〜UINTの最大値)を指定します。</dd>
-<dt>ByteRead</dt>
+<dt>bf</dt>
<dd>実際に転送されたバイト数を格納する変数を指すポインタを指定します。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>正常終了。</dd>
-<dt>FR_DENIED</dt>
-<dd>非読み込みモードで開いたファイルから読み込もうとした。</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>ディスク・エラーによる失敗。</dd>
-<dt>FR_INT_ERR</dt>
-<dd>不正なFAT構造または内部エラーによる失敗。</dd>
-<dt>FR_NOT_READY</dt>
-<dd>メディアがセットされていないなど、物理ドライブが動作不能状態。</dd>
-<dt>FR_INVALID_OBJECT</dt>
-<dd>無効なファイル・オブジェクト。</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#de">FR_DENIED</a>,
+<a href="rc.html#io">FR_INVALID_OBJECT</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
-<p>ファイルのデータをバッファに読み出さずに送信ストリームに直接転送します。アプリケーション側でデータ・バッファを必要としないので、メモリの限られた環境で有効です。リード/ライト・ポインタは転送されたバイト数だけ進みます。指定されたバイト数の転送中にファイルの終端に達した場合や送信ストリームがビジーになった場合、<tt>*ByteFwd</tt>は<tt>ByteToFwd</tt>よりも小さくなります。</p>
+<p>ファイルのデータをバッファに読み出さずに送信ストリームに直接転送します。アプリケーション側でデータ・バッファを必要としないので、メモリの限られた環境で有効です。リード/ライト・ポインタは転送されたバイト数だけ進みます。指定されたバイト数の転送中にファイルの終端に達した場合や送信ストリームがビジーになった場合、<tt class="arg">*bf</tt>は<tt class="arg">btf</tt>よりも小さくなります。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p><tt>_USE_FORWARD == 1</tt>で、且つ<tt>_FS_TINY == 1</tt>のときに使用可能です。</p>
</div>
-<div class="para">
+<div class="para use">
<h4>使用例(オーディオ再生)</h4>
<pre>
-<span>/*-----------------------------------------------------------------------*/</span>
-<span>/* f_forward関数から呼ばれるデータ送信関数の例 */</span>
-<span>/*-----------------------------------------------------------------------*/</span>
+<span class="c">/*-----------------------------------------------------------------------*/</span>
+<span class="c">/* f_forward関数から呼ばれるデータ送信関数の例 */</span>
+<span class="c">/*-----------------------------------------------------------------------*/</span>
-UINT out_stream ( <span>/* 戻り値: 転送されたバイト数またはストリームの状態 */</span>
- const BYTE *p, <span>/* 転送するデータを指すポインタ */</span>
- UINT btf <span>/* &gt;0: 転送を行う(バイト数). 0: ストリームの状態を調べる */</span>
+UINT out_stream ( <span class="c">/* 戻り値: 転送されたバイト数またはストリームの状態 */</span>
+ const BYTE *p, <span class="c">/* 転送するデータを指すポインタ */</span>
+ UINT btf <span class="c">/* &gt;0: 転送を行う(バイト数). 0: ストリームの状態を調べる */</span>
)
{
UINT cnt = 0;
- if (btf == 0) { <span>/* センス要求 */</span>
- <span>/* ストリームの状態を返す (0: ビジー, 1: レディ) */</span>
- <span>/* 一旦、レディを返したら、続く転送要求で少なくとも1バイトは */</span>
- <span>/* 転送されないと f_forward関数は FR_RW_ERROR となる。 */</span>
+ if (btf == 0) { <span class="c">/* センス要求 */</span>
+ <span class="c">/* ストリームの状態を返す (0: ビジー, 1: レディ) */</span>
+ <span class="c">/* 一旦、レディを返したら、続く転送要求で少なくとも1バイトは */</span>
+ <span class="c">/* 転送されないと f_forward関数は FR_INT_ERR となる。 */</span>
if (FIFO_READY) cnt = 1;
}
- else { <span>/* 転送要求 */</span>
- do { <span>/* 全てのバイトを転送するか、ストリームがビジーになるまで繰り返す */</span>
+ else { <span class="c">/* 転送要求 */</span>
+ do { <span class="c">/* 全てのバイトを転送するか、ストリームがビジーになるまで繰り返す */</span>
FIFO_PORT = *p++;
cnt++;
} while (cnt &lt; btf &amp;&amp; FIFO_READY);
@@ -102,32 +97,32 @@ UINT out_stream ( <span>/* 戻り値: 転送されたバイト数またはストリームの状態 */
}
-<span>/*-----------------------------------------------------------------------*/</span>
-<span>/* f_forward関数の使用例 */</span>
-<span>/*-----------------------------------------------------------------------*/</span>
+<span class="c">/*-----------------------------------------------------------------------*/</span>
+<span class="c">/* f_forward関数の使用例 */</span>
+<span class="c">/*-----------------------------------------------------------------------*/</span>
FRESULT play_file (
- char *fn <span>/* 再生するオーディオ・ファイル名を指すポインタ */</span>
+ char *fn <span class="c">/* 再生するオーディオ・ファイル名を指すポインタ */</span>
)
{
FRESULT rc;
FIL fil;
UINT dmy;
- <span>/* ファイルを読み出しモードで開く */</span>
+ <span class="c">/* ファイルを読み出しモードで開く */</span>
rc = f_open(&amp;fil, fn, FA_READ);
if (rc) return rc;
- <span>/* 全てのデータが転送されるかエラーが発生するまで続ける */</span>
+ <span class="c">/* 全てのデータが転送されるかエラーが発生するまで続ける */</span>
while (rc == FR_OK &amp;&amp; fil.fptr &lt; fil.fsize) {
- <span>/* ほかの処理... */</span>
+ <span class="c">/* ほかの処理... */</span>
- <span>/* 定期的または要求に応じてデータをストリームに送出する */</span>
+ <span class="c">/* 定期的または要求に応じてデータをストリームに送出する */</span>
rc = f_forward(&amp;fil, out_stream, 1000, &amp;dmy);
}
- <span>/* ファイルを閉じて戻る */</span>
+ <span class="c">/* ファイルを閉じて戻る */</span>
f_close(&amp;fil);
return rc;
}
@@ -135,7 +130,7 @@ FRESULT play_file (
</div>
-<div class="para">
+<div class="para ref">
<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="gets.html">fgets</a>, <a href="write.html">f_write</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/ja/getcwd.html b/data/sysrom/fat/doc/ja/getcwd.html
index 827807c..74dacfa 100644
--- a/data/sysrom/fat/doc/ja/getcwd.html
+++ b/data/sysrom/fat/doc/ja/getcwd.html
@@ -11,62 +11,56 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_getcwd</h2>
<p>カレント・ディレクトリを得ます</p>
<pre>
FRESULT f_getcwd (
- TCHAR* <em>Buffer</em>, <span>/* バッファ */</span>
- UINT <em>BufferLen</em> <span>/* バッファ・サイズ */</span>
+ TCHAR* <span class="arg">buff</span>, <span class="c">/* [OUT] バッファ */</span>
+ UINT <span class="arg">len</span> <span class="c">/* [IN] バッファ・サイズ */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>Buffer</dt>
+<dt>buff</dt>
<dd>カレント・ディレクトリの文字列を格納するバッファ</dd>
-<dt>BufferLen</dt>
+<dt>len</dt>
<dd>TCHAR単位のバッファ・サイズ</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>正常終了。</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>ディスク・エラーによる失敗。</dd>
-<dt>FR_INT_ERR</dt>
-<dd>不正なFAT構造または内部エラーによる失敗。</dd>
-<dt>FR_NOT_READY</dt>
-<dd>メディアがセットされていないなど、物理ドライブが動作不能状態。</dd>
-<dt>FR_NO_FILESYSTEM</dt>
-<dd>有効なFATボリュームが見つからない。</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>その論理ドライブにワーク・エリアが与えられていない。</dd>
-<dt>FR_NOT_ENOUGH_CORE</dt>
-<dd>バッファ・サイズが不足。</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>,
+<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
-<p>f_getcwd関数は、カレント・ドライブのカレント・ディレクトリのパス文字列を取得します。パス文字列は、ドライブ番号を含んだフル・パス名です。</p>
+<p>カレント・ドライブのカレント・ディレクトリのパス文字列を取得します。パス文字列は、ドライブ番号を含んだフル・パス名です。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p><tt>_FS_RPATH == 2</tt>のとき使用可能です。</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>参照</h4>
<p><tt><a href="chdrive.html">f_chdrive</a>, <a href="chdir.html">f_chdir</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/ja/getfree.html b/data/sysrom/fat/doc/ja/getfree.html
index 58b569c..94552f2 100644
--- a/data/sysrom/fat/doc/ja/getfree.html
+++ b/data/sysrom/fat/doc/ja/getfree.html
@@ -11,88 +11,81 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_getfree</h2>
<p>論理ドライブ上の未使用クラスタ数を得ます。</p>
<pre>
FRESULT f_getfree (
- const TCHAR* <em>Path</em>, <span>/* 対象ドライブを指定します */</span>
- DWORD* <em>Clusters</em>, <span>/* 空きクラスタ数を格納する変数へのポインタ */</span>
- FATFS** <em>FileSystemObject</em> <span>/* ファイル・システム・オブジェクトを指すポインタへのポインタ */</span>
+ const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] 対象ドライブを指定します */</span>
+ DWORD* <span class="arg">nclst</span>, <span class="c">/* [OUT] 空きクラスタ数を格納する変数へのポインタ */</span>
+ FATFS** <span class="arg">fatfs</span> <span class="c">/* [OUT] ファイル・システム・オブジェクトを指すポインタへのポインタ */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>Path</dt>
-<dd>調べる対象の論理ドライブを示す<a href="filename.html">パス名</a>が入った<tt>'\0'</tt>で終わる文字列へのポインタを指定します。</dd>
-<dt>Clusters</dt>
+<dt>path</dt>
+<dd>調べる対象の論理ドライブを示す<a href="filename.html">パス名</a>を示すヌル文字<tt>'\0'</tt>終端の文字列へのポインタを指定します。ヌル文字列はカレント・ドライブを意味します。</dd>
+<dt>nclst</dt>
<dd>空きクラスタ数を格納する<tt>DWORD</tt>変数へのポインタを指定します。</dd>
-<dt>FileSystemObject</dt>
+<dt>fatfs</dt>
<dd>対象ドライブのファイル・システム・オブジェクトを指すポインタが返されます。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>正常終了。<tt>*Clusters</tt>に空きクラスタ数が返されます。</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>ドライブ番号が不正。</dd>
-<dt>FR_NOT_READY</dt>
-<dd>メディアがセットされていないなど、物理ドライブが動作不能状態。</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>ディスク・エラーによる失敗。</dd>
-<dt>FR_INT_ERR</dt>
-<dd>不正なFAT構造または内部エラーによる失敗。</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>その論理ドライブにワーク・エリアが与えられていない。</dd>
-<dt>FR_NO_FILESYSTEM</dt>
-<dd>有効なFATボリュームが見つからない。</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
<p>論理ドライブ上の空きクラスタ数を取得します。返されたファイル・システム・オブジェクトの<tt>csize</tt>メンバがクラスタあたりのセクタ数を示しているので、これを元に実際の空きサイズが計算できます。FAT32ボリュームにおいては、FSINFOセクタの状態によっては不正確な値を返したり、処理に時間がかかったりする可能性があります。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_FS_MINIMIZE == 0</tt>のとき使用可能です。</p>
</div>
-<div class="para">
+<div class="para use">
<h4>使用例</h4>
<pre>
FATFS *fs;
DWORD fre_clust, fre_sect, tot_sect;
- <span>/* ドライブ1のボリューム情報と空きクラスタ数を得る */</span>
+ <span class="c">/* ドライブ1のボリューム情報と空きクラスタ数を得る */</span>
res = f_getfree("1:", &amp;fre_clust, &amp;fs);
if (res) die(res);
- <span>/* 全セクタ数と空きセクタ数を計算 */</span>
+ <span class="c">/* 全セクタ数と空きセクタ数を計算 */</span>
tot_sect = (fs->n_fatent - 2) * fs->csize;
fre_sect = fre_clust * fs->csize;
- <span>/* ドライブサイズと空きサイズの表示 (512バイト/セクタと仮定) */</span>
- printf("%lu KB total drive space.\n"
- "%lu KB available.\n",
- fre_sect / 2, tot_sect / 2);
+ <span class="c">/* ボリュームとと空きのサイズをKiB単位で表示 (512バイト/セクタと仮定) */</span>
+ printf("%lu KB total drive space.\n%lu KB available.\n",
+ tot_sect / 2, fre_sect / 2);
</pre>
</div>
-<div class="para">
+<div class="para ref">
<h4>参照</h4>
<tt><a href="sfatfs.html">FATFS</a></tt>
</div>
diff --git a/data/sysrom/fat/doc/ja/getlabel.html b/data/sysrom/fat/doc/ja/getlabel.html
new file mode 100644
index 0000000..e2df997
--- /dev/null
+++ b/data/sysrom/fat/doc/ja/getlabel.html
@@ -0,0 +1,82 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="ja">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="FatFs" href="../00index_j.html">
+<link rel="alternate" hreflang="en" title="English" href="../en/getlabel.html">
+<link rel="stylesheet" href="../css_j.css" type="text/css" media="screen" title="ELM Default">
+<title>FatFs - f_getlabel</title>
+</head>
+
+<body>
+
+<div class="para func">
+<h2>f_getlabel</h2>
+<p>ボリューム・ラベルを取得します。</p>
+<pre>
+FRESULT f_getlabel (
+ const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] 対象ドライブ */</span>
+ TCHAR* <span class="arg">name</span>, <span class="c">/* [OUT] ボリューム名を格納するバッファ */</span>
+ DWORD* <span class="arg">sn</span> <span class="c">/* [OUT] ボリューム・シリアル番号を格納する変数 */</span>
+);
+</pre>
+</div>
+
+<div class="para arg">
+<h4>引数</h4>
+<dl class="par">
+<dt>path</dt>
+<dd>対象となる論理ドライブの<a href="filename.html">パス名</a>を示すヌル文字<tt>'\0'</tt>終端の文字列へのポインタを指定します。ヌル文字列の場合は、デフォルト・ドライブを指定したことになります。</dd>
+<dt>name</dt>
+<dd>ボリューム名を格納する配列へのポインタを指定します。少なくとも12要素のサイズが必要です。ボリューム名がない場合はヌル文字列が返されます。この情報が不要なときはヌル・ポインタを指定してください。</dd>
+<dt>sn</dt>
+<dd>ボリューム・シリアル番号を格納する<tt>DWORD</tt>変数へのポインタを指定します。この情報が不要なときはヌル・ポインタを指定してください。</dd>
+</dl>
+</div>
+
+
+<div class="para ret">
+<h4>戻り値</h4>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>
+</p>
+</div>
+
+
+<div class="para comp">
+<h4>対応情報</h4>
+<p><tt>_USE_LABEL == 1</tt>のときに使用可能です。</p>
+</div>
+
+
+<div class="para use">
+<h4>使用例</h4>
+<pre>
+ char str[12];
+
+ <span class="c">/* デフォルト・ドライブのボリューム名を得る */</span>
+ f_getlabel("", str, 0);
+
+ <span class="c">/* ドライブ2のボリューム名を得る */</span>
+ f_getlabel("2:", str, 0);
+</pre>
+</div>
+
+
+<div class="para ref">
+<h4>参照</h4>
+<tt><a href="setlabel.html">f_setlabel</a></tt>
+</div>
+
+
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
+</body>
+</html>
diff --git a/data/sysrom/fat/doc/ja/gets.html b/data/sysrom/fat/doc/ja/gets.html
index 2dfcdf6..26384c7 100644
--- a/data/sysrom/fat/doc/ja/gets.html
+++ b/data/sysrom/fat/doc/ja/gets.html
@@ -11,51 +11,51 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_gets</h2>
<p>ファイルから文字列を読み出します。</p>
<pre>
TCHAR* f_gets (
- TCHAR* <em>Str</em>, <span>/* バッファ */</span>
- int <em>Size</em>, <span>/* バッファのサイズ */</span>
- FIL* <em>FileObject</em> <span>/* ファイル・オブジェクト */</span>
+ TCHAR* <span class="arg">buff</span>, <span class="c">/* [OUT] バッファ */</span>
+ int <span class="arg">len</span>, <span class="c">/* [IN] バッファのサイズ */</span>
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] ファイル・オブジェクト */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>Str</dt>
+<dt>str</dt>
<dd>文字列を読み出すバッファを指すポインタを指定します。</dd>
-<dt>Size</dt>
+<dt>len</dt>
<dd>バッファのサイズを要素数で指定します。</dd>
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>ファイル・オブジェクト構造体へのポインタを指定します。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
<p>関数が成功すると<tt>Str</tt>が返されます。</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
-<p>この関数は<a href="read.html">f_read()</a>のラッパー関数です。読み出し動作は、最初の<tt>'\n'</tt>を読み込むか、ファイル終端に達するか、<tt>Size - 1</tt>文字を読み出すまで続きます。読み込まれた文字列の終端には<tt>'\0'</tt>が付加されます。既にファイル終端で1文字も読み込まれなかったとき、または何らかのエラーが発生したときは関数は失敗しヌル・ポインタを返します。ファイル終端かエラーかは<tt>f_eof()</tt>,<tt>f_error()</tt>マクロで調べられます。</p>
+<p>この関数は<a href="read.html"><tt>f_read()</tt></a>のラッパー関数です。読み出し動作は、最初の<tt>'\n'</tt>を読み込むか、ファイル終端に達するか、<tt>len - 1</tt>文字を読み出すまで続きます。読み込まれた文字列の終端には<tt>'\0'</tt>が付加されます。既にファイル終端で1文字も読み込まれなかったとき、または何らかのエラーが発生したときは関数は失敗しヌル・ポインタを返します。ファイル終端かエラーかは<tt>f_eof()</tt>,<tt>f_error()</tt>マクロで調べられます。</p>
<p>APIにUnicodeが選択されている(<tt>_LFN_UNICODE</tt>が1)ときは、UTF-8エンコードのテキスト・ファイルとしてUCS-2に変換してバッファに読み込みます。それ以外の時は無変換(1文字1バイト)で読み込みます。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
-<p><tt>_USE_STRFUNC</tt>が 1または 2のとき使用可能です。2のときは、ファイルに含まれる<tt>'\r'</tt>が取り除かれてバッファに読み込まれます。</p>
+<p><tt>_USE_STRFUNC</tt>が1または2のとき使用可能です。2のときは、ファイルに含まれる<tt>'\r'</tt>が取り除かれてバッファに読み込まれます。</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="read.html">f_read</a>, <a href="putc.html">f_putc</a>, <a href="puts.html">f_puts</a>, <a href="printf.html">f_printf</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/ja/lseek.html b/data/sysrom/fat/doc/ja/lseek.html
index 3dd6db6..bfc83da 100644
--- a/data/sysrom/fat/doc/ja/lseek.html
+++ b/data/sysrom/fat/doc/ja/lseek.html
@@ -11,113 +11,116 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_lseek</h2>
-<p>ファイルのリード/ライト・ポインタを移動します。</p>
+<p>ファイルのリード/ライト・ポインタを移動します。また、高速シーク機能使用時にはCLMT(後述)の作成にも使用します。</p>
<pre>
FRESULT f_lseek (
- FIL* <em>FileObject</em>, <span>/* ファイル・オブジェクト構造体へのポインタ */</span>
- DWORD <em>Offset</em> <span>/* 移動先オフセット */</span>
+ FIL* <span class="arg">fp</span>, <span class="c">/* [IN] ファイル・オブジェクト構造体へのポインタ */</span>
+ DWORD <span class="arg">ofs</span> <span class="c">/* [IN] 移動先オフセット */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>対象となるファイル・オブジェクト構造体へのポインタを指定します。</dd>
-<dt>Offset</dt>
+<dt>ofs</dt>
<dd>移動先のオフセット(リード/ライト・ポインタ)値。ファイル先頭からのオフセットをバイト単位で指定します。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>正常終了。</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>ディスク・エラーによる失敗。</dd>
-<dt>FR_INT_ERR</dt>
-<dd>不正なFAT構造または内部エラーによる失敗。</dd>
-<dt>FR_NOT_READY</dt>
-<dd>メディアがセットされていないなど、物理ドライブが動作不能状態。</dd>
-<dt>FR_INVALID_OBJECT</dt>
-<dd>無効なファイル・オブジェクト。</dd>
-<dt>FR_NOT_ENOUGH_CORE</dt>
-<dd>リンク・マップ・テーブルのサイズが不足。</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#io">FR_INVALID_OBJECT</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>,
+<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
-<p>ファイルのリード/ライト・ポインタ(ファイル・オブジェクト内のfptrメンバで、次に読み出し・書き込みされるバイトのオフセットを示す)を移動します。オフセットの原点はファイル先頭です。書き込みモードでファイル・サイズより大きな値を指定すると、そこまでファイル・サイズが拡張され、拡張された部分のデータは未定義となります。データを遅延無く高速に書き込みたいときは、予めこの関数で必要なサイズまでファイル・サイズを拡張しておくと良いでしょう。f_lseek関数が正常終了したあとは、リード/ライト・ポインタが正しく移動したかfptrをチェックするべきです。リード/ライト・ポインタが指定より小さいときは、次の原因が考えられます。</p>
+<p>ファイルのリード/ライト・ポインタ(次に読み出し・書き込みされるバイトのオフセット)を移動します。オフセットの原点はファイル先頭です。書き込みモードでファイル・サイズより大きな値を指定すると、そこまでファイル・サイズが拡張され、拡張された部分のデータは未定義となります。データを遅延無く高速に書き込みたいときは、予めこの関数で必要なサイズまでファイル・サイズを拡張しておくと良いでしょう。<tt>f_lseek()</tt>が正常終了したあとは、リード/ライト・ポインタが正しく移動したかチェックするべきです。リード/ライト・ポインタが指定より小さいときは、次の原因が考えられます。</p>
<ul>
<li>非書き込みモードまたは高速シーク・モードのため、ファイル・サイズでクリップされた。</li>
<li>ファイル拡張中にディスクが満杯になった。</li>
</ul>
-<p><tt>_USE_FASTSEEK</tt>に1が指定されていて、且つファイル・オブジェクトの<tt>cltbl</tt>メンバがNULL以外のとき、高速シーク・モードになります。これはファイルのクラスタ情報をアプリケーションの指定した配列に保持しておくことにより、FATにアクセスすることなく後方シークやロング・シークを高速に行う機能です。高速シーク動作を行う前には、配列を初期化しておく必要があります。必要な配列サイズ(要素数)は、(ファイルの分割数 + 1) * 2 です。たとえば、ファイルが5つに分断されているときに必要な配列サイズは、12要素となります。高速シーク使用時はファイル・サイズの拡張はできません。</p>
+<p><tt>_USE_FASTSEEK</tt>が1で、且つファイル・オブジェクトの<tt>cltbl</tt>メンバがNULL以外(<tt>f_open(</tt>)でNULLに設定される)のとき、高速シーク・モードになります。これはファイルのクラスタ配置情報(CLMT)をメモリ上に保持しておくことにより、FATにアクセスすることなく後方シークやロング・シークを高速に行う機能です。高速シーク・モードは、<tt>f_read()/f_wtite()</tt>の動作にも適用されます。高速シーク・モードでは<tt>f_wtite()/f_lseek()</tt>によるファイル・サイズの拡張はできません。</p>
+<p>高速シーク動作を行う前に、CLMTを作成しておく必要があります。これを作成するには、まずCLMT格納バッファ(<tt>DWORD</tt>型配列)を準備し、<tt>cltbl</tt>メンバにそのポインタをセットします。そして、配列の先頭要素にその配列のサイズ(要素数)を入れ、<tt>f_lseek()</tt>を<tt class="arg">ofs</tt>に<tt>CREATE_LINKMAP</tt>を指定して呼び出します。関数が成功するとCLMTが作成され、以降の<tt>f_read()/f_write()/f_lseek()</tt>ではFATへのアクセスは発生しません。<tt>FR_NOT_ENOUGH_CORE</tt>で失敗したときは配列サイズが不足で、先頭要素には実際に必要となる要素数が返されます。必要な要素数は、(ファイルの分割数 + 1) * 2 です。たとえば、ファイルが5つのフラグメントに分断されているときに必要な要素数は、12となります。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p><tt>_FS_MINIMIZE &lt; 3</tt>のとき使用可能です。</p>
</div>
-<div class="para">
+<div class="para use">
<h4>使用例</h4>
<pre>
- <span>/* ファイル・オフセット5000へ移動 */</span>
- res = f_lseek(&amp;file, 5000, 0);
+ <span class="c">/* ファイルを開く */</span>
+ file = malloc(sizeof(FIL));
+ if (!file) ...
+ res = f_open(file, "file.dat", FA_READ|FA_WRITE);
+ if (res) ...
+
+ <span class="c">/* ファイル・オフセット5000へ移動 */</span>
+ res = f_lseek(file, 5000);
- <span>/* ファイル追記の準備 (ファイル終端へ移動) */</span>
- res = f_lseek(&amp;file, file.fsize, 0);
+ <span class="c">/* ファイル終端へ移動(ファイル追記の準備) */</span>
+ res = f_lseek(file, f_size(file));
- <span>/* 3000バイト進める */</span>
- res = f_lseek(&amp;file, file.fptr + 3000, 0);
+ <span class="c">/* 3000バイト進める */</span>
+ res = f_lseek(file, f_tell(file) + 3000);
- <span>/* 2000バイト戻す (オーバーフローに注意) */</span>
- res = f_lseek(&amp;file, file.fptr - 2000, 0);
+ <span class="c">/* 2000バイト戻す (オーバーフローに注意) */</span>
+ res = f_lseek(file, f_tell(file) - 2000);
</pre>
<pre>
- <span>/* クラスタ先行割り当て (ストリーミング・ライト時のバッファ・オーバーラン防止) */</span>
+ <span class="c">/* クラスタ先行割り当て (ストリーミング・ライト時のバッファ・オーバーラン防止) */</span>
- res = f_open(&amp;file, "record.wav", FA_CREATE_NEW | FA_WRITE); <span>/* ファイル作成 */</span>
+ res = f_open(file, "record.wav", FA_CREATE_NEW | FA_WRITE); <span class="c">/* ファイル作成 */</span>
- res = f_lseek(&amp;file, MAX_SIZE, 0); <span>/* 十分なクラスタの先行割り当て */</span>
- if (res || file.fptr != PRE_SIZE) .... <span>/* 正しくファイルが拡張されたかチェック */</span>
+ res = f_lseek(file, MAX_SIZE); <span class="c">/* 十分なクラスタの先行割り当て */</span>
+ if (res || f_tell(file) != PRE_SIZE) ... <span class="c">/* 正しくファイルが拡張されたかチェック */</span>
- res = f_lseek(&amp;file, DATA_START, 0); <span>/* データ・ストリームの記録(アロケーションディレイ無し) */</span>
+ res = f_lseek(file, DATA_START); <span class="c">/* データ・ストリームの記録(アロケーションディレイ無し) */</span>
...
- res = f_truncate(&amp;file); <span>/* 不要領域の切り捨て */</span>
- res = f_lseek(&amp;file, 0, 0); <span>/* ヘッダの記録 */</span>
+ res = f_truncate(file); <span class="c">/* 不要領域の切り捨て */</span>
+ res = f_lseek(file, 0); <span class="c">/* ヘッダの記録 */</span>
...
- res = f_close(&amp;file);
+ res = f_close(file);
</pre>
<pre>
- <span>/* 高速シーク機能を使う */</span>
+ <span class="c">/* 高速シーク機能を使う */</span>
- DWORD lktbl[SZ_TBL]; <span>/* リンク・マップ・テーブル格納バッファ */</span>
+ DWORD lktbl[SZ_TBL]; <span class="c">/* リンク・マップ・テーブル格納バッファ */</span>
- res = f_lseek(&amp;file, ofs1); <span>/* 通常シーク (オープン時、file.cltbl == NULL) */</span>
+ res = f_lseek(file, ofs1); <span class="c">/* 通常シーク (オープン時、file.cltbl == NULL) */</span>
- file.cltbl = lktbl; <span>/* 高速シーク機能の有効化 */</span>
- lktbl[0] = SZ_TBL; <span>/* 先頭要素に配列要素数をセット */</span>
- res = f_lseek(&amp;file, CREATE_LINKMAP); <span>/* リンク・マップ・テーブルの作成 */</span>
+ file.cltbl = lktbl; <span class="c">/* 高速シーク機能の有効化 */</span>
+ lktbl[0] = SZ_TBL; <span class="c">/* 先頭要素に配列要素数をセット */</span>
+ res = f_lseek(file, CREATE_LINKMAP); <span class="c">/* CLMTの作成 */</span>
+ ...
- res = f_lseek(&amp;file, ofs2); <span>/* 高速シーク (file.cltbl != NULL) */</span>
+ res = f_lseek(file, ofs2); <span class="c">/* 以降、f_read/f_write/f_lseekでFATアクセスが発生しない */</span>
</pre>
</div>
-<div class="para">
+<div class="para ref">
<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/ja/mkdir.html b/data/sysrom/fat/doc/ja/mkdir.html
index 831b094..ef107d3 100644
--- a/data/sysrom/fat/doc/ja/mkdir.html
+++ b/data/sysrom/fat/doc/ja/mkdir.html
@@ -11,69 +11,59 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_mkdir</h2>
<p>ディレクトリを作成します。</p>
<pre>
FRESULT f_mkdir (
- const TCHAR* <em>DirName</em> <span>/* 作成するディレクトリ名へのポインタ */</span>
+ const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] 作成するディレクトリ名へのポインタ */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>DirName</dt>
-<dd>作成するディレクトリの<a href="filename.html">パス名</a>が入った<tt>'\0'</tt>で終わる文字列へのポインタを指定します。</dd>
+<dt>path</dt>
+<dd>作成するディレクトリの<a href="filename.html">パス名</a>を示すヌル文字<tt>'\0'</tt>終端の文字列へのポインタを指定します。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>正常終了。</dd>
-<dt>FR_NO_PATH</dt>
-<dd>パスが見つからない。</dd>
-<dt>FR_INVALID_NAME</dt>
-<dd>パス名が不正。</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>ドライブ番号が不正。</dd>
-<dt>FR_DENIED</dt>
-<dd>ディスクやディレクトリ・エントリが満杯の場合など。</dd>
-<dt>FR_EXIST</dt>
-<dd>同名のディレクトリやファイルが存在する。</dd>
-<dt>FR_NOT_READY</dt>
-<dd>メディアがセットされていないなど、物理ドライブが動作不能状態。</dd>
-<dt>FR_WRITE_PROTECTED</dt>
-<dd>メディアが書き込み禁止状態。</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>ディスク・エラーによる失敗。</dd>
-<dt>FR_INT_ERR</dt>
-<dd>不正なFAT構造または内部エラーによる失敗。</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>その論理ドライブにワーク・エリアが与えられていない。</dd>
-<dt>FR_NO_FILESYSTEM</dt>
-<dd>有効なFATボリュームが見つからない。</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#np">FR_NO_PATH</a>,
+<a href="rc.html#in">FR_INVALID_NAME</a>,
+<a href="rc.html#de">FR_DENIED</a>,
+<a href="rc.html#ex">FR_EXIST</a>,
+<a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>,
+<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
<p>空のディレクトリを作成します。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_FS_MINIMIZE == 0</tt>のとき使用可能です。</p>
</div>
-<div class="para">
+<div class="para use">
<h4>使用例</h4>
<pre>
res = f_mkdir("sub1");
diff --git a/data/sysrom/fat/doc/ja/mkfs.html b/data/sysrom/fat/doc/ja/mkfs.html
index 717c4cf..cbeea5d 100644
--- a/data/sysrom/fat/doc/ja/mkfs.html
+++ b/data/sysrom/fat/doc/ja/mkfs.html
@@ -11,70 +11,63 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_mkfs</h2>
-<p>物理ドライブ上にFATボリュームを作成(フォーマット)します。</p>
+<p>論理ドライブ上にFATボリュームを作成(フォーマット)します。</p>
<pre>
FRESULT f_mkfs (
- BYTE <em>Drive</em>, <span>/* 論理ドライブ番号 */</span>
- BYTE <em>PartitioningRule</em>, <span>/* 区画作成方法 */</span>
- UINT <em>AllocSize</em> <span>/* クラス・タサイズ */</span>
+ BYTE <span class="arg">vol</span>, <span class="c">/* [IN] 論理ドライブ番号 */</span>
+ BYTE <span class="arg">sfd</span>, <span class="c">/* [IN] 区画作成方法 */</span>
+ UINT <span class="arg">au</span> <span class="c">/* [IN] クラス・タサイズ */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>Drive</dt>
-<dd>フォーマットする論理ドライブ(0-9)。</dd>
-<dt>PartitioningRule</dt>
-<dd>0を指定すると、ドライブの全領域を占める基本DOS区画を作成したあと、そこにFATボリュームを作成します(FDISKフォーマット)。1を指定すると、区画テーブルを作成せず物理ドライブの先頭セクタから直接ファイル・システムを作成します(super floppy (SFD) フォーマット)。</dd>
-<dt>AllocSize</dt>
-<dd>クラスタ・サイズをバイト単位で指定します。2の累乗、且つセクタ・サイズ以上、且つセクタ・サイズの128倍以下でなければなりません。無効な値を指定した場合、ドライブ・サイズに応じたデフォルトのクラスタ・サイズが選択されます。特に指定しない場合は、0を指定して自動選択とします。</dd>
+<dt>vol</dt>
+<dd>フォーマットする論理ドライブ。(0 〜 <tt>_VOLUMES - 1</tt>)</dd>
+<dt>sfd</dt>
+<dd>パーテーション形式。(0(FDISK) or 1(SFD))</dd>
+<dt>au</dt>
+<dd>クラスタ・サイズをバイト単位で指定します。対象ドライブのセクタ・サイズのn倍(n = 1〜128で、2の累乗)でなければなりません。0を指定した場合、ボリュームのサイズに応じたデフォルトのクラスタ・サイズが選択されます。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>正常終了。</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>ドライブ番号が無効。</dd>
-<dt>FR_NOT_READY</dt>
-<dd>メディアがセットされていないなど、物理ドライブが動作不能状態。</dd>
-<dt>FR_WRITE_PROTECTED</dt>
-<dd>メディアが書き込み禁止状態。</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>その論理ドライブにワーク・エリアが割り当てられていない。</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>ディスク・エラーによる失敗。</dd>
-<dt>FR_MKFS_ABORTED</dt>
-<dd>次の理由で開始前に処理が中断された。
-<ul>
-<li>ディスク・サイズが小さすぎる。</li>
-<li>何らかの引数が不正。</li>
-<li>そのクラスタ・サイズが使えない。クラスタ数がFATタイプの境界に近くなるとき発生する可能性がある。</li>
-</ul>
-</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ma">FR_MKFS_ABORTED</a>,
+<a href="rc.html#ip">FR_INVALID_PARAMETER</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>説明</h4>
-<p>f_mkfs関数は物理ドライブ上にFATボリュームを作成します。リムーバブル・メディアのパーテーショニング・ルールとしてはFDISK形式とSFD形式があり、メモリ・カードではFDISK形式が普通です。この関数は<em>複数区画には対応していない</em>ので、その物理ドライブの既存の区画は全て削除され、全体が一つの区画になります。</p>
-<p>FATタイプ(FAT12/FAT16/FAT32)は、その論理ドライブ上の<em>クラスタ数によってのみ決定</em>される決まり[FAT仕様書より]になっていて、それ以外の要因はありません。したがって、どのFATタイプになるかはドライブ・サイズとクラスタ・サイズに依存します。クラスタ・サイズは大きくするほど性能が上がり、逆にディスク利用効率は落ちます。</p>
-<p>クラスタ数がFATタイプの境界に近くなるときは、FR_MKFS_ABORTEDで関数が失敗する可能性があります。</p>
+<p>物理ドライブ上にFATボリュームを作成します。FDISK形式が指定された場合は、物理ドライブ全体を占める基本区画(パーテーション)が作成され、その中にFATボリュームが作成されます。SFD形式では、FATボリュームは物理ドライブの先頭セクタからベタで作成されます。</p>
+<p>マルチパーテーション機能(<tt>_MULTI_PARTITION</tt>)により、指定された論理ドライブが特定の区画(1〜4)に結び付けられている場合、その区画の中にFATボリュームが作成されます。この場合、<tt class="arg">sfd</tt>は無視され、また対応する物理ドライブはこれに先立ち、<tt>f_fdisk()</tt>または他のツールで適切に区画設定されている必要があります。</p>
+<p>パーテーション形式には、FDISK形式とSFD形式の二通りあります。FDISK形式は、ハードディスク、MMC、SDC、CFCなどで使用されます。FDISK形式では一台の物理ドライブ上に一つまたは複数の区画を作成することができます。管理情報はMBR(物理ドライブの先頭セクタ)に記録されます。SFD形式は単に何の分割も行わない形式で、ボリュームは物理ドライブの先頭セクタから開始します。SFD形式は、フロッピーディスク、マイクロドライブ、光学ディスク、およびその他スーパーフロッピーメディアで使用されています。</p>
+<p>FATタイプ(FAT12/FAT16/FAT32)は、その論理ドライブ上の<em>クラスタ数によってのみ決定</em>される決まり[FAT仕様書より]になっていて、それ以外の要因はありません。したがって、どのFATタイプになるかはドライブ・サイズとクラスタ・サイズに依存します。クラスタ・サイズは大きくするほど性能が上がり、ディスク利用効率は落ちます。</p>
+<p>クラスタ数がFATタイプの境界に近くなるときは、<tt>FR_MKFS_ABORTED</tt>で関数が失敗する可能性があります。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_USE_MKFS == 1</tt>のとき使用可能です。</p>
</div>
-<p class="foot"><a href="../00index_e.html">Return</a></p>
+<div class="para ref">
+<h4>参照</h4>
+<p><tt><a href="filename.html#vol">ボリューム管理</a>, <a href="fdisk.html">f_fdisk</a></tt></p>
+</div>
+
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
</body>
</html>
diff --git a/data/sysrom/fat/doc/ja/mount.html b/data/sysrom/fat/doc/ja/mount.html
index a87d6d8..26d31d8 100644
--- a/data/sysrom/fat/doc/ja/mount.html
+++ b/data/sysrom/fat/doc/ja/mount.html
@@ -11,52 +11,50 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_mount</h2>
<p>論理ドライブのワーク・エリアを登録・抹消します。</p>
<pre>
FRESULT f_mount (
- BYTE <em>Drive</em>, <span>/* 論理ドライブ番号 */</span>
- FATFS* <em>FileSystemObject</em> <span>/* ワーク・エリアへのポインタ */</span>
+ BYTE <span class="arg">vol</span>, <span class="c">/* [IN] 論理ドライブ番号 */</span>
+ FATFS* <span class="arg">fatfs</span> <span class="c">/* [IN] ワーク・エリアへのポインタ */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>Drive</dt>
-<dd>論理ドライブ番号(0-9)。</dd>
-<dt>FileSystemObject</dt>
+<dt>vol</dt>
+<dd>論理ドライブ番号(0 〜 <tt>_VOLUMES - 1</tt>)。</dd>
+<dt>fatfs</dt>
<dd>登録するワーク・エリア(ファイル・システム・オブジェクト)へのポインタ。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>正常終了。</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>論理ドライブ番号が無効。</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
-<p>FatFsモジュールではそれぞれの論理ドライブにファイル・システム・オブジェクトというワーク・エリアが必要です。この関数は論理ドライブにそのワーク・エリアを登録したり抹消したりします。何らかのファイル関数を使用する前にこの関数でその論理ドライブのワーク・エリアを与えておかなければなりません。<tt>FileSystemObject</tt>にヌル・ポインタを指定するとその論理ドライブのワーク・エリアの登録は抹消され、登録されていたワーク・エリアは破棄できます。操作対象のドライブに対して開かれているファイルやディレクトリがあった場合、それらは全て無効になります。</p>
-<p>この関数は、ドライブの状態に関わらず常に成功します。関数内では下位レイヤ(物理ドライブ)へのアクセスは発生せず、ワーク・エリアを初期化して内部配列にそのアドレスを登録するだけです。実際のマウント動作は、この関数の実行またはメディア交換発生の後、最初のファイル・アクセスのときに行われます。</p>
+<p>FatFsモジュールではそれぞれの論理ドライブにファイル・システム・オブジェクトというワーク・エリアが必要です。この関数は論理ドライブにそのワーク・エリアを登録したり抹消したりします。何らかのファイル関数を使用する前にこの関数でその論理ドライブのワーク・エリアを与えておかなければなりません。<tt class="arg">fatfs</tt>にヌル・ポインタを指定するとワーク・エリアの登録は抹消され、登録されていたワーク・エリアは破棄できます。操作対象のドライブに対して開かれているファイルやディレクトリがあった場合、それらは全て無効になります。</p>
+<p>この関数は、物理ドライブの状態に関わらず常に成功します。関数内では下位レイヤへのアクセスは発生せず、指定されたワーク・エリアをクリア(無効化)し、そのアドレスを内部配列に登録するだけです。単に登録済みのワーク・エリアをクリアする目的にも使えます。実際のマウント動作は、ボリュームへのアクセス開始のときにワーク・エリアが無効または物理ドライブが未初期化だった場合に自動で行われます。マウント動作では、物理ドライブの初期化、FATボリュームの検出とワーク・エリアの初期化が行われます。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p>全ての構成で使用可能です。</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>参照</h4>
<p><tt><a href="sfatfs.html">FATFS</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/ja/open.html b/data/sysrom/fat/doc/ja/open.html
index c2a16cf..0a9b680 100644
--- a/data/sysrom/fat/doc/ja/open.html
+++ b/data/sysrom/fat/doc/ja/open.html
@@ -11,34 +11,34 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_open</h2>
<p>ファイルをオープンまたは作成します。</p>
<pre>
FRESULT f_open (
- FIL* <em>FileObject</em>, <span>/* 空のファイル・オブジェクト構造体へのポインタ */</span>
- const TCHAR* <em>FileName</em>, <span>/* ファイルのフルパス名へのポインタ */</span>
- BYTE <em>ModeFlags</em> <span>/* モードフラグ */</span>
+ FIL* <span class="arg">fp</span>, <span class="c">/* [OUT] 空のファイル・オブジェクト構造体へのポインタ */</span>
+ const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] ファイルのフルパス名へのポインタ */</span>
+ BYTE <span class="arg">mode</span> <span class="c">/* [IN] モードフラグ */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>新しく作成するファイル・オブジェクト構造体へのポインタを指定します。以降、そのファイルを閉じるまでこのファイル・オブジェクトを使用してファイル操作をします。</dd>
-<dt>FileName</dt>
-<dd>開く(または作成する)ファイルの <a href="filename.html">ファイル名</a>が入った<tt>'\0'</tt>で終わる文字列へのポインタを指定します。</dd>
-<dt>ModeFlags</dt>
+<dt>path</dt>
+<dd>開く(または作成する)ファイルの <a href="filename.html">ファイル名</a>を示すヌル文字<tt>'\0'</tt>終端の文字列へのポインタを指定します。</dd>
+<dt>mode</dt>
<dd>ファイルのアクセス方法やオープン方法を決めるフラグです。このパラメータには次の組み合わせを指定します。<br>
<table class="lst">
<tr><th>値</th><th>意味</th></tr>
<tr><td>FA_READ</td><td>読み出しモードで開きます。読み書きする場合は<tt>FA_WRITE</tt>と共に指定します。</td></tr>
<tr><td>FA_WRITE</td><td>書き込みモードで開きます。読み書きする場合は<tt>FA_READ</tt>と共に指定します。</td></tr>
<tr><td>FA_OPEN_EXISTING</td><td>既存のファイルを開きます。ファイルが無いときはエラーになります。(デフォルト)</td></tr>
-<tr><td>FA_OPEN_ALWAYS</td><td>既存のファイルを開きます。ファイルが無いときはファイルを作成します。追記する場合は、この方法でオープンした後、<tt>f_lseek()</tt>でファイルの最後尾に移動してください。</td></tr>
-<tr><td>FA_CREATE_NEW</td><td>ファイルを作成します。同名のファイルがある場合は、エラーになります。</td></tr>
+<tr><td>FA_OPEN_ALWAYS</td><td>既存のファイルを開きます。ファイルが無いときはファイルを作成します。追記の場合は、この方法でオープンした後、<a href="lseek.html"><tt>f_lseek()</tt></a>でファイルの最後尾に移動してください。</td></tr>
+<tr><td>FA_CREATE_NEW</td><td>ファイルを作成します。同名のファイルがある場合は、<tt>FR_EXIST</tt>で失敗します。</td></tr>
<tr><td>FA_CREATE_ALWAYS</td><td>ファイルを作成します。同名のファイルがある場合は、サイズを0にしてから開きます。</td></tr>
</table>
</dd>
@@ -46,90 +46,80 @@ FRESULT f_open (
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>正常終了。以降、<tt>FileObject</tt>構造体を使ってこのファイルを操作できます。</dd>
-<dt>FR_NO_FILE</dt>
-<dd>ファイルが見つからない。</dd>
-<dt>FR_NO_PATH</dt>
-<dd>パスが見つからない。</dd>
-<dt>FR_INVALID_NAME</dt>
-<dd>ファイル名が不正。</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>ドライブ番号が不正。</dd>
-<dt>FR_EXIST</dt>
-<dd>同名のファイルが既にある。</dd>
-<dt>FR_DENIED</dt>
-<dd>アクセスが拒否された。リード・オンリー・ファイルの書き込みモード・オープン、同名のディレクトリまたはリード・オンリー・ファイルがある状態でのファイル作成、ディスクまたはディレクトリ・テーブルが満杯でファイルを作成できないなど。</dd>
-<dt>FR_NOT_READY</dt>
-<dd>メディアがセットされていないなど、物理ドライブが動作不能状態。</dd>
-<dt>FR_WRITE_PROTECTED</dt>
-<dd>メディアが書き込み禁止状態で書き込み系オープンをした。</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>ディスク・エラーによる失敗。</dd>
-<dt>FR_INT_ERR</dt>
-<dd>不正なFAT構造または内部エラーによる失敗。</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>その論理ドライブにワーク・エリアが割り当てられていない。</dd>
-<dt>FR_NO_FILESYSTEM</dt>
-<dd>有効なFATボリュームが見つからない。</dd>
-<dt>FR_LOCKED</dt>
-<dd>ファイル共有機能によるアクセス拒否。</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#ok">FR_NO_FILE</a>,
+<a href="rc.html#np">FR_NO_PATH</a>,
+<a href="rc.html#in">FR_INVALID_NAME</a>,
+<a href="rc.html#de">FR_DENIED</a>,
+<a href="rc.html#ex">FR_EXIST</a>,
+<a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>,
+<a href="rc.html#lo">FR_LOCKED</a>,
+<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>,
+<a href="rc.html#tf">FR_TOO_MANY_OPEN_FILES</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
-<p>既存のファイルを開いたり、新しいファイルを作成します。関数が成功するとファイル・オブジェクトが作成され、以降そのファイルに対するアクセスに使用します。ファイルを閉じるときは、<a href="close.html">f_close()</a>を使用します。何らかの変更が行われたファイルがその後正しく閉じられなかった場合、そのファイルが破損する場合があります。</p>
-<p>ファイル・アクセスを開始する前に、<a href="mount.html">f_mount()</a>を使ってそれぞれの論理ドライブにワーク・エリア(ファイル・システム・オブジェクト)を与える必要があります。この初期化の後、その論理ドライブに対して全てのファイル関数が使えるようになります。</p>
+<p>既存のファイルを開いたり、新しいファイルを作成します。関数が成功するとファイル・オブジェクトが作成され、以降そのファイルに対するアクセスに使用します。ファイルを閉じるときは、<a href="close.html"><tt>f_close()</tt></a>を使用します。何らかの変更が行われたファイルがその後正しく閉じられなかった場合、そのファイルが破損する場合があります。</p>
+<p>既に開かれているファイルを開く必要がある場合は、<a href="appnote.html#dup">多重アクセス制御</a>を参照してください。しかし、一つのファイルに対する書き込みモードを含む重複オープンは常に禁止です。</p>
+<p>ファイル・アクセスを開始する前に、<a href="mount.html"><tt>f_mount()</tt></a>を使ってそれぞれの論理ドライブにワーク・エリア(ファイル・システム・オブジェクト)を与える必要があります。この初期化の後、その論理ドライブに対して全てのファイル関数が使えるようになります。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p>全ての構成で使用可能です。<tt>_FS_READONLY == 1</tt>のときは、<tt>FA_WRITE, FA_CREATE_ALWAYS, FA_CREATE_NEW, FA_OPEN_ALWAYS</tt>の各フラグはサポートされません。</p>
</div>
-<div class="para">
+<div class="para use">
<h4>使用例(ファイル・コピー)</h4>
<pre>
void main (void)
{
- FATFS fs[2]; <span>/* 論理ドライブのワーク・エリア(ファイル・システム・オブジェクト) */</span>
- FIL fsrc, fdst; <span>/* ファイル・オブジェクト */</span>
- BYTE buffer[4096]; <span>/* file copy buffer */</span>
- FRESULT res; <span>/* FatFs function common result code */</span>
- UINT br, bw; <span>/* File R/W count */</span>
+ FATFS fs[2]; <span class="c">/* 論理ドライブのワーク・エリア(ファイル・システム・オブジェクト) */</span>
+ FIL fsrc, fdst; <span class="c">/* ファイル・オブジェクト */</span>
+ BYTE buffer[4096]; <span class="c">/* file copy buffer */</span>
+ FRESULT res; <span class="c">/* FatFs function common result code */</span>
+ UINT br, bw; <span class="c">/* File R/W count */</span>
- <span>/* ドライブ0,1にワーク・エリアを与える */</span>
+ <span class="c">/* ドライブ0,1にワーク・エリアを与える (常に成功する) */</span>
f_mount(0, &amp;fs[0]);
f_mount(1, &amp;fs[1]);
- <span>/* ドライブ1のソース・ファイルを開く */</span>
+ <span class="c">/* ドライブ1のソース・ファイルを開く */</span>
res = f_open(&amp;fsrc, "1:srcfile.dat", FA_OPEN_EXISTING | FA_READ);
if (res) die(res);
- <span>/* ドライブ0にデスティネーション・ファイルを作成する */</span>
+ <span class="c">/* ドライブ0にデスティネーション・ファイルを作成する */</span>
res = f_open(&amp;fdst, "0:dstfile.dat", FA_CREATE_ALWAYS | FA_WRITE);
if (res) die(res);
- <span>/* ソースからデスティネーションにコピーする */</span>
+ <span class="c">/* ソースからデスティネーションにコピーする */</span>
for (;;) {
- res = f_read(&amp;fsrc, buffer, sizeof(buffer), &amp;br);
- if (res || br == 0) break; <span>/* エラーかファイル終端 */</span>
+ res = f_read(&amp;fsrc, buffer, sizeof buffer, &amp;br);
+ if (res || br == 0) break; <span class="c">/* エラーかファイル終端 */</span>
res = f_write(&amp;fdst, buffer, br, &amp;bw);
- if (res || bw &lt; br) break; <span>/* エラーかディスク満杯 */</span>
+ if (res || bw &lt; br) break; <span class="c">/* エラーかディスク満杯 */</span>
}
- <span>/* 全てのファイルを閉じる */</span>
+ <span class="c">/* 全てのファイルを閉じる */</span>
f_close(&amp;fsrc);
f_close(&amp;fdst);
- <span>/* ワーク・エリアを開放する */</span>
+ <span class="c">/* ワーク・エリアを開放する */</span>
f_mount(0, NULL);
f_mount(1, NULL);
}
@@ -137,7 +127,7 @@ void main (void)
</div>
-<div class="para">
+<div class="para ref">
<h4>参照</h4>
<p><tt><a href="read.html">f_read</a>, <a href="write.html">f_write</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a>, <a href="sfatfs.html">FATFS</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/ja/opendir.html b/data/sysrom/fat/doc/ja/opendir.html
index fffe569..2a8f348 100644
--- a/data/sysrom/fat/doc/ja/opendir.html
+++ b/data/sysrom/fat/doc/ja/opendir.html
@@ -11,66 +11,59 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_opendir</h2>
<p>ディレクトリを開きます。</p>
<pre>
FRESULT f_opendir (
- DIR* <em>DirObject</em>, <span>/* ディレクトリ・ブジェクト構造体へのポインタ */</span>
- const TCHAR* <em>DirName</em> <span>/* ディレクトリ名へのポインタ */</span>
+ DIR* <span class="arg">dj</span>, <span class="c">/* [OUT] ディレクトリ・ブジェクト構造体へのポインタ */</span>
+ const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] ディレクトリ名へのポインタ */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>DirObject</dt>
+<dt>dj</dt>
<dd>初期化するディレクトリ・オブジェクト構造体へのポインタを指定します。</dd>
-<dt>DirName</dt>
-<dd>オープンするディレクトリへの<a href="filename.html">パス名</a>が入った<tt>'\0'</tt>で終わる文字列へのポインタを指定します。</dd>
+<dt>path</dt>
+<dd>オープンするディレクトリの<a href="filename.html">パス名</a>を示すヌル文字<tt>'\0'</tt>終端の文字列へのポインタを指定します。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>正常終了。</dd>
-<dt>FR_NO_PATH</dt>
-<dd>パスが見つからない。</dd>
-<dt>FR_INVALID_NAME</dt>
-<dd>パス名が不正。</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>論理ドライブ番号が不正。</dd>
-<dt>FR_NOT_READY</dt>
-<dd>メディアがセットされていないなど、物理ドライブが動作不能状態。</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>ディスク・エラーによる失敗。</dd>
-<dt>FR_INT_ERR</dt>
-<dd>不正なFAT構造または内部エラーによる失敗。</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>論理ドライブにワーク・エリアが与えられていない。</dd>
-<dt>FR_NO_FILESYSTEM</dt>
-<dd>有効なFATボリュームが見つからない。</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#np">FR_NO_PATH</a>,
+<a href="rc.html#in">FR_INVALID_NAME</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>,
+<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
-<p>ディレクトリを開きます。正常終了したら、<tt>DirObject</tt>構造体を使ってこのディレクトリの項目を順次読み出せます。<tt>DirObject</tt>構造体は使用後は任意の時点で破棄できます。</p>
+<p>ディレクトリを開きます。正常終了したら、作成された<tt>DIR</tt>構造体を使ってこのディレクトリの項目を順次読み出せます。作成されたディレクトリ・オブジェクトは、不要になったら任意の時点で破棄できます。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p><tt>_FS_MINIMIZE &lt;= 1</tt>のとき使用可能になります。</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>参照</h4>
<p><tt><a href="readdir.html">f_readdir</a>, <a href="sdir.html">DIR</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/ja/printf.html b/data/sysrom/fat/doc/ja/printf.html
index 2df2628..9cda44e 100644
--- a/data/sysrom/fat/doc/ja/printf.html
+++ b/data/sysrom/fat/doc/ja/printf.html
@@ -11,25 +11,25 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_printf</h2>
<p>ファイルに書式化文字列を書き込みます。</p>
<pre>
int f_printf (
- FIL* <em>FileObject</em>, <span>/* ファイル・オブジェクト */</span>
- const TCHAR* <em>Foramt</em>, <span>/* 書式制御文字列 */</span>
+ FIL* <span class="arg">fp</span>, <span class="c">/* [IN] ファイル・オブジェクト */</span>
+ const TCHAR* <span class="arg">fmt</span>, <span class="c">/* [IN] 書式制御文字列 */</span>
...
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>ファイル・オブジェクト構造体へのポインタを指定します。</dd>
-<dt>Format</dt>
-<dd>'\0'で終わる書式制御文字列を指すポインタを指定します。'\0'は書き込まれません。</dd>
+<dt>fmt</dt>
+<dd>ヌル文字<tt>'\0'</tt>終端の書式制御文字列を指すポインタを指定します。ヌル文字は書き込まれません。</dd>
<dt>...</dt>
<dd>オプションの引数。</dd>
@@ -37,44 +37,50 @@ int f_printf (
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<p>文字列が正常に書き込まれると書き込まれた文字数が返されます。ディスクが満杯またはその他エラーにより正常に書き込まれなかったときは関数は失敗し<tt>EOF (-1)</tt>が返されます。</p>
+<p>文字列が正常に書き込まれると、書き込まれた文字数が返されます。ディスクが満杯またはその他エラーにより正常に書き込まれなかったときは、関数は失敗し<tt>EOF (-1)</tt>が返されます。</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
-<p>この関数は<a href="putc.html">f_putc()</a>および<a href="puts.html">f_puts()</a>のラッパー関数です。書式制御機能はサブセットとなっていて、書式制御文字は次に示すものが使用可能です。</p>
+<p>この関数は、<a href="putc.html"><tt>f_putc()</tt></a>および<a href="puts.html"><tt>f_puts()</tt></a>のラッパー関数です。書式制御機能はサブセットとなっていて、書式制御文字は次に示すものが使用可能です。</p>
<ul>
<li>タイプ: <tt>c C s S d D u U x X b B</tt></li>
<li>精度指定: <tt>l L</tt></li>
-<li>フラグ: <tt>0</tt></li>
+<li>フラグ: <tt>0 -</tt></li>
</ul>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_USE_STRFUNC</tt>が 1または 2のとき使用可能になります。2の時は、出力に含まれる<tt>'\n'</tt>が<tt>"\r\n"</tt>に展開されてファイルに書き込まれます。</p>
<p>APIにUnicodeが選択されている(<tt>_LFN_UNICODE</tt>が1)ときは、UTF-8エンコードでファイルに書き込みます。それ以外の時は無変換(1文字1バイト)で書き込みます。</p>
</div>
-<div class="para">
+<div class="para use">
<h4>使用例</h4>
<pre>
- f_printf(&amp;fil, "%6d", -200); <span>/* " -200" */</span>
- f_printf(&amp;fil, "%02u", 5); <span>/* "05" */</span>
- f_printf(&amp;fil, "%ld", 12345678L); <span>/* "12345678" */</span>
- f_printf(&amp;fil, "%08lX", 1194684UL); <span>/* "00123ABC" */</span>
- f_printf(&amp;fil, "%s", "String"); <span>/* "String" */</span>
- f_printf(&amp;fil, "%c", 'a'); <span>/* "a" */</span>
+ f_printf(&amp;fil, "%d", 1234); <span class="c">/* "1234" */</span>
+ f_printf(&amp;fil, "%6d,%3d%%", -200, 5); <span class="c">/* " -200, 5%" */</span>
+ f_printf(&amp;fil, "%-6u", 100); <span class="c">/* "100 " */</span>
+ f_printf(&amp;fil, "%ld", 12345678L); <span class="c">/* "12345678" */</span>
+ f_printf(&amp;fil, "%04x", 0xA3); <span class="c">/* "00a3" */</span>
+ f_printf(&amp;fil, "%08LX", 0x123ABC); <span class="c">/* "00123ABC" */</span>
+ f_printf(&amp;fil, "%016b", 0x550F); <span class="c">/* "0101010100001111" */</span>
+ f_printf(&amp;fil, "%s", "String"); <span class="c">/* "String" */</span>
+ f_printf(&amp;fil, "%-4s", "abc"); <span class="c">/* "abc " */</span>
+ f_printf(&amp;fil, "%4s", "abc"); <span class="c">/* " abc" */</span>
+ f_printf(&amp;fil, "%c", 'a'); <span class="c">/* "a" */</span>
+ f_printf(&amp;fil, "%f", 10.0); <span class="c">/* 浮動小数点は未サポート */</span>
</pre>
</div>
-<div class="para">
+<div class="para ref">
<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="putc.html">f_putc</a>, <a href="puts.html">f_puts</a>, <a href="gets.html">f_gets</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/ja/putc.html b/data/sysrom/fat/doc/ja/putc.html
index 956723e..ddf4e3d 100644
--- a/data/sysrom/fat/doc/ja/putc.html
+++ b/data/sysrom/fat/doc/ja/putc.html
@@ -11,48 +11,48 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_putc</h2>
<p>ファイルに文字を書き込みます。</p>
<pre>
int f_putc (
- TCHAR <em>Chr</em>, <span>/* 書き込む文字 */</span>
- FIL* <em>FileObject</em> <span>/* ファイル・オブジェクト */</span>
+ TCHAR <span class="arg">chr</span>, <span class="c">/* [IN] 書き込む文字 */</span>
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] ファイル・オブジェクト */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>Chr</dt>
+<dt>chr</dt>
<dd>書き込む文字を指定します。</dd>
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>ファイル・オブジェクト構造体へのポインタを指定します。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<p>文字が正常に書き込まれると書き込んだ文字が返されます。ディスクが満杯またはエラーにより書き込まれなかったときは<tt>EOF (-1)</tt>が返されます。</p>
+<p>文字が正常に書き込まれると書き込んだ文字数(1)が返されます。ディスクが満杯またはエラーにより書き込まれなかったときは<tt>EOF (-1)</tt>が返されます。</p>
<p>APIにUnicodeが選択されている(<tt>_LFN_UNICODE</tt>が1)ときは、UTF-8エンコードでファイルに書き込みます。それ以外の時は無変換(1文字1バイト)で書き込みます。</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
-<p>1文字をファイルに書き込みます。この関数は<a href="write.html">f_write()</a>のラッパー関数です。</p>
+<p>1文字をファイルに書き込みます。この関数は<a href="write.html"><tt>f_write()</tt></a>のラッパー関数です。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_USE_STRFUNC</tt>が 1または 2のとき使用可能です。2を指定すると、<tt>'\n'</tt>は<tt>"\r\n"</tt>に展開されてファイルに書き込まれます。</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="puts.html">f_puts</a>, <a href="printf.html">f_printf</a>, <a href="gets.html">f_gets</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/ja/puts.html b/data/sysrom/fat/doc/ja/puts.html
index b2fe474..ab661d3 100644
--- a/data/sysrom/fat/doc/ja/puts.html
+++ b/data/sysrom/fat/doc/ja/puts.html
@@ -11,48 +11,48 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_puts</h2>
<p>ファイルに文字列を書き込みます。</p>
<pre>
int f_puts (
- const TCHAR* <em>Str</em>, <span>/* 文字列 */</span>
- FIL* <em>FileObject</em> <span>/* ファイル・オブジェクト */</span>
+ const TCHAR* <span class="arg">str</span>, <span class="c">/* [IN] 書き込む文字列 */</span>
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] ファイル・オブジェクト */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>Str</dt>
-<dd>書き込む'\0'で終わる文字列を指すポインタを指定します。'\0'は書き込まれません。</dd>
-<dt>FileObject</dt>
+<dt>str</dt>
+<dd>書き込むヌル文字<tt>'\0'</tt>終端の文字列を指すポインタを指定します。ヌル文字は書き込まれません。</dd>
+<dt>fp</dt>
<dd>ファイル・オブジェクト構造体へのポインタを指定します。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<p>文字列が正常に書き込まれると、書き込まれた文字数が返されます。ディスクが満杯またはエラーにより正常に書き込まれなかったときは<tt>EOF (-1)</tt>が返されます。</p>
+<p>文字列が正常に書き込まれると、書き込まれた文字数が返されます。ディスクが満杯またはエラーにより書き込みが中断されたときは<tt>EOF (-1)</tt>が返されます。</p>
<p>APIにUnicodeが選択されている(<tt>_LFN_UNICODE</tt>が1)ときは、UTF-8エンコードでファイルに書き込みます。それ以外の時は無変換(1文字1バイト)で書き込みます。</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
-<p>文字列をファイルに書き込みます。この関数は<a href="putc.html">f_putc()</a>のラッパー関数です。</p>
+<p>文字列をファイルに書き込みます。この関数は<a href="putc.html"><tt>f_putc()</tt></a>のラッパー関数です。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_USE_STRFUNC</tt>が 1または 2のとき使用可能です。2を指定すると、文字列に含まれる<tt>'\n'</tt>は<tt>"\r\n"</tt>に展開されてファイルに書き込まれます。</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="putc.html">f_putc</a>, <a href="printf.html">f_printf</a>, <a href="gets.html">f_gets</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/ja/rc.html b/data/sysrom/fat/doc/ja/rc.html
new file mode 100644
index 0000000..64386f4
--- /dev/null
+++ b/data/sysrom/fat/doc/ja/rc.html
@@ -0,0 +1,86 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="ja">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="FatFs" href="../00index_j.html">
+<link rel="alternate" hreflang="en" title="English" href="../en/rc.html">
+<link rel="stylesheet" href="../css_j.css" type="text/css" media="screen" title="ELM Default">
+<title>FatFs - 謌サ繧雁、</title>
+</head>
+
+<body>
+<h1>繝輔ぃ繧、繝ォ髢「謨ー縺ョ謌サ繧雁、</h1>
+<p>FatFs縺ョAPI縺ァ縺ッ縲∽ク驛ィ縺ョ髢「謨ー繧帝勁縺咲オ先棡縺ォ蠢懊§縺溷ア騾壹ョ繝ェ繧カ繝ォ繝医サ繧ウ繝シ繝(FRESULT蝙(enum))繧定ソ斐@縺セ縺吶る未謨ー縺梧仙粥縺励◆蝣エ蜷医ッ0繧定ソ斐@縺セ縺吶ょ、ア謨励@縺溷エ蜷医ッ0莉・螟悶ョ蛟、繧定ソ斐@縲∝、縺ッ繧ィ繝ゥ繝シ縺ョ遞ョ鬘槭r遉コ縺励∪縺吶</p>
+
+<dl class="ret">
+<dt id="ok">FR_OK (0)</dt>
+<dd>髢「謨ー縺ッ謌仙粥縺励◆縲</dd>
+<dt id="de">FR_DISK_ERR</dt>
+<dd>荳倶ス阪Ξ繧、繝、(繝繧」繧ケ繧ッI/O髢「謨ー)縺ァ蝗槫セゥ荳崎ス縺ェ繧ィ繝ゥ繝シ縺檎匱逕溘@縺溘</dd>
+<dt id="ie">FR_INT_ERR</dt>
+<dd>蜀驛ィ蜃ヲ逅縺ョ蛛・蜈ィ諤ァ縺ォ逡ー蟶ク縺梧、懷コ縺輔l縺溘ょ次蝗縺ィ縺励※縺ッ谺。縺ョ繧医≧縺ェ縺薙→縺瑚縺医i繧後∪縺吶
+<ul>
+<li>繝懊Μ繝・繝シ繝荳翫ョFAT讒矩縺ォ繧ィ繝ゥ繝シ縺後≠繧九</li>
+<li>繧ケ繧ソ繝繧ッ荳崎カウ繧莉悶ョ繧ソ繧ケ繧ッ遲峨↓繧医k繝ッ繝シ繧ッ繝サ繧ィ繝ェ繧「(繝輔ぃ繧、繝ォ繝サ繧キ繧ケ繝繝繝サ繧ェ繝悶ず繧ァ繧ッ繝医d繝輔ぃ繧、繝ォ繝サ繧ェ繝悶ず繧ァ繧ッ繝)縺ョ遐エ螢翫ょ、壹¥縺ッ縺薙l縺悟次蝗縲</li>
+<li>縺昴ョ繝輔ぃ繧、繝ォ繧ェ繝悶ず繧ァ繧ッ繝医〒縺ッ驕主悉縺ォ<tt>FR_DISK_ERR</tt>縺檎匱逕溘@縺ヲ縺繧九</li>
+</ul>
+</dd>
+<dt id="nr">FR_NOT_READY</dt>
+<dd>迚ゥ逅繝峨Λ繧、繝悶′蜍穂ス懷庄閭ス縺ェ迥カ諷九↓縺ェ縺縲ゅ∪縺溘ッ縲√ラ繝ゥ繧、繝悶ョ蛻晄悄蛹悶↓螟ア謨励@縺溘</dd>
+<dt id="nf">FR_NO_FILE</dt>
+<dd>謖螳壹&繧後◆繝輔ぃ繧、繝ォ縺瑚ヲ九▽縺九i縺ェ縺九▲縺溘</dd>
+<dt id="np">FR_NO_PATH</dt>
+<dd>謖螳壹&繧後◆繝代せ縺瑚ヲ九▽縺九i縺ェ縺九▲縺溘</dd>
+<dt id="in">FR_INVALID_NAME</dt>
+<dd>謖螳壹&繧後◆譁蟄怜励′<a href="filename.html">繝代せ蜷阪ョ繝輔か繝シ繝槭ャ繝</a>縺ィ縺励※辟。蜉ケ縲</dd>
+<dt id="dn">FR_DENIED</dt>
+<dd>縺昴ョ繧ェ繝悶ず繧ァ繧ッ繝医↓蟇セ縺吶k謫堺ス懊ョ諡貞凄縲ょ次蝗縺ィ縺励※縺ッ谺。縺ョ繧医≧縺ェ縺薙→縺瑚縺医i繧後∪縺吶
+<ul>
+<li>譖ク縺崎セシ縺ソ遖∵ュ「螻樊ァ(<tt>AM_RDO</tt>)繧呈戟縺、繝輔ぃ繧、繝ォ繧呈嶌縺崎セシ縺ソ繝「繝シ繝峨〒髢九%縺縺ィ縺励◆縲</li>
+<li>譖ク縺崎セシ縺ソ遖∵ュ「螻樊ァ繧呈戟縺、繝輔ぃ繧、繝ォ繧繝繧」繝ャ繧ッ繝医Μ繧貞炎髯、縺励h縺縺ィ縺励◆縲</li>
+<li>遨コ縺ァ縺ェ縺繝繧」繝ャ繧ッ繝医Μ縺セ縺溘ッ繧ォ繝ャ繝ウ繝医サ繝繧」繝ャ繧ッ繝医Μ繧貞炎髯、縺励h縺縺ィ縺励◆縲</li>
+<li><tt>FA_READ</tt>繧剃サ倥¢縺壹↓髢九>縺溘ヵ繧。繧、繝ォ縺ォ蟇セ縺励※隱ュ縺ソ蜃コ縺励r陦後▲縺溘</li>
+<li><tt>FA_WRITE</tt>繧剃サ倥¢縺壹↓髢九>縺溘ヵ繧。繧、繝ォ縺ォ蟇セ縺励※螟画峩謫堺ス懊r陦後▲縺溘</li>
+<li>繝繧」繝ャ繧ッ繝医Μ繝サ繝繝シ繝悶Ν縺梧コ譚ッ縺ァ繝輔ぃ繧、繝ォ繧繝繧」繝ャ繧ッ繝医Μ繧剃ス懈舌〒縺阪↑縺九▲縺溘</li>
+<li>繝懊Μ繝・繝シ繝縺梧コ譚ッ縺ァ繝繧」繝ャ繧ッ繝医Μ繧剃ス懈舌〒縺阪↑縺九▲縺溘</li>
+</ul>
+</dd>
+<dt id="ex">FR_EXIST</dt>
+<dd>譁ー縺励¥菴懈舌@繧医≧縺ィ縺励◆繧ェ繝悶ず繧ァ繧ッ繝医→蜷後§蜷榊燕縺ョ繧ェ繝悶ず繧ァ繧ッ繝医′譌「縺ォ蟄伜惠縺吶k縲</dd>
+<dt id="io">FR_INVALID_OBJECT</dt>
+<dd>謖螳壹&繧後◆繝輔ぃ繧、繝ォ繝サ繧ェ繝悶ず繧ァ繧ッ繝医d繝繧」繝ャ繧ッ繝医Μ繝サ繧ェ繝悶ず繧ァ繧ッ繝医′辟。蜉ケ縲ゅが繝シ繝励Φ縺輔l縺ヲ縺縺ェ縺縲∵里縺ォ髢峨§繧峨l縺ヲ縺繧九∽ス輔i縺九ョ蜴溷屏縺ァ遐エ螢翫&繧後※縺繧九√↑縺ゥ縲</dd>
+<dt id="wp">FR_WRITE_PROTECTED</dt>
+<dd>迚ゥ逅繝峨Λ繧、繝悶′譖ク縺崎セシ縺ソ遖∵ュ「迥カ諷九ョ縺ィ縺阪∵嶌縺崎セシ縺ソ繧剃シエ縺謫堺ス懊r陦後♀縺縺ィ縺励◆縲</dd>
+<dt id="id">FR_INVALID_DRIVE</dt>
+<dd>謖螳壹&繧後◆繝峨Λ繧、繝也分蜿キ縺檎┌蜉ケ縲(髢「騾」繧ェ繝励す繝ァ繝ウ: <tt>_VOLUMES</tt>)</dd>
+<dt id="ne">FR_NOT_ENABLED</dt>
+<dd>縺昴ョ繝懊Μ繝・繝シ繝縺ョ謫堺ス懊↓蠢隕√↑繝ッ繝シ繧ッ繝サ繧ィ繝ェ繧「(繝輔ぃ繧、繝ォ繝サ繧キ繧ケ繝繝繝サ繧ェ繝悶ず繧ァ繧ッ繝域ァ矩菴)縺御ク弱∴繧峨l縺ヲ縺縺ェ縺縲</dd>
+<dt id="ns">FR_NO_FILESYSTEM</dt>
+<dd>迚ゥ逅繝峨Λ繧、繝紋ク翫↓譛牙柑縺ェFAT繝懊Μ繝・繝シ繝縺瑚ヲ九▽縺九i縺ェ縺九▲縺溘</dd>
+<dt id="ma">FR_MKFS_ABORTED</dt>
+<dd><tt>f_mkfs()</tt>縺ョ蜃ヲ逅縺碁幕蟋句燕縺ォ荳ュ譁ュ縺輔l縺溘ょ次蝗縺ィ縺励※縺ッ谺。縺ョ繧医≧縺ェ縺薙→縺瑚縺医i繧後∪縺吶
+<ul>
+<li>繝懊Μ繝・繝シ繝縺悟ー上&縺吶℃繧九</li>
+<li>FAT繧ソ繧、繝励ョ險育ョ励↓遏帷崟縺瑚ヲ九▽縺九▲縺溘ゅけ繝ゥ繧ケ繧ソ謨ー縺熊AT繧ソ繧、繝励ョ蠅逡御サ倩ソ代↓縺ェ繧九→縺阪↓逋コ逕溘☆繧句エ蜷医′縺ゅj縺セ縺吶</li>
+</ul>
+</dd>
+<dt id="tm">FR_TIMEOUT</dt>
+<dd><a href="appnote.html#reentrant">蜀榊・蛻カ蠕。</a>縺ォ繧医k蠕縺。譎る俣縺悟ョ夂セゥ縺輔l縺滓凾髢薙r雜翫∴縺溘◆繧√髢「謨ー縺ッ螳溯。後&繧後↑縺九▲縺溘(髢「騾」繧ェ繝励す繝ァ繝ウ: <tt>_TIMEOUT</tt>)</dd>
+<dt id="lo">FR_LOCKED</dt>
+<dd><a href="appnote.html#dup">螟夐阪い繧ッ繧サ繧ケ謗剃サ匁ゥ溯ス</a>縺ォ繧医j縲√◎縺ョ繝輔ぃ繧、繝ォ縺ォ蟇セ縺励※陦後♀縺縺ィ縺励◆繧「繧ッ繧サ繧ケ縺梧拠蜷ヲ縺輔l縺溘(髢「騾」繧ェ繝励す繝ァ繝ウ: <tt>_FS_LOCK</tt>)</dd>
+<dt id="nc">FR_NOT_ENOUGH_CORE</dt>
+<dd>繝。繝「繝ェ荳崎カウ縺ォ繧医k螟ア謨励ょ次蝗縺ィ縺励※縺ッ谺。縺ョ繧医≧縺ェ縺薙→縺瑚縺医i繧後∪縺吶
+<ul>
+<li>LFN謫堺ス懊ヰ繝繝輔ぃ縺ョ蜍慕噪遒コ菫昴↓螟ア謨励@縺溘(髢「騾」繧ェ繝励す繝ァ繝ウ: <tt>_USE_LFN</tt>)</li>
+<li>荳弱∴繧峨l縺滄榊励ョ繧オ繧、繧コ縺悟ョ滄圀縺ォ蠢隕√↑繧オ繧、繧コ縺ォ蟇セ縺励※荳崎カウ縺励※縺繧九</li>
+</ul>
+</dd>
+<dt id="tf">FR_TOO_MANY_OPEN_FILES</dt>
+<dd>蜷梧凾繧ェ繝シ繝励Φ蜿ッ閭ス縺ェ繝輔ぃ繧、繝ォ謨ー繧定カ翫∴縺ヲ繝輔ぃ繧、繝ォ繧帝幕縺薙≧縺ィ縺励◆縲(髢「騾」繧ェ繝励す繝ァ繝ウ: <tt>_FS_LOCK</tt>)</dd>
+<dt id="ip">FR_INVALID_PARAMETER</dt>
+<dd>荳弱∴繧峨l縺溘ヱ繝ゥ繝。繝シ繧ソ縺檎┌蜉ケ縺セ縺溘ッ遏帷崟縺励※縺繧九</dd>
+</dl>
+
+</body>
+</html>
diff --git a/data/sysrom/fat/doc/ja/read.html b/data/sysrom/fat/doc/ja/read.html
index fb344cc..04ef8b3 100644
--- a/data/sysrom/fat/doc/ja/read.html
+++ b/data/sysrom/fat/doc/ja/read.html
@@ -11,66 +11,61 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_read</h2>
<p>ファイルからデータを読み出します。</p>
<pre>
FRESULT f_read (
- FIL* <em>FileObject</em>, <span>/* ファイル・オブジェクト構造体 */</span>
- void* <em>Buffer</em>, <span>/* 読み出したデータを格納するバッファ */</span>
- UINT <em>ByteToRead</em>, <span>/* 読み出すバイト数 */</span>
- UINT* <em>ByteRead</em> <span>/* 読み出されたバイト数 */</span>
+ FIL* <span class="arg">fp</span>, <span class="c">/* [IN] ファイル・オブジェクト構造体 */</span>
+ void* <span class="arg">buff</span>, <span class="c">/* [OUT] 読み出したデータを格納するバッファ */</span>
+ UINT <span class="arg">btr</span>, <span class="c">/* [IN] 読み出すバイト数 */</span>
+ UINT* <span class="arg">br</span> <span class="c">/* [OUT] 読み出されたバイト数 */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>ファイル・オブジェクト構造体へのポインタを指定します。</dd>
-<dt>Buffer</dt>
+<dt>buff</dt>
<dd>読み出したデータを格納するバッファを指すポインタを指定します。</dd>
-<dt>ByteToRead</dt>
-<dd>読み出すバイト数(0〜UINTの最大値)を指定します。</dd>
-<dt>ByteRead</dt>
+<dt>btr</dt>
+<dd>読み出すバイト数(0〜<tt>UINT</tt>型の最大値)を指定します。</dd>
+<dt>br</dt>
<dd>実際に読み出されたバイト数を格納する変数を指すポインタを指定します。戻り値は関数の成否にかかわらず常に有効です。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>正常終了。</dd>
-<dt>FR_DENIED</dt>
-<dd>非読み込みモードで開いたファイルから読み込もうとした。</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>ディスク・エラーによる失敗。</dd>
-<dt>FR_INT_ERR</dt>
-<dd>不正なFAT構造または内部エラーによる失敗。</dd>
-<dt>FR_NOT_READY</dt>
-<dd>メディアがセットされていないなど、物理ドライブが動作不能状態。</dd>
-<dt>FR_INVALID_OBJECT</dt>
-<dd>無効なファイル・オブジェクト。</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#de">FR_DENIED</a>,
+<a href="rc.html#io">FR_INVALID_OBJECT</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
-<p>読み込み開始位置は、現在のリード/ライト・ポインタからになります。リード/ライト・ポインタは読み込まれたバイト数だけ進みます。関数が正常終了した後は、<tt>*ByteRead</tt>の値をチェックすべきです。<tt>*ByteRead</tt>が<tt>ByteToRead</tt>よりも小さいときは、読み込み中にファイルの終端に達したことを示しています。</p>
+<p>読み込み開始位置は、現在のリード/ライト・ポインタからになります。リード/ライト・ポインタは読み込まれたバイト数だけ進みます。関数が正常終了した後は、<tt class="arg">*br</tt>の値をチェックすべきです。<tt class="arg">*br</tt>が<tt class="arg">btr</tt>よりも小さいときは、読み込み中にファイルの終端に達したことを示しています。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p>全ての構成で使用可能です。</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="gets.html">fgets</a>, <a href="write.html">f_write</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/ja/readdir.html b/data/sysrom/fat/doc/ja/readdir.html
index be5cdbe..48966a1 100644
--- a/data/sysrom/fat/doc/ja/readdir.html
+++ b/data/sysrom/fat/doc/ja/readdir.html
@@ -11,99 +11,98 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_readdir</h2>
<p>ディレクトリ項目を読み出します</p>
<pre>
FRESULT f_readdir (
- DIR* <em>DirObject</em>, <span>/* ディレクトリ・ブジェクト構造体へのポインタ */</span>
- FILINFO* <em>FileInfo</em> <span>/* ファイル情報構造体へのポインタ */</span>
+ DIR* <span class="arg">dj</span>, <span class="c">/* [IN] ディレクトリ・ブジェクト構造体へのポインタ */</span>
+ FILINFO* <span class="arg">fno</span> <span class="c">/* [OUT] ファイル情報構造体へのポインタ */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>DirObject</dt>
+<dt>dj</dt>
<dd>有効なディレクトリ・オブジェクト構造体へのポインタを指定します。</dd>
-<dt>FileInfo</dt>
+<dt>fno</dt>
<dd>読み出したディレクトリ項目を格納するファイル情報構造体へのポインタを指定します。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>正常終了。</dd>
-<dt>FR_NOT_READY</dt>
-<dd>メディアがセットされていないなど、物理ドライブが動作不能状態。</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>ディスク・エラーによる失敗。</dd>
-<dt>FR_INT_ERR</dt>
-<dd>不正なFAT構造または内部エラーによる失敗。</dd>
-<dt>FR_INVALID_OBJECT</dt>
-<dd>無効なディレクトリ・オブジェクト。</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#io">FR_INVALID_OBJECT</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>,
+<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
-<p>ディレクトリ項目を順次読み出します。この関数を繰り返し実行することによりディレクトリの全ての項目を読み出すことができます。全ての項目を読み出し、読み出す項目がもう無いときは、<tt>f_name[]</tt>メンバにヌル文字列が返されます。ボリューム・ラベルは読み出すときに棄てられ、現れることはありません。"."、".."は、相対パスが有効なとき(<tt>_FS_RPATH == 1</tt>)にのみ現れます。得られるファイル情報の詳細については <tt>FILINFO</tt>構造体を参照してください。FileInfoにヌル・ポインタを指定すると、そのディレクトリのリード・インデックスを巻き戻します。</p>
-<p>LFN機能が有効な時は、f_readdir関数の呼び出しに先立ってFILINFO構造体の<tt>lfname</tt>と<tt>lfsize</tt>が有効な値で初期化されていなければなりません。<tt>lfname</tt>はLFNを格納するバッファで、<tt>lfsize</tt>はそのバッファ・サイズ(文字数)です。次の条件に一つでも該当する場合は、LFN格納バッファにヌル文字列が返されます。</p>
+<p>ディレクトリの項目(ファイルとディレクトリ)を順次読み出します。この関数を繰り返し実行することによりそのディレクトリの全ての項目を読み出すことができます。全ての項目を読み出し、読み出す項目がもう無いときは、<tt>fname[]</tt>メンバにヌル文字列が返されます。ドット・エントリ("."、"..")は、相対パスが有効なとき(<tt>_FS_RPATH == 1</tt>)にのみ現れます。得られるファイル情報の詳細については <tt>FILINFO</tt>構造体を参照してください。<tt class="arg">fno</tt>にヌル・ポインタを指定すると、そのディレクトリのリード・インデックスを巻き戻します。</p>
+<p>LFN機能が有効な時は、<tt>f_readdir()</tt>関数の呼び出しに先立って<tt>FILINFO</tt>構造体の<tt>lfname</tt>と<tt>lfsize</tt>が有効な値で初期化されていなければなりません。<tt>lfname</tt>はLFNを格納するバッファで、<tt>lfsize</tt>はそのバッファの要素数です。次の条件に一つでも該当する場合は、LFN格納バッファにヌル文字列が返されます。</p>
<ul>
<li>そのディレクトリ項目にLFNが存在しない。</li>
<li>LFNの長さに対してLFN格納バッファまたはLFN操作バッファのサイズが不十分。</li>
-<li>LFNにOEMコードに存在しない文字が含まれている。(Unicode APIではないとき)</li>
+<li>LFNに現在のOEMコードに存在しない文字が含まれている。(Unicode APIではないとき)</li>
</ul>
-<p>また、<tt>lfname</tt>にヌル・ポインタを指定した場合は、LFNに関して何も返されません。LFNが存在しないときは、<tt>f_name[]</tt>メンバのSFNにASCII英小文字が含まれる場合があります。</p>
+<p>また、<tt>lfname</tt>にヌル・ポインタを指定した場合は、LFNに関して何も返されません。LFNが存在しないときは、<tt>fname[]</tt>メンバのSFNにASCII英小文字が含まれる場合があります。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p><tt>_FS_MINIMIZE &lt;= 1</tt>のときに使用可能です。</p>
</div>
-<div class="para">
+<div class="para use">
<h4>使用例</h4>
<pre>
-FRESULT scan_files (char* path)
+FRESULT scan_files (
+ char* path <span class="c">/* 開始ノード (ワークエリアとしても使用) */</span>
+)
{
FRESULT res;
FILINFO fno;
DIR dir;
int i;
- char *fn;
-#if _USE_LFN
- static char lfn[_MAX_LFN * (_DF1S ? 2 : 1) + 1];
+ char *fn; <span class="c">/* 非Unicode構成を想定 */</span>
+<span class="k">#if</span> _USE_LFN
+ static char lfn[_MAX_LFN + 1];
fno.lfname = lfn;
- fno.lfsize = sizeof(lfn);
-#endif
+ fno.lfsize = sizeof lfn;
+<span class="k">#endif</span>
- res = f_opendir(&amp;dir, path);
+ res = f_opendir(&amp;dir, path); <span class="c">/* ディレクトリを開く */</span>
if (res == FR_OK) {
i = strlen(path);
for (;;) {
- res = f_readdir(&amp;dir, &amp;fno);
- if (res != FR_OK || fno.fname[0] == 0) break;
- if (fno.fname[0] == '.') continue;
-#if _USE_LFN
+ res = f_readdir(&amp;dir, &amp;fno); <span class="c">/* ディレクトリ項目を1個読み出す */</span>
+ if (res != FR_OK || fno.fname[0] == 0) break; <span class="c">/* エラーまたは項目無しのときは抜ける */</span>
+ if (fno.fname[0] == '.') continue; <span class="c">/* ドットエントリは無視 */</span>
+<span class="k">#if</span> _USE_LFN
fn = *fno.lfname ? fno.lfname : fno.fname;
-#else
+<span class="k">#else</span>
fn = fno.fname;
-#endif
- if (fno.fattrib &amp; AM_DIR) {
+<span class="k">#endif</span>
+ if (fno.fattrib &amp; AM_DIR) { <span class="c">/* ディレクトリ */</span>
sprintf(&amp;path[i], "/%s", fn);
res = scan_files(path);
if (res != FR_OK) break;
path[i] = 0;
- } else {
+ } else { <span class="c">/* ファイル */</span>
printf("%s/%s\n", path, fn);
}
}
@@ -115,7 +114,7 @@ FRESULT scan_files (char* path)
</div>
-<div class="para">
+<div class="para ref">
<h4>参照</h4>
<p><tt><a href="opendir.html">f_opendir</a>, <a href="stat.html">f_stat</a>, <a href="sfileinfo.html">FILINFO</a>, <a href="sdir.html">DIR</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/ja/rename.html b/data/sysrom/fat/doc/ja/rename.html
index a98bafb..62a9826 100644
--- a/data/sysrom/fat/doc/ja/rename.html
+++ b/data/sysrom/fat/doc/ja/rename.html
@@ -11,80 +11,68 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_rename</h2>
-<p>ファイルまたはディレクトリの名前の変更または移動。</p>
+<p>オブジェクトの名前の変更または移動。</p>
<pre>
FRESULT f_rename (
- const TCHAR* <em>OldName</em>, <span>/* 古いファイルまたはディレクトリ名 */</span>
- const TCHAR* <em>NewName</em> <span>/* 新しいファイルまたはディレクトリ名 */</span>
+ const TCHAR* <span class="arg">old_name</span>, <span class="c">/* [IN] 古いオブジェクト名 */</span>
+ const TCHAR* <span class="arg">new_name</span> <span class="c">/* [IN] 新しいオブジェクト名 */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>OldName</dt>
-<dd>変更対象のオブジェクト(ファイルまたはディレクトリ)への<a href="filename.html">パス名</a>の入った<tt>'\0'</tt>で終わる文字列へのポインタを指定します。</dd>
-<dt>NewName</dt>
-<dd>新しいファイルまたはディレクトリのフルパス名の入った<tt>'\0'</tt>で終わる文字列へのポインタを指定します。既に存在する名前は使えません。また、ドライブ番号は指定できず、<tt>OldName</tt>で指定された論理ドライブ上のオブジェクトとして扱われます。<br>
+<dt>old_name</dt>
+<dd>変更対象のオブジェクト(ファイルまたはディレクトリ)の<a href="filename.html">パス名</a>を示すヌル文字<tt>'\0'</tt>終端の文字列へのポインタを指定します。</dd>
+<dt>new_name</dt>
+<dd>新しいオブジェクトのパス名を示すヌル文字<tt>'\0'</tt>終端の文字列へのポインタを指定します。既に存在する名前は使えません。また、ドライブ番号は指定できず、<tt class="arg">old_name</tt>で指定された論理ドライブ上のオブジェクトとして扱われます。<br>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>正常終了。</dd>
-<dt>FR_NO_FILE</dt>
-<dd>OldNameのオブジェクトが見つからない。</dd>
-<dt>FR_NO_PATH</dt>
-<dd>パスが見つからない。</dd>
-<dt>FR_INVALID_NAME</dt>
-<dd>パス名が不正。</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>ドライブ番号が不正。</dd>
-<dt>FR_DENIED</dt>
-<dd>ドライブ容量の不足等の理由で新しい名前のオブジェクトが作れない。</dd>
-<dt>FR_EXIST</dt>
-<dd>NewNameと同じ名前が既に存在する。</dd>
-<dt>FR_NOT_READY</dt>
-<dd>メディアがセットされていないなど、物理ドライブが動作不能状態。</dd>
-<dt>FR_WRITE_PROTECTED</dt>
-<dd>メディアが書き込み禁止状態。</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>ディスク・エラーによる失敗。</dd>
-<dt>FR_INT_ERR</dt>
-<dd>不正なFAT構造または内部エラーによる失敗。</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>論理ドライブにワークエリアが割り当てられていない。</dd>
-<dt>FR_NO_FILESYSTEM</dt>
-<dd>有効なFATボリュームが見つからない。</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#ok">FR_NO_FILE</a>,
+<a href="rc.html#np">FR_NO_PATH</a>,
+<a href="rc.html#in">FR_INVALID_NAME</a>,
+<a href="rc.html#ex">FR_EXIST</a>,
+<a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>,
+<a href="rc.html#lo">FR_LOCKED</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
-<p>オブジェクトの名前を変更します。また、別のディレクトリへの移動(同じドライブ内のみ)も可能です。<em>開かれているオブジェクトに対して使用してはなりません</em>。</p>
+<p>オブジェクトの名前を変更します。また、同時に別のディレクトリへの移動も可能です。<em>開かれているオブジェクトに対して使用してはなりません</em>。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_FS_MINIMIZE == 0</tt>のときに使用可能です。</p>
</div>
-<div class="para">
+<div class="para use">
<h4>使用例</h4>
<pre>
- <span>/* ファイルまたはサブディレクトリの名前を変更する */</span>
+ <span class="c">/* ファイルまたはサブディレクトリの名前を変更する */</span>
f_rename("oldname.txt", "newname.txt");
- <span>/* ファイルまたはサブディレクトリの名前の変更と別のディレクトリへの移動 */</span>
+ <span class="c">/* ファイルまたはサブディレクトリの名前の変更と別のディレクトリへの移動 */</span>
f_rename("oldname.txt", "dir1/newname.txt");
</pre>
</div>
diff --git a/data/sysrom/fat/doc/ja/sdir.html b/data/sysrom/fat/doc/ja/sdir.html
index 86c5430..051fa57 100644
--- a/data/sysrom/fat/doc/ja/sdir.html
+++ b/data/sysrom/fat/doc/ja/sdir.html
@@ -13,21 +13,21 @@
<div class="para">
<h2>DIR</h2>
-<p><tt>DIR</tt>構造体は、f_opendir(), f_readdir()のワーク・エリアとして使用されます。アプリケーションから変更可能なメンバはありません。</p>
+<p><tt>DIR</tt>構造体は、<tt>f_opendir(), f_readdir()</tt>のワーク・エリアとして使用されます。アプリケーションは、この構造体のメンバを書き換えてはなりません。</p>
<pre>
-typedef struct {
- FATFS* fs; <span>/* 親ファイル・システム・オブジェクトへのポインタ */</span>
- WORD id; <span>/* 親ファイル・システム・オブジェクトのマウントID */</span>
- WORD index; <span>/* 次に読み出すディレクトリ・インデックス番号 */</span>
- DWORD sclust; <span>/* ディレクトリ開始クラスタ (0:ルート) */</span>
- DWORD clust; <span>/* 現在のクラスタ番号 */</span>
- DWORD sect; <span>/* 現在のセクタ番号 */</span>
- BYTE* dir; <span>/* 現在のSFNエントリへのポインタ */</span>
- BYTE* fn; <span>/* SFNバッファへのポインタ (in/out) {file[8],ext[3],status[1]} */</span>
-#if _USE_LFN
- WCHAR* lfn; <span>/* LFNバッファへのポインタ */</span>
- WORD lfn_idx; <span>/* 最後にマッチしたLFNエントリのインデックス (0xFFFF:無効) */</span>
-#endif
+<span class="k">typedef</span> <span class="k">struct</span> {
+ FATFS* fs; <span class="c">/* 親ファイル・システム・オブジェクトへのポインタ */</span>
+ WORD id; <span class="c">/* 親ファイル・システム・オブジェクトのマウントID */</span>
+ WORD index; <span class="c">/* 次に読み出すディレクトリ・インデックス番号 */</span>
+ DWORD sclust; <span class="c">/* ディレクトリ開始クラスタ (0:ルート) */</span>
+ DWORD clust; <span class="c">/* 現在のクラスタ番号 */</span>
+ DWORD sect; <span class="c">/* 現在のセクタ番号 */</span>
+ BYTE* dir; <span class="c">/* 現在のSFNエントリへのポインタ */</span>
+ BYTE* fn; <span class="c">/* SFNバッファへのポインタ (in/out) {file[8],ext[3],status[1]} */</span>
+<span class="k">#if</span> _USE_LFN
+ WCHAR* lfn; <span class="c">/* LFNバッファへのポインタ */</span>
+ WORD lfn_idx; <span class="c">/* 最後にマッチしたLFNエントリのインデックス (0xFFFF:無効) */</span>
+<span class="k">#endif</span>
} DIR;
</pre>
</div>
diff --git a/data/sysrom/fat/doc/ja/setlabel.html b/data/sysrom/fat/doc/ja/setlabel.html
new file mode 100644
index 0000000..9756037
--- /dev/null
+++ b/data/sysrom/fat/doc/ja/setlabel.html
@@ -0,0 +1,89 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="ja">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="FatFs" href="../00index_j.html">
+<link rel="alternate" hreflang="en" title="English" href="../en/setlabel.html">
+<link rel="stylesheet" href="../css_j.css" type="text/css" media="screen" title="ELM Default">
+<title>FatFs - f_setlabel</title>
+</head>
+
+<body>
+
+<div class="para func">
+<h2>f_setlabel</h2>
+<p>ボリューム・ラベルを書き込みます。</p>
+<pre>
+FRESULT f_setlabel (
+ const TCHAR* <span class="arg">name</span> <span class="c">/* [IN] 設定するボリューム名へのポインタ */</span>
+);
+</pre>
+</div>
+
+<div class="para arg">
+<h4>引数</h4>
+<dl class="par">
+<dt>name</dt>
+<dd>設定するボリューム名を示すヌル文字<tt>'\0'</tt>終端の文字列へのポインタを指定します。</dd>
+</dl>
+</div>
+
+
+<div class="para ret">
+<h4>戻り値</h4>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#in">FR_INVALID_NAME</a>,
+<a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>
+</p>
+</div>
+
+
+<div class="para desc">
+<h4>解説</h4>
+<p>文字列の先頭にドライブ番号を含む場合は、その論理ドライブに設定されます。含まない場合は、デフォルト・ドライブに設定されます。ボリューム名を削除するときは、ヌル文字列を指定します。名前のフォーマットは、短いファイル名とほぼ同じですが、次の点が異なります。</p>
+<ul>
+<li>ローカル・コード換算で11バイト以下。</li>
+<li>ピリオドを含むことはできない。</li>
+<li>最後尾以外の任意の位置にスペースを置くことができる。ただし、最後尾のスペースは除去される。</li>
+</ul>
+</div>
+
+<div class="para comp">
+<h4>対応情報</h4>
+<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_USE_LABEL == 1</tt>のときに使用可能です。</p>
+</div>
+
+
+<div class="para use">
+<h4>使用例</h4>
+<pre>
+ <span class="c">/* デフォルト・ドライブにボリューム名を設定 */</span>
+ f_setlabel("DATA DISK");
+
+ <span class="c">/* ドライブ2にボリューム名を設定 */</span>
+ f_setlabel("2:DISK 3 OF 4");
+
+ <span class="c">/* ドライブ2のボリューム名を削除 */</span>
+ f_setlabel("2:");
+</pre>
+</div>
+
+
+<div class="para ref">
+<h4>参照</h4>
+<tt><a href="getlabel.html">f_getlabel</a></tt>
+</div>
+
+
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
+</body>
+</html>
diff --git a/data/sysrom/fat/doc/ja/sfatfs.html b/data/sysrom/fat/doc/ja/sfatfs.html
index 6a17d82..081bdc7 100644
--- a/data/sysrom/fat/doc/ja/sfatfs.html
+++ b/data/sysrom/fat/doc/ja/sfatfs.html
@@ -13,39 +13,40 @@
<div class="para">
<h2>FATFS</h2>
-<p><tt>FATFS</tt>構造体は、個々の論理ドライブのダイナミック・ワーク・エリアを保持し、f_mount()でFatFsモジュールに登録されます。標準状態では次のようなメンバになっています。アプリケーションから書き換え可能なメンバはありません。</p>
+<p><tt>FATFS</tt>構造体(ファイル・システム・オブジェクト)は、個々の論理ドライブのダイナミック・ワーク・エリアを保持し、<tt>f_mount()</tt>でFatFsモジュールに登録されます。初期化が行われるタイミングは、<tt>f_mount()</tt>またはメディア交換の後の最初のファイル・アクセスの時です。アプリケーションは、この構造体のメンバを書き換えてはなりません。</p>
<pre>
-typedef struct {
- BYTE fs_type; <span>/* FATタイプ */</span>
- BYTE drv; <span>/* 物理ドライブ番号 */</span>
- BYTE csize; <span>/* クラスタ当たりのセクタ数 */</span>
- BYTE n_fats; <span>/* FATの多重化数 */</span>
- BYTE wflag; <span>/* win[]ダーティ・フラグ */</span>
- BYTE fsi_flag; <span>/* fsinfoダーティ・フラグ */</span>
- WORD id; <span>/* ファイル・システム・マウントID */</span>
- WORD n_rootdir; <span>/* ルート・ディレクトリのエントリ数 (FAT12/16) */</span>
-#if _MAX_SS != 512
- WORD ssize; <span>/* セクタ・サイズ (可変セクタ長のみ) */</span>
-#endif
-#if _FS_REENTRANT
- HANDLE h_mutex; <span>/* 同期オブジェクトID */</span>
-#endif
-#if !_FS_READONLY
- DWORD last_clust; <span>/* 最後に割り当てられたクラスタ番号 */</span>
- DWORD free_clust; <span>/* 空きクラスタ数 */</span>
- DWORD fsi_sector; <span>/* fsinfoセクタ (FAT32) */</span>
-#endif
-#if _FS_RPATH
- DWORD cdir; <span>/* カレント・ディレクトリのクラスタ (0:ルート) */</span>
-#endif
- DWORD n_fatent; <span>/* FATのエントリ数 (= クラスタ数 + 2) */</span>
- DWORD fsize; <span>/* FAT 1個当たりのセクタ数 */</span>
- DWORD fatbase; <span>/* FAT領域開始セクタ */</span>
- DWORD dirbase; <span>/* ルート・ディレクトリ開始セクタ (FAT32: クラスタ番号) */</span>
- DWORD database; <span>/* データ領域開始区セクタ */</span>
- DWORD winsect; <span>/* win[]に現れているセクタ番号 */</span>
- BYTE win[_MAX_SS]; <span>/* ディスク・アクセス・ウィンドウ */</span>
+<span class="k">typedef</span> <span class="k">struct</span> {
+ BYTE fs_type; <span class="c">/* FATタイプ */</span>
+ BYTE drv; <span class="c">/* 物理ドライブ番号 */</span>
+ BYTE csize; <span class="c">/* クラスタ当たりのセクタ数 */</span>
+ BYTE n_fats; <span class="c">/* FATの多重化数 */</span>
+ BYTE wflag; <span class="c">/* win[]ダーティ・フラグ */</span>
+ BYTE fsi_flag; <span class="c">/* fsinfoダーティ・フラグ */</span>
+ WORD id; <span class="c">/* ファイル・システム・マウントID */</span>
+ WORD n_rootdir; <span class="c">/* ルート・ディレクトリのエントリ数 (FAT12/16) */</span>
+<span class="k">#if</span> _MAX_SS != 512
+ WORD ssize; <span class="c">/* セクタ・サイズ (512, 1024, 2048 or 4096) */</span>
+<span class="k">#endif</span>
+<span class="k">#if</span> _FS_REENTRANT
+ _SYNC_t sobj; <span class="c">/* 同期オブジェクトID */</span>
+<span class="k">#endif</span>
+<span class="k">#if</span> !_FS_READONLY
+ DWORD last_clust; <span class="c">/* 最後に割り当てられたクラスタ番号 */</span>
+ DWORD free_clust; <span class="c">/* 空きクラスタ数 */</span>
+ DWORD fsi_sector; <span class="c">/* fsinfoセクタ (FAT32) */</span>
+<span class="k">#endif</span>
+<span class="k">#if</span> _FS_RPATH
+ DWORD cdir; <span class="c">/* カレント・ディレクトリのクラスタ (0:ルート) */</span>
+<span class="k">#endif</span>
+ DWORD n_fatent; <span class="c">/* FATのエントリ数 (== クラスタ数 + 2) */</span>
+ DWORD fsize; <span class="c">/* FAT 1個当たりのセクタ数 */</span>
+ DWORD volbase; <span class="c">/* ボリューム開始セクタ */</span>
+ DWORD fatbase; <span class="c">/* FAT領域開始セクタ */</span>
+ DWORD dirbase; <span class="c">/* ルート・ディレクトリ開始セクタ/クラスタ */</span>
+ DWORD database; <span class="c">/* データ領域開始セクタ */</span>
+ DWORD winsect; <span class="c">/* win[]に現れているセクタ番号 */</span>
+ BYTE win[_MAX_SS]; <span class="c">/* ディスク・アクセス・ウィンドウ */</span>
} FATFS;
</pre>
</div>
diff --git a/data/sysrom/fat/doc/ja/sfile.html b/data/sysrom/fat/doc/ja/sfile.html
index 45989ad..3b952e5 100644
--- a/data/sysrom/fat/doc/ja/sfile.html
+++ b/data/sysrom/fat/doc/ja/sfile.html
@@ -13,32 +13,32 @@
<div class="para">
<h2>FIL</h2>
-<p><tt>FIL</tt>構造体は、f_open関数で作成され、そのファイルの状態を保持します。また、f_close関数でファイルが閉じられると無効化されます。アプリケーションからの書き換えが可能なメンバは<tt>cltbl</tt>のみです。非タイニー構成では内部にセクタ・バッファが確保されるので、サイズに注意が必要です。</p>
+<p><tt>FIL</tt>構造体(ファイル・オブジェクト)は、<tt>f_open()</tt>で初期化され、以後そのファイルの状態を保持します。また、<tt>f_close()</tt>でファイルが閉じられると無効化されます。アプリケーションは、この構造体のメンバを書き換えてはなりません(<tt>cltbl</tt>は例外)。非タイニー構成では、内部にセクタ・バッファが確保されるので、占有サイズに注意が必要です。</p>
<pre>
-typedef struct {
- FATFS* fs; <span>/* 親ファイル・システム・オブジェクトへのポインタ */</span>
- WORD id; <span>/* 親ファイル・システム・オブジェクトのマウントID */</span>
- BYTE flag; <span>/* ファイル・ステータス・フラグ */</span>
+<span class="k">typedef</span> <span class="k">struct</span> {
+ FATFS* fs; <span class="c">/* 親ファイル・システム・オブジェクトへのポインタ */</span>
+ WORD id; <span class="c">/* 親ファイル・システム・オブジェクトのマウントID */</span>
+ BYTE flag; <span class="c">/* ファイル・ステータス・フラグ */</span>
BYTE pad1;
- DWORD fptr; <span>/* ファイル読み書きポインタ (ファイル先頭からのバイト・オフセット) */</span>
- DWORD fsize; <span>/* ファイル・サイズ(バイト単位) */</span>
- DWORD org_clust; <span>/* ファイル開始クラスタ番号 (0 on fsize==0) */</span>
- DWORD curr_clust; <span>/* 現在のクラスタ */</span>
- DWORD dsect; <span>/* 現在のデータ・セクタ */</span>
-#if _FS_READONLY == 0
- DWORD dir_sect; <span>/* このファイルのディレクトリ・エントリのあるセクタ */</span>
- BYTE* dir_ptr; <span>/* このファイルのディレクトリへのポインタ */</span>
-#endif
-#if _USE_FASTSEEK
- DWORD* cltbl; <span>/* ファイルのクラスタ・リンク情報へのポインタ (Nulled on file open) */</span>
-#endif
-#if _FS_SHARE
- UINT lockid; <span>/* ファイル・ロックID */</span>
-#endif
-#if !_FS_TINY
- BYTE buf[_MAX_SS]; <span>/* データ転送バッファ */</span>
-#endif
+ DWORD fptr; <span class="c">/* ファイル読み書きポインタ (ファイル先頭からのバイト・オフセット) */</span>
+ DWORD fsize; <span class="c">/* ファイル・サイズ(バイト単位) */</span>
+ DWORD sclust; <span class="c">/* ファイル開始クラスタ番号 (set 0 if fsize==0) */</span>
+ DWORD clust; <span class="c">/* 現在のクラスタ */</span>
+ DWORD dsect; <span class="c">/* 現在のデータ・セクタ */</span>
+<span class="k">#if</span> _FS_READONLY == 0
+ DWORD dir_sect; <span class="c">/* このファイルのディレクトリ・エントリのあるセクタ */</span>
+ BYTE* dir_ptr; <span class="c">/* このファイルのディレクトリへのポインタ */</span>
+<span class="k">#endif</span>
+<span class="k">#if</span> _USE_FASTSEEK
+ DWORD* cltbl; <span class="c">/* ファイルのクラスタ・リンク情報へのポインタ (Nulled on file open) */</span>
+<span class="k">#endif</span>
+<span class="k">#if</span> _FS_SHARE
+ UINT lockid; <span class="c">/* ファイル・ロックID */</span>
+<span class="k">#endif</span>
+<span class="k">#if</span> !_FS_TINY
+ BYTE buf[_MAX_SS]; <span class="c">/* データ転送バッファ */</span>
+<span class="k">#endif</span>
} FIL;
</pre>
</div>
diff --git a/data/sysrom/fat/doc/ja/sfileinfo.html b/data/sysrom/fat/doc/ja/sfileinfo.html
index b0c2c08..3dcac1c 100644
--- a/data/sysrom/fat/doc/ja/sfileinfo.html
+++ b/data/sysrom/fat/doc/ja/sfileinfo.html
@@ -15,16 +15,16 @@
<h2>FILINFO</h2>
<p><tt>FILINFO</tt>構造体は、<tt>f_stat(), f_readdir()</tt>で返されるファイル情報を保持します。</p>
<pre>
-typedef struct {
- DWORD fsize; <span>/* ファイル・サイズ */</span>
- WORD fdate; <span>/* 最後に更新された日付 */</span>
- WORD ftime; <span>/* 最後に更新された時刻 */</span>
- BYTE fattrib; <span>/* アトリビュート */</span>
- TCHAR fname[13]; <span>/* 短いファイル名 (8.3フォーマット) */</span>
-#if _USE_LFN
- TCHAR* lfname; <span>/* 長いファイル名のバッファへのポインタ */</span>
- int lfsize; <span>/* 長いファイル名のバッファのサイズ [文字数] */</span>
-#endif
+<span class="k">typedef</span> <span class="k">struct</span> {
+ DWORD fsize; <span class="c">/* ファイル・サイズ */</span>
+ WORD fdate; <span class="c">/* 最後に更新された日付 */</span>
+ WORD ftime; <span class="c">/* 最後に更新された時刻 */</span>
+ BYTE fattrib; <span class="c">/* アトリビュート */</span>
+ TCHAR fname[13]; <span class="c">/* 短いファイル名 (8.3フォーマット) */</span>
+<span class="k">#if</span> _USE_LFN
+ TCHAR* lfname; <span class="c">/* 長いファイル名のバッファへのポインタ */</span>
+ int lfsize; <span class="c">/* 長いファイル名のバッファのサイズ [文字数] */</span>
+<span class="k">#endif</span>
} FILINFO;
</pre>
</div>
diff --git a/data/sysrom/fat/doc/ja/size.html b/data/sysrom/fat/doc/ja/size.html
new file mode 100644
index 0000000..caff05d
--- /dev/null
+++ b/data/sysrom/fat/doc/ja/size.html
@@ -0,0 +1,62 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="ja">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="FatFs" href="../00index_j.html">
+<link rel="alternate" hreflang="en" title="English" href="../en/size.html">
+<link rel="stylesheet" href="../css_j.css" type="text/css" media="screen" title="ELM Default">
+<title>FatFs - f_size</title>
+</head>
+
+<body>
+
+<div class="para func">
+<h2>f_size</h2>
+<p>ファイルのサイズを取得します。</p>
+<pre>
+DWORD f_size (
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] ファイル・オブジェクト */</span>
+);
+</pre>
+</div>
+
+
+<div class="para arg">
+<h4>引数</h4>
+<dl class="par">
+<dt>fp</dt>
+<dd>ファイル・オブジェクト構造体へのポインタを指定します。</dd>
+</dl>
+</div>
+
+
+<div class="para ret">
+<h4>戻り値</h4>
+<p>バイト単位のファイル・サイズが返ります。</p>
+</div>
+
+
+<div class="para desc">
+<h4>解説</h4>
+<p>f_size関数は、現リビジョンではマクロとして実装されています。</p>
+<pre>
+<span class="k">#define</span> f_size(fp) ((fp)->fsize)
+</pre>
+</div>
+
+
+<div class="para comp">
+<h4>対応情報</h4>
+<p>常に使用可能。</p>
+</div>
+
+
+<div class="para ref">
+<h4>参照</h4>
+<p><tt><a href="open.html">f_open</a>, <a href="lseek.html">f_lseek</a>, <a href="sfile.html">FIL</a></tt></p>
+</div>
+
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
+</body>
+</html>
diff --git a/data/sysrom/fat/doc/ja/stat.html b/data/sysrom/fat/doc/ja/stat.html
index 86cdf60..b5144bc 100644
--- a/data/sysrom/fat/doc/ja/stat.html
+++ b/data/sysrom/fat/doc/ja/stat.html
@@ -11,67 +11,59 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_stat</h2>
<pre>
FRESULT f_stat (
- const TCHAR* <em>FileName</em>, <span>/* ファイルまたはディレクトリ名へのポインタ */</span>
- FILINFO* <em>FileInfo</em> <span>/* ファイル情報構造体へのポインタ */</span>
+ const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] ファイルまたはディレクトリ名へのポインタ */</span>
+ FILINFO* <span class="arg">fno</span> <span class="c">/* [OUT] ファイル情報構造体へのポインタ */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>FileName</dt>
-<dd>情報を得るファイルまたはディレクトリ名の<tt>'\0'</tt>で終わる文字列を指すポインタを指定します。</dd>
-<dt>FileInfo</dt>
+<dt>path</dt>
+<dd>情報を得るファイルまたはディレクトリ名を示すヌル文字<tt>'\0'</tt>終端の文字列を指すポインタを指定します。</dd>
+<dt>fno</dt>
<dd>読み出したファイル情報を格納するファイル情報構造体へのポインタを指定します。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>正常終了。</dd>
-<dt>FR_NO_FILE</dt>
-<dd>ファイルまたはディレクトリが見つからない。</dd>
-<dt>FR_NO_PATH</dt>
-<dd>パスが見つからない。</dd>
-<dt>FR_INVALID_NAME</dt>
-<dd>パス名が不正。</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>論理ドライブ番号が不正。</dd>
-<dt>FR_NOT_READY</dt>
-<dd>メディアがセットされていないなど、物理ドライブが動作不能状態。</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>ディスク・エラーによる失敗。</dd>
-<dt>FR_INT_ERR</dt>
-<dd>不正なFAT構造または内部エラーによる失敗。</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>論理ドライブにワークエリアが割り当てられていない。</dd>
-<dt>FR_NO_FILESYSTEM</dt>
-<dd>有効なFATボリュームが見つからない。</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#ok">FR_NO_FILE</a>,
+<a href="rc.html#np">FR_NO_PATH</a>,
+<a href="rc.html#in">FR_INVALID_NAME</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>,
+<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
-<p>ファイルまたはディレクトリに関する情報を得ます。得られるファイル情報の詳細については <tt>FILINFO</tt>構造体を参照してください。</p>
+<p>指定されたファイルまたはディレクトリに関する情報(サイズ、タイムスタンプおよび属性)を得ます。ディレクトリのサイズ情報は無効で常に0です。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p><tt>_FS_MINIMIZE == 0</tt>のときに使用可能です。</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>参照</h4>
<p><tt><a href="opendir.html">f_opendir</a>, <a href="readdir.html">f_readdir</a>, <a href="sfileinfo.html">FILINFO</a>, <a href="sdir.html">DIR</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/ja/sync.html b/data/sysrom/fat/doc/ja/sync.html
index 0b9852b..1d14cc4 100644
--- a/data/sysrom/fat/doc/ja/sync.html
+++ b/data/sysrom/fat/doc/ja/sync.html
@@ -11,55 +11,51 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_sync</h2>
<p>書き込み中のファイルのキャッシュされた情報をフラッシュします。</p>
<pre>
FRESULT f_sync (
- FIL* <em>FileObject</em> <span>/* ファイル・オブジェクト構造体へのポインタ */</span>
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] ファイル・オブジェクト構造体へのポインタ */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>syncするファイルのファイル・オブジェクト構造体へのポインタを指定します。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>正常終了。</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>ディスク・エラーによる失敗。</dd>
-<dt>FR_INT_ERR</dt>
-<dd>不正なFAT構造または内部エラーによる失敗。</dd>
-<dt>FR_NOT_READY</dt>
-<dd>メディアがセットされていないなど、物理ドライブが動作不能状態。</dd>
-<dt>FR_INVALID_OBJECT</dt>
-<dd>ファイル・オブジェクトが無効。</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#io">FR_INVALID_OBJECT</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
<p>この関数は<tt>f_close()</tt>と同じ処理を実行しますが、ファイルは引き続き開かれたままになり、読み書きを続行できます。ロギングなど、書き込みモードで長時間ファイルが開かれているアプリケーションにおいて、定期的または区切りの良いところでこの関数を使用することにより、不意の電源断やメディアの取り外しにより失われるデータを最小にすることができます。実際のところ、<tt>f_close()</tt>内ではこの関数を呼び出した後ファイル・オブジェクトを無効化しているだけなので、<tt>f_close()</tt>直前の<tt>f_sync()</tt>は意味がありません。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p><tt>_FS_READONLY == 0</tt>のときに使用可能です。</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>参照</h4>
<p><tt><a href="close.html">f_close</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/ja/tell.html b/data/sysrom/fat/doc/ja/tell.html
new file mode 100644
index 0000000..1dee982
--- /dev/null
+++ b/data/sysrom/fat/doc/ja/tell.html
@@ -0,0 +1,62 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="ja">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
+<meta http-equiv="Content-Style-Type" content="text/css">
+<link rel="up" title="FatFs" href="../00index_e.html">
+<link rel="alternate" hreflang="en" title="English" href="../en/tell.html">
+<link rel="stylesheet" href="../css_j.css" type="text/css" media="screen" title="ELM Default">
+<title>FatFs - f_tell</title>
+</head>
+
+<body>
+
+<div class="para func">
+<h2>f_tell</h2>
+<p>現在のリード/ライト・ポインタを取得します。</p>
+<pre>
+DWORD f_tell (
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] ファイル・オブジェクト */</span>
+);
+</pre>
+</div>
+
+
+<div class="para arg">
+<h4>引数</h4>
+<dl class="par">
+<dt>fp</dt>
+<dd>ファイル・オブジェクト構造体へのポインタを指定します。</dd>
+</dl>
+</div>
+
+
+<div class="para ret">
+<h4>戻り値</h4>
+<p>現在のリード/ライト・ポインタ(ファイル先頭からのバイト単位のオフセット)が返ります。</p>
+</div>
+
+
+<div class="para desc">
+<h4>解説</h4>
+<p>f_tell関数は、現リビジョンではマクロとして実装されています。</p>
+<pre>
+<span class="k">#define</span> f_tell(fp) ((fp)->fptr)
+</pre>
+</div>
+
+
+<div class="para comp">
+<h4>対応情報</h4>
+<p>常に使用可能。</p>
+</div>
+
+
+<div class="para ref">
+<h4>参照</h4>
+<p><tt><a href="open.html">f_open</a>, <a href="lseek.html">f_lseek</a>, <a href="sfile.html">FIL</a></tt></p>
+</div>
+
+<p class="foot"><a href="../00index_j.html">戻る</a></p>
+</body>
+</html>
diff --git a/data/sysrom/fat/doc/ja/truncate.html b/data/sysrom/fat/doc/ja/truncate.html
index 4d8233d..29bf480 100644
--- a/data/sysrom/fat/doc/ja/truncate.html
+++ b/data/sysrom/fat/doc/ja/truncate.html
@@ -11,57 +11,52 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_truncate</h2>
<p>ファイル長を切り詰めます。</p>
<pre>
FRESULT f_truncate (
- FIL* <em>FileObject</em> <span>/* ファイル・オブジェクトへのポインタ */</span>
+ FIL* <span class="arg">fp</span> <span class="c">/* [IN] ファイル・オブジェクトへのポインタ */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>切り詰め対象ファイルのファイル・オブジェクトへのポインタ</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>正常終了。</dd>
-<dt>FR_DENIED</dt>
-<dd>ファイルが非書き込みモードで開かれている。</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>ディスク・エラーによる失敗。</dd>
-<dt>FR_INT_ERR</dt>
-<dd>不正なFAT構造または内部エラーによる失敗。</dd>
-<dt>FR_NOT_READY</dt>
-<dd>メディアがセットされていないなど、物理ドライブが動作不能状態。</dd>
-<dt>FR_INVALID_OBJECT</dt>
-<dd>無効なファイル・オブジェクト。</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#de">FR_DENIED</a>,
+<a href="rc.html#io">FR_INVALID_OBJECT</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
<p>ファイルの長さが現在のリード/ライト・ポインタに切り詰められます。リード/ライト・ポインタが既にファイルの終端を指しているときは、この関数は何の効果も持ちません。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_FS_MINIMIZE == 0</tt>のときに使用可能です。</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="lseek.html">f_lseek</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/ja/unlink.html b/data/sysrom/fat/doc/ja/unlink.html
index 11b5278..b164998 100644
--- a/data/sysrom/fat/doc/ja/unlink.html
+++ b/data/sysrom/fat/doc/ja/unlink.html
@@ -11,64 +11,59 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_unlink</h2>
-<p>オブジェクトを削除します。</p>
+<p>ファイルまたはディレクトリを削除します。</p>
<pre>
FRESULT f_unlink (
- const TCHAR* <em>FileName</em> <span>/* オブジェクト名へのポインタ */</span>
+ const TCHAR* <span class="arg">path</span> <span class="c">/* [IN] オブジェクト名へのポインタ */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>FileName</dt>
-<dd>削除対象の<a href="filename.html">ファイルまたはディレクトリ名</a>の入った<tt>'\0'</tt>で終わる文字列へのポインタを指定します。</dd>
+<dt>path</dt>
+<dd>削除対象の<a href="filename.html">パス名</a>を示すヌル文字<tt>'\0'</tt>終端の文字列へのポインタを指定します。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>正常終了。</dd>
-<dt>FR_NO_FILE</dt>
-<dd>ファイルが見つからない。</dd>
-<dt>FR_NO_PATH</dt>
-<dd>パスが見つからない。</dd>
-<dt>FR_INVALID_NAME</dt>
-<dd>パス名が不正。</dd>
-<dt>FR_INVALID_DRIVE</dt>
-<dd>ドライブ番号が不正。</dd>
-<dt>FR_DENIED</dt>
-<dd>対象オブジェクトがリード・オンリー属性、空でないディレクトリやカレント・ディレクトリ。</dd>
-<dt>FR_NOT_READY</dt>
-<dd>メディアがセットされていないなど、物理ドライブが動作不能状態。</dd>
-<dt>FR_WRITE_PROTECTED</dt>
-<dd>メディアが書き込み禁止状態。</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>ディスク・エラーによる失敗。</dd>
-<dt>FR_INT_ERR</dt>
-<dd>不正なFAT構造または内部エラーによる失敗。</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>論理ドライブにワーク・エリアが割り当てられていない。</dd>
-<dt>FR_NO_FILESYSTEM</dt>
-<dd>有効なFATボリュームが見つからない。</dd>
-<dt>FR_LOCKED</dt>
-<dd>ファイル共有機能によるアクセス拒否。</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#ok">FR_NO_FILE</a>,
+<a href="rc.html#np">FR_NO_PATH</a>,
+<a href="rc.html#in">FR_INVALID_NAME</a>,
+<a href="rc.html#de">FR_DENIED</a>,
+<a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>,
+<a href="rc.html#lo">FR_LOCKED</a>,
+<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
-<p>オブジェクトを削除します。<em>開かれているオブジェクトやカレント・ディレクトリは削除してはなりません</em>。</p>
+<p>削除対象のオブジェクが次の条件に当てはまる場合、そのアクセスは拒否され関数は失敗します。
+<ul>
+<li>リード・オンリー属性(<tt>AM_RDO</tt>)を持っている。</li>
+<li>空でないディレクトリまたはカレント・ディレクトリ。</li>
+<li>開かれているファイル。<a href="appnote.html#dup">多重アクセス制御</a>が有効なときは安全に拒否されますが、そうでないときは不正な操作となり、<em>FAT構造が破壊される可能性</em>があります。</li>
+</ul>
+</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_FS_MINIMIZE == 0</tt>のときに使用可能です。</p>
</div>
diff --git a/data/sysrom/fat/doc/ja/utime.html b/data/sysrom/fat/doc/ja/utime.html
index bd7017f..6da79df 100644
--- a/data/sysrom/fat/doc/ja/utime.html
+++ b/data/sysrom/fat/doc/ja/utime.html
@@ -11,68 +11,59 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_utime</h2>
<p>オブジェクトのタイムスタンプを変更します。</p>
<pre>
FRESULT f_utime (
- const TCHAR* <em>FileName</em>, <span>/* オブジェクト名へのポインタ */</span>
- const FILINFO* <em>TimeDate</em> <span>/* 設定する日付 */</span>
+ const TCHAR* <span class="arg">path</span>, <span class="c">/* [IN] オブジェクト名へのポインタ */</span>
+ const FILINFO* <span class="arg">fno</span> <span class="c">/* [IN] 設定する日付 */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>FileName</dt>
-<dd>変更対象のファイルまたはディレクトリへの<a href="filename.html">パス名</a>の入った<tt>'\0'</tt>で終わる文字列を指定します。</dd>
-<dt>TimeDate</dt>
-<dd>設定する日付と時間をfdateとftimeメンバに設定されたFILINFO構造体へのポインタ。他のメンバはDon't careです。</dd>
+<dt>path</dt>
+<dd>変更対象のファイルまたはディレクトリの<a href="filename.html">パス名</a>を示すヌル文字<tt>'\0'</tt>終端の文字列を指定します。</dd>
+<dt>fno</dt>
+<dd>設定する日付と時間を<tt>fdate</tt>と<tt>ftime</tt>メンバに設定された<tt>FILINFO</tt>構造体へのポインタ。他のメンバはこの関数では意味を持ちません。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>正常終了。</dd>
-<dt>FR_NO_FILE</dt>
-<dd>ファイルが見つからない。</dd>
-<dt>FR_NO_PATH</dt>
-<dd>パスが見つからない。</dd>
-<dt>FR_INVALID_NAME</dt>
-<dd>パス名が不正。</dd>
-<dt>FR_INVALID_NAME</dt>
-<dd>論理ドライブ番号が不正。</dd>
-<dt>FR_NOT_READY</dt>
-<dd>メディアがセットされていないなど、物理ドライブが動作不能状態。</dd>
-<dt>FR_WRITE_PROTECTED</dt>
-<dd>メディアが書き込み禁止状態。</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>ディスク・エラーによる失敗。</dd>
-<dt>FR_INT_ERR</dt>
-<dd>不正なFAT構造または内部エラーによる失敗。</dd>
-<dt>FR_NOT_ENABLED</dt>
-<dd>その論理ドライブにワーク・エリアが与えられていない。</dd>
-<dt>FR_NO_FILESYSTEM</dt>
-<dd>有効なFATボリュームが見つからない。</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#ok">FR_NO_FILE</a>,
+<a href="rc.html#np">FR_NO_PATH</a>,
+<a href="rc.html#in">FR_INVALID_NAME</a>,
+<a href="rc.html#wp">FR_WRITE_PROTECTED</a>,
+<a href="rc.html#id">FR_INVALID_DRIVE</a>,
+<a href="rc.html#ne">FR_NOT_ENABLED</a>,
+<a href="rc.html#ns">FR_NO_FILESYSTEM</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>,
+<a href="rc.html#nc">FR_NOT_ENOUGH_CORE</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
<p>オブジェクトのタイムスタンプを変更します。</p>
</div>
-<div class="para">
+<div class="para use">
<h4>使用例</h4>
<pre>
FRESULT set_timestamp (
- char *obj, <span>/* ファイル名へのポインタ */</span>
+ char *obj, <span class="c">/* ファイル名へのポインタ */</span>
int year,
int month,
int mday,
@@ -92,13 +83,13 @@ FRESULT set_timestamp (
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p><tt>_FS_READONLY == 0</tt>で、且つ<tt>_FS_MINIMIZE == 0</tt>のときに使用可能です。</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>参照</h4>
<p><tt><a href="stat.html">f_stat</a>, <a href="sfileinfo.html">FILINFO</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/ja/write.html b/data/sysrom/fat/doc/ja/write.html
index 8997e44..35da3fa 100644
--- a/data/sysrom/fat/doc/ja/write.html
+++ b/data/sysrom/fat/doc/ja/write.html
@@ -11,66 +11,61 @@
<body>
-<div class="para">
+<div class="para func">
<h2>f_write</h2>
<p>ファイルにデータを書き込みます。</p>
<pre>
FRESULT f_write (
- FIL* <em>FileObject</em>, <span>/* ファイル・オブジェクト */</span>
- const void* <em>Buffer</em>, <span>/* 書き込みデータ */</span>
- UINT <em>ByteToWrite</em>, <span>/* 書き込むバイト数 */</span>
- UINT* <em>ByteWritten</em> <span>/* 書き込まれたバイト数 */</span>
+ FIL* <span class="arg">fp</span>, <span class="c">/* [IN] ファイル・オブジェクト */</span>
+ const void* <span class="arg">buff</span>, <span class="c">/* [IN] 書き込みデータ */</span>
+ UINT <span class="arg">btw</span>, <span class="c">/* [IN] 書き込むバイト数 */</span>
+ UINT* <span class="arg">bw</span> <span class="c">/* [OUT] 書き込まれたバイト数 */</span>
);
</pre>
</div>
-<div class="para">
+<div class="para arg">
<h4>引数</h4>
<dl class="par">
-<dt>FileObject</dt>
+<dt>fp</dt>
<dd>ファイル・オブジェクト構造体へのポインタを指定します。</dd>
-<dt>Buffer</dt>
+<dt>buff</dt>
<dd>書き込むデータを格納したバッファを指すポインタを指定します。</dd>
-<dt>ByteToWrite</dt>
-<dd>書き込むバイト数(0〜UINTの最大値)を指定します。</dd>
-<dt>ByteWritten</dt>
+<dt>btw</dt>
+<dd>書き込むバイト数(0〜<tt>UINT</tt>型の最大値)を指定します。</dd>
+<dt>bw</dt>
<dd>書き込まれたバイト数を格納する変数を指すポインタを指定します。戻り値は関数の成否にかかわらず常に有効です。</dd>
</dl>
</div>
-<div class="para">
+<div class="para ret">
<h4>戻り値</h4>
-<dl class="ret">
-<dt>FR_OK (0)</dt>
-<dd>正常終了。</dd>
-<dt>FR_DISK_ERR</dt>
-<dd>ディスク・エラーによる失敗。</dd>
-<dt>FR_INT_ERR</dt>
-<dd>不正なFAT構造または内部エラーによる失敗。</dd>
-<dt>FR_NOT_READY</dt>
-<dd>メディアがセットされていないなど、物理ドライブが動作不能状態。</dd>
-<dt>FR_DENIED</dt>
-<dd>非書き込みモードで開かれたファイルに書き込もうとした。</dd>
-<dt>FR_INVALID_OBJECT</dt>
-<dd>無効なファイルオブジェクト。</dd>
-</dl>
+<p>
+<a href="rc.html#ok">FR_OK</a>,
+<a href="rc.html#de">FR_DISK_ERR</a>,
+<a href="rc.html#ie">FR_INT_ERR</a>,
+<a href="rc.html#nr">FR_NOT_READY</a>,
+<a href="rc.html#de">FR_DENIED</a>,
+<a href="rc.html#io">FR_INVALID_OBJECT</a>,
+<a href="rc.html#tm">FR_TIMEOUT</a>
+</p>
</div>
-<div class="para">
+<div class="para desc">
<h4>解説</h4>
-<p>書き込み開始位置は、リード/ライト・ポインタの位置からになります。リード/ライト・ポインタは実際に書き込まれたバイト数だけ進みます。関数が正常終了した後、要求したバイト数が書き込まれたかどうか<tt>*ByteWritten</tt>をチェックすべきです。<tt>*ByteWritten &lt; ByteToWrite</tt>のときは、ディスク・フルを意味します。ディスク・フルが発生しているときまたはそれに近いときは、制御が帰るまで時間がかかる場合があります。</p>
+<p>書き込み開始位置は、リード/ライト・ポインタの位置からになります。リード/ライト・ポインタは実際に書き込まれたバイト数だけ進みます。関数が正常終了した後、要求したバイト数が書き込まれたかどうか<tt class="arg">*bw</tt>をチェックすべきです。<tt class="arg">*bw</tt>が<tt class="arg">btw</tt>より小さいときは、ディスク・フルを意味します。ディスク・フルが発生しているときまたはそれに近いときは、制御が帰るまで時間がかかる場合があります。</p>
</div>
-<div class="para">
+<div class="para comp">
<h4>対応情報</h4>
<p><tt>_FS_READONLY == 0</tt>のときに使用可能です。</p>
</div>
-<div class="para">
+<div class="para ref">
<h4>参照</h4>
<p><tt><a href="open.html">f_open</a>, <a href="read.html">f_read</a>, <a href="putc.html">fputc</a>, <a href="puts.html">fputs</a>, <a href="printf.html">fprintf</a>, <a href="close.html">f_close</a>, <a href="sfile.html">FIL</a></tt></p>
</div>
diff --git a/data/sysrom/fat/doc/updates.txt b/data/sysrom/fat/doc/updates.txt
index 1e7cb03..de492b4 100644
--- a/data/sysrom/fat/doc/updates.txt
+++ b/data/sysrom/fat/doc/updates.txt
@@ -1,3 +1,21 @@
+R0.09b, Jan 24, 2013
+ Added f_getlabel() and f_setlabel(). (_USE_LABEL = 1)
+
+R0.09a, Aug 27, 2012
+ Fixed assertion failure due to OS/2 EA on FAT12/16.
+ Changed API rejects null object pointer to avoid crash.
+ Changed option name _FS_SHARE to _FS_LOCK.
+
+R0.09, Sep 06, 2011
+ f_mkfs() supports multiple partition to finish the multiple partition feature.
+ Added f_fdisk(). (_MULTI_PARTITION = 2)
+
+R0.08b, Jan 15, 2011
+ Fast seek feature is also applied to f_read() and f_write().
+ f_lseek() reports required table size on creating CLMP.
+ Extended format syntax of f_printf().
+ Ignores duplicated directory separators in given path names.
+
R0.08a, Aug 16, 2010
Added f_getcwd(). (_FS_RPATH = 2)
Added sector erase feature. (_USE_ERASE)
diff --git a/data/sysrom/fat/src/00readme.txt b/data/sysrom/fat/src/00readme.txt
index d097ef1..2acbbb8 100644
--- a/data/sysrom/fat/src/00readme.txt
+++ b/data/sysrom/fat/src/00readme.txt
@@ -1,4 +1,4 @@
-FatFs Module Source Files R0.09 (C)ChaN, 2011
+FatFs Module Source Files R0.09b (C)ChaN, 2013
FILES
@@ -7,7 +7,8 @@ FILES
ff.h Common include file for FatFs and application module.
ff.c FatFs module.
diskio.h Common include file for FatFs and disk I/O module.
- integer.h Alternative type definitions for integer variables.
+ diskio.c An example of glue function to attach existing disk I/O module to FatFs.
+ integer.h Integer type definitions for FatFs.
option Optional external functions.
Low level disk I/O module is not included in this archive because the FatFs
@@ -23,7 +24,7 @@ AGREEMENTS
small embedded systems. This is a free software and is opened for education,
research and commercial developments under license policy of following trems.
- Copyright (C) 2011, ChaN, all right reserved.
+ Copyright (C) 2012, ChaN, all right reserved.
* The FatFs module is a free software and there is NO WARRANTY.
* No restriction on use. You can use, modify and redistribute it for
@@ -128,3 +129,10 @@ REVISION HISTORY
Sep 06,'11 R0.09 f_mkfs() supports multiple partition to finish the multiple partition feature.
Added f_fdisk(). (_MULTI_PARTITION = 2)
+
+ Aug 27,'12 R0.09a Fixed assertion failure due to OS/2 EA on FAT12/16.
+ Changed f_open() and f_opendir() reject null object pointer to avoid crash.
+ Changed option name _FS_SHARE to _FS_LOCK.
+
+ Jan 23,'13 R0.09b Added f_getlabel() and f_setlabel(). (_USE_LABEL == 1)
+
diff --git a/data/sysrom/fat/src/diskio.h b/data/sysrom/fat/src/diskio.h
index 2fa4b28..9c72d95 100644
--- a/data/sysrom/fat/src/diskio.h
+++ b/data/sysrom/fat/src/diskio.h
@@ -1,11 +1,16 @@
/*-----------------------------------------------------------------------
-/ Low level disk interface modlue include file
+/ Low level disk interface modlue include file (C)ChaN, 2013
/-----------------------------------------------------------------------*/
-#ifndef _DISKIO
+#ifndef _DISKIO_DEFINED
+#define _DISKIO_DEFINED
-#define _READONLY 0 /* 1: Remove write functions */
-#define _USE_IOCTL 1 /* 1: Use disk_ioctl fucntion */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define _USE_WRITE 1 /* 1: Enable disk_write function */
+#define _USE_IOCTL 1 /* 1: Enable disk_ioctl fucntion */
#include "integer.h"
@@ -26,19 +31,15 @@ typedef enum {
/*---------------------------------------*/
/* Prototypes for disk control functions */
-int assign_drives (int, int);
-DSTATUS disk_initialize (BYTE);
-DSTATUS disk_status (BYTE);
-DRESULT disk_read (BYTE, BYTE*, DWORD, BYTE);
-#if _READONLY == 0
-DRESULT disk_write (BYTE, const BYTE*, DWORD, BYTE);
-#endif
-DRESULT disk_ioctl (BYTE, BYTE, void*);
+DSTATUS disk_initialize (BYTE pdrv);
+DSTATUS disk_status (BYTE pdrv);
+DRESULT disk_read (BYTE pdrv, BYTE*buff, DWORD sector, BYTE count);
+DRESULT disk_write (BYTE pdrv, const BYTE* buff, DWORD sector, BYTE count);
+DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
/* Disk Status Bits (DSTATUS) */
-
#define STA_NOINIT 0x01 /* Drive not initialized */
#define STA_NODISK 0x02 /* No medium in the drive */
#define STA_PROTECT 0x04 /* Write protected */
@@ -46,17 +47,18 @@ DRESULT disk_ioctl (BYTE, BYTE, void*);
/* Command code for disk_ioctrl fucntion */
-/* Generic command (defined for FatFs) */
+/* Generic command (used by FatFs) */
#define CTRL_SYNC 0 /* Flush disk cache (for write functions) */
#define GET_SECTOR_COUNT 1 /* Get media size (for only f_mkfs()) */
#define GET_SECTOR_SIZE 2 /* Get sector size (for multiple sector size (_MAX_SS >= 1024)) */
#define GET_BLOCK_SIZE 3 /* Get erase block size (for only f_mkfs()) */
#define CTRL_ERASE_SECTOR 4 /* Force erased a block of sectors (for only _USE_ERASE) */
-/* Generic command */
+/* Generic command (not used by FatFs) */
#define CTRL_POWER 5 /* Get/Set power status */
#define CTRL_LOCK 6 /* Lock/Unlock media removal */
#define CTRL_EJECT 7 /* Eject media */
+#define CTRL_FORMAT 8 /* Create physical format on the media */
/* MMC/SDC specific ioctl command */
#define MMC_GET_TYPE 10 /* Get card type */
@@ -70,9 +72,17 @@ DRESULT disk_ioctl (BYTE, BYTE, void*);
#define ATA_GET_MODEL 21 /* Get model name */
#define ATA_GET_SN 22 /* Get serial number */
-/* NAND specific ioctl command */
-#define NAND_FORMAT 30 /* Create physical format */
+/* MMC card type flags (MMC_GET_TYPE) */
+#define CT_MMC 0x01 /* MMC ver 3 */
+#define CT_SD1 0x02 /* SD ver 1 */
+#define CT_SD2 0x04 /* SD ver 2 */
+#define CT_SDC (CT_SD1|CT_SD2) /* SD */
+#define CT_BLOCK 0x08 /* Block addressing */
+
+
+#ifdef __cplusplus
+}
+#endif
-#define _DISKIO
#endif
diff --git a/data/sysrom/fat/src/ff.c b/data/sysrom/fat/src/ff.c
index cc897b7..aa640f8 100644
--- a/data/sysrom/fat/src/ff.c
+++ b/data/sysrom/fat/src/ff.c
@@ -1,11 +1,11 @@
/*----------------------------------------------------------------------------/
-/ FatFs - FAT file system module R0.09 (C)ChaN, 2011
+/ FatFs - FAT file system module R0.09b (C)ChaN, 2013
/-----------------------------------------------------------------------------/
/ FatFs module is a generic FAT file system module for small embedded systems.
/ This is a free software that opened for education, research and commercial
/ developments under license policy of following terms.
/
-/ Copyright (C) 2011, ChaN, all right reserved.
+/ Copyright (C) 2013, ChaN, all right reserved.
/
/ * The FatFs module is a free software and there is NO WARRANTY.
/ * No restriction on use. You can use, modify and redistribute it for
@@ -86,10 +86,14 @@
/ Jan 15,'11 R0.08b Fast seek feature is also applied to f_read() and f_write().
/ f_lseek() reports required table size on creating CLMP.
/ Extended format syntax of f_printf function.
-/ Ignores duplicated directory separators in given path names.
+/ Ignores duplicated directory separators in given path name.
/
/ Sep 06,'11 R0.09 f_mkfs() supports multiple partition to finish the multiple partition feature.
/ Added f_fdisk(). (_MULTI_PARTITION = 2)
+/ Aug 27,'12 R0.09a Fixed assertion failure due to OS/2 EA on FAT12/16 volume.
+/ Changed f_open() and f_opendir reject null object pointer to avoid crash.
+/ Changed option name _FS_SHARE to _FS_LOCK.
+/ Jan 24,'13 R0.09b Added f_setlabel() and f_getlabel(). (_USE_LABEL = 1)
/---------------------------------------------------------------------------*/
#include "ff.h" /* FatFs configurations and declarations */
@@ -102,7 +106,7 @@
---------------------------------------------------------------------------*/
-#if _FATFS != 6502 /* Revision ID */
+#if _FATFS != 82786 /* Revision ID */
#error Wrong include file (ff.h).
#endif
@@ -133,10 +137,10 @@
#define ABORT(fs, res) { fp->flag |= FA__ERROR; LEAVE_FF(fs, res); }
-/* File shareing feature */
-#if _FS_SHARE
+/* File access control feature */
+#if _FS_LOCK
#if _FS_READONLY
-#error _FS_SHARE must be 0 on read-only cfg.
+#error _FS_LOCK must be 0 on read-only cfg.
#endif
typedef struct {
FATFS *fs; /* File ID 1, volume (NULL:blank entry) */
@@ -147,10 +151,6 @@ typedef struct {
#endif
-/* Misc definitions */
-#define LD_CLUST(dir) (((DWORD)LD_WORD(dir+DIR_FstClusHI)<<16) | LD_WORD(dir+DIR_FstClusLO))
-#define ST_CLUST(dir,cl) {ST_WORD(dir+DIR_FstClusLO, cl); ST_WORD(dir+DIR_FstClusHI, (DWORD)cl>>16);}
-
/* DBCS code ranges and SBCS extend char conversion table */
@@ -420,7 +420,7 @@ typedef struct {
#define BPB_FSVer 42 /* File system version (2) */
#define BPB_RootClus 44 /* Root dir first cluster (4) */
#define BPB_FSInfo 48 /* Offset of FSInfo sector (2) */
-#define BPB_BkBootSec 50 /* Offset of backup boot sectot (2) */
+#define BPB_BkBootSec 50 /* Offset of backup boot sector (2) */
#define BS_DrvNum32 64 /* Physical drive number (2) */
#define BS_BootSig32 66 /* Extended boot signature (1) */
#define BS_VolID32 67 /* Volume serial number (4) */
@@ -437,8 +437,10 @@ typedef struct {
#define DIR_Name 0 /* Short file name (11) */
#define DIR_Attr 11 /* Attribute (1) */
#define DIR_NTres 12 /* NT flag (1) */
+#define DIR_CrtTimeTenth 13 /* Created time sub-second (1) */
#define DIR_CrtTime 14 /* Created time (2) */
#define DIR_CrtDate 16 /* Created date (2) */
+#define DIR_LstAccDate 18 /* Last accessed date (2) */
#define DIR_FstClusHI 20 /* Higher 16-bit of first cluster (2) */
#define DIR_WrtTime 22 /* Modified time (2) */
#define DIR_WrtDate 24 /* Modified date (2) */
@@ -451,8 +453,8 @@ typedef struct {
#define LDIR_FstClusLO 26 /* Filled by zero (0) */
#define SZ_DIR 32 /* Size of a directory entry */
#define LLE 0x40 /* Last long entry flag in LDIR_Ord */
-#define DDE 0xE5 /* Deleted directory enrty mark in DIR_Name[0] */
-#define NDDE 0x05 /* Replacement of a character collides with DDE */
+#define DDE 0xE5 /* Deleted directory entry mark in DIR_Name[0] */
+#define NDDE 0x05 /* Replacement of the character collides with DDE */
/*------------------------------------------------------------*/
@@ -478,9 +480,9 @@ static
BYTE CurrVol; /* Current drive */
#endif
-#if _FS_SHARE
+#if _FS_LOCK
static
-FILESEM Files[_FS_SHARE]; /* File lock semaphores */
+FILESEM Files[_FS_LOCK]; /* File lock semaphores */
#endif
#if _USE_LFN == 0 /* No LFN feature */
@@ -511,6 +513,14 @@ static WCHAR LfnBuf[_MAX_LFN+1];
#endif
+#ifdef _EXCVT
+static
+const BYTE ExCvt[] = _EXCVT; /* Upper conversion table for extended chars */
+#endif
+
+
+
+
/*--------------------------------------------------------------------------
@@ -531,10 +541,10 @@ void mem_cpy (void* dst, const void* src, UINT cnt) {
const BYTE *s = (const BYTE*)src;
#if _WORD_ACCESS == 1
- while (cnt >= sizeof(int)) {
+ while (cnt >= sizeof (int)) {
*(int*)d = *(int*)s;
- d += sizeof(int); s += sizeof(int);
- cnt -= sizeof(int);
+ d += sizeof (int); s += sizeof (int);
+ cnt -= sizeof (int);
}
#endif
while (cnt--)
@@ -589,7 +599,8 @@ void unlock_fs (
FRESULT res /* Result code to be returned */
)
{
- if (res != FR_NOT_ENABLED &&
+ if (fs &&
+ res != FR_NOT_ENABLED &&
res != FR_INVALID_DRIVE &&
res != FR_INVALID_OBJECT &&
res != FR_TIMEOUT) {
@@ -601,9 +612,9 @@ void unlock_fs (
/*-----------------------------------------------------------------------*/
-/* File shareing control functions */
+/* File lock control functions */
/*-----------------------------------------------------------------------*/
-#if _FS_SHARE
+#if _FS_LOCK
static
FRESULT chk_lock ( /* Check if the file can be accessed */
@@ -614,7 +625,7 @@ FRESULT chk_lock ( /* Check if the file can be accessed */
UINT i, be;
/* Search file semaphore table */
- for (i = be = 0; i < _FS_SHARE; i++) {
+ for (i = be = 0; i < _FS_LOCK; i++) {
if (Files[i].fs) { /* Existing entry */
if (Files[i].fs == dj->fs && /* Check if the file matched with an open file */
Files[i].clu == dj->sclust &&
@@ -623,7 +634,7 @@ FRESULT chk_lock ( /* Check if the file can be accessed */
be++;
}
}
- if (i == _FS_SHARE) /* The file is not opened */
+ if (i == _FS_LOCK) /* The file is not opened */
return (be || acc == 2) ? FR_OK : FR_TOO_MANY_OPEN_FILES; /* Is there a blank entry for new file? */
/* The file has been opened. Reject any open against writing file and all write mode open */
@@ -636,8 +647,8 @@ int enq_lock (void) /* Check if an entry is available for a new file */
{
UINT i;
- for (i = 0; i < _FS_SHARE && Files[i].fs; i++) ;
- return (i == _FS_SHARE) ? 0 : 1;
+ for (i = 0; i < _FS_LOCK && Files[i].fs; i++) ;
+ return (i == _FS_LOCK) ? 0 : 1;
}
@@ -650,15 +661,15 @@ UINT inc_lock ( /* Increment file open counter and returns its index (0:int erro
UINT i;
- for (i = 0; i < _FS_SHARE; i++) { /* Find the file */
+ for (i = 0; i < _FS_LOCK; i++) { /* Find the file */
if (Files[i].fs == dj->fs &&
Files[i].clu == dj->sclust &&
Files[i].idx == dj->index) break;
}
- if (i == _FS_SHARE) { /* Not opened. Register it as new. */
- for (i = 0; i < _FS_SHARE && Files[i].fs; i++) ;
- if (i == _FS_SHARE) return 0; /* No space to register (int err) */
+ if (i == _FS_LOCK) { /* Not opened. Register it as new. */
+ for (i = 0; i < _FS_LOCK && Files[i].fs; i++) ;
+ if (i == _FS_LOCK) return 0; /* No space to register (int err) */
Files[i].fs = dj->fs;
Files[i].clu = dj->sclust;
Files[i].idx = dj->index;
@@ -682,7 +693,7 @@ FRESULT dec_lock ( /* Decrement file open counter */
FRESULT res;
- if (--i < _FS_SHARE) {
+ if (--i < _FS_LOCK) {
n = Files[i].ctr;
if (n == 0x100) n = 0;
if (n) n--;
@@ -703,7 +714,7 @@ void clear_lock ( /* Clear lock entries of the volume */
{
UINT i;
- for (i = 0; i < _FS_SHARE; i++) {
+ for (i = 0; i < _FS_LOCK; i++) {
if (Files[i].fs == fs) Files[i].fs = 0;
}
}
@@ -712,39 +723,51 @@ void clear_lock ( /* Clear lock entries of the volume */
/*-----------------------------------------------------------------------*/
-/* Change window offset */
+/* Move/Flush disk access window */
/*-----------------------------------------------------------------------*/
+
+#if !_FS_READONLY
static
-FRESULT move_window (
- FATFS *fs, /* File system object */
- DWORD sector /* Sector number to make appearance in the fs->win[] */
-) /* Move to zero only writes back dirty window */
+FRESULT sync_window (
+ FATFS *fs /* File system object */
+)
{
DWORD wsect;
+ UINT nf;
-
- wsect = fs->winsect;
- if (wsect != sector) { /* Changed current window */
-#if !_FS_READONLY
- if (fs->wflag) { /* Write back dirty window if needed */
- if (disk_write(fs->drv, fs->win, wsect, 1) != RES_OK)
- return FR_DISK_ERR;
- fs->wflag = 0;
- if (wsect < (fs->fatbase + fs->fsize)) { /* In FAT area */
- BYTE nf;
- for (nf = fs->n_fats; nf > 1; nf--) { /* Reflect the change to all FAT copies */
- wsect += fs->fsize;
- disk_write(fs->drv, fs->win, wsect, 1);
- }
+
+ if (fs->wflag) { /* Write back the sector if it is dirty */
+ wsect = fs->winsect; /* Current sector number */
+ if (disk_write(fs->drv, fs->win, wsect, 1) != RES_OK)
+ return FR_DISK_ERR;
+ fs->wflag = 0;
+ if (wsect >= fs->fatbase && wsect < (fs->fatbase + fs->fsize)) { /* In FAT area? */
+ for (nf = fs->n_fats; nf >= 2; nf--) { /* Reflect the change to all FAT copies */
+ wsect += fs->fsize;
+ disk_write(fs->drv, fs->win, wsect, 1);
}
}
+ }
+ return FR_OK;
+}
#endif
- if (sector) {
- if (disk_read(fs->drv, fs->win, sector, 1) != RES_OK)
- return FR_DISK_ERR;
- fs->winsect = sector;
- }
+
+
+static
+FRESULT move_window (
+ FATFS *fs, /* File system object */
+ DWORD sector /* Sector number to make appearance in the fs->win[] */
+)
+{
+ if (sector != fs->winsect) { /* Changed current window */
+#if !_FS_READONLY
+ if (sync_window(fs) != FR_OK)
+ return FR_DISK_ERR;
+#endif
+ if (disk_read(fs->drv, fs->win, sector, 1) != RES_OK)
+ return FR_DISK_ERR;
+ fs->winsect = sector;
}
return FR_OK;
@@ -754,18 +777,18 @@ FRESULT move_window (
/*-----------------------------------------------------------------------*/
-/* Clean-up cached data */
+/* Synchronize file system and strage device */
/*-----------------------------------------------------------------------*/
#if !_FS_READONLY
static
-FRESULT sync ( /* FR_OK: successful, FR_DISK_ERR: failed */
- FATFS *fs /* File system object */
+FRESULT sync_fs ( /* FR_OK: successful, FR_DISK_ERR: failed */
+ FATFS *fs /* File system object */
)
{
FRESULT res;
- res = move_window(fs, 0);
+ res = sync_window(fs);
if (res == FR_OK) {
/* Update FSInfo sector if needed */
if (fs->fs_type == FS_FAT32 && fs->fsi_flag) {
@@ -798,7 +821,7 @@ FRESULT sync ( /* FR_OK: successful, FR_DISK_ERR: failed */
/*-----------------------------------------------------------------------*/
-static DWORD clust2sect ( /* !=0: Sector number, 0: Failed - invalid cluster# */
+DWORD clust2sect ( /* !=0: Sector number, 0: Failed - invalid cluster# */
FATFS *fs, /* File system object */
DWORD clst /* Cluster# to be converted */
)
@@ -816,7 +839,7 @@ static DWORD clust2sect ( /* !=0: Sector number, 0: Failed - invalid cluster# */
/*-----------------------------------------------------------------------*/
-static DWORD get_fat ( /* 0xFFFFFFFF:Disk error, 1:Internal error, Else:Cluster status */
+DWORD get_fat ( /* 0xFFFFFFFF:Disk error, 1:Internal error, Else:Cluster status */
FATFS *fs, /* File system object */
DWORD clst /* Cluster# to get the link information */
)
@@ -825,7 +848,7 @@ static DWORD get_fat ( /* 0xFFFFFFFF:Disk error, 1:Internal error, Else:Cluster
BYTE *p;
- if (clst < 2 || clst >= fs->n_fatent) /* Chack range */
+ if (clst < 2 || clst >= fs->n_fatent) /* Check range */
return 1;
switch (fs->fs_type) {
@@ -859,7 +882,7 @@ static DWORD get_fat ( /* 0xFFFFFFFF:Disk error, 1:Internal error, Else:Cluster
/*-----------------------------------------------------------------------*/
#if !_FS_READONLY
-static FRESULT put_fat (
+FRESULT put_fat (
FATFS *fs, /* File system object */
DWORD clst, /* Cluster# to be changed in range of 2 to fs->n_fatent - 1 */
DWORD val /* New value to mark the cluster */
@@ -876,7 +899,7 @@ static FRESULT put_fat (
} else {
switch (fs->fs_type) {
case FS_FAT12 :
- bc = clst; bc += bc / 2;
+ bc = (UINT)clst; bc += bc / 2;
res = move_window(fs, fs->fatbase + (bc / SS(fs)));
if (res != FR_OK) break;
p = &fs->win[bc % SS(fs)];
@@ -930,7 +953,7 @@ FRESULT remove_chain (
FRESULT res;
DWORD nxt;
#if _USE_ERASE
- DWORD scl = clst, ecl = clst, resion[2];
+ DWORD scl = clst, ecl = clst, rt[2];
#endif
if (clst < 2 || clst >= fs->n_fatent) { /* Check range */
@@ -950,12 +973,12 @@ FRESULT remove_chain (
fs->fsi_flag = 1;
}
#if _USE_ERASE
- if (ecl + 1 == nxt) { /* Next cluster is contiguous */
+ if (ecl + 1 == nxt) { /* Is next cluster contiguous? */
ecl = nxt;
} else { /* End of contiguous clusters */
- resion[0] = clust2sect(fs, scl); /* Start sector */
- resion[1] = clust2sect(fs, ecl) + fs->csize - 1; /* End sector */
- disk_ioctl(fs->drv, CTRL_ERASE_SECTOR, resion); /* Erase the block */
+ rt[0] = clust2sect(fs, scl); /* Start sector */
+ rt[1] = clust2sect(fs, ecl) + fs->csize - 1; /* End sector */
+ disk_ioctl(fs->drv, CTRL_ERASE_SECTOR, rt); /* Erase the block */
scl = ecl = nxt;
}
#endif
@@ -1064,7 +1087,7 @@ DWORD clmt_clust ( /* <2:Error, >=2:Cluster number */
static
FRESULT dir_sdi (
DIR *dj, /* Pointer to directory object */
- WORD idx /* Directory index number */
+ WORD idx /* Index of directory table */
)
{
DWORD clst;
@@ -1106,12 +1129,12 @@ FRESULT dir_sdi (
/*-----------------------------------------------------------------------*/
-/* Directory handling - Move directory index next */
+/* Directory handling - Move directory table index next */
/*-----------------------------------------------------------------------*/
static
-FRESULT dir_next ( /* FR_OK:Succeeded, FR_NO_FILE:End of table, FR_DENIED:EOT and could not stretch */
- DIR *dj, /* Pointer to directory object */
+FRESULT dir_next ( /* FR_OK:Succeeded, FR_NO_FILE:End of table, FR_DENIED:Could not stretch */
+ DIR *dj, /* Pointer to the directory object */
int stretch /* 0: Do not stretch table, 1: Stretch table if needed */
)
{
@@ -1145,12 +1168,12 @@ FRESULT dir_next ( /* FR_OK:Succeeded, FR_NO_FILE:End of table, FR_DENIED:EOT an
if (clst == 1) return FR_INT_ERR;
if (clst == 0xFFFFFFFF) return FR_DISK_ERR;
/* Clean-up stretched table */
- if (move_window(dj->fs, 0)) return FR_DISK_ERR; /* Flush active window */
+ if (sync_window(dj->fs)) return FR_DISK_ERR; /* Flush active window */
mem_set(dj->fs->win, 0, SS(dj->fs)); /* Clear window buffer */
dj->fs->winsect = clust2sect(dj->fs, clst); /* Cluster start sector */
for (c = 0; c < dj->fs->csize; c++) { /* Fill the new cluster with 0 */
dj->fs->wflag = 1;
- if (move_window(dj->fs, 0)) return FR_DISK_ERR;
+ if (sync_window(dj->fs)) return FR_DISK_ERR;
dj->fs->winsect++;
}
dj->fs->winsect -= c; /* Rewind window address */
@@ -1174,6 +1197,75 @@ FRESULT dir_next ( /* FR_OK:Succeeded, FR_NO_FILE:End of table, FR_DENIED:EOT an
/*-----------------------------------------------------------------------*/
+/* Directory handling - Reserve directory entry */
+/*-----------------------------------------------------------------------*/
+
+#if !_FS_READONLY
+static
+FRESULT dir_alloc (
+ DIR* dj, /* Pointer to the directory object */
+ UINT nent /* Number of contiguous entries to allocate (1-21) */
+)
+{
+ FRESULT res;
+ UINT n;
+
+
+ res = dir_sdi(dj, 0);
+ if (res == FR_OK) {
+ n = 0;
+ do {
+ res = move_window(dj->fs, dj->sect);
+ if (res != FR_OK) break;
+ if (dj->dir[0] == DDE || dj->dir[0] == 0) { /* Is it a blank entry? */
+ if (++n == nent) break; /* A block of contiguous entry is found */
+ } else {
+ n = 0; /* Not a blank entry. Restart to search */
+ }
+ res = dir_next(dj, 1); /* Next entry with table stretch enabled */
+ } while (res == FR_OK);
+ }
+ return res;
+}
+#endif
+
+
+
+/*-----------------------------------------------------------------------*/
+/* Directory handling - Load/Store start cluster number */
+/*-----------------------------------------------------------------------*/
+
+static
+DWORD ld_clust (
+ FATFS *fs, /* Pointer to the fs object */
+ BYTE *dir /* Pointer to the directory entry */
+)
+{
+ DWORD cl;
+
+ cl = LD_WORD(dir+DIR_FstClusLO);
+ if (fs->fs_type == FS_FAT32)
+ cl |= (DWORD)LD_WORD(dir+DIR_FstClusHI) << 16;
+
+ return cl;
+}
+
+
+#if !_FS_READONLY
+static
+void st_clust (
+ BYTE *dir, /* Pointer to the directory entry */
+ DWORD cl /* Value to be set */
+)
+{
+ ST_WORD(dir+DIR_FstClusLO, cl);
+ ST_WORD(dir+DIR_FstClusHI, cl >> 16);
+}
+#endif
+
+
+
+/*-----------------------------------------------------------------------*/
/* LFN handling - Test/Pick/Fit an LFN segment from/to directory entry */
/*-----------------------------------------------------------------------*/
#if _USE_LFN
@@ -1409,16 +1501,17 @@ FRESULT dir_find (
/*-----------------------------------------------------------------------*/
/* Read an object from the directory */
/*-----------------------------------------------------------------------*/
-#if _FS_MINIMIZE <= 1
+#if _FS_MINIMIZE <= 1 || _USE_LABEL || _FS_RPATH >= 2
static
FRESULT dir_read (
- DIR *dj /* Pointer to the directory object that pointing the entry to be read */
+ DIR *dj, /* Pointer to the directory object */
+ int vol /* Filtered by 0:file/dir or 1:volume label */
)
{
FRESULT res;
- BYTE c, *dir;
+ BYTE a, c, *dir;
#if _USE_LFN
- BYTE a, ord = 0xFF, sum = 0xFF;
+ BYTE ord = 0xFF, sum = 0xFF;
#endif
res = FR_NO_FILE;
@@ -1428,9 +1521,9 @@ FRESULT dir_read (
dir = dj->dir; /* Ptr to the directory entry of current index */
c = dir[DIR_Name];
if (c == 0) { res = FR_NO_FILE; break; } /* Reached to end of table */
-#if _USE_LFN /* LFN configuration */
a = dir[DIR_Attr] & AM_MASK;
- if (c == DDE || (!_FS_RPATH && c == '.') || ((a & AM_VOL) && a != AM_LFN)) { /* An entry without valid data */
+#if _USE_LFN /* LFN configuration */
+ if (c == DDE || (!_FS_RPATH && c == '.') || (a == AM_VOL) != vol) { /* An entry without valid data */
ord = 0xFF;
} else {
if (a == AM_LFN) { /* An LFN entry is found */
@@ -1448,7 +1541,7 @@ FRESULT dir_read (
}
}
#else /* Non LFN configuration */
- if (c != DDE && (_FS_RPATH || c != '.') && !(dir[DIR_Attr] & AM_VOL)) /* Is it a valid entry? */
+ if (c != DDE && (_FS_RPATH || c != '.') && a != AM_LFN && (a == AM_VOL) == vol) /* Is it a valid entry? */
break;
#endif
res = dir_next(dj, 0); /* Next entry */
@@ -1459,7 +1552,7 @@ FRESULT dir_read (
return res;
}
-#endif
+#endif /* _FS_MINIMIZE <= 1 || _USE_LABEL || _FS_RPATH >= 2 */
@@ -1473,9 +1566,8 @@ FRESULT dir_register ( /* FR_OK:Successful, FR_DENIED:No free entry or too many
)
{
FRESULT res;
- BYTE c, *dir;
#if _USE_LFN /* LFN configuration */
- WORD n, ne, is;
+ WORD n, ne;
BYTE sn[12], *fn, sum;
WCHAR *lfn;
@@ -1498,35 +1590,18 @@ FRESULT dir_register ( /* FR_OK:Successful, FR_DENIED:No free entry or too many
fn[NS] = sn[NS]; dj->lfn = lfn;
}
- if (sn[NS] & NS_LFN) { /* When LFN is to be created, reserve an SFN + LFN entries. */
- for (ne = 0; lfn[ne]; ne++) ;
- ne = (ne + 25) / 13;
- } else { /* Otherwise reserve only an SFN entry. */
+ if (sn[NS] & NS_LFN) { /* When LFN is to be created, allocate entries for an SFN + LFNs. */
+ for (n = 0; lfn[n]; n++) ;
+ ne = (n + 25) / 13;
+ } else { /* Otherwise allocate an entry for an SFN */
ne = 1;
}
+ res = dir_alloc(dj, ne); /* Allocate entries */
- /* Reserve contiguous entries */
- res = dir_sdi(dj, 0);
- if (res != FR_OK) return res;
- n = is = 0;
- do {
- res = move_window(dj->fs, dj->sect);
- if (res != FR_OK) break;
- c = *dj->dir; /* Check the entry status */
- if (c == DDE || c == 0) { /* Is it a blank entry? */
- if (n == 0) is = dj->index; /* First index of the contiguous entry */
- if (++n == ne) break; /* A contiguous entry that required count is found */
- } else {
- n = 0; /* Not a blank entry. Restart to search */
- }
- res = dir_next(dj, 1); /* Next entry with table stretch */
- } while (res == FR_OK);
-
- if (res == FR_OK && ne > 1) { /* Initialize LFN entry if needed */
- res = dir_sdi(dj, is);
+ if (res == FR_OK && --ne) { /* Set LFN entry if needed */
+ res = dir_sdi(dj, (WORD)(dj->index - ne));
if (res == FR_OK) {
- sum = sum_sfn(dj->fn); /* Sum of the SFN tied to the LFN */
- ne--;
+ sum = sum_sfn(dj->fn); /* Sum value of the SFN tied to the LFN */
do { /* Store LFN entries in bottom first */
res = move_window(dj->fs, dj->sect);
if (res != FR_OK) break;
@@ -1536,28 +1611,17 @@ FRESULT dir_register ( /* FR_OK:Successful, FR_DENIED:No free entry or too many
} while (res == FR_OK && --ne);
}
}
-
#else /* Non LFN configuration */
- res = dir_sdi(dj, 0);
- if (res == FR_OK) {
- do { /* Find a blank entry for the SFN */
- res = move_window(dj->fs, dj->sect);
- if (res != FR_OK) break;
- c = *dj->dir;
- if (c == DDE || c == 0) break; /* Is it a blank entry? */
- res = dir_next(dj, 1); /* Next entry with table stretch */
- } while (res == FR_OK);
- }
+ res = dir_alloc(dj, 1); /* Allocate an entry for SFN */
#endif
- if (res == FR_OK) { /* Initialize the SFN entry */
+ if (res == FR_OK) { /* Set SFN entry */
res = move_window(dj->fs, dj->sect);
if (res == FR_OK) {
- dir = dj->dir;
- mem_set(dir, 0, SZ_DIR); /* Clean the entry */
- mem_cpy(dir, dj->fn, 11); /* Put SFN */
+ mem_set(dj->dir, 0, SZ_DIR); /* Clean the entry */
+ mem_cpy(dj->dir, dj->fn, 11); /* Put SFN */
#if _USE_LFN
- dir[DIR_NTres] = *(dj->fn+NS) & (NS_BODY | NS_EXT); /* Put NT flag */
+ dj->dir[DIR_NTres] = *(dj->fn+NS) & (NS_BODY | NS_EXT); /* Put NT flag */
#endif
dj->fs->wflag = 1;
}
@@ -1625,10 +1689,6 @@ FRESULT create_name (
const TCHAR **path /* Pointer to pointer to the segment in the path string */
)
{
-#ifdef _EXCVT
- static const BYTE excvt[] = _EXCVT; /* Upper conversion table for extended chars */
-#endif
-
#if _USE_LFN /* LFN configuration */
BYTE b, cf;
WCHAR w, *lfn;
@@ -1707,7 +1767,7 @@ FRESULT create_name (
if (w >= 0x80) { /* Non ASCII char */
#ifdef _EXCVT
w = ff_convert(w, 0); /* Unicode -> OEM code */
- if (w) w = excvt[w - 0x80]; /* Convert extended char to upper (SBCS) */
+ if (w) w = ExCvt[w - 0x80]; /* Convert extended char to upper (SBCS) */
#else
w = ff_convert(ff_wtoupper(w), 0); /* Upper converted Unicode -> OEM code */
#endif
@@ -1784,10 +1844,10 @@ FRESULT create_name (
if (c >= 0x80) { /* Extended char? */
b |= 3; /* Eliminate NT flag */
#ifdef _EXCVT
- c = excvt[c-0x80]; /* Upper conversion (SBCS) */
+ c = ExCvt[c - 0x80]; /* To upper extended chars (SBCS cfg) */
#else
-#if !_DF1S /* ASCII only cfg */
- return FR_INVALID_NAME;
+#if !_DF1S
+ return FR_INVALID_NAME; /* Reject extended chars (ASCII cfg) */
#endif
#endif
}
@@ -1832,7 +1892,7 @@ FRESULT create_name (
/*-----------------------------------------------------------------------*/
/* Get file information from directory entry */
/*-----------------------------------------------------------------------*/
-#if _FS_MINIMIZE <= 1
+#if _FS_MINIMIZE <= 1 || _FS_RPATH >= 2
static
void get_fileinfo ( /* No return code */
DIR *dj, /* Pointer to the directory object */
@@ -1906,7 +1966,7 @@ void get_fileinfo ( /* No return code */
}
#endif
}
-#endif /* _FS_MINIMIZE <= 1 */
+#endif /* _FS_MINIMIZE <= 1 || _FS_RPATH >= 2*/
@@ -1940,7 +2000,6 @@ FRESULT follow_path ( /* FR_OK(0): successful, !=0: error code */
if ((UINT)*path < ' ') { /* Nul path means the start directory itself */
res = dir_sdi(dj, 0);
dj->dir = 0;
-
} else { /* Follow path */
for (;;) {
res = create_name(dj, &path); /* Get a segment */
@@ -1948,7 +2007,7 @@ FRESULT follow_path ( /* FR_OK(0): successful, !=0: error code */
res = dir_find(dj); /* Find it */
ns = *(dj->fn+NS);
if (res != FR_OK) { /* Failed to find the object */
- if (res != FR_NO_FILE) break; /* Abort if any hard error occured */
+ if (res != FR_NO_FILE) break; /* Abort if any hard error occurred */
/* Object not found */
if (_FS_RPATH && (ns & NS_DOT)) { /* If dot entry is not exit */
dj->sclust = 0; dj->dir = 0; /* It is the root dir */
@@ -1964,7 +2023,7 @@ FRESULT follow_path ( /* FR_OK(0): successful, !=0: error code */
if (!(dir[DIR_Attr] & AM_DIR)) { /* Cannot follow because it is a file */
res = FR_NO_PATH; break;
}
- dj->sclust = LD_CLUST(dir);
+ dj->sclust = ld_clust(dj->fs, dir);
}
}
@@ -1979,7 +2038,7 @@ FRESULT follow_path ( /* FR_OK(0): successful, !=0: error code */
/*-----------------------------------------------------------------------*/
static
-BYTE check_fs ( /* 0:FAT-VBR, 1:Valid BR but not FAT, 2:Not a BR, 3:Disk error */
+BYTE check_fs ( /* 0:FAT-VBR, 1:Any BR but not FAT, 2:Not a BR, 3:Disk error */
FATFS *fs, /* File system object */
DWORD sect /* Sector# (lba) to check if it is an FAT boot record or not */
)
@@ -2008,7 +2067,7 @@ static
FRESULT chk_mounted ( /* FR_OK(0): successful, !=0: any error occurred */
const TCHAR **path, /* Pointer to pointer to the path name (drive number) */
FATFS **rfs, /* Pointer to pointer to the found file system object */
- BYTE chk_wp /* !=0: Check media write protection for write access */
+ BYTE wmode /* !=0: Check write protection for write access */
)
{
BYTE fmt, b, pi, *tbl;
@@ -2019,11 +2078,12 @@ FRESULT chk_mounted ( /* FR_OK(0): successful, !=0: any error occurred */
const TCHAR *p = *path;
FATFS *fs;
+
/* Get logical drive number from the path name */
vol = p[0] - '0'; /* Is there a drive number? */
if (vol <= 9 && p[1] == ':') { /* Found a drive number, get and strip it */
p += 2; *path = p; /* Return pointer to the path name */
- } else { /* No drive number is given */
+ } else { /* No drive number, use default drive */
#if _FS_RPATH
vol = CurrVol; /* Use current drive */
#else
@@ -2032,17 +2092,19 @@ FRESULT chk_mounted ( /* FR_OK(0): successful, !=0: any error occurred */
}
/* Check if the file system object is valid or not */
+ *rfs = 0;
if (vol >= _VOLUMES) /* Is the drive number valid? */
return FR_INVALID_DRIVE;
- *rfs = fs = FatFs[vol]; /* Return pointer to the corresponding file system object */
+ fs = FatFs[vol]; /* Get corresponding file system object */
if (!fs) return FR_NOT_ENABLED; /* Is the file system object available? */
- ENTER_FF(fs); /* Lock file system */
+ ENTER_FF(fs); /* Lock volume */
- if (fs->fs_type) { /* If the logical drive has been mounted */
+ *rfs = fs; /* Return pointer to the corresponding file system object */
+ if (fs->fs_type) { /* If the volume has been mounted */
stat = disk_status(fs->drv);
if (!(stat & STA_NOINIT)) { /* and the physical drive is kept initialized (has not been changed), */
- if (!_FS_READONLY && chk_wp && (stat & STA_PROTECT)) /* Check write protection if needed */
+ if (!_FS_READONLY && wmode && (stat & STA_PROTECT)) /* Check write protection if needed */
return FR_WRITE_PROTECTED;
return FR_OK; /* The file system object is valid */
}
@@ -2053,16 +2115,16 @@ FRESULT chk_mounted ( /* FR_OK(0): successful, !=0: any error occurred */
fs->fs_type = 0; /* Clear the file system object */
fs->drv = LD2PD(vol); /* Bind the logical drive and a physical drive */
- stat = disk_initialize(fs->drv); /* Initialize low level disk I/O layer */
+ stat = disk_initialize(fs->drv); /* Initialize the physical drive */
if (stat & STA_NOINIT) /* Check if the initialization succeeded */
- return FR_NOT_READY; /* Failed to initialize due to no media or hard error */
- if (!_FS_READONLY && chk_wp && (stat & STA_PROTECT)) /* Check disk write protection if needed */
+ return FR_NOT_READY; /* Failed to initialize due to no medium or hard error */
+ if (!_FS_READONLY && wmode && (stat & STA_PROTECT)) /* Check disk write protection if needed */
return FR_WRITE_PROTECTED;
#if _MAX_SS != 512 /* Get disk sector size (variable sector size cfg only) */
if (disk_ioctl(fs->drv, GET_SECTOR_SIZE, &fs->ssize) != RES_OK)
return FR_DISK_ERR;
#endif
- /* Search FAT partition on the drive. Supports only generic partitionings, FDISK and SFD. */
+ /* Search FAT partition on the drive. Supports only generic partitions, FDISK and SFD. */
fmt = check_fs(fs, bsect = 0); /* Load sector 0 and check if it is an FAT-VBR (in SFD) */
if (LD2PT(vol) && !fmt) fmt = 1; /* Force non-SFD if the volume is forced partition */
if (fmt == 1) { /* Not an FAT-VBR, the physical drive can be partitioned */
@@ -2114,8 +2176,9 @@ FRESULT chk_mounted ( /* FR_OK(0): successful, !=0: any error occurred */
/* Boundaries and Limits */
fs->n_fatent = nclst + 2; /* Number of FAT entries */
- fs->database = bsect + sysect; /* Data start sector */
+ fs->volbase = bsect; /* Volume start sector */
fs->fatbase = bsect + nrsv; /* FAT start sector */
+ fs->database = bsect + sysect; /* Data start sector */
if (fmt == FS_FAT32) {
if (fs->n_rootdir) return FR_NO_FILESYSTEM; /* (BPB_RootEntCnt must be 0) */
fs->dirbase = LD_DWORD(fs->win+BPB_RootClus); /* Root directory start cluster */
@@ -2154,7 +2217,7 @@ FRESULT chk_mounted ( /* FR_OK(0): successful, !=0: any error occurred */
#if _FS_RPATH
fs->cdir = 0; /* Current directory (root dir) */
#endif
-#if _FS_SHARE /* Clear file lock semaphores */
+#if _FS_LOCK /* Clear file lock semaphores */
clear_lock(fs);
#endif
@@ -2170,16 +2233,18 @@ FRESULT chk_mounted ( /* FR_OK(0): successful, !=0: any error occurred */
static
FRESULT validate ( /* FR_OK(0): The object is valid, !=0: Invalid */
- FATFS *fs, /* Pointer to the file system object */
- WORD id /* Member id of the target object to be checked */
+ void* obj /* Pointer to the object FIL/DIR to check validity */
)
{
- if (!fs || !fs->fs_type || fs->id != id)
+ FIL *fil = (FIL*)obj; /* Assuming offset of fs and id in the FIL/DIR is identical */
+
+
+ if (!fil || !fil->fs || !fil->fs->fs_type || fil->fs->id != fil->id)
return FR_INVALID_OBJECT;
- ENTER_FF(fs); /* Lock file system */
+ ENTER_FF(fil->fs); /* Lock file system */
- if (disk_status(fs->drv) & STA_NOINIT)
+ if (disk_status(fil->fs->drv) & STA_NOINIT)
return FR_NOT_READY;
return FR_OK;
@@ -2213,7 +2278,7 @@ FRESULT f_mount (
rfs = FatFs[vol]; /* Get current fs object */
if (rfs) {
-#if _FS_SHARE
+#if _FS_LOCK
clear_lock(rfs);
#endif
#if _FS_REENTRANT /* Discard sync object of the current volume */
@@ -2252,6 +2317,7 @@ FRESULT f_open (
DEF_NAMEBUF;
+ if (!fp) return FR_INVALID_OBJECT;
fp->fs = 0; /* Clear file object */
#if !_FS_READONLY
@@ -2261,103 +2327,104 @@ FRESULT f_open (
mode &= FA_READ;
res = chk_mounted(&path, &dj.fs, 0);
#endif
- INIT_BUF(dj);
- if (res == FR_OK)
+ if (res == FR_OK) {
+ INIT_BUF(dj);
res = follow_path(&dj, path); /* Follow the file path */
- dir = dj.dir;
-
+ dir = dj.dir;
#if !_FS_READONLY /* R/W configuration */
- if (res == FR_OK) {
- if (!dir) /* Current dir itself */
- res = FR_INVALID_NAME;
-#if _FS_SHARE
- else
- res = chk_lock(&dj, (mode & ~FA_READ) ? 1 : 0);
+ if (res == FR_OK) {
+ if (!dir) /* Current dir itself */
+ res = FR_INVALID_NAME;
+#if _FS_LOCK
+ else
+ res = chk_lock(&dj, (mode & ~FA_READ) ? 1 : 0);
#endif
- }
- /* Create or Open a file */
- if (mode & (FA_CREATE_ALWAYS | FA_OPEN_ALWAYS | FA_CREATE_NEW)) {
- DWORD dw, cl;
-
- if (res != FR_OK) { /* No file, create new */
- if (res == FR_NO_FILE) /* There is no file to open, create a new entry */
-#if _FS_SHARE
- res = enq_lock() ? dir_register(&dj) : FR_TOO_MANY_OPEN_FILES;
+ }
+ /* Create or Open a file */
+ if (mode & (FA_CREATE_ALWAYS | FA_OPEN_ALWAYS | FA_CREATE_NEW)) {
+ DWORD dw, cl;
+
+ if (res != FR_OK) { /* No file, create new */
+ if (res == FR_NO_FILE) /* There is no file to open, create a new entry */
+#if _FS_LOCK
+ res = enq_lock() ? dir_register(&dj) : FR_TOO_MANY_OPEN_FILES;
#else
- res = dir_register(&dj);
+ res = dir_register(&dj);
#endif
- mode |= FA_CREATE_ALWAYS; /* File is created */
- dir = dj.dir; /* New entry */
- }
- else { /* Any object is already existing */
- if (dir[DIR_Attr] & (AM_RDO | AM_DIR)) { /* Cannot overwrite it (R/O or DIR) */
- res = FR_DENIED;
- } else {
- if (mode & FA_CREATE_NEW) /* Cannot create as new file */
- res = FR_EXIST;
+ mode |= FA_CREATE_ALWAYS; /* File is created */
+ dir = dj.dir; /* New entry */
}
- }
- if (res == FR_OK && (mode & FA_CREATE_ALWAYS)) { /* Truncate it if overwrite mode */
- dw = get_fattime(); /* Created time */
- ST_DWORD(dir+DIR_CrtTime, dw);
- dir[DIR_Attr] = 0; /* Reset attribute */
- ST_DWORD(dir+DIR_FileSize, 0); /* size = 0 */
- cl = LD_CLUST(dir); /* Get start cluster */
- ST_CLUST(dir, 0); /* cluster = 0 */
- dj.fs->wflag = 1;
- if (cl) { /* Remove the cluster chain if exist */
- dw = dj.fs->winsect;
- res = remove_chain(dj.fs, cl);
- if (res == FR_OK) {
- dj.fs->last_clust = cl - 1; /* Reuse the cluster hole */
- res = move_window(dj.fs, dw);
+ else { /* Any object is already existing */
+ if (dir[DIR_Attr] & (AM_RDO | AM_DIR)) { /* Cannot overwrite it (R/O or DIR) */
+ res = FR_DENIED;
+ } else {
+ if (mode & FA_CREATE_NEW) /* Cannot create as new file */
+ res = FR_EXIST;
+ }
+ }
+ if (res == FR_OK && (mode & FA_CREATE_ALWAYS)) { /* Truncate it if overwrite mode */
+ dw = get_fattime(); /* Created time */
+ ST_DWORD(dir+DIR_CrtTime, dw);
+ dir[DIR_Attr] = 0; /* Reset attribute */
+ ST_DWORD(dir+DIR_FileSize, 0); /* size = 0 */
+ cl = ld_clust(dj.fs, dir); /* Get start cluster */
+ st_clust(dir, 0); /* cluster = 0 */
+ dj.fs->wflag = 1;
+ if (cl) { /* Remove the cluster chain if exist */
+ dw = dj.fs->winsect;
+ res = remove_chain(dj.fs, cl);
+ if (res == FR_OK) {
+ dj.fs->last_clust = cl - 1; /* Reuse the cluster hole */
+ res = move_window(dj.fs, dw);
+ }
}
}
}
- }
- else { /* Open an existing file */
- if (res == FR_OK) { /* Follow succeeded */
- if (dir[DIR_Attr] & AM_DIR) { /* It is a directory */
- res = FR_NO_FILE;
- } else {
- if ((mode & FA_WRITE) && (dir[DIR_Attr] & AM_RDO)) /* R/O violation */
- res = FR_DENIED;
+ else { /* Open an existing file */
+ if (res == FR_OK) { /* Follow succeeded */
+ if (dir[DIR_Attr] & AM_DIR) { /* It is a directory */
+ res = FR_NO_FILE;
+ } else {
+ if ((mode & FA_WRITE) && (dir[DIR_Attr] & AM_RDO)) /* R/O violation */
+ res = FR_DENIED;
+ }
}
}
- }
- if (res == FR_OK) {
- if (mode & FA_CREATE_ALWAYS) /* Set file change flag if created or overwritten */
- mode |= FA__WRITTEN;
- fp->dir_sect = dj.fs->winsect; /* Pointer to the directory entry */
- fp->dir_ptr = dir;
-#if _FS_SHARE
- fp->lockid = inc_lock(&dj, (mode & ~FA_READ) ? 1 : 0);
- if (!fp->lockid) res = FR_INT_ERR;
+ if (res == FR_OK) {
+ if (mode & FA_CREATE_ALWAYS) /* Set file change flag if created or overwritten */
+ mode |= FA__WRITTEN;
+ fp->dir_sect = dj.fs->winsect; /* Pointer to the directory entry */
+ fp->dir_ptr = dir;
+#if _FS_LOCK
+ fp->lockid = inc_lock(&dj, (mode & ~FA_READ) ? 1 : 0);
+ if (!fp->lockid) res = FR_INT_ERR;
#endif
- }
+ }
#else /* R/O configuration */
- if (res == FR_OK) { /* Follow succeeded */
- if (!dir) { /* Current dir itself */
- res = FR_INVALID_NAME;
- } else {
- if (dir[DIR_Attr] & AM_DIR) /* It is a directory */
- res = FR_NO_FILE;
+ if (res == FR_OK) { /* Follow succeeded */
+ dir = dj.dir;
+ if (!dir) { /* Current dir itself */
+ res = FR_INVALID_NAME;
+ } else {
+ if (dir[DIR_Attr] & AM_DIR) /* It is a directory */
+ res = FR_NO_FILE;
+ }
}
- }
#endif
- FREE_BUF();
+ FREE_BUF();
- if (res == FR_OK) {
- fp->flag = mode; /* File access mode */
- fp->sclust = LD_CLUST(dir); /* File start cluster */
- fp->fsize = LD_DWORD(dir+DIR_FileSize); /* File size */
- fp->fptr = 0; /* File pointer */
- fp->dsect = 0;
+ if (res == FR_OK) {
+ fp->flag = mode; /* File access mode */
+ fp->sclust = ld_clust(dj.fs, dir); /* File start cluster */
+ fp->fsize = LD_DWORD(dir+DIR_FileSize); /* File size */
+ fp->fptr = 0; /* File pointer */
+ fp->dsect = 0;
#if _USE_FASTSEEK
- fp->cltbl = 0; /* Normal seek mode */
+ fp->cltbl = 0; /* Normal seek mode */
#endif
- fp->fs = dj.fs; fp->id = dj.fs->id; /* Validate file object */
+ fp->fs = dj.fs; fp->id = dj.fs->id; /* Validate file object */
+ }
}
LEAVE_FF(dj.fs, res);
@@ -2380,12 +2447,12 @@ FRESULT f_read (
FRESULT res;
DWORD clst, sect, remain;
UINT rcnt, cc;
- BYTE csect, *rbuff = buff;
+ BYTE csect, *rbuff = (BYTE*)buff;
- *br = 0; /* Initialize byte counter */
+ *br = 0; /* Clear read byte counter */
- res = validate(fp->fs, fp->id); /* Check validity */
+ res = validate(fp); /* Check validity */
if (res != FR_OK) LEAVE_FF(fp->fs, res);
if (fp->flag & FA__ERROR) /* Aborted file? */
LEAVE_FF(fp->fs, FR_INT_ERR);
@@ -2449,7 +2516,7 @@ FRESULT f_read (
#endif
fp->dsect = sect;
}
- rcnt = SS(fp->fs) - (fp->fptr % SS(fp->fs)); /* Get partial sector data from sector buffer */
+ rcnt = SS(fp->fs) - ((UINT)fp->fptr % SS(fp->fs)); /* Get partial sector data from sector buffer */
if (rcnt > btr) rcnt = btr;
#if _FS_TINY
if (move_window(fp->fs, fp->dsect)) /* Move sector window */
@@ -2481,13 +2548,13 @@ FRESULT f_write (
FRESULT res;
DWORD clst, sect;
UINT wcnt, cc;
- const BYTE *wbuff = buff;
+ const BYTE *wbuff = (const BYTE*)buff;
BYTE csect;
- *bw = 0; /* Initialize byte counter */
+ *bw = 0; /* Clear write byte counter */
- res = validate(fp->fs, fp->id); /* Check validity */
+ res = validate(fp); /* Check validity */
if (res != FR_OK) LEAVE_FF(fp->fs, res);
if (fp->flag & FA__ERROR) /* Aborted file? */
LEAVE_FF(fp->fs, FR_INT_ERR);
@@ -2518,7 +2585,7 @@ FRESULT f_write (
fp->clust = clst; /* Update current cluster */
}
#if _FS_TINY
- if (fp->fs->winsect == fp->dsect && move_window(fp->fs, 0)) /* Write-back sector cache */
+ if (fp->fs->winsect == fp->dsect && sync_window(fp->fs)) /* Write-back sector cache */
ABORT(fp->fs, FR_DISK_ERR);
#else
if (fp->flag & FA__DIRTY) { /* Write-back sector cache */
@@ -2552,7 +2619,7 @@ FRESULT f_write (
}
#if _FS_TINY
if (fp->fptr >= fp->fsize) { /* Avoid silly cache filling at growing edge */
- if (move_window(fp->fs, 0)) ABORT(fp->fs, FR_DISK_ERR);
+ if (sync_window(fp->fs)) ABORT(fp->fs, FR_DISK_ERR);
fp->fs->winsect = sect;
}
#else
@@ -2564,7 +2631,7 @@ FRESULT f_write (
#endif
fp->dsect = sect;
}
- wcnt = SS(fp->fs) - (fp->fptr % SS(fp->fs));/* Put partial sector into file I/O buffer */
+ wcnt = SS(fp->fs) - ((UINT)fp->fptr % SS(fp->fs));/* Put partial sector into file I/O buffer */
if (wcnt > btw) wcnt = btw;
#if _FS_TINY
if (move_window(fp->fs, fp->dsect)) /* Move sector window */
@@ -2595,11 +2662,11 @@ FRESULT f_sync (
)
{
FRESULT res;
- DWORD tim;
+ DWORD tm;
BYTE *dir;
- res = validate(fp->fs, fp->id); /* Check validity of the object */
+ res = validate(fp); /* Check validity of the object */
if (res == FR_OK) {
if (fp->flag & FA__WRITTEN) { /* Has the file been written? */
#if !_FS_TINY /* Write-back dirty buffer */
@@ -2615,12 +2682,13 @@ FRESULT f_sync (
dir = fp->dir_ptr;
dir[DIR_Attr] |= AM_ARC; /* Set archive bit */
ST_DWORD(dir+DIR_FileSize, fp->fsize); /* Update file size */
- ST_CLUST(dir, fp->sclust); /* Update start cluster */
- tim = get_fattime(); /* Update updated time */
- ST_DWORD(dir+DIR_WrtTime, tim);
+ st_clust(dir, fp->sclust); /* Update start cluster */
+ tm = get_fattime(); /* Update updated time */
+ ST_DWORD(dir+DIR_WrtTime, tm);
+ ST_WORD(dir+DIR_LstAccDate, 0);
fp->flag &= ~FA__WRITTEN;
fp->fs->wflag = 1;
- res = sync(fp->fs);
+ res = sync_fs(fp->fs);
}
}
}
@@ -2643,21 +2711,26 @@ FRESULT f_close (
{
FRESULT res;
-#if _FS_READONLY
- FATFS *fs = fp->fs;
- res = validate(fs, fp->id);
- if (res == FR_OK) fp->fs = 0; /* Discard file object */
- LEAVE_FF(fs, res);
+#if _FS_READONLY
+ res = validate(fp);
+ {
+#if _FS_REENTRANT
+ FATFS *fs = fp->fs;
+#endif
+ if (res == FR_OK) fp->fs = 0; /* Discard file object */
+ LEAVE_FF(fs, res);
+ }
#else
res = f_sync(fp); /* Flush cached data */
-#if _FS_SHARE
+#if _FS_LOCK
if (res == FR_OK) { /* Decrement open counter */
#if _FS_REENTRANT
- res = validate(fp->fs, fp->id);
+ FATFS *fs = fp->fs;;
+ res = validate(fp);
if (res == FR_OK) {
res = dec_lock(fp->lockid);
- unlock_fs(fp->fs, FR_OK);
+ unlock_fs(fs, FR_OK);
}
#else
res = dec_lock(fp->lockid);
@@ -2710,7 +2783,7 @@ FRESULT f_chdir (
dj.fs->cdir = dj.sclust; /* Start directory itself */
} else {
if (dj.dir[DIR_Attr] & AM_DIR) /* Reached to the directory */
- dj.fs->cdir = LD_CLUST(dj.dir);
+ dj.fs->cdir = ld_clust(dj.fs, dj.dir);
else
res = FR_NO_PATH; /* Reached but a file */
}
@@ -2724,8 +2797,8 @@ FRESULT f_chdir (
#if _FS_RPATH >= 2
FRESULT f_getcwd (
- TCHAR *path, /* Pointer to the directory path */
- UINT sz_path /* Size of path */
+ TCHAR *buff, /* Pointer to the directory path */
+ UINT len /* Size of path */
)
{
FRESULT res;
@@ -2737,52 +2810,52 @@ FRESULT f_getcwd (
DEF_NAMEBUF;
- *path = 0;
- res = chk_mounted((const TCHAR**)&path, &dj.fs, 0); /* Get current volume */
+ *buff = 0;
+ res = chk_mounted((const TCHAR**)&buff, &dj.fs, 0); /* Get current volume */
if (res == FR_OK) {
INIT_BUF(dj);
- i = sz_path; /* Bottom of buffer (dir stack base) */
+ i = len; /* Bottom of buffer (dir stack base) */
dj.sclust = dj.fs->cdir; /* Start to follow upper dir from current dir */
while ((ccl = dj.sclust) != 0) { /* Repeat while current dir is a sub-dir */
res = dir_sdi(&dj, 1); /* Get parent dir */
if (res != FR_OK) break;
- res = dir_read(&dj);
+ res = dir_read(&dj, 0);
if (res != FR_OK) break;
- dj.sclust = LD_CLUST(dj.dir); /* Goto parent dir */
+ dj.sclust = ld_clust(dj.fs, dj.dir); /* Goto parent dir */
res = dir_sdi(&dj, 0);
if (res != FR_OK) break;
do { /* Find the entry links to the child dir */
- res = dir_read(&dj);
+ res = dir_read(&dj, 0);
if (res != FR_OK) break;
- if (ccl == LD_CLUST(dj.dir)) break; /* Found the entry */
+ if (ccl == ld_clust(dj.fs, dj.dir)) break; /* Found the entry */
res = dir_next(&dj, 0);
} while (res == FR_OK);
if (res == FR_NO_FILE) res = FR_INT_ERR;/* It cannot be 'not found'. */
if (res != FR_OK) break;
#if _USE_LFN
- fno.lfname = path;
+ fno.lfname = buff;
fno.lfsize = i;
#endif
get_fileinfo(&dj, &fno); /* Get the dir name and push it to the buffer */
tp = fno.fname;
- if (_USE_LFN && *path) tp = path;
+ if (_USE_LFN && *buff) tp = buff;
for (n = 0; tp[n]; n++) ;
if (i < n + 3) {
res = FR_NOT_ENOUGH_CORE; break;
}
- while (n) path[--i] = tp[--n];
- path[--i] = '/';
+ while (n) buff[--i] = tp[--n];
+ buff[--i] = '/';
}
- tp = path;
+ tp = buff;
if (res == FR_OK) {
*tp++ = '0' + CurrVol; /* Put drive number */
*tp++ = ':';
- if (i == sz_path) { /* Root-dir */
+ if (i == len) { /* Root-dir */
*tp++ = '/';
} else { /* Sub-dir */
do /* Add stacked path str */
- *tp++ = path[i++];
- while (i < sz_path);
+ *tp++ = buff[i++];
+ while (i < len);
}
}
*tp = 0;
@@ -2809,7 +2882,7 @@ FRESULT f_lseek (
FRESULT res;
- res = validate(fp->fs, fp->id); /* Check validity of the object */
+ res = validate(fp); /* Check validity of the object */
if (res != FR_OK) LEAVE_FF(fp->fs, res);
if (fp->flag & FA__ERROR) /* Check abort flag */
LEAVE_FF(fp->fs, FR_INT_ERR);
@@ -2956,7 +3029,7 @@ FRESULT f_lseek (
#if _FS_MINIMIZE <= 1
/*-----------------------------------------------------------------------*/
-/* Create a Directroy Object */
+/* Create a Directory Object */
/*-----------------------------------------------------------------------*/
FRESULT f_opendir (
@@ -2965,10 +3038,14 @@ FRESULT f_opendir (
)
{
FRESULT res;
+ FATFS *fs;
DEF_NAMEBUF;
+ if (!dj) return FR_INVALID_OBJECT;
+
res = chk_mounted(&path, &dj->fs, 0);
+ fs = dj->fs;
if (res == FR_OK) {
INIT_BUF(*dj);
res = follow_path(dj, path); /* Follow the path to the directory */
@@ -2976,27 +3053,30 @@ FRESULT f_opendir (
if (res == FR_OK) { /* Follow completed */
if (dj->dir) { /* It is not the root dir */
if (dj->dir[DIR_Attr] & AM_DIR) { /* The object is a directory */
- dj->sclust = LD_CLUST(dj->dir);
+ dj->sclust = ld_clust(fs, dj->dir);
} else { /* The object is not a directory */
res = FR_NO_PATH;
}
}
if (res == FR_OK) {
- dj->id = dj->fs->id;
+ dj->id = fs->id;
res = dir_sdi(dj, 0); /* Rewind dir */
}
}
if (res == FR_NO_FILE) res = FR_NO_PATH;
+ if (res != FR_OK) dj->fs = 0; /* Invalidate the dir object if function faild */
+ } else {
+ dj->fs = 0;
}
- LEAVE_FF(dj->fs, res);
+ LEAVE_FF(fs, res);
}
/*-----------------------------------------------------------------------*/
-/* Read Directory Entry in Sequense */
+/* Read Directory Entry in Sequence */
/*-----------------------------------------------------------------------*/
FRESULT f_readdir (
@@ -3008,13 +3088,13 @@ FRESULT f_readdir (
DEF_NAMEBUF;
- res = validate(dj->fs, dj->id); /* Check validity of the object */
+ res = validate(dj); /* Check validity of the object */
if (res == FR_OK) {
if (!fno) {
res = dir_sdi(dj, 0); /* Rewind the directory object */
} else {
INIT_BUF(*dj);
- res = dir_read(dj); /* Read an directory item */
+ res = dir_read(dj, 0); /* Read an item */
if (res == FR_NO_FILE) { /* Reached end of dir */
dj->sect = 0;
res = FR_OK;
@@ -3075,12 +3155,13 @@ FRESULT f_stat (
/*-----------------------------------------------------------------------*/
FRESULT f_getfree (
- const TCHAR *path, /* Pointer to the logical drive number (root dir) */
- DWORD *nclst, /* Pointer to the variable to return number of free clusters */
- FATFS **fatfs /* Pointer to pointer to corresponding file system object to return */
+ const TCHAR *path, /* Path name of the logical drive number */
+ DWORD *nclst, /* Pointer to a variable to return number of free clusters */
+ FATFS **fatfs /* Pointer to return pointer to corresponding file system object */
)
{
FRESULT res;
+ FATFS *fs;
DWORD n, clst, sect, stat;
UINT i;
BYTE fat, *p;
@@ -3088,32 +3169,33 @@ FRESULT f_getfree (
/* Get drive number */
res = chk_mounted(&path, fatfs, 0);
+ fs = *fatfs;
if (res == FR_OK) {
/* If free_clust is valid, return it without full cluster scan */
- if ((*fatfs)->free_clust <= (*fatfs)->n_fatent - 2) {
- *nclst = (*fatfs)->free_clust;
+ if (fs->free_clust <= fs->n_fatent - 2) {
+ *nclst = fs->free_clust;
} else {
/* Get number of free clusters */
- fat = (*fatfs)->fs_type;
+ fat = fs->fs_type;
n = 0;
if (fat == FS_FAT12) {
clst = 2;
do {
- stat = get_fat(*fatfs, clst);
+ stat = get_fat(fs, clst);
if (stat == 0xFFFFFFFF) { res = FR_DISK_ERR; break; }
if (stat == 1) { res = FR_INT_ERR; break; }
if (stat == 0) n++;
- } while (++clst < (*fatfs)->n_fatent);
+ } while (++clst < fs->n_fatent);
} else {
- clst = (*fatfs)->n_fatent;
- sect = (*fatfs)->fatbase;
+ clst = fs->n_fatent;
+ sect = fs->fatbase;
i = 0; p = 0;
do {
if (!i) {
- res = move_window(*fatfs, sect++);
+ res = move_window(fs, sect++);
if (res != FR_OK) break;
- p = (*fatfs)->win;
- i = SS(*fatfs);
+ p = fs->win;
+ i = SS(fs);
}
if (fat == FS_FAT16) {
if (LD_WORD(p) == 0) n++;
@@ -3124,12 +3206,12 @@ FRESULT f_getfree (
}
} while (--clst);
}
- (*fatfs)->free_clust = n;
- if (fat == FS_FAT32) (*fatfs)->fsi_flag = 1;
+ fs->free_clust = n;
+ if (fat == FS_FAT32) fs->fsi_flag = 1;
*nclst = n;
}
}
- LEAVE_FF(*fatfs, res);
+ LEAVE_FF(fs, res);
}
@@ -3147,7 +3229,7 @@ FRESULT f_truncate (
DWORD ncl;
- res = validate(fp->fs, fp->id); /* Check validity of the object */
+ res = validate(fp); /* Check validity of the object */
if (res == FR_OK) {
if (fp->flag & FA__ERROR) { /* Check abort flag */
res = FR_INT_ERR;
@@ -3204,7 +3286,7 @@ FRESULT f_unlink (
res = follow_path(&dj, path); /* Follow the file path */
if (_FS_RPATH && res == FR_OK && (dj.fn[NS] & NS_DOT))
res = FR_INVALID_NAME; /* Cannot remove dot entry */
-#if _FS_SHARE
+#if _FS_LOCK
if (res == FR_OK) res = chk_lock(&dj, 2); /* Cannot remove open file */
#endif
if (res == FR_OK) { /* The object is accessible */
@@ -3215,19 +3297,19 @@ FRESULT f_unlink (
if (dir[DIR_Attr] & AM_RDO)
res = FR_DENIED; /* Cannot remove R/O object */
}
- dclst = LD_CLUST(dir);
+ dclst = ld_clust(dj.fs, dir);
if (res == FR_OK && (dir[DIR_Attr] & AM_DIR)) { /* Is it a sub-dir? */
if (dclst < 2) {
res = FR_INT_ERR;
} else {
- mem_cpy(&sdj, &dj, sizeof(DIR)); /* Check if the sub-dir is empty or not */
+ mem_cpy(&sdj, &dj, sizeof (DIR)); /* Check if the sub-dir is empty or not */
sdj.sclust = dclst;
res = dir_sdi(&sdj, 2); /* Exclude dot entries */
if (res == FR_OK) {
- res = dir_read(&sdj);
- if (res == FR_OK /* Not empty dir */
+ res = dir_read(&sdj, 0); /* Read an item */
+ if (res == FR_OK /* Not empty dir */
#if _FS_RPATH
- || dclst == sdj.fs->cdir /* Current dir */
+ || dclst == dj.fs->cdir /* Current dir */
#endif
) res = FR_DENIED;
if (res == FR_NO_FILE) res = FR_OK; /* Empty */
@@ -3239,12 +3321,13 @@ FRESULT f_unlink (
if (res == FR_OK) {
if (dclst) /* Remove the cluster chain if exist */
res = remove_chain(dj.fs, dclst);
- if (res == FR_OK) res = sync(dj.fs);
+ if (res == FR_OK) res = sync_fs(dj.fs);
}
}
}
FREE_BUF();
}
+
LEAVE_FF(dj.fs, res);
}
@@ -3262,7 +3345,7 @@ FRESULT f_mkdir (
FRESULT res;
DIR dj;
BYTE *dir, n;
- DWORD dsc, dcl, pcl, tim = get_fattime();
+ DWORD dsc, dcl, pcl, tm = get_fattime();
DEF_NAMEBUF;
@@ -3280,25 +3363,25 @@ FRESULT f_mkdir (
if (dcl == 1) res = FR_INT_ERR;
if (dcl == 0xFFFFFFFF) res = FR_DISK_ERR;
if (res == FR_OK) /* Flush FAT */
- res = move_window(dj.fs, 0);
+ res = sync_window(dj.fs);
if (res == FR_OK) { /* Initialize the new directory table */
dsc = clust2sect(dj.fs, dcl);
dir = dj.fs->win;
mem_set(dir, 0, SS(dj.fs));
- mem_set(dir+DIR_Name, ' ', 8+3); /* Create "." entry */
+ mem_set(dir+DIR_Name, ' ', 11); /* Create "." entry */
dir[DIR_Name] = '.';
dir[DIR_Attr] = AM_DIR;
- ST_DWORD(dir+DIR_WrtTime, tim);
- ST_CLUST(dir, dcl);
+ ST_DWORD(dir+DIR_WrtTime, tm);
+ st_clust(dir, dcl);
mem_cpy(dir+SZ_DIR, dir, SZ_DIR); /* Create ".." entry */
dir[33] = '.'; pcl = dj.sclust;
if (dj.fs->fs_type == FS_FAT32 && pcl == dj.fs->dirbase)
pcl = 0;
- ST_CLUST(dir+SZ_DIR, pcl);
+ st_clust(dir+SZ_DIR, pcl);
for (n = dj.fs->csize; n; n--) { /* Write dot entries and clear following sectors */
dj.fs->winsect = dsc++;
dj.fs->wflag = 1;
- res = move_window(dj.fs, 0);
+ res = sync_window(dj.fs);
if (res != FR_OK) break;
mem_set(dir, 0, SS(dj.fs));
}
@@ -3309,10 +3392,10 @@ FRESULT f_mkdir (
} else {
dir = dj.dir;
dir[DIR_Attr] = AM_DIR; /* Attribute */
- ST_DWORD(dir+DIR_WrtTime, tim); /* Created time */
- ST_CLUST(dir, dcl); /* Table start cluster */
+ ST_DWORD(dir+DIR_WrtTime, tm); /* Created time */
+ st_clust(dir, dcl); /* Table start cluster */
dj.fs->wflag = 1;
- res = sync(dj.fs);
+ res = sync_fs(dj.fs);
}
}
FREE_BUF();
@@ -3355,7 +3438,7 @@ FRESULT f_chmod (
mask &= AM_RDO|AM_HID|AM_SYS|AM_ARC; /* Valid attribute mask */
dir[DIR_Attr] = (value & mask) | (dir[DIR_Attr] & (BYTE)~mask); /* Apply attribute change */
dj.fs->wflag = 1;
- res = sync(dj.fs);
+ res = sync_fs(dj.fs);
}
}
}
@@ -3396,7 +3479,7 @@ FRESULT f_utime (
ST_WORD(dir+DIR_WrtTime, fno->ftime);
ST_WORD(dir+DIR_WrtDate, fno->fdate);
dj.fs->wflag = 1;
- res = sync(dj.fs);
+ res = sync_fs(dj.fs);
}
}
}
@@ -3430,7 +3513,7 @@ FRESULT f_rename (
res = follow_path(&djo, path_old); /* Check old object */
if (_FS_RPATH && res == FR_OK && (djo.fn[NS] & NS_DOT))
res = FR_INVALID_NAME;
-#if _FS_SHARE
+#if _FS_LOCK
if (res == FR_OK) res = chk_lock(&djo, 2);
#endif
if (res == FR_OK) { /* Old object is found */
@@ -3438,11 +3521,11 @@ FRESULT f_rename (
res = FR_NO_FILE;
} else {
mem_cpy(buf, djo.dir+DIR_Attr, 21); /* Save the object information except for name */
- mem_cpy(&djn, &djo, sizeof(DIR)); /* Check new object */
+ mem_cpy(&djn, &djo, sizeof (DIR)); /* Check new object */
res = follow_path(&djn, path_new);
if (res == FR_OK) res = FR_EXIST; /* The new object name is already existing */
if (res == FR_NO_FILE) { /* Is it a valid path and no name collision? */
-/* Start critical section that any interruption or error can cause cross-link */
+/* Start critical section that any interruption can cause a cross-link */
res = dir_register(&djn); /* Register the new entry */
if (res == FR_OK) {
dir = djn.dir; /* Copy object information except for name */
@@ -3450,23 +3533,23 @@ FRESULT f_rename (
dir[DIR_Attr] = buf[0] | AM_ARC;
djo.fs->wflag = 1;
if (djo.sclust != djn.sclust && (dir[DIR_Attr] & AM_DIR)) { /* Update .. entry in the directory if needed */
- dw = clust2sect(djn.fs, LD_CLUST(dir));
+ dw = clust2sect(djo.fs, ld_clust(djo.fs, dir));
if (!dw) {
res = FR_INT_ERR;
} else {
- res = move_window(djn.fs, dw);
- dir = djn.fs->win+SZ_DIR; /* .. entry */
+ res = move_window(djo.fs, dw);
+ dir = djo.fs->win+SZ_DIR; /* .. entry */
if (res == FR_OK && dir[1] == '.') {
- dw = (djn.fs->fs_type == FS_FAT32 && djn.sclust == djn.fs->dirbase) ? 0 : djn.sclust;
- ST_CLUST(dir, dw);
- djn.fs->wflag = 1;
+ dw = (djo.fs->fs_type == FS_FAT32 && djn.sclust == djo.fs->dirbase) ? 0 : djn.sclust;
+ st_clust(dir, dw);
+ djo.fs->wflag = 1;
}
}
}
if (res == FR_OK) {
res = dir_remove(&djo); /* Remove old entry */
if (res == FR_OK)
- res = sync(djo.fs);
+ res = sync_fs(djo.fs);
}
}
/* End critical section */
@@ -3475,6 +3558,7 @@ FRESULT f_rename (
}
FREE_BUF();
}
+
LEAVE_FF(djo.fs, res);
}
@@ -3485,6 +3569,166 @@ FRESULT f_rename (
+#if _USE_LABEL
+/*-----------------------------------------------------------------------*/
+/* Get volume label */
+/*-----------------------------------------------------------------------*/
+
+FRESULT f_getlabel (
+ const TCHAR* path, /* Path name of the logical drive number */
+ TCHAR* label, /* Pointer to a buffer to return the volume label */
+ DWORD* sn /* Pointer to a variable to return the volume serial number */
+)
+{
+ FRESULT res;
+ DIR dj;
+ UINT i, j;
+
+
+ /* Get logical drive */
+ res = chk_mounted(&path, &dj.fs, 0);
+
+ /* Get volume label */
+ if (res == FR_OK && label) {
+ dj.sclust = 0; /* Open root dir */
+ res = dir_sdi(&dj, 0);
+ if (res == FR_OK) {
+ res = dir_read(&dj, 1); /* Get an entry with AM_VOL */
+ if (res == FR_OK) { /* A volume label is exist */
+#if _LFN_UNICODE
+ WCHAR w;
+ i = j = 0;
+ do {
+ w = (i < 11) ? dj.dir[i++] : ' ';
+ if (IsDBCS1(w) && i < 11 && IsDBCS2(dj.dir[i]))
+ w = (w << 8) | dj.dir[i++];
+ label[j++] = ff_convert(w, 1);
+ } while (j < 11);
+#else
+ mem_cpy(label, dj.dir, 11);
+#endif
+ j = 11;
+ do {
+ label[j] = 0;
+ if (!j) break;
+ } while (label[--j] == ' ');
+ }
+ if (res == FR_NO_FILE) { /* No label, return nul string */
+ label[0] = 0;
+ res = FR_OK;
+ }
+ }
+ }
+
+ /* Get volume serial number */
+ if (res == FR_OK && sn) {
+ res = move_window(dj.fs, dj.fs->volbase);
+ if (res == FR_OK) {
+ i = dj.fs->fs_type == FS_FAT32 ? BS_VolID32 : BS_VolID;
+ *sn = LD_DWORD(&dj.fs->win[i]);
+ }
+ }
+
+ LEAVE_FF(dj.fs, res);
+}
+
+
+
+#if !_FS_READONLY
+/*-----------------------------------------------------------------------*/
+/* Set volume label */
+/*-----------------------------------------------------------------------*/
+
+FRESULT f_setlabel (
+ const TCHAR* label /* Pointer to the volume label to set */
+)
+{
+ FRESULT res;
+ DIR dj;
+ BYTE vn[11];
+ UINT i, j, sl;
+ WCHAR w;
+ DWORD tm;
+
+
+ /* Get logical drive */
+ res = chk_mounted(&label, &dj.fs, 1);
+ if (res) LEAVE_FF(dj.fs, res);
+
+ /* Create a volume label in directory form */
+ vn[0] = 0;
+ for (sl = 0; label[sl]; sl++) ; /* Get name length */
+ for ( ; sl && label[sl-1] == ' '; sl--) ; /* Remove trailing spaces */
+ if (sl) { /* Create volume label in directory form */
+ i = j = 0;
+ do {
+#if _LFN_UNICODE
+ w = ff_convert(ff_wtoupper(label[i++]), 0);
+#else
+ w = (BYTE)label[i++];
+ if (IsDBCS1(w))
+ w = (j < 10 && i < sl && IsDBCS2(label[i])) ? (w << 8) | (BYTE)label[i++] : 0;
+#if _USE_LFN
+ w = ff_convert(ff_wtoupper(ff_convert(w, 1)), 0);
+#else
+ if (IsLower(w)) w -= 0x20; /* To upper ASCII chars */
+#ifdef _EXCVT
+ if (w >= 0x80) w = ExCvt[w - 0x80]; /* To upper extended chars (SBCS cfg) */
+#else
+ if (!_DF1S && w >= 0x80) w = 0; /* Reject extended chars (ASCII cfg) */
+#endif
+#endif
+#endif
+ if (!w || chk_chr("\"*+,.:;<=>\?[]|\x7F", w) || j >= (UINT)((w >= 0x100) ? 10 : 11)) /* Reject invalid chars for volume label */
+ LEAVE_FF(dj.fs, FR_INVALID_NAME);
+ if (w >= 0x100) vn[j++] = (BYTE)(w >> 8);
+ vn[j++] = (BYTE)w;
+ } while (i < sl);
+ while (j < 11) vn[j++] = ' ';
+ }
+
+ /* Set volume label */
+ dj.sclust = 0; /* Open root dir */
+ res = dir_sdi(&dj, 0);
+ if (res == FR_OK) {
+ res = dir_read(&dj, 1); /* Get an entry with AM_VOL */
+ if (res == FR_OK) { /* A volume label is found */
+ if (vn[0]) {
+ mem_cpy(dj.dir, vn, 11); /* Change the volume label name */
+ tm = get_fattime();
+ ST_DWORD(dj.dir+DIR_WrtTime, tm);
+ } else {
+ dj.dir[0] = DDE; /* Remove the volume label */
+ }
+ dj.fs->wflag = 1;
+ res = sync_fs(dj.fs);
+ } else { /* No volume label is found or error */
+ if (res == FR_NO_FILE) {
+ res = FR_OK;
+ if (vn[0]) { /* Create volume label as new */
+ res = dir_alloc(&dj, 1); /* Allocate an entry for volume label */
+ if (res == FR_OK) {
+ mem_set(dj.dir, 0, SZ_DIR); /* Set volume label */
+ mem_cpy(dj.dir, vn, 11);
+ dj.dir[DIR_Attr] = AM_VOL;
+ tm = get_fattime();
+ ST_DWORD(dj.dir+DIR_WrtTime, tm);
+ dj.fs->wflag = 1;
+ res = sync_fs(dj.fs);
+ }
+ }
+ }
+ }
+ }
+
+ LEAVE_FF(dj.fs, res);
+}
+
+#endif /* !_FS_READONLY */
+#endif /* _USE_LABEL */
+
+
+
/*-----------------------------------------------------------------------*/
/* Forward data to the stream directly (available on only tiny cfg) */
/*-----------------------------------------------------------------------*/
@@ -3493,7 +3737,7 @@ FRESULT f_rename (
FRESULT f_forward (
FIL *fp, /* Pointer to the file object */
UINT (*func)(const BYTE*,UINT), /* Pointer to the streaming function */
- UINT btr, /* Number of bytes to forward */
+ UINT btf, /* Number of bytes to forward */
UINT *bf /* Pointer to number of bytes forwarded */
)
{
@@ -3503,9 +3747,9 @@ FRESULT f_forward (
BYTE csect;
- *bf = 0; /* Initialize byte counter */
+ *bf = 0; /* Clear transfer byte counter */
- res = validate(fp->fs, fp->id); /* Check validity of the object */
+ res = validate(fp); /* Check validity of the object */
if (res != FR_OK) LEAVE_FF(fp->fs, res);
if (fp->flag & FA__ERROR) /* Check error flag */
LEAVE_FF(fp->fs, FR_INT_ERR);
@@ -3513,10 +3757,10 @@ FRESULT f_forward (
LEAVE_FF(fp->fs, FR_DENIED);
remain = fp->fsize - fp->fptr;
- if (btr > remain) btr = (UINT)remain; /* Truncate btr by remaining bytes */
+ if (btf > remain) btf = (UINT)remain; /* Truncate btf by remaining bytes */
- for ( ; btr && (*func)(0, 0); /* Repeat until all data transferred or stream becomes busy */
- fp->fptr += rcnt, *bf += rcnt, btr -= rcnt) {
+ for ( ; btf && (*func)(0, 0); /* Repeat until all data transferred or stream becomes busy */
+ fp->fptr += rcnt, *bf += rcnt, btf -= rcnt) {
csect = (BYTE)(fp->fptr / SS(fp->fs) & (fp->fs->csize - 1)); /* Sector offset in the cluster */
if ((fp->fptr % SS(fp->fs)) == 0) { /* On the sector boundary? */
if (!csect) { /* On the cluster boundary? */
@@ -3534,7 +3778,7 @@ FRESULT f_forward (
ABORT(fp->fs, FR_DISK_ERR);
fp->dsect = sect;
rcnt = SS(fp->fs) - (WORD)(fp->fptr % SS(fp->fs)); /* Forward data from sector window */
- if (rcnt > btr) rcnt = btr;
+ if (rcnt > btf) rcnt = btf;
rcnt = (*func)(&fp->fs->win[(WORD)fp->fptr % SS(fp->fs)], rcnt);
if (!rcnt) ABORT(fp->fs, FR_INT_ERR);
}
@@ -3554,7 +3798,7 @@ FRESULT f_forward (
FRESULT f_mkfs (
- BYTE drv, /* Logical drive number */
+ BYTE vol, /* Logical drive number */
BYTE sfd, /* Partitioning rule 0:FDISK, 1:SFD */
UINT au /* Allocation unit size [bytes] */
)
@@ -3571,14 +3815,14 @@ FRESULT f_mkfs (
/* Check mounted drive and clear work area */
- if (drv >= _VOLUMES) return FR_INVALID_DRIVE;
+ if (vol >= _VOLUMES) return FR_INVALID_DRIVE;
if (sfd > 1) return FR_INVALID_PARAMETER;
if (au & (au - 1)) return FR_INVALID_PARAMETER;
- fs = FatFs[drv];
+ fs = FatFs[vol];
if (!fs) return FR_NOT_ENABLED;
fs->fs_type = 0;
- pdrv = LD2PD(drv); /* Physical drive */
- part = LD2PT(drv); /* Partition (0:auto detect, 1-4:get from partition table)*/
+ pdrv = LD2PD(vol); /* Physical drive */
+ part = LD2PT(vol); /* Partition (0:auto detect, 1-4:get from partition table)*/
/* Get disk statics */
stat = disk_initialize(pdrv);
@@ -3613,7 +3857,7 @@ FRESULT f_mkfs (
if (au == 0) au = 1;
if (au > 128) au = 128;
- /* Pre-compute number of clusters and FAT syb-type */
+ /* Pre-compute number of clusters and FAT sub-type */
n_clst = n_vol / au;
fmt = FS_FAT12;
if (n_clst >= MIN_FAT16) fmt = FS_FAT16;
@@ -3665,18 +3909,18 @@ FRESULT f_mkfs (
if (disk_write(pdrv, fs->win, 0, 1) != RES_OK) return FR_DISK_ERR;
md = 0xF8;
} else {
- if (sfd) { /* No patition table (SFD) */
+ if (sfd) { /* No partition table (SFD) */
md = 0xF0;
} else { /* Create partition table (FDISK) */
mem_set(fs->win, 0, SS(fs));
- tbl = fs->win+MBR_Table; /* Create partiton table for single partition in the drive */
+ tbl = fs->win+MBR_Table; /* Create partition table for single partition in the drive */
tbl[1] = 1; /* Partition start head */
tbl[2] = 1; /* Partition start sector */
tbl[3] = 0; /* Partition start cylinder */
tbl[4] = sys; /* System type */
tbl[5] = 254; /* Partition end head */
n = (b_vol + n_vol) / 63 / 255;
- tbl[6] = (BYTE)((n >> 2) | 63); /* Partiiton end sector */
+ tbl[6] = (BYTE)((n >> 2) | 63); /* Partition end sector */
tbl[7] = (BYTE)n; /* End cylinder */
ST_DWORD(tbl+8, 63); /* Partition start in LBA */
ST_DWORD(tbl+12, n_vol); /* Partition size in LBA */
@@ -3784,7 +4028,7 @@ FRESULT f_mkfs (
}
-#if _MULTI_PARTITION == 2
+#if _MULTI_PARTITION
/*-----------------------------------------------------------------------*/
/* Divide Physical Drive */
/*-----------------------------------------------------------------------*/
@@ -3851,7 +4095,7 @@ FRESULT f_fdisk (
}
-#endif /* _MULTI_PARTITION == 2 */
+#endif /* _MULTI_PARTITION */
#endif /* _USE_MKFS && !_FS_READONLY */
@@ -3861,10 +4105,11 @@ FRESULT f_fdisk (
/*-----------------------------------------------------------------------*/
/* Get a string from the file */
/*-----------------------------------------------------------------------*/
+
TCHAR* f_gets (
TCHAR* buff, /* Pointer to the string buffer to read */
int len, /* Size of string buffer (characters) */
- FIL* fil /* Pointer to the file object */
+ FIL* fp /* Pointer to the file object */
)
{
int n = 0;
@@ -3874,24 +4119,24 @@ TCHAR* f_gets (
while (n < len - 1) { /* Read bytes until buffer gets filled */
- f_read(fil, s, 1, &rc);
+ f_read(fp, s, 1, &rc);
if (rc != 1) break; /* Break on EOF or error */
c = s[0];
#if _LFN_UNICODE /* Read a character in UTF-8 encoding */
if (c >= 0x80) {
if (c < 0xC0) continue; /* Skip stray trailer */
- if (c < 0xE0) { /* Two-byte sequense */
- f_read(fil, s, 1, &rc);
+ if (c < 0xE0) { /* Two-byte sequence */
+ f_read(fp, s, 1, &rc);
if (rc != 1) break;
c = ((c & 0x1F) << 6) | (s[0] & 0x3F);
if (c < 0x80) c = '?';
} else {
- if (c < 0xF0) { /* Three-byte sequense */
- f_read(fil, s, 2, &rc);
+ if (c < 0xF0) { /* Three-byte sequence */
+ f_read(fp, s, 2, &rc);
if (rc != 2) break;
c = (c << 12) | ((s[0] & 0x3F) << 6) | (s[1] & 0x3F);
if (c < 0x800) c = '?';
- } else { /* Reject four-byte sequense */
+ } else { /* Reject four-byte sequence */
c = '?';
}
}
@@ -3915,9 +4160,10 @@ TCHAR* f_gets (
/*-----------------------------------------------------------------------*/
/* Put a character to the file */
/*-----------------------------------------------------------------------*/
+
int f_putc (
TCHAR c, /* A character to be output */
- FIL* fil /* Pointer to the file object */
+ FIL* fp /* Pointer to the file object */
)
{
UINT bw, btw;
@@ -3925,7 +4171,7 @@ int f_putc (
#if _USE_STRFUNC >= 2
- if (c == '\n') f_putc ('\r', fil); /* LF -> CRLF conversion */
+ if (c == '\n') f_putc ('\r', fp); /* LF -> CRLF conversion */
#endif
#if _LFN_UNICODE /* Write the character in UTF-8 encoding */
@@ -3948,7 +4194,7 @@ int f_putc (
s[0] = (BYTE)c;
btw = 1;
#endif
- f_write(fil, s, btw, &bw); /* Write the char to the file */
+ f_write(fp, s, btw, &bw); /* Write the char to the file */
return (bw == btw) ? 1 : EOF; /* Return the result */
}
@@ -3958,16 +4204,17 @@ int f_putc (
/*-----------------------------------------------------------------------*/
/* Put a string to the file */
/*-----------------------------------------------------------------------*/
+
int f_puts (
const TCHAR* str, /* Pointer to the string to be output */
- FIL* fil /* Pointer to the file object */
+ FIL* fp /* Pointer to the file object */
)
{
int n;
for (n = 0; *str; str++, n++) {
- if (f_putc(*str, fil) == EOF) return EOF;
+ if (f_putc(*str, fp) == EOF) return EOF;
}
return n;
}
@@ -3978,8 +4225,9 @@ int f_puts (
/*-----------------------------------------------------------------------*/
/* Put a formatted string to the file */
/*-----------------------------------------------------------------------*/
+
int f_printf (
- FIL* fil, /* Pointer to the file object */
+ FIL* fp, /* Pointer to the file object */
const TCHAR* str, /* Pointer to the format string */
... /* Optional arguments... */
)
@@ -3998,7 +4246,7 @@ int f_printf (
c = *str++;
if (c == 0) break; /* End of string */
if (c != '%') { /* Non escape character */
- cc = f_putc(c, fil);
+ cc = f_putc(c, fp);
if (cc != EOF) cc = 1;
continue;
}
@@ -4027,14 +4275,14 @@ int f_printf (
for (j = 0; p[j]; j++) ;
chc = 0;
if (!(f & 2)) {
- while (j++ < w) chc += (cc = f_putc(' ', fil));
+ while (j++ < w) chc += (cc = f_putc(' ', fp));
}
- chc += (cc = f_puts(p, fil));
- while (j++ < w) chc += (cc = f_putc(' ', fil));
+ chc += (cc = f_puts(p, fp));
+ while (j++ < w) chc += (cc = f_putc(' ', fp));
if (cc != EOF) cc = chc;
continue;
case 'C' : /* Character */
- cc = f_putc((TCHAR)va_arg(arp, int), fil); continue;
+ cc = f_putc((TCHAR)va_arg(arp, int), fp); continue;
case 'B' : /* Binary */
r = 2; break;
case 'O' : /* Octal */
@@ -4044,8 +4292,8 @@ int f_printf (
r = 10; break;
case 'X' : /* Hexdecimal */
r = 16; break;
- default: /* Unknown type (passthrough) */
- cc = f_putc(c, fil); continue;
+ default: /* Unknown type (pass-through) */
+ cc = f_putc(c, fp); continue;
}
/* Get an argument and put it in numeral */
@@ -4059,14 +4307,14 @@ int f_printf (
d = (TCHAR)(v % r); v /= r;
if (d > 9) d += (c == 'x') ? 0x27 : 0x07;
s[i++] = d + '0';
- } while (v && i < sizeof(s) / sizeof(s[0]));
+ } while (v && i < sizeof s / sizeof s[0]);
if (f & 8) s[i++] = '-';
j = i; d = (f & 1) ? '0' : ' ';
- res = 0;
- while (!(f & 2) && j++ < w) res += (cc = f_putc(d, fil));
- do res += (cc = f_putc(s[--i], fil)); while(i);
- while (j++ < w) res += (cc = f_putc(' ', fil));
- if (cc != EOF) cc = res;
+ chc = 0;
+ while (!(f & 2) && j++ < w) chc += (cc = f_putc(d, fp));
+ do chc += (cc = f_putc(s[--i], fp)); while(i);
+ while (j++ < w) chc += (cc = f_putc(' ', fp));
+ if (cc != EOF) cc = chc;
}
va_end(arp);
diff --git a/data/sysrom/fat/src/ff.h b/data/sysrom/fat/src/ff.h
index 11f0364..b4115f6 100644
--- a/data/sysrom/fat/src/ff.h
+++ b/data/sysrom/fat/src/ff.h
@@ -1,11 +1,11 @@
/*---------------------------------------------------------------------------/
-/ FatFs - FAT file system module include file R0.09 (C)ChaN, 2011
+/ FatFs - FAT file system module include file R0.09b (C)ChaN, 2013
/----------------------------------------------------------------------------/
/ FatFs module is a generic FAT file system module for small embedded systems.
/ This is a free software that opened for education, research and commercial
-/ developments under license policy of following trems.
+/ developments under license policy of following terms.
/
-/ Copyright (C) 2011, ChaN, all right reserved.
+/ Copyright (C) 2013, ChaN, all right reserved.
/
/ * The FatFs module is a free software and there is NO WARRANTY.
/ * No restriction on use. You can use, modify and redistribute it for
@@ -15,7 +15,7 @@
/----------------------------------------------------------------------------*/
#ifndef _FATFS
-#define _FATFS 6502 /* Revision ID */
+#define _FATFS 82786 /* Revision ID */
#ifdef __cplusplus
extern "C" {
@@ -41,9 +41,9 @@ extern PARTITION VolToPart[]; /* Volume - Partition resolution table */
#define LD2PD(vol) (VolToPart[vol].pd) /* Get physical drive number */
#define LD2PT(vol) (VolToPart[vol].pt) /* Get partition index */
-#else /* Single partition configuration */
-#define LD2PD(vol) (vol) /* Each logical drive is bound to the same physical drive number */
-#define LD2PT(vol) 0 /* Always mounts the 1st partition or in SFD */
+#else /* Single partition configuration */
+#define LD2PD(vol) (BYTE)(vol) /* Each logical drive is bound to the same physical drive number */
+#define LD2PT(vol) 0 /* Always mounts the 1st partition or in SFD */
#endif
@@ -99,6 +99,7 @@ typedef struct {
#endif
DWORD n_fatent; /* Number of FAT entries (= number of clusters + 2) */
DWORD fsize; /* Sectors per FAT */
+ DWORD volbase; /* Volume start sector */
DWORD fatbase; /* FAT start sector */
DWORD dirbase; /* Root directory start sector (FAT32:Cluster#) */
DWORD database; /* Data start sector */
@@ -111,24 +112,24 @@ typedef struct {
/* File object structure (FIL) */
typedef struct {
- FATFS* fs; /* Pointer to the owner file system object */
- WORD id; /* Owner file system mount ID */
+ FATFS* fs; /* Pointer to the related file system object (**do not change order**) */
+ WORD id; /* Owner file system mount ID (**do not change order**) */
BYTE flag; /* File status flags */
BYTE pad1;
- DWORD fptr; /* File read/write pointer (0 on file open) */
+ DWORD fptr; /* File read/write pointer (0ed on file open) */
DWORD fsize; /* File size */
- DWORD sclust; /* File start cluster (0 when fsize==0) */
- DWORD clust; /* Current cluster */
- DWORD dsect; /* Current data sector */
+ DWORD sclust; /* File data start cluster (0:no data cluster, always 0 when fsize is 0) */
+ DWORD clust; /* Current cluster of fpter */
+ DWORD dsect; /* Current data sector of fpter */
#if !_FS_READONLY
DWORD dir_sect; /* Sector containing the directory entry */
- BYTE* dir_ptr; /* Ponter to the directory entry in the window */
+ BYTE* dir_ptr; /* Pointer to the directory entry in the window */
#endif
#if _USE_FASTSEEK
DWORD* cltbl; /* Pointer to the cluster link map table (null on file open) */
#endif
-#if _FS_SHARE
- UINT lockid; /* File lock ID (index of file semaphore table) */
+#if _FS_LOCK
+ UINT lockid; /* File lock ID (index of file semaphore table Files[]) */
#endif
#if !_FS_TINY
BYTE buf[_MAX_SS]; /* File data read/write buffer */
@@ -140,8 +141,8 @@ typedef struct {
/* Directory object structure (DIR) */
typedef struct {
- FATFS* fs; /* Pointer to the owner file system object */
- WORD id; /* Owner file system mount ID */
+ FATFS* fs; /* Pointer to the owner file system object (**do not change order**) */
+ WORD id; /* Owner file system mount ID (**do not change order**) */
WORD index; /* Current read/write index number */
DWORD sclust; /* Table start cluster (0:Root dir) */
DWORD clust; /* Current cluster */
@@ -176,14 +177,14 @@ typedef struct {
typedef enum {
FR_OK = 0, /* (0) Succeeded */
- FR_DISK_ERR, /* (1) A hard error occured in the low level disk I/O layer */
+ FR_DISK_ERR, /* (1) A hard error occurred in the low level disk I/O layer */
FR_INT_ERR, /* (2) Assertion failed */
FR_NOT_READY, /* (3) The physical drive cannot work */
FR_NO_FILE, /* (4) Could not find the file */
FR_NO_PATH, /* (5) Could not find the path */
FR_INVALID_NAME, /* (6) The path name format is invalid */
- FR_DENIED, /* (7) Acces denied due to prohibited access or directory full */
- FR_EXIST, /* (8) Acces denied due to prohibited access */
+ FR_DENIED, /* (7) Access denied due to prohibited access or directory full */
+ FR_EXIST, /* (8) Access denied due to prohibited access */
FR_INVALID_OBJECT, /* (9) The file/directory object is invalid */
FR_WRITE_PROTECTED, /* (10) The physical drive is write protected */
FR_INVALID_DRIVE, /* (11) The logical drive number is invalid */
@@ -191,7 +192,7 @@ typedef enum {
FR_NO_FILESYSTEM, /* (13) There is no valid FAT volume */
FR_MKFS_ABORTED, /* (14) The f_mkfs() aborted due to any parameter error */
FR_TIMEOUT, /* (15) Could not get a grant to access the volume within defined period */
- FR_LOCKED, /* (16) The operation is rejected according to the file shareing policy */
+ FR_LOCKED, /* (16) The operation is rejected according to the file sharing policy */
FR_NOT_ENOUGH_CORE, /* (17) LFN working buffer could not be allocated */
FR_TOO_MANY_OPEN_FILES, /* (18) Number of open files > _FS_SHARE */
FR_INVALID_PARAMETER /* (19) Given parameter is invalid */
@@ -202,33 +203,35 @@ typedef enum {
/*--------------------------------------------------------------*/
/* FatFs module application interface */
-FRESULT f_mount (BYTE, FATFS*); /* Mount/Unmount a logical drive */
-FRESULT f_open (FIL*, const TCHAR*, BYTE); /* Open or create a file */
-FRESULT f_read (FIL*, void*, UINT, UINT*); /* Read data from a file */
-FRESULT f_lseek (FIL*, DWORD); /* Move file pointer of a file object */
-FRESULT f_close (FIL*); /* Close an open file object */
-FRESULT f_opendir (DIR*, const TCHAR*); /* Open an existing directory */
-FRESULT f_readdir (DIR*, FILINFO*); /* Read a directory item */
-FRESULT f_stat (const TCHAR*, FILINFO*); /* Get file status */
-FRESULT f_write (FIL*, const void*, UINT, UINT*); /* Write data to a file */
-FRESULT f_getfree (const TCHAR*, DWORD*, FATFS**); /* Get number of free clusters on the drive */
-FRESULT f_truncate (FIL*); /* Truncate file */
-FRESULT f_sync (FIL*); /* Flush cached data of a writing file */
-FRESULT f_unlink (const TCHAR*); /* Delete an existing file or directory */
-FRESULT f_mkdir (const TCHAR*); /* Create a new directory */
-FRESULT f_chmod (const TCHAR*, BYTE, BYTE); /* Change attriburte of the file/dir */
-FRESULT f_utime (const TCHAR*, const FILINFO*); /* Change timestamp of the file/dir */
-FRESULT f_rename (const TCHAR*, const TCHAR*); /* Rename/Move a file or directory */
-FRESULT f_chdrive (BYTE); /* Change current drive */
-FRESULT f_chdir (const TCHAR*); /* Change current directory */
-FRESULT f_getcwd (TCHAR*, UINT); /* Get current directory */
-FRESULT f_forward (FIL*, UINT(*)(const BYTE*,UINT), UINT, UINT*); /* Forward data to the stream */
-FRESULT f_mkfs (BYTE, BYTE, UINT); /* Create a file system on the drive */
-FRESULT f_fdisk (BYTE, const DWORD[], void*); /* Divide a physical drive into some partitions */
-int f_putc (TCHAR, FIL*); /* Put a character to the file */
-int f_puts (const TCHAR*, FIL*); /* Put a string to the file */
-int f_printf (FIL*, const TCHAR*, ...); /* Put a formatted string to the file */
-TCHAR* f_gets (TCHAR*, int, FIL*); /* Get a string from the file */
+FRESULT f_mount (BYTE vol, FATFS* fs); /* Mount/Unmount a logical drive */
+FRESULT f_open (FIL* fp, const TCHAR* path, BYTE mode); /* Open or create a file */
+FRESULT f_read (FIL* fp, void* buff, UINT btr, UINT* br); /* Read data from a file */
+FRESULT f_lseek (FIL* fp, DWORD ofs); /* Move file pointer of a file object */
+FRESULT f_close (FIL* fp); /* Close an open file object */
+FRESULT f_opendir (DIR* dj, const TCHAR* path); /* Open an existing directory */
+FRESULT f_readdir (DIR* dj, FILINFO* fno); /* Read a directory item */
+FRESULT f_stat (const TCHAR* path, FILINFO* fno); /* Get file status */
+FRESULT f_write (FIL* fp, const void* buff, UINT btw, UINT* bw); /* Write data to a file */
+FRESULT f_getfree (const TCHAR* path, DWORD* nclst, FATFS** fatfs); /* Get number of free clusters on the drive */
+FRESULT f_truncate (FIL* fp); /* Truncate file */
+FRESULT f_sync (FIL* fp); /* Flush cached data of a writing file */
+FRESULT f_unlink (const TCHAR* path); /* Delete an existing file or directory */
+FRESULT f_mkdir (const TCHAR* path); /* Create a new directory */
+FRESULT f_chmod (const TCHAR* path, BYTE value, BYTE mask); /* Change attribute of the file/dir */
+FRESULT f_utime (const TCHAR* path, const FILINFO* fno); /* Change times-tamp of the file/dir */
+FRESULT f_rename (const TCHAR* path_old, const TCHAR* path_new); /* Rename/Move a file or directory */
+FRESULT f_chdrive (BYTE drv); /* Change current drive */
+FRESULT f_chdir (const TCHAR* path); /* Change current directory */
+FRESULT f_getcwd (TCHAR* buff, UINT len); /* Get current directory */
+FRESULT f_getlabel (const TCHAR* path, TCHAR* label, DWORD* sn); /* Get volume label */
+FRESULT f_setlabel (const TCHAR* label); /* Set volume label */
+FRESULT f_forward (FIL* fp, UINT(*func)(const BYTE*,UINT), UINT btf, UINT* bf); /* Forward data to the stream */
+FRESULT f_mkfs (BYTE vol, BYTE sfd, UINT au); /* Create a file system on the drive */
+FRESULT f_fdisk (BYTE pdrv, const DWORD szt[], void* work); /* Divide a physical drive into some partitions */
+int f_putc (TCHAR c, FIL* fp); /* Put a character to the file */
+int f_puts (const TCHAR* str, FIL* cp); /* Put a string to the file */
+int f_printf (FIL* fp, const TCHAR* str, ...); /* Put a formatted string to the file */
+TCHAR* f_gets (TCHAR* buff, int len, FIL* fp); /* Get a string from the file */
#define f_eof(fp) (((fp)->fptr == (fp)->fsize) ? 1 : 0)
#define f_error(fp) (((fp)->flag & FA__ERROR) ? 1 : 0)
@@ -251,21 +254,21 @@ DWORD get_fattime (void);
#endif
/* Unicode support functions */
-#if _USE_LFN /* Unicode - OEM code conversion */
-WCHAR ff_convert (WCHAR, UINT); /* OEM-Unicode bidirectional conversion */
-WCHAR ff_wtoupper (WCHAR); /* Unicode upper-case conversion */
-#if _USE_LFN == 3 /* Memory functions */
-void* ff_memalloc (UINT); /* Allocate memory block */
-void ff_memfree (void*); /* Free memory block */
+#if _USE_LFN /* Unicode - OEM code conversion */
+WCHAR ff_convert (WCHAR chr, UINT dir); /* OEM-Unicode bidirectional conversion */
+WCHAR ff_wtoupper (WCHAR chr); /* Unicode upper-case conversion */
+#if _USE_LFN == 3 /* Memory functions */
+void* ff_memalloc (UINT msize); /* Allocate memory block */
+void ff_memfree (void* mblock); /* Free memory block */
#endif
#endif
/* Sync functions */
#if _FS_REENTRANT
-int ff_cre_syncobj (BYTE, _SYNC_t*);/* Create a sync object */
-int ff_req_grant (_SYNC_t); /* Lock sync object */
-void ff_rel_grant (_SYNC_t); /* Unlock sync object */
-int ff_del_syncobj (_SYNC_t); /* Delete a sync object */
+int ff_cre_syncobj (BYTE vol, _SYNC_t* sobj); /* Create a sync object */
+int ff_req_grant (_SYNC_t sobj); /* Lock sync object */
+void ff_rel_grant (_SYNC_t sobj); /* Unlock sync object */
+int ff_del_syncobj (_SYNC_t sobj); /* Delete a sync object */
#endif
diff --git a/data/sysrom/fat/src/ffconf.h b/data/sysrom/fat/src/ffconf.h
index 6c529aa..51e8f27 100644
--- a/data/sysrom/fat/src/ffconf.h
+++ b/data/sysrom/fat/src/ffconf.h
@@ -1,5 +1,5 @@
/*---------------------------------------------------------------------------/
-/ FatFs - FAT file system module configuration file R0.09 (C)ChaN, 2011
+/ FatFs - FAT file system module configuration file R0.09b (C)ChaN, 2013
/----------------------------------------------------------------------------/
/
/ CAUTION! Do not forget to make clean the project after any changes to
@@ -7,7 +7,7 @@
/
/----------------------------------------------------------------------------*/
#ifndef _FFCONF
-#define _FFCONF 6502 /* Revision ID */
+#define _FFCONF 82786 /* Revision ID */
/*---------------------------------------------------------------------------/
@@ -44,20 +44,23 @@
/* To enable f_mkfs function, set _USE_MKFS to 1 and set _FS_READONLY to 0 */
-#define _USE_FORWARD 0 /* 0:Disable or 1:Enable */
-/* To enable f_forward function, set _USE_FORWARD to 1 and set _FS_TINY to 1. */
+#define _USE_FASTSEEK 0 /* 0:Disable or 1:Enable */
+/* To enable fast seek feature, set _USE_FASTSEEK to 1. */
-#define _USE_FASTSEEK 1 /* 0:Disable or 1:Enable */
-/* To enable fast seek feature, set _USE_FASTSEEK to 1. */
+#define _USE_LABEL 0 /* 0:Disable or 1:Enable */
+/* To enable volume label functions, set _USE_LAVEL to 1 */
+#define _USE_FORWARD 0 /* 0:Disable or 1:Enable */
+/* To enable f_forward function, set _USE_FORWARD to 1 and set _FS_TINY to 1. */
+
/*---------------------------------------------------------------------------/
/ Locale and Namespace Configurations
/----------------------------------------------------------------------------*/
-#define _CODE_PAGE 1252
+#define _CODE_PAGE 932
/* The _CODE_PAGE specifies the OEM code page to be used on the target system.
/ Incorrect setting of the code page can cause a file open failure.
/
@@ -90,7 +93,7 @@
*/
-#define _USE_LFN 2 /* 0 to 3 */
+#define _USE_LFN 0 /* 0 to 3 */
#define _MAX_LFN 255 /* Maximum LFN length to handle (12 to 255) */
/* The _USE_LFN option switches the LFN support.
/
@@ -110,7 +113,7 @@
/ enable LFN feature and set _LFN_UNICODE to 1. */
-#define _FS_RPATH 2 /* 0 to 2 */
+#define _FS_RPATH 0 /* 0 to 2 */
/* The _FS_RPATH option configures relative path feature.
/
/ 0: Disable relative path feature and remove related functions.
@@ -120,7 +123,6 @@
/ Note that output of the f_readdir fnction is affected by this option. */
-
/*---------------------------------------------------------------------------/
/ Physical Drive Configurations
/----------------------------------------------------------------------------*/
@@ -137,7 +139,7 @@
/ and GET_SECTOR_SIZE command must be implememted to the disk_ioctl function. */
-#define _MULTI_PARTITION 0 /* 0:Single partition, 1/2:Enable multiple partition */
+#define _MULTI_PARTITION 0 /* 0:Single partition, 1:Enable multiple partition */
/* When set to 0, each volume is bound to the same physical drive number and
/ it can mount only first primaly partition. When it is set to 1, each volume
/ is tied to the partitions listed in VolToPart[]. */
@@ -182,9 +184,9 @@
/ function must be added to the project. */
-#define _FS_SHARE 0 /* 0:Disable or >=1:Enable */
-/* To enable file shareing feature, set _FS_SHARE to 1 or greater. The value
- defines how many files can be opened simultaneously. */
+#define _FS_LOCK 0 /* 0:Disable or >=1:Enable */
+/* To enable file lock control feature, set _FS_LOCK to 1 or greater.
+ The value defines how many files can be opened simultaneously. */
#endif /* _FFCONFIG */
diff --git a/data/sysrom/fat/src/option/cc932.c b/data/sysrom/fat/src/option/cc932.c
index a5bb707..26ac70f 100644
--- a/data/sysrom/fat/src/option/cc932.c
+++ b/data/sysrom/fat/src/option/cc932.c
@@ -3724,7 +3724,7 @@ const WCHAR sjis2uni[] = {
WCHAR ff_convert ( /* Converted code, 0 means conversion error */
- WCHAR src, /* Character code to be converted */
+ WCHAR chr, /* Character code to be converted */
UINT dir /* 0: Unicode to OEMCP, 1: OEMCP to Unicode */
)
{
@@ -3733,8 +3733,8 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
int i, n, li, hi;
- if (src <= 0x80) { /* ASCII */
- c = src;
+ if (chr <= 0x80) { /* ASCII */
+ c = chr;
} else {
#if !_TINY_TABLE
if (dir) { /* OEMCP to unicode */
@@ -3747,8 +3747,8 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
li = 0;
for (n = 16; n; n--) {
i = li + (hi - li) / 2;
- if (src == p[i * 2]) break;
- if (src > p[i * 2])
+ if (chr == p[i * 2]) break;
+ if (chr > p[i * 2])
li = i;
else
hi = i;
@@ -3760,15 +3760,15 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
do {
c = *p;
p += 2;
- } while (c && c != src);
+ } while (c && c != chr);
p -= 3;
c = *p;
} else { /* Unicode to OEMCP */
li = 0; hi = sizeof(uni2sjis) / 4 - 1;
for (n = 16; n; n--) {
i = li + (hi - li) / 2;
- if (src == uni2sjis[i * 2]) break;
- if (src > uni2sjis[i * 2])
+ if (chr == uni2sjis[i * 2]) break;
+ if (chr > uni2sjis[i * 2])
li = i;
else
hi = i;
diff --git a/data/sysrom/fat/src/option/cc936.c b/data/sysrom/fat/src/option/cc936.c
index 6e58e89..07a7c1c 100644
--- a/data/sysrom/fat/src/option/cc936.c
+++ b/data/sysrom/fat/src/option/cc936.c
@@ -10922,7 +10922,7 @@ const WCHAR oem2uni[] = {
WCHAR ff_convert ( /* Converted code, 0 means conversion error */
- WCHAR src, /* Character code to be converted */
+ WCHAR chr, /* Character code to be converted */
UINT dir /* 0: Unicode to OEMCP, 1: OEMCP to Unicode */
)
{
@@ -10931,8 +10931,8 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
int i, n, li, hi;
- if (src < 0x80) { /* ASCII */
- c = src;
+ if (chr < 0x80) { /* ASCII */
+ c = chr;
} else {
if (dir) { /* OEMCP to unicode */
p = oem2uni;
@@ -10944,8 +10944,8 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
li = 0;
for (n = 16; n; n--) {
i = li + (hi - li) / 2;
- if (src == p[i * 2]) break;
- if (src > p[i * 2])
+ if (chr == p[i * 2]) break;
+ if (chr > p[i * 2])
li = i;
else
hi = i;
diff --git a/data/sysrom/fat/src/option/cc949.c b/data/sysrom/fat/src/option/cc949.c
index 626268b..1fd075d 100644
--- a/data/sysrom/fat/src/option/cc949.c
+++ b/data/sysrom/fat/src/option/cc949.c
@@ -8551,7 +8551,7 @@ const WCHAR oem2uni[] = {
WCHAR ff_convert ( /* Converted code, 0 means conversion error */
- WCHAR src, /* Character code to be converted */
+ WCHAR chr, /* Character code to be converted */
UINT dir /* 0: Unicode to OEMCP, 1: OEMCP to Unicode */
)
{
@@ -8560,8 +8560,8 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
int i, n, li, hi;
- if (src < 0x80) { /* ASCII */
- c = src;
+ if (chr < 0x80) { /* ASCII */
+ c = chr;
} else {
if (dir) { /* OEMCP to unicode */
p = oem2uni;
@@ -8573,8 +8573,8 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
li = 0;
for (n = 16; n; n--) {
i = li + (hi - li) / 2;
- if (src == p[i * 2]) break;
- if (src > p[i * 2])
+ if (chr == p[i * 2]) break;
+ if (chr > p[i * 2])
li = i;
else
hi = i;
diff --git a/data/sysrom/fat/src/option/cc950.c b/data/sysrom/fat/src/option/cc950.c
index f58c9a4..a3c9c44 100644
--- a/data/sysrom/fat/src/option/cc950.c
+++ b/data/sysrom/fat/src/option/cc950.c
@@ -6777,7 +6777,7 @@ const WCHAR oem2uni[] = {
WCHAR ff_convert ( /* Converted code, 0 means conversion error */
- WCHAR src, /* Character code to be converted */
+ WCHAR chr, /* Character code to be converted */
UINT dir /* 0: Unicode to OEMCP, 1: OEMCP to Unicode */
)
{
@@ -6786,8 +6786,8 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
int i, n, li, hi;
- if (src < 0x80) { /* ASCII */
- c = src;
+ if (chr < 0x80) { /* ASCII */
+ c = chr;
} else {
if (dir) { /* OEMCP to unicode */
p = oem2uni;
@@ -6799,8 +6799,8 @@ WCHAR ff_convert ( /* Converted code, 0 means conversion error */
li = 0;
for (n = 16; n; n--) {
i = li + (hi - li) / 2;
- if (src == p[i * 2]) break;
- if (src > p[i * 2])
+ if (chr == p[i * 2]) break;
+ if (chr > p[i * 2])
li = i;
else
hi = i;
diff --git a/data/sysrom/fat/src/option/ccsbcs.c b/data/sysrom/fat/src/option/ccsbcs.c
deleted file mode 100644
index eb0ab4e..0000000
--- a/data/sysrom/fat/src/option/ccsbcs.c
+++ /dev/null
@@ -1,540 +0,0 @@
-/*------------------------------------------------------------------------*/
-/* Unicode - Local code bidirectional converter (C)ChaN, 2009 */
-/* (SBCS code pages) */
-/*------------------------------------------------------------------------*/
-/* 437 U.S. (OEM)
-/ 720 Arabic (OEM)
-/ 1256 Arabic (Windows)
-/ 737 Greek (OEM)
-/ 1253 Greek (Windows)
-/ 1250 Central Europe (Windows)
-/ 775 Baltic (OEM)
-/ 1257 Baltic (Windows)
-/ 850 Multilingual Latin 1 (OEM)
-/ 852 Latin 2 (OEM)
-/ 1252 Latin 1 (Windows)
-/ 855 Cyrillic (OEM)
-/ 1251 Cyrillic (Windows)
-/ 866 Russian (OEM)
-/ 857 Turkish (OEM)
-/ 1254 Turkish (Windows)
-/ 858 Multilingual Latin 1 + Euro (OEM)
-/ 862 Hebrew (OEM)
-/ 1255 Hebrew (Windows)
-/ 874 Thai (OEM, Windows)
-/ 1258 Vietnam (OEM, Windows)
-*/
-
-#include "../ff.h"
-
-
-#if _CODE_PAGE == 437
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP437(0x80-0xFF) to Unicode conversion table */
- 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7,
- 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5,
- 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9,
- 0x00FF, 0x00D6, 0x00DC, 0x00A2, 0x00A3, 0x00A5, 0x20A7, 0x0192,
- 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA,
- 0x00BF, 0x2310, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
- 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556,
- 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510,
- 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F,
- 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567,
- 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B,
- 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580,
- 0x03B1, 0x00DF, 0x0393, 0x03C0, 0x03A3, 0x03C3, 0x00B5, 0x03C4,
- 0x03A6, 0x0398, 0x03A9, 0x03B4, 0x221E, 0x03C6, 0x03B5, 0x2229,
- 0x2261, 0x00B1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00F7, 0x2248,
- 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0
-};
-
-#elif _CODE_PAGE == 720
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP720(0x80-0xFF) to Unicode conversion table */
- 0x0000, 0x0000, 0x00E9, 0x00E2, 0x0000, 0x00E0, 0x0000, 0x00E7,
- 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x0651, 0x0652, 0x00F4, 0x00A4, 0x0640, 0x00FB, 0x00F9,
- 0x0621, 0x0622, 0x0623, 0x0624, 0x00A3, 0x0625, 0x0626, 0x0627,
- 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F,
- 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x00AB, 0x00BB,
- 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556,
- 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510,
- 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F,
- 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567,
- 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B,
- 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580,
- 0x0636, 0x0637, 0x0638, 0x0639, 0x063A, 0x0641, 0x00B5, 0x0642,
- 0x0643, 0x0644, 0x0645, 0x0646, 0x0647, 0x0648, 0x0649, 0x064A,
- 0x2261, 0x064B, 0x064C, 0x064D, 0x064E, 0x064F, 0xO650, 0x2248,
- 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0
-};
-
-#elif _CODE_PAGE == 737
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP737(0x80-0xFF) to Unicode conversion table */
- 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 0x0398,
- 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F, 0x03A0,
- 0x03A1, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7, 0x03A8, 0x03A9,
- 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, 0x03B8,
- 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, 0x03C0,
- 0x03C1, 0x03C3, 0x03C2, 0x03C4, 0x03C5, 0x03C6, 0x03C7, 0x03C8,
- 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556,
- 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510,
- 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F,
- 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567,
- 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B,
- 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580,
- 0x03C9, 0x03AC, 0x03AD, 0x03AE, 0x03CA, 0x03AF, 0x03CC, 0x03CD,
- 0x03CB, 0x03CE, 0x0386, 0x0388, 0x0389, 0x038A, 0x038C, 0x038E,
- 0x038F, 0x00B1, 0x2265, 0x2264, 0x03AA, 0x03AB, 0x00F7, 0x2248,
- 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0
-};
-
-#elif _CODE_PAGE == 775
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP775(0x80-0xFF) to Unicode conversion table */
- 0x0106, 0x00FC, 0x00E9, 0x0101, 0x00E4, 0x0123, 0x00E5, 0x0107,
- 0x0142, 0x0113, 0x0156, 0x0157, 0x012B, 0x0179, 0x00C4, 0x00C5,
- 0x00C9, 0x00E6, 0x00C6, 0x014D, 0x00F6, 0x0122, 0x00A2, 0x015A,
- 0x015B, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x00D7, 0x00A4,
- 0x0100, 0x012A, 0x00F3, 0x017B, 0x017C, 0x017A, 0x201D, 0x00A6,
- 0x00A9, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x0141, 0x00AB, 0x00BB,
- 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x0104, 0x010C, 0x0118,
- 0x0116, 0x2563, 0x2551, 0x2557, 0x255D, 0x012E, 0x0160, 0x2510,
- 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x0172, 0x016A,
- 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x017D,
- 0x0105, 0x010D, 0x0119, 0x0117, 0x012F, 0x0161, 0x0173, 0x016B,
- 0x017E, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580,
- 0x00D3, 0x00DF, 0x014C, 0x0143, 0x00F5, 0x00D5, 0x00B5, 0x0144,
- 0x0136, 0x0137, 0x013B, 0x013C, 0x0146, 0x0112, 0x0145, 0x2019,
- 0x00AD, 0x00B1, 0x201C, 0x00BE, 0x00B6, 0x00A7, 0x00F7, 0x201E,
- 0x00B0, 0x2219, 0x00B7, 0x00B9, 0x00B3, 0x00B2, 0x25A0, 0x00A0
-};
-
-#elif _CODE_PAGE == 850
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP850(0x80-0xFF) to Unicode conversion table */
- 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7,
- 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5,
- 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9,
- 0x00FF, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x00D7, 0x0192,
- 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA,
- 0x00BF, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
- 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00C1, 0x00C2, 0x00C0,
- 0x00A9, 0x2563, 0x2551, 0x2557, 0x255D, 0x00A2, 0x00A5, 0x2510,
- 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x00E3, 0x00C3,
- 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4,
- 0x00F0, 0x00D0, 0x00CA, 0x00CB, 0x00C8, 0x0131, 0x00CD, 0x00CE,
- 0x00CF, 0x2518, 0x250C, 0x2588, 0x2584, 0x00A6, 0x00CC, 0x2580,
- 0x00D3, 0x00DF, 0x00D4, 0x00D2, 0x00F5, 0x00D5, 0x00B5, 0x00FE,
- 0x00DE, 0x00DA, 0x00DB, 0x00D9, 0x00FD, 0x00DD, 0x00AF, 0x00B4,
- 0x00AD, 0x00B1, 0x2017, 0x00BE, 0x00B6, 0x00A7, 0x00F7, 0x00B8,
- 0x00B0, 0x00A8, 0x00B7, 0x00B9, 0x00B3, 0x00B2, 0x25A0, 0x00A0
-};
-
-#elif _CODE_PAGE == 852
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP852(0x80-0xFF) to Unicode conversion table */
- 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x016F, 0x0107, 0x00E7,
- 0x0142, 0x00EB, 0x0150, 0x0151, 0x00EE, 0x0179, 0x00C4, 0x0106,
- 0x00C9, 0x0139, 0x013A, 0x00F4, 0x00F6, 0x013D, 0x013E, 0x015A,
- 0x015B, 0x00D6, 0x00DC, 0x0164, 0x0165, 0x0141, 0x00D7, 0x010D,
- 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x0104, 0x0105, 0x017D, 0x017E,
- 0x0118, 0x0119, 0x00AC, 0x017A, 0x010C, 0x015F, 0x00AB, 0x00BB,
- 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00C1, 0x00C2, 0x011A,
- 0x015E, 0x2563, 0x2551, 0x2557, 0x255D, 0x017B, 0x017C, 0x2510,
- 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x0102, 0x0103,
- 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4,
- 0x0111, 0x0110, 0x010E, 0x00CB, 0x010F, 0x0147, 0x00CD, 0x00CE,
- 0x011B, 0x2518, 0x250C, 0x2588, 0x2584, 0x0162, 0x016E, 0x2580,
- 0x00D3, 0x00DF, 0x00D4, 0x0143, 0x0144, 0x0148, 0x0160, 0x0161,
- 0x0154, 0x00DA, 0x0155, 0x0170, 0x00FD, 0x00DD, 0x0163, 0x00B4,
- 0x00AD, 0x02DD, 0x02DB, 0x02C7, 0x02D8, 0x00A7, 0x00F7, 0x00B8,
- 0x00B0, 0x00A8, 0x02D9, 0x0171, 0x0158, 0x0159, 0x25A0, 0x00A0
-};
-
-#elif _CODE_PAGE == 855
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP855(0x80-0xFF) to Unicode conversion table */
- 0x0452, 0x0402, 0x0453, 0x0403, 0x0451, 0x0401, 0x0454, 0x0404,
- 0x0455, 0x0405, 0x0456, 0x0406, 0x0457, 0x0407, 0x0458, 0x0408,
- 0x0459, 0x0409, 0x045A, 0x040A, 0x045B, 0x040B, 0x045C, 0x040C,
- 0x045E, 0x040E, 0x045F, 0x040F, 0x044E, 0x042E, 0x044A, 0x042A,
- 0x0430, 0x0410, 0x0431, 0x0411, 0x0446, 0x0426, 0x0434, 0x0414,
- 0x0435, 0x0415, 0x0444, 0x0424, 0x0433, 0x0413, 0x00AB, 0x00BB,
- 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x0445, 0x0425, 0x0438,
- 0x0418, 0x2563, 0x2551, 0x2557, 0x255D, 0x0439, 0x0419, 0x2510,
- 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x043A, 0x041A,
- 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4,
- 0x043B, 0x041B, 0x043C, 0x041C, 0x043D, 0x041D, 0x043E, 0x041E,
- 0x043F, 0x2518, 0x250C, 0x2588, 0x2584, 0x041F, 0x044F, 0x2580,
- 0x042F, 0x0440, 0x0420, 0x0441, 0x0421, 0x0442, 0x0422, 0x0443,
- 0x0423, 0x0436, 0x0416, 0x0432, 0x0412, 0x044C, 0x042C, 0x2116,
- 0x00AD, 0x044B, 0x042B, 0x0437, 0x0417, 0x0448, 0x0428, 0x044D,
- 0x042D, 0x0449, 0x0429, 0x0447, 0x0427, 0x00A7, 0x25A0, 0x00A0
-};
-
-#elif _CODE_PAGE == 857
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP857(0x80-0xFF) to Unicode conversion table */
- 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7,
- 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x0131, 0x00C4, 0x00C5,
- 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9,
- 0x0130, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x015E, 0x015F,
- 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x011E, 0x011F,
- 0x00BF, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
- 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00C1, 0x00C2, 0x00C0,
- 0x00A9, 0x2563, 0x2551, 0x2557, 0x255D, 0x00A2, 0x00A5, 0x2510,
- 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x00E3, 0x00C3,
- 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4,
- 0x00BA, 0x00AA, 0x00CA, 0x00CB, 0x00C8, 0x0000, 0x00CD, 0x00CE,
- 0x00CF, 0x2518, 0x250C, 0x2588, 0x2584, 0x00A6, 0x00CC, 0x2580,
- 0x00D3, 0x00DF, 0x00D4, 0x00D2, 0x00F5, 0x00D5, 0x00B5, 0x0000,
- 0x00D7, 0x00DA, 0x00DB, 0x00D9, 0x00EC, 0x00FF, 0x00AF, 0x00B4,
- 0x00AD, 0x00B1, 0x0000, 0x00BE, 0x00B6, 0x00A7, 0x00F7, 0x00B8,
- 0x00B0, 0x00A8, 0x00B7, 0x00B9, 0x00B3, 0x00B2, 0x25A0, 0x00A0
-};
-
-#elif _CODE_PAGE == 858
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP858(0x80-0xFF) to Unicode conversion table */
- 0x00C7, 0x00FC, 0x00E9, 0x00E2, 0x00E4, 0x00E0, 0x00E5, 0x00E7,
- 0x00EA, 0x00EB, 0x00E8, 0x00EF, 0x00EE, 0x00EC, 0x00C4, 0x00C5,
- 0x00C9, 0x00E6, 0x00C6, 0x00F4, 0x00F6, 0x00F2, 0x00FB, 0x00F9,
- 0x00FF, 0x00D6, 0x00DC, 0x00F8, 0x00A3, 0x00D8, 0x00D7, 0x0192,
- 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA,
- 0x00BF, 0x00AE, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
- 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x00C1, 0x00C2, 0x00C0,
- 0x00A9, 0x2563, 0x2551, 0x2557, 0x2550, 0x00A2, 0x00A5, 0x2510,
- 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x00E3, 0x00C3,
- 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x00A4,
- 0x00F0, 0x00D0, 0x00CA, 0x00CB, 0x00C8, 0x20AC, 0x00CD, 0x00CE,
- 0x00CF, 0x2518, 0x250C, 0x2588, 0x2584, 0x00C6, 0x00CC, 0x2580,
- 0x00D3, 0x00DF, 0x00D4, 0x00D2, 0x00F5, 0x00D5, 0x00B5, 0x00FE,
- 0x00DE, 0x00DA, 0x00DB, 0x00D9, 0x00FD, 0x00DD, 0x00AF, 0x00B4,
- 0x00AD, 0x00B1, 0x2017, 0x00BE, 0x00B6, 0x00A7, 0x00F7, 0x00B8,
- 0x00B0, 0x00A8, 0x00B7, 0x00B9, 0x00B3, 0x00B2, 0x25A0, 0x00A0
-};
-
-#elif _CODE_PAGE == 862
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP862(0x80-0xFF) to Unicode conversion table */
- 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7,
- 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF,
- 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7,
- 0x05E8, 0x05E9, 0x05EA, 0x00A2, 0x00A3, 0x00A5, 0x20A7, 0x0192,
- 0x00E1, 0x00ED, 0x00F3, 0x00FA, 0x00F1, 0x00D1, 0x00AA, 0x00BA,
- 0x00BF, 0x2310, 0x00AC, 0x00BD, 0x00BC, 0x00A1, 0x00AB, 0x00BB,
- 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556,
- 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510,
- 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F,
- 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567,
- 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B,
- 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580,
- 0x03B1, 0x00DF, 0x0393, 0x03C0, 0x03A3, 0x03C3, 0x00B5, 0x03C4,
- 0x03A6, 0x0398, 0x03A9, 0x03B4, 0x221E, 0x03C6, 0x03B5, 0x2229,
- 0x2261, 0x00B1, 0x2265, 0x2264, 0x2320, 0x2321, 0x00F7, 0x2248,
- 0x00B0, 0x2219, 0x00B7, 0x221A, 0x207F, 0x00B2, 0x25A0, 0x00A0
-};
-
-#elif _CODE_PAGE == 866
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP866(0x80-0xFF) to Unicode conversion table */
- 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417,
- 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F,
- 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427,
- 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F,
- 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
- 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F,
- 0x2591, 0x2592, 0x2593, 0x2502, 0x2524, 0x2561, 0x2562, 0x2556,
- 0x2555, 0x2563, 0x2551, 0x2557, 0x255D, 0x255C, 0x255B, 0x2510,
- 0x2514, 0x2534, 0x252C, 0x251C, 0x2500, 0x253C, 0x255E, 0x255F,
- 0x255A, 0x2554, 0x2569, 0x2566, 0x2560, 0x2550, 0x256C, 0x2567,
- 0x2568, 0x2564, 0x2565, 0x2559, 0x2558, 0x2552, 0x2553, 0x256B,
- 0x256A, 0x2518, 0x250C, 0x2588, 0x2584, 0x258C, 0x2590, 0x2580,
- 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
- 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F,
- 0x0401, 0x0451, 0x0404, 0x0454, 0x0407, 0x0457, 0x040E, 0x045E,
- 0x00B0, 0x2219, 0x00B7, 0x221A, 0x2116, 0x00A4, 0x25A0, 0x00A0
-};
-
-#elif _CODE_PAGE == 874
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP874(0x80-0xFF) to Unicode conversion table */
- 0x20AC, 0x0000, 0x0000, 0x0000, 0x0000, 0x2026, 0x0000, 0x0000,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x00A0, 0x0E01, 0x0E02, 0x0E03, 0x0E04, 0x0E05, 0x0E06, 0x0E07,
- 0x0E08, 0x0E09, 0x0E0A, 0x0E0B, 0x0E0C, 0x0E0D, 0x0E0E, 0x0E0F,
- 0x0E10, 0x0E11, 0x0E12, 0x0E13, 0x0E14, 0x0E15, 0x0E16, 0x0E17,
- 0x0E18, 0x0E19, 0x0E1A, 0x0E1B, 0x0E1C, 0x0E1D, 0x0E1E, 0x0E1F,
- 0x0E20, 0x0E21, 0x0E22, 0x0E23, 0x0E24, 0x0E25, 0x0E26, 0x0E27,
- 0x0E28, 0x0E29, 0x0E2A, 0x0E2B, 0x0E2C, 0x0E2D, 0x0E2E, 0x0E2F,
- 0x0E30, 0x0E31, 0x0E32, 0x0E33, 0x0E34, 0x0E35, 0x0E36, 0x0E37,
- 0x0E38, 0x0E39, 0x0E3A, 0x0000, 0x0000, 0x0000, 0x0000, 0x0E3F,
- 0x0E40, 0x0E41, 0x0E42, 0x0E43, 0x0E44, 0x0E45, 0x0E46, 0x0E47,
- 0x0E48, 0x0E49, 0x0E4A, 0x0E4B, 0x0E4C, 0x0E4D, 0x0E4E, 0x0E4F,
- 0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57,
- 0x0E58, 0x0E59, 0x0E5A, 0x0E5B, 0x0000, 0x0000, 0x0000, 0x0000
-};
-
-#elif _CODE_PAGE == 1250
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP1250(0x80-0xFF) to Unicode conversion table */
- 0x20AC, 0x0000, 0x201A, 0x0000, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x0000, 0x2030, 0x0160, 0x2039, 0x015A, 0x0164, 0x017D, 0x0179,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x0000, 0x2122, 0x0161, 0x203A, 0x015B, 0x0165, 0x017E, 0x017A,
- 0x00A0, 0x02C7, 0x02D8, 0x0141, 0x00A4, 0x0104, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x015E, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x017B,
- 0x00B0, 0x00B1, 0x02DB, 0x0142, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x0105, 0x015F, 0x00BB, 0x013D, 0x02DD, 0x013E, 0x017C,
- 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7,
- 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E,
- 0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7,
- 0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF,
- 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7,
- 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F,
- 0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7,
- 0x0159, 0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9
-};
-
-#elif _CODE_PAGE == 1251
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP1251(0x80-0xFF) to Unicode conversion table */
- 0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x20AC, 0x2030, 0x0409, 0x2039, 0x040A, 0x040C, 0x040B, 0x040F,
- 0x0452, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x0000, 0x2111, 0x0459, 0x203A, 0x045A, 0x045C, 0x045B, 0x045F,
- 0x00A0, 0x040E, 0x045E, 0x0408, 0x00A4, 0x0490, 0x00A6, 0x00A7,
- 0x0401, 0x00A9, 0x0404, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x0407,
- 0x00B0, 0x00B1, 0x0406, 0x0456, 0x0491, 0x00B5, 0x00B6, 0x00B7,
- 0x0451, 0x2116, 0x0454, 0x00BB, 0x0458, 0x0405, 0x0455, 0x0457,
- 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417,
- 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F,
- 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427,
- 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F,
- 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
- 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F,
- 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
- 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F
-};
-
-#elif _CODE_PAGE == 1252
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP1252(0x80-0xFF) to Unicode conversion table */
- 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x017D, 0x0000,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x0000, 0x017E, 0x0178,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
- 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7,
- 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
- 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7,
- 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7,
- 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
- 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7,
- 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF
-};
-
-#elif _CODE_PAGE == 1253
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP1253(0x80-0xFF) to Unicode conversion table */
- 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x0000, 0x2030, 0x0000, 0x2039, 0x000C, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x0000, 0x2122, 0x0000, 0x203A, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x00A0, 0x0385, 0x0386, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x0000, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x2015,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x00B5, 0x00B6, 0x00B7,
- 0x0388, 0x0389, 0x038A, 0x00BB, 0x038C, 0x00BD, 0x038E, 0x038F,
- 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,
- 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
- 0x03A0, 0x03A1, 0x0000, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7,
- 0x03A8, 0x03A9, 0x03AA, 0x03AD, 0x03AC, 0x03AD, 0x03AE, 0x03AF,
- 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7,
- 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF,
- 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7,
- 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x0000
-};
-
-#elif _CODE_PAGE == 1254
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP1254(0x80-0xFF) to Unicode conversion table */
- 0x20AC, 0x0000, 0x210A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0x0000, 0x0000, 0x0178,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
- 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7,
- 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
- 0x011E, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7,
- 0x00D8, 0x00D9, 0x00DA, 0x00BD, 0x00DC, 0x0130, 0x015E, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7,
- 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
- 0x011F, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7,
- 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0131, 0x015F, 0x00FF
-};
-
-#elif _CODE_PAGE == 1255
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP1255(0x80-0xFF) to Unicode conversion table */
- 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x02C6, 0x2030, 0x0000, 0x2039, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x02DC, 0x2122, 0x0000, 0x203A, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x00D7, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x00B9, 0x00F7, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
- 0x05B0, 0x05B1, 0x05B2, 0x05B3, 0x05B4, 0x05B5, 0x05B6, 0x05B7,
- 0x05B8, 0x05B9, 0x0000, 0x05BB, 0x05BC, 0x05BD, 0x05BE, 0x05BF,
- 0x05C0, 0x05C1, 0x05C2, 0x05C3, 0x05F0, 0x05F1, 0x05F2, 0x05F3,
- 0x05F4, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
- 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7,
- 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF,
- 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7,
- 0x05E8, 0x05E9, 0x05EA, 0x0000, 0x0000, 0x200E, 0x200F, 0x0000
-};
-
-#elif _CODE_PAGE == 1256
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP1256(0x80-0xFF) to Unicode conversion table */
- 0x20AC, 0x067E, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x02C6, 0x2030, 0x0679, 0x2039, 0x0152, 0x0686, 0x0698, 0x0688,
- 0x06AF, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x06A9, 0x2122, 0x0691, 0x203A, 0x0153, 0x200C, 0x200D, 0x06BA,
- 0x00A0, 0x060C, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x06BE, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x00B9, 0x061B, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x061F,
- 0x06C1, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627,
- 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F,
- 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x00D7,
- 0x0637, 0x0638, 0x0639, 0x063A, 0x0640, 0x0640, 0x0642, 0x0643,
- 0x00E0, 0x0644, 0x00E2, 0x0645, 0x0646, 0x0647, 0x0648, 0x00E7,
- 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0649, 0x064A, 0x00EE, 0x00EF,
- 0x064B, 0x064C, 0x064D, 0x064E, 0x00F4, 0x064F, 0x0650, 0x00F7,
- 0x0651, 0x00F9, 0x0652, 0x00FB, 0x00FC, 0x200E, 0x200F, 0x06D2
-}
-
-#elif _CODE_PAGE == 1257
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP1257(0x80-0xFF) to Unicode conversion table */
- 0x20AC, 0x0000, 0x201A, 0x0000, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x0000, 0x2030, 0x0000, 0x2039, 0x0000, 0x00A8, 0x02C7, 0x00B8,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x0000, 0x2122, 0x0000, 0x203A, 0x0000, 0x00AF, 0x02DB, 0x0000,
- 0x00A0, 0x0000, 0x00A2, 0x00A3, 0x00A4, 0x0000, 0x00A6, 0x00A7,
- 0x00D8, 0x00A9, 0x0156, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x00B9, 0x0157, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00E6,
- 0x0104, 0x012E, 0x0100, 0x0106, 0x00C4, 0x00C5, 0x0118, 0x0112,
- 0x010C, 0x00C9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012A, 0x013B,
- 0x0160, 0x0143, 0x0145, 0x00D3, 0x014C, 0x00D5, 0x00D6, 0x00D7,
- 0x0172, 0x0141, 0x015A, 0x016A, 0x00DC, 0x017B, 0x017D, 0x00DF,
- 0x0105, 0x012F, 0x0101, 0x0107, 0x00E4, 0x00E5, 0x0119, 0x0113,
- 0x010D, 0x00E9, 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C,
- 0x0161, 0x0144, 0x0146, 0x00F3, 0x014D, 0x00F5, 0x00F6, 0x00F7,
- 0x0173, 0x014E, 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x02D9
-};
-
-#elif _CODE_PAGE == 1258
-#define _TBLDEF 1
-static
-const WCHAR Tbl[] = { /* CP1258(0x80-0xFF) to Unicode conversion table */
- 0x20AC, 0x0000, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x02C6, 0x2030, 0x0000, 0x2039, 0x0152, 0x0000, 0x0000, 0x0000,
- 0x0000, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x02DC, 0x2122, 0x0000, 0x203A, 0x0153, 0x0000, 0x0000, 0x0178,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
- 0x00C0, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x00C5, 0x00C6, 0x00C7,
- 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x0300, 0x00CD, 0x00CE, 0x00CF,
- 0x0110, 0x00D1, 0x0309, 0x00D3, 0x00D4, 0x01A0, 0x00D6, 0x00D7,
- 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x01AF, 0x0303, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x00E5, 0x00E6, 0x00E7,
- 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0301, 0x00ED, 0x00EE, 0x00EF,
- 0x0111, 0x00F1, 0x0323, 0x00F3, 0x00F4, 0x01A1, 0x00F6, 0x00F7,
- 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x01B0, 0x20AB, 0x00FF
-};
-
-#endif
-
-
-#if !_TBLDEF || !_USE_LFN
-#error This file is not needed in current configuration. Remove from the project.
-#endif
-
-
-WCHAR ff_convert ( /* Converted character, Returns zero on error */
- WCHAR src, /* Character code to be converted */
- UINT dir /* 0: Unicode to OEMCP, 1: OEMCP to Unicode */
-)
-{
- WCHAR c;
-
-
- if (src < 0x80) { /* ASCII */
- c = src;
-
- } else {
- if (dir) { /* OEMCP to Unicode */
- c = (src >= 0x100) ? 0 : Tbl[src - 0x80];
-
- } else { /* Unicode to OEMCP */
- for (c = 0; c < 0x80; c++) {
- if (src == Tbl[c]) break;
- }
- c = (c + 0x80) & 0xFF;
- }
- }
-
- return c;
-}
-
-
-WCHAR ff_wtoupper ( /* Upper converted character */
- WCHAR chr /* Input character */
-)
-{
- static const WCHAR tbl_lower[] = { 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F, 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7A, 0xA1, 0x00A2, 0x00A3, 0x00A5, 0x00AC, 0x00AF, 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0x0FF, 0x101, 0x103, 0x105, 0x107, 0x109, 0x10B, 0x10D, 0x10F, 0x111, 0x113, 0x115, 0x117, 0x119, 0x11B, 0x11D, 0x11F, 0x121, 0x123, 0x125, 0x127, 0x129, 0x12B, 0x12D, 0x12F, 0x131, 0x133, 0x135, 0x137, 0x13A, 0x13C, 0x13E, 0x140, 0x142, 0x144, 0x146, 0x148, 0x14B, 0x14D, 0x14F, 0x151, 0x153, 0x155, 0x157, 0x159, 0x15B, 0x15D, 0x15F, 0x161, 0x163, 0x165, 0x167, 0x169, 0x16B, 0x16D, 0x16F, 0x171, 0x173, 0x175, 0x177, 0x17A, 0x17C, 0x17E, 0x192, 0x3B1, 0x3B2, 0x3B3, 0x3B4, 0x3B5, 0x3B6, 0x3B7, 0x3B8, 0x3B9, 0x3BA, 0x3BB, 0x3BC, 0x3BD, 0x3BE, 0x3BF, 0x3C0, 0x3C1, 0x3C3, 0x3C4, 0x3C5, 0x3C6, 0x3C7, 0x3C8, 0x3C9, 0x3CA, 0x430, 0x431, 0x432, 0x433, 0x434, 0x435, 0x436, 0x437, 0x438, 0x439, 0x43A, 0x43B, 0x43C, 0x43D, 0x43E, 0x43F, 0x440, 0x441, 0x442, 0x443, 0x444, 0x445, 0x446, 0x447, 0x448, 0x449, 0x44A, 0x44B, 0x44C, 0x44D, 0x44E, 0x44F, 0x451, 0x452, 0x453, 0x454, 0x455, 0x456, 0x457, 0x458, 0x459, 0x45A, 0x45B, 0x45C, 0x45E, 0x45F, 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, 0x2178, 0x2179, 0x217A, 0x217B, 0x217C, 0x217D, 0x217E, 0x217F, 0xFF41, 0xFF42, 0xFF43, 0xFF44, 0xFF45, 0xFF46, 0xFF47, 0xFF48, 0xFF49, 0xFF4A, 0xFF4B, 0xFF4C, 0xFF4D, 0xFF4E, 0xFF4F, 0xFF50, 0xFF51, 0xFF52, 0xFF53, 0xFF54, 0xFF55, 0xFF56, 0xFF57, 0xFF58, 0xFF59, 0xFF5A, 0 };
- static const WCHAR tbl_upper[] = { 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A, 0x21, 0xFFE0, 0xFFE1, 0xFFE5, 0xFFE2, 0xFFE3, 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0x178, 0x100, 0x102, 0x104, 0x106, 0x108, 0x10A, 0x10C, 0x10E, 0x110, 0x112, 0x114, 0x116, 0x118, 0x11A, 0x11C, 0x11E, 0x120, 0x122, 0x124, 0x126, 0x128, 0x12A, 0x12C, 0x12E, 0x130, 0x132, 0x134, 0x136, 0x139, 0x13B, 0x13D, 0x13F, 0x141, 0x143, 0x145, 0x147, 0x14A, 0x14C, 0x14E, 0x150, 0x152, 0x154, 0x156, 0x158, 0x15A, 0x15C, 0x15E, 0x160, 0x162, 0x164, 0x166, 0x168, 0x16A, 0x16C, 0x16E, 0x170, 0x172, 0x174, 0x176, 0x179, 0x17B, 0x17D, 0x191, 0x391, 0x392, 0x393, 0x394, 0x395, 0x396, 0x397, 0x398, 0x399, 0x39A, 0x39B, 0x39C, 0x39D, 0x39E, 0x39F, 0x3A0, 0x3A1, 0x3A3, 0x3A4, 0x3A5, 0x3A6, 0x3A7, 0x3A8, 0x3A9, 0x3AA, 0x410, 0x411, 0x412, 0x413, 0x414, 0x415, 0x416, 0x417, 0x418, 0x419, 0x41A, 0x41B, 0x41C, 0x41D, 0x41E, 0x41F, 0x420, 0x421, 0x422, 0x423, 0x424, 0x425, 0x426, 0x427, 0x428, 0x429, 0x42A, 0x42B, 0x42C, 0x42D, 0x42E, 0x42F, 0x401, 0x402, 0x403, 0x404, 0x405, 0x406, 0x407, 0x408, 0x409, 0x40A, 0x40B, 0x40C, 0x40E, 0x40F, 0x2160, 0x2161, 0x2162, 0x2163, 0x2164, 0x2165, 0x2166, 0x2167, 0x2168, 0x2169, 0x216A, 0x216B, 0x216C, 0x216D, 0x216E, 0x216F, 0xFF21, 0xFF22, 0xFF23, 0xFF24, 0xFF25, 0xFF26, 0xFF27, 0xFF28, 0xFF29, 0xFF2A, 0xFF2B, 0xFF2C, 0xFF2D, 0xFF2E, 0xFF2F, 0xFF30, 0xFF31, 0xFF32, 0xFF33, 0xFF34, 0xFF35, 0xFF36, 0xFF37, 0xFF38, 0xFF39, 0xFF3A, 0 };
- int i;
-
-
- for (i = 0; tbl_lower[i] && chr != tbl_lower[i]; i++) ;
-
- return tbl_lower[i] ? tbl_upper[i] : chr;
-}
diff --git a/data/sysrom/fat/src/option/syscall.c b/data/sysrom/fat/src/option/syscall.c
index e231c51..5a8839e 100644
--- a/data/sysrom/fat/src/option/syscall.c
+++ b/data/sysrom/fat/src/option/syscall.c
@@ -1,6 +1,6 @@
/*------------------------------------------------------------------------*/
-/* Sample code of OS dependent controls for FatFs R0.08b */
-/* (C)ChaN, 2011 */
+/* Sample code of OS dependent controls for FatFs */
+/* (C)ChaN, 2012 */
/*------------------------------------------------------------------------*/
#include <stdlib.h> /* ANSI memory controls */
@@ -14,27 +14,31 @@
/* Create a Synchronization Object
/*------------------------------------------------------------------------*/
/* This function is called in f_mount function to create a new
-/ synchronization object, such as semaphore and mutex. When a zero is
+/ synchronization object, such as semaphore and mutex. When a FALSE is
/ returned, the f_mount function fails with FR_INT_ERR.
*/
-int ff_cre_syncobj ( /* TRUE:Function succeeded, FALSE:Could not create due to any error */
+int ff_cre_syncobj ( /* 1:Function succeeded, 0:Could not create due to any error */
BYTE vol, /* Corresponding logical drive being processed */
_SYNC_t *sobj /* Pointer to return the created sync object */
)
{
int ret;
+// static _SYNC_t sem[_VOLUMES]; /* FreeRTOS */
- *sobj = CreateMutex(NULL, FALSE, NULL); /* Win32 */
+
+ *sobj = CreateMutex(NULL, FALSE, NULL); /* Win32 */
ret = (*sobj != INVALID_HANDLE_VALUE);
-// *sobj = SyncObjects[vol]; /* uITRON (give a static sync object) */
-// ret = 1; /* The initial value of the semaphore must be 1. */
+// *sobj = SyncObjects[vol]; /* uITRON (give a static created sync object) */
+// ret = 1; /* The initial value of the semaphore must be 1. */
-// *sobj = OSMutexCreate(0, &err); /* uC/OS-II */
+// *sobj = OSMutexCreate(0, &err); /* uC/OS-II */
// ret = (err == OS_NO_ERR);
-// *sobj = xSemaphoreCreateMutex(); /* FreeRTOS */
+// if (!sem[vol]) /* FreeRTOS */
+// sem[vol] = xSemaphoreCreateMutex();
+// *sobj = sem[vol];
// ret = (*sobj != NULL);
return ret;
@@ -46,15 +50,16 @@ int ff_cre_syncobj ( /* TRUE:Function succeeded, FALSE:Could not create due to a
/* Delete a Synchronization Object */
/*------------------------------------------------------------------------*/
/* This function is called in f_mount function to delete a synchronization
-/ object that created with ff_cre_syncobj function. When a zero is
+/ object that created with ff_cre_syncobj function. When a FALSE is
/ returned, the f_mount function fails with FR_INT_ERR.
*/
-int ff_del_syncobj ( /* TRUE:Function succeeded, FALSE:Could not delete due to any error */
+int ff_del_syncobj ( /* 1:Function succeeded, 0:Could not delete due to any error */
_SYNC_t sobj /* Sync object tied to the logical drive to be deleted */
)
{
- BOOL ret;
+ int ret;
+
ret = CloseHandle(sobj); /* Win32 */
@@ -74,7 +79,7 @@ int ff_del_syncobj ( /* TRUE:Function succeeded, FALSE:Could not delete due to a
/* Request Grant to Access the Volume */
/*------------------------------------------------------------------------*/
/* This function is called on entering file functions to lock the volume.
-/ When a zero is returned, the file function fails with FR_TIMEOUT.
+/ When a FALSE is returned, the file function fails with FR_TIMEOUT.
*/
int ff_req_grant ( /* TRUE:Got a grant to access the volume, FALSE:Could not get a grant */
@@ -85,9 +90,9 @@ int ff_req_grant ( /* TRUE:Got a grant to access the volume, FALSE:Could not get
ret = (WaitForSingleObject(sobj, _FS_TIMEOUT) == WAIT_OBJECT_0); /* Win32 */
-// ret = (wai_sem(sobj) == E_OK); /* uITRON */
+// ret = (wai_sem(sobj) == E_OK); /* uITRON */
-// OSMutexPend(sobj, _FS_TIMEOUT, &err)); /* uC/OS-II */
+// OSMutexPend(sobj, _FS_TIMEOUT, &err)); /* uC/OS-II */
// ret = (err == OS_NO_ERR);
// ret = (xSemaphoreTake(sobj, _FS_TIMEOUT) == pdTRUE); /* FreeRTOS */
@@ -114,7 +119,6 @@ void ff_rel_grant (
// OSMutexPost(sobj); /* uC/OS-II */
// xSemaphoreGive(sobj); /* FreeRTOS */
-
}
#endif
@@ -130,10 +134,10 @@ void ff_rel_grant (
*/
void* ff_memalloc ( /* Returns pointer to the allocated memory block */
- UINT size /* Number of bytes to allocate */
+ UINT msize /* Number of bytes to allocate */
)
{
- return malloc(size);
+ return malloc(msize);
}
@@ -141,7 +145,7 @@ void* ff_memalloc ( /* Returns pointer to the allocated memory block */
/* Free a memory block */
/*------------------------------------------------------------------------*/
-void ff_memfree(
+void ff_memfree (
void* mblock /* Pointer to the memory block to free */
)
{
diff --git a/data/sysrom/fat/src/option/unicode.c b/data/sysrom/fat/src/option/unicode.c
new file mode 100644
index 0000000..16a8d96
--- /dev/null
+++ b/data/sysrom/fat/src/option/unicode.c
@@ -0,0 +1,17 @@
+#include "../ff.h"
+
+#if _USE_LFN != 0
+
+#if _CODE_PAGE == 932
+#include "cc932.c"
+#elif _CODE_PAGE == 936
+#include "cc936.c"
+#elif _CODE_PAGE == 949
+#include "cc949.c"
+#elif _CODE_PAGE == 950
+#include "cc950.c"
+#else
+#include "ccsbcs.c"
+#endif
+
+#endif