summaryrefslogtreecommitdiff
path: root/toxcore/tox.c
AgeCommit message (Collapse)Author
2016-09-01Match parameter names in declarations with their definitions.iphydf
The parameter names were taken from function definitions to update the names in function declarations (prototypes).
2016-08-31Add braces to all if statements.iphydf
2016-08-30Add missing #includes to headers and rename tox_old to tox_group.iphydf
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-29Add getters/setters for options.iphydf
2016-08-28Expose constants as functions.iphydf
These functions simply return the constants. They are a stable ABI, so that if constants change, the ABI of these functions won't. Code solely relying on these functions will remain compatible with future values of those constants. The functions are currently not exposed in tox.h, because this is pending a change in apidsl to generate accessors for "const" values.
2016-08-27Move logging to a callback.iphydf
This removes the global logger (which by the way was deleted when the first tox was killed, so other toxes would then stop logging). Various bits of the code now carry a logger or pass it around. It's a bit less transparent now, but now there is no need to have a global logger, and clients can decide what to log and where.
2016-08-22Make Message received receipts statelessGregory Mullen (grayhatter)
2016-08-22Make Friend User Status statelessGregory Mullen (grayhatter)
2016-08-20Make the friend message callback statelessGregory Mullen (grayhatter)
2016-08-19Make Typing change callback statelessGregory Mullen (grayhatter)
Moved a few #defines to the top of the header for better readability
2016-08-18Make friend_status_message callback stateless.iphydf
See #40 for details.
2016-08-18Allow NULL as argument to tox_kill.iphydf
This behaviour is consistent with free() and operator delete.
2016-08-18Make tox_callback_friend_name stateless.iphydf
See #27 and #40 for details.
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.
2016-08-12Check code formatting on Travis.iphydf
We run astyle on Travis and check if there is a diff. The build terminates if git finds a difference.
2016-02-13added the dropped ;Gregory Mullen (GrayHatter)
2016-02-13update the compatablity function to match the macroGregory Mullen (GrayHatter)
2016-02-13Get SemVer more readyGregory Mullen (GrayHatter)
2016-01-27 fix: compare sensitive data with sodium_memcmpRoman Proskuryakov
fix: make increment_nonce & increment_nonce_number independent of user-controlled input fix: make crypto_core more stable agains null ptr dereference
2015-06-03Return error if file_id parameter is NULL.irungentoo
2015-05-30Return port error if tcp server failed to init.irungentoo
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-05-12Connect to own TCP server if hosting one.irungentoo
Removed useless code.
2015-05-11Fixes and changes to tox_bootstrap and tox_add_tcp_relay.irungentoo
Functionality of both no longer overlaps. If address has more than 1 ip, call the internal function on all of them.
2015-05-08Added basic TCP server hosting to tox.h api.irungentoo
TODO: tell friends we are hosting a relay and prioritize using relays hosted by friends over bootstrap ones.
2015-04-09tox_hash fix.irungentoo
2015-04-02API function to get last seen timestamp of friendJfreegman
also removed remnants of the no longer used variable ping_lastrecv
2015-03-25If length is 0, data should be ignored.Roman Pasichnyk
2015-03-21Renamed tox_file_send_control to tox_file_control.irungentoo
Renamed tox_file_send_seek to tox_file_seek.
2015-03-21Transfers with filelength == 0 now behave exactly like transfers of everyirungentoo
other size (except streaming of course).
2015-03-20Allow sending of file transfer requests with length 0 but don't allocateirungentoo
any file number for them in core. These can be used to tell friends we don't have an avatar set or to unset a set avatar.
2015-03-19callback_file_request_chunk -> callback_file_chunk_requestDubslow
A couple of minor reasons, combined warrant a PR imo: a) fileChunkRequested is a better signal name than fileRequestChunkReceived, and I don't want to break consistency by reordering words for just this signal b) "request chunk" is parsed by English speakers as a verb-object combination, implying sending the request, not receiving, whereas "chunk requested" is parsed (more correctly) as an adjective-noun combo (in particular, request is a noun not a verb), and thus reads far more like "hey heads up we just got a request" For instance some tests/testing code had some callbacks to *receive* chunk requests, and they were called "tox_file_request_chunk"... to receive a chunk, not request it. Now they're called "tox_file_chunk_request". So yeah...
2015-03-18Merge branch 'one_more_rename' of https://github.com/dubslow/toxcore into ↵irungentoo
new_api
2015-03-18Removed TOX_USER_STATUS_INVALID.irungentoo
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-18Api changes.irungentoo
receive to recv in file receive functions. Added TOX_MAX_FILENAME_LENGTH define.
2015-03-17Renamed SEND_FAILED to SENDQ.irungentoo
2015-03-17Save function renamed to tox_get_savedata()irungentoo
2015-03-17Make sure some defines in the public api are always correct.irungentoo
Make sure some assumptions are always correct.
2015-03-17Changed INVALID_LENGTH to TOO_LONG.irungentoo
2015-03-17Added tox_file_send_seek() function to api.irungentoo
This function can be used to seek an incoming file tranfer right before accepting it. It is meant to be used to resume incomplete file tranfers by clients.
2015-03-17Allow file names to be of length 0.irungentoo
Pointer in callback will be NULL if length is 0.
2015-03-17Added and implemented file_id parameter to file tranfers.irungentoo
file_id is a 32byte identifier that can be used by users to identify file tranfers across core/client restarts in order to resume broken file tranfers. In avatar tranfers it corresponds to the hash of the avatar. Added tox_file_get_file_id() function to api to obtain the file_id of an ongoing file transfer. If not set, core will generate a random one.
2015-03-16New API fixups.iphydf
2015-03-15Merge branch 'new_api_patch' of https://github.com/Impyy/toxcore into new_apiirungentoo
2015-03-15Avatar hash is now the filename of the file transfer instead of theirungentoo
first 32 bytes. Enforce length of filename in core when transfer is an avatar type transfer to make things more safe.
2015-03-15Initialize Tox_Options with default values in tox_options_newImpyy
2015-03-13Merge branch 'newer_api' of https://github.com/dubslow/toxcore into new_apiirungentoo
2015-03-13revert to TOX_FILE_KINDDubslow