| lo.h | | lo.h | |
| | | | |
| skipping to change at line 14 | | skipping to change at line 14 | |
| * This program is free software; you can redistribute it and/or modify | | * This program is free software; you can redistribute it and/or modify | |
| * it under the terms of the GNU General Public License as published by | | * it under the terms of the GNU General Public License as published by | |
| * the Free Software Foundation; either version 2 of the License, or | | * the Free Software Foundation; either version 2 of the License, or | |
| * (at your option) any later version. | | * (at your option) any later version. | |
| * | | * | |
| * This program is distributed in the hope that it will be useful, | | * This program is distributed in the hope that it will be useful, | |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| * GNU General Public License for more details. | | * GNU General Public License for more details. | |
| * | | * | |
|
| * $Id: lo.h,v 1.2 2004/10/17 22:44:17 theno23 Exp $ | | * $Id: lo.h,v 1.5 2004/11/19 23:07:18 theno23 Exp $ | |
| */ | | */ | |
| | | | |
| #ifndef LO_H | | #ifndef LO_H | |
| #define LO_H | | #define LO_H | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| /** | | /** | |
| | | | |
| skipping to change at line 83 | | skipping to change at line 83 | |
| * passed here must agree with the types specified in the type parameter. | | * passed here must agree with the types specified in the type parameter. | |
| * | | * | |
| * example:<br> | | * example:<br> | |
| * lo_send(t, "/foo/bar", "ff", 0.1f, 23.0f); | | * lo_send(t, "/foo/bar", "ff", 0.1f, 23.0f); | |
| * | | * | |
| * returns -1 on failure. | | * returns -1 on failure. | |
| */ | | */ | |
| int lo_send(lo_address targ, const char *path, const char *type, ...); | | int lo_send(lo_address targ, const char *path, const char *type, ...); | |
| | | | |
| /** | | /** | |
|
| | | * \brief Send a OSC formatted message to the address specified, scheduled | |
| | | to | |
| | | * be dispatch at some time in the future. | |
| | | * | |
| | | * \param targ The target OSC address | |
| | | * \param ts The OSC timetag timestamp at which the message will be process | |
| | | ed | |
| | | * \param path The OSC path the message will be delivered to | |
| | | * \param type The types of the data items in the message, types are define | |
| | | d in | |
| | | * lo_types_common.h | |
| | | * \param ... The data values to be transmitted. The types of the arguments | |
| | | * passed here must agree with the types specified in the type parameter. | |
| | | * | |
| | | * example:<br> | |
| | | * lo_timetag now;<br> | |
| | | * lo_timetag_now(&now);<br> | |
| | | * lo_send(t, now, "/foo/bar", "ff", 0.1f, 23.0f); | |
| | | * | |
| | | * on success returns the number of bytes sent, returns -1 on failure. | |
| | | */ | |
| | | int lo_send_timestamped(lo_address targ, lo_timetag ts, const char *path, | |
| | | const char *type, ...); | |
| | | | |
| | | /** | |
| * \brief Return the error number from the last failed lo_send or | | * \brief Return the error number from the last failed lo_send or | |
| * lo_address_new call | | * lo_address_new call | |
| */ | | */ | |
| 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); | |
| | | | |
| skipping to change at line 162 | | skipping to change at line 184 | |
| */ | | */ | |
| int lo_server_thread_get_port(lo_server_thread st); | | int lo_server_thread_get_port(lo_server_thread st); | |
| | | | |
| /** | | /** | |
| * \brief Return a URL describing the address of the server thread. | | * \brief Return a URL describing the address of the server thread. | |
| * | | * | |
| * Return value must be free()'d to reclaim memory. | | * Return value must be free()'d to reclaim memory. | |
| */ | | */ | |
| char *lo_server_thread_get_url(lo_server_thread st); | | char *lo_server_thread_get_url(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 ammount of space to allocate in the blob structure. | | * \param size The ammount 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, void *data); | | lo_blob lo_blob_new(int32_t size, void *data); | |
| | | | |
| /** | | /** | |
| | | | |
End of changes. 3 change blocks. |
| 1 lines changed or deleted | | 31 lines changed or added | |
|
| lo_lowlevel.h | | lo_lowlevel.h | |
| | | | |
| skipping to change at line 14 | | skipping to change at line 14 | |
| * This program is free software; you can redistribute it and/or modify | | * This program is free software; you can redistribute it and/or modify | |
| * it under the terms of the GNU General Public License as published by | | * it under the terms of the GNU General Public License as published by | |
| * the Free Software Foundation; either version 2 of the License, or | | * the Free Software Foundation; either version 2 of the License, or | |
| * (at your option) any later version. | | * (at your option) any later version. | |
| * | | * | |
| * This program is distributed in the hope that it will be useful, | | * This program is distributed in the hope that it will be useful, | |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| * GNU General Public License for more details. | | * GNU General Public License for more details. | |
| * | | * | |
|
| * $Id: lo_lowlevel.h,v 1.3 2004/10/17 11:31:52 theno23 Exp $ | | * $Id: lo_lowlevel.h,v 1.9 2004/11/19 23:07:18 theno23 Exp $ | |
| */ | | */ | |
| | | | |
| #ifndef LO_LOWLEVEL_H | | #ifndef LO_LOWLEVEL_H | |
| #define LO_LOWLEVEL_H | | #define LO_LOWLEVEL_H | |
| | | | |
| #include "lo/lo_osc_types.h" | | #include "lo/lo_osc_types.h" | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| skipping to change at line 56 | | skipping to change at line 56 | |
| /** | | /** | |
| * \brief send a lo_message object to target targ | | * \brief send a lo_message object to target targ | |
| * | | * | |
| * This is slightly more efficient than lo_send if you want to send a lot o
f | | * This is slightly more efficient than lo_send if you want to send a lot o
f | |
| * similar messages. The messages are constructed with the lo_message_new()
and | | * similar messages. The messages are constructed with the lo_message_new()
and | |
| * lo_message_add*() functions. | | * lo_message_add*() functions. | |
| */ | | */ | |
| int lo_send_message(lo_address targ, const char *path, lo_message msg); | | int lo_send_message(lo_address targ, const char *path, lo_message msg); | |
| | | | |
| /** | | /** | |
|
| | | * \brief send a lo_bundle object to address targ | |
| | | * | |
| | | * This is slightly more efficient than lo_send_bundled if you want to send | |
| | | a | |
| | | * lot of similar bundles. The bundles are constructed with the | |
| | | * lo_bundle_new() and lo_bundle_add_message() functions. | |
| | | */ | |
| | | int lo_send_bundle(lo_address targ, 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 Free memory allocated by lo_message_new and any subsequent | | * \brief Free memory allocated by lo_message_new and any subsequent | |
| * lo_message_add*() calls. | | * lo_message_add*() calls. | |
| */ | | */ | |
| void lo_message_free(lo_message m); | | void lo_message_free(lo_message m); | |
| | | | |
| | | | |
| skipping to change at line 157 | | skipping to change at line 166 | |
| | | | |
| /** | | /** | |
| * \brief Append a data item and typechar of the specified type to a messa
ge. | | * \brief Append a data item and typechar of the specified type to a messa
ge. | |
| * See lo_message_add_int32() for details. | | * See lo_message_add_int32() for details. | |
| */ | | */ | |
| void lo_message_add_infinitum(lo_message m); | | void lo_message_add_infinitum(lo_message m); | |
| | | | |
| /** | | /** | |
| * \brief Return the length of a message in bytes. | | * \brief Return the length of a message in bytes. | |
| * | | * | |
|
| * \param m The mesaage to be serialised | | * \param m The message to be sized | |
| * \param path The path the message will be sent to | | * \param path The path the message will be sent to | |
| */ | | */ | |
| size_t lo_message_length(lo_message m, const char *path); | | size_t lo_message_length(lo_message m, const char *path); | |
| | | | |
| /** | | /** | |
| * \brief Serialise the message object to an area of memory and return a | | * \brief Serialise the message object to an area of memory and return a | |
| * pointer to the serialised form. | | * pointer to the serialised form. | |
| * | | * | |
| * \param m The mesaage to be serialised | | * \param m The mesaage to be serialised | |
| * \param path The path the message will be sent to | | * \param path The path the message will be sent to | |
|
| | | * \param to The address to serialise to, memory will be allocated if to is | |
| | | * 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, | |
| * having the correct endianess and bit-packed structure. | | * having the correct endianess and bit-packed structure. | |
| */ | | */ | |
|
| void *lo_message_serialise(lo_message m, const char *path, size_t *size); | | void *lo_message_serialise(lo_message m, const char *path, void *to, | |
| | | size_t *size); | |
| | | | |
| | | /** | |
| | | * \brief Create a new bundle object. | |
| | | * | |
| | | * OSC Bundles ecapsulate one or more OSC messages and may include a timest | |
| | | amp | |
| | | * indicating when the bundle should be dispatched. | |
| | | * | |
| | | * \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 | |
| | | * the bundle as soon as it receives it. | |
| | | */ | |
| | | lo_bundle lo_bundle_new(lo_timetag tt); | |
| | | | |
| | | /** | |
| | | * \brief Adds an OSC message to an existing bundle. | |
| | | * | |
| | | * The message passsed is appended to the list of messages in the bundle to | |
| | | be | |
| | | * dispatched to 'path'. | |
| | | */ | |
| | | void lo_bundle_add_message(lo_bundle b, const char *path, lo_message m); | |
| | | | |
| | | /** | |
| | | * \brief Return the length of a bundle in bytes. | |
| | | * | |
| | | * Includes the marker and typetage length. | |
| | | * | |
| | | * \param b The bundle to be sized | |
| | | */ | |
| | | size_t lo_bundle_length(lo_bundle b); | |
| | | | |
| | | /** | |
| | | * \brief Serialise the bundle object to an area of memory and return a | |
| | | * pointer to the serialised form. | |
| | | * | |
| | | * \param b The bundle to be serialised | |
| | | * \param to The address to serialise to, memory will be allocated if to is | |
| | | * NULL. | |
| | | * \param size If this pointer is non-NULL the size of the memory area | |
| | | * will be written here | |
| | | * | |
| | | * The returned form is suitable to be sent over a low level OSC transport, | |
| | | * having the correct endianess and bit-packed structure. | |
| | | */ | |
| | | void *lo_bundle_serialise(lo_bundle b, void *to, size_t *size); | |
| | | | |
| | | /** | |
| | | * \brief Frees the memory taken by a bundle object. | |
| | | */ | |
| | | void lo_bundle_free(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 313 | | skipping to change at line 374 | |
| lo_method lo_server_add_method(lo_server s, const char *path, | | lo_method lo_server_add_method(lo_server s, const char *path, | |
| const char *typespec, lo_method_handler h, | | const char *typespec, lo_method_handler h, | |
| void *user_data); | | 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 | |
| | | * received are dispatched immediatly. lo_server_events_pending() and | |
| | | * 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. | |
| */ | | */ | |
| int lo_server_get_socket_fd(lo_server s); | | int lo_server_get_socket_fd(lo_server s); | |
| | | | |
| /** | | /** | |
| * \brief Return the port number that the server has bound to. | | * \brief Return the port number that the server has bound to. | |
| * | | * | |
| * Useful when NULL is passed for the port number and you wish to know how
to | | * Useful when NULL is passed for the port number and you wish to know how
to | |
| * address the server. | | * address the server. | |
| */ | | */ | |
| int lo_server_get_port(lo_server s); | | int lo_server_get_port(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 bee free()'d when it is no longer needed. | | * The return value should bee 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 Return true if there are scheduled events (eg. from bundles) wai | |
| | | ting | |
| | | * * to be dispatched by the server */ | |
| | | int lo_server_events_pending(lo_server s); | |
| | | | |
| | | /** \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. | |
| | | */ | |
| | | double lo_server_next_event_delay(lo_server s); | |
| | | | |
| /** | | /** | |
| * \brief Return the protocol portion of an OSC URL, eg. udp, tcp. | | * \brief Return the protocol portion of an OSC URL, eg. udp, tcp. | |
| * | | * | |
| * This library uses OSC URLs of the form: osc.prot://hostname:port/path if
the | | * This library uses OSC URLs of the form: osc.prot://hostname:port/path if
the | |
| * prot part is missing, UDP is assumed. | | * prot part is missing, UDP is assumed. | |
| * | | * | |
| * The return value should bee free()'d when it is no longer needed. | | * The return value should bee free()'d when it is no longer needed. | |
| */ | | */ | |
| char *lo_url_get_protocol(const char *url); | | char *lo_url_get_protocol(const char *url); | |
| | | | |
| | | | |
| skipping to change at line 380 | | skipping to change at line 456 | |
| int lo_strsize(const char *s); | | int lo_strsize(const char *s); | |
| | | | |
| /** | | /** | |
| * \brief A function to calculate the amount of OSC message space required
by a | | * \brief A function to calculate the amount of OSC message space required
by a | |
| * lo_blob object. | | * lo_blob object. | |
| * | | * | |
| * Returns the storage size in bytes, will always be a multiple of four. | | * Returns the storage size in bytes, will always be a multiple of four. | |
| */ | | */ | |
| uint32_t lo_blobsize(lo_blob b); | | uint32_t lo_blobsize(lo_blob b); | |
| | | | |
|
| | | /** | |
| | | * \brief Test a string against an OSC pattern glob | |
| | | * | |
| | | * \param str The tring to test | |
| | | * \param p The pattern to test against | |
| | | */ | |
| | | int lo_pattern_match(const char *str, const char *p); | |
| | | | |
| /** \brief the real send function (don't call directly) */ | | /** \brief the real send function (don't call directly) */ | |
| int lo_send_internal(lo_address t, const char *file, const int line, | | int lo_send_internal(lo_address t, const char *file, const int line, | |
| const char *path, const char *types, ...); | | const char *path, const char *types, ...); | |
|
| | | /** \brief the real send_timestamped function (don't call directly) */ | |
| | | int lo_send_timestamped_internal(lo_address t, const char *file, const int | |
| | | line, | |
| | | lo_timetag ts, const char *path, const char *types, ...); | |
| | | | |
| | | /** \brief Find the time difference between two timetags | |
| | | * | |
| | | * Returns a - b in seconds. | |
| | | */ | |
| | | double lo_timetag_diff(lo_timetag a, lo_timetag b); | |
| | | | |
| | | /** \brief Return a timetag for the current time | |
| | | * | |
| | | * On exit the timetag pointed to by t is filled with the OSC represenation | |
| | | * of this instant in time. | |
| | | */ | |
| | | void lo_timetag_now(lo_timetag *t); | |
| | | | |
| /** @} */ | | /** @} */ | |
| | | | |
| /* prettyprinters */ | | /* prettyprinters */ | |
| | | | |
| /** | | /** | |
| * \defgroup pp Prettyprinting functions | | * \defgroup pp Prettyprinting functions | |
| * | | * | |
| * These functions all print an ASCII representation of thier argument to | | * These functions all print an ASCII representation of thier argument to | |
| * stdout. Useful for debugging. | | * stdout. Useful for debugging. | |
| * @{ | | * @{ | |
| */ | | */ | |
|
| | | void lo_bundle_pp(lo_bundle b); | |
| void lo_message_pp(lo_message m); | | void lo_message_pp(lo_message m); | |
| void lo_arg_pp(lo_type type, void *data); | | void lo_arg_pp(lo_type type, void *data); | |
| void lo_server_pp(lo_server s); | | void lo_server_pp(lo_server s); | |
| void lo_method_pp(lo_method m); | | void lo_method_pp(lo_method m); | |
| void lo_method_pp_prefix(lo_method m, const char *p); | | void lo_method_pp_prefix(lo_method m, const char *p); | |
| void lo_server_thread_pp(lo_server_thread st); | | void lo_server_thread_pp(lo_server_thread st); | |
| /** @} */ | | /** @} */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| | | | |
End of changes. 10 change blocks. |
| 3 lines changed or deleted | | 112 lines changed or added | |
|
| lo_macros.h | | lo_macros.h | |
| | | | |
| skipping to change at line 14 | | skipping to change at line 14 | |
| * This program is free software; you can redistribute it and/or modify | | * This program is free software; you can redistribute it and/or modify | |
| * it under the terms of the GNU General Public License as published by | | * it under the terms of the GNU General Public License as published by | |
| * the Free Software Foundation; either version 2 of the License, or | | * the Free Software Foundation; either version 2 of the License, or | |
| * (at your option) any later version. | | * (at your option) any later version. | |
| * | | * | |
| * This program is distributed in the hope that it will be useful, | | * This program is distributed in the hope that it will be useful, | |
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| * GNU General Public License for more details. | | * GNU General Public License for more details. | |
| * | | * | |
|
| * $Id: lo_macros.h,v 1.1.1.1 2004/08/07 22:21:02 theno23 Exp $ | | * $Id: lo_macros.h,v 1.2 2004/11/18 15:20:26 theno23 Exp $ | |
| */ | | */ | |
| | | | |
| #ifndef LO_MACROS_H | | #ifndef LO_MACROS_H | |
| #define LO_MACROS_H | | #define LO_MACROS_H | |
| | | | |
| /* macros that have to be defined after function signatures */ | | /* macros that have to be defined after function signatures */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| skipping to change at line 44 | | skipping to change at line 44 | |
| | | | |
| /* 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 | | #define LO_MARKER_A 0xdeadbeef | |
| #define LO_MARKER_B 0xf00baa23 | | #define LO_MARKER_B 0xf00baa23 | |
| | | | |
| #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...) \ | |
| | | lo_send_timestamped_internal(targ, __FILE__, __LINE__, ts, path, \ | |
| | | types, LO_MARKER_A, LO_MARKER_B) | |
| | | | |
| #if 0 | | #if 0 | |
| | | | |
| This function is deliberatly not avialable, see send.c for details. | | This function is deliberatly not avialable, see send.c for details. | |
| | | | |
| #define lo_sendf(targ, path, types...) \ | | #define lo_sendf(targ, path, types...) \ | |
| lo_sendf_internal(targ, __FILE__, __LINE__, path, types, \ | | lo_sendf_internal(targ, __FILE__, __LINE__, path, types, \ | |
| LO_MARKER_A, LO_MARKER_B) | | LO_MARKER_A, LO_MARKER_B) | |
| #endif | | #endif | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| | | | |
End of changes. 2 change blocks. |
| 1 lines changed or deleted | | 5 lines changed or added | |
|