Browse code

core, lib, modules: restructured source code tree

- 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)

Daniel-Constantin Mierla authored on 07/12/2016 11:03:51
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,123 +0,0 @@
1
-/* 
2
- * Copyright (C) 2001-2003 FhG Fokus
3
- *
4
- * This file is part of Kamailio, a free SIP server.
5
- *
6
- * Kamailio is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version
10
- *
11
- * Kamailio is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License 
17
- * along with this program; if not, write to the Free Software 
18
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19
- */
20
-
21
-#ifndef TRIM_H
22
-#define TRIM_H
23
-
24
-#include "str.h"
25
-
26
-
27
-/*!
28
- * This switch-case statement is used in
29
- * trim_leading and trim_trailing. You can
30
- * define characters that should be skipped 
31
- * here.
32
- */
33
-#define TRIM_SWITCH(c) switch(c) {     \
34
-                       case ' ':       \
35
-                       case '\t':      \
36
-                       case '\r':      \
37
-                       case '\n':      \
38
-                               break;  \
39
-                                       \
40
-                       default:        \
41
-                               return; \
42
-                       }
43
-
44
-
45
-/*
46
- * Remove any leading whitechars, like spaces,
47
- * horizontal tabs, carriage returns and line
48
- * feeds
49
- *
50
- * WARNING: String descriptor structure will be
51
- *          modified ! Make a copy otherwise you
52
- *          might be unable to free _s->s for
53
- *          example !
54
- *
55
- */
56
-static inline void trim_leading(str* _s)
57
-{
58
-	for(; _s->len > 0; _s->len--, _s->s++) {
59
-		TRIM_SWITCH(*(_s->s));
60
-	}
61
-}
62
-
63
-
64
-/*
65
- * Remove any trailing white char, like spaces,
66
- * horizontal tabs, carriage returns and line feeds
67
- *
68
- * WARNING: String descriptor structure will be
69
- *          modified ! Make a copy otherwise you
70
- *          might be unable to free _s->s for
71
- *          example !
72
- */
73
-static inline void trim_trailing(str* _s)
74
-{
75
-	for(; _s->len > 0; _s->len--) {
76
-		TRIM_SWITCH(_s->s[_s->len - 1]);
77
-	}
78
-}
79
-
80
-
81
-/*
82
- * Do trim_leading and trim_trailing
83
- *
84
- * WARNING: String structure will be modified !
85
- *          Make a copy otherwise you might be
86
- *          unable to free _s->s for example !
87
- */
88
-static inline void trim(str* _s)
89
-{
90
-	trim_leading(_s);
91
-	trim_trailing(_s);
92
-}
93
-
94
-
95
-/*
96
- * right and left space trimming
97
- *
98
- * WARNING: String structure will be modified !
99
- *          Make a copy otherwise you might be
100
- *          unable to free _s_->s for example !
101
- */
102
-#define trim_spaces_lr(_s_)												\
103
-	do{																	\
104
-		for(;(_s_).s[(_s_).len-1]==' ';(_s_).s[--(_s_).len]=0);			\
105
-		for(;(_s_).s[0]==' ';(_s_).s=(_s_).s+1,(_s_).len--);			\
106
-																		\
107
-	} while(0);
108
-
109
-/*
110
- * right and left zero trimming
111
- *
112
- * WARNING: String structure will be modified !
113
- *          Make a copy otherwise you might be
114
- *          unable to free _s_->s for example !
115
- */
116
-#define trim_zeros_lr(_s_)												\
117
-	do{																	\
118
-		for(;(_s_)->s[(_s_)->len-1]=='\0';(_s_)->s[--(_s_)->len]=0);	\
119
-		for(;(_s_)->s[0]=='\0';(_s_)->s=(_s_)->s+1,(_s_)->len--);		\
120
-																		\
121
-	} while(0);
122
-
123
-#endif /* TRIM_H */
Browse code

core: macro helper to trim zeros from str value

Daniel-Constantin Mierla authored on 06/09/2016 10:49:16
Showing 1 changed files
... ...
@@ -105,5 +105,19 @@ static inline void trim(str* _s)
105 105
 		for(;(_s_).s[0]==' ';(_s_).s=(_s_).s+1,(_s_).len--);			\
106 106
 																		\
107 107
 	} while(0);
108
-	
108
+
109
+/*
110
+ * right and left zero trimming
111
+ *
112
+ * WARNING: String structure will be modified !
113
+ *          Make a copy otherwise you might be
114
+ *          unable to free _s_->s for example !
115
+ */
116
+#define trim_zeros_lr(_s_)												\
117
+	do{																	\
118
+		for(;(_s_)->s[(_s_)->len-1]=='\0';(_s_)->s[--(_s_)->len]=0);	\
119
+		for(;(_s_)->s[0]=='\0';(_s_)->s=(_s_)->s+1,(_s_)->len--);		\
120
+																		\
121
+	} while(0);
122
+
109 123
 #endif /* TRIM_H */
Browse code

core: Modify doxygen, remove history, remove SVN IDs, change "ser" and "sip-router" to "KAMAILIO"

Olle E. Johansson authored on 16/01/2015 16:38:46
Showing 1 changed files
... ...
@@ -1,21 +1,14 @@
1 1
 /* 
2
- * $Id$
3
- *
4 2
  * Copyright (C) 2001-2003 FhG Fokus
5 3
  *
6
- * This file is part of ser, a free SIP server.
4
+ * This file is part of Kamailio, a free SIP server.
7 5
  *
8
- * ser is free software; you can redistribute it and/or modify
6
+ * Kamailio is free software; you can redistribute it and/or modify
9 7
  * it under the terms of the GNU General Public License as published by
10 8
  * the Free Software Foundation; either version 2 of the License, or
11 9
  * (at your option) any later version
12 10
  *
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,
11
+ * Kamailio is distributed in the hope that it will be useful,
19 12
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 13
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 14
  * GNU General Public License for more details.
... ...
@@ -25,14 +18,13 @@
25 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
26 19
  */
27 20
 
28
-
29 21
 #ifndef TRIM_H
30 22
 #define TRIM_H
31 23
 
32 24
 #include "str.h"
33 25
 
34 26
 
35
-/*
27
+/*!
36 28
  * This switch-case statement is used in
37 29
  * trim_leading and trim_trailing. You can
38 30
  * define characters that should be skipped 
Browse code

all: updated FSF address in GPL text

Anthony Messina authored on 04/07/2014 09:36:37 • Daniel-Constantin Mierla committed on 04/07/2014 09:37:36
Showing 1 changed files
... ...
@@ -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
 
Browse code

lib/kcore: cleaned up unused code

- local route and errinfo related code were not used for long time
- also moved some bits of code to more appropriate location

Daniel-Constantin Mierla authored on 10/02/2012 12:42:59
Showing 1 changed files
... ...
@@ -100,4 +100,18 @@ static inline void trim(str* _s)
100 100
 }
101 101
 
102 102
 
103
+/*
104
+ * right and left space trimming
105
+ *
106
+ * WARNING: String structure will be modified !
107
+ *          Make a copy otherwise you might be
108
+ *          unable to free _s_->s for example !
109
+ */
110
+#define trim_spaces_lr(_s_)												\
111
+	do{																	\
112
+		for(;(_s_).s[(_s_).len-1]==' ';(_s_).s[--(_s_).len]=0);			\
113
+		for(;(_s_).s[0]==' ';(_s_).s=(_s_).s+1,(_s_).len--);			\
114
+																		\
115
+	} while(0);
116
+	
103 117
 #endif /* TRIM_H */
Browse code

- Spelling checked - READMEs updated

Jan Janak authored on 24/08/2004 08:45:09
Showing 1 changed files
... ...
@@ -1,7 +1,7 @@
1 1
 /* 
2 2
  * $Id$
3 3
  *
4
- * Copyright (C) 2001-2003 Fhg Fokus
4
+ * Copyright (C) 2001-2003 FhG Fokus
5 5
  *
6 6
  * This file is part of ser, a free SIP server.
7 7
  *
Browse code

Minor beautifications.

Jan Janak authored on 02/12/2002 09:16:58
Showing 1 changed files
... ...
@@ -35,7 +35,8 @@
35 35
 /*
36 36
  * This switch-case statement is used in
37 37
  * trim_leading and trim_trailing. You can
38
- * define char that should be skipped here.
38
+ * define characters that should be skipped 
39
+ * here.
39 40
  */
40 41
 #define TRIM_SWITCH(c) switch(c) {     \
41 42
                        case ' ':       \
Browse code

Cosmetic change.

Jan Janak authored on 19/09/2002 14:51:51
Showing 1 changed files
... ...
@@ -1,5 +1,5 @@
1
-/* $Id$ */
2
-/*
1
+/* 
2
+ * $Id$
3 3
  *
4 4
  * Copyright (C) 2001-2003 Fhg Fokus
5 5
  *
Browse code

GPLization banner introduced to *.[hc] files

Jiri Kuthan authored on 19/09/2002 12:23:52
Showing 1 changed files
... ...
@@ -1,4 +1,30 @@
1 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
+
2 28
 
3 29
 #ifndef TRIM_H
4 30
 #define TRIM_H
Browse code

*** empty log message ***

Jan Janak authored on 12/08/2002 12:16:46
Showing 1 changed files
... ...
@@ -73,4 +73,4 @@ static inline void trim(str* _s)
73 73
 }
74 74
 
75 75
 
76
-#endif
76
+#endif /* TRIM_H */
Browse code

*** empty log message ***

Jan Janak authored on 09/08/2002 11:23:36
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,76 @@
1
+/* $Id$ */
2
+
3
+#ifndef TRIM_H
4
+#define TRIM_H
5
+
6
+#include "str.h"
7
+
8
+
9
+/*
10
+ * This switch-case statement is used in
11
+ * trim_leading and trim_trailing. You can
12
+ * define char that should be skipped here.
13
+ */
14
+#define TRIM_SWITCH(c) switch(c) {     \
15
+                       case ' ':       \
16
+                       case '\t':      \
17
+                       case '\r':      \
18
+                       case '\n':      \
19
+                               break;  \
20
+                                       \
21
+                       default:        \
22
+                               return; \
23
+                       }
24
+
25
+
26
+/*
27
+ * Remove any leading whitechars, like spaces,
28
+ * horizontal tabs, carriage returns and line
29
+ * feeds
30
+ *
31
+ * WARNING: String descriptor structure will be
32
+ *          modified ! Make a copy otherwise you
33
+ *          might be unable to free _s->s for
34
+ *          example !
35
+ *
36
+ */
37
+static inline void trim_leading(str* _s)
38
+{
39
+	for(; _s->len > 0; _s->len--, _s->s++) {
40
+		TRIM_SWITCH(*(_s->s));
41
+	}
42
+}
43
+
44
+
45
+/*
46
+ * Remove any trailing white char, like spaces,
47
+ * horizontal tabs, carriage returns and line feeds
48
+ *
49
+ * WARNING: String descriptor structure will be
50
+ *          modified ! Make a copy otherwise you
51
+ *          might be unable to free _s->s for
52
+ *          example !
53
+ */
54
+static inline void trim_trailing(str* _s)
55
+{
56
+	for(; _s->len > 0; _s->len--) {
57
+		TRIM_SWITCH(_s->s[_s->len - 1]);
58
+	}
59
+}
60
+
61
+
62
+/*
63
+ * Do trim_leading and trim_trailing
64
+ *
65
+ * WARNING: String structure will be modified !
66
+ *          Make a copy otherwise you might be
67
+ *          unable to free _s->s for example !
68
+ */
69
+static inline void trim(str* _s)
70
+{
71
+	trim_leading(_s);
72
+	trim_trailing(_s);
73
+}
74
+
75
+
76
+#endif