- 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,60 +0,0 @@ |
1 |
-/* |
|
2 |
- * Copyright (C) 2007 iptelorg GmbH |
|
3 |
- * |
|
4 |
- * Permission to use, copy, modify, and distribute this software for any |
|
5 |
- * purpose with or without fee is hereby granted, provided that the above |
|
6 |
- * copyright notice and this permission notice appear in all copies. |
|
7 |
- * |
|
8 |
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
|
9 |
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
|
10 |
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
|
11 |
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
|
12 |
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
|
13 |
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
|
14 |
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
|
15 |
- */ |
|
16 |
- |
|
17 |
-/*! |
|
18 |
- * \file |
|
19 |
- * \brief Kamailio core :: lock operations init |
|
20 |
- * \ingroup core |
|
21 |
- * |
|
22 |
- * Module: \ref core |
|
23 |
- * |
|
24 |
- * Reference: |
|
25 |
- * - \ref LockingDoc |
|
26 |
- */ |
|
27 |
- |
|
28 |
-/*! |
|
29 |
- * \page LockingDoc Documentation of locking |
|
30 |
- * \verbinclude locking.txt |
|
31 |
- * |
|
32 |
- */ |
|
33 |
- |
|
34 |
- |
|
35 |
- |
|
36 |
-#include "ut.h" |
|
37 |
-#include "dprint.h" |
|
38 |
-#include "lock_ops.h" |
|
39 |
- |
|
40 |
-/* returns 0 on success, -1 on error */ |
|
41 |
-int init_lock_ops(void) |
|
42 |
-{ |
|
43 |
-#ifdef USE_FUTEX |
|
44 |
- int os_ver; |
|
45 |
- |
|
46 |
- os_ver=get_sys_version(0, 0, 0); |
|
47 |
- if (os_ver < 0x020546 ){ /* if ver < 2.5.70 */ |
|
48 |
- LM_CRIT("old kernel: compiled with FUTEX support which is not" |
|
49 |
- " present in the running kernel (try 2.6+)\n"); |
|
50 |
- return -1; |
|
51 |
- } |
|
52 |
-#endif |
|
53 |
- return 0; |
|
54 |
-} |
|
55 |
- |
|
56 |
- |
|
57 |
- |
|
58 |
-void destroy_lock_ops(void) |
|
59 |
-{ |
|
60 |
-} |
... | ... |
@@ -1,6 +1,4 @@ |
1 | 1 |
/* |
2 |
- * $Id$ |
|
3 |
- * |
|
4 | 2 |
* Copyright (C) 2007 iptelorg GmbH |
5 | 3 |
* |
6 | 4 |
* Permission to use, copy, modify, and distribute this software for any |
... | ... |
@@ -15,18 +13,10 @@ |
15 | 13 |
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
16 | 14 |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
17 | 15 |
*/ |
18 |
-/* |
|
19 |
- * lock operations init |
|
20 |
- */ |
|
21 |
-/* |
|
22 |
- * History: |
|
23 |
- * -------- |
|
24 |
- * 2007-05-14 created by andrei |
|
25 |
- */ |
|
26 | 16 |
|
27 | 17 |
/*! |
28 | 18 |
* \file |
29 |
- * \brief SIP-router core :: |
|
19 |
+ * \brief Kamailio core :: lock operations init |
|
30 | 20 |
* \ingroup core |
31 | 21 |
* |
32 | 22 |
* Module: \ref core |
... | ... |
@@ -55,9 +55,8 @@ int init_lock_ops(void) |
55 | 55 |
|
56 | 56 |
os_ver=get_sys_version(0, 0, 0); |
57 | 57 |
if (os_ver < 0x020546 ){ /* if ver < 2.5.70 */ |
58 |
- LOG(L_CRIT, "ERROR: init_lock_ops: old kernel:" |
|
59 |
- " compiled with FUTEX support which is not present in the" |
|
60 |
- " running kernel (try 2.6+)\n"); |
|
58 |
+ LM_CRIT("old kernel: compiled with FUTEX support which is not" |
|
59 |
+ " present in the running kernel (try 2.6+)\n"); |
|
61 | 60 |
return -1; |
62 | 61 |
} |
63 | 62 |
#endif |
In C language, a declaration in the form int f(); is equivalent to int f(...);, thus being able to accept an indefinit number of parameters. With the -Wstrict-prototypes GCC options, these declarations are reported as "function declaration isn’t a prototype".
On some cases, this may trick the compiler into generating unoptimized code (like preparing to handle variadic argument list).
In all cases having a declaration int f() and a definition inf f(int) is missleading, even if standard compliant.
This is still Work in Progress. (maybe adding the -Wstrict-prototypes option to default is desireable)
... | ... |
@@ -48,7 +48,7 @@ |
48 | 48 |
#include "lock_ops.h" |
49 | 49 |
|
50 | 50 |
/* returns 0 on success, -1 on error */ |
51 |
-int init_lock_ops() |
|
51 |
+int init_lock_ops(void) |
|
52 | 52 |
{ |
53 | 53 |
#ifdef USE_FUTEX |
54 | 54 |
int os_ver; |
... | ... |
@@ -66,6 +66,6 @@ int init_lock_ops() |
66 | 66 |
|
67 | 67 |
|
68 | 68 |
|
69 |
-void destroy_lock_ops() |
|
69 |
+void destroy_lock_ops(void) |
|
70 | 70 |
{ |
71 | 71 |
} |
- Including locking.txt in doxygen
- Updating other files (ser -> sip-router)
... | ... |
@@ -28,9 +28,20 @@ |
28 | 28 |
* \file |
29 | 29 |
* \brief SIP-router core :: |
30 | 30 |
* \ingroup core |
31 |
+ * |
|
31 | 32 |
* Module: \ref core |
33 |
+ * |
|
34 |
+ * Reference: |
|
35 |
+ * - \ref LockingDoc |
|
32 | 36 |
*/ |
33 | 37 |
|
38 |
+/*! |
|
39 |
+ * \page LockingDoc Documentation of locking |
|
40 |
+ * \verbinclude locking.txt |
|
41 |
+ * |
|
42 |
+ */ |
|
43 |
+ |
|
44 |
+ |
|
34 | 45 |
|
35 | 46 |
#include "ut.h" |
36 | 47 |
#include "dprint.h" |
Please fill in after the :: to explain the function of this file.
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,52 @@ |
1 |
+/* |
|
2 |
+ * $Id$ |
|
3 |
+ * |
|
4 |
+ * Copyright (C) 2007 iptelorg GmbH |
|
5 |
+ * |
|
6 |
+ * Permission to use, copy, modify, and distribute this software for any |
|
7 |
+ * purpose with or without fee is hereby granted, provided that the above |
|
8 |
+ * copyright notice and this permission notice appear in all copies. |
|
9 |
+ * |
|
10 |
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
|
11 |
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
|
12 |
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
|
13 |
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
|
14 |
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
|
15 |
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
|
16 |
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
|
17 |
+ */ |
|
18 |
+/* |
|
19 |
+ * lock operations init |
|
20 |
+ */ |
|
21 |
+/* |
|
22 |
+ * History: |
|
23 |
+ * -------- |
|
24 |
+ * 2007-05-14 created by andrei |
|
25 |
+ */ |
|
26 |
+ |
|
27 |
+#include "lock_ops.h" |
|
28 |
+#include "ut.h" |
|
29 |
+#include "dprint.h" |
|
30 |
+ |
|
31 |
+/* returns 0 on success, -1 on error */ |
|
32 |
+int init_lock_ops() |
|
33 |
+{ |
|
34 |
+#ifdef USE_FUTEX |
|
35 |
+ int os_ver; |
|
36 |
+ |
|
37 |
+ os_ver=get_sys_version(0, 0, 0); |
|
38 |
+ if (os_ver < 0x020546 ){ /* if ver < 2.5.70 */ |
|
39 |
+ LOG(L_CRIT, "ERROR: init_lock_ops: old kernel:" |
|
40 |
+ " compiled with FUTEX support which is not present in the" |
|
41 |
+ " running kernel (try 2.6+)\n"); |
|
42 |
+ return -1; |
|
43 |
+ } |
|
44 |
+#endif |
|
45 |
+ return 0; |
|
46 |
+} |
|
47 |
+ |
|
48 |
+ |
|
49 |
+ |
|
50 |
+void destroy_lock_ops() |
|
51 |
+{ |
|
52 |
+} |