summaryrefslogtreecommitdiff
path: root/testing/tox_shell.c
AgeCommit message (Collapse)Author
2016-09-30Remove return after no-return situation (and other cleanups).iphydf
Cleanups: - Fix header guards to not use reserved names. - Avoid name shadowing. - Removed an unused variable found by avoiding name shadowing.
2016-09-24Make toxcore code C++ compatible.iphydf
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-10make the majority of the callbacks stateless and add some status to a testcasemichael bishop
2016-09-06Improve static and const correctness.iphydf
- 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-01Sort #includes in all source files.iphydf
2016-08-31Add braces to all if statements.iphydf
2016-08-20Make the friend message callback statelessGregory Mullen (grayhatter)
2016-08-18Fix some compiler warnings.iphydf
2016-08-17Make self_connection_status callback stateless.iphydf
**What are we doing?** We are moving towards stateless callbacks. This means that when registering a callback, you no longer pass a user data pointer. Instead, you pass a user data pointer to tox_iterate. This pointer is threaded through the code, passed to each callback. The callback can modify the data pointed at. An extra indirection will be needed if the pointer itself can change. **Why?** Currently, callbacks are registered with a user data pointer. This means the library has N pointers for N different callbacks. These pointers need to be managed by the client code. Managing the lifetime of the pointee can be difficult. In C++, it takes special effort to ensure that the lifetime of user data extends at least beyond the lifetime of the Tox instance. For other languages, the situation is much worse. Java and other garbage collected languages may move objects in memory, so the pointers are not stable. Tox4j goes through a lot of effort to make the Java/Scala user experience a pleasant one by keeping a global array of Tox+userdata on the C++ side, and communicating via protobufs. A Haskell FFI would have to do similarly complex tricks. Stateless callbacks ensure that a user data pointer only needs to live during a single function call. This means that the user code (or language runtime) can move the data around at will, as long as it sets the new location in the callback. **How?** We are doing this change one callback at a time. After each callback, we ensure that everything still works as expected. This means the toxcore change will require 15 Pull Requests.
2015-08-08Fix for DragonFlyBSDMichael Neumann
2015-05-22Move savedata to options struct.irungentoo
Add a way to select the type of savedata (normal savedata, load a secret key, potentially others?) to load.
2015-03-18Renamed TOX_MESSAGE_TYPE_MESSAGE to TOX_MESSAGE_TYPE_NORMAL.irungentoo
2015-03-18Merge branch 'one_more_rename' of https://github.com/dubslow/toxcore into ↵irungentoo
new_api
2015-03-18Merged normal message function and send action function into oneirungentoo
messaging function. This removes code duplication and allows us to easily add new message types to the api without having to add new functions.
2015-03-18Move get_connection_status to self pseudonamespace, to contrast ↵Dubslow
friend_get_connection_status
2015-03-12Convert core code depending on the apiDubslow
2015-03-09Fixed small issue.irungentoo
2015-02-24Ported some of the code in testing/ to the new api.irungentoo
2014-08-23Added FreeBSD includeMaxim Biro
2014-08-20Daily OS X fix.stal
Patch also fixes NetBSD and OpenBSD, but I can't test that. <pty.h> is <util.h> on some BSDs.
2014-08-19Added tox_shell to testing.irungentoo
tox_shell is a basic secure shell that can be used to control a computer from any Tox client. Just run tox_shell and make it add your Tox id. It's very basic but it works.