ReactOS 0.4.16-dev-297-gc569aee
fs.c File Reference
#include "lwip/apps/httpd_opts.h"
#include "lwip/def.h"
#include "lwip/apps/fs.h"
#include <string.h>
Include dependency graph for fs.c:

Go to the source code of this file.

Functions

err_t fs_open (struct fs_file *file, const char *name)
 
void fs_close (struct fs_file *file)
 
int fs_bytes_left (struct fs_file *file)
 

Function Documentation

◆ fs_bytes_left()

int fs_bytes_left ( struct fs_file file)

Definition at line 158 of file fs.c.

159{
160 return file->len - file->index;
161}
Definition: fci.c:127

◆ fs_close()

void fs_close ( struct fs_file file)

Definition at line 83 of file fs.c.

84{
85#if LWIP_HTTPD_CUSTOM_FILES
86 if ((file->flags & FS_FILE_FLAGS_CUSTOM) != 0) {
87 fs_close_custom(file);
88 }
89#endif /* LWIP_HTTPD_CUSTOM_FILES */
90#if LWIP_HTTPD_FILE_STATE
91 fs_state_free(file, file->state);
92#endif /* #if LWIP_HTTPD_FILE_STATE */
94}
#define FS_FILE_FLAGS_CUSTOM
Definition: fs.h:57
#define LWIP_UNUSED_ARG(x)
Definition: arch.h:373

Referenced by VfatChkdsk().

◆ fs_open()

err_t fs_open ( struct fs_file file,
const char name 
)

Definition at line 43 of file fs.c.

44{
45 const struct fsdata_file *f;
46
47 if ((file == NULL) || (name == NULL)) {
48 return ERR_ARG;
49 }
50
51#if LWIP_HTTPD_CUSTOM_FILES
52 if (fs_open_custom(file, name)) {
53 file->flags |= FS_FILE_FLAGS_CUSTOM;
54 return ERR_OK;
55 }
56#endif /* LWIP_HTTPD_CUSTOM_FILES */
57
58 for (f = FS_ROOT; f != NULL; f = f->next) {
59 if (!strcmp(name, (const char *)f->name)) {
60 file->data = (const char *)f->data;
61 file->len = f->len;
62 file->index = f->len;
63 file->flags = f->flags;
65 file->chksum_count = f->chksum_count;
66 file->chksum = f->chksum;
67#endif /* HTTPD_PRECALCULATED_CHECKSUM */
69 file->pextension = NULL;
70#endif /* LWIP_HTTPD_FILE_EXTENSION */
72 file->state = fs_state_init(file, name);
73#endif /* #if LWIP_HTTPD_FILE_STATE */
74 return ERR_OK;
75 }
76 }
77 /* file not found */
78 return ERR_VAL;
79}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define NULL
Definition: types.h:112
#define FS_ROOT
Definition: fsdata.c:335
GLfloat f
Definition: glext.h:7540
#define HTTPD_PRECALCULATED_CHECKSUM
Definition: httpd_opts.h:392
#define LWIP_HTTPD_FILE_EXTENSION
Definition: httpd_opts.h:385
#define LWIP_HTTPD_FILE_STATE
Definition: httpd_opts.h:375
@ ERR_OK
Definition: err.h:55
@ ERR_VAL
Definition: err.h:67
@ ERR_ARG
Definition: err.h:88
#define f
Definition: ke_i.h:83
struct define * next
Definition: compiler.c:65
Definition: name.c:39
WCHAR * name
Definition: name.c:42

Referenced by VfatChkdsk().