source: rtems/cpukit/shttpd/compat_rtems.h @ 5e26288

4.104.114.84.95
Last change on this file since 5e26288 was 5e26288, checked in by Ralf Corsepius <ralf.corsepius@…>, on 06/11/07 at 14:05:21

2007-06-11 Ralf Corsépius <ralf.corsepius@…>

  • shttpd/compat_rtems.h: Define closesocket.
  • Property mode set to 100644
File size: 2.1 KB
Line 
1/**
2 * @file rtems/rtems-shttpd.h
3 */
4
5#ifndef _rtems_rtems_webserver_h
6#define _rtems_rtems_webserver_h
7
8#include "shttpd.h"
9
10#include <rtems.h>
11#include <sys/socket.h>
12#include <netinet/in.h>
13#include <dirent.h>
14
15/* RTEMS is an Real Time Embedded operating system, for operation in hardware.
16  It does not have SSL or CGI support, as it does not have dynamic library
17  loading or sub-processes. */
18#define EMBEDDED
19#define NO_SSL
20#define NO_CGI
21
22#define DIRSEP                          '/'
23#define IS_DIRSEP_CHAR(c)               ((c) == '/')
24#define O_BINARY                        0
25#define closesocket(a)                  close(a)
26#define ERRNO                           errno
27
28/* RTEMS version is Thread Safe */
29#define InitializeCriticalSection(x)  rtems_semaphore_create( \
30                                  rtems_build_name('H','T','P','X'), \
31                                  1, /* Not Held Yet.*/ \
32                                  RTEMS_FIFO | \
33                                  RTEMS_BINARY_SEMAPHORE, \
34                                  0, \
35                                  x);
36#define EnterCriticalSection(x) rtems_semaphore_obtain(*(x),RTEMS_WAIT,RTEMS_NO_TIMEOUT)
37#define LeaveCriticalSection(x) rtems_semaphore_release(*(x))
38
39
40
41#ifdef __cplusplus
42extern "C" {
43#endif
44
45typedef void (*rtems_shttpd_addpages)(struct shttpd_ctx *ctx);
46typedef void (*rtems_shttpd_init)(void);
47
48rtems_status_code rtems_initialize_webserver(rtems_task_priority   initial_priority,
49                                             size_t                stack_size,
50                                             rtems_mode            initial_modes,
51                                             rtems_attribute       attribute_set,
52                                             rtems_shttpd_init     init_callback,
53                                             rtems_shttpd_addpages addpages_callback,
54                                             char                 *webroot
55                                            );
56void rtems_terminate_webserver(void);
57int  rtems_webserver_ok(void);
58
59#ifdef __cplusplus
60}
61#endif
62#endif
Note: See TracBrowser for help on using the repository browser.