Commit Graph

331 Commits

Author SHA1 Message Date
iphydf
bbdd798256
Fix unresolved reference in toxencryptsave API.
Also, make sure this won't happen again by checking for it in
format-source.
2016-12-14 11:35:43 +00:00
iphydf
b14b8d07fa
Add compatibility pkg-config modules: libtoxcore, libtoxav.
These were generated by the autotools build. Some clients may depend on
these files instead of the newer split pkg-config files. New clients
should be using the toxcore, toxav, toxencryptsave, and toxdns modules.
2016-12-13 20:58:32 +00:00
iphydf
4cf69996cc
Add apidsl file for toxencryptsave.
This breaks the toxencryptsave API. It hides the Tox_Pass_Key struct
definition.
2016-12-13 14:24:40 +00:00
iphydf
2dc2ac52b9
Fix --enable-logging flag in autotools configure script.
We also never really tested this, because we run make distcheck, which
does another configure with default flags instead of the ones we passed.

Fixes #317.
2016-12-13 00:52:58 +00:00
GDR!
c684499375 Move -ltoxcore to be the first linked library 2016-12-12 14:09:34 +01:00
iphydf
d8ae726d0a Don't build nTox by default.
Build it on Travis. It won't be built on the windows builds regardless
of having it enabled globally.

Fixes #292.
2016-12-05 22:02:30 +00:00
Maxim Biro
f0f53dbd55 Don't error on warnings by default
Having -Werror set by default causes users' builds to fail because
toxcore is not warning-free. Failing on errors is appropriate for the
development phase, e.g. when building it in a CI enviroment, but it
doesn't make much sense to fail builds for users and let them figure out
that they need to pass -DWARNINGS=OFF to make the library build.
2016-11-28 15:13:01 -05:00
Gregory Mullen (grayhatter)
ad517eb1df
add NAT hole punching level to Tox API 2016-11-24 17:38:34 -08:00
iphydf
8bbde23f48
Use apidsl for the crypto_core API.
This allows us to use apidsl features like namespaces to enforce a
naming standard.
2016-11-12 11:55:40 +00:00
iphydf
b2dd50f9fc
Work around Travis issue that causes build failures.
Travis seems to no longer set $TERM, which breaks opam. We now manually
set it to some hopefully sane value.
2016-11-10 23:45:48 +00:00
endoffile78
3f53090c1d
Remove assoc 2016-11-06 09:14:53 -06:00
iphydf
7b6b47a610
Enable address sanitizer on the cmake build. 2016-11-06 12:19:34 +00:00
iphydf
96c672aef5
Compile as C++ for windows builds.
Compiling as C++ changes nothing semantically, but ensures that we don't
break C++ compatibility while also retaining C compatibility.

C++ compatibility is useful for tooling and additional diagnostics and
analyses.
2016-11-02 18:50:41 +00:00
iphydf
de966cdf90
Error if format_test can't be executed.
This ensures that on Travis, format_test will always be executed, or the
build fails.
2016-10-26 13:34:29 +01:00
iphydf
0fb79c54b8
Set log level for DEBUG=ON to LOG_DEBUG.
We use TRACE=ON (cmake flag) to enable LOG_TRACE. This way, a regular
build can enable DEBUG while not paying the price of TRACE. This is
particularly important for FFI bindings (especially Python), where
invoking callbacks can be an expensive operation.
2016-10-06 15:15:42 +01:00
Maxim Biro
02e9cd38f1 Add option to build tox-bootstrapd
When cross-compiling to <target> from Linux, cmake might find native Linux
libconfig and decide to build tox-bootstrapd. If the target is Windows, this
will fail, as tox-bootstrapd can't be built for Windows in the first place. If
the target is Linux of some other architecture, then using host native
libconfig will fail too. Thus an option is needed to guard against this.
2016-10-05 23:47:39 -04:00
Maxim Biro
90123c803a Align things nicer 2016-10-04 15:44:46 -04:00
Maxim Biro
bf42872bb3 Use TEST_TIMEOUT_SECONDS cmake flag on Travis 2016-10-04 15:32:38 -04:00
iphydf
b8b9789a69
Rebuild apidsl'd headers in cmake.
- Moved apidsl headers next to their generated versions. In the future,
  perhaps all (or most) headers will be apidsl-generated, so the sources
  should stay together.
- Try to find apidsl/apigen binary and astyle binary and use it for the
  format test. Don't run the format test if these can't be found.
2016-10-02 23:54:03 +01:00
iphydf
6d2b85ed06
Minor documentation fixes.
- Fixed incorrect parameter names (documented name didn't match code
  name).
- Removed `@return` from functions that return `void`.
- Make sure every parameter is documented. This required moving the
  planes and strides documentation to the function docs.
2016-10-01 11:17:57 +01:00
iphydf
c037100747
Import the hstox SUT interface from hstox.
We'll maintain it in the c-toxcore repo, where it belongs.
2016-10-01 02:13:34 +01:00
iphydf
1977d56caa
Remove return after no-return situation (and other cleanups).
Cleanups:
- Fix header guards to not use reserved names.
- Avoid name shadowing.
- Removed an unused variable found by avoiding name shadowing.
2016-09-30 19:06:44 +01:00
iphydf
30e86c5eb0
Merge branch 'master' of https://github.com/irungentoo/toxcore 2016-09-29 09:54:53 +01:00
iphydf
36f40f1a4f
Add version-sync script to update all places with versions.
This will update tox.in.h only. Currently, you will still need to
manually update tox.h. An upcoming PR (#154) will update tox.h as
part of the build.
2016-09-28 23:29:36 +01:00
nobody
a4630e91ee Updated to match current toxav.h 2016-09-28 15:13:21 -04:00
Gregory Mullen (grayhatter)
51139a080c
v0.0.0 => v0.0.1 2016-09-28 12:12:39 -07:00
iphydf
d369448ace
Work around bug in opencv3 headers.
OpenCV 3.1 doesn't define cvRound in C, only in C++. Thus, we now need
to compile av_test as C++ code.
2016-09-25 01:58:51 +01:00
iphydf
15cb426166
Make toxcore code C++ compatible.
It is still C code, so still compatible with C compilers as well. This
change lets us see more clearly where implicit conversions occur by
making them explicit.
2016-09-24 21:53:50 +01:00
iphydf
0d347c2b2e
Minor cleanups: unused vars, unreachable code, static globals.
- All global variables should be static unless they have an explicit
  extern declaration in a header file.
- `to_compare` was not used in encryptsave and toxav tests.
- `break` in switch cases is not required directly after `return`,
  `goto`, or a noreturn function like `abort`.
2016-09-24 20:52:09 +01:00
Jfreegman
dd2965a58f Make group callbacks stateless 2016-09-21 15:33:55 -04:00
iphydf
e59fd26d49
Add OSX and Windows build to travis config.
Tests for Windows are disabled for now, until we figure out which tests
can successfully run on wine and select only those.
2016-09-20 13:52:33 +01:00
iphydf
51d18236c8
Revert "Make ToxAV stateless"
This reverts commit 21f8db12c4.

It is currently broken. Incoming call callbacks are not invoked, and
instead the client goes offline immediately.
2016-09-19 21:53:40 +01:00
iphydf
67ac9138ab
Add STRICT_ABI cmake flag to generate export lists.
Enabling this flag will generate and use an LD version script. It
ensures that the dynamic libraries (libtoxcore.so, libtoxav.so) only
export the symbols that are defined in their public API (tox.h and
toxav.h, respectively).
2016-09-19 19:42:12 +01:00
arza
d28f94a2f9 Changed the umask to 077 so that the keys file is not readable/writable by other users. 2016-09-19 05:03:48 +03:00
arza
3df21424bb Included sys/stat.h. 2016-09-19 05:03:38 +03: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
Gregory Mullen (grayhatter)
21f8db12c4
Make ToxAV stateless 2016-09-17 14:05:51 -07:00
iphydf
1494e474dd
Ensure that all TODOs have an owner.
In the future, all TODOs added either need a bug number (TODO(#NN)) or a
person's github user name. By default, I made irungentoo the owner of
all toxcore TODOs, mannol the owner of toxav TODOs, and myself the owner
of API TODOs.
2016-09-16 12:06:02 +01:00
iphydf
37c041f815
Clean up Travis build a bit in preparation for osx/win. 2016-09-16 11:22:23 +01:00
iphydf
c0d84ab489
Remove format-source from travis script.
This test is already performed by `make test` later on. We originally
had it in the Travis script to make it fail fast when the format is
wrong, but there is also some value in running all tests despite format
errors.

Fixes #83. There are no more relevant phases that would benefit from the
padding lines proposed.
2016-09-16 11:05:54 +01:00
iphydf
a8823830d3
Add some astyle options to make it do more.
It now enforces a bit more formatting. In particular, padding inside
parentheses is removed. I would like it to remove padding after unary
operators, but there seems to be no option for that.
2016-09-13 01:07:02 +01:00
iphydf
2db31d95fd
Use "phase" script for travis build phases.
This is the first step towards unifying travis configs for toxcore,
hstox, and qtox.
2016-09-11 22:13:47 +01:00
iphydf
6683a4b284
Use TokTok's apidsl instead of the iphydf one. 2016-09-11 21:09:41 +01:00
michael bishop
05f474b4df
make the majority of the callbacks stateless and add some status to a testcase 2016-09-10 01:09:37 -03:00
iphydf
406d292107
Minor cleanups: header reordering, adding {}.
I hadn't done this for the "fun" code, yet. Also, we should include
system headers after our own headers.

"In general, a module should be implemented by one or more .cpp files.
Each of these .cpp files should include the header that defines their
interface first. This ensures that all of the dependences of the module
header have been properly added to the module header itself, and are not
implicit. System headers should be included after user headers for a
translation unit."
-- http://llvm.org/docs/CodingStandards.html#a-public-header-file-is-a-module
2016-09-09 19:30:50 +01:00
iphydf
59075ba325
Use const for version numbers.
ApiDSL generates the lowercase function declarations for us and puts them in the
right namespace (TOX_, TOXAV_).
2016-09-09 10:05:12 +01:00
iphydf
254feb0acd
Add address sanitizer option to cmake file. 2016-09-08 10:13:40 +01:00
iphydf
159dc3b6ab
Print a message about missing astyle in format-source. 2016-09-07 23:11:13 +01:00
iphydf
ad26560516
Improve static and const correctness.
- Any non-externally-visible declarations should be `static`.
- Casting away the `const` qualifier from pointers-to-const is
  dangerous. All but one instance of this are now correct. The one
  instance where we can't keep `const` is one where toxav code actually
  writes to a chunk of memory marked as `const`. This code also assumes
  4 byte alignment of data packets. I don't know whether that is a valid
  assumption, but it's likely unportable, and *not* obviously correct.
- Replaced empty parameter lists with `(void)` to avoid passing
  parameters to it. Empty parameter lists are old style declarations for
  unknown number and type of arguments.
- Commented out (as `#if DHT_HARDENING` block) the hardening code that
  was never executed.
- Minor style fix: don't use `default` in enum-switches unless the number
  of enumerators in the default case is very large. In this case, it was
  2, so we want to list them both explicitly to be warned about missing
  one if we add one in the future.
- Removed the only two function declarations from nTox.h and put them
  into nTox.c. They are not used outside and nTox is not a library.
2016-09-06 11:54:37 +01:00