irungentoo/ProjectTox-Core — pull request #790 by nurupo (2014-03-08 02:49:39+00:00)
Title: Some tox_wait_* improvements

Previously `networking_wait_prepare()` needed to be called twice -- once to get length of the buffer to allocate and then one more to actually prepare the buffer, so I just made `networking_wait_data_size()` which returns the required size of the buffer and let `networking_wait_prepare()` handling only preparation step.
`networking_wait_data_size()` is a function instead of a define because `sizeof(select_info)` depends on size on int and more importantly -- memory alignment. Making a define would require putting the whole `select_info` struct in tox.h, which is kind of ugly.

Added some important comments, like the limit of `microseconds` variable.

Changed return values to be more consistent.

Added more timeout options.