- new folder src/ to hold the source code for main project applications
- main.c is in src/
- all core files are subfolder are in src/core/
- modules are in src/modules/
- libs are in src/lib/
- application Makefiles are in src/
- application binary is built in src/ (src/kamailio)
1 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,109 +0,0 @@ |
1 |
-/* |
|
2 |
- * |
|
3 |
- * Copyright (C) 2001-2003 FhG Fokus |
|
4 |
- * |
|
5 |
- * This file is part of Kamailio, a free SIP server. |
|
6 |
- * |
|
7 |
- * Kamailio is free software; you can redistribute it and/or modify |
|
8 |
- * it under the terms of the GNU General Public License as published by |
|
9 |
- * the Free Software Foundation; either version 2 of the License, or |
|
10 |
- * (at your option) any later version |
|
11 |
- * |
|
12 |
- * For a license to use the Kamailio software under conditions |
|
13 |
- * other than those described here, or to purchase support for this |
|
14 |
- * software, please contact iptel.org by e-mail at the following addresses: |
|
15 |
- * info@iptel.org |
|
16 |
- * |
|
17 |
- * Kamailio is distributed in the hope that it will be useful, |
|
18 |
- * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
19 |
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
20 |
- * GNU General Public License for more details. |
|
21 |
- * |
|
22 |
- * You should have received a copy of the GNU General Public License |
|
23 |
- * along with this program; if not, write to the Free Software |
|
24 |
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
25 |
- */ |
|
26 |
- |
|
27 |
-/*! |
|
28 |
-* \file |
|
29 |
-* \brief Kamailio core :: Kamailio locking library |
|
30 |
-* \author andrei |
|
31 |
-* \ingroup core |
|
32 |
-* Module: \ref core |
|
33 |
-* |
|
34 |
- * WARNING: don't include this directly include instead locking.h! |
|
35 |
- * |
|
36 |
-Implements: (see also locking.h) |
|
37 |
- |
|
38 |
- simple locks: |
|
39 |
- ------------- |
|
40 |
- gen_lock_t* lock_alloc(); - allocates a lock in shared mem. |
|
41 |
- void lock_dealloc(gen_lock_t* lock); - deallocates the lock's shared m. |
|
42 |
- |
|
43 |
- lock sets: [implemented only for FL & SYSV so far] |
|
44 |
- ---------- |
|
45 |
- gen_lock_set_t* lock_set_alloc(no) - allocs a lock set in shm. |
|
46 |
- void lock_set_dealloc(gen_lock_set_t* s); - deallocs the lock set shm. |
|
47 |
- |
|
48 |
-*/ |
|
49 |
- |
|
50 |
-#ifndef _lock_alloc_h |
|
51 |
-#define _lock_alloc_h |
|
52 |
- |
|
53 |
-/*shm_{malloc, free}*/ |
|
54 |
-#include "mem/mem.h" |
|
55 |
-#ifdef SHM_MEM |
|
56 |
-#include "mem/shm_mem.h" |
|
57 |
-#else |
|
58 |
-#error "locking requires shared memory support" |
|
59 |
-#endif |
|
60 |
- |
|
61 |
-#if defined(FAST_LOCK) || defined(USE_PTHREAD_MUTEX) || defined(USE_POSIX_SEM) |
|
62 |
-/* simple locks*/ |
|
63 |
-#define lock_alloc() shm_malloc(sizeof(gen_lock_t)) |
|
64 |
-#define lock_dealloc(lock) shm_free((void*)lock) |
|
65 |
-/* lock sets */ |
|
66 |
- |
|
67 |
-inline static gen_lock_set_t* lock_set_alloc(int n) |
|
68 |
-{ |
|
69 |
- gen_lock_set_t* ls; |
|
70 |
- ls=(gen_lock_set_t*)shm_malloc(sizeof(gen_lock_set_t)+n*sizeof(gen_lock_t)); |
|
71 |
- if (ls==0){ |
|
72 |
- LM_CRIT("could not allocate lock_set\n"); |
|
73 |
- }else{ |
|
74 |
- ls->locks=(gen_lock_t*)((char*)ls+sizeof(gen_lock_set_t)); |
|
75 |
- ls->size=n; |
|
76 |
- } |
|
77 |
- return ls; |
|
78 |
-} |
|
79 |
- |
|
80 |
-#define lock_set_dealloc(lock_set) shm_free((void*)lock_set) |
|
81 |
- |
|
82 |
-#elif defined USE_SYSV_SEM |
|
83 |
- |
|
84 |
-/*simple locks*/ |
|
85 |
-#define lock_alloc() shm_malloc(sizeof(gen_lock_t)) |
|
86 |
-#define lock_dealloc(lock) shm_free((void*)lock) |
|
87 |
-/* lock sets */ |
|
88 |
- |
|
89 |
-inline static gen_lock_set_t* lock_set_alloc(int n) |
|
90 |
-{ |
|
91 |
- gen_lock_set_t* ls; |
|
92 |
- ls=(gen_lock_set_t*)shm_malloc(sizeof(gen_lock_set_t)); |
|
93 |
- if (ls){ |
|
94 |
- ls->size=n; |
|
95 |
- ls->semid=-1; |
|
96 |
- }; |
|
97 |
- return ls; |
|
98 |
-} |
|
99 |
- |
|
100 |
- |
|
101 |
-#define lock_set_dealloc(lock_set) shm_free((void*)lock_set) |
|
102 |
- |
|
103 |
- |
|
104 |
-#else |
|
105 |
-#error "no locking method selected" |
|
106 |
-#endif |
|
107 |
- |
|
108 |
- |
|
109 |
-#endif |
... | ... |
@@ -1,21 +1,20 @@ |
1 |
-/* $Id$ */ |
|
2 | 1 |
/* |
3 | 2 |
* |
4 | 3 |
* Copyright (C) 2001-2003 FhG Fokus |
5 | 4 |
* |
6 |
- * This file is part of ser, a free SIP server. |
|
5 |
+ * This file is part of Kamailio, a free SIP server. |
|
7 | 6 |
* |
8 |
- * ser is free software; you can redistribute it and/or modify |
|
7 |
+ * Kamailio is free software; you can redistribute it and/or modify |
|
9 | 8 |
* it under the terms of the GNU General Public License as published by |
10 | 9 |
* the Free Software Foundation; either version 2 of the License, or |
11 | 10 |
* (at your option) any later version |
12 | 11 |
* |
13 |
- * For a license to use the ser software under conditions |
|
12 |
+ * For a license to use the Kamailio software under conditions |
|
14 | 13 |
* other than those described here, or to purchase support for this |
15 | 14 |
* software, please contact iptel.org by e-mail at the following addresses: |
16 | 15 |
* info@iptel.org |
17 | 16 |
* |
18 |
- * ser is distributed in the hope that it will be useful, |
|
17 |
+ * Kamailio is distributed in the hope that it will be useful, |
|
19 | 18 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
20 | 19 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
21 | 20 |
* GNU General Public License for more details. |
... | ... |
@@ -25,15 +24,14 @@ |
25 | 24 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
26 | 25 |
*/ |
27 | 26 |
|
28 |
-/* |
|
29 |
- * ser locking library |
|
27 |
+/*! |
|
28 |
+* \file |
|
29 |
+* \brief Kamailio core :: Kamailio locking library |
|
30 |
+* \author andrei |
|
31 |
+* \ingroup core |
|
32 |
+* Module: \ref core |
|
33 |
+* |
|
30 | 34 |
* WARNING: don't include this directly include instead locking.h! |
31 |
- * History: |
|
32 |
- * -------- |
|
33 |
- * 2003-03-06 created by andrei (contains parts of the original locking.h) |
|
34 |
- * 2003-03-17 fixed cast warning in shm_free (forced to void*) (andrei) |
|
35 |
- * 2004-07-28 s/lock_set_t/gen_lock_set_t/ because of a type conflict |
|
36 |
- * on darwin (andrei) |
|
37 | 35 |
* |
38 | 36 |
Implements: (see also locking.h) |
39 | 37 |
|
... | ... |
@@ -71,7 +71,7 @@ inline static gen_lock_set_t* lock_set_alloc(int n) |
71 | 71 |
gen_lock_set_t* ls; |
72 | 72 |
ls=(gen_lock_set_t*)shm_malloc(sizeof(gen_lock_set_t)+n*sizeof(gen_lock_t)); |
73 | 73 |
if (ls==0){ |
74 |
- LOG(L_CRIT, "ERROR: lock_set_alloc (FL): could not allocate lock_set\n"); |
|
74 |
+ LM_CRIT("could not allocate lock_set\n"); |
|
75 | 75 |
}else{ |
76 | 76 |
ls->locks=(gen_lock_t*)((char*)ls+sizeof(gen_lock_set_t)); |
77 | 77 |
ls->size=n; |
... | ... |
@@ -22,7 +22,7 @@ |
22 | 22 |
* |
23 | 23 |
* You should have received a copy of the GNU General Public License |
24 | 24 |
* along with this program; if not, write to the Free Software |
25 |
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
25 |
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
26 | 26 |
*/ |
27 | 27 |
|
28 | 28 |
/* |
... | ... |
@@ -28,9 +28,12 @@ |
28 | 28 |
/* |
29 | 29 |
* ser locking library |
30 | 30 |
* WARNING: don't include this directly include instead locking.h! |
31 |
- * |
|
31 |
+ * History: |
|
32 |
+ * -------- |
|
32 | 33 |
* 2003-03-06 created by andrei (contains parts of the original locking.h) |
33 | 34 |
* 2003-03-17 fixed cast warning in shm_free (forced to void*) (andrei) |
35 |
+ * 2004-07-28 s/lock_set_t/gen_lock_set_t/ because of a type conflict |
|
36 |
+ * on darwin (andrei) |
|
34 | 37 |
* |
35 | 38 |
Implements: (see also locking.h) |
36 | 39 |
|
... | ... |
@@ -41,8 +44,8 @@ Implements: (see also locking.h) |
41 | 44 |
|
42 | 45 |
lock sets: [implemented only for FL & SYSV so far] |
43 | 46 |
---------- |
44 |
- lock_set_t* lock_set_alloc(no) - allocs a lock set in shm. |
|
45 |
- void lock_set_dealloc(lock_set_t* s); - deallocs the lock set shm. |
|
47 |
+ gen_lock_set_t* lock_set_alloc(no) - allocs a lock set in shm. |
|
48 |
+ void lock_set_dealloc(gen_lock_set_t* s); - deallocs the lock set shm. |
|
46 | 49 |
|
47 | 50 |
*/ |
48 | 51 |
|
... | ... |
@@ -63,14 +66,14 @@ Implements: (see also locking.h) |
63 | 66 |
#define lock_dealloc(lock) shm_free((void*)lock) |
64 | 67 |
/* lock sets */ |
65 | 68 |
|
66 |
-inline static lock_set_t* lock_set_alloc(int n) |
|
69 |
+inline static gen_lock_set_t* lock_set_alloc(int n) |
|
67 | 70 |
{ |
68 |
- lock_set_t* ls; |
|
69 |
- ls=(lock_set_t*)shm_malloc(sizeof(lock_set_t)+n*sizeof(gen_lock_t)); |
|
71 |
+ gen_lock_set_t* ls; |
|
72 |
+ ls=(gen_lock_set_t*)shm_malloc(sizeof(gen_lock_set_t)+n*sizeof(gen_lock_t)); |
|
70 | 73 |
if (ls==0){ |
71 | 74 |
LOG(L_CRIT, "ERROR: lock_set_alloc (FL): could not allocate lock_set\n"); |
72 | 75 |
}else{ |
73 |
- ls->locks=(gen_lock_t*)((char*)ls+sizeof(lock_set_t)); |
|
76 |
+ ls->locks=(gen_lock_t*)((char*)ls+sizeof(gen_lock_set_t)); |
|
74 | 77 |
ls->size=n; |
75 | 78 |
} |
76 | 79 |
return ls; |
... | ... |
@@ -85,10 +88,10 @@ inline static lock_set_t* lock_set_alloc(int n) |
85 | 88 |
#define lock_dealloc(lock) shm_free((void*)lock) |
86 | 89 |
/* lock sets */ |
87 | 90 |
|
88 |
-inline static lock_set_t* lock_set_alloc(int n) |
|
91 |
+inline static gen_lock_set_t* lock_set_alloc(int n) |
|
89 | 92 |
{ |
90 |
- lock_set_t* ls; |
|
91 |
- ls=(lock_set_t*)shm_malloc(sizeof(lock_set_t)); |
|
93 |
+ gen_lock_set_t* ls; |
|
94 |
+ ls=(gen_lock_set_t*)shm_malloc(sizeof(gen_lock_set_t)); |
|
92 | 95 |
if (ls){ |
93 | 96 |
ls->size=n; |
94 | 97 |
ls->semid=-1; |
... | ... |
@@ -54,7 +54,7 @@ Implements: (see also locking.h) |
54 | 54 |
#ifdef SHM_MEM |
55 | 55 |
#include "mem/shm_mem.h" |
56 | 56 |
#else |
57 |
-#error "locking requires shared memroy support" |
|
57 |
+#error "locking requires shared memory support" |
|
58 | 58 |
#endif |
59 | 59 |
|
60 | 60 |
#if defined(FAST_LOCK) || defined(USE_PTHREAD_MUTEX) || defined(USE_POSIX_SEM) |
... | ... |
@@ -60,7 +60,7 @@ Implements: (see also locking.h) |
60 | 60 |
#if defined(FAST_LOCK) || defined(USE_PTHREAD_MUTEX) || defined(USE_POSIX_SEM) |
61 | 61 |
/* simple locks*/ |
62 | 62 |
#define lock_alloc() shm_malloc(sizeof(gen_lock_t)) |
63 |
-#define lock_dealloc(lock) shm_free(lock) |
|
63 |
+#define lock_dealloc(lock) shm_free((void*)lock) |
|
64 | 64 |
/* lock sets */ |
65 | 65 |
|
66 | 66 |
inline static lock_set_t* lock_set_alloc(int n) |
... | ... |
@@ -82,7 +82,7 @@ inline static lock_set_t* lock_set_alloc(int n) |
82 | 82 |
|
83 | 83 |
/*simple locks*/ |
84 | 84 |
#define lock_alloc() shm_malloc(sizeof(gen_lock_t)) |
85 |
-#define lock_dealloc(lock) shm_free(lock) |
|
85 |
+#define lock_dealloc(lock) shm_free((void*)lock) |
|
86 | 86 |
/* lock sets */ |
87 | 87 |
|
88 | 88 |
inline static lock_set_t* lock_set_alloc(int n) |
... | ... |
@@ -29,7 +29,8 @@ |
29 | 29 |
* ser locking library |
30 | 30 |
* WARNING: don't include this directly include instead locking.h! |
31 | 31 |
* |
32 |
- * 2002-03-06 created by andrei (contains parts of the original locking.h) |
|
32 |
+ * 2003-03-06 created by andrei (contains parts of the original locking.h) |
|
33 |
+ * 2003-03-17 fixed cast warning in shm_free (forced to void*) (andrei) |
|
33 | 34 |
* |
34 | 35 |
Implements: (see also locking.h) |
35 | 36 |
|
... | ... |
@@ -75,7 +76,7 @@ inline static lock_set_t* lock_set_alloc(int n) |
75 | 76 |
return ls; |
76 | 77 |
} |
77 | 78 |
|
78 |
-#define lock_set_dealloc(lock_set) shm_free(lock_set) |
|
79 |
+#define lock_set_dealloc(lock_set) shm_free((void*)lock_set) |
|
79 | 80 |
|
80 | 81 |
#elif defined USE_SYSV_SEM |
81 | 82 |
|
... | ... |
@@ -96,7 +97,7 @@ inline static lock_set_t* lock_set_alloc(int n) |
96 | 97 |
} |
97 | 98 |
|
98 | 99 |
|
99 |
-#define lock_set_dealloc(lock_set) shm_free(lock_set) |
|
100 |
+#define lock_set_dealloc(lock_set) shm_free((void*)lock_set) |
|
100 | 101 |
|
101 | 102 |
|
102 | 103 |
#else |
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,107 @@ |
1 |
+/* $Id$ */ |
|
2 |
+/* |
|
3 |
+ * |
|
4 |
+ * Copyright (C) 2001-2003 Fhg Fokus |
|
5 |
+ * |
|
6 |
+ * This file is part of ser, a free SIP server. |
|
7 |
+ * |
|
8 |
+ * ser is free software; you can redistribute it and/or modify |
|
9 |
+ * it under the terms of the GNU General Public License as published by |
|
10 |
+ * the Free Software Foundation; either version 2 of the License, or |
|
11 |
+ * (at your option) any later version |
|
12 |
+ * |
|
13 |
+ * For a license to use the ser software under conditions |
|
14 |
+ * other than those described here, or to purchase support for this |
|
15 |
+ * software, please contact iptel.org by e-mail at the following addresses: |
|
16 |
+ * info@iptel.org |
|
17 |
+ * |
|
18 |
+ * ser 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, write to the Free Software |
|
25 |
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
26 |
+ */ |
|
27 |
+ |
|
28 |
+/* |
|
29 |
+ * ser locking library |
|
30 |
+ * WARNING: don't include this directly include instead locking.h! |
|
31 |
+ * |
|
32 |
+ * 2002-03-06 created by andrei (contains parts of the original locking.h) |
|
33 |
+ * |
|
34 |
+Implements: (see also locking.h) |
|
35 |
+ |
|
36 |
+ simple locks: |
|
37 |
+ ------------- |
|
38 |
+ gen_lock_t* lock_alloc(); - allocates a lock in shared mem. |
|
39 |
+ void lock_dealloc(gen_lock_t* lock); - deallocates the lock's shared m. |
|
40 |
+ |
|
41 |
+ lock sets: [implemented only for FL & SYSV so far] |
|
42 |
+ ---------- |
|
43 |
+ lock_set_t* lock_set_alloc(no) - allocs a lock set in shm. |
|
44 |
+ void lock_set_dealloc(lock_set_t* s); - deallocs the lock set shm. |
|
45 |
+ |
|
46 |
+*/ |
|
47 |
+ |
|
48 |
+#ifndef _lock_alloc_h |
|
49 |
+#define _lock_alloc_h |
|
50 |
+ |
|
51 |
+/*shm_{malloc, free}*/ |
|
52 |
+#include "mem/mem.h" |
|
53 |
+#ifdef SHM_MEM |
|
54 |
+#include "mem/shm_mem.h" |
|
55 |
+#else |
|
56 |
+#error "locking requires shared memroy support" |
|
57 |
+#endif |
|
58 |
+ |
|
59 |
+#if defined(FAST_LOCK) || defined(USE_PTHREAD_MUTEX) || defined(USE_POSIX_SEM) |
|
60 |
+/* simple locks*/ |
|
61 |
+#define lock_alloc() shm_malloc(sizeof(gen_lock_t)) |
|
62 |
+#define lock_dealloc(lock) shm_free(lock) |
|
63 |
+/* lock sets */ |
|
64 |
+ |
|
65 |
+inline static lock_set_t* lock_set_alloc(int n) |
|
66 |
+{ |
|
67 |
+ lock_set_t* ls; |
|
68 |
+ ls=(lock_set_t*)shm_malloc(sizeof(lock_set_t)+n*sizeof(gen_lock_t)); |
|
69 |
+ if (ls==0){ |
|
70 |
+ LOG(L_CRIT, "ERROR: lock_set_alloc (FL): could not allocate lock_set\n"); |
|
71 |
+ }else{ |
|
72 |
+ ls->locks=(gen_lock_t*)((char*)ls+sizeof(lock_set_t)); |
|
73 |
+ ls->size=n; |
|
74 |
+ } |
|
75 |
+ return ls; |
|
76 |
+} |
|
77 |
+ |
|
78 |
+#define lock_set_dealloc(lock_set) shm_free(lock_set) |
|
79 |
+ |
|
80 |
+#elif defined USE_SYSV_SEM |
|
81 |
+ |
|
82 |
+/*simple locks*/ |
|
83 |
+#define lock_alloc() shm_malloc(sizeof(gen_lock_t)) |
|
84 |
+#define lock_dealloc(lock) shm_free(lock) |
|
85 |
+/* lock sets */ |
|
86 |
+ |
|
87 |
+inline static lock_set_t* lock_set_alloc(int n) |
|
88 |
+{ |
|
89 |
+ lock_set_t* ls; |
|
90 |
+ ls=(lock_set_t*)shm_malloc(sizeof(lock_set_t)); |
|
91 |
+ if (ls){ |
|
92 |
+ ls->size=n; |
|
93 |
+ ls->semid=-1; |
|
94 |
+ }; |
|
95 |
+ return ls; |
|
96 |
+} |
|
97 |
+ |
|
98 |
+ |
|
99 |
+#define lock_set_dealloc(lock_set) shm_free(lock_set) |
|
100 |
+ |
|
101 |
+ |
|
102 |
+#else |
|
103 |
+#error "no locking method selected" |
|
104 |
+#endif |
|
105 |
+ |
|
106 |
+ |
|
107 |
+#endif |