| lo.h | | lo.h | |
| | | | |
| skipping to change at line 33 | | skipping to change at line 33 | |
| | | | |
| /** | | /** | |
| * \file lo.h The liblo main headerfile and high-level API functions. | | * \file lo.h The liblo main headerfile and high-level API functions. | |
| */ | | */ | |
| | | | |
| #include "lo/lo_endian.h" | | #include "lo/lo_endian.h" | |
| #include "lo/lo_types.h" | | #include "lo/lo_types.h" | |
| #include "lo/lo_osc_types.h" | | #include "lo/lo_osc_types.h" | |
| #include "lo/lo_errors.h" | | #include "lo/lo_errors.h" | |
| #include "lo/lo_lowlevel.h" | | #include "lo/lo_lowlevel.h" | |
|
| | | #if 1 | |
| | | #include "lo/lo_serverthread.h" | |
| | | #endif | |
| | | | |
| /** | | /** | |
| * \defgroup liblo High-level OSC API | | * \defgroup liblo High-level OSC API | |
| * | | * | |
| * Defines the high-level API functions necessary to implement OSC support. | | * Defines the high-level API functions necessary to implement OSC support. | |
| * Should be adequate for most applications, but if you require lower level | | * Should be adequate for most applications, but if you require lower level | |
| * control you can use the functions defined in lo_lowlevel.h | | * control you can use the functions defined in lo_lowlevel.h | |
| * @{ | | * @{ | |
| */ | | */ | |
| | | | |
| | | | |
| skipping to change at line 188 | | skipping to change at line 191 | |
| */ | | */ | |
| int lo_address_errno(lo_address a); | | int lo_address_errno(lo_address a); | |
| | | | |
| /** | | /** | |
| * \brief Return the error string from the last failed lo_send() or | | * \brief Return the error string from the last failed lo_send() or | |
| * lo_address_new() call | | * lo_address_new() call | |
| */ | | */ | |
| const char *lo_address_errstr(lo_address a); | | const char *lo_address_errstr(lo_address a); | |
| | | | |
| /** | | /** | |
|
| * \brief Create a new server thread to handle incoming OSC | | | |
| * messages. | | | |
| * | | | |
| * Server threads take care of the message reception and dispatch by | | | |
| * transparently creating a system thread to handle incoming messages. | | | |
| * Use this if you do not want to handle the threading yourself. | | | |
| * | | | |
| * \param port If NULL is passed then an unused port will be chosen by the | | | |
| * system, its number may be retrieved with lo_server_thread_get_port() | | | |
| * so it can be passed to clients. Otherwise a decimal port number, service | | | |
| * name or UNIX domain socket path may be passed. | | | |
| * \param err_h A function that will be called in the event of an error bei | | | |
| ng | | | |
| * raised. The function prototype is defined in lo_types.h | | | |
| */ | | | |
| lo_server_thread lo_server_thread_new(const char *port, lo_err_handler err_ | | | |
| h); | | | |
| | | | |
| /** | | | |
| * \brief Create a new server thread to handle incoming OSC | | | |
| * messages, and join a UDP multicast group. | | | |
| * | | | |
| * Server threads take care of the message reception and dispatch by | | | |
| * transparently creating a system thread to handle incoming messages. | | | |
| * Use this if you do not want to handle the threading yourself. | | | |
| * | | | |
| * \param group The multicast group to join. See documentation on IP | | | |
| * multicast for the acceptable address range; e.g., http://tldp.org/HOWTO/ | | | |
| Multicast-HOWTO-2.html | | | |
| * \param port If NULL is passed then an unused port will be chosen by the | | | |
| * system, its number may be retrieved with lo_server_thread_get_port() | | | |
| * so it can be passed to clients. Otherwise a decimal port number, service | | | |
| * name or UNIX domain socket path may be passed. | | | |
| * \param err_h A function that will be called in the event of an error bei | | | |
| ng | | | |
| * raised. The function prototype is defined in lo_types.h | | | |
| */ | | | |
| lo_server_thread lo_server_thread_new_multicast(const char *group, const ch | | | |
| ar *port, | | | |
| lo_err_handler err_h); | | | |
| | | | |
| /** | | | |
| * \brief Create a new server thread to handle incoming OSC | | | |
| * messages, specifying protocol. | | | |
| * | | | |
| * Server threads take care of the message reception and dispatch by | | | |
| * transparently creating a system thread to handle incoming messages. | | | |
| * Use this if you do not want to handle the threading yourself. | | | |
| * | | | |
| * \param port If NULL is passed then an unused port will be chosen by the | | | |
| * system, its number may be retrieved with lo_server_thread_get_port() | | | |
| * so it can be passed to clients. Otherwise a decimal port number, service | | | |
| * name or UNIX domain socket path may be passed. | | | |
| * \param proto The protocol to use, should be one of LO_UDP, LO_TCP or LO_ | | | |
| UNIX. | | | |
| * \param err_h A function that will be called in the event of an error bei | | | |
| ng | | | |
| * raised. The function prototype is defined in lo_types.h | | | |
| */ | | | |
| lo_server_thread lo_server_thread_new_with_proto(const char *port, int prot | | | |
| o, | | | |
| lo_err_handler err_h); | | | |
| | | | |
| /** | | | |
| * \brief Free memory taken by a server thread | | | |
| * | | | |
| * Frees the memory, and, if currently running will stop the associated thr | | | |
| ead. | | | |
| */ | | | |
| void lo_server_thread_free(lo_server_thread st); | | | |
| | | | |
| /** | | | |
| * \brief Add an OSC method to the specifed server thread. | | | |
| * | | | |
| * \param st The server thread the method is to be added to. | | | |
| * \param path The OSC path to register the method to. If NULL is passed th | | | |
| e | | | |
| * method will match all paths. | | | |
| * \param typespec The typespec the method accepts. Incoming messages with | | | |
| * similar typespecs (e.g. ones with numerical types in the same position) | | | |
| will | | | |
| * be coerced to the typespec given here. | | | |
| * \param h The method handler callback function that will be called it a | | | |
| * matching message is received | | | |
| * \param user_data A value that will be passed to the callback function, h | | | |
| , | | | |
| * when its invoked matching from this method. | | | |
| */ | | | |
| lo_method lo_server_thread_add_method(lo_server_thread st, const char *path | | | |
| , | | | |
| const char *typespec, lo_method_handler h, | | | |
| void *user_data); | | | |
| /** | | | |
| * \brief Delete an OSC method from the specifed server thread. | | | |
| * | | | |
| * \param st The server thread the method is to be removed from. | | | |
| * \param path The OSC path of the method to delete. If NULL is passed the | | | |
| * method will match the generic handler. | | | |
| * \param typespec The typespec the method accepts. | | | |
| */ | | | |
| void lo_server_thread_del_method(lo_server_thread st, const char *path, | | | |
| const char *typespec); | | | |
| | | | |
| /** | | | |
| * \brief Start the server thread | | | |
| * | | | |
| * \param st the server thread to start. | | | |
| * \return Less than 0 on failure, 0 on success. | | | |
| */ | | | |
| int lo_server_thread_start(lo_server_thread st); | | | |
| | | | |
| /** | | | |
| * \brief Stop the server thread | | | |
| * | | | |
| * \param st the server thread to start. | | | |
| * \return Less than 0 on failure, 0 on success. | | | |
| */ | | | |
| int lo_server_thread_stop(lo_server_thread st); | | | |
| | | | |
| /** | | | |
| * \brief Return the port number that the server thread has bound to. | | | |
| */ | | | |
| int lo_server_thread_get_port(lo_server_thread st); | | | |
| | | | |
| /** | | | |
| * \brief Return a URL describing the address of the server thread. | | | |
| * | | | |
| * Return value must be free()'d to reclaim memory. | | | |
| */ | | | |
| char *lo_server_thread_get_url(lo_server_thread st); | | | |
| | | | |
| /** | | | |
| * \brief Return the lo_server for a lo_server_thread | | | |
| * | | | |
| * This function is useful for passing a thread's lo_server | | | |
| * to lo_send_from(). | | | |
| */ | | | |
| lo_server lo_server_thread_get_server(lo_server_thread st); | | | |
| | | | |
| /** \brief Return true if there are scheduled events (eg. from bundles) wai | | | |
| ting | | | |
| * to be dispatched by the thread */ | | | |
| int lo_server_thread_events_pending(lo_server_thread st); | | | |
| | | | |
| /** | | | |
| * \brief Create a new OSC blob type. | | * \brief Create a new OSC blob type. | |
| * | | * | |
| * \param size The amount of space to allocate in the blob structure. | | * \param size The amount of space to allocate in the blob structure. | |
| * \param data The data that will be used to initialise the blob, should be | | * \param data The data that will be used to initialise the blob, should be | |
| * size bytes long. | | * size bytes long. | |
| */ | | */ | |
| lo_blob lo_blob_new(int32_t size, const void *data); | | lo_blob lo_blob_new(int32_t size, const void *data); | |
| | | | |
| /** | | /** | |
| * \brief Free the memory taken by a blob | | * \brief Free the memory taken by a blob | |
| | | | |
End of changes. 2 change blocks. |
| 145 lines changed or deleted | | 3 lines changed or added | |
|
| lo_lowlevel.h | | lo_lowlevel.h | |
| | | | |
| skipping to change at line 32 | | skipping to change at line 32 | |
| /** | | /** | |
| * \file lo_lowlevel.h The liblo headerfile defining the low-level API | | * \file lo_lowlevel.h The liblo headerfile defining the low-level API | |
| * functions. | | * functions. | |
| */ | | */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| #include <stdarg.h> | | #include <stdarg.h> | |
|
| | | #include <sys/types.h> | |
| #ifdef _MSC_VER | | #ifdef _MSC_VER | |
| #define ssize_t SSIZE_T | | #define ssize_t SSIZE_T | |
| #define uint32_t unsigned __int32 | | #define uint32_t unsigned __int32 | |
| #else | | #else | |
| #include <stdint.h> | | #include <stdint.h> | |
| #endif | | #endif | |
| | | | |
| #include "lo/lo_types.h" | | #include "lo/lo_types.h" | |
| #include "lo/lo_errors.h" | | #include "lo/lo_errors.h" | |
| | | | |
| | | | |
| skipping to change at line 109 | | skipping to change at line 110 | |
| * \param b The bundle itself | | * \param b The bundle itself | |
| */ | | */ | |
| int lo_send_bundle_from(lo_address targ, lo_server serv, lo_bundle b); | | int lo_send_bundle_from(lo_address targ, lo_server serv, lo_bundle b); | |
| | | | |
| /** | | /** | |
| * \brief Create a new lo_message object | | * \brief Create a new lo_message object | |
| */ | | */ | |
| lo_message lo_message_new(); | | lo_message lo_message_new(); | |
| | | | |
| /** | | /** | |
|
| | | * \brief Add one to a message's reference count. | |
| | | * | |
| | | * Messages are reference counted. If a message is multiply referenced, | |
| | | * the message's counter should be incremented. It is automatically | |
| | | * decremented by lo_message_free lo_message_free_recursive, with | |
| | | * lo_message_free_recursive being the preferable method. | |
| | | */ | |
| | | void lo_message_incref(lo_message m); | |
| | | | |
| | | /** | |
| | | * \brief Create a new lo_message object by cloning an already existing one | |
| | | */ | |
| | | lo_message lo_message_clone(lo_message m); | |
| | | | |
| | | /** | |
| * \brief Free memory allocated by lo_message_new() and any subsequent | | * \brief Free memory allocated by lo_message_new() and any subsequent | |
| * \ref lo_message_add_int32 lo_message_add*() calls. | | * \ref lo_message_add_int32 lo_message_add*() calls. | |
| */ | | */ | |
| void lo_message_free(lo_message m); | | void lo_message_free(lo_message m); | |
| | | | |
| /** | | /** | |
| * \brief Append a number of arguments to a message. | | * \brief Append a number of arguments to a message. | |
| * | | * | |
| * The data will be added in OSC byteorder (bigendian). | | * The data will be added in OSC byteorder (bigendian). | |
| * | | * | |
| | | | |
| skipping to change at line 417 | | skipping to change at line 433 | |
| | | | |
| /** | | /** | |
| * \brief Get the Time-to-Live value for a given target address. | | * \brief Get the Time-to-Live value for a given target address. | |
| * | | * | |
| * \param t An OSC address. | | * \param t An OSC address. | |
| * \return An integer specifying the scope of a multicast UDP message. | | * \return An integer specifying the scope of a multicast UDP message. | |
| */ | | */ | |
| int lo_address_get_ttl(lo_address t); | | int lo_address_get_ttl(lo_address t); | |
| | | | |
| /** | | /** | |
|
| | | * \brief Set the network interface to use for a given target address. | |
| | | * | |
| | | * The caller should specify either the iface or ip variable. The IP, | |
| | | * if specified, should match the same network family as the OSC | |
| | | * address. (That is, should correctly correspond to IPv4 or IPv6.) | |
| | | * Typically the assigned network interface will only be used in the | |
| | | * case of sending multicast messages. It is recommended to use the | |
| | | * if_nameindex POSIX function to get a list of network interface | |
| | | * names. | |
| | | * | |
| | | * \param t An OSC address. | |
| | | * \param iface The name of a network interface on the local system. | |
| | | * \param ip The IP address of a network interface on the local system. | |
| | | * \return 0 if the interface was successfully identified, or non-zero | |
| | | * otherwise. | |
| | | */ | |
| | | int lo_address_set_iface(lo_address t, const char *iface, const char *ip); | |
| | | | |
| | | /** | |
| | | * \brief Get the name of the network interface assigned to an OSC address | |
| | | . | |
| | | * | |
| | | * \param t An OSC address. | |
| | | * \return A string pointer or 0 if no interface has been assigned. | |
| | | * Caller should not modify the provided string. It is a | |
| | | * legal pointer until the next call to lo_address_set_iface | |
| | | * or lo_address_free. | |
| | | */ | |
| | | const char* lo_address_get_iface(lo_address t); | |
| | | | |
| | | /** | |
| | | * \brief Set the TCP_NODELAY flag on outgoing TCP connections. | |
| | | * \param t The address to set this flag for. | |
| | | * \param enable Non-zero to set the flag, zero to unset it. | |
| | | * \return the previous value of this flag. | |
| | | */ | |
| | | int lo_address_set_tcp_nodelay(lo_address t, int enable); | |
| | | | |
| | | /** | |
| | | * \brief Set outgoing stream connections (e.g., TCP) to be | |
| | | * transmitted using the SLIP packetizing protocol. | |
| | | * \param t The address to set this flag for. | |
| | | * \param enable Non-zero to set the flag, zero to unset it. | |
| | | * \return the previous value of this flag. | |
| | | */ | |
| | | int lo_address_set_stream_slip(lo_address t, int enable); | |
| | | | |
| | | /** | |
| * \brief Create a new bundle object. | | * \brief Create a new bundle object. | |
| * | | * | |
| * OSC Bundles encapsulate one or more OSC messages and may include a times
tamp | | * OSC Bundles encapsulate one or more OSC messages and may include a times
tamp | |
| * indicating when the bundle should be dispatched. | | * indicating when the bundle should be dispatched. | |
| * | | * | |
| * \param tt The timestamp when the bundle should be handled by the receive
r. | | * \param tt The timestamp when the bundle should be handled by the receive
r. | |
| * Pass LO_TT_IMMEDIATE if you want the receiving server to dispa
tch | | * Pass LO_TT_IMMEDIATE if you want the receiving server to dispa
tch | |
| * the bundle as soon as it receives it. | | * the bundle as soon as it receives it. | |
| */ | | */ | |
| lo_bundle lo_bundle_new(lo_timetag tt); | | lo_bundle lo_bundle_new(lo_timetag tt); | |
| | | | |
| /** | | /** | |
|
| | | * \brief Add one to a bundle's reference count. | |
| | | * | |
| | | * Bundles are reference counted. If a bundle is multiply referenced, | |
| | | * the bundle's counter should be incremented. It is automatically | |
| | | * decremented by lo_bundle_free lo_bundle_free_recursive, with | |
| | | * lo_bundle_free_recursive being the preferable method. | |
| | | */ | |
| | | void lo_bundle_incref(lo_bundle b); | |
| | | | |
| | | /** | |
| * \brief Adds an OSC message to an existing bundle. | | * \brief Adds an OSC message to an existing bundle. | |
| * | | * | |
| * The message passed is appended to the list of messages in the bundle to
be | | * The message passed is appended to the list of messages in the bundle to
be | |
| * dispatched to 'path'. | | * dispatched to 'path'. | |
| * | | * | |
| * \return 0 if successful, less than 0 otherwise. | | * \return 0 if successful, less than 0 otherwise. | |
| */ | | */ | |
| int lo_bundle_add_message(lo_bundle b, const char *path, lo_message m); | | int lo_bundle_add_message(lo_bundle b, const char *path, lo_message m); | |
| | | | |
| /** | | /** | |
|
| | | * \brief Adds an OSC bundle to an existing bundle. | |
| | | * | |
| | | * The child bundle passed is appended to the list of child bundles|message | |
| | | s in the parent bundle to be | |
| | | * dispatched. | |
| | | * | |
| | | * \return 0 if successful, less than 0 otherwise. | |
| | | */ | |
| | | int lo_bundle_add_bundle(lo_bundle b, lo_bundle n); | |
| | | | |
| | | /** | |
| * \brief Return the length of a bundle in bytes. | | * \brief Return the length of a bundle in bytes. | |
| * | | * | |
| * Includes the marker and typetage length. | | * Includes the marker and typetage length. | |
| * | | * | |
| * \param b The bundle to be sized | | * \param b The bundle to be sized | |
| */ | | */ | |
| size_t lo_bundle_length(lo_bundle b); | | size_t lo_bundle_length(lo_bundle b); | |
| | | | |
| /** | | /** | |
|
| | | * \brief Return the number of top-level elements in a bundle. | |
| | | * | |
| | | * \param b The bundle to be counted. | |
| | | */ | |
| | | unsigned int lo_bundle_count(lo_bundle b); | |
| | | | |
| | | /** | |
| | | * \brief Gets the element type contained within a bundle. | |
| | | * | |
| | | * Returns a lo_element_type at a given index within a bundle. | |
| | | | |
| | | * \return The requested lo_element_type if successful, otherwise 0. | |
| | | */ | |
| | | lo_element_type lo_bundle_get_type(lo_bundle b, int index); | |
| | | | |
| | | /** | |
| | | * \brief Gets a nested bundle contained within a bundle. | |
| | | * | |
| | | * Returns a lo_bundle at a given index within a bundle. | |
| | | * | |
| | | * \return The requested lo_bundle if successful, otherwise 0. | |
| | | */ | |
| | | lo_bundle lo_bundle_get_bundle(lo_bundle b, int index); | |
| | | | |
| | | /** | |
| | | * \brief Gets a message contained within a bundle. | |
| | | * | |
| | | * Returns a lo_message at a given index within a bundle, and | |
| | | * optionally the path associated with that message. | |
| | | * | |
| | | * \return The requested lo_message if successful, otherwise 0. | |
| | | */ | |
| | | lo_message lo_bundle_get_message(lo_bundle b, int index, | |
| | | const char **path); | |
| | | | |
| | | /** | |
| * \brief Serialise the bundle object to an area of memory and return a | | * \brief Serialise the bundle object to an area of memory and return a | |
| * pointer to the serialised form. | | * pointer to the serialised form. | |
| * | | * | |
| * \param b The bundle to be serialised | | * \param b The bundle to be serialised | |
| * \param to The address to serialise to, memory will be allocated if to is | | * \param to The address to serialise to, memory will be allocated if to is | |
| * NULL. | | * NULL. | |
| * \param size If this pointer is non-NULL the size of the memory area | | * \param size If this pointer is non-NULL the size of the memory area | |
| * will be written here | | * will be written here | |
| * | | * | |
| * The returned form is suitable to be sent over a low level OSC transport, | | * The returned form is suitable to be sent over a low level OSC transport, | |
| | | | |
| skipping to change at line 470 | | skipping to change at line 589 | |
| void *lo_bundle_serialise(lo_bundle b, void *to, size_t *size); | | void *lo_bundle_serialise(lo_bundle b, void *to, size_t *size); | |
| | | | |
| /** | | /** | |
| * \brief Frees the memory taken by a bundle object. | | * \brief Frees the memory taken by a bundle object. | |
| * | | * | |
| * \param b The bundle to be freed. | | * \param b The bundle to be freed. | |
| */ | | */ | |
| void lo_bundle_free(lo_bundle b); | | void lo_bundle_free(lo_bundle b); | |
| | | | |
| /** | | /** | |
|
| * \brief Frees the memory taken by a bundle object and messages in the bu | | * \brief Frees the memory taken by a bundle object and its messages and n | |
| ndle. | | ested bundles recursively. | |
| | | * | |
| | | * \param b The bundle, which may contain messages and nested bundles, to b | |
| | | e freed. | |
| | | */ | |
| | | void lo_bundle_free_recursive(lo_bundle b); | |
| | | | |
| | | /** | |
| | | * \brief Obsolete, use lo_bundle_free_recursive instead. | |
| * | | * | |
|
| * \param b The bundle, which may contain messages, to be freed. | | * \param b The bundle, which may contain messages and nested bundles, to b
e freed. | |
| */ | | */ | |
| void lo_bundle_free_messages(lo_bundle b); | | void lo_bundle_free_messages(lo_bundle b); | |
| | | | |
| /** | | /** | |
| * \brief Return true if the type specified has a numerical value, such as | | * \brief Return true if the type specified has a numerical value, such as | |
| * LO_INT32, LO_FLOAT etc. | | * LO_INT32, LO_FLOAT etc. | |
| * | | * | |
| * \param a The type to be tested. | | * \param a The type to be tested. | |
| */ | | */ | |
| int lo_is_numerical_type(lo_type a); | | int lo_is_numerical_type(lo_type a); | |
| | | | |
| skipping to change at line 569 | | skipping to change at line 695 | |
| * Otherwise a decimal port number or service name or may be passed. | | * Otherwise a decimal port number or service name or may be passed. | |
| * If using UNIX domain sockets then a socket path should be passed here. | | * If using UNIX domain sockets then a socket path should be passed here. | |
| * \param err_h An error callback function that will be called if there is
an | | * \param err_h An error callback function that will be called if there is
an | |
| * error in messge reception or server creation. Pass NULL if you do not wa
nt | | * error in messge reception or server creation. Pass NULL if you do not wa
nt | |
| * error handling. | | * error handling. | |
| */ | | */ | |
| lo_server lo_server_new_multicast(const char *group, const char *port, | | lo_server lo_server_new_multicast(const char *group, const char *port, | |
| lo_err_handler err_h); | | lo_err_handler err_h); | |
| | | | |
| /** | | /** | |
|
| | | * \brief Create a new server instance, and join a UDP multicast | |
| | | * group, optionally specifying which network interface to use. | |
| | | * Note that usually only one of iface or ip are specified. | |
| | | * | |
| | | * \param group The multicast group to join. See documentation on IP | |
| | | * multicast for the acceptable address range; e.g., http://tldp.org/HOWTO/ | |
| | | Multicast-HOWTO-2.html | |
| | | * \param port If using UDP then NULL may be passed to find an unused port. | |
| | | * Otherwise a decimal port number or service name or may be passed. | |
| | | * If using UNIX domain sockets then a socket path should be passed here. | |
| | | * \param iface A string specifying the name of a network interface to | |
| | | * use, or zero if not specified. | |
| | | * \param ip A string specifying the IP address of a network interface | |
| | | * to use, or zero if not specified. | |
| | | * \param err_h An error callback function that will be called if there is | |
| | | an | |
| | | * error in messge reception or server creation. Pass NULL if you do not wa | |
| | | nt | |
| | | * error handling. | |
| | | */ | |
| | | lo_server lo_server_new_multicast_iface(const char *group, const char *port | |
| | | , | |
| | | const char *iface, const char *ip, | |
| | | lo_err_handler err_h); | |
| | | | |
| | | /** | |
| | | * \brief Create a new server instance, taking port and the optional | |
| | | * multicast group IP from an URL string. | |
| | | * | |
| | | * \param url The URL to specify the server parameters. | |
| | | * \param err_h An error callback function that will be called if there is | |
| | | an | |
| | | * error in messge reception or server creation. Pass NULL if you do not wa | |
| | | nt | |
| | | * error handling. | |
| | | * \return A new lo_server instance. | |
| | | */ | |
| | | lo_server lo_server_new_from_url(const char *url, | |
| | | lo_err_handler err_h); | |
| | | | |
| | | /** | |
| | | * \brief Enables or disables type coercion during message dispatch. | |
| | | * \param server The server to toggle this option for. | |
| | | * \param enable Non-zero to enable, or zero to disable type coercion. | |
| | | * \return The previous value of this option. | |
| | | */ | |
| | | int lo_server_enable_coercion(lo_server server, int enable); | |
| | | | |
| | | /** | |
| * \brief Free up memory used by the lo_server object | | * \brief Free up memory used by the lo_server object | |
| */ | | */ | |
| void lo_server_free(lo_server s); | | void lo_server_free(lo_server s); | |
| | | | |
| /** | | /** | |
| * \brief Wait for an OSC message to be received | | * \brief Wait for an OSC message to be received | |
| * | | * | |
| * \param s The server to wait for connections on. | | * \param s The server to wait for connections on. | |
| * \param timeout A timeout in milliseconds to wait for the incoming packet
. | | * \param timeout A timeout in milliseconds to wait for the incoming packet
. | |
| * a value of 0 will return immediately. | | * a value of 0 will return immediately. | |
| | | | |
| skipping to change at line 637 | | skipping to change at line 806 | |
| * | | * | |
| * \param s The server the method is to be removed from. | | * \param s The server the method is to be removed from. | |
| * \param path The OSC path of the method to delete. If NULL is passed the | | * \param path The OSC path of the method to delete. If NULL is passed the | |
| * method will match the generic handler. | | * method will match the generic handler. | |
| * \param typespec The typespec the method accepts. | | * \param typespec The typespec the method accepts. | |
| */ | | */ | |
| void lo_server_del_method(lo_server s, const char *path, | | void lo_server_del_method(lo_server s, const char *path, | |
| const char *typespec); | | const char *typespec); | |
| | | | |
| /** | | /** | |
|
| | | * \brief Add bundle notification handlers to the specified server. | |
| | | * | |
| | | * \param s The server the method is to be added to. | |
| | | * \param sh The callback function that will be called before the messages | |
| | | * of a bundle are dispatched | |
| | | * \param eh The callback function that will be called after the messages | |
| | | * of a bundle are dispatched | |
| | | * \param user_data A value that will be passed to the user_data parameter | |
| | | * of both callback functions. | |
| | | */ | |
| | | int lo_server_add_bundle_handlers(lo_server s, | |
| | | lo_bundle_start_handler sh, | |
| | | lo_bundle_end_handler eh, | |
| | | void *user_data); | |
| | | | |
| | | /** | |
| * \brief Return the file descriptor of the server socket. | | * \brief Return the file descriptor of the server socket. | |
| * | | * | |
| * If the server protocol supports exposing the server's underlying | | * If the server protocol supports exposing the server's underlying | |
| * receive mechanism for monitoring with select() or poll(), this function | | * receive mechanism for monitoring with select() or poll(), this function | |
| * returns the file descriptor needed, otherwise, it returns -1. | | * returns the file descriptor needed, otherwise, it returns -1. | |
| * | | * | |
| * WARNING: when using this function beware that not all OSC packets that a
re | | * WARNING: when using this function beware that not all OSC packets that a
re | |
| * received are dispatched immediately. lo_server_events_pending() and | | * received are dispatched immediately. lo_server_events_pending() and | |
| * lo_server_next_event_delay() can be used to tell if there are pending | | * lo_server_next_event_delay() can be used to tell if there are pending | |
| * events and how long before you should attempt to receive them. | | * events and how long before you should attempt to receive them. | |
| | | | |
| skipping to change at line 673 | | skipping to change at line 858 | |
| int lo_server_get_protocol(lo_server s); | | int lo_server_get_protocol(lo_server s); | |
| | | | |
| /** | | /** | |
| * \brief Return an OSC URL that can be used to contact the server. | | * \brief Return an OSC URL that can be used to contact the server. | |
| * | | * | |
| * The return value should be free()'d when it is no longer needed. | | * The return value should be free()'d when it is no longer needed. | |
| */ | | */ | |
| char *lo_server_get_url(lo_server s); | | char *lo_server_get_url(lo_server s); | |
| | | | |
| /** | | /** | |
|
| | | * \brief Toggle event queue. | |
| | | * If queueing is enabled, timetagged messages that are sent in | |
| | | * advance of the current time will be put on an internal queue, and | |
| | | * they will be dispatched at the indicated time. By default, | |
| | | * queueing is enabled. Use this function to disable it, if it is | |
| | | * desired to have a server process messages immediately. In that | |
| | | * case, use lo_message_get_timestamp() to get the message timestamp | |
| | | * from within a method handler. | |
| | | * \param s A liblo server | |
| | | * \param queue_enabled Zero to disable queue, non-zero to enable. | |
| | | * \param dispatch_remaining If non-zero, previously queued messages | |
| | | * will be immediately dispatched when queue | |
| | | * is disabled. | |
| | | * \return The previous state of queue behaviour. Zero if queueing | |
| | | * was previously disabled, non-zero otherwise. | |
| | | */ | |
| | | int lo_server_enable_queue(lo_server s, int queue_enabled, | |
| | | int dispatch_remaining); | |
| | | | |
| | | /** | |
| * \brief Return true if there are scheduled events (eg. from bundles) | | * \brief Return true if there are scheduled events (eg. from bundles) | |
| * waiting to be dispatched by the server | | * waiting to be dispatched by the server | |
| */ | | */ | |
| int lo_server_events_pending(lo_server s); | | int lo_server_events_pending(lo_server s); | |
| | | | |
| /** | | /** | |
| * \brief Return the time in seconds until the next scheduled event. | | * \brief Return the time in seconds until the next scheduled event. | |
| * | | * | |
| * If the delay is greater than 100 seconds then it will return 100.0. | | * If the delay is greater than 100 seconds then it will return 100.0. | |
| */ | | */ | |
| | | | |
| skipping to change at line 848 | | skipping to change at line 1053 | |
| /** \brief Pretty-print a lo_server object. */ | | /** \brief Pretty-print a lo_server object. */ | |
| void lo_server_pp(lo_server s); | | void lo_server_pp(lo_server s); | |
| | | | |
| /** \brief Pretty-print a lo_method object. */ | | /** \brief Pretty-print a lo_method object. */ | |
| void lo_method_pp(lo_method m); | | void lo_method_pp(lo_method m); | |
| | | | |
| /** \brief Pretty-print a lo_method object, but prepend a given prefix | | /** \brief Pretty-print a lo_method object, but prepend a given prefix | |
| * to all field names. */ | | * to all field names. */ | |
| void lo_method_pp_prefix(lo_method m, const char *p); | | void lo_method_pp_prefix(lo_method m, const char *p); | |
| | | | |
|
| /** \brief Pretty-print a lo_server_thread object. */ | | | |
| void lo_server_thread_pp(lo_server_thread st); | | | |
| /** @} */ | | /** @} */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 12 change blocks. |
| 5 lines changed or deleted | | 217 lines changed or added | |
|
| lo_macros.h | | lo_macros.h | |
| | | | |
| skipping to change at line 39 | | skipping to change at line 39 | |
| | | | |
| /* \brief A set of macros to represent different communications transports | | /* \brief A set of macros to represent different communications transports | |
| */ | | */ | |
| #define LO_DEFAULT 0x0 | | #define LO_DEFAULT 0x0 | |
| #define LO_UDP 0x1 | | #define LO_UDP 0x1 | |
| #define LO_UNIX 0x2 | | #define LO_UNIX 0x2 | |
| #define LO_TCP 0x4 | | #define LO_TCP 0x4 | |
| | | | |
| /* an internal value, ignored in transmission but check against LO_MARKER i
n the | | /* an internal value, ignored in transmission but check against LO_MARKER i
n the | |
| * argument list. Used to do primitive bounds checking */ | | * argument list. Used to do primitive bounds checking */ | |
|
| #define LO_MARKER_A 0xdeadbeef | | #ifdef __LP64__ | |
| #define LO_MARKER_B 0xf00baa23 | | # define LO_MARKER_A (void *)0xdeadbeefdeadbeef | |
| | | # define LO_MARKER_B (void *)0xf00baa23f00baa23 | |
| | | #else /*__LP64__*/ | |
| | | # define LO_MARKER_A (void *)0xdeadbeef | |
| | | # define LO_MARKER_B (void *)0xf00baa23 | |
| | | #endif | |
| | | | |
| #define LO_ARGS_END LO_MARKER_A, LO_MARKER_B | | #define LO_ARGS_END LO_MARKER_A, LO_MARKER_B | |
| | | | |
| #define lo_message_add_varargs(msg, types, list) \ | | #define lo_message_add_varargs(msg, types, list) \ | |
| lo_message_add_varargs_internal(msg, types, list, __FILE__, __LINE__) | | lo_message_add_varargs_internal(msg, types, list, __FILE__, __LINE__) | |
| | | | |
|
| #ifdef __GNUC__ | | #ifdef _MSC_VER | |
| | | #ifndef USE_ANSI_C | |
| | | #define USE_ANSI_C | |
| | | #endif | |
| | | #endif | |
| | | | |
| | | #ifdef DLL_EXPORT | |
| | | #ifndef USE_ANSI_C | |
| | | #define USE_ANSI_C | |
| | | #endif | |
| | | #endif | |
| | | | |
| | | #ifdef USE_ANSI_C | |
| | | | |
| | | /* In non-GCC compilers, there is no support for variable-argument | |
| | | * macros, so provide "internal" vararg functions directly instead. */ | |
| | | | |
| | | int lo_message_add(lo_message msg, const char *types, ...); | |
| | | int lo_send(lo_address targ, const char *path, const char *types, ...); | |
| | | int lo_send_timestamped(lo_address targ, lo_timetag ts, const char *path, c | |
| | | onst char *types, ...); | |
| | | int lo_send_from(lo_address targ, lo_server from, lo_timetag ts, const char | |
| | | *path, const char *types, ...); | |
| | | | |
| | | #else // !USE_ANSI_C | |
| | | | |
| #define lo_message_add(msg, types...) \ | | #define lo_message_add(msg, types...) \ | |
| lo_message_add_internal(msg, __FILE__, __LINE__, types, \ | | lo_message_add_internal(msg, __FILE__, __LINE__, types, \ | |
| LO_MARKER_A, LO_MARKER_B) | | LO_MARKER_A, LO_MARKER_B) | |
| | | | |
| #define lo_send(targ, path, types...) \ | | #define lo_send(targ, path, types...) \ | |
| lo_send_internal(targ, __FILE__, __LINE__, path, types, \ | | lo_send_internal(targ, __FILE__, __LINE__, path, types, \ | |
| LO_MARKER_A, LO_MARKER_B) | | LO_MARKER_A, LO_MARKER_B) | |
| | | | |
| #define lo_send_timestamped(targ, ts, path, types...) \ | | #define lo_send_timestamped(targ, ts, path, types...) \ | |
| lo_send_timestamped_internal(targ, __FILE__, __LINE__, ts, path, \ | | lo_send_timestamped_internal(targ, __FILE__, __LINE__, ts, path, \ | |
| types, LO_MARKER_A, LO_MARKER_B) | | types, LO_MARKER_A, LO_MARKER_B) | |
| | | | |
| #define lo_send_from(targ, from, ts, path, types...) \ | | #define lo_send_from(targ, from, ts, path, types...) \ | |
| lo_send_from_internal(targ, from, __FILE__, __LINE__, ts, path, \ | | lo_send_from_internal(targ, from, __FILE__, __LINE__, ts, path, \ | |
| types, LO_MARKER_A, LO_MARKER_B) | | types, LO_MARKER_A, LO_MARKER_B) | |
| | | | |
|
| #else | | #endif // USE_ANSI_C | |
| | | | |
| /* In non-GCC compilers, there is no support for variable-argument | | | |
| * macros, so provide "internal" vararg functions directly instead. */ | | | |
| | | | |
| int lo_message_add(lo_message msg, const char *types, ...); | | | |
| int lo_send(lo_address targ, const char *path, const char *types, ...); | | | |
| int lo_send_timestamped(lo_address targ, lo_timetag ts, const char *path, c | | | |
| onst char *types, ...); | | | |
| int lo_send_from(lo_address targ, lo_server from, lo_timetag ts, const char | | | |
| *path, const char *types, ...); | | | |
| | | | |
| #endif | | | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 3 change blocks. |
| 16 lines changed or deleted | | 34 lines changed or added | |
|