Commit Graph

49 Commits

Author SHA1 Message Date
iphydf
abc17b0f89
Factor out time keeping code into its own module: mono_time.c.
It turns out, `unix_time` is also monotonic, and is used as such, so I've
renamed the new functions to `mono_time_*`.

2018-07-08:
```
00:01 <@irungentoo> the idea used to be that the unix_time() function
  could go backward in time but I think I might have started using it like
  if it could not after I changed it so that it would never go back in time
```
2018-07-09 21:04:50 +00:00
iphydf
c8697ccc20
Move load_state and its helper functions to their own module. 2018-07-09 20:36:39 +00:00
Maxim Biro
c7f63737eb Revert "Implement tox_loop"
This reverts commit 5ff099763b.
2017-04-22 15:31:25 -04:00
Ansa89
5ff099763b
Implement tox_loop 2017-04-01 17:47:34 +02:00
iphydf
6ae33c16cf
Add VLA compatibility macro for C89-ish compilers. 2017-01-28 20:49:12 +00:00
Sergey 'Jin' Bostandzhyan
3f24f04876 Setup autotools to read .so version info from a separate file
We want to use the same libtool style .so versions in both build systems,
ideally both systems should read the version information from the same
configuration file.

This commit introduces an so.version configuration file and sets up
the autotools to use it.

The version numbers in so.version define the ABI compatibility and should be
updated prior to each release.

implements #323
2017-01-18 11:20:07 +01:00
iphydf
d6d14b5430
Remove \ at end of list in makefile. 2017-01-07 11:47:30 -06:00
endoffile78
e667ec23b9
Replace make_quick_sort with qsort 2017-01-07 11:47:30 -06:00
Diadlo
06a68f0f5f
Add secure memcmp and memzero implementation.
Implementation mostly taken from libsodium utils.

Fix #347
2017-01-04 00:40:17 +03:00
iphydf
db71602731
Use tox_options_set_* instead of direct member access.
Also added a `tox_options_copy` function for cloning an options object.
This can be useful when creating several Tox instances with slightly
varying options.
2016-12-22 10:53:39 +00:00
endoffile78
3f53090c1d
Remove assoc 2016-11-06 09:14:53 -06:00
Jfreegman
8e43ca834c Complete old groupchat conversion to new API 2016-09-17 19:11:28 -04:00
iphydf
c0397a0a46 ApiDSL'ing old group chats (now: conference). 2016-09-17 19:11:28 -04:00
iphydf
fa3b51266b
Add missing #includes to headers and rename tox_old to tox_group.
Also, no longer #include the group code into tox.c. Instead, compile it
separately in tox_group.c. This is a bit less surprising to someone looking
around the code. Having some implementations in a .h file is certainly a bit
surprising to a disciplined C programmer, especially when there is no technical
reason to do it.
2016-08-30 19:31:40 +01:00
Roman Yepishev
b0e720846f
Add missing files so that archive for make dist is complete 2016-02-26 22:58:13 -05:00
irungentoo
3e9c4e80f0
TCP_connection started.
The plan is to move some of the TCP stuff from net_crypto into it.
2015-04-07 20:19:30 -04:00
irungentoo
fab2daf57a
Install tox_old.h too. 2015-03-14 10:54:42 -04:00
irungentoo
6c71bb7e64
Moved all the connection stuff from messenger to friend_connection.
Messenger was doing way do many things.

friend_connection takes care of finding and establishing a connection
to friends.
2014-09-27 18:25:03 -04:00
irungentoo
d67624bf99
Removed groupchats from core. 2014-09-25 16:48:18 -04:00
irungentoo
aca2d61843
Some code written for new group chats. 2014-09-25 15:10:54 -04:00
irungentoo
2740099da0
pthread is now a core dependency instead of just a toxav dependency.
Fixed possible thread bug with sending A/V packets.

TODO: eventually make toxcore thread safe.
2014-06-12 11:15:20 -04:00
Maxim Biro
24c6db5968 Fixed the undefined reference to pow error 2014-05-31 13:16:08 -04:00
mannol
9db41e7582 Merge remote-tracking branch 'upstream/master' into Multicalls-patch 2014-05-22 00:08:19 +02:00
mannol
a1f2a18ae4 Merge upstream and other stuff 2014-05-20 00:10:40 +02:00
notsecure
fe66fcc7e4 list
Simple struct with functions to create a list which associates ids with
data
2014-05-19 16:42:09 -04:00
irungentoo
10da970e0d
Added ping_array, a special efficient array for use in operations
that require sending ping type packets.

Made ping packets use it.
2014-05-12 14:07:03 -04:00
irungentoo
ff4368add7
Fixed build by adding librt to build system. 2014-05-10 16:09:44 -04:00
irungentoo
8e24771fc4
Remove Lossless UDP (This breaks Tox.) 2014-05-02 10:36:48 -04:00
mannol
42b25a4d3e Yeah many calls 2014-04-27 19:21:26 +02:00
irungentoo
9c6a8432ce Crypto related cleanups.
Moved Bunch of functions from net_crypto to crypto_core.

decrypt_data_fast and decrypt_data_symmetric were the same thing
therefore, removed decrypt_data_fast.

Replaced all the crypto_secretbox_* defines with the equivalent
crypto_box_* one.

New define: crypto_box_KEYBYTES that is equal to
crypto_box_BEFORENMBYTES.
2014-04-21 16:51:36 -04:00
irungentoo
736f5f8034
Added TCP test to build system. 2014-04-10 20:46:24 -04:00
Jin^eLD
70475d281d Fix NaCl builds for *BSD
From what I see there is a difference between *BSD and Linux when
linking vs. toxcore which has been bulit vs. the NaCl library:

on Linux it only links if NaCl's object files (i.e. randombytes.o) is
present in the linker options, however on *BSD systems this will cause a
linking error, see:
https://github.com/Tox/toxic/issues/31#issuecomment-38224441

This commit makes sure that we do not add the NaCl object files to our
pkg-config settings on *BSD, but do add them on Linux.
2014-03-23 02:05:57 +01:00
exonity
a77dacbdf0 Changed libtoxcore_la_LDADD to libtoxcore_la_LIBADD cause of creating a library. 2014-02-17 21:44:10 +01:00
irungentoo
9fcb707ec4 Wrote random_path function.
Added onion_client to the build system.
2014-01-16 10:00:36 -05:00
irungentoo
7e2d21271a Some work on the onion part done. 2014-01-04 19:40:43 -05:00
irungentoo
97b9a9cf04 Added onion.c to build system and added a test. 2013-12-31 23:18:37 -05:00
Coren[m]
0d8329b3a9
Significantly trimmed down version of an ID<=>IP cache.
Besides acknowledging timeouts, the module isn't trying to do anything fancy with the data besides storing and retrieving.
2013-11-14 19:05:53 +01:00
mannol
5bc2560904 tox A/V: integration of A/V code into tox
Also-by: Sergey 'Jin' Bostandzhyan <jin@mediatomb.cc>
2013-10-13 16:40:15 +02:00
irungentoo
1f5bfab327 Start of group chats integration into the core. 2013-09-09 14:44:43 -04:00
Jin^eLD
e092eee869 Allow to build vs nacl instead of libsodium
By default libsodium is used. Only if --enable-nacl is specified, then
nacl will be used instead of libsodium.

Pass locations of nacl headers and libraries by using the following
options:

--with-nacl-headers=/home/me/somewhere/nacl-20110221/build/469/include/amd64/
--with-nacl-libs=/home/me/somewhere/nacl-20110221/build/469/lib/amd64/
2013-09-06 22:54:45 +03:00
jin-eld
7d29bd23b9 Forward compatibility with automake 1.14
This update makes sure that the build still works with automake prior to
1.12 and at the same time does not give any warnings or errors with
automake 1.14
2013-09-01 20:39:02 +03:00
irungentoo
8f0bef5f20 Fixed warnings and moved hex_string_to_bin to testing/ 2013-08-30 08:16:34 -04:00
irungentoo
7441a234b7 Merge branch 'udp_connections' of https://github.com/vx-k/ProjectTox-Core into vx-k-udp_connections 2013-08-30 07:53:51 -04:00
jin-eld
93e2e1eaa0 Sync makefile with source list
packets.h is now gone
2013-08-30 02:19:00 +03:00
Anony Moose
eb33796e58 Moved misc_tools from testing to toxcore. 2013-08-29 22:54:54 +00:00
jin-eld
ed1c130ebc Move extra libtool options into configure
This should allow to keep the libtool options all in one place and at
the same time define different options depending on the host.

Made sure that -no-undefined is set only on Win32. Although no side
effects on Linux and OSX have been observed so far, it's probably better
to play it safe; it does not seem to be needed/does not seem to matter on *nix,
only required for Win32.
2013-08-26 22:08:43 +03:00
jin-eld
634a67f627 Also generate a .dll in MinGW builds
Previously only static a static library was produced on MinGW builds,
this PR makes sure that we also build a proper .dll
2013-08-26 02:18:09 +03:00
jin-eld
1ec70337cf Remove cmake build system 2013-08-24 03:36:43 +03:00
jin-eld
50c8a820e5 Implemented autotools based build scripts
supported options:

--with-dependency-search=DIR    will tell configure to look for various
dependencies in DIR/include and DIR/lib

Alternatively you can also specify libsodium header and libs location
with --with-libsodium-headers and --with-libsodium-libs if it is
installed elsewhere.

Ncurses and libconfig are handled via the default pkg-config way, see
./configure --help=short for detailed information.

The tox library is compiled as libtoxcore in shared and static variants,
public headers are installed to ${prefix}/include/tox

A pkg-config libtoxcore.pc configuration file is provided.

Use ./configure --help for a full list of configure options or
./configure --help=short for the options that I added.

To generate the configure script after pulling from git use:
autoreconf -i

To generate a release tarball use:
make dist

Unit tests are handled by the libcheck library integration that is provided
by autotools, use:
make check

to compile and run the tests.

Unit tests are currently optional, i.e. - if the check library is not
found on the system, then tests will be disabled. Same goes for nTox and
DHT bootstrap daemon - they will be enabled or disabled depending on the
availability of ncurses (for nTox) or libconfig (for DHT bootstrap
daemon).

The above can be also tuned by:
--enable-tests / --disable-tests
--enable-ntox / --disable-ntox
--enable-dht-bootstrap-daemon / --disable-dht-bootstrap-daemon
2013-08-24 03:25:07 +03:00