source: roaraudio/include/libroareio/httpd.h @ 4708:c9d40761088a

Last change on this file since 4708:c9d40761088a was 4708:c9d40761088a, checked in by phi, 13 years ago

updated copyright statements

File size: 3.3 KB
Line 
1//httpd.h:
2
3/*
4 *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2010-2011
5 *
6 *  This file is part of libroareio a part of RoarAudio,
7 *  a cross-platform sound system for both, home and professional use.
8 *  See README for details.
9 *
10 *  This file is free software; you can redistribute it and/or modify
11 *  it under the terms of the GNU General Public License version 3
12 *  as published by the Free Software Foundation.
13 *
14 *  libroar is distributed in the hope that it will be useful,
15 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 *  GNU General Public License for more details.
18 *
19 *  You should have received a copy of the GNU General Public License
20 *  along with this software; see the file COPYING.  If not, write to
21 *  the Free Software Foundation, 51 Franklin Street, Fifth Floor,
22 *  Boston, MA 02110-1301, USA.
23 *
24 *  NOTE for everyone want's to change something and send patches:
25 *  read README and HACKING! There a addition information on
26 *  the license of this document you need to read before you send
27 *  any patches.
28 *
29 *  NOTE for uses of non-GPL (LGPL,...) software using libesd, libartsc
30 *  or libpulse*:
31 *  The libs libroaresd, libroararts and libroarpulse link this lib
32 *  and are therefore GPL. Because of this it may be illigal to use
33 *  them with any software that uses libesd, libartsc or libpulse*.
34 */
35
36#ifndef _LIBROAREIO_HTTPD_H_
37#define _LIBROAREIO_HTTPD_H_
38
39#include "libroareio.h"
40
41#define _ROAR_EIO_HTTPD_VERSION(major,minor) ((major)<<8|(minor))
42#define _ROAR_EIO_HTTPD_VERSION_MAJOR(x)     ((x)>>8)
43#define _ROAR_EIO_HTTPD_VERSION_MINOR(x)     ((x)&0xFF)
44
45#define ROAR_HTTPD_VERSION_HTTP09    _ROAR_EIO_HTTPD_VERSION(0,9)
46#define ROAR_HTTPD_VERSION_HTTP10    _ROAR_EIO_HTTPD_VERSION(1,0)
47#define ROAR_HTTPD_VERSION_HTTP11    _ROAR_EIO_HTTPD_VERSION(1,1)
48
49#define ROAR_HTTPD_METHOD_NONE       0
50#define ROAR_HTTPD_METHOD_GET        1
51#define ROAR_HTTPD_METHOD_POST       2
52#define ROAR_HTTPD_METHOD_PUT        3
53#define ROAR_HTTPD_METHOD_HEAD       4
54#define ROAR_HTTPD_METHOD_DELETE     5
55#define ROAR_HTTPD_METHOD_TRACE      6
56#define ROAR_HTTPD_METHOD_OPTIONS    7
57#define ROAR_HTTPD_METHOD_CONNECT    8
58//#define ROAR_HTTPD_METHOD_       9
59
60#define ROAR_HTTPD_STATUS_OK         200
61#define ROAR_HTTPD_STATUS_NOT_FOUND  404
62#define ROAR_HTTPD_STATUS_INTSERVERR 500
63#define ROAR_HTTPD_STATUS_NOT_IMPL   501
64#define ROAR_HTTPD_STATUS_VERNOTSUP  505
65
66#define ROAR_HTTPD_STATE_REQ           1
67#define ROAR_HTTPD_STATE_EOH           2
68#define ROAR_HTTPD_STATE_RESP          3
69
70struct roar_httpd_request {
71 int method;
72 char * resource;
73 char * query_string;
74 int version;
75 struct roar_keyval * header;
76};
77
78struct roar_httpd_response {
79 int version;
80 int status;
81 struct roar_vio_calls * file;
82 struct roar_keyval    * header;
83};
84
85struct roar_httpd {
86 int state;
87 struct roar_httpd_request  request;
88 struct roar_httpd_response response;
89 int (*cb_eoh)(struct roar_httpd * httpd);
90 struct roar_vio_calls * client;
91 struct roar_vio_calls   viostore[1];
92 struct roar_buffer * header;
93 struct roar_buffer * iobuffer;
94};
95
96struct roar_httpd * roar_http_new(struct roar_vio_calls * client, int (*cb_eoh)(struct roar_httpd * httpd));
97int                 roar_http_free(struct roar_httpd * httpd);
98int                 roar_http_update(struct roar_httpd * httpd);
99
100#endif
101
102//ll
Note: See TracBrowser for help on using the repository browser.