GadgetSeed  0.9.6
fs.c
[詳解]
1 /** @file
2  @brief ファイルシステムAPI
3 
4  @date 2018.09.09
5  @author Takashi SHUDO
6 */
7 
8 #include "sysconfig.h"
9 #include "fs.h"
10 #include "str.h"
11 
12 #ifdef GSC_COMP_ENABLE_FATFS
13 extern const struct st_filesystem fatfs_fs;
14 #endif
15 
16 #ifdef GSC_COMP_ENABLE_PIPEFS
17 extern const struct st_filesystem pipefs_fs;
18 #endif
19 
20 struct st_filesystem const *filesystems[] = {
21 #ifdef GSC_COMP_ENABLE_FATFS
22  &fatfs_fs,
23 #endif
24 #ifdef GSC_COMP_ENABLE_PIPEFS
25  &pipefs_fs,
26 #endif
27  0
28 };
29 
30 struct st_filesystem * search_filesystem(const char *name)
31 {
32  const struct st_filesystem **fs = &filesystems[0];
33 
34  while(*fs != 0) {
35  if(strcomp((uchar *)name, (uchar *)(*fs)->name) == 0) {
36  return (struct st_filesystem *)*fs;
37  }
38  fs ++;
39  }
40 
41  return 0;
42 }
unsigned char uchar
GadgetSeedの文字(列)は unsigned char 型となる
Definition: str.h:13
ファイルシステム構造体
Definition: fs.h:56
ファイルシステムAPI
文字列処理
int strcomp(const uchar *s1, const uchar *s2)
文字列比較
Definition: str.c:583