示例#1
0
  void result(struct httpd_fs_file *file) const
  {
    file->data = data;
    file->len = pgm_read_word(len);

    nanode_log_P(PSTR("http: entry result"));
    nanode_log((char *)data);
  }
示例#2
0
// Note that 'filename' might not be zero-terminated!
int httpd_fs_open(const char *filename, struct httpd_fs_file *file)
{
  nanode_log_P(PSTR("http: file open"));
  nanode_log((char*)filename);
  
  int result = 0;
  const file_entry_t* cur = dir;
  bool done = false;
  while (!done)
  {
    entry e(cur);
    if (e.matches(filename))
    {
      e.result(file);
      done = 1;
      result = 1;
    }
    if (!e.isvalid())
      done = 1;
    ++cur;
  }

  return result; 
}