| 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.8 2005/08/09 15:06:04 mhabets Exp $ | | * $Id: lo.h,v 1.10 2005/12/05 22:25:31 nhumfrey 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 87 | | skipping to change at line 87 | |
| * 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, | |
| | | * from the same socket as the specificied server. | |
| | | * | |
| | | * \param targ The target OSC address | |
| | | * \param from The server to send message from (can be NULL to use new so | |
| | | cket) | |
| | | * \param ts The OSC timetag timestamp at which the message will be proce | |
| | | ssed | |
| | | * (can be LO_TT_IMMEDIATE if you don't want to attach a timetag) | |
| | | * \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> | |
| | | * serv = lo_server_new(NULL, err);<br> | |
| | | * lo_server_add_method(serv, "/reply", "ss", reply_handler, NULL); | |
| | | * lo_send_from(t, serv, LO_TT_IMMEDIATE, "/foo/bar", "ff", 0.1f, 23.0f); | |
| | | * | |
| | | * on success returns the number of bytes sent, returns -1 on failure. | |
| | | */ | |
| | | int lo_send_from(lo_address targ, lo_server from, lo_timetag ts, | |
| | | const char *path, const char *type, ...); | |
| | | | |
| | | /** | |
| * \brief Send a OSC formatted message to the address specified, scheduled
to | | * \brief Send a OSC formatted message to the address specified, scheduled
to | |
| * be dispatch at some time in the future. | | * be dispatch at some time in the future. | |
| * | | * | |
| * \param targ The target OSC address | | * \param targ The target OSC address | |
| * \param ts The OSC timetag timestamp at which the message will be process
ed | | * \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 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 | | * \param type The types of the data items in the message, types are define
d in | |
| * lo_types_common.h | | * lo_types_common.h | |
| * \param ... The data values to be transmitted. The types of the arguments | | * \param ... The data values to be transmitted. The types of the arguments | |
| * 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_timetag now;<br> | | * lo_timetag now;<br> | |
| * lo_timetag_now(&now);<br> | | * lo_timetag_now(&now);<br> | |
|
| * lo_send(t, now, "/foo/bar", "ff", 0.1f, 23.0f); | | * lo_send_timestamped(t, now, "/foo/bar", "ff", 0.1f, 23.0f); | |
| * | | * | |
| * on success returns the number of bytes sent, returns -1 on failure. | | * 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, | | int lo_send_timestamped(lo_address targ, lo_timetag ts, const char *path, | |
| const char *type, ...); | | 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 | |
| */ | | */ | |
| | | | |
| skipping to change at line 198 | | skipping to change at line 222 | |
| */ | | */ | |
| 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 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 | | /** \brief Return true if there are scheduled events (eg. from bundles) wai
ting | |
| * to be dispatched by the thread */ | | * to be dispatched by the thread */ | |
| int lo_server_thread_events_pending(lo_server_thread st); | | 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. | |
| | | | |
End of changes. 4 change blocks. |
| 2 lines changed or deleted | | 37 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.11 2005/08/09 15:06:04 mhabets Exp $ | | * $Id: lo_lowlevel.h,v 1.15 2005/12/29 20:08:26 nhumfrey 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_message object to target targ from address of serv | |
| | | * | |
| | | * 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 | |
| | | * lo_message_add*() functions. | |
| | | * | |
| | | * \param targ The address to send the message to | |
| | | * \param serv The server socket to send the message from | |
| | | * (can be NULL to use new socket) | |
| | | * \param path The path to send the message to | |
| | | * \param msg The bundle itself | |
| | | */ | |
| | | int lo_send_message_from(lo_address targ, lo_server serv, | |
| | | const char *path, lo_message msg); | |
| | | | |
| | | /** | |
| * \brief send a lo_bundle object to address targ | | * \brief send a lo_bundle object to address targ | |
| * | | * | |
|
| * This is slightly more efficient than lo_send_bundled if you want to send | | * Bundles are constructed with the | |
| a | | | |
| * lot of similar bundles. The bundles are constructed with the | | | |
| * lo_bundle_new() and lo_bundle_add_message() functions. | | * lo_bundle_new() and lo_bundle_add_message() functions. | |
| */ | | */ | |
| int lo_send_bundle(lo_address targ, lo_bundle b); | | int lo_send_bundle(lo_address targ, lo_bundle b); | |
| | | | |
| /** | | /** | |
|
| | | * \brief send a lo_bundle object to address targ from address of serv | |
| | | * | |
| | | * Bundles are constructed with the | |
| | | * lo_bundle_new() and lo_bundle_add_message() functions. | |
| | | * | |
| | | * \param targ The address to send the bundle to | |
| | | * \param serv The server socket to send the bundle from | |
| | | * (can be NULL to use new socket) | |
| | | * \param b The bundle itself | |
| | | */ | |
| | | 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 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 346 | | skipping to change at line 374 | |
| | | | |
| /** | | /** | |
| * \brief Create a new server instance, specifying protocol. | | * \brief Create a new server instance, specifying protocol. | |
| * | | * | |
| * lo_servers block until they receive OSC messages. if you want non-blocki
ng | | * lo_servers block until they receive OSC messages. if you want non-blocki
ng | |
| * behaviour see the lo_server_thread_* functions. | | * behaviour see the lo_server_thread_* functions. | |
| * | | * | |
| * \param port If using UDP then NULL may be passed to find an unused port. | | * \param port If using UDP then NULL may be passed to find an unused port. | |
| * Otherwise a decimal port number orservice name or may be passed. | | * Otherwise a decimal port number orservice 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 proto The protocol to use, should be one of LO_UDP, or LO_UNIX. | | * \param proto The protocol to use, should be one of LO_UDP, LO_TCP or LO_
UNIX. | |
| * \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_with_proto(const char *port, int proto, | | lo_server lo_server_new_with_proto(const char *port, int proto, | |
| lo_err_handler err_h); | | lo_err_handler err_h); | |
| | | | |
| /** | | /** | |
| * \brief Free up memory used by the lo_server object | | * \brief Free up memory used by the lo_server object | |
| */ | | */ | |
| | | | |
| skipping to change at line 389 | | skipping to change at line 417 | |
| | | | |
| /** | | /** | |
| * \brief Add an OSC method to the specifed server. | | * \brief Add an OSC method to the specifed server. | |
| * | | * | |
| * \param s The server the method is to be added to. | | * \param s The server the method is to be added to. | |
| * \param path The OSC path to register the method to. If NULL is passed th
e | | * \param path The OSC path to register the method to. If NULL is passed th
e | |
| * method will match all paths. | | * method will match all paths. | |
| * \param typespec The typespec the method accepts. Incoming messages with | | * \param typespec The typespec the method accepts. Incoming messages with | |
| * similar typespecs (e.g. ones with numerical types in the same position)
will | | * similar typespecs (e.g. ones with numerical types in the same position)
will | |
| * be coerced to the typespec given here. | | * be coerced to the typespec given here. | |
|
| * \param h The method handler callback function that will be called it a | | * \param h The method handler callback function that will be called if a | |
| * matching message is received | | * matching message is received | |
| * \param user_data A value that will be passed to the callback function, h
, | | * \param user_data A value that will be passed to the callback function, h
, | |
| * when its invoked matching from this method. | | * when its invoked matching from this method. | |
| */ | | */ | |
| 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 Delete an OSC method from the specifed server. | | * \brief Delete an OSC method from the specifed server. | |
| | | | |
| skipping to change at line 438 | | skipping to change at line 466 | |
| */ | | */ | |
| 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 | | * \brief Return true if there are scheduled events (eg. from bundles) | |
| * * 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. | |
| */ | | */ | |
| double lo_server_next_event_delay(lo_server s); | | 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. | |
| | | | |
| skipping to change at line 511 | | skipping to change at line 542 | |
| * \param p The pattern to test against | | * \param p The pattern to test against | |
| */ | | */ | |
| int lo_pattern_match(const char *str, const char *p); | | 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) */ | | /** \brief the real send_timestamped function (don't call directly) */ | |
| int lo_send_timestamped_internal(lo_address t, const char *file, const int
line, | | int lo_send_timestamped_internal(lo_address t, const char *file, const int
line, | |
| lo_timetag ts, const char *path, const char *types, ...); | | lo_timetag ts, const char *path, const char *types, ...); | |
|
| | | /** \brief the real lo_send_from function (don't call directly) */ | |
| | | int lo_send_from_internal(lo_address targ, lo_server from, const char *file | |
| | | , | |
| | | const int line, const lo_timetag ts, | |
| | | const char *path, const char *types, ...); | |
| | | | |
| /** \brief Find the time difference between two timetags | | /** \brief Find the time difference between two timetags | |
| * | | * | |
| * Returns a - b in seconds. | | * Returns a - b in seconds. | |
| */ | | */ | |
| double lo_timetag_diff(lo_timetag a, lo_timetag b); | | double lo_timetag_diff(lo_timetag a, lo_timetag b); | |
| | | | |
| /** \brief Return a timetag for the current time | | /** \brief Return a timetag for the current time | |
| * | | * | |
| * On exit the timetag pointed to by t is filled with the OSC represenation | | * On exit the timetag pointed to by t is filled with the OSC represenation | |
| | | | |
End of changes. 9 change blocks. |
| 10 lines changed or deleted | | 46 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.3 2005/02/28 14:33:19 theno23 Exp $ | | * $Id: lo_macros.h,v 1.5 2005/12/05 22:22:09 nhumfrey 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 | |
| | | | |
|
| /* Maximum length of UDP messages in bytes */ | | /* \brief Maximum length of UDP messages in bytes | |
| | | */ | |
| #define LO_MAX_MSG_SIZE 32768 | | #define LO_MAX_MSG_SIZE 32768 | |
| | | | |
| /* \brief A set of macros to represent different communications transports | | /* \brief A set of macros to represent different communications transports | |
| */ | | */ | |
| #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 */ | |
| | | | |
| skipping to change at line 48 | | skipping to change at line 49 | |
| #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...) \ | | #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) | |
| | | | |
|
| #if 0 | | #define lo_send_from(targ, from, ts, path, types...) \ | |
| | | lo_send_from_internal(targ, from, __FILE__, __LINE__, ts, path, \ | |
| This function is deliberatly not avialable, see send.c for details. | | types, LO_MARKER_A, LO_MARKER_B) | |
| | | | |
| #define lo_sendf(targ, path...) \ | | | |
| lo_sendf_internal(targ, __FILE__, __LINE__, path, \ | | | |
| LO_MARKER_A, LO_MARKER_B) | | | |
| #endif | | | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 3 change blocks. |
| 10 lines changed or deleted | | 6 lines changed or added | |
|