8 * HTTP server read-only file system code.
9 * \author Adam Dunkels <adam@dunkels.com>
11 * A simple read-only filesystem.
15 * Copyright (c) 2001, Swedish Institute of Computer Science.
16 * All rights reserved.
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions
21 * 1. Redistributions of source code must retain the above copyright
22 * notice, this list of conditions and the following disclaimer.
23 * 2. Redistributions in binary form must reproduce the above copyright
24 * notice, this list of conditions and the following disclaimer in the
25 * documentation and/or other materials provided with the distribution.
26 * 3. Neither the name of the Institute nor the names of its contributors
27 * may be used to endorse or promote products derived from this software
28 * without specific prior written permission.
30 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
31 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
34 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
36 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
39 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
42 * This file is part of the lwIP TCP/IP stack.
44 * Author: Adam Dunkels <adam@sics.se>
46 * $Id: fs.c,v 1.7.2.3 2003/10/07 13:22:27 adam Exp $
57 #if FS_STATISTICS == 1
58 static u16_t count[FS_NUMFILES];
59 #endif /* FS_STATISTICS */
60 #endif /* FS_STATISTICS */
62 /*-----------------------------------------------------------------------------------*/
64 fs_strcmp(const char *str1, const char *str2)
76 if(str1[i] != str2[i]) {
84 /*-----------------------------------------------------------------------------------*/
86 fs_open(const char *name, struct fs_file *file)
89 #if FS_STATISTICS == 1
91 #endif /* FS_STATISTICS */
92 #endif /* FS_STATISTICS */
93 struct fsdata_file_noconst *f;
95 for(f = (struct fsdata_file_noconst *)FS_ROOT;
97 f = (struct fsdata_file_noconst *)f->next) {
99 if(fs_strcmp(name, f->name) == 0) {
100 file->data = f->data;
103 #if FS_STATISTICS == 1
105 #endif /* FS_STATISTICS */
106 #endif /* FS_STATISTICS */
110 #if FS_STATISTICS == 1
112 #endif /* FS_STATISTICS */
113 #endif /* FS_STATISTICS */
118 /*-----------------------------------------------------------------------------------*/
123 #if FS_STATISTICS == 1
125 for(i = 0; i < FS_NUMFILES; i++) {
128 #endif /* FS_STATISTICS */
129 #endif /* FS_STATISTICS */
131 /*-----------------------------------------------------------------------------------*/
133 #if FS_STATISTICS == 1
137 struct fsdata_file_noconst *f;
141 for(f = (struct fsdata_file_noconst *)FS_ROOT;
143 f = (struct fsdata_file_noconst *)f->next) {
145 if(fs_strcmp(name, f->name) == 0) {
152 #endif /* FS_STATISTICS */
153 #endif /* FS_STATISTICS */
154 /*-----------------------------------------------------------------------------------*/