simple_fs.h

来自「MANTIS是由科罗拉多大学开发的传感器网络嵌入式操作系统。 这是mantis」· C头文件 代码 · 共 49 行

H
49
字号
//  This file is part of MANTIS OS, Operating System//  See http://mantis.cs.colorado.edu/////  Copyright (C) 2003,2004,2005 University of Colorado, Boulder////  This program is free software; you can redistribute it and/or//  modify it under the terms of the mos license (see file LICENSE)/** @file simple_fs.h * @brief Super-simple file system */#ifndef _SIMPLE_FS_H_#define _SIMPLE_FS_H_/* The following file names are already in use: *  * prg - program image propagated by Aqueduct or Deluge * aqX - cache file used by Aqueduct or Deluge, X is a letter starting from '1' * rrp - temporary program image stored by repro_reprogram function before it *       gets renamed to 'prg' or 'bkX' * bkX - backup image, X is a letter starting from '1' */ #include "mos.h"typedef struct {	// This field was originally supposed to mean something more,	// but now is just being used as a flag that the file is allocated. 	int8_t index;	uint8_t name[3];	uint32_t start;	uint32_t length;} mos_file;void simple_fs_init();void simple_fs_format();mos_file* mos_file_create(const char* name, uint32_t length);mos_file* mos_file_open(const char* name);void mos_file_rename(const char* src, const char* dst);uint16_t mos_file_read(uint8_t* buf, mos_file* file, uint32_t offset, uint16_t length);uint16_t mos_file_write(uint8_t* buf, mos_file* file, uint32_t offset, uint16_t length);uint16_t mos_file_crc(mos_file* file, uint32_t offset, uint32_t length);void mos_file_flush(mos_file* file);int8_t mos_file_close(mos_file* file);void simple_fs_ls();#endif /* _SIMPLE_FS_H_ */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?