summaryrefslogtreecommitdiff
path: root/include/baresip.h
diff options
context:
space:
mode:
authorAlfred E. Heggestad <aeh@db.org>2016-07-24 18:00:40 +0200
committerAlfred E. Heggestad <aeh@db.org>2016-07-24 18:00:40 +0200
commit713f55a1f9958222f85238bde40482b566cf040e (patch)
tree7ca0800a14cec6f9cbe6794a3bdcea9b42001db7 /include/baresip.h
parent0a987e0a95b3473f8bc5e70455c92232d9990114 (diff)
contact: make contacts re-entrant
Diffstat (limited to 'include/baresip.h')
-rw-r--r--include/baresip.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/include/baresip.h b/include/baresip.h
index 26ddf4b..c6d8ae8 100644
--- a/include/baresip.h
+++ b/include/baresip.h
@@ -262,17 +262,24 @@ enum presence_status {
PRESENCE_BUSY
};
+struct contacts {
+ struct list cl;
+ struct hash *cht;
+};
+
struct contact;
-int contact_init(void);
-void contact_close(void);
-int contact_add(struct contact **contactp, const struct pl *addr);
-int contacts_print(struct re_printf *pf, void *unused);
+int contact_init(struct contacts *contacts);
+void contact_close(struct contacts *contacts);
+int contact_add(struct contacts *contacts,
+ struct contact **contactp, const struct pl *addr);
+int contacts_print(struct re_printf *pf, const struct contacts *contacts);
void contact_set_presence(struct contact *c, enum presence_status status);
-bool contact_block_access(const char *uri);
-struct contact *contact_find(const char *uri);
+bool contact_block_access(const struct contacts *contacts, const char *uri);
+struct contact *contact_find(const struct contacts *contacts,
+ const char *uri);
struct sip_addr *contact_addr(const struct contact *c);
-struct list *contact_list(void);
+struct list *contact_list(const struct contacts *contacts);
const char *contact_str(const struct contact *c);
const char *contact_presence_str(enum presence_status status);
@@ -1076,6 +1083,7 @@ double mos_calculate(double *r_factor, double rtt,
int baresip_init(struct config *cfg, bool prefer_ipv6);
void baresip_close(void);
struct network *baresip_network(void);
+struct contacts *baresip_contacts(void);
#ifdef __cplusplus