ReactOS 0.4.16-dev-306-g647d351
fs.h File Reference
#include "httpd_opts.h"
#include "lwip/err.h"
Include dependency graph for fs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  fs_file
 
struct  fsdata_file
 

Macros

#define FS_READ_EOF   -1
 
#define FS_READ_DELAYED   -2
 
#define FS_FILE_FLAGS_HEADER_INCLUDED   0x01
 
#define FS_FILE_FLAGS_HEADER_PERSISTENT   0x02
 
#define FS_FILE_FLAGS_HEADER_HTTPVER_1_1   0x04
 
#define FS_FILE_FLAGS_SSI   0x08
 
#define FS_FILE_FLAGS_CUSTOM   0x10
 

Typedefs

typedef void fs_file_extension
 

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)
 

Macro Definition Documentation

◆ FS_FILE_FLAGS_CUSTOM

#define FS_FILE_FLAGS_CUSTOM   0x10

Definition at line 57 of file fs.h.

◆ FS_FILE_FLAGS_HEADER_HTTPVER_1_1

#define FS_FILE_FLAGS_HEADER_HTTPVER_1_1   0x04

Definition at line 55 of file fs.h.

◆ FS_FILE_FLAGS_HEADER_INCLUDED

#define FS_FILE_FLAGS_HEADER_INCLUDED   0x01

Definition at line 53 of file fs.h.

◆ FS_FILE_FLAGS_HEADER_PERSISTENT

#define FS_FILE_FLAGS_HEADER_PERSISTENT   0x02

Definition at line 54 of file fs.h.

◆ FS_FILE_FLAGS_SSI

#define FS_FILE_FLAGS_SSI   0x08

Definition at line 56 of file fs.h.

◆ FS_READ_DELAYED

#define FS_READ_DELAYED   -2

Definition at line 43 of file fs.h.

◆ FS_READ_EOF

#define FS_READ_EOF   -1

Definition at line 42 of file fs.h.

Typedef Documentation

◆ fs_file_extension

Define FS_FILE_EXTENSION_T_DEFINED if you have typedef'ed to your private pointer type (defaults to 'void' so the default usage is 'void*')

Definition at line 63 of file fs.h.

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().