Some demos use datafiles; let's allow these to easily work by
adding a callback-interface for loading tracks.
The callbacks are only present in player-mode, because tracks
aren't loaded from disk in client-mode.
Proper Amiga-suport is supplied by using the AmiTCP stack when
USE_AMITCP is enabled. Add explicit OpenLibrary/CloseLibrary
calls, for those people who don't link against auto-opening
libs ala VBCC's auto.s.
Add a typedef for uint32_t (needed for network communication)
for Motorola 68k platforms.
Also add a SAS/C support for the 'inline' keyword.
Thanks to Aske Simon Christensen for help with the SAS/C support.
While we're at it, make sure we always delete all the data before
trying to re-request. This we won't get out of sync on socket-error
at that particular location.
Previously some functions returned 1 and some returned -1 on
error. There were also two internal functions that returned 0
on error and 1 on 0 on success. Fix this, and make sure we
always return -1 on error and 0 on success.
There were a couple of places where malloc-failures (out-of-memory,
really) weren't caught. This isn't a big deal on modern operating
systems, but is worth dealing with on low-end platforms.
Failures to add/delete keys should count as socket-errors, because
they cause the editor and client to become out of sync.
Previously, sync_track_path could either overflow it's 'temp'
buffer by one byte, or (even worse) end up not zero-terminating
it.
Correct the code by explicitly zero-terminating the result of
strncpy, and reducing the lenght-parameter to strncat.
Unify the interface for load_track_data() and request_track_data(),
as they essentially perform the same task, but for different
compile-time configurations.
sync_update is the only code-path that can end up calling any of the
callbacks, so there's no need to store it in the device.
This is a breaking change, so all users needs to update their code
accordingly.
The network code assumes that the client and server have the
same endianess. This isn't always the case, so let's change
it all to network byte-order.
This change is not backwards compatible, so old clients and
new editors (or vica verca) will not work together any more.