Browse code

dispatcher: use clang format across the module

Daniel-Constantin Mierla authored on 10/01/2017 22:36:18
Showing 1 changed files
... ...
@@ -18,7 +18,7 @@
18 18
  * along with this program; if not, write to the Free Software
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
20 20
  */
21
-		       
21
+
22 22
 #ifndef _DS_HT_H_
23 23
 #define _DS_HT_H_
24 24
 
... ...
@@ -27,11 +27,11 @@
27 27
 #include "../../core/str.h"
28 28
 #include "../../core/locking.h"
29 29
 
30
+/* clang-format off */
30 31
 #define DS_LOAD_INIT		0
31 32
 #define DS_LOAD_CONFIRMED	1
32 33
 
33
-typedef struct _ds_cell
34
-{
34
+typedef struct _ds_cell {
35 35
     unsigned int cellid;   /* item hash id */
36 36
 	str callid;            /* sip call-id */
37 37
 	str duid;              /* destination unique id (duid attribute) */
... ...
@@ -43,27 +43,26 @@ typedef struct _ds_cell
43 43
     struct _ds_cell *next;
44 44
 } ds_cell_t;
45 45
 
46
-typedef struct _ds_entry
47
-{
46
+typedef struct _ds_entry {
48 47
 	unsigned int esize;
49 48
 	ds_cell_t *first;
50 49
 	gen_lock_t lock;	
51 50
 } ds_entry_t;
52 51
 
53
-typedef struct _ds_ht
54
-{
52
+typedef struct _ds_ht {
55 53
 	unsigned int htexpire;
56 54
 	unsigned int htinitexpire;
57 55
 	unsigned int htsize;
58 56
 	ds_entry_t *entries;
59 57
 	struct _ds_ht *next;
60 58
 } ds_ht_t;
59
+/* clang-format on */
61 60
 
62 61
 ds_ht_t *ds_ht_init(unsigned int htsize, int expire, int initexpire);
63 62
 int ds_ht_destroy(ds_ht_t *dsht);
64 63
 int ds_add_cell(ds_ht_t *dsht, str *cid, str *did, int dset);
65 64
 int ds_del_cell(ds_ht_t *dsht, str *cid);
66
-ds_cell_t* ds_get_cell(ds_ht_t *dsht, str *cid);
65
+ds_cell_t *ds_get_cell(ds_ht_t *dsht, str *cid);
67 66
 int ds_unlock_cell(ds_ht_t *dsht, str *cid);
68 67
 
69 68
 int ds_ht_dbg(ds_ht_t *dsht);
Browse code

core, lib, modules: updated include paths for header files

Daniel-Constantin Mierla authored on 07/12/2016 11:07:22
Showing 1 changed files
... ...
@@ -24,8 +24,8 @@
24 24
 
25 25
 #include <time.h>
26 26
 
27
-#include "../../str.h"
28
-#include "../../locking.h"
27
+#include "../../core/str.h"
28
+#include "../../core/locking.h"
29 29
 
30 30
 #define DS_LOAD_INIT		0
31 31
 #define DS_LOAD_CONFIRMED	1
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
new file mode 100644
... ...
@@ -0,0 +1,73 @@
1
+/**
2
+ *
3
+ * Copyright (C) 2010 Daniel-Constantin Mierla (asipto.com)
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
+ * Kamailio is distributed in the hope that it will be useful,
13
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
+ * GNU General Public License for more details.
16
+ *
17
+ * You should have received a copy of the GNU General Public License
18
+ * along with this program; if not, write to the Free Software
19
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
20
+ */
21
+		       
22
+#ifndef _DS_HT_H_
23
+#define _DS_HT_H_
24
+
25
+#include <time.h>
26
+
27
+#include "../../str.h"
28
+#include "../../locking.h"
29
+
30
+#define DS_LOAD_INIT		0
31
+#define DS_LOAD_CONFIRMED	1
32
+
33
+typedef struct _ds_cell
34
+{
35
+    unsigned int cellid;   /* item hash id */
36
+	str callid;            /* sip call-id */
37
+	str duid;              /* destination unique id (duid attribute) */
38
+	int dset;              /* destination set */
39
+	int state;             /* state */
40
+	time_t  expire;        /* expiration of the item */
41
+	time_t  initexpire;    /* expiration in initial state of the item */
42
+    struct _ds_cell *prev;
43
+    struct _ds_cell *next;
44
+} ds_cell_t;
45
+
46
+typedef struct _ds_entry
47
+{
48
+	unsigned int esize;
49
+	ds_cell_t *first;
50
+	gen_lock_t lock;	
51
+} ds_entry_t;
52
+
53
+typedef struct _ds_ht
54
+{
55
+	unsigned int htexpire;
56
+	unsigned int htinitexpire;
57
+	unsigned int htsize;
58
+	ds_entry_t *entries;
59
+	struct _ds_ht *next;
60
+} ds_ht_t;
61
+
62
+ds_ht_t *ds_ht_init(unsigned int htsize, int expire, int initexpire);
63
+int ds_ht_destroy(ds_ht_t *dsht);
64
+int ds_add_cell(ds_ht_t *dsht, str *cid, str *did, int dset);
65
+int ds_del_cell(ds_ht_t *dsht, str *cid);
66
+ds_cell_t* ds_get_cell(ds_ht_t *dsht, str *cid);
67
+int ds_unlock_cell(ds_ht_t *dsht, str *cid);
68
+
69
+int ds_ht_dbg(ds_ht_t *dsht);
70
+int ds_cell_free(ds_cell_t *cell);
71
+int ds_ht_clear_slots(ds_ht_t *dsht);
72
+
73
+#endif