Skip to content

Commit

Permalink
lib/presence: removed trailing spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Nov 13, 2023
1 parent 7d8ba21 commit f6f2585
Show file tree
Hide file tree
Showing 21 changed files with 220 additions and 220 deletions.
22 changes: 11 additions & 11 deletions src/lib/presence/domain_maintainer.c
@@ -1,4 +1,4 @@
/*
/*
* Copyright (C) 2005 iptelorg GmbH
*
* This file is part of ser, a free SIP server.
Expand Down Expand Up @@ -41,13 +41,13 @@ domain_maintainer_t *create_domain_maintainer()
return dm;
}

void destroy_domain_maintainer(domain_maintainer_t *dm)
void destroy_domain_maintainer(domain_maintainer_t *dm)
{
int i, cnt;
notifier_domain_t *d;

if (!dm) return;

DEBUG_LOG("destroying domain maintainer\n");

cnt = ptr_vector_size(&dm->registered_domains);
Expand All @@ -68,7 +68,7 @@ static notifier_domain_t *find_domain_nolock(domain_maintainer_t *dm, const str_
{
notifier_domain_t *d = NULL;
int i, cnt;

cnt = ptr_vector_size(&dm->registered_domains);
for (i = 0; i < cnt; i++) {
d = ptr_vector_get(&dm->registered_domains, i);
Expand All @@ -81,7 +81,7 @@ static notifier_domain_t *find_domain_nolock(domain_maintainer_t *dm, const str_
static notifier_domain_t *add_domain_nolock(domain_maintainer_t *dm, const str_t *name)
{
notifier_domain_t *d = create_notifier_domain(dm->rc_grp, name);

if (d) {
DEBUG_LOG("created domain: \'%.*s\'\n", FMT_STR(d->name));
ptr_vector_add(&dm->registered_domains, d);
Expand All @@ -93,7 +93,7 @@ static notifier_domain_t *add_domain_nolock(domain_maintainer_t *dm, const str_t
/* notifier_domain_t *find_notifier_domain(domain_maintainer_t *dm, const str_t *name)
{
notifier_domain_t *d = NULL;
if (!dm) return NULL;
cds_mutex_lock(&dm->mutex);
d = find_domain_nolock(dm, name);
Expand All @@ -104,9 +104,9 @@ static notifier_domain_t *add_domain_nolock(domain_maintainer_t *dm, const str_t
notifier_domain_t *register_notifier_domain(domain_maintainer_t *dm, const str_t *name)
{
notifier_domain_t *d = NULL;

if (!dm) return NULL;

cds_mutex_lock(&dm->mutex);
d = find_domain_nolock(dm, name);
if (!d) d = add_domain_nolock(dm, name);
Expand All @@ -121,7 +121,7 @@ static void remove_notifier_domain(domain_maintainer_t *dm, notifier_domain_t *d
{
notifier_domain_t *d = NULL;
int i, cnt;

cnt = ptr_vector_size(&dm->registered_domains);
for (i = 0; i < cnt; i++) {
d = ptr_vector_get(&dm->registered_domains, i);
Expand All @@ -135,7 +135,7 @@ static void remove_notifier_domain(domain_maintainer_t *dm, notifier_domain_t *d
void release_notifier_domain(domain_maintainer_t *dm, notifier_domain_t *domain)
{
if ((!dm) || (!domain)) return;

cds_mutex_lock(&dm->mutex);
if (remove_reference(&domain->ref)) {
/* last reference */
Expand Down
6 changes: 3 additions & 3 deletions src/lib/presence/domain_maintainer.h
@@ -1,4 +1,4 @@
/*
/*
* Copyright (C) 2005 iptelorg GmbH
*
* This file is part of ser, a free SIP server.
Expand Down Expand Up @@ -40,13 +40,13 @@ typedef struct {
cds_mutex_t mutex;
} domain_maintainer_t;


domain_maintainer_t *create_domain_maintainer();
void destroy_domain_maintainer(domain_maintainer_t *dm);

notifier_domain_t *register_notifier_domain(domain_maintainer_t *dm, const str_t *name);
void release_notifier_domain(domain_maintainer_t *dm, notifier_domain_t *domain);

#ifdef __cplusplus
}
#endif
Expand Down
26 changes: 13 additions & 13 deletions src/lib/presence/lpidf.c
@@ -1,4 +1,4 @@
/*
/*
* Copyright (C) 2005 iptelorg GmbH
*
* This file is part of ser, a free SIP server.
Expand Down Expand Up @@ -36,9 +36,9 @@
static void doc_add_tuple(dstring_t *buf, presentity_info_t *p, presence_tuple_info_t *t)
{
char tmp[64];

if (t->status.basic == presence_tuple_closed) return; /* do not append closed tuples */

dstr_append_zt(buf, "Contact: ");
dstr_append_str(buf, &t->contact);
dstr_append_zt(buf, ";q=");
Expand All @@ -55,7 +55,7 @@ static void doc_add_presentity(dstring_t *buf, presentity_info_t *p)
dstr_append_zt(buf, "To: ");
dstr_append_str(buf, &p->uri);
dstr_append_zt(buf, "\r\n");

t = p->first_tuple;
while (t) {
doc_add_tuple(buf, p, t);
Expand All @@ -67,34 +67,34 @@ int create_lpidf_document(presentity_info_t *p, str_t *dst, str_t *dst_content_t
{
dstring_t buf;
int err;

if (!dst) return -1;

str_clear(dst);
if (dst_content_type) str_clear(dst_content_type);

if (!p) return -1;

if (dst_content_type) {
if (str_dup_zt(dst_content_type, "text/lpidf") < 0) {
return -1;
}
}

/* if (!p->first_tuple) return 0;*/ /* no tuples => nothing to say */
/* if (!p->first_tuple) return 0;*/ /* no tuples => nothing to say */

dstr_init(&buf, 2048);

doc_add_presentity(&buf, p);

err = dstr_get_str(&buf, dst);
dstr_destroy(&buf);

if (err != 0) {
str_free_content(dst);
if (dst_content_type) str_free_content(dst_content_type);
}

return err;
}

2 changes: 1 addition & 1 deletion src/lib/presence/lpidf.h
@@ -1,4 +1,4 @@
/*
/*
* Copyright (C) 2005 iptelorg GmbH
*
* This file is part of ser, a free SIP server.
Expand Down
22 changes: 11 additions & 11 deletions src/lib/presence/notifier.h
@@ -1,4 +1,4 @@
/*
/*
* Copyright (C) 2005 iptelorg GmbH
*
* This file is part of ser, a free SIP server.
Expand Down Expand Up @@ -45,17 +45,17 @@ notifier_t *register_notifier(
void unregister_notifier(notifier_domain_t *domain, notifier_t *info);

/** accepts subscription (internally adds reference to it), thus it can
* be handled by notifier which called this function
* MUST be called in notifier's subscribe function, otherwise the
* subscription can NOT be accepted
* be handled by notifier which called this function
* MUST be called in notifier's subscribe function, otherwise the
* subscription can NOT be accepted
*
* Note: only for asynchonously processed subscriptions (synchronous
* Note: only for asynchonously processed subscriptions (synchronous
* don't need it) */
void accept_subscription(qsa_subscription_t *s);

/** releases accepted subscription - MUST be called on all accepted
/** releases accepted subscription - MUST be called on all accepted
* subscriptions (only on them!) to be freed from memory !
* Note: only for asynchonously processed subscriptions (synchronous
* Note: only for asynchonously processed subscriptions (synchronous
* don't need it) */
void release_subscription(qsa_subscription_t *s);

Expand All @@ -72,7 +72,7 @@ typedef enum {

typedef struct {
/* replacement for record_id, package, ... it is much more efficient */
qsa_subscription_t *subscription;
qsa_subscription_t *subscription;
qsa_content_type_t *content_type;
void *data;
int data_len;
Expand All @@ -83,10 +83,10 @@ typedef struct {
void free_client_notify_info_content(client_notify_info_t *info);

/* notifications SHOULD be sent through this method */
int notify_subscriber(qsa_subscription_t *s,
int notify_subscriber(qsa_subscription_t *s,
notifier_t *n,
qsa_content_type_t *content_type,
void *data,
qsa_content_type_t *content_type,
void *data,
qsa_subscription_status_t status);

/* this can be called in notifier and the returned value is valid
Expand Down

0 comments on commit f6f2585

Please sign in to comment.