Implement getfreemem for seven_fs + add to the callbacks

This commit is contained in:
Lailouezzz 2020-01-05 16:36:58 +01:00
parent 7e2a2668fb
commit f39ee1b820
Signed by: Lailouezzz
GPG Key ID: 03FCE8A99EF8482C
3 changed files with 46 additions and 1 deletions

View File

@ -0,0 +1,39 @@
/* ****************************************************************************
* link/seven_fs/getfreemem.c -- get the available free space on a 7.00 fs.
* Copyright (C) 2020 Alan "Lailouezzz" Le Bouder <alanlebouder@gmail.com>
*
* This file is part of libcasio.
* libcasio is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3.0 of the License,
* or (at your option) any later version.
*
* libcasio is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with libcasio; if not, see <http://www.gnu.org/licenses/>.
* ************************************************************************* */
#include "seven_fs.h"
/**
* casio_sevenfs_getfreemem:
* Get the available free space on a Protocol 7.00 filesystem.
*
* @arg cookie the cookie.
* @arg path the path.
* @arg capacity the pointer to capacity
* @return the error code (0 if ok).
*/
int CASIO_EXPORT casio_sevenfs_getfreemem(sevenfs_cookie_t *cookie,
sevenfs_path_t *path,
size_t *capacity)
{
int err;
casio_link_t *handle = cookie;
return (0);
}

View File

@ -25,7 +25,7 @@ CASIO_LOCAL casio_fsfuncs_t sevenfs_callbacks = {
(casio_fs_makepath_t*)&casio_make_sevenfs_path,
(casio_fs_freepath_t*)&casio_free_sevenfs_path,
NULL,
NULL,
(casio_fs_getfreemem_t*)&casio_sevenfs_getfreemem,
NULL,
(casio_fs_del_t*)&casio_sevenfs_delete,
NULL,

View File

@ -63,4 +63,10 @@ CASIO_EXTERN int CASIO_EXPORT casio_sevenfs_open
OF((sevenfs_cookie_t *casio__cookie, sevenfs_path_t *casio__path,
casio_off_t casio__size, casio_openmode_t casio__mode, casio_stream_t **casio__stream));
/* Get the free space */
CASIO_EXTERN int CASIO_EXPORT casio_sevenfs_getfreemem
OF((sevenfs_cookie_t *casio__cookie, sevenfs_path_t *casio__path,
size_t *casio__capacity));
#endif /* LOCAL_LINK_SEVEN_FS_H */