From 32a1138b9f66b76808906064a76c5f9533cc825c Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 27 Jan 2017 15:04:17 +1100 Subject: extmod: Rename vfs_fat_file.h to vfs_fat.h. And move declaration of mp_fat_vfs_type to this file. --- cc3200/mods/moduos.c | 2 +- esp8266/moduos.c | 3 +-- extmod/vfs_fat.c | 2 +- extmod/vfs_fat.h | 39 +++++++++++++++++++++++++++++++++++++++ extmod/vfs_fat_ffconf.c | 2 +- extmod/vfs_fat_file.c | 2 +- extmod/vfs_fat_file.h | 38 -------------------------------------- extmod/vfs_fat_misc.c | 2 +- extmod/vfs_fat_reader.c | 2 +- stmhal/builtin_open.c | 2 +- stmhal/moduos.c | 2 +- unix/modos.c | 2 +- 12 files changed, 49 insertions(+), 49 deletions(-) create mode 100644 extmod/vfs_fat.h delete mode 100644 extmod/vfs_fat_file.h diff --git a/cc3200/mods/moduos.c b/cc3200/mods/moduos.c index d5b29336a..1c9932b8e 100644 --- a/cc3200/mods/moduos.c +++ b/cc3200/mods/moduos.c @@ -37,7 +37,7 @@ #include "moduos.h" #include "diskio.h" #include "sflash_diskio.h" -#include "extmod/vfs_fat_file.h" +#include "extmod/vfs_fat.h" #include "random.h" #include "mpexception.h" #include "version.h" diff --git a/esp8266/moduos.c b/esp8266/moduos.c index e9c4c3e8c..5f5aab166 100644 --- a/esp8266/moduos.c +++ b/esp8266/moduos.c @@ -34,12 +34,11 @@ #include "py/runtime.h" #include "py/mperrno.h" #include "extmod/misc.h" +#include "extmod/vfs_fat.h" #include "genhdr/mpversion.h" #include "esp_mphal.h" #include "user_interface.h" -extern const mp_obj_type_t mp_fat_vfs_type; - STATIC const qstr os_uname_info_fields[] = { MP_QSTR_sysname, MP_QSTR_nodename, MP_QSTR_release, MP_QSTR_version, MP_QSTR_machine diff --git a/extmod/vfs_fat.c b/extmod/vfs_fat.c index 36bdb5dbd..36e5031a8 100644 --- a/extmod/vfs_fat.c +++ b/extmod/vfs_fat.c @@ -37,7 +37,7 @@ #include "py/runtime.h" #include "py/mperrno.h" #include "lib/oofatfs/ff.h" -#include "extmod/vfs_fat_file.h" +#include "extmod/vfs_fat.h" #include "extmod/fsusermount.h" #include "timeutils.h" diff --git a/extmod/vfs_fat.h b/extmod/vfs_fat.h new file mode 100644 index 000000000..441b35c04 --- /dev/null +++ b/extmod/vfs_fat.h @@ -0,0 +1,39 @@ +/* + * This file is part of the Micro Python project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2013, 2014 Damien P. George + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +struct _fs_user_mount_t; + +extern const byte fresult_to_errno_table[20]; +extern const mp_obj_type_t mp_fat_vfs_type; + +struct _fs_user_mount_t *ff_get_vfs(const char **path); + +mp_obj_t fatfs_builtin_open(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwargs); +mp_obj_t fatfs_builtin_open_self(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs); +MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_open_obj); + +mp_obj_t fat_vfs_listdir(const char *path, bool is_str_type); +mp_obj_t fat_vfs_listdir2(struct _fs_user_mount_t *vfs, const char *path, bool is_str_type); diff --git a/extmod/vfs_fat_ffconf.c b/extmod/vfs_fat_ffconf.c index ddcdd8844..89081380e 100644 --- a/extmod/vfs_fat_ffconf.c +++ b/extmod/vfs_fat_ffconf.c @@ -36,7 +36,7 @@ #include "lib/fatfs/ff.h" #endif #include "extmod/fsusermount.h" -#include "extmod/vfs_fat_file.h" +#include "extmod/vfs_fat.h" STATIC bool check_path(const TCHAR **path, const char *mount_point_str, mp_uint_t mount_point_len) { if (strncmp(*path, mount_point_str, mount_point_len) == 0) { diff --git a/extmod/vfs_fat_file.c b/extmod/vfs_fat_file.c index 6651d70d0..ea332709e 100644 --- a/extmod/vfs_fat_file.c +++ b/extmod/vfs_fat_file.c @@ -42,7 +42,7 @@ #include "lib/fatfs/ff.h" #endif #include "extmod/fsusermount.h" -#include "extmod/vfs_fat_file.h" +#include "extmod/vfs_fat.h" #if MICROPY_VFS_FAT #define mp_type_fileio fatfs_type_fileio diff --git a/extmod/vfs_fat_file.h b/extmod/vfs_fat_file.h deleted file mode 100644 index 9693aa04a..000000000 --- a/extmod/vfs_fat_file.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * This file is part of the Micro Python project, http://micropython.org/ - * - * The MIT License (MIT) - * - * Copyright (c) 2013, 2014 Damien P. George - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -struct _fs_user_mount_t; - -extern const byte fresult_to_errno_table[20]; - -struct _fs_user_mount_t *ff_get_vfs(const char **path); - -mp_obj_t fatfs_builtin_open(mp_uint_t n_args, const mp_obj_t *args, mp_map_t *kwargs); -mp_obj_t fatfs_builtin_open_self(size_t n_args, const mp_obj_t *args, mp_map_t *kwargs); -MP_DECLARE_CONST_FUN_OBJ_KW(mp_builtin_open_obj); - -mp_obj_t fat_vfs_listdir(const char *path, bool is_str_type); -mp_obj_t fat_vfs_listdir2(struct _fs_user_mount_t *vfs, const char *path, bool is_str_type); diff --git a/extmod/vfs_fat_misc.c b/extmod/vfs_fat_misc.c index 5e89009cd..ea267a15f 100644 --- a/extmod/vfs_fat_misc.c +++ b/extmod/vfs_fat_misc.c @@ -37,7 +37,7 @@ #else #include "lib/fatfs/ff.h" #endif -#include "extmod/vfs_fat_file.h" +#include "extmod/vfs_fat.h" #include "extmod/fsusermount.h" #include "py/lexer.h" diff --git a/extmod/vfs_fat_reader.c b/extmod/vfs_fat_reader.c index efd2de0c1..b9abf3ad7 100644 --- a/extmod/vfs_fat_reader.c +++ b/extmod/vfs_fat_reader.c @@ -38,7 +38,7 @@ #include "lib/fatfs/ff.h" #endif #include "extmod/fsusermount.h" -#include "extmod/vfs_fat_file.h" +#include "extmod/vfs_fat.h" typedef struct _mp_reader_fatfs_t { FIL fp; diff --git a/stmhal/builtin_open.c b/stmhal/builtin_open.c index 697eec8ea..56b98ea61 100644 --- a/stmhal/builtin_open.c +++ b/stmhal/builtin_open.c @@ -25,6 +25,6 @@ */ #include "py/runtime.h" -#include "extmod/vfs_fat_file.h" +#include "extmod/vfs_fat.h" MP_DEFINE_CONST_FUN_OBJ_KW(mp_builtin_open_obj, 1, fatfs_builtin_open); diff --git a/stmhal/moduos.c b/stmhal/moduos.c index b3c6570a5..158e530ff 100644 --- a/stmhal/moduos.c +++ b/stmhal/moduos.c @@ -37,7 +37,7 @@ #include "timeutils.h" #include "rng.h" #include "uart.h" -#include "extmod/vfs_fat_file.h" +#include "extmod/vfs_fat.h" #include "sdcard.h" #include "extmod/fsusermount.h" #include "portmodules.h" diff --git a/unix/modos.c b/unix/modos.c index 72f5d872e..c35b246dd 100644 --- a/unix/modos.c +++ b/unix/modos.c @@ -39,6 +39,7 @@ #include "py/objtuple.h" #include "py/mphal.h" #include "extmod/misc.h" +#include "extmod/vfs_fat.h" // Can't include this, as FATFS structure definition is required, // and FatFs header defining it conflicts with POSIX. @@ -46,7 +47,6 @@ MP_DECLARE_CONST_FUN_OBJ_KW(fsuser_mount_obj); MP_DECLARE_CONST_FUN_OBJ_1(fsuser_umount_obj); MP_DECLARE_CONST_FUN_OBJ_KW(fsuser_mkfs_obj); -extern const mp_obj_type_t mp_fat_vfs_type; #ifdef __ANDROID__ #define USE_STATFS 1 -- cgit v1.2.3