summaryrefslogtreecommitdiff
path: root/toxrtp/toxrtp_helper.h
diff options
context:
space:
mode:
authormannol <eniz_vukovic@hotmail.com>2014-01-25 01:32:33 +0100
committermannol <eniz_vukovic@hotmail.com>2014-01-25 01:32:33 +0100
commit65d320e31daa4709bb48b7f2a52c269dde0927e9 (patch)
tree45081a96be413d850a837d6afcee19fcfbfe7aca /toxrtp/toxrtp_helper.h
parent51d8c41390be853a13693476802a834daf8d156a (diff)
Done with encryption and core adaptations.
Diffstat (limited to 'toxrtp/toxrtp_helper.h')
-rw-r--r--toxrtp/toxrtp_helper.h77
1 files changed, 0 insertions, 77 deletions
diff --git a/toxrtp/toxrtp_helper.h b/toxrtp/toxrtp_helper.h
deleted file mode 100644
index c9bcfcca..00000000
--- a/toxrtp/toxrtp_helper.h
+++ /dev/null
@@ -1,77 +0,0 @@
1/* rtp_helper.h
2*
3* Has some standard functions. !Red!
4*
5*
6* Copyright (C) 2013 Tox project All Rights Reserved.
7*
8* This file is part of Tox.
9*
10* Tox is free software: you can redistribute it and/or modify
11* it under the terms of the GNU General Public License as published by
12* the Free Software Foundation, either version 3 of the License, or
13* (at your option) any later version.
14*
15* Tox is distributed in the hope that it will be useful,
16* but WITHOUT ANY WARRANTY; without even the implied warranty of
17* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18* GNU General Public License for more details.
19*
20* You should have received a copy of the GNU General Public License
21* along with Tox. If not, see <http://www.gnu.org/licenses/>.
22*
23*/
24
25#ifndef _RTP__HELPER_H_
26#define _RTP__HELPER_H_
27
28#include <time.h>
29#include <inttypes.h>
30
31/* Current time, unix format */
32/*#define _time ((uint32_t)time(NULL))*/
33
34#define SUCCESS 0
35#define FAILURE -1
36
37#define _USE_ERRORS
38
39#define RUN_IN_THREAD(_func, _thread_id, _arg_ptr) \
40if ( pthread_create ( &_thread_id, NULL, _func, _arg_ptr ) ) { \
41 pthread_detach ( _thread_id ); \
42}
43
44/* Core adaptation helper */
45int t_setipport ( const char* _ip, unsigned short _port, void* _cont );
46uint32_t t_random ( uint32_t _max );
47
48/* It's a bit faster than the memcpy it self and more optimized for using
49 * a uint8_t since memcpy has optimizations when copying "words" i.e. long type.
50 * Otherwise it just copies char's while we need only uint8_t
51 */
52void t_memcpy ( uint8_t* _dest, const uint8_t* _source, size_t _size );
53
54
55/* This is our memset. It's also a bit faster than the memset for it
56 * does not cast _dest to char* and uses faster loop algorithm.
57 */
58uint8_t* t_memset ( uint8_t* _dest, uint8_t _valu, size_t _size );
59
60/* Get null terminated len */
61size_t t_memlen ( const uint8_t* _valu );
62
63/* finds location of substring */
64size_t t_strfind ( const uint8_t* _str, const uint8_t* _substr );
65
66/* string alloc and copy ( ! must be null terminated ) */
67uint8_t* t_strallcpy ( const uint8_t* _source );
68
69/* Get current time in milliseconds */
70uint64_t t_time();
71
72
73#endif /* _RTP__HELPER_H_ */
74
75
76
77