Commit 317cc63d2054fdded252779b317c20a2c79ff389
1 parent
4f4e6438
huge refactoring of build structure as well as other changes...sorry for the hug…
…e diff. These are the changes done within the sister project taskrambler, including reactivation of the existing tests as well as code coverage reports
Showing
100 changed files
with
1031 additions
and
468 deletions
Too many changes to show.
To preserve performance only 100 of 100+ files are displayed.
1 | .*.swp | 1 | .*.swp |
2 | *.o | 2 | *.o |
3 | +*.a | ||
4 | +*.gcda | ||
5 | +*.gcno | ||
3 | .dirstamp | 6 | .dirstamp |
4 | .deps/ | 7 | .deps/ |
5 | Makefile | 8 | Makefile |
@@ -8,6 +11,10 @@ Makefile.in | @@ -8,6 +11,10 @@ Makefile.in | ||
8 | m4/ | 11 | m4/ |
9 | /docs/ | 12 | /docs/ |
10 | /INSTALL | 13 | /INSTALL |
14 | +coverage.base | ||
15 | +coverage.run | ||
16 | +coverage.info | ||
17 | +coveragereport/ | ||
11 | *.m4 | 18 | *.m4 |
12 | /autom4te.cache/ | 19 | /autom4te.cache/ |
13 | /compile | 20 | /compile |
@@ -18,4 +25,5 @@ m4/ | @@ -18,4 +25,5 @@ m4/ | ||
18 | /ltmain.sh | 25 | /ltmain.sh |
19 | /missing | 26 | /missing |
20 | stamp-h1 | 27 | stamp-h1 |
21 | -src/webgameserver | 28 | +src/taskrambler |
29 | +/tests/*Test |
@@ -5,6 +5,8 @@ ACLOCAL_AMFLAGS = -I m4 | @@ -5,6 +5,8 @@ ACLOCAL_AMFLAGS = -I m4 | ||
5 | #create_token_LDADD = src/libtoken.la $(LIBOBJS) | 5 | #create_token_LDADD = src/libtoken.la $(LIBOBJS) |
6 | #create_token_CFLAGS = -Wall -I include | 6 | #create_token_CFLAGS = -Wall -I include |
7 | 7 | ||
8 | -EXTRA_DIST = include assets | 8 | +EXTRA_DIST = include assets certs |
9 | 9 | ||
10 | SUBDIRS = src tests | 10 | SUBDIRS = src tests |
11 | + | ||
12 | +include $(top_srcdir)/Makefile.am.coverage |
Makefile.am.coverage
0 → 100644
1 | + | ||
2 | +# Coverage targets | ||
3 | + | ||
4 | +#if HAVE_GCOV | ||
5 | + | ||
6 | + .PHONY: clean-gcda | ||
7 | + clean-gcda: | ||
8 | + @echo Removing old coverage results | ||
9 | + -find -name '*.gcda' -print | xargs -r rm | ||
10 | + | ||
11 | + .PHONY: coverage-html generate-coverage-html clean-coverage-html | ||
12 | + coverage-html: clean-gcda | ||
13 | + -$(MAKE) -C tests $(AM_MAKEFLAGS) -k check-build | ||
14 | + $(MAKE) $(AM_MAKEFLAGS) init-coverage-html | ||
15 | + -$(MAKE) $(AM_MAKEFLAGS) -k check | ||
16 | + $(MAKE) $(AM_MAKEFLAGS) generate-coverage-html | ||
17 | + | ||
18 | + init-coverage-html: | ||
19 | + $(LCOV) -d $(top_builddir) -c -i -o coverage.base --no-checksum --compat-libtool | ||
20 | + | ||
21 | + generate-coverage-html: | ||
22 | + @echo Collecting coverage data | ||
23 | + $(LCOV) -d $(top_builddir) -c -o coverage.run --no-checksum --compat-libtool | ||
24 | + $(LCOV) -d $(top_builddir) -a ./coverage.base -a ./coverage.run -o coverage.info --no-checksum --compat-libtool | ||
25 | + LANG=C $(GENHTML) --prefix $(top_builddir) --output-directory coveragereport --title "Code Coverage" --legend --branch-coverage --show-details coverage.info | ||
26 | + | ||
27 | + clean-coverage-html: clean-gcda | ||
28 | + -$(LCOV) --directory $(top_builddir) -z | ||
29 | + -rm -rf coverage.info coveragereport | ||
30 | + | ||
31 | + clean-local: clean-coverage-html | ||
32 | + | ||
33 | +#endif # HAVE_GCOV |
@@ -3,13 +3,22 @@ | @@ -3,13 +3,22 @@ | ||
3 | 3 | ||
4 | AC_PREREQ([2.68]) | 4 | AC_PREREQ([2.68]) |
5 | AC_INIT([webgameserver], [0.0.2], [Georg Hopp <georg@steffers.org>]) | 5 | AC_INIT([webgameserver], [0.0.2], [Georg Hopp <georg@steffers.org>]) |
6 | +LT_INIT | ||
6 | AM_INIT_AUTOMAKE | 7 | AM_INIT_AUTOMAKE |
7 | -AC_COPYRIGHT([Copyright (C) 2012 Georg Hopp]) | ||
8 | -AC_REVISION([$Revision: 0.03 $]) | 8 | +#AM_INIT_AUTOMAKE([subdir-objects]) |
9 | +AM_SILENT_RULES([yes]) | ||
10 | +AC_COPYRIGHT([Copyright © 2012 Georg Hopp]) | ||
11 | +AC_REVISION([$Revision: 0.04 $]) | ||
9 | AC_CONFIG_SRCDIR([src/webgameserver.c]) | 12 | AC_CONFIG_SRCDIR([src/webgameserver.c]) |
10 | AC_CONFIG_HEADERS([config.h]) | 13 | AC_CONFIG_HEADERS([config.h]) |
11 | AC_CONFIG_MACRO_DIR([m4]) | 14 | AC_CONFIG_MACRO_DIR([m4]) |
12 | 15 | ||
16 | +m4_include([m4/gcov.m4]) | ||
17 | +AC_TDD_GCOV | ||
18 | +AC_SUBST(COVERAGE_CFLAGS) | ||
19 | +AC_SUBST(COVERAGE_CXXFLAGS) | ||
20 | +AC_SUBST(COVERAGE_LDFLAGS) | ||
21 | + | ||
13 | # Checks for programs. | 22 | # Checks for programs. |
14 | AC_PROG_CXX | 23 | AC_PROG_CXX |
15 | AC_PROG_CC | 24 | AC_PROG_CC |
@@ -37,5 +46,17 @@ AC_TYPE_SIZE_T | @@ -37,5 +46,17 @@ AC_TYPE_SIZE_T | ||
37 | #AC_FUNC_MALLOC | 46 | #AC_FUNC_MALLOC |
38 | AC_CHECK_FUNCS([memset]) | 47 | AC_CHECK_FUNCS([memset]) |
39 | 48 | ||
40 | -AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile]) | 49 | +AC_CONFIG_FILES([Makefile |
50 | + src/Makefile | ||
51 | + src/auth/Makefile | ||
52 | + src/cbuf/Makefile | ||
53 | + src/class/Makefile | ||
54 | + src/hash/Makefile | ||
55 | + src/http/Makefile | ||
56 | + src/logger/Makefile | ||
57 | + src/server/Makefile | ||
58 | + src/session/Makefile | ||
59 | + src/socket/Makefile | ||
60 | + src/stream/Makefile | ||
61 | + tests/Makefile]) | ||
41 | AC_OUTPUT | 62 | AC_OUTPUT |
1 | -/** | ||
2 | - * \file | ||
3 | - * Authenticatio module factory | ||
4 | - * | ||
5 | - * A factory to get a specific authentication module. | ||
6 | - * An authentication module is a class that implement the Auth interface. | ||
7 | - * | ||
8 | - * \author Georg Hopp | ||
9 | - * | ||
10 | - * \copyright | ||
11 | - * Copyright © 2012 Georg Hopp | ||
12 | - * | ||
13 | - * This program is free software: you can redistribute it and/or modify | ||
14 | - * it under the terms of the GNU General Public License as published by | ||
15 | - * the Free Software Foundation, either version 3 of the License, or | ||
16 | - * (at your option) any later version. | ||
17 | - * | ||
18 | - * This program is distributed in the hope that it will be useful, | ||
19 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
20 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
21 | - * GNU General Public License for more details. | ||
22 | - * | ||
23 | - * You should have received a copy of the GNU General Public License | ||
24 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
25 | - */ | ||
26 | - | ||
27 | #ifndef __AUTH_H__ | 1 | #ifndef __AUTH_H__ |
28 | #define __AUTH_H__ | 2 | #define __AUTH_H__ |
29 | 3 | ||
30 | -#include "class.h" | 4 | +#include "auth/auth.h" |
31 | #include "auth/ldap.h" | 5 | #include "auth/ldap.h" |
32 | - | ||
33 | -typedef enum e_AuthModule { | ||
34 | - AUTH_LDAP = 0 | ||
35 | -} AuthModule; | ||
36 | - | ||
37 | -CLASS(Auth) { | ||
38 | -}; | ||
39 | - | ||
40 | -void * authCreateById(Auth, int); | ||
41 | -AuthLdap authCreateLdap(Auth); | 6 | +#include "auth/credential.h" |
7 | +#include "auth/interface/auth.h" | ||
42 | 8 | ||
43 | #endif // __AUTH_H__ | 9 | #endif // __AUTH_H__ |
44 | 10 |
include/auth/auth.h
0 → 100644
1 | +/** | ||
2 | + * \file | ||
3 | + * Authenticatio module factory | ||
4 | + * | ||
5 | + * A factory to get a specific authentication module. | ||
6 | + * An authentication module is a class that implement the Auth interface. | ||
7 | + * | ||
8 | + * \author Georg Hopp | ||
9 | + * | ||
10 | + * \copyright | ||
11 | + * Copyright © 2012 Georg Hopp | ||
12 | + * | ||
13 | + * This program is free software: you can redistribute it and/or modify | ||
14 | + * it under the terms of the GNU General Public License as published by | ||
15 | + * the Free Software Foundation, either version 3 of the License, or | ||
16 | + * (at your option) any later version. | ||
17 | + * | ||
18 | + * This program is distributed in the hope that it will be useful, | ||
19 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
20 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
21 | + * GNU General Public License for more details. | ||
22 | + * | ||
23 | + * You should have received a copy of the GNU General Public License | ||
24 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
25 | + */ | ||
26 | + | ||
27 | +#ifndef __AUTH_AUTH_H__ | ||
28 | +#define __AUTH_AUTH_H__ | ||
29 | + | ||
30 | +#include "class.h" | ||
31 | +#include "auth/ldap.h" | ||
32 | + | ||
33 | +typedef enum e_AuthModule { | ||
34 | + AUTH_LDAP = 0 | ||
35 | +} AuthModule; | ||
36 | + | ||
37 | +CLASS(Auth) { | ||
38 | +}; | ||
39 | + | ||
40 | +void * authCreateById(Auth, int); | ||
41 | +AuthLdap authCreateLdap(Auth); | ||
42 | + | ||
43 | +#endif // __AUTH_AUTH_H__ | ||
44 | + | ||
45 | +// vim: set ts=4 sw=4: |
1 | -#ifndef __CREDENTIAL_H__ | ||
2 | -#define __CREDENTIAL_H__ | 1 | +/** |
2 | + * \file | ||
3 | + * | ||
4 | + * \author Georg Hopp | ||
5 | + * | ||
6 | + * \copyright | ||
7 | + * Copyright © 2012 Georg Hopp | ||
8 | + * | ||
9 | + * This program is free software: you can redistribute it and/or modify | ||
10 | + * it under the terms of the GNU General Public License as published by | ||
11 | + * the Free Software Foundation, either version 3 of the License, or | ||
12 | + * (at your option) any later version. | ||
13 | + * | ||
14 | + * This program 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 program. If not, see <http://www.gnu.org/licenses/>. | ||
21 | + */ | ||
22 | + | ||
23 | +#ifndef __AUTH_CREDENTIAL_H__ | ||
24 | +#define __AUTH_CREDENTIAL_H__ | ||
3 | 25 | ||
4 | #include <sys/types.h> | 26 | #include <sys/types.h> |
5 | 27 | ||
@@ -27,6 +49,6 @@ CLASS(Credential) { | @@ -27,6 +49,6 @@ CLASS(Credential) { | ||
27 | } cred; | 49 | } cred; |
28 | }; | 50 | }; |
29 | 51 | ||
30 | -#endif // __CREDENTIAL_H__ | 52 | +#endif // __AUTH_CREDENTIAL_H__ |
31 | 53 | ||
32 | // vim: set ts=4 sw=4: | 54 | // vim: set ts=4 sw=4: |
@@ -25,13 +25,13 @@ | @@ -25,13 +25,13 @@ | ||
25 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 25 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | -#ifndef __INTERFACE_AUTH_H__ | ||
29 | -#define __INTERFACE_AUTH_H__ | 28 | +#ifndef __AUTH_INTERFACE_AUTH_H__ |
29 | +#define __AUTH_INTERFACE_AUTH_H__ | ||
30 | 30 | ||
31 | #include <stdarg.h> | 31 | #include <stdarg.h> |
32 | 32 | ||
33 | -#include "interface.h" | ||
34 | -#include "credential.h" | 33 | +#include "class.h" |
34 | +#include "auth/credential.h" | ||
35 | 35 | ||
36 | typedef int (* fptr_authenticate)(void *, Credential); | 36 | typedef int (* fptr_authenticate)(void *, Credential); |
37 | 37 | ||
@@ -44,6 +44,6 @@ struct i_Auth { | @@ -44,6 +44,6 @@ struct i_Auth { | ||
44 | 44 | ||
45 | extern int authenticate(void *, Credential); | 45 | extern int authenticate(void *, Credential); |
46 | 46 | ||
47 | -#endif // __INTERFACE_AUTH_H__ | 47 | +#endif // __AUTH_INTERFACE_AUTH_H__ |
48 | 48 | ||
49 | // vim: set ts=4 sw=4: | 49 | // vim: set ts=4 sw=4: |
1 | +/** | ||
2 | + * \file | ||
3 | + * | ||
4 | + * \author Georg Hopp | ||
5 | + * | ||
6 | + * \copyright | ||
7 | + * Copyright © 2012 Georg Hopp | ||
8 | + * | ||
9 | + * This program is free software: you can redistribute it and/or modify | ||
10 | + * it under the terms of the GNU General Public License as published by | ||
11 | + * the Free Software Foundation, either version 3 of the License, or | ||
12 | + * (at your option) any later version. | ||
13 | + * | ||
14 | + * This program 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 program. If not, see <http://www.gnu.org/licenses/>. | ||
21 | + */ | ||
22 | + | ||
1 | #ifndef __AUTH_LDAP_H__ | 23 | #ifndef __AUTH_LDAP_H__ |
2 | #define __AUTH_LDAP_H__ | 24 | #define __AUTH_LDAP_H__ |
3 | 25 |
@@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
11 | * \author Georg Hopp | 11 | * \author Georg Hopp |
12 | * | 12 | * |
13 | * \copyright | 13 | * \copyright |
14 | - * Copyright (C) 2012 Georg Hopp | 14 | + * Copyright © 2012 Georg Hopp |
15 | * | 15 | * |
16 | * This program is free software: you can redistribute it and/or modify | 16 | * This program is free software: you can redistribute it and/or modify |
17 | * it under the terms of the GNU General Public License as published by | 17 | * it under the terms of the GNU General Public License as published by |
1 | -/** | ||
2 | - * \file | ||
3 | - * My own class implementation for C. It combines a data structure | ||
4 | - * with a set of dynamically linked methods defined by an interface. A | ||
5 | - * dynamically linked method will be called via a selector method which in | ||
6 | - * turn gets the implementation stored in the class. | ||
7 | - * | ||
8 | - * \author Georg Hopp | ||
9 | - * | ||
10 | - * \copyright | ||
11 | - * Copyright (C) 2012 Georg Hopp | ||
12 | - * | ||
13 | - * This program is free software: you can redistribute it and/or modify | ||
14 | - * it under the terms of the GNU General Public License as published by | ||
15 | - * the Free Software Foundation, either version 3 of the License, or | ||
16 | - * (at your option) any later version. | ||
17 | - * | ||
18 | - * This program is distributed in the hope that it will be useful, | ||
19 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
20 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
21 | - * GNU General Public License for more details. | ||
22 | - * | ||
23 | - * You should have received a copy of the GNU General Public License | ||
24 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
25 | - */ | ||
26 | - | ||
27 | #ifndef __CLASS_H__ | 1 | #ifndef __CLASS_H__ |
28 | #define __CLASS_H__ | 2 | #define __CLASS_H__ |
29 | 3 | ||
30 | -#include <stdarg.h> | ||
31 | -#include <sys/types.h> | ||
32 | -#include <string.h> | ||
33 | -#include <assert.h> | ||
34 | - | ||
35 | -#include "interface.h" | ||
36 | - | ||
37 | -#ifndef _ISOC99_SOURCE | ||
38 | -#define _ISOC99_SOURCE | ||
39 | -#endif | ||
40 | - | ||
41 | -#define CLASS_MAGIC 0xFEFE | ||
42 | - | ||
43 | -#define CLASS(name) \ | ||
44 | - struct c_##name; \ | ||
45 | - typedef struct c_##name * name; \ | ||
46 | - extern struct class * const _##name; \ | ||
47 | - struct c_##name | ||
48 | - | ||
49 | -#define EXTENDS(parent) \ | ||
50 | - const char _[sizeof(struct c_##parent)] | ||
51 | - | ||
52 | -#define _NULL NULL | ||
53 | -#define CREATE_CLASS(name,_parent,...) \ | ||
54 | - static struct class c_##name; \ | ||
55 | - static void _classInit_(void) { \ | ||
56 | - c_##name.parent = _##_parent; \ | ||
57 | - c_##name.init = NULL; \ | ||
58 | - } \ | ||
59 | - static struct class c_##name = { \ | ||
60 | - CLASS_MAGIC, \ | ||
61 | - NULL, \ | ||
62 | - sizeof(struct c_##name), \ | ||
63 | - _classInit_, \ | ||
64 | - INIT_IMPL(__VA_ARGS__) \ | ||
65 | - }; struct class * const _##name = &c_##name | ||
66 | - | ||
67 | -#define GET_CLASS(object) (*(class_ptr *)((object) - sizeof(void*))) | ||
68 | -#define IFACE_GET(class,iface) (interfaceGet(&((class)->impl),(iface))) | ||
69 | -#define IFACE_EXISTS(class,iface) (NULL != IFACE_GET((class),(iface))) | ||
70 | - | ||
71 | -/** | ||
72 | - * \todo actually i use gcc feature ## for variadoc... think about | ||
73 | - * a way to make this standard. | ||
74 | - */ | ||
75 | -#define _CALL(object,_iface,method,...) \ | ||
76 | - do { \ | ||
77 | - class_ptr class = GET_CLASS((object)); \ | ||
78 | - if (class->init) class->init(); \ | ||
79 | - iface = (struct i_##_iface *)IFACE_GET(class, &i_##_iface); \ | ||
80 | - while ((NULL == iface || NULL == iface->method) && HAS_PARENT(class)) { \ | ||
81 | - class = class->parent; \ | ||
82 | - if (class->init) class->init(); \ | ||
83 | - iface = (struct i_##_iface *)IFACE_GET(class, &i_##_iface); \ | ||
84 | - }; \ | ||
85 | - assert(NULL != iface->method); \ | ||
86 | - } while(0) | ||
87 | - | ||
88 | -#define CALL(object,_iface,method,...) \ | ||
89 | - do { \ | ||
90 | - struct i_##_iface * iface; \ | ||
91 | - _CALL(object, _iface, method, ##__VA_ARGS__); \ | ||
92 | - iface->method(object, ##__VA_ARGS__); \ | ||
93 | - } while(0) | ||
94 | - | ||
95 | -#define RETCALL(object,_iface,method,ret,...) \ | ||
96 | - do { \ | ||
97 | - struct i_##_iface * iface; \ | ||
98 | - _CALL(object, _iface, method, ##__VA_ARGS__); \ | ||
99 | - ret = iface->method(object, ##__VA_ARGS__); \ | ||
100 | - } while(0) | ||
101 | - | ||
102 | -#define PARENTCALL(object,_iface,method,...) \ | ||
103 | - do { \ | ||
104 | - struct i_##_iface * iface; \ | ||
105 | - class_ptr class = GET_CLASS((object)); \ | ||
106 | - if (class->init) class->init(); \ | ||
107 | - assert(HAS_PARENT(class)); \ | ||
108 | - class = class->parent; \ | ||
109 | - if (class->init) class->init(); \ | ||
110 | - iface = (struct i_##_iface *)IFACE_GET(class, &i_##_iface); \ | ||
111 | - assert(NULL != iface->method); \ | ||
112 | - iface->method(object, ##__VA_ARGS__); \ | ||
113 | - } while(0) | ||
114 | - | ||
115 | - | ||
116 | -#define HAS_PARENT(class) (NULL != ((class)->parent)) | ||
117 | - | ||
118 | -typedef void (* fptr_classInit)(void); | ||
119 | - | ||
120 | -struct class; | ||
121 | -typedef struct class * class_ptr; | ||
122 | -struct class { | ||
123 | - const int magic; | ||
124 | - class_ptr parent; | ||
125 | - size_t object_size; | ||
126 | - fptr_classInit init; | ||
127 | - struct iface_impl impl; | ||
128 | -}; | 4 | +#include "class/class.h" |
5 | +#include "class/interface.h" | ||
6 | +#include "class/interface/class.h" | ||
129 | 7 | ||
130 | #endif // __CLASS_H__ | 8 | #endif // __CLASS_H__ |
131 | 9 |
include/class/class.h
0 → 100644
1 | +/** | ||
2 | + * \file | ||
3 | + * My own class implementation for C. It combines a data structure | ||
4 | + * with a set of dynamically linked methods defined by an interface. A | ||
5 | + * dynamically linked method will be called via a selector method which in | ||
6 | + * turn gets the implementation stored in the class. | ||
7 | + * | ||
8 | + * \author Georg Hopp | ||
9 | + * | ||
10 | + * \copyright | ||
11 | + * Copyright © 2012 Georg Hopp | ||
12 | + * | ||
13 | + * This program is free software: you can redistribute it and/or modify | ||
14 | + * it under the terms of the GNU General Public License as published by | ||
15 | + * the Free Software Foundation, either version 3 of the License, or | ||
16 | + * (at your option) any later version. | ||
17 | + * | ||
18 | + * This program is distributed in the hope that it will be useful, | ||
19 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
20 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
21 | + * GNU General Public License for more details. | ||
22 | + * | ||
23 | + * You should have received a copy of the GNU General Public License | ||
24 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
25 | + */ | ||
26 | + | ||
27 | +#ifndef __CLASS_CLASS_H__ | ||
28 | +#define __CLASS_CLASS_H__ | ||
29 | + | ||
30 | +#include <stdarg.h> | ||
31 | +#include <sys/types.h> | ||
32 | +#include <string.h> | ||
33 | +#include <assert.h> | ||
34 | + | ||
35 | +#include "class/interface.h" | ||
36 | + | ||
37 | +#ifndef _ISOC99_SOURCE | ||
38 | +#define _ISOC99_SOURCE | ||
39 | +#endif | ||
40 | + | ||
41 | +#define CLASS_MAGIC 0xFEFE | ||
42 | + | ||
43 | +#define CLASS(name) \ | ||
44 | + struct c_##name; \ | ||
45 | + typedef struct c_##name * name; \ | ||
46 | + extern struct class * const _##name; \ | ||
47 | + struct c_##name | ||
48 | + | ||
49 | +#define EXTENDS(parent) \ | ||
50 | + const char _[sizeof(struct c_##parent)] | ||
51 | + | ||
52 | +#define _NULL NULL | ||
53 | +#define CREATE_CLASS(name,_parent,...) \ | ||
54 | + static struct class c_##name; \ | ||
55 | + static class_ptr _classInit##name##_(void) { \ | ||
56 | + c_##name.parent = _##_parent; \ | ||
57 | + c_##name.init = NULL; \ | ||
58 | + return &c_##name; \ | ||
59 | + } \ | ||
60 | + static struct class c_##name = { \ | ||
61 | + CLASS_MAGIC, \ | ||
62 | + NULL, \ | ||
63 | + sizeof(struct c_##name), \ | ||
64 | + _classInit##name##_, \ | ||
65 | + INIT_IFACE_IMPL(__VA_ARGS__) \ | ||
66 | + }; struct class * const _##name = &c_##name | ||
67 | + | ||
68 | +#define INIT_CLASS(class) ((class)->init? (class)->init() : (class)) | ||
69 | +#define GET_CLASS(object) (INIT_CLASS(*(class_ptr *)((void*)(object) - sizeof(void*)))) | ||
70 | +#define IFACE_GET(class,iface) (interfaceGet(&((class)->impl),(iface))) | ||
71 | +#define HAS_PARENT(class) (NULL != ((class)->parent) && INIT_CLASS((class)->parent)) | ||
72 | + | ||
73 | +#define IS_OBJECT(obj) ((GET_CLASS((obj)))->magic == CLASS_MAGIC) | ||
74 | +#define INSTANCE_OF(class,obj) ((GET_CLASS((obj))) == _##class) | ||
75 | + | ||
76 | +/** | ||
77 | + * \todo actually i use gcc feature ## for variadoc... think about | ||
78 | + * a way to make this standard. | ||
79 | + */ | ||
80 | +#define _CALL(_class,_iface,method,...) \ | ||
81 | + do { \ | ||
82 | + class_ptr class = _class; \ | ||
83 | + iface = (struct i_##_iface *)IFACE_GET(class, &i_##_iface); \ | ||
84 | + while ((NULL == iface || NULL == iface->method) && HAS_PARENT(class)) { \ | ||
85 | + class = class->parent; \ | ||
86 | + iface = (struct i_##_iface *)IFACE_GET(class, &i_##_iface); \ | ||
87 | + } \ | ||
88 | + assert(NULL != iface->method); \ | ||
89 | + } while(0) | ||
90 | + | ||
91 | +#define CALL(object,_iface,method,...) \ | ||
92 | + do { \ | ||
93 | + struct i_##_iface * iface; \ | ||
94 | + _CALL(GET_CLASS(object), _iface, method, ##__VA_ARGS__); \ | ||
95 | + iface->method(object, ##__VA_ARGS__); \ | ||
96 | + } while(0) | ||
97 | + | ||
98 | +#define RETCALL(object,_iface,method,ret,...) \ | ||
99 | + do { \ | ||
100 | + struct i_##_iface * iface; \ | ||
101 | + _CALL(GET_CLASS(object), _iface, method, ##__VA_ARGS__); \ | ||
102 | + ret = iface->method(object, ##__VA_ARGS__); \ | ||
103 | + } while(0) | ||
104 | + | ||
105 | +#define PARENTCALL(object,_iface,method,...) \ | ||
106 | + do { \ | ||
107 | + struct i_##_iface * iface; \ | ||
108 | + class_ptr pc_class = GET_CLASS((object)); \ | ||
109 | + assert(HAS_PARENT(pc_class)); \ | ||
110 | + _CALL(pc_class->parent, _iface, method, ##__VA_ARGS__); \ | ||
111 | + iface->method(object, ##__VA_ARGS__); \ | ||
112 | + } while(0) | ||
113 | + | ||
114 | + | ||
115 | +struct class; | ||
116 | +typedef struct class * class_ptr; | ||
117 | +typedef class_ptr (* fptr_classInit)(void); | ||
118 | +struct class { | ||
119 | + const int magic; | ||
120 | + class_ptr parent; | ||
121 | + size_t object_size; | ||
122 | + fptr_classInit init; | ||
123 | + struct iface_impl impl; | ||
124 | +}; | ||
125 | + | ||
126 | +#endif // __CLASS_CLASS_H__ | ||
127 | + | ||
128 | +// vim: set ts=4 sw=4: |
@@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
8 | * \author Georg Hopp | 8 | * \author Georg Hopp |
9 | * | 9 | * |
10 | * \copyright | 10 | * \copyright |
11 | - * Copyright (C) 2012 Georg Hopp | 11 | + * Copyright © 2012 Georg Hopp |
12 | * | 12 | * |
13 | * This program is free software: you can redistribute it and/or modify | 13 | * This program is free software: you can redistribute it and/or modify |
14 | * it under the terms of the GNU General Public License as published by | 14 | * it under the terms of the GNU General Public License as published by |
@@ -24,8 +24,8 @@ | @@ -24,8 +24,8 @@ | ||
24 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 24 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
25 | */ | 25 | */ |
26 | 26 | ||
27 | -#ifndef __INTERFACE_H__ | ||
28 | -#define __INTERFACE_H__ | 27 | +#ifndef __CLASS_INTERFACE_H__ |
28 | +#define __CLASS_INTERFACE_H__ | ||
29 | 29 | ||
30 | #include <sys/types.h> | 30 | #include <sys/types.h> |
31 | 31 | ||
@@ -36,7 +36,7 @@ | @@ -36,7 +36,7 @@ | ||
36 | static const struct i_##name i_##name##_impl = {&i_##name,__VA_ARGS__} | 36 | static const struct i_##name i_##name##_impl = {&i_##name,__VA_ARGS__} |
37 | 37 | ||
38 | #define NUMARGS(...) (sizeof((const void*[]){__VA_ARGS__})/sizeof(void*)) | 38 | #define NUMARGS(...) (sizeof((const void*[]){__VA_ARGS__})/sizeof(void*)) |
39 | -#define INIT_IMPL(...) {NUMARGS(__VA_ARGS__), 0, {__VA_ARGS__}} | 39 | +#define INIT_IFACE_IMPL(...) {NUMARGS(__VA_ARGS__), 0, {__VA_ARGS__}} |
40 | 40 | ||
41 | 41 | ||
42 | struct interface { | 42 | struct interface { |
@@ -52,8 +52,8 @@ struct iface_impl { | @@ -52,8 +52,8 @@ struct iface_impl { | ||
52 | }; | 52 | }; |
53 | typedef struct iface_impl * iface_impl_ptr; | 53 | typedef struct iface_impl * iface_impl_ptr; |
54 | 54 | ||
55 | -extern struct interface * interfaceGet(iface_impl_ptr, const iface_ptr); | 55 | +extern iface_ptr interfaceGet(iface_impl_ptr, const iface_ptr); |
56 | 56 | ||
57 | -#endif // __INTERFACE_H__ | 57 | +#endif // __CLASS_INTERFACE_H__ |
58 | 58 | ||
59 | // vim: set ts=4 sw=4: | 59 | // vim: set ts=4 sw=4: |
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | * \author Georg Hopp | 7 | * \author Georg Hopp |
8 | * | 8 | * |
9 | * \copyright | 9 | * \copyright |
10 | - * Copyright (C) 2012 Georg Hopp | 10 | + * Copyright © 2012 Georg Hopp |
11 | * | 11 | * |
12 | * This program is free software: you can redistribute it and/or modify | 12 | * This program is free software: you can redistribute it and/or modify |
13 | * it under the terms of the GNU General Public License as published by | 13 | * it under the terms of the GNU General Public License as published by |
@@ -23,13 +23,13 @@ | @@ -23,13 +23,13 @@ | ||
23 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 23 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | -#ifndef __INTERFACE_CLASS_H__ | ||
27 | -#define __INTERFACE_CLASS_H__ | 26 | +#ifndef __CLASS_INTERFACE_CLASS_H__ |
27 | +#define __CLASS_INTERFACE_CLASS_H__ | ||
28 | 28 | ||
29 | #include <stdarg.h> | 29 | #include <stdarg.h> |
30 | 30 | ||
31 | -#include "class.h" | ||
32 | -#include "interface.h" | 31 | +#include "class/class.h" |
32 | +#include "class/interface.h" | ||
33 | 33 | ||
34 | typedef int (* fptr_ctor)(void *, va_list *); | 34 | typedef int (* fptr_ctor)(void *, va_list *); |
35 | typedef void (* fptr_dtor)(void *); | 35 | typedef void (* fptr_dtor)(void *); |
@@ -52,6 +52,6 @@ extern void * classClone(void *); | @@ -52,6 +52,6 @@ extern void * classClone(void *); | ||
52 | #define delete(object) classDelete((void **)&(object)) | 52 | #define delete(object) classDelete((void **)&(object)) |
53 | #define clone(object) classClone((void *)(object)) | 53 | #define clone(object) classClone((void *)(object)) |
54 | 54 | ||
55 | -#endif // __INTERFACE_CLASS_H__ | 55 | +#endif // __CLASS_INTERFACE_CLASS_H__ |
56 | 56 | ||
57 | // vim: set ts=4 sw=4: | 57 | // vim: set ts=4 sw=4: |
1 | +/** | ||
2 | + * \file | ||
3 | + * | ||
4 | + * \author Georg Hopp | ||
5 | + * | ||
6 | + * \copyright | ||
7 | + * Copyright © 2012 Georg Hopp | ||
8 | + * | ||
9 | + * This program is free software: you can redistribute it and/or modify | ||
10 | + * it under the terms of the GNU General Public License as published by | ||
11 | + * the Free Software Foundation, either version 3 of the License, or | ||
12 | + * (at your option) any later version. | ||
13 | + * | ||
14 | + * This program 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 program. If not, see <http://www.gnu.org/licenses/>. | ||
21 | + */ | ||
22 | + | ||
1 | #ifndef __COMMONS_H__ | 23 | #ifndef __COMMONS_H__ |
2 | #define __COMMONS_H__ | 24 | #define __COMMONS_H__ |
3 | 25 |
1 | #ifndef __HASH_H__ | 1 | #ifndef __HASH_H__ |
2 | #define __HASH_H__ | 2 | #define __HASH_H__ |
3 | 3 | ||
4 | -#include <sys/types.h> | ||
5 | - | ||
6 | -#include "class.h" | ||
7 | - | ||
8 | - | ||
9 | -CLASS(Hash) { | ||
10 | - void * root; | ||
11 | -}; | ||
12 | - | ||
13 | -void * hashAdd(Hash, void *); | ||
14 | -void * hashDelete(Hash, const char *, size_t); | ||
15 | -void * hashGet(Hash, const char *, size_t); | ||
16 | -void hashEach(Hash, void (*)(const void*)); | 4 | +#include "hash/hash.h" |
5 | +#include "hash/value.h" | ||
6 | +#include "hash/interface/hashable.h" | ||
17 | 7 | ||
18 | #endif // __HASH_H__ | 8 | #endif // __HASH_H__ |
19 | 9 |
include/hash/hash.h
0 → 100644
1 | +/** | ||
2 | + * \file | ||
3 | + * | ||
4 | + * \author Georg Hopp | ||
5 | + * | ||
6 | + * \copyright | ||
7 | + * Copyright © 2012 Georg Hopp | ||
8 | + * | ||
9 | + * This program is free software: you can redistribute it and/or modify | ||
10 | + * it under the terms of the GNU General Public License as published by | ||
11 | + * the Free Software Foundation, either version 3 of the License, or | ||
12 | + * (at your option) any later version. | ||
13 | + * | ||
14 | + * This program 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 program. If not, see <http://www.gnu.org/licenses/>. | ||
21 | + */ | ||
22 | + | ||
23 | +#ifndef __HASH_HASH_H__ | ||
24 | +#define __HASH_HASH_H__ | ||
25 | + | ||
26 | +#include <sys/types.h> | ||
27 | + | ||
28 | +#include "class.h" | ||
29 | + | ||
30 | + | ||
31 | +CLASS(Hash) { | ||
32 | + void * root; | ||
33 | +}; | ||
34 | + | ||
35 | +void * hashAdd(Hash, void *); | ||
36 | +void * hashDelete(Hash, const char *, size_t); | ||
37 | +void * hashGet(Hash, const char *, size_t); | ||
38 | +void hashEach(Hash, void (*)(const void*)); | ||
39 | + | ||
40 | +#endif // __HASH_HASH_H__ | ||
41 | + | ||
42 | +// vim: set ts=4 sw=4: |
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | * \author Georg Hopp | 5 | * \author Georg Hopp |
6 | * | 6 | * |
7 | * \copyright | 7 | * \copyright |
8 | - * Copyright (C) 2012 Georg Hopp | 8 | + * Copyright © 2012 Georg Hopp |
9 | * | 9 | * |
10 | * This program is free software: you can redistribute it and/or modify | 10 | * This program is free software: you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License as published by | 11 | * it under the terms of the GNU General Public License as published by |
@@ -21,10 +21,10 @@ | @@ -21,10 +21,10 @@ | ||
21 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 21 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | -#ifndef __INTERFACE_HASHABLE_H__ | ||
25 | -#define __INTERFACE_HASHABLE_H__ | 24 | +#ifndef __HASH_INTERFACE_HASHABLE_H__ |
25 | +#define __HASH_INTERFACE_HASHABLE_H__ | ||
26 | 26 | ||
27 | -#include "interface.h" | 27 | +#include "class.h" |
28 | 28 | ||
29 | typedef unsigned long (* fptr_hashableGetHash)(void *); | 29 | typedef unsigned long (* fptr_hashableGetHash)(void *); |
30 | typedef void (* fptr_hashableHandleDouble)(void *, void *); | 30 | typedef void (* fptr_hashableHandleDouble)(void *, void *); |
@@ -40,6 +40,6 @@ struct i_Hashable { | @@ -40,6 +40,6 @@ struct i_Hashable { | ||
40 | extern unsigned long hashableGetHash(void *); | 40 | extern unsigned long hashableGetHash(void *); |
41 | extern void hashableHandleDouble(void *, void *); | 41 | extern void hashableHandleDouble(void *, void *); |
42 | 42 | ||
43 | -#endif // __INTERFACE_HASHABLE_H__ | 43 | +#endif // __HASH_INTERFACE_HASHABLE_H__ |
44 | 44 | ||
45 | // vim: set ts=4 sw=4: | 45 | // vim: set ts=4 sw=4: |
1 | +/** | ||
2 | + * \file | ||
3 | + * | ||
4 | + * \author Georg Hopp | ||
5 | + * | ||
6 | + * \copyright | ||
7 | + * Copyright © 2012 Georg Hopp | ||
8 | + * | ||
9 | + * This program is free software: you can redistribute it and/or modify | ||
10 | + * it under the terms of the GNU General Public License as published by | ||
11 | + * the Free Software Foundation, either version 3 of the License, or | ||
12 | + * (at your option) any later version. | ||
13 | + * | ||
14 | + * This program 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 program. If not, see <http://www.gnu.org/licenses/>. | ||
21 | + */ | ||
22 | + | ||
1 | #ifndef __HASH_VALUE_H__ | 23 | #ifndef __HASH_VALUE_H__ |
2 | #define __HASH_VALUE_H__ | 24 | #define __HASH_VALUE_H__ |
3 | 25 |
include/http.h
0 → 100644
1 | +#ifndef __HTTP_H__ | ||
2 | +#define __HTTP_H__ | ||
3 | + | ||
4 | +#include "http/cookie.h" | ||
5 | +#include "http/header.h" | ||
6 | +#include "http/message.h" | ||
7 | +#include "http/message/queue.h" | ||
8 | +#include "http/request.h" | ||
9 | +#include "http/response.h" | ||
10 | +#include "http/parser.h" | ||
11 | +#include "http/writer.h" | ||
12 | +#include "http/worker.h" | ||
13 | +#include "http/interface/http_intro.h" | ||
14 | + | ||
15 | +#endif // __HTTP_H__ | ||
16 | + | ||
17 | +// vim: set ts=4 sw=4: |
1 | +/** | ||
2 | + * \file | ||
3 | + * | ||
4 | + * \author Georg Hopp | ||
5 | + * | ||
6 | + * \copyright | ||
7 | + * Copyright © 2012 Georg Hopp | ||
8 | + * | ||
9 | + * This program is free software: you can redistribute it and/or modify | ||
10 | + * it under the terms of the GNU General Public License as published by | ||
11 | + * the Free Software Foundation, either version 3 of the License, or | ||
12 | + * (at your option) any later version. | ||
13 | + * | ||
14 | + * This program 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 program. If not, see <http://www.gnu.org/licenses/>. | ||
21 | + */ | ||
22 | + | ||
1 | #ifndef __HTTP_COOKIE_H__ | 23 | #ifndef __HTTP_COOKIE_H__ |
2 | #define __HTTP_COOKIE_H__ | 24 | #define __HTTP_COOKIE_H__ |
3 | 25 |
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | * \author Georg Hopp | 6 | * \author Georg Hopp |
7 | * | 7 | * |
8 | * \copyright | 8 | * \copyright |
9 | - * Copyright (C) 2012 Georg Hopp | 9 | + * Copyright © 2012 Georg Hopp |
10 | * | 10 | * |
11 | * This program is free software: you can redistribute it and/or modify | 11 | * This program is free software: you can redistribute it and/or modify |
12 | * it under the terms of the GNU General Public License as published by | 12 | * it under the terms of the GNU General Public License as published by |
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | * \author Georg Hopp | 7 | * \author Georg Hopp |
8 | * | 8 | * |
9 | * \copyright | 9 | * \copyright |
10 | - * Copyright (C) 2012 Georg Hopp | 10 | + * Copyright © 2012 Georg Hopp |
11 | * | 11 | * |
12 | * This program is free software: you can redistribute it and/or modify | 12 | * This program is free software: you can redistribute it and/or modify |
13 | * it under the terms of the GNU General Public License as published by | 13 | * it under the terms of the GNU General Public License as published by |
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | * \author Georg Hopp | 5 | * \author Georg Hopp |
6 | * | 6 | * |
7 | * \copyright | 7 | * \copyright |
8 | - * Copyright (C) 2012 Georg Hopp | 8 | + * Copyright © 2012 Georg Hopp |
9 | * | 9 | * |
10 | * This program is free software: you can redistribute it and/or modify | 10 | * This program is free software: you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License as published by | 11 | * it under the terms of the GNU General Public License as published by |
@@ -38,7 +38,6 @@ CLASS(HttpMessage) { | @@ -38,7 +38,6 @@ CLASS(HttpMessage) { | ||
38 | char * version; | 38 | char * version; |
39 | 39 | ||
40 | Hash header; | 40 | Hash header; |
41 | - Hash cookies; | ||
42 | 41 | ||
43 | HttpMessageType type; | 42 | HttpMessageType type; |
44 | Stream handle; | 43 | Stream handle; |
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | * \author Georg Hopp | 7 | * \author Georg Hopp |
8 | * | 8 | * |
9 | * \copyright | 9 | * \copyright |
10 | - * Copyright (C) 2012 Georg Hopp | 10 | + * Copyright © 2012 Georg Hopp |
11 | * | 11 | * |
12 | * This program is free software: you can redistribute it and/or modify | 12 | * This program is free software: you can redistribute it and/or modify |
13 | * it under the terms of the GNU General Public License as published by | 13 | * it under the terms of the GNU General Public License as published by |
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | * \author Georg Hopp | 5 | * \author Georg Hopp |
6 | * | 6 | * |
7 | * \copyright | 7 | * \copyright |
8 | - * Copyright (C) 2012 Georg Hopp | 8 | + * Copyright © 2012 Georg Hopp |
9 | * | 9 | * |
10 | * This program is free software: you can redistribute it and/or modify | 10 | * This program is free software: you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License as published by | 11 | * it under the terms of the GNU General Public License as published by |
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | * \author Georg Hopp | 5 | * \author Georg Hopp |
6 | * | 6 | * |
7 | * \copyright | 7 | * \copyright |
8 | - * Copyright (C) 2012 Georg Hopp | 8 | + * Copyright © 2012 Georg Hopp |
9 | * | 9 | * |
10 | * This program is free software: you can redistribute it and/or modify | 10 | * This program is free software: you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License as published by | 11 | * it under the terms of the GNU General Public License as published by |
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | * \author Georg Hopp | 5 | * \author Georg Hopp |
6 | * | 6 | * |
7 | * \copyright | 7 | * \copyright |
8 | - * Copyright (C) 2012 Georg Hopp | 8 | + * Copyright © 2012 Georg Hopp |
9 | * | 9 | * |
10 | * This program is free software: you can redistribute it and/or modify | 10 | * This program is free software: you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License as published by | 11 | * it under the terms of the GNU General Public License as published by |
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | * \author Georg Hopp | 5 | * \author Georg Hopp |
6 | * | 6 | * |
7 | * \copyright | 7 | * \copyright |
8 | - * Copyright (C) 2012 Georg Hopp | 8 | + * Copyright © 2012 Georg Hopp |
9 | * | 9 | * |
10 | * This program is free software: you can redistribute it and/or modify | 10 | * This program is free software: you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License as published by | 11 | * it under the terms of the GNU General Public License as published by |
@@ -5,20 +5,20 @@ | @@ -5,20 +5,20 @@ | ||
5 | * \author Georg Hopp | 5 | * \author Georg Hopp |
6 | * | 6 | * |
7 | * \copyright | 7 | * \copyright |
8 | - * - Copyright (C) 2012 Georg Hopp | ||
9 | - * - | ||
10 | - * - This program is free software: you can redistribute it and/or modify | ||
11 | - * - it under the terms of the GNU General Public License as published by | ||
12 | - * - the Free Software Foundation, either version 3 of the License, or | ||
13 | - * - (at your option) any later version. | ||
14 | - * - | ||
15 | - * - This program is distributed in the hope that it will be useful, | ||
16 | - * - but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | - * - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | - * - GNU General Public License for more details. | ||
19 | - * - | ||
20 | - * - You should have received a copy of the GNU General Public License | ||
21 | - * - along with this program. If not, see <http://www.gnu.org/licenses/>. | 8 | + * Copyright © 2012 Georg Hopp |
9 | + * | ||
10 | + * This program is free software: you can redistribute it and/or modify | ||
11 | + * it under the terms of the GNU General Public License as published by | ||
12 | + * the Free Software Foundation, either version 3 of the License, or | ||
13 | + * (at your option) any later version. | ||
14 | + * | ||
15 | + * This program is distributed in the hope that it will be useful, | ||
16 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | + * GNU General Public License for more details. | ||
19 | + * | ||
20 | + * You should have received a copy of the GNU General Public License | ||
21 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
22 | */ | 22 | */ |
23 | 23 | ||
24 | #ifndef __HTTP_WRITER_H__ | 24 | #ifndef __HTTP_WRITER_H__ |
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | * \author Georg Hopp | 5 | * \author Georg Hopp |
6 | * | 6 | * |
7 | * \copyright | 7 | * \copyright |
8 | - * Copyright (C) 2012 Georg Hopp | 8 | + * Copyright © 2012 Georg Hopp |
9 | * | 9 | * |
10 | * This program is free software: you can redistribute it and/or modify | 10 | * This program is free software: you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License as published by | 11 | * it under the terms of the GNU General Public License as published by |
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | * \author Georg Hopp | 5 | * \author Georg Hopp |
6 | * | 6 | * |
7 | * \copyright | 7 | * \copyright |
8 | - * Copyright (C) 2012 Georg Hopp | 8 | + * Copyright © 2012 Georg Hopp |
9 | * | 9 | * |
10 | * This program is free software: you can redistribute it and/or modify | 10 | * This program is free software: you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License as published by | 11 | * it under the terms of the GNU General Public License as published by |
1 | -/** | ||
2 | - * \file | ||
3 | - * A generic logger class and two extended classes, One that logs to | ||
4 | - * stderr and one that logs to the system syslog. | ||
5 | - * | ||
6 | - * \author Georg Hopp | ||
7 | - * | ||
8 | - * \copyright | ||
9 | - * Copyright (C) 2012 Georg Hopp | ||
10 | - * | ||
11 | - * This program is free software: you can redistribute it and/or modify | ||
12 | - * it under the terms of the GNU General Public License as published by | ||
13 | - * the Free Software Foundation, either version 3 of the License, or | ||
14 | - * (at your option) any later version. | ||
15 | - * | ||
16 | - * This program is distributed in the hope that it will be useful, | ||
17 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | - * GNU General Public License for more details. | ||
20 | - * | ||
21 | - * You should have received a copy of the GNU General Public License | ||
22 | - * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
23 | - */ | ||
24 | - | ||
25 | #ifndef __LOGGER_H__ | 1 | #ifndef __LOGGER_H__ |
26 | #define __LOGGER_H__ | 2 | #define __LOGGER_H__ |
27 | 3 | ||
28 | -#include "class.h" | ||
29 | - | ||
30 | -typedef enum logger_level { | ||
31 | - LOGGER_DEBUG=0, | ||
32 | - LOGGER_INFO, | ||
33 | - LOGGER_NOTICE, | ||
34 | - LOGGER_WARNING, | ||
35 | - LOGGER_ERR, | ||
36 | - LOGGER_CRIT, | ||
37 | - LOGGER_ALERT, | ||
38 | - LOGGER_EMERG | ||
39 | -} logger_level; | ||
40 | - | ||
41 | -extern const char * const logger_level_str[]; | ||
42 | - | ||
43 | -CLASS(Logger) { | ||
44 | - logger_level min_level; | ||
45 | -}; | ||
46 | - | ||
47 | -CLASS(LoggerStderr) { | ||
48 | - EXTENDS(Logger); | ||
49 | -}; | ||
50 | - | ||
51 | -CLASS(LoggerSyslog) { | ||
52 | - EXTENDS(Logger); | ||
53 | -}; | 4 | +#include "logger/logger.h" |
5 | +#include "logger/interface/logger.h" | ||
54 | 6 | ||
55 | #endif // __LOGGER_H__ | 7 | #endif // __LOGGER_H__ |
56 | 8 |
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | * \author Georg Hopp | 5 | * \author Georg Hopp |
6 | * | 6 | * |
7 | * \copyright | 7 | * \copyright |
8 | - * Copyright (C) 2012 Georg Hopp | 8 | + * Copyright © 2012 Georg Hopp |
9 | * | 9 | * |
10 | * This program is free software: you can redistribute it and/or modify | 10 | * This program is free software: you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License as published by | 11 | * it under the terms of the GNU General Public License as published by |
@@ -21,12 +21,12 @@ | @@ -21,12 +21,12 @@ | ||
21 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 21 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | -#ifndef __INTERFACE_LOGGER_H__ | ||
25 | -#define __INTERFACE_LOGGER_H__ | 24 | +#ifndef __LOGGER_INTERFACE_LOGGER_H__ |
25 | +#define __LOGGER_INTERFACE_LOGGER_H__ | ||
26 | 26 | ||
27 | #include <stdarg.h> | 27 | #include <stdarg.h> |
28 | 28 | ||
29 | -#include "interface.h" | 29 | +#include "class.h" |
30 | #include "logger.h" | 30 | #include "logger.h" |
31 | 31 | ||
32 | typedef void (* fptr_log)(void *, logger_level, const char * const); | 32 | typedef void (* fptr_log)(void *, logger_level, const char * const); |
@@ -40,6 +40,6 @@ struct i_Logger { | @@ -40,6 +40,6 @@ struct i_Logger { | ||
40 | 40 | ||
41 | extern void loggerLog(void *, logger_level, const char * const, ...); | 41 | extern void loggerLog(void *, logger_level, const char * const, ...); |
42 | 42 | ||
43 | -#endif // __INTERFACE_LOGGER_H__ | 43 | +#endif // __LOGGER_INTERFACE_LOGGER_H__ |
44 | 44 | ||
45 | // vim: set ts=4 sw=4: | 45 | // vim: set ts=4 sw=4: |
include/logger/logger.h
0 → 100644
1 | +/** | ||
2 | + * \file | ||
3 | + * A generic logger class and two extended classes, One that logs to | ||
4 | + * stderr and one that logs to the system syslog. | ||
5 | + * | ||
6 | + * \author Georg Hopp | ||
7 | + * | ||
8 | + * \copyright | ||
9 | + * Copyright © 2012 Georg Hopp | ||
10 | + * | ||
11 | + * This program is free software: you can redistribute it and/or modify | ||
12 | + * it under the terms of the GNU General Public License as published by | ||
13 | + * the Free Software Foundation, either version 3 of the License, or | ||
14 | + * (at your option) any later version. | ||
15 | + * | ||
16 | + * This program is distributed in the hope that it will be useful, | ||
17 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | + * GNU General Public License for more details. | ||
20 | + * | ||
21 | + * You should have received a copy of the GNU General Public License | ||
22 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
23 | + */ | ||
24 | + | ||
25 | +#ifndef __LOGGER_LOGGER_H__ | ||
26 | +#define __LOGGER_LOGGER_H__ | ||
27 | + | ||
28 | +#include "class.h" | ||
29 | + | ||
30 | +typedef enum logger_level { | ||
31 | + LOGGER_DEBUG=0, | ||
32 | + LOGGER_INFO, | ||
33 | + LOGGER_NOTICE, | ||
34 | + LOGGER_WARNING, | ||
35 | + LOGGER_ERR, | ||
36 | + LOGGER_CRIT, | ||
37 | + LOGGER_ALERT, | ||
38 | + LOGGER_EMERG | ||
39 | +} logger_level; | ||
40 | + | ||
41 | +extern const char * const logger_level_str[]; | ||
42 | + | ||
43 | +CLASS(Logger) { | ||
44 | + logger_level min_level; | ||
45 | +}; | ||
46 | + | ||
47 | +CLASS(LoggerStderr) { | ||
48 | + EXTENDS(Logger); | ||
49 | +}; | ||
50 | + | ||
51 | +CLASS(LoggerSyslog) { | ||
52 | + EXTENDS(Logger); | ||
53 | +}; | ||
54 | + | ||
55 | +#endif // __LOGGER_LOGGER_H__ | ||
56 | + | ||
57 | +// vim: set ts=4 sw=4: |
@@ -7,7 +7,7 @@ | @@ -7,7 +7,7 @@ | ||
7 | * \author Georg Hopp | 7 | * \author Georg Hopp |
8 | * | 8 | * |
9 | * \copyright | 9 | * \copyright |
10 | - * Copyright (C) 2012 Georg Hopp | 10 | + * Copyright © 2012 Georg Hopp |
11 | * | 11 | * |
12 | * This program is free software: you can redistribute it and/or modify | 12 | * This program is free software: you can redistribute it and/or modify |
13 | * it under the terms of the GNU General Public License as published by | 13 | * it under the terms of the GNU General Public License as published by |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | * \author Georg Hopp | 6 | * \author Georg Hopp |
7 | * | 7 | * |
8 | * \copyright | 8 | * \copyright |
9 | - * Copyright (C) 2012 Georg Hopp | 9 | + * Copyright © 2012 Georg Hopp |
10 | * | 10 | * |
11 | * This program is free software: you can redistribute it and/or modify | 11 | * This program is free software: you can redistribute it and/or modify |
12 | * it under the terms of the GNU General Public License as published by | 12 | * it under the terms of the GNU General Public License as published by |
1 | #ifndef __STREAM_H__ | 1 | #ifndef __STREAM_H__ |
2 | #define __STREAM_H__ | 2 | #define __STREAM_H__ |
3 | 3 | ||
4 | -#include <sys/types.h> | ||
5 | -#include <openssl/ssl.h> | ||
6 | - | ||
7 | -#include "class.h" | ||
8 | - | ||
9 | -typedef enum e_StreamHandleType { | ||
10 | - STREAM_FD = 0, | ||
11 | - STREAM_SSL | ||
12 | -} StreamHandleType; | ||
13 | - | ||
14 | -CLASS(Stream) { | ||
15 | - StreamHandleType type; | ||
16 | - union { | ||
17 | - int fd; | ||
18 | - SSL * ssl; | ||
19 | - } handle; | ||
20 | -}; | ||
21 | - | ||
22 | -ssize_t streamRead(Stream, void *, size_t); | ||
23 | -ssize_t streamWrite(Stream, void *, size_t); | 4 | +#include "stream/stream.h" |
5 | +#include "stream/interface/reader.h" | ||
6 | +#include "stream/interface/writer.h" | ||
24 | 7 | ||
25 | #endif // __STREAM_H__ | 8 | #endif // __STREAM_H__ |
26 | 9 |
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | * \author Georg Hopp | 6 | * \author Georg Hopp |
7 | * | 7 | * |
8 | * \copyright | 8 | * \copyright |
9 | - * Copyright (C) 2012 Georg Hopp | 9 | + * Copyright © 2012 Georg Hopp |
10 | * | 10 | * |
11 | * This program is free software: you can redistribute it and/or modify | 11 | * This program is free software: you can redistribute it and/or modify |
12 | * it under the terms of the GNU General Public License as published by | 12 | * it under the terms of the GNU General Public License as published by |
@@ -22,12 +22,12 @@ | @@ -22,12 +22,12 @@ | ||
22 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 22 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | -#ifndef __STREAM_READER_H__ | ||
26 | -#define __STREAM_READER_H__ | 25 | +#ifndef __STREAM_INTERFACE_READER_H__ |
26 | +#define __STREAM_INTERFACE_READER_H__ | ||
27 | 27 | ||
28 | #include <sys/types.h> | 28 | #include <sys/types.h> |
29 | 29 | ||
30 | -#include "stream.h" | 30 | +#include "stream/stream.h" |
31 | 31 | ||
32 | typedef ssize_t (* fptr_streamReaderRead)(void *, Stream); | 32 | typedef ssize_t (* fptr_streamReaderRead)(void *, Stream); |
33 | 33 | ||
@@ -40,6 +40,6 @@ struct i_StreamReader { | @@ -40,6 +40,6 @@ struct i_StreamReader { | ||
40 | 40 | ||
41 | extern ssize_t streamReaderRead(void *, Stream); | 41 | extern ssize_t streamReaderRead(void *, Stream); |
42 | 42 | ||
43 | -#endif // __STREAM_READER_H__ | 43 | +#endif // __STREAM_INTERFACE_READER_H__ |
44 | 44 | ||
45 | // vim: set ts=4 sw=4: | 45 | // vim: set ts=4 sw=4: |
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | * \author Georg Hopp | 6 | * \author Georg Hopp |
7 | * | 7 | * |
8 | * \copyright | 8 | * \copyright |
9 | - * Copyright (C) 2012 Georg Hopp | 9 | + * Copyright © 2012 Georg Hopp |
10 | * | 10 | * |
11 | * This program is free software: you can redistribute it and/or modify | 11 | * This program is free software: you can redistribute it and/or modify |
12 | * it under the terms of the GNU General Public License as published by | 12 | * it under the terms of the GNU General Public License as published by |
@@ -22,12 +22,12 @@ | @@ -22,12 +22,12 @@ | ||
22 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 22 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
23 | */ | 23 | */ |
24 | 24 | ||
25 | -#ifndef __STREAM_WRITER_H__ | ||
26 | -#define __STREAM_WRITER_H__ | 25 | +#ifndef __STREAM_INTERFACE_WRITER_H__ |
26 | +#define __STREAM_INTERFACE_WRITER_H__ | ||
27 | 27 | ||
28 | #include <sys/types.h> | 28 | #include <sys/types.h> |
29 | 29 | ||
30 | -#include "stream.h" | 30 | +#include "stream/stream.h" |
31 | 31 | ||
32 | typedef ssize_t (* fptr_streamWriterWrite)(void *, Stream); | 32 | typedef ssize_t (* fptr_streamWriterWrite)(void *, Stream); |
33 | 33 | ||
@@ -40,6 +40,6 @@ struct i_StreamWriter { | @@ -40,6 +40,6 @@ struct i_StreamWriter { | ||
40 | 40 | ||
41 | extern ssize_t streamWriterWrite(void *, Stream); | 41 | extern ssize_t streamWriterWrite(void *, Stream); |
42 | 42 | ||
43 | -#endif // __STREAM_WRITER_H__ | 43 | +#endif // __STREAM_INTERFACE_WRITER_H__ |
44 | 44 | ||
45 | // vim: set ts=4 sw=4: | 45 | // vim: set ts=4 sw=4: |
include/stream/stream.h
0 → 100644
1 | +/** | ||
2 | + * \file | ||
3 | + * | ||
4 | + * \author Georg Hopp | ||
5 | + * | ||
6 | + * \copyright | ||
7 | + * Copyright © 2012 Georg Hopp | ||
8 | + * | ||
9 | + * This program is free software: you can redistribute it and/or modify | ||
10 | + * it under the terms of the GNU General Public License as published by | ||
11 | + * the Free Software Foundation, either version 3 of the License, or | ||
12 | + * (at your option) any later version. | ||
13 | + * | ||
14 | + * This program 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 program. If not, see <http://www.gnu.org/licenses/>. | ||
21 | + */ | ||
22 | + | ||
23 | +#ifndef __STREAM_STREAM_H__ | ||
24 | +#define __STREAM_STREAM_H__ | ||
25 | + | ||
26 | +#include <sys/types.h> | ||
27 | +#include <openssl/ssl.h> | ||
28 | + | ||
29 | +#include "class.h" | ||
30 | + | ||
31 | +typedef enum e_StreamHandleType { | ||
32 | + STREAM_FD = 0, | ||
33 | + STREAM_SSL | ||
34 | +} StreamHandleType; | ||
35 | + | ||
36 | +CLASS(Stream) { | ||
37 | + StreamHandleType type; | ||
38 | + union { | ||
39 | + int fd; | ||
40 | + SSL * ssl; | ||
41 | + } handle; | ||
42 | +}; | ||
43 | + | ||
44 | +ssize_t streamRead(Stream, void *, size_t); | ||
45 | +ssize_t streamWrite(Stream, void *, size_t); | ||
46 | + | ||
47 | +#endif // __STREAM_STREAM_H__ | ||
48 | + | ||
49 | +// vim: set ts=4 sw=4: |
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | * \author Georg Hopp | 5 | * \author Georg Hopp |
6 | * | 6 | * |
7 | * \copyright | 7 | * \copyright |
8 | - * Copyright (C) 2012 Georg Hopp | 8 | + * Copyright © 2012 Georg Hopp |
9 | * | 9 | * |
10 | * This program is free software: you can redistribute it and/or modify | 10 | * This program is free software: you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License as published by | 11 | * it under the terms of the GNU General Public License as published by |
1 | +/** | ||
2 | + * \file | ||
3 | + * | ||
4 | + * \author Georg Hopp | ||
5 | + * | ||
6 | + * \copyright | ||
7 | + * Copyright © 2012 Georg Hopp | ||
8 | + * | ||
9 | + * This program is free software: you can redistribute it and/or modify | ||
10 | + * it under the terms of the GNU General Public License as published by | ||
11 | + * the Free Software Foundation, either version 3 of the License, or | ||
12 | + * (at your option) any later version. | ||
13 | + * | ||
14 | + * This program 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 program. If not, see <http://www.gnu.org/licenses/>. | ||
21 | + */ | ||
22 | + | ||
1 | #ifndef __UTILS_HTTP_H__ | 23 | #ifndef __UTILS_HTTP_H__ |
2 | #define __UTILS_HTTP_H__ | 24 | #define __UTILS_HTTP_H__ |
3 | 25 |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | * \author Georg Hopp | 5 | * \author Georg Hopp |
6 | * | 6 | * |
7 | * \copyright | 7 | * \copyright |
8 | - * Copyright (C) 2012 Georg Hopp | 8 | + * Copyright © 2012 Georg Hopp |
9 | * | 9 | * |
10 | * This program is free software: you can redistribute it and/or modify | 10 | * This program is free software: you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License as published by | 11 | * it under the terms of the GNU General Public License as published by |
1 | ACLOCAL_AMFLAGS = -I m4 | 1 | ACLOCAL_AMFLAGS = -I m4 |
2 | -AUTOMAKE_OPTIONS = subdir-objects | ||
3 | 2 | ||
4 | -IFACE = interface/class.c interface/stream_reader.c interface/logger.c \ | ||
5 | - interface/stream_writer.c interface/http_intro.c \ | ||
6 | - interface/subject.c interface/observer.c interface.c | ||
7 | -SOCKET = socket.c socket/accept.c socket/connect.c socket/listen.c | ||
8 | -STREAM = stream.c stream/read.c stream/write.c | ||
9 | -HASH = hash.c hash/add.c hash/get.c hash/delete.c \ | ||
10 | - hash/each.c interface/hashable.c hash_value.c | ||
11 | -SERVER = server.c server/run.c server/close_conn.c server/poll.c \ | ||
12 | - server/handle_accept.c server/read.c server/write.c | ||
13 | -LOGGER = logger.c logger/stderr.c logger/syslog.c | ||
14 | -CB = cbuf.c cbuf/read.c cbuf/write.c \ | ||
15 | - cbuf/get_line.c cbuf/set_data.c cbuf/get_data.c \ | ||
16 | - cbuf/addr_index.c cbuf/get_free.c cbuf/get_read.c cbuf/get_write.c \ | ||
17 | - cbuf/inc_read.c cbuf/inc_write.c cbuf/is_empty.c cbuf/memchr.c \ | ||
18 | - cbuf/skip_non_alpha.c cbuf/is_locked.c cbuf/lock.c cbuf/release.c \ | ||
19 | - cbuf/empty.c | ||
20 | -MSG = http/message.c \ | ||
21 | - http/message/has_keep_alive.c \ | ||
22 | - http/message/header_size_get.c \ | ||
23 | - http/message/header_to_string.c \ | ||
24 | - http/message/get_version.c \ | ||
25 | - http/message/has_valid_version.c | ||
26 | -MSGQ = http/message/queue.c | ||
27 | -REQ = http/request.c \ | ||
28 | - http/request/has_valid_method.c | ||
29 | -RESP = http/response.c \ | ||
30 | - http/response/304.c \ | ||
31 | - http/response/404.c \ | ||
32 | - http/response/403.c \ | ||
33 | - http/response/login_form.c \ | ||
34 | - http/response/asset.c \ | ||
35 | - http/response/randval.c \ | ||
36 | - http/response/session.c | ||
37 | -PARSER = http/parser.c \ | ||
38 | - http/parser/parse.c \ | ||
39 | - http/parser/new_message.c \ | ||
40 | - http/parser/header.c \ | ||
41 | - http/parser/body.c \ | ||
42 | - http/parser/request_vars.c \ | ||
43 | - http/parser/post_vars.c | ||
44 | -WRITER = http/writer.c \ | ||
45 | - http/writer/write.c | ||
46 | -WORKER = http/worker.c \ | ||
47 | - http/worker/process.c \ | ||
48 | - http/worker/write.c \ | ||
49 | - http/worker/get_asset.c \ | ||
50 | - http/worker/add_common_header.c | ||
51 | -HEADER = http/header.c \ | ||
52 | - http/header/to_string.c | ||
53 | -SESSION = session.c session/add.c session/get.c session/delete.c | ||
54 | -UTILS = utils/hash.c \ | ||
55 | - utils/memory.c \ | ||
56 | - utils/http.c \ | ||
57 | - utils/daemonize.c \ | ||
58 | - utils/signalHandling.c | ||
59 | -AUTH = interface/auth.c auth/ldap.c credential.c | 3 | +IFACE = interface/subject.c \ |
4 | + interface/observer.c | ||
5 | +UTILS = utils/hash.c \ | ||
6 | + utils/memory.c \ | ||
7 | + utils/http.c \ | ||
8 | + utils/daemonize.c \ | ||
9 | + utils/signalHandling.c | ||
60 | 10 | ||
11 | +LIBS = ./http/libhttp.a \ | ||
12 | + ./auth/libauth.a \ | ||
13 | + ./cbuf/libcbuf.a \ | ||
14 | + ./class/libclass.a \ | ||
15 | + ./hash/libhash.a \ | ||
16 | + ./logger/liblogger.a \ | ||
17 | + ./server/libserver.a \ | ||
18 | + ./session/libsession.a \ | ||
19 | + ./socket/libsocket.a \ | ||
20 | + ./stream/libstream.a | ||
61 | 21 | ||
62 | AM_CFLAGS = -Wall -I ../include/ | 22 | AM_CFLAGS = -Wall -I ../include/ |
63 | 23 | ||
64 | bin_PROGRAMS = webgameserver | 24 | bin_PROGRAMS = webgameserver |
65 | 25 | ||
66 | -webgameserver_SOURCES = webgameserver.c \ | ||
67 | - $(IFACE) $(SOCKET) $(SERVER) $(LOGGER) $(MSG) $(REQ) \ | ||
68 | - $(WRITER) $(RESP) $(HEADER) $(PARSER) $(WORKER) $(CB) \ | ||
69 | - $(UTILS) $(MSGQ) $(SESSION) $(STREAM) $(HASH) $(AUTH) | ||
70 | -webgameserver_CFLAGS = -Wall -I ../include/ | ||
71 | -webgameserver_LDFLAGS = -lrt -lssl -lldap | 26 | +webgameserver_SOURCES = webgameserver.c $(IFACE) $(UTILS) |
27 | +webgameserver_CFLAGS = -Wall -I ../include/# $(COVERAGE_CFLAGS) | ||
28 | +webgameserver_LDADD = $(LIBS) -lrt -lssl -lldap | ||
29 | +#webgameserver_LDFLAGS = $(COVERAGE_LDFLAGS) | ||
30 | + | ||
31 | +SUBDIRS = auth cbuf class hash http logger server session socket stream |
src/auth/Makefile.am
0 → 100644
1 | +/** | ||
2 | + * \file | ||
3 | + * | ||
4 | + * \author Georg Hopp | ||
5 | + * | ||
6 | + * \copyright | ||
7 | + * Copyright © 2012 Georg Hopp | ||
8 | + * | ||
9 | + * This program is free software: you can redistribute it and/or modify | ||
10 | + * it under the terms of the GNU General Public License as published by | ||
11 | + * the Free Software Foundation, either version 3 of the License, or | ||
12 | + * (at your option) any later version. | ||
13 | + * | ||
14 | + * This program 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 program. If not, see <http://www.gnu.org/licenses/>. | ||
21 | + */ | ||
22 | + | ||
1 | #include <stdarg.h> | 23 | #include <stdarg.h> |
2 | #include <sys/types.h> | 24 | #include <sys/types.h> |
3 | #include <stdlib.h> | 25 | #include <stdlib.h> |
4 | #include <string.h> | 26 | #include <string.h> |
5 | 27 | ||
6 | -#include "credential.h" | ||
7 | #include "class.h" | 28 | #include "class.h" |
8 | -#include "interface/class.h" | ||
9 | - | ||
10 | #include "utils/memory.h" | 29 | #include "utils/memory.h" |
11 | 30 | ||
31 | +#include "auth/credential.h" | ||
32 | + | ||
12 | static | 33 | static |
13 | int | 34 | int |
14 | credentialCtor(void * _this, va_list * params) | 35 | credentialCtor(void * _this, va_list * params) |
@@ -20,9 +20,9 @@ | @@ -20,9 +20,9 @@ | ||
20 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 20 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | -#include "auth.h" | ||
24 | -#include "credential.h" | ||
25 | -#include "interface/auth.h" | 23 | +#include "auth/auth.h" |
24 | +#include "auth/credential.h" | ||
25 | +#include "auth/interface/auth.h" | ||
26 | 26 | ||
27 | const struct interface i_Auth = { | 27 | const struct interface i_Auth = { |
28 | "auth", | 28 | "auth", |
1 | +/** | ||
2 | + * \file | ||
3 | + * | ||
4 | + * \author Georg Hopp | ||
5 | + * | ||
6 | + * \copyright | ||
7 | + * Copyright © 2012 Georg Hopp | ||
8 | + * | ||
9 | + * This program is free software: you can redistribute it and/or modify | ||
10 | + * it under the terms of the GNU General Public License as published by | ||
11 | + * the Free Software Foundation, either version 3 of the License, or | ||
12 | + * (at your option) any later version. | ||
13 | + * | ||
14 | + * This program 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 program. If not, see <http://www.gnu.org/licenses/>. | ||
21 | + */ | ||
22 | + | ||
1 | #include <stdarg.h> | 23 | #include <stdarg.h> |
2 | #include <stdlib.h> | 24 | #include <stdlib.h> |
3 | #include <string.h> | 25 | #include <string.h> |
4 | #include <stdio.h> | 26 | #include <stdio.h> |
5 | #include <ldap.h> | 27 | #include <ldap.h> |
6 | 28 | ||
7 | -#include "auth/ldap.h" | ||
8 | #include "class.h" | 29 | #include "class.h" |
9 | -#include "credential.h" | ||
10 | -#include "interface/class.h" | ||
11 | -#include "interface/auth.h" | ||
12 | - | ||
13 | #include "utils/memory.h" | 30 | #include "utils/memory.h" |
14 | #include "commons.h" | 31 | #include "commons.h" |
15 | 32 | ||
33 | +#include "auth/ldap.h" | ||
34 | +#include "auth/credential.h" | ||
35 | +#include "auth/interface/auth.h" | ||
36 | + | ||
16 | static | 37 | static |
17 | int | 38 | int |
18 | authLdapCtor(void * _this, va_list * params) | 39 | authLdapCtor(void * _this, va_list * params) |
src/cbuf/Makefile.am
0 → 100644
1 | +ACLOCAL_AMFLAGS = -I m4 | ||
2 | + | ||
3 | +CB = cbuf.c read.c write.c \ | ||
4 | + get_line.c set_data.c get_data.c \ | ||
5 | + addr_index.c get_free.c get_read.c get_write.c \ | ||
6 | + inc_read.c inc_write.c is_empty.c memchr.c \ | ||
7 | + skip_non_alpha.c is_locked.c lock.c release.c \ | ||
8 | + empty.c | ||
9 | + | ||
10 | +noinst_LIBRARIES = libcbuf.a | ||
11 | + | ||
12 | +libcbuf_a_SOURCES = $(CB) | ||
13 | +libcbuf_a_CFLAGS = -Wall -I ../../include/ |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -34,7 +34,6 @@ | @@ -34,7 +34,6 @@ | ||
34 | #include <fcntl.h> | 34 | #include <fcntl.h> |
35 | 35 | ||
36 | #include "class.h" | 36 | #include "class.h" |
37 | -#include "interface/class.h" | ||
38 | #include "utils/memory.h" | 37 | #include "utils/memory.h" |
39 | 38 | ||
40 | #include "cbuf.h" | 39 | #include "cbuf.h" |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
src/class/Makefile.am
0 → 100644
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -23,7 +23,7 @@ | @@ -23,7 +23,7 @@ | ||
23 | #include <sys/types.h> | 23 | #include <sys/types.h> |
24 | #include <stdlib.h> | 24 | #include <stdlib.h> |
25 | 25 | ||
26 | -#include "interface.h" | 26 | +#include "class/interface.h" |
27 | #include "commons.h" | 27 | #include "commons.h" |
28 | 28 | ||
29 | static | 29 | static |
@@ -40,25 +40,25 @@ comp(const void * _a, const void * _b) | @@ -40,25 +40,25 @@ comp(const void * _a, const void * _b) | ||
40 | * this one is important in selector functions to get the correct interface | 40 | * this one is important in selector functions to get the correct interface |
41 | * implementation of a class. | 41 | * implementation of a class. |
42 | */ | 42 | */ |
43 | -struct interface * | 43 | +iface_ptr |
44 | interfaceGet(iface_impl_ptr iface_impl, const iface_ptr _iface) | 44 | interfaceGet(iface_impl_ptr iface_impl, const iface_ptr _iface) |
45 | { | 45 | { |
46 | const iface_ptr * iface = &_iface; | 46 | const iface_ptr * iface = &_iface; |
47 | - void * dummy; | 47 | + iface_ptr * found; |
48 | 48 | ||
49 | if (! iface_impl->simpl) { | 49 | if (! iface_impl->simpl) { |
50 | qsort((void**)(iface_impl->impl), iface_impl->nimpl, sizeof(iface_ptr), comp); | 50 | qsort((void**)(iface_impl->impl), iface_impl->nimpl, sizeof(iface_ptr), comp); |
51 | iface_impl->simpl=TRUE; | 51 | iface_impl->simpl=TRUE; |
52 | } | 52 | } |
53 | 53 | ||
54 | - dummy = bsearch( | 54 | + found = bsearch( |
55 | &iface, | 55 | &iface, |
56 | iface_impl->impl, | 56 | iface_impl->impl, |
57 | iface_impl->nimpl, | 57 | iface_impl->nimpl, |
58 | sizeof(iface_ptr), | 58 | sizeof(iface_ptr), |
59 | comp); | 59 | comp); |
60 | 60 | ||
61 | - return dummy? *(struct interface **)dummy : dummy; | 61 | + return found? *found : (iface_ptr)NULL; |
62 | } | 62 | } |
63 | 63 | ||
64 | // vim: set ts=4 sw=4: | 64 | // vim: set ts=4 sw=4: |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -24,8 +24,8 @@ | @@ -24,8 +24,8 @@ | ||
24 | #include <stdlib.h> | 24 | #include <stdlib.h> |
25 | #include <assert.h> | 25 | #include <assert.h> |
26 | 26 | ||
27 | -#include "class.h" | ||
28 | -#include "interface/class.h" | 27 | +#include "class/class.h" |
28 | +#include "class/interface/class.h" | ||
29 | 29 | ||
30 | const | 30 | const |
31 | struct interface i_Class = { | 31 | struct interface i_Class = { |
@@ -40,8 +40,6 @@ classNew(class_ptr class, ...) | @@ -40,8 +40,6 @@ classNew(class_ptr class, ...) | ||
40 | va_list params; | 40 | va_list params; |
41 | int ret; | 41 | int ret; |
42 | 42 | ||
43 | - if (class->init) class->init(); | ||
44 | - | ||
45 | * (class_ptr *)object = class; | 43 | * (class_ptr *)object = class; |
46 | object += sizeof(void*); | 44 | object += sizeof(void*); |
47 | 45 |
src/hash/Makefile.am
0 → 100644
1 | +/** | ||
2 | + * \file | ||
3 | + * | ||
4 | + * \author Georg Hopp | ||
5 | + * | ||
6 | + * \copyright | ||
7 | + * Copyright © 2012 Georg Hopp | ||
8 | + * | ||
9 | + * This program is free software: you can redistribute it and/or modify | ||
10 | + * it under the terms of the GNU General Public License as published by | ||
11 | + * the Free Software Foundation, either version 3 of the License, or | ||
12 | + * (at your option) any later version. | ||
13 | + * | ||
14 | + * This program 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 program. If not, see <http://www.gnu.org/licenses/>. | ||
21 | + */ | ||
22 | + | ||
1 | #include <search.h> | 23 | #include <search.h> |
2 | 24 | ||
3 | #include "hash.h" | 25 | #include "hash.h" |
4 | -#include "interface/hashable.h" | ||
5 | -#include "interface/class.h" | 26 | +#include "class.h" |
6 | 27 | ||
7 | static | 28 | static |
8 | inline | 29 | inline |
1 | +/** | ||
2 | + * \file | ||
3 | + * | ||
4 | + * \author Georg Hopp | ||
5 | + * | ||
6 | + * \copyright | ||
7 | + * Copyright © 2012 Georg Hopp | ||
8 | + * | ||
9 | + * This program is free software: you can redistribute it and/or modify | ||
10 | + * it under the terms of the GNU General Public License as published by | ||
11 | + * the Free Software Foundation, either version 3 of the License, or | ||
12 | + * (at your option) any later version. | ||
13 | + * | ||
14 | + * This program 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 program. If not, see <http://www.gnu.org/licenses/>. | ||
21 | + */ | ||
22 | + | ||
1 | #include <search.h> | 23 | #include <search.h> |
2 | #include <sys/types.h> | 24 | #include <sys/types.h> |
3 | 25 | ||
4 | #include "hash.h" | 26 | #include "hash.h" |
5 | -#include "interface/hashable.h" | ||
6 | #include "utils/hash.h" | 27 | #include "utils/hash.h" |
7 | 28 | ||
8 | static | 29 | static |
1 | +/** | ||
2 | + * \file | ||
3 | + * | ||
4 | + * \author Georg Hopp | ||
5 | + * | ||
6 | + * \copyright | ||
7 | + * Copyright © 2012 Georg Hopp | ||
8 | + * | ||
9 | + * This program is free software: you can redistribute it and/or modify | ||
10 | + * it under the terms of the GNU General Public License as published by | ||
11 | + * the Free Software Foundation, either version 3 of the License, or | ||
12 | + * (at your option) any later version. | ||
13 | + * | ||
14 | + * This program 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 program. If not, see <http://www.gnu.org/licenses/>. | ||
21 | + */ | ||
22 | + | ||
1 | #include <search.h> | 23 | #include <search.h> |
2 | 24 | ||
3 | #include "hash.h" | 25 | #include "hash.h" |
1 | +/** | ||
2 | + * \file | ||
3 | + * | ||
4 | + * \author Georg Hopp | ||
5 | + * | ||
6 | + * \copyright | ||
7 | + * Copyright © 2012 Georg Hopp | ||
8 | + * | ||
9 | + * This program is free software: you can redistribute it and/or modify | ||
10 | + * it under the terms of the GNU General Public License as published by | ||
11 | + * the Free Software Foundation, either version 3 of the License, or | ||
12 | + * (at your option) any later version. | ||
13 | + * | ||
14 | + * This program 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 program. If not, see <http://www.gnu.org/licenses/>. | ||
21 | + */ | ||
22 | + | ||
1 | #include <search.h> | 23 | #include <search.h> |
2 | #include <sys/types.h> | 24 | #include <sys/types.h> |
3 | 25 | ||
4 | #include "hash.h" | 26 | #include "hash.h" |
5 | -#include "interface/hashable.h" | ||
6 | #include "utils/hash.h" | 27 | #include "utils/hash.h" |
7 | 28 | ||
8 | static | 29 | static |
1 | +/** | ||
2 | + * \file | ||
3 | + * | ||
4 | + * \author Georg Hopp | ||
5 | + * | ||
6 | + * \copyright | ||
7 | + * Copyright © 2012 Georg Hopp | ||
8 | + * | ||
9 | + * This program is free software: you can redistribute it and/or modify | ||
10 | + * it under the terms of the GNU General Public License as published by | ||
11 | + * the Free Software Foundation, either version 3 of the License, or | ||
12 | + * (at your option) any later version. | ||
13 | + * | ||
14 | + * This program 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 program. If not, see <http://www.gnu.org/licenses/>. | ||
21 | + */ | ||
22 | + | ||
1 | #define _GNU_SOURCE | 23 | #define _GNU_SOURCE |
2 | 24 | ||
3 | #include <search.h> | 25 | #include <search.h> |
4 | #include <stdarg.h> | 26 | #include <stdarg.h> |
5 | 27 | ||
6 | -#include "hash.h" | 28 | +#include "hash/hash.h" |
7 | #include "class.h" | 29 | #include "class.h" |
8 | -#include "interface/class.h" | ||
9 | 30 | ||
10 | static | 31 | static |
11 | int | 32 | int |
@@ -25,7 +25,7 @@ | @@ -25,7 +25,7 @@ | ||
25 | #include <stdarg.h> | 25 | #include <stdarg.h> |
26 | 26 | ||
27 | #include "class.h" | 27 | #include "class.h" |
28 | -#include "interface/hashable.h" | 28 | +#include "hash/interface/hashable.h" |
29 | 29 | ||
30 | const struct interface i_Hashable = { | 30 | const struct interface i_Hashable = { |
31 | "hashable", | 31 | "hashable", |
1 | +/** | ||
2 | + * \file | ||
3 | + * | ||
4 | + * \author Georg Hopp | ||
5 | + * | ||
6 | + * \copyright | ||
7 | + * Copyright © 2012 Georg Hopp | ||
8 | + * | ||
9 | + * This program is free software: you can redistribute it and/or modify | ||
10 | + * it under the terms of the GNU General Public License as published by | ||
11 | + * the Free Software Foundation, either version 3 of the License, or | ||
12 | + * (at your option) any later version. | ||
13 | + * | ||
14 | + * This program 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 program. If not, see <http://www.gnu.org/licenses/>. | ||
21 | + */ | ||
22 | + | ||
1 | #include <stdarg.h> | 23 | #include <stdarg.h> |
2 | #include <stdlib.h> | 24 | #include <stdlib.h> |
3 | #include <string.h> | 25 | #include <string.h> |
4 | #include <sys/types.h> | 26 | #include <sys/types.h> |
5 | 27 | ||
6 | -#include "hash_value.h" | 28 | +#include "class.h" |
7 | #include "utils/hash.h" | 29 | #include "utils/hash.h" |
8 | #include "utils/memory.h" | 30 | #include "utils/memory.h" |
9 | #include "commons.h" | 31 | #include "commons.h" |
10 | -#include "interface/class.h" | ||
11 | -#include "interface/hashable.h" | 32 | + |
33 | +#include "hash/value.h" | ||
34 | +#include "hash/interface/hashable.h" | ||
12 | 35 | ||
13 | static | 36 | static |
14 | int | 37 | int |
src/http/Makefile.am
0 → 100644
1 | +ACLOCAL_AMFLAGS = -I m4 | ||
2 | + | ||
3 | +MSG = message.c \ | ||
4 | + message/has_keep_alive.c \ | ||
5 | + message/header_size_get.c \ | ||
6 | + message/header_to_string.c \ | ||
7 | + message/get_version.c \ | ||
8 | + message/has_valid_version.c | ||
9 | +MSGQ = message/queue.c | ||
10 | +REQ = request.c \ | ||
11 | + request/has_valid_method.c | ||
12 | +RESP = response.c \ | ||
13 | + response/304.c \ | ||
14 | + response/404.c \ | ||
15 | + response/403.c \ | ||
16 | + response/login_form.c \ | ||
17 | + response/asset.c \ | ||
18 | + response/randval.c \ | ||
19 | + response/session.c | ||
20 | +PARSER = parser.c \ | ||
21 | + parser/parse.c \ | ||
22 | + parser/new_message.c \ | ||
23 | + parser/p_header.c \ | ||
24 | + parser/p_body.c \ | ||
25 | + parser/p_request_vars.c \ | ||
26 | + parser/p_post_vars.c | ||
27 | +WRITER = writer.c \ | ||
28 | + writer/write.c | ||
29 | +WORKER = worker.c \ | ||
30 | + worker/process.c \ | ||
31 | + worker/answer.c \ | ||
32 | + worker/get_asset.c \ | ||
33 | + worker/add_common_header.c | ||
34 | +HEADER = header.c \ | ||
35 | + header/to_string.c | ||
36 | + | ||
37 | +noinst_LIBRARIES = libhttp.a | ||
38 | + | ||
39 | +libhttp_a_SOURCES = $(MSG) $(MSGQ) $(REQ) $(RESP) $(PARSER) $(WRITER) \ | ||
40 | + $(WORKER) $(HEADER) interface/i_http_intro.c | ||
41 | +libhttp_a_CFLAGS = -Wall -I ../../include/ |
1 | +/** | ||
2 | + * \file | ||
3 | + * | ||
4 | + * \author Georg Hopp | ||
5 | + * | ||
6 | + * \copyright | ||
7 | + * Copyright © 2012 Georg Hopp | ||
8 | + * | ||
9 | + * This program is free software: you can redistribute it and/or modify | ||
10 | + * it under the terms of the GNU General Public License as published by | ||
11 | + * the Free Software Foundation, either version 3 of the License, or | ||
12 | + * (at your option) any later version. | ||
13 | + * | ||
14 | + * This program 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 program. If not, see <http://www.gnu.org/licenses/>. | ||
21 | + */ | ||
22 | + | ||
1 | #include <stdlib.h> | 23 | #include <stdlib.h> |
2 | #include <string.h> | 24 | #include <string.h> |
3 | #include <stdarg.h> | 25 | #include <stdarg.h> |
4 | #include <sys/types.h> | 26 | #include <sys/types.h> |
5 | 27 | ||
6 | -#include "cookie.h" | ||
7 | -#include "interface/class.h" | ||
8 | -#include "interface/hashable" | 28 | +#include "class.h" |
29 | +#include "hash.h" | ||
30 | +#include "http/cookie.h" | ||
9 | 31 | ||
10 | #include "utils/hash.h" | 32 | #include "utils/hash.h" |
11 | #include "utils/memory.h" | 33 | #include "utils/memory.h" |
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | * \author Georg Hopp | 5 | * \author Georg Hopp |
6 | * | 6 | * |
7 | * \copyright | 7 | * \copyright |
8 | - * Copyright (C) 2012 Georg Hopp | 8 | + * Copyright © 2012 Georg Hopp |
9 | * | 9 | * |
10 | * This program is free software: you can redistribute it and/or modify | 10 | * This program is free software: you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License as published by | 11 | * it under the terms of the GNU General Public License as published by |
@@ -25,9 +25,8 @@ | @@ -25,9 +25,8 @@ | ||
25 | #include <string.h> | 25 | #include <string.h> |
26 | 26 | ||
27 | #include "class.h" | 27 | #include "class.h" |
28 | -#include "interface/class.h" | 28 | +#include "hash.h" |
29 | #include "http/header.h" | 29 | #include "http/header.h" |
30 | -#include "interface/hashable.h" | ||
31 | 30 | ||
32 | #include "utils/hash.h" | 31 | #include "utils/hash.h" |
33 | #include "utils/memory.h" | 32 | #include "utils/memory.h" |
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | * \author Georg Hopp | 5 | * \author Georg Hopp |
6 | * | 6 | * |
7 | * \copyright | 7 | * \copyright |
8 | - * Copyright (C) 2012 Georg Hopp | 8 | + * Copyright © 2012 Georg Hopp |
9 | * | 9 | * |
10 | * This program is free software: you can redistribute it and/or modify | 10 | * This program is free software: you can redistribute it and/or modify |
11 | * it under the terms of the GNU General Public License as published by | 11 | * it under the terms of the GNU General Public License as published by |
@@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include "class.h" | 23 | #include "class.h" |
24 | -#include "interface/http_intro.h" | 24 | +#include "http/interface/http_intro.h" |
25 | 25 | ||
26 | const struct interface i_HttpIntro = { | 26 | const struct interface i_HttpIntro = { |
27 | "httpIntro", | 27 | "httpIntro", |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -31,7 +31,6 @@ | @@ -31,7 +31,6 @@ | ||
31 | #include <unistd.h> | 31 | #include <unistd.h> |
32 | 32 | ||
33 | #include "class.h" | 33 | #include "class.h" |
34 | -#include "interface/class.h" | ||
35 | #include "hash.h" | 34 | #include "hash.h" |
36 | #include "http/message.h" | 35 | #include "http/message.h" |
37 | #include "utils/memory.h" | 36 | #include "utils/memory.h" |
@@ -47,8 +46,7 @@ httpMessageCtor(void * _this, va_list * params) | @@ -47,8 +46,7 @@ httpMessageCtor(void * _this, va_list * params) | ||
47 | this->version = calloc(1, strlen(version)+1); | 46 | this->version = calloc(1, strlen(version)+1); |
48 | strcpy(this->version, version); | 47 | strcpy(this->version, version); |
49 | 48 | ||
50 | - this->header = new(Hash); | ||
51 | - this->cookies = new(Hash); | 49 | + this->header = new(Hash); |
52 | 50 | ||
53 | return 0; | 51 | return 0; |
54 | } | 52 | } |
@@ -60,7 +58,6 @@ httpMessageDtor(void * _this) | @@ -60,7 +58,6 @@ httpMessageDtor(void * _this) | ||
60 | HttpMessage this = _this; | 58 | HttpMessage this = _this; |
61 | 59 | ||
62 | delete(this->header); | 60 | delete(this->header); |
63 | - delete(this->cookies); | ||
64 | 61 | ||
65 | FREE(this->version); | 62 | FREE(this->version); |
66 | 63 |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -27,7 +27,7 @@ | @@ -27,7 +27,7 @@ | ||
27 | #include "http/message.h" | 27 | #include "http/message.h" |
28 | #include "http/response.h" | 28 | #include "http/response.h" |
29 | #include "http/header.h" | 29 | #include "http/header.h" |
30 | -#include "interface/http_intro.h" | 30 | +#include "http/interface/http_intro.h" |
31 | #include "hash.h" | 31 | #include "hash.h" |
32 | 32 | ||
33 | static size_t size; | 33 | static size_t size; |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -26,7 +26,7 @@ | @@ -26,7 +26,7 @@ | ||
26 | 26 | ||
27 | #include "http/response.h" | 27 | #include "http/response.h" |
28 | #include "http/header.h" | 28 | #include "http/header.h" |
29 | -#include "interface/http_intro.h" | 29 | +#include "http/interface/http_intro.h" |
30 | #include "hash.h" | 30 | #include "hash.h" |
31 | 31 | ||
32 | static char * string; | 32 | static char * string; |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -23,7 +23,6 @@ | @@ -23,7 +23,6 @@ | ||
23 | #include <stdarg.h> | 23 | #include <stdarg.h> |
24 | 24 | ||
25 | #include "class.h" | 25 | #include "class.h" |
26 | -#include "interface/class.h" | ||
27 | 26 | ||
28 | #include "http/message/queue.h" | 27 | #include "http/message/queue.h" |
29 | 28 |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -25,8 +25,7 @@ | @@ -25,8 +25,7 @@ | ||
25 | #include <stdarg.h> | 25 | #include <stdarg.h> |
26 | 26 | ||
27 | #include "class.h" | 27 | #include "class.h" |
28 | -#include "interface/class.h" | ||
29 | -#include "interface/stream_reader.h" | 28 | +#include "stream.h" |
30 | 29 | ||
31 | #include "http/parser.h" | 30 | #include "http/parser.h" |
32 | #include "http/message/queue.h" | 31 | #include "http/message/queue.h" |
1 | +/** | ||
2 | + * \file | ||
3 | + * | ||
4 | + * \author Georg Hopp | ||
5 | + * | ||
6 | + * \copyright | ||
7 | + * Copyright © 2012 Georg Hopp | ||
8 | + * | ||
9 | + * This program is free software: you can redistribute it and/or modify | ||
10 | + * it under the terms of the GNU General Public License as published by | ||
11 | + * the Free Software Foundation, either version 3 of the License, or | ||
12 | + * (at your option) any later version. | ||
13 | + * | ||
14 | + * This program 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 program. If not, see <http://www.gnu.org/licenses/>. | ||
21 | + */ | ||
22 | + | ||
1 | #include "http/parser.h" | 23 | #include "http/parser.h" |
2 | 24 | ||
3 | #include "utils/http.h" | 25 | #include "utils/http.h" |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -4,7 +4,7 @@ | @@ -4,7 +4,7 @@ | ||
4 | * \author Georg Hopp | 4 | * \author Georg Hopp |
5 | * | 5 | * |
6 | * \copyright | 6 | * \copyright |
7 | - * Copyright (C) 2012 Georg Hopp | 7 | + * Copyright © 2012 Georg Hopp |
8 | * | 8 | * |
9 | * This program is free software: you can redistribute it and/or modify | 9 | * This program is free software: you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -25,13 +25,11 @@ | @@ -25,13 +25,11 @@ | ||
25 | #include <sys/types.h> | 25 | #include <sys/types.h> |
26 | 26 | ||
27 | #include "class.h" | 27 | #include "class.h" |
28 | -#include "interface/class.h" | ||
29 | #include "http/header.h" | 28 | #include "http/header.h" |
30 | #include "http/parser.h" | 29 | #include "http/parser.h" |
31 | #include "http/message.h" | 30 | #include "http/message.h" |
32 | #include "http/request.h" | 31 | #include "http/request.h" |
33 | #include "hash.h" | 32 | #include "hash.h" |
34 | -#include "hash_value.h" | ||
35 | 33 | ||
36 | #define MAX(x,y) ((x) > (y) ? (x) : (y)) | 34 | #define MAX(x,y) ((x) > (y) ? (x) : (y)) |
37 | 35 |
1 | +/** | ||
2 | + * \file | ||
3 | + * | ||
4 | + * \author Georg Hopp | ||
5 | + * | ||
6 | + * \copyright | ||
7 | + * Copyright © 2012 Georg Hopp | ||
8 | + * | ||
9 | + * This program is free software: you can redistribute it and/or modify | ||
10 | + * it under the terms of the GNU General Public License as published by | ||
11 | + * the Free Software Foundation, either version 3 of the License, or | ||
12 | + * (at your option) any later version. | ||
13 | + * | ||
14 | + * This program 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 program. If not, see <http://www.gnu.org/licenses/>. | ||
21 | + */ | ||
22 | + | ||
1 | #include <string.h> | 23 | #include <string.h> |
2 | #include <sys/types.h> | 24 | #include <sys/types.h> |
3 | 25 | ||
4 | #include "http/parser.h" | 26 | #include "http/parser.h" |
5 | #include "http/request.h" | 27 | #include "http/request.h" |
6 | -#include "hash_value.h" | ||
7 | #include "hash.h" | 28 | #include "hash.h" |
8 | -#include "interface/class.h" | 29 | +#include "class.h" |
9 | 30 | ||
10 | /** | 31 | /** |
11 | * \todo this is very similar to other pair parsing | 32 | * \todo this is very similar to other pair parsing |
Please
register
or
login
to post a comment