Skip to content

Commit

Permalink
feat: upgrade PJSIP 2.13
Browse files Browse the repository at this point in the history
  • Loading branch information
aldiand committed Jun 7, 2023
1 parent 5667239 commit 53365cf
Show file tree
Hide file tree
Showing 633 changed files with 53,939 additions and 46,933 deletions.
4 changes: 2 additions & 2 deletions Pod/VialerPJSIP.a
Git LFS file not shown
1 change: 0 additions & 1 deletion Pod/vialer-pjsip-include/pj++/file.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* $Id$ */
/*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <[email protected]>
Expand Down
43 changes: 21 additions & 22 deletions Pod/vialer-pjsip-include/pj++/hash.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* $Id$ */
/*
* Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <[email protected]>
Expand Down Expand Up @@ -36,44 +35,44 @@ class Pj_Hash_Table : public Pj_Object
class iterator
{
public:
iterator()
iterator()
{
}
explicit iterator(pj_hash_table_t *h, pj_hash_iterator_t *i)
explicit iterator(pj_hash_table_t *h, pj_hash_iterator_t *i)
: ht_(h), it_(i)
{
}
iterator(const iterator &rhs)
iterator(const iterator &rhs)
: ht_(rhs.ht_), it_(rhs.it_)
{
}
void operator++()
void operator++()
{
it_ = pj_hash_next(ht_, it_);
}
bool operator==(const iterator &rhs)
bool operator==(const iterator &rhs)
{
return ht_ == rhs.ht_ && it_ == rhs.it_;
}
iterator & operator=(const iterator &rhs)
iterator & operator=(const iterator &rhs)
{
ht_=rhs.ht_; it_=rhs.it_;
return *this;
}
private:
pj_hash_table_t *ht_;
pj_hash_iterator_t it_val_;
pj_hash_iterator_t *it_;
pj_hash_table_t *ht_;
pj_hash_iterator_t it_val_;
pj_hash_iterator_t *it_;

friend class Pj_Hash_Table;
friend class Pj_Hash_Table;
};

//
// Construct hash table.
//
Pj_Hash_Table(Pj_Pool *pool, unsigned size)
{
table_ = pj_hash_create(pool->pool_(), size);
table_ = pj_hash_create(pool->pool_(), size);
}

//
Expand All @@ -90,23 +89,23 @@ class Pj_Hash_Table : public Pj_Object
const void *key,
unsigned keylen = PJ_HASH_KEY_STRING)
{
return pj_hash_calc(initial_hval, key, keylen);
return pj_hash_calc(initial_hval, key, keylen);
}

//
// Return pjlib compatible hash table object.
//
pj_hash_table_t *pj_hash_table_t_()
{
return table_;
return table_;
}

//
// Get the value associated with the specified key.
//
void *get(const void *key, unsigned keylen = PJ_HASH_KEY_STRING)
{
return pj_hash_get(table_, key, keylen);
return pj_hash_get(table_, key, keylen);
}

//
Expand All @@ -118,39 +117,39 @@ class Pj_Hash_Table : public Pj_Object
void *value,
unsigned keylen = PJ_HASH_KEY_STRING)
{
pj_hash_set(pool->pool_(), table_, key, keylen, value);
pj_hash_set(pool->pool_(), table_, key, keylen, value);
}

//
// Get number of items in the hash table.
//
unsigned count()
{
return pj_hash_count(table_);
return pj_hash_count(table_);
}

//
// Iterate hash table.
//
iterator begin()
{
iterator it(table_, NULL);
it.it_ = pj_hash_first(table_, &it.it_val_);
return it;
iterator it(table_, NULL);
it.it_ = pj_hash_first(table_, &it.it_val_);
return it;
}

//
// End of items.
//
iterator end()
{
return iterator(table_, NULL);
return iterator(table_, NULL);
}

private:
pj_hash_table_t *table_;
};


#endif /* __PJPP_HASH_HPP__ */
#endif /* __PJPP_HASH_HPP__ */

Loading

0 comments on commit 53365cf

Please sign in to comment.