.TH "liblolowlevel" 3 "Version 0.34" "liblo" \" -*- nroff -*- .ad l .nh .SH NAME liblolowlevel \- Low-level OSC API .SH SYNOPSIS .br .PP .SS "Data Structures" .in +1c .ti -1c .RI "struct \fBlo_server_config\fP" .br .RI "A configuration struct for initializing \fBlo_server\fP using \fBlo_server_new_from_config()\fP\&. " .in -1c .SS "Typedefs" .in +1c .ti -1c .RI "typedef long double \fBlo_hires\fP" .br .RI "Type used to represent numerical values in conversions between OSC types\&. " .in -1c .SS "Enumerations" .in +1c .ti -1c .RI "enum \fBlo_slip_encoding\fP " .br .RI "Used with \fBlo_address_set_stream_slip()\fP to specify whether sent messages should be encoded with SLIP, and whether the encoding should be single- or double-ENDed\&. " .in -1c .SS "Functions" .in +1c .ti -1c .RI "int \fBlo_send_message\fP (\fBlo_address\fP targ, const char *path, \fBlo_message\fP msg)" .br .RI "Send a \fBlo_message\fP object to target targ\&. " .ti -1c .RI "int \fBlo_send_message_from\fP (\fBlo_address\fP targ, \fBlo_server\fP serv, const char *path, \fBlo_message\fP msg)" .br .RI "Send a \fBlo_message\fP object to target targ from address of serv\&. " .ti -1c .RI "int \fBlo_send_bundle\fP (\fBlo_address\fP targ, \fBlo_bundle\fP b)" .br .RI "Send a \fBlo_bundle\fP object to address targ\&. " .ti -1c .RI "int \fBlo_send_bundle_from\fP (\fBlo_address\fP targ, \fBlo_server\fP serv, \fBlo_bundle\fP b)" .br .RI "Send a \fBlo_bundle\fP object to address targ from address of serv\&. " .ti -1c .RI "\fBlo_message\fP \fBlo_message_new\fP (void)" .br .RI "Create a new \fBlo_message\fP object\&. " .ti -1c .RI "void \fBlo_message_incref\fP (\fBlo_message\fP m)" .br .RI "Add one to a message's reference count\&. " .ti -1c .RI "int \fBlo_message_decref\fP (\fBlo_message\fP m)" .br .RI "Subtract one from a message's reference count\&. " .ti -1c .RI "\fBlo_message\fP \fBlo_message_clone\fP (\fBlo_message\fP m)" .br .RI "Create a new \fBlo_message\fP object by cloning an already existing one\&. " .ti -1c .RI "void \fBlo_message_free\fP (\fBlo_message\fP m)" .br .RI "Free memory allocated by \fBlo_message_new()\fP and any subsequent \fBlo_message_add_int32\fP lo_message_add*() calls\&. " .ti -1c .RI "void \fBlo_message_clear\fP (\fBlo_message\fP m)" .br .RI "Clear elements from a \fBlo_message\fP but do not free allocated memory\&. " .ti -1c .RI "int \fBlo_message_add\fP (\fBlo_message\fP m, const char *types,\&.\&.\&.)" .br .RI "Append a number of arguments to a message\&. " .ti -1c .RI "int \fBlo_message_add_varargs\fP (\fBlo_message\fP m, const char *types, va_list ap)" .br .RI "Append a varargs list to a message\&. " .ti -1c .RI "int \fBlo_message_add_int32\fP (\fBlo_message\fP m, int32_t a)" .br .RI "Append a data item and typechar of the specified type to a message\&. " .ti -1c .RI "int \fBlo_message_add_float\fP (\fBlo_message\fP m, float a)" .br .RI "Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. " .ti -1c .RI "int \fBlo_message_add_string\fP (\fBlo_message\fP m, const char *a)" .br .RI "Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. " .ti -1c .RI "int \fBlo_message_add_blob\fP (\fBlo_message\fP m, \fBlo_blob\fP a)" .br .RI "Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. " .ti -1c .RI "int \fBlo_message_add_int64\fP (\fBlo_message\fP m, int64_t a)" .br .RI "Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. " .ti -1c .RI "int \fBlo_message_add_timetag\fP (\fBlo_message\fP m, \fBlo_timetag\fP a)" .br .RI "Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. " .ti -1c .RI "int \fBlo_message_add_double\fP (\fBlo_message\fP m, double a)" .br .RI "Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. " .ti -1c .RI "int \fBlo_message_add_symbol\fP (\fBlo_message\fP m, const char *a)" .br .RI "Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. " .ti -1c .RI "int \fBlo_message_add_char\fP (\fBlo_message\fP m, char a)" .br .RI "Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. " .ti -1c .RI "int \fBlo_message_add_midi\fP (\fBlo_message\fP m, uint8_t a[4])" .br .RI "Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. " .ti -1c .RI "int \fBlo_message_add_true\fP (\fBlo_message\fP m)" .br .RI "Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. " .ti -1c .RI "int \fBlo_message_add_false\fP (\fBlo_message\fP m)" .br .RI "Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. " .ti -1c .RI "int \fBlo_message_add_nil\fP (\fBlo_message\fP m)" .br .RI "Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. " .ti -1c .RI "int \fBlo_message_add_infinitum\fP (\fBlo_message\fP m)" .br .RI "Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. " .ti -1c .RI "\fBlo_address\fP \fBlo_message_get_source\fP (\fBlo_message\fP m)" .br .RI "Returns the source (\fBlo_address\fP) of an incoming message\&. " .ti -1c .RI "\fBlo_timetag\fP \fBlo_message_get_timestamp\fP (\fBlo_message\fP m)" .br .RI "Returns the timestamp (\fBlo_timetag\fP *) of a bundled incoming message\&. " .ti -1c .RI "char * \fBlo_message_get_types\fP (\fBlo_message\fP m)" .br .RI "Return the message type tag string\&. " .ti -1c .RI "int \fBlo_message_get_argc\fP (\fBlo_message\fP m)" .br .RI "Return the message argument count\&. " .ti -1c .RI "\fBlo_arg\fP ** \fBlo_message_get_argv\fP (\fBlo_message\fP m)" .br .RI "Return the message arguments\&. Do not free the returned data\&. " .ti -1c .RI "size_t \fBlo_message_length\fP (\fBlo_message\fP m, const char *path)" .br .RI "Return the length of a message in bytes\&. " .ti -1c .RI "void * \fBlo_message_serialise\fP (\fBlo_message\fP m, const char *path, void *to, size_t *size)" .br .RI "Serialise the \fBlo_message\fP object to an area of memory and return a pointer to the serialised form\&. Opposite of \fBlo_message_deserialise()\fP\&. " .ti -1c .RI "\fBlo_message\fP \fBlo_message_deserialise\fP (void *data, size_t size, int *result)" .br .RI "Deserialise a raw OSC message and return a new \fBlo_message\fP object\&. Opposite of \fBlo_message_serialise()\fP\&. " .ti -1c .RI "int \fBlo_server_dispatch_data\fP (\fBlo_server\fP s, void *data, size_t size)" .br .RI "Dispatch a raw block of memory containing an OSC message\&. " .ti -1c .RI "const char * \fBlo_address_get_hostname\fP (\fBlo_address\fP a)" .br .RI "Return the hostname of a \fBlo_address\fP object\&. " .ti -1c .RI "const char * \fBlo_address_get_port\fP (\fBlo_address\fP a)" .br .RI "Return the port/service name of a \fBlo_address\fP object\&. " .ti -1c .RI "int \fBlo_address_get_protocol\fP (\fBlo_address\fP a)" .br .RI "Return the protocol of a \fBlo_address\fP object\&. " .ti -1c .RI "char * \fBlo_address_get_url\fP (\fBlo_address\fP a)" .br .RI "Return a URL representing an OSC address\&. " .ti -1c .RI "void \fBlo_address_set_ttl\fP (\fBlo_address\fP t, int ttl)" .br .RI "Set the Time-to-Live value for a given target address\&. " .ti -1c .RI "int \fBlo_address_get_ttl\fP (\fBlo_address\fP t)" .br .RI "Get the Time-to-Live value for a given target address\&. " .ti -1c .RI "int \fBlo_address_set_iface\fP (\fBlo_address\fP t, const char *iface, const char *ip)" .br .RI "Set the network interface to use for a given target address\&. " .ti -1c .RI "const char * \fBlo_address_get_iface\fP (\fBlo_address\fP t)" .br .RI "Get the name of the network interface assigned to an OSC address\&. " .ti -1c .RI "int \fBlo_address_set_tcp_nodelay\fP (\fBlo_address\fP t, int enable)" .br .RI "Set the TCP_NODELAY flag on outgoing TCP connections\&. " .ti -1c .RI "int \fBlo_address_set_stream_slip\fP (\fBlo_address\fP t, \fBlo_slip_encoding\fP encoding)" .br .RI "Set outgoing stream connections (e\&.g\&., TCP) to be transmitted using the SLIP packetizing protocol\&. " .ti -1c .RI "\fBlo_bundle\fP \fBlo_bundle_new\fP (\fBlo_timetag\fP tt)" .br .RI "Create a new bundle object\&. " .ti -1c .RI "void \fBlo_bundle_incref\fP (\fBlo_bundle\fP b)" .br .RI "Add one to a bundle's reference count\&. " .ti -1c .RI "int \fBlo_bundle_add_message\fP (\fBlo_bundle\fP b, const char *path, \fBlo_message\fP m)" .br .RI "Adds an OSC message to an existing bundle\&. " .ti -1c .RI "int \fBlo_bundle_add_bundle\fP (\fBlo_bundle\fP b, \fBlo_bundle\fP n)" .br .RI "Adds an OSC bundle to an existing bundle\&. " .ti -1c .RI "size_t \fBlo_bundle_length\fP (\fBlo_bundle\fP b)" .br .RI "Return the length of a bundle in bytes\&. " .ti -1c .RI "unsigned int \fBlo_bundle_count\fP (\fBlo_bundle\fP b)" .br .RI "Return the number of top-level elements in a bundle\&. " .ti -1c .RI "\fBlo_element_type\fP \fBlo_bundle_get_type\fP (\fBlo_bundle\fP b, int index)" .br .RI "Gets the element type contained within a bundle\&. " .ti -1c .RI "\fBlo_bundle\fP \fBlo_bundle_get_bundle\fP (\fBlo_bundle\fP b, int index)" .br .RI "Gets a nested bundle contained within a bundle\&. " .ti -1c .RI "\fBlo_message\fP \fBlo_bundle_get_message\fP (\fBlo_bundle\fP b, int index, const char **path)" .br .RI "Gets a message contained within a bundle\&. " .ti -1c .RI "\fBlo_timetag\fP \fBlo_bundle_get_timestamp\fP (\fBlo_bundle\fP b)" .br .RI "Get the timestamp associated with a bundle\&. " .ti -1c .RI "void * \fBlo_bundle_serialise\fP (\fBlo_bundle\fP b, void *to, size_t *size)" .br .RI "Serialise the bundle object to an area of memory and return a pointer to the serialised form\&. " .ti -1c .RI "void \fBlo_bundle_free\fP (\fBlo_bundle\fP b)" .br .RI "Frees the memory taken by a bundle object\&. " .ti -1c .RI "void \fBlo_bundle_free_recursive\fP (\fBlo_bundle\fP b)" .br .RI "Frees the memory taken by a bundle object and its messages and nested bundles recursively\&. " .ti -1c .RI "void \fBlo_bundle_free_messages\fP (\fBlo_bundle\fP b)" .br .RI "Obsolete, use lo_bundle_free_recursive instead\&. " .ti -1c .RI "int \fBlo_is_numerical_type\fP (\fBlo_type\fP a)" .br .RI "Return true if the type specified has a numerical value, such as LO_INT32, LO_FLOAT etc\&. " .ti -1c .RI "int \fBlo_is_string_type\fP (\fBlo_type\fP a)" .br .RI "Return true if the type specified has a textual value, such as LO_STRING or LO_SYMBOL\&. " .ti -1c .RI "int \fBlo_coerce\fP (\fBlo_type\fP type_to, \fBlo_arg\fP *to, \fBlo_type\fP type_from, \fBlo_arg\fP *from)" .br .RI "Attempt to convert one OSC type to another\&. " .ti -1c .RI "\fBlo_hires\fP \fBlo_hires_val\fP (\fBlo_type\fP type, \fBlo_arg\fP *p)" .br .RI "Return the numerical value of the given argument with the maximum native system precision\&. " .ti -1c .RI "\fBlo_server\fP \fBlo_server_new\fP (const char *port, \fBlo_err_handler\fP err_h)" .br .RI "Create a new server instance\&. " .ti -1c .RI "\fBlo_server\fP \fBlo_server_new_with_proto\fP (const char *port, int proto, \fBlo_err_handler\fP err_h)" .br .RI "Create a new server instance, specifying protocol\&. " .ti -1c .RI "\fBlo_server\fP \fBlo_server_new_multicast\fP (const char *group, const char *port, \fBlo_err_handler\fP err_h)" .br .RI "Create a new server instance, and join a UDP multicast group\&. " .ti -1c .RI "\fBlo_server\fP \fBlo_server_new_multicast_iface\fP (const char *group, const char *port, const char *iface, const char *ip, \fBlo_err_handler\fP err_h)" .br .RI "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\&. " .ti -1c .RI "\fBlo_server\fP \fBlo_server_new_from_url\fP (const char *url, \fBlo_err_handler\fP err_h)" .br .RI "Create a new server instance, taking port and the optional multicast group IP from an URL string\&. " .ti -1c .RI "\fBlo_server\fP \fBlo_server_new_from_config\fP (\fBlo_server_config\fP *config)" .br .RI "Create a new server instance, using a configuration struct\&. " .ti -1c .RI "int \fBlo_server_enable_coercion\fP (\fBlo_server\fP server, int enable)" .br .RI "Enables or disables type coercion during message dispatch\&. " .ti -1c .RI "void \fBlo_server_free\fP (\fBlo_server\fP s)" .br .RI "Free up memory used by the \fBlo_server\fP object\&. " .ti -1c .RI "int \fBlo_server_wait\fP (\fBlo_server\fP s, int timeout)" .br .RI "Wait for an OSC message to be received\&. " .ti -1c .RI "int \fBlo_servers_wait\fP (\fBlo_server\fP *s, int *status, int num_servers, int timeout)" .br .RI "Wait on multiple servers for an OSC message to be received\&. " .ti -1c .RI "int \fBlo_server_recv_noblock\fP (\fBlo_server\fP s, int timeout)" .br .RI "Look for an OSC message waiting to be received\&. " .ti -1c .RI "int \fBlo_servers_recv_noblock\fP (\fBlo_server\fP *s, int *recvd, int num_servers, int timeout)" .br .RI "Look for an OSC message waiting to be received on multiple servers\&. " .ti -1c .RI "int \fBlo_server_recv\fP (\fBlo_server\fP s)" .br .RI "Block, waiting for an OSC message to be received\&. " .ti -1c .RI "\fBlo_method\fP \fBlo_server_add_method\fP (\fBlo_server\fP s, const char *path, const char *typespec, \fBlo_method_handler\fP h, const void *user_data)" .br .RI "Add an OSC method to the specifed server\&. " .ti -1c .RI "void \fBlo_server_del_method\fP (\fBlo_server\fP s, const char *path, const char *typespec)" .br .RI "Delete an OSC method from the specified server\&. " .ti -1c .RI "int \fBlo_server_del_lo_method\fP (\fBlo_server\fP s, \fBlo_method\fP m)" .br .RI "Delete a specific OSC method from the specified server\&. " .ti -1c .RI "int \fBlo_server_add_bundle_handlers\fP (\fBlo_server\fP s, \fBlo_bundle_start_handler\fP sh, \fBlo_bundle_end_handler\fP eh, void *user_data)" .br .RI "Add bundle notification handlers to the specified server\&. " .ti -1c .RI "int \fBlo_server_get_socket_fd\fP (\fBlo_server\fP s)" .br .RI "Return the file descriptor of the server socket\&. " .ti -1c .RI "int \fBlo_server_get_port\fP (\fBlo_server\fP s)" .br .RI "Return the port number that the server has bound to\&. " .ti -1c .RI "int \fBlo_server_get_protocol\fP (\fBlo_server\fP s)" .br .RI "Return the protocol that the server is using\&. " .ti -1c .RI "char * \fBlo_server_get_url\fP (\fBlo_server\fP s)" .br .RI "Return an OSC URL that can be used to contact the server\&. " .ti -1c .RI "int \fBlo_server_enable_queue\fP (\fBlo_server\fP s, int queue_enabled, int dispatch_remaining)" .br .RI "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 \fBlo_message_get_timestamp()\fP to get the message timestamp from within a method handler\&. " .ti -1c .RI "int \fBlo_server_events_pending\fP (\fBlo_server\fP s)" .br .RI "Return true if there are scheduled events (eg\&. from bundles) waiting to be dispatched by the server\&. " .ti -1c .RI "double \fBlo_server_next_event_delay\fP (\fBlo_server\fP s)" .br .RI "Return the time in seconds until the next scheduled event\&. " .ti -1c .RI "int \fBlo_server_max_msg_size\fP (\fBlo_server\fP s, int req_size)" .br .RI "Set the maximum message size accepted by a server\&. " .ti -1c .RI "char * \fBlo_url_get_protocol\fP (const char *url)" .br .RI "Return the protocol portion of an OSC URL, eg\&. udp, tcp\&. " .ti -1c .RI "int \fBlo_url_get_protocol_id\fP (const char *url)" .br .RI "Return the protocol ID of an OSC URL\&. " .ti -1c .RI "char * \fBlo_url_get_hostname\fP (const char *url)" .br .RI "Return the hostname portion of an OSC URL\&. " .ti -1c .RI "char * \fBlo_url_get_port\fP (const char *url)" .br .RI "Return the port portion of an OSC URL\&. " .ti -1c .RI "char * \fBlo_url_get_path\fP (const char *url)" .br .RI "Return the path portion of an OSC URL\&. " .ti -1c .RI "int \fBlo_strsize\fP (const char *s)" .br .RI "A function to calculate the amount of OSC message space required by a C char *\&. " .ti -1c .RI "uint32_t \fBlo_blobsize\fP (\fBlo_blob\fP b)" .br .RI "A function to calculate the amount of OSC message space required by a \fBlo_blob\fP object\&. " .ti -1c .RI "int \fBlo_pattern_match\fP (const char *str, const char *p)" .br .RI "Test a string against an OSC pattern glob\&. " .ti -1c .RI "int \fBlo_string_contains_pattern\fP (const char *str)" .br .RI "Test if a string contains any OSC pattern characters\&. " .ti -1c .RI "double \fBlo_timetag_diff\fP (\fBlo_timetag\fP a, \fBlo_timetag\fP b)" .br .RI "Find the time difference between two timetags\&. " .ti -1c .RI "void \fBlo_timetag_now\fP (\fBlo_timetag\fP *t)" .br .RI "Return a timetag for the current time\&. " .ti -1c .RI "size_t \fBlo_arg_size\fP (\fBlo_type\fP type, void *data)" .br .RI "Return the storage size, in bytes, of the given argument\&. " .ti -1c .RI "char * \fBlo_get_path\fP (void *data, ssize_t size)" .br .RI "Given a raw OSC message, return the message path\&. " .ti -1c .RI "void \fBlo_arg_host_endian\fP (\fBlo_type\fP type, void *data)" .br .RI "Convert the specified argument to host byte order where necessary\&. " .ti -1c .RI "void \fBlo_arg_network_endian\fP (\fBlo_type\fP type, void *data)" .br .RI "Convert the specified argument to network byte order where necessary\&. " .in -1c .SH "Detailed Description" .PP Use these functions if you require more precise control over OSC message contruction or handling that what is provided in the high-level functions described in liblo\&. .SH "Typedef Documentation" .PP .SS "typedef long double \fBlo_hires\fP" .PP Type used to represent numerical values in conversions between OSC types\&. .PP Definition at line \fB56\fP of file \fBlo_lowlevel\&.h\fP\&. .SH "Enumeration Type Documentation" .PP .SS "enum \fBlo_slip_encoding\fP" .PP Used with \fBlo_address_set_stream_slip()\fP to specify whether sent messages should be encoded with SLIP, and whether the encoding should be single- or double-ENDed\&. .PP Definition at line \fB85\fP of file \fBlo_lowlevel\&.h\fP\&. .SH "Function Documentation" .PP .SS "const char * lo_address_get_hostname (\fBlo_address\fP a)" .PP Return the hostname of a \fBlo_address\fP object\&. Returned value must not be modified or free'd\&. Value will be a dotted quad, colon'd IPV6 address, or resolvable name\&. .SS "const char * lo_address_get_iface (\fBlo_address\fP t)" .PP Get the name of the network interface assigned to an OSC address\&. .PP \fBParameters\fP .RS 4 \fIt\fP An OSC address\&. .RE .PP \fBReturns\fP .RS 4 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\&. .RE .PP .SS "const char * lo_address_get_port (\fBlo_address\fP a)" .PP Return the port/service name of a \fBlo_address\fP object\&. Returned value must not be modified or free'd\&. Value will be a service name or ASCII representation of the port number\&. .SS "int lo_address_get_protocol (\fBlo_address\fP a)" .PP Return the protocol of a \fBlo_address\fP object\&. Returned value will be one of LO_UDP, LO_TCP or LO_UNIX\&. .SS "int lo_address_get_ttl (\fBlo_address\fP t)" .PP Get the Time-to-Live value for a given target address\&. .PP \fBParameters\fP .RS 4 \fIt\fP An OSC address\&. .RE .PP \fBReturns\fP .RS 4 An integer specifying the scope of a multicast UDP message\&. .RE .PP .SS "char * lo_address_get_url (\fBlo_address\fP a)" .PP Return a URL representing an OSC address\&. Returned value must be free'd\&. .SS "int lo_address_set_iface (\fBlo_address\fP t, const char * iface, const char * ip)" .PP 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\&. .PP \fBParameters\fP .RS 4 \fIt\fP An OSC address\&. .br \fIiface\fP The name of a network interface on the local system\&. .br \fIip\fP The IP address of a network interface on the local system\&. .RE .PP \fBReturns\fP .RS 4 0 if the interface was successfully identified, or non-zero otherwise\&. .RE .PP .SS "int lo_address_set_stream_slip (\fBlo_address\fP t, \fBlo_slip_encoding\fP encoding)" .PP Set outgoing stream connections (e\&.g\&., TCP) to be transmitted using the SLIP packetizing protocol\&. .PP \fBParameters\fP .RS 4 \fIt\fP The address to set this flag for\&. .br \fIencoding\fP Specify single- or double-ENDed SLIP, or disable SLIP\&. .RE .PP \fBReturns\fP .RS 4 the previous value of this flag\&. .RE .PP .SS "int lo_address_set_tcp_nodelay (\fBlo_address\fP t, int enable)" .PP Set the TCP_NODELAY flag on outgoing TCP connections\&. .PP \fBParameters\fP .RS 4 \fIt\fP The address to set this flag for\&. .br \fIenable\fP Non-zero to set the flag, zero to unset it\&. .RE .PP \fBReturns\fP .RS 4 the previous value of this flag\&. .RE .PP .SS "void lo_address_set_ttl (\fBlo_address\fP t, int ttl)" .PP Set the Time-to-Live value for a given target address\&. This is required for sending multicast UDP messages\&. A value of 1 (the usual case) keeps the message within the subnet, while 255 means a global, unrestricted scope\&. .PP \fBParameters\fP .RS 4 \fIt\fP An OSC address\&. .br \fIttl\fP An integer specifying the scope of a multicast UDP message\&. .RE .PP .SS "void lo_arg_host_endian (\fBlo_type\fP type, void * data)" .PP Convert the specified argument to host byte order where necessary\&. .PP \fBParameters\fP .RS 4 \fItype\fP The OSC type of the data item (eg\&. LO_FLOAT)\&. .br \fIdata\fP A pointer to the data item to be converted\&. It is changed in-place\&. .RE .PP .SS "void lo_arg_network_endian (\fBlo_type\fP type, void * data)" .PP Convert the specified argument to network byte order where necessary\&. .PP \fBParameters\fP .RS 4 \fItype\fP The OSC type of the data item (eg\&. LO_FLOAT)\&. .br \fIdata\fP A pointer to the data item to be converted\&. It is changed in-place\&. .RE .PP .SS "size_t lo_arg_size (\fBlo_type\fP type, void * data)" .PP Return the storage size, in bytes, of the given argument\&. .SS "uint32_t lo_blobsize (\fBlo_blob\fP b)" .PP A function to calculate the amount of OSC message space required by a \fBlo_blob\fP object\&. Returns the storage size in bytes, which will always be a multiple of four\&. .SS "int lo_bundle_add_bundle (\fBlo_bundle\fP b, \fBlo_bundle\fP n)" .PP Adds an OSC bundle to an existing bundle\&. The child bundle passed is appended to the list of child bundles|messages in the parent bundle to be dispatched\&. .PP \fBReturns\fP .RS 4 0 if successful, less than 0 otherwise\&. .RE .PP .SS "int lo_bundle_add_message (\fBlo_bundle\fP b, const char * path, \fBlo_message\fP m)" .PP Adds an OSC message to an existing bundle\&. The message passed is appended to the list of messages in the bundle to be dispatched to 'path'\&. .PP \fBReturns\fP .RS 4 0 if successful, less than 0 otherwise\&. .RE .PP .SS "unsigned int lo_bundle_count (\fBlo_bundle\fP b)" .PP Return the number of top-level elements in a bundle\&. .PP \fBParameters\fP .RS 4 \fIb\fP The bundle to be counted\&. .RE .PP .SS "void lo_bundle_free (\fBlo_bundle\fP b)" .PP Frees the memory taken by a bundle object\&. .PP \fBParameters\fP .RS 4 \fIb\fP The bundle to be freed\&. .RE .PP .SS "void lo_bundle_free_messages (\fBlo_bundle\fP b)" .PP Obsolete, use lo_bundle_free_recursive instead\&. .PP \fBParameters\fP .RS 4 \fIb\fP The bundle, which may contain messages and nested bundles, to be freed\&. .RE .PP .SS "void lo_bundle_free_recursive (\fBlo_bundle\fP b)" .PP Frees the memory taken by a bundle object and its messages and nested bundles recursively\&. .PP \fBParameters\fP .RS 4 \fIb\fP The bundle, which may contain messages and nested bundles, to be freed\&. .RE .PP .SS "\fBlo_bundle\fP lo_bundle_get_bundle (\fBlo_bundle\fP b, int index)" .PP Gets a nested bundle contained within a bundle\&. Returns a \fBlo_bundle\fP at a given index within a bundle\&. .PP \fBReturns\fP .RS 4 The requested \fBlo_bundle\fP if successful, otherwise 0\&. .RE .PP .SS "\fBlo_message\fP lo_bundle_get_message (\fBlo_bundle\fP b, int index, const char ** path)" .PP Gets a message contained within a bundle\&. Returns a \fBlo_message\fP at a given index within a bundle, and optionally the path associated with that message\&. .PP \fBReturns\fP .RS 4 The requested \fBlo_message\fP if successful, otherwise 0\&. .RE .PP .SS "\fBlo_timetag\fP lo_bundle_get_timestamp (\fBlo_bundle\fP b)" .PP Get the timestamp associated with a bundle\&. .PP \fBParameters\fP .RS 4 \fIb\fP The bundle for which the timestamp should be returned\&. .RE .PP \fBReturns\fP .RS 4 The timestamp of the bundle as a \fBlo_timetag\fP\&. .RE .PP .SS "\fBlo_element_type\fP lo_bundle_get_type (\fBlo_bundle\fP b, int index)" .PP Gets the element type contained within a bundle\&. Returns a \fBlo_element_type\fP at a given index within a bundle\&. .PP \fBReturns\fP .RS 4 The requested \fBlo_element_type\fP if successful, otherwise 0\&. .RE .PP .SS "void lo_bundle_incref (\fBlo_bundle\fP b)" .PP 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\&. .SS "size_t lo_bundle_length (\fBlo_bundle\fP b)" .PP Return the length of a bundle in bytes\&. Includes the marker and typetag length\&. .PP \fBParameters\fP .RS 4 \fIb\fP The bundle to be sized .RE .PP .SS "\fBlo_bundle\fP lo_bundle_new (\fBlo_timetag\fP tt)" .PP Create a new bundle object\&. OSC Bundles encapsulate one or more OSC messages and may include a timestamp indicating when the bundle should be dispatched\&. .PP \fBParameters\fP .RS 4 \fItt\fP The timestamp when the bundle should be handled by the receiver\&. Pass LO_TT_IMMEDIATE if you want the receiving server to dispatch the bundle as soon as it receives it\&. .RE .PP .SS "void * lo_bundle_serialise (\fBlo_bundle\fP b, void * to, size_t * size)" .PP Serialise the bundle object to an area of memory and return a pointer to the serialised form\&. .PP \fBParameters\fP .RS 4 \fIb\fP The bundle to be serialised .br \fIto\fP The address to serialise to, memory will be allocated if to is NULL\&. .br \fIsize\fP If this pointer is non-NULL the size of the memory area will be written here .RE .PP The returned form is suitable to be sent over a low level OSC transport, having the correct endianess and bit-packed structure\&. .SS "int lo_coerce (\fBlo_type\fP type_to, \fBlo_arg\fP * to, \fBlo_type\fP type_from, \fBlo_arg\fP * from)" .PP Attempt to convert one OSC type to another\&. Numerical types (eg LO_INT32, LO_FLOAT etc\&.) may be converted to other numerical types and string types (LO_STRING and LO_SYMBOL) may be converted to the other type\&. This is done automatically if a received message matches the path, but not the exact types, and is coercible (ie\&. all numerical types in numerical positions)\&. .PP On failure no translation occurs and false is returned\&. .PP \fBParameters\fP .RS 4 \fItype_to\fP The type of the destination variable\&. .br \fIto\fP A pointer to the destination variable\&. .br \fItype_from\fP The type of the source variable\&. .br \fIfrom\fP A pointer to the source variable\&. .RE .PP .SS "char * lo_get_path (void * data, ssize_t size)" .PP Given a raw OSC message, return the message path\&. .PP \fBParameters\fP .RS 4 \fIdata\fP A pointer to the raw OSC message data\&. .br \fIsize\fP The size of data in bytes (total buffer bytes)\&. .RE .PP Returns the message path or NULL if an error occurs\&. Do not free() the returned pointer\&. .SS "\fBlo_hires\fP lo_hires_val (\fBlo_type\fP type, \fBlo_arg\fP * p)" .PP Return the numerical value of the given argument with the maximum native system precision\&. .SS "int lo_is_numerical_type (\fBlo_type\fP a)" .PP Return true if the type specified has a numerical value, such as LO_INT32, LO_FLOAT etc\&. .PP \fBParameters\fP .RS 4 \fIa\fP The type to be tested\&. .RE .PP .SS "int lo_is_string_type (\fBlo_type\fP a)" .PP Return true if the type specified has a textual value, such as LO_STRING or LO_SYMBOL\&. .PP \fBParameters\fP .RS 4 \fIa\fP The type to be tested\&. .RE .PP .SS "int lo_message_add (\fBlo_message\fP m, const char * types, \&.\&.\&.)" .PP Append a number of arguments to a message\&. The data will be added in OSC byteorder (bigendian)\&. .PP \fBParameters\fP .RS 4 \fIm\fP The message to be extended\&. .br \fItypes\fP The types of the data items in the message, types are defined in lo_types_common\&.h .br \fI\&.\&.\&.\fP The data values to be transmitted\&. The types of the arguments passed here must agree with the types specified in the type parameter\&. .RE .PP \fBReturns\fP .RS 4 Less than 0 on failure, 0 on success\&. .RE .PP .SS "int lo_message_add_blob (\fBlo_message\fP m, \fBlo_blob\fP a)" .PP Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. .PP \fBReturns\fP .RS 4 Less than 0 on failure, 0 on success\&. .RE .PP .SS "int lo_message_add_char (\fBlo_message\fP m, char a)" .PP Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. .PP \fBReturns\fP .RS 4 Less than 0 on failure, 0 on success\&. .RE .PP .SS "int lo_message_add_double (\fBlo_message\fP m, double a)" .PP Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. .PP \fBReturns\fP .RS 4 Less than 0 on failure, 0 on success\&. .RE .PP .SS "int lo_message_add_false (\fBlo_message\fP m)" .PP Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. .PP \fBReturns\fP .RS 4 Less than 0 on failure, 0 on success\&. .RE .PP .SS "int lo_message_add_float (\fBlo_message\fP m, float a)" .PP Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. .PP \fBReturns\fP .RS 4 Less than 0 on failure, 0 on success\&. .RE .PP .SS "int lo_message_add_infinitum (\fBlo_message\fP m)" .PP Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. .PP \fBReturns\fP .RS 4 Less than 0 on failure, 0 on success\&. .RE .PP .SS "int lo_message_add_int32 (\fBlo_message\fP m, int32_t a)" .PP Append a data item and typechar of the specified type to a message\&. The data will be added in OSC byteorder (bigendian)\&. .PP \fBParameters\fP .RS 4 \fIm\fP The message to be extended\&. .br \fIa\fP The data item\&. .RE .PP \fBReturns\fP .RS 4 Less than 0 on failure, 0 on success\&. .RE .PP .SS "int lo_message_add_int64 (\fBlo_message\fP m, int64_t a)" .PP Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. .PP \fBReturns\fP .RS 4 Less than 0 on failure, 0 on success\&. .RE .PP .SS "int lo_message_add_midi (\fBlo_message\fP m, uint8_t a[4])" .PP Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. .PP \fBReturns\fP .RS 4 Less than 0 on failure, 0 on success\&. .RE .PP .SS "int lo_message_add_nil (\fBlo_message\fP m)" .PP Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. .PP \fBReturns\fP .RS 4 Less than 0 on failure, 0 on success\&. .RE .PP .SS "int lo_message_add_string (\fBlo_message\fP m, const char * a)" .PP Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. .PP \fBReturns\fP .RS 4 Less than 0 on failure, 0 on success\&. .RE .PP .SS "int lo_message_add_symbol (\fBlo_message\fP m, const char * a)" .PP Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. .PP \fBReturns\fP .RS 4 Less than 0 on failure, 0 on success\&. .RE .PP .SS "int lo_message_add_timetag (\fBlo_message\fP m, \fBlo_timetag\fP a)" .PP Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. .PP \fBReturns\fP .RS 4 Less than 0 on failure, 0 on success\&. .RE .PP .SS "int lo_message_add_true (\fBlo_message\fP m)" .PP Append a data item and typechar of the specified type to a message\&. See \fBlo_message_add_int32()\fP for details\&. .PP \fBReturns\fP .RS 4 Less than 0 on failure, 0 on success\&. .RE .PP .SS "int lo_message_add_varargs (\fBlo_message\fP m, const char * types, va_list ap)" .PP Append a varargs list to a message\&. The data will be added in OSC byteorder (bigendian)\&. IMPORTANT: args list must be terminated with LO_ARGS_END, or this call will fail\&. This is used to do simple error checking on the sizes of parameters passed\&. .PP \fBParameters\fP .RS 4 \fIm\fP The message to be extended\&. .br \fItypes\fP The types of the data items in the message, types are defined in lo_types_common\&.h .br \fIap\fP The va_list created by a C function declared with an ellipsis (\&.\&.\&.) argument, and pre-initialised with "va_start(ap)"\&. The types of the arguments passed here must agree with the types specified in the type parameter\&. .RE .PP \fBReturns\fP .RS 4 Less than 0 on failure, 0 on success\&. .RE .PP .SS "void lo_message_clear (\fBlo_message\fP m)" .PP Clear elements from a \fBlo_message\fP but do not free allocated memory\&. .SS "\fBlo_message\fP lo_message_clone (\fBlo_message\fP m)" .PP Create a new \fBlo_message\fP object by cloning an already existing one\&. .SS "int lo_message_decref (\fBlo_message\fP m)" .PP Subtract one from a message's reference count\&. Messages are reference counted\&. In general decrementing the counter should be handled automatically using \fR\fBlo_message_free\fP\fP or \fR\fBlo_bundle_free_recursive\fP\fP, however if necessary the counter can be decremented manually\&. .SS "\fBlo_message\fP lo_message_deserialise (void * data, size_t size, int * result)" .PP Deserialise a raw OSC message and return a new \fBlo_message\fP object\&. Opposite of \fBlo_message_serialise()\fP\&. .PP \fBParameters\fP .RS 4 \fIdata\fP Pointer to the raw OSC message data in network transmission form (network byte order where appropriate)\&. .br \fIsize\fP The size of data in bytes .br \fIresult\fP If this pointer is non-NULL, the result or error code will be written here\&. .RE .PP Returns a new \fBlo_message\fP, or NULL if deserialisation fails\&. Use \fBlo_message_free()\fP to free the resulting object\&. .SS "void lo_message_free (\fBlo_message\fP m)" .PP Free memory allocated by \fBlo_message_new()\fP and any subsequent \fBlo_message_add_int32\fP lo_message_add*() calls\&. .SS "int lo_message_get_argc (\fBlo_message\fP m)" .PP Return the message argument count\&. The result is valid until further data is added with lo_message_add*()\&. .SS "\fBlo_arg\fP ** lo_message_get_argv (\fBlo_message\fP m)" .PP Return the message arguments\&. Do not free the returned data\&. The result is valid until further data is added with lo_message_add*()\&. .SS "\fBlo_address\fP lo_message_get_source (\fBlo_message\fP m)" .PP Returns the source (\fBlo_address\fP) of an incoming message\&. Returns NULL if the message is outgoing\&. Do not free the returned address\&. This is usually called on the \fBlo_message\fP passed to \fBlo_method_handler\fP, to set up bidirectional communication\&. See \fBexample_tcp_echo_server\&.c\fP for an example of this\&. .SS "\fBlo_timetag\fP lo_message_get_timestamp (\fBlo_message\fP m)" .PP Returns the timestamp (\fBlo_timetag\fP *) of a bundled incoming message\&. Returns LO_TT_IMMEDIATE if the message is outgoing, or did not arrive contained in a bundle\&. Do not free the returned timetag\&. .SS "char * lo_message_get_types (\fBlo_message\fP m)" .PP Return the message type tag string\&. The result is valid until further data is added with lo_message_add*()\&. .SS "void lo_message_incref (\fBlo_message\fP m)" .PP 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 \fR\fBlo_message_free\fP\fP or \fR\fBlo_bundle_free_recursive\fP\fP, with \fR\fBlo_bundle_free_recursive\fP\fP being the preferable method if bundles are used\&. .SS "size_t lo_message_length (\fBlo_message\fP m, const char * path)" .PP Return the length of a message in bytes\&. .PP \fBParameters\fP .RS 4 \fIm\fP The message to be sized .br \fIpath\fP The path the message will be sent to .RE .PP .SS "\fBlo_message\fP lo_message_new (void )" .PP Create a new \fBlo_message\fP object\&. .SS "void * lo_message_serialise (\fBlo_message\fP m, const char * path, void * to, size_t * size)" .PP Serialise the \fBlo_message\fP object to an area of memory and return a pointer to the serialised form\&. Opposite of \fBlo_message_deserialise()\fP\&. .PP \fBParameters\fP .RS 4 \fIm\fP The message to be serialised .br \fIpath\fP The path the message will be sent to .br \fIto\fP The address to serialise to, memory will be allocated if to is NULL\&. .br \fIsize\fP If this pointer is non-NULL the size of the memory area will be written here .RE .PP The returned form is suitable to be sent over a low level OSC transport, having the correct endianess and bit-packed structure\&. .SS "int lo_pattern_match (const char * str, const char * p)" .PP Test a string against an OSC pattern glob\&. .PP \fBParameters\fP .RS 4 \fIstr\fP The string to test .br \fIp\fP The pattern to test against .RE .PP \fBReturns\fP .RS 4 1 if true, 0 otherwise\&. .RE .PP .SS "int lo_send_bundle (\fBlo_address\fP targ, \fBlo_bundle\fP b)" .PP Send a \fBlo_bundle\fP object to address targ\&. Bundles are constructed with the \fBlo_bundle_new()\fP and \fBlo_bundle_add_message()\fP functions\&. .SS "int lo_send_bundle_from (\fBlo_address\fP targ, \fBlo_server\fP serv, \fBlo_bundle\fP b)" .PP Send a \fBlo_bundle\fP object to address targ from address of serv\&. Bundles are constructed with the \fBlo_bundle_new()\fP and \fBlo_bundle_add_message()\fP functions\&. .PP \fBParameters\fP .RS 4 \fItarg\fP The address to send the bundle to .br \fIserv\fP The server socket to send the bundle from (can be NULL to use new socket) .br \fIb\fP The bundle itself .RE .PP .SS "int lo_send_message (\fBlo_address\fP targ, const char * path, \fBlo_message\fP msg)" .PP Send a \fBlo_message\fP object to target targ\&. This is slightly more efficient than \fBlo_send()\fP if you want to send a lot of similar messages\&. The messages are constructed with the \fBlo_message_new()\fP and \fBlo_message_add*()\fP functions\&. .SS "int lo_send_message_from (\fBlo_address\fP targ, \fBlo_server\fP serv, const char * path, \fBlo_message\fP msg)" .PP Send a \fBlo_message\fP object to target targ from address of serv\&. This is slightly more efficient than \fBlo_send()\fP if you want to send a lot of similar messages\&. The messages are constructed with the \fBlo_message_new()\fP and \fBlo_message_add*()\fP functions\&. .PP \fBParameters\fP .RS 4 \fItarg\fP The address to send the message to .br \fIserv\fP The server socket to send the message from (can be NULL to use new socket) .br \fIpath\fP The path to send the message to .br \fImsg\fP The bundle itself .RE .PP .SS "int lo_server_add_bundle_handlers (\fBlo_server\fP s, \fBlo_bundle_start_handler\fP sh, \fBlo_bundle_end_handler\fP eh, void * user_data)" .PP Add bundle notification handlers to the specified server\&. .PP \fBParameters\fP .RS 4 \fIs\fP The server the method is to be added to\&. .br \fIsh\fP The callback function that will be called before the messages of a bundle are dispatched .br \fIeh\fP The callback function that will be called after the messages of a bundle are dispatched .br \fIuser_data\fP A value that will be passed to the user_data parameter of both callback functions\&. .RE .PP .SS "\fBlo_method\fP lo_server_add_method (\fBlo_server\fP s, const char * path, const char * typespec, \fBlo_method_handler\fP h, const void * user_data)" .PP Add an OSC method to the specifed server\&. .PP \fBParameters\fP .RS 4 \fIs\fP The server the method is to be added to\&. .br \fIpath\fP The OSC path to register the method to\&. If NULL is passed the method will match all paths\&. .br \fItypespec\fP 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\&. .br \fIh\fP The method handler callback function that will be called if a matching message is received .br \fIuser_data\fP A value that will be passed to the callback function, h, when its invoked matching from this method\&. .RE .PP \fBReturns\fP .RS 4 A unique pointer identifying the method\&. It should not be freed\&. .RE .PP .SS "int lo_server_del_lo_method (\fBlo_server\fP s, \fBlo_method\fP m)" .PP Delete a specific OSC method from the specified server\&. .PP \fBParameters\fP .RS 4 \fIs\fP The server the method is to be removed from\&. .br \fIm\fP The \fBlo_method\fP identifier returned from lo_server_add_method for the method to delete from the server\&. .RE .PP \fBReturns\fP .RS 4 Non-zero if it was not found in the list of methods for the server\&. .RE .PP .SS "void lo_server_del_method (\fBlo_server\fP s, const char * path, const char * typespec)" .PP Delete an OSC method from the specified server\&. .PP \fBParameters\fP .RS 4 \fIs\fP The server the method is to be removed from\&. .br \fIpath\fP The OSC path of the method to delete\&. If NULL is passed the method will match the generic handler\&. .br \fItypespec\fP The typespec the method accepts\&. .RE .PP .SS "int lo_server_dispatch_data (\fBlo_server\fP s, void * data, size_t size)" .PP Dispatch a raw block of memory containing an OSC message\&. This is useful when a raw block of memory is available that is structured as OSC, and you wish to use liblo to dispatch the message to a handler function as if it had been received over the network\&. .PP \fBParameters\fP .RS 4 \fIs\fP The \fBlo_server\fP to use for dispatching\&. .br \fIdata\fP Pointer to the raw OSC message data in network transmission form (network byte order where appropriate)\&. .br \fIsize\fP The size of data in bytes .RE .PP Returns the number of bytes used if successful, or less than 0 otherwise\&. .SS "int lo_server_enable_coercion (\fBlo_server\fP server, int enable)" .PP Enables or disables type coercion during message dispatch\&. .PP \fBParameters\fP .RS 4 \fIserver\fP The server to toggle this option for\&. .br \fIenable\fP Non-zero to enable, or zero to disable type coercion\&. .RE .PP \fBReturns\fP .RS 4 The previous value of this option\&. .RE .PP .SS "int lo_server_enable_queue (\fBlo_server\fP s, int queue_enabled, int dispatch_remaining)" .PP 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 \fBlo_message_get_timestamp()\fP to get the message timestamp from within a method handler\&. .PP \fBParameters\fP .RS 4 \fIs\fP A liblo server .br \fIqueue_enabled\fP Zero to disable queue, non-zero to enable\&. .br \fIdispatch_remaining\fP If non-zero, previously queued messages will be immediately dispatched when queue is disabled\&. .RE .PP \fBReturns\fP .RS 4 The previous state of queue behaviour\&. Zero if queueing was previously disabled, non-zero otherwise\&. .RE .PP .SS "int lo_server_events_pending (\fBlo_server\fP s)" .PP Return true if there are scheduled events (eg\&. from bundles) waiting to be dispatched by the server\&. .SS "void lo_server_free (\fBlo_server\fP s)" .PP Free up memory used by the \fBlo_server\fP object\&. .PP Referenced by \fBlo::Server::~Server()\fP\&. .SS "int lo_server_get_port (\fBlo_server\fP s)" .PP 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 address the server\&. .SS "int lo_server_get_protocol (\fBlo_server\fP s)" .PP Return the protocol that the server is using\&. Returned value will be one of LO_UDP, LO_TCP or LO_UNIX\&. .SS "int lo_server_get_socket_fd (\fBlo_server\fP s)" .PP Return the file descriptor of the server socket\&. If the server protocol supports exposing the server's underlying receive mechanism for monitoring with select() or poll(), this function returns the file descriptor needed, otherwise, it returns -1\&. .PP WARNING: when using this function beware that not all OSC packets that are received are dispatched immediately\&. \fBlo_server_events_pending()\fP and \fBlo_server_next_event_delay()\fP can be used to tell if there are pending events and how long before you should attempt to receive them\&. .SS "char * lo_server_get_url (\fBlo_server\fP s)" .PP 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\&. .SS "int lo_server_max_msg_size (\fBlo_server\fP s, int req_size)" .PP Set the maximum message size accepted by a server\&. For UDP servers, the maximum message size cannot exceed 64k, due to the UDP transport specifications\&. For TCP servers, this number may be larger, but be aware that one or more contiguous blocks of memory of this size may be allocated by liblo\&. (At least one per connection\&.) .PP \fBParameters\fP .RS 4 \fIs\fP The server on which to operate\&. .br \fIreq_size\fP The new maximum message size to request, 0 if it should not be modified, or -1 if it should be set to unlimited\&. Note that an unlimited message buffer may make your application open to a denial of service attack\&. .RE .PP \fBReturns\fP .RS 4 The new maximum message size is returned, which may or may not be equal to req_size\&. If -1 is returned, maximum size is unlimited\&. .RE .PP .SS "\fBlo_server\fP lo_server_new (const char * port, \fBlo_err_handler\fP err_h)" .PP Create a new server instance\&. Using \fBlo_server_recv()\fP, lo_servers block until they receive OSC messages\&. Most likely you want non-blocking behaviour, so use of \fBlo_server_recv_noblock()\fP is encouraged or the \fBlo_server_thread_new\fP and "lo_server_thread_*" functions\&. .PP \fBParameters\fP .RS 4 \fIport\fP If NULL is passed then an unused UDP port will be chosen by the system, its number may be retrieved with \fBlo_server_thread_get_port()\fP so it can be passed to clients\&. Otherwise a decimal port number, service name or UNIX domain socket path may be passed\&. .br \fIerr_h\fP 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 want error handling\&. .RE .PP .PP Referenced by \fBlo::Server::Server()\fP, and \fBlo::Server::Server()\fP\&. .SS "\fBlo_server\fP lo_server_new_from_config (\fBlo_server_config\fP * config)" .PP Create a new server instance, using a configuration struct\&. .PP \fBParameters\fP .RS 4 \fIconfig\fP A pre-initialized config struct\&. A pointer to it will not be kept\&. .RE .PP \fBReturns\fP .RS 4 A new \fBlo_server\fP instance\&. .RE .PP .SS "\fBlo_server\fP lo_server_new_from_url (const char * url, \fBlo_err_handler\fP err_h)" .PP Create a new server instance, taking port and the optional multicast group IP from an URL string\&. .PP \fBParameters\fP .RS 4 \fIurl\fP The URL to specify the server parameters\&. .br \fIerr_h\fP 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 want error handling\&. .RE .PP \fBReturns\fP .RS 4 A new \fBlo_server\fP instance\&. .RE .PP .SS "\fBlo_server\fP lo_server_new_multicast (const char * group, const char * port, \fBlo_err_handler\fP err_h)" .PP Create a new server instance, and join a UDP multicast group\&. .PP \fBParameters\fP .RS 4 \fIgroup\fP 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 .br \fIport\fP 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\&. .br \fIerr_h\fP 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 want error handling\&. .RE .PP .PP Referenced by \fBlo::Server::Server()\fP\&. .SS "\fBlo_server\fP lo_server_new_multicast_iface (const char * group, const char * port, const char * iface, const char * ip, \fBlo_err_handler\fP err_h)" .PP 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\&. .PP \fBParameters\fP .RS 4 \fIgroup\fP 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 .br \fIport\fP 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\&. .br \fIiface\fP A string specifying the name of a network interface to use, or zero if not specified\&. .br \fIip\fP A string specifying the IP address of a network interface to use, or zero if not specified\&. .br \fIerr_h\fP 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 want error handling\&. .RE .PP .PP Referenced by \fBlo::Server::Server()\fP, and \fBlo::Server::Server()\fP\&. .SS "\fBlo_server\fP lo_server_new_with_proto (const char * port, int proto, \fBlo_err_handler\fP err_h)" .PP Create a new server instance, specifying protocol\&. Using \fBlo_server_recv()\fP, lo_servers block until they receive OSC messages\&. Most likely you want non-blocking behaviour, so use of \fBlo_server_recv_noblock()\fP is encouraged or the \fBlo_server_thread_new\fP and "lo_server_thread_*" functions\&. .PP \fBParameters\fP .RS 4 \fIport\fP If using UDP then NULL may be passed to find an unused port\&. Otherwise a decimal port number orservice name or may be passed\&. If using UNIX domain sockets then a socket path should be passed here\&. .br \fIproto\fP The protocol to use, should be one of LO_UDP, LO_TCP or LO_UNIX\&. .br \fIerr_h\fP 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 want error handling\&. .RE .PP .PP Referenced by \fBlo::Server::Server()\fP, and \fBlo::Server::Server()\fP\&. .SS "double lo_server_next_event_delay (\fBlo_server\fP s)" .PP Return the time in seconds until the next scheduled event\&. If the delay is greater than 100 seconds then it will return 100\&.0\&. .SS "int lo_server_recv (\fBlo_server\fP s)" .PP Block, waiting for an OSC message to be received\&. The blocking behavior of this function is, in most cases, undesireable, since a program with no incoming messages may never exit\&. It is encouraged to use \fBlo_server_recv_noblock()\fP instead, which is equivalent to \fBlo_server_wait()\fP and then \fBlo_server_recv()\fP\&. .PP The return value is the number of bytes in the received message\&. The message will be dispatched to a matching method if one is found\&. In cases where no message is received but returning is necessary anyway, this function may return 0\&. .SS "int lo_server_recv_noblock (\fBlo_server\fP s, int timeout)" .PP Look for an OSC message waiting to be received\&. In new programs, this function should be prefered over \fBlo_server_recv()\fP\&. .PP \fBParameters\fP .RS 4 \fIs\fP The server to wait for connections on\&. .br \fItimeout\fP A timeout in milliseconds to wait for the incoming packet\&. a value of 0 will return immediately\&. .RE .PP The return value is the number of bytes in the received message or 0 if there is no message\&. The message will be dispatched to a matching method if one is found\&. .SS "int lo_server_wait (\fBlo_server\fP s, int timeout)" .PP Wait for an OSC message to be received\&. .PP \fBParameters\fP .RS 4 \fIs\fP The server to wait for connections on\&. .br \fItimeout\fP A timeout in milliseconds to wait for the incoming packet\&. a value of 0 will return immediately\&. .RE .PP The return value is 1 if there is a message waiting, 0 if there is no message, and -1 if there is an error that causes the function to return early\&. If there is a message waiting you can now call \fBlo_server_recv()\fP to receive that message\&. This is preferable to using \fBlo_server_recv()\fP alone, since otherwise it may never exit if no new messages are incoming\&. .SS "int lo_servers_recv_noblock (\fBlo_server\fP * s, int * recvd, int num_servers, int timeout)" .PP Look for an OSC message waiting to be received on multiple servers\&. .PP \fBParameters\fP .RS 4 \fIs\fP As array of servers to wait for connections on\&. .br \fIrecvd\fP An array to store the number of bytes received by each server in array s\&. .br \fInum_servers\fP The number of servers in the array s\&. .br \fItimeout\fP A timeout in milliseconds to wait for the incoming packet\&. a value of 0 will return immediately\&. .RE .PP The return value is the total number of bytes received by all servers\&. The messages will be dispatched to a matching method if one is found\&. .SS "int lo_servers_wait (\fBlo_server\fP * s, int * status, int num_servers, int timeout)" .PP Wait on multiple servers for an OSC message to be received\&. .PP \fBParameters\fP .RS 4 \fIs\fP An array of servers to wait for connections on\&. .br \fIstatus\fP An array to receive the status of each server\&. .br \fInum_servers\fP The number of servers in the array s\&. .br \fItimeout\fP A timeout in milliseconds to wait for the incoming packet\&. a value of 0 will return immediately\&. .RE .PP The return value is the number of servers with a message waiting or -1 if there is an error that causes the function to return early\&. If there is a message waiting you can now call \fBlo_server_recv()\fP to receive that message\&. This is preferable to using \fBlo_server_recv()\fP alone, since otherwise it may never exit if no new messages are incoming\&. .SS "int lo_string_contains_pattern (const char * str)" .PP Test if a string contains any OSC pattern characters\&. .PP \fBParameters\fP .RS 4 \fIstr\fP The string to test .RE .PP \fBReturns\fP .RS 4 1 if true, 0 otherwise\&. .RE .PP .SS "int lo_strsize (const char * s)" .PP A function to calculate the amount of OSC message space required by a C char *\&. Returns the storage size in bytes, which will always be a multiple of four\&. .SS "double lo_timetag_diff (\fBlo_timetag\fP a, \fBlo_timetag\fP b)" .PP Find the time difference between two timetags\&. Returns a - b in seconds\&. .SS "void lo_timetag_now (\fBlo_timetag\fP * t)" .PP Return a timetag for the current time\&. On exit the timetag pointed to by t is filled with the OSC representation of this instant in time\&. .PP Referenced by \fBlo::now()\fP\&. .SS "char * lo_url_get_hostname (const char * url)" .PP Return the hostname portion of an OSC URL\&. The return value should be free()'d when it is no longer needed\&. .SS "char * lo_url_get_path (const char * url)" .PP Return the path portion of an OSC URL\&. The return value should be free()'d when it is no longer needed\&. .SS "char * lo_url_get_port (const char * url)" .PP Return the port portion of an OSC URL\&. The return value should be free()'d when it is no longer needed\&. .SS "char * lo_url_get_protocol (const char * url)" .PP 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 prot part is missing, UDP is assumed\&. .PP The return value should be free()'d when it is no longer needed\&. .SS "int lo_url_get_protocol_id (const char * url)" .PP Return the protocol ID of an OSC URL\&. This library uses OSC URLs of the form: osc\&.prot://hostname:port/path if the prot part is missing, UDP is assumed\&. Returned value will be one of LO_UDP, LO_TCP, LO_UNIX or -1\&. .PP \fBReturns\fP .RS 4 An integer specifying the protocol\&. Return -1 when the protocol is not supported by liblo\&. .RE .PP .SH "Author" .PP Generated automatically by Doxygen for liblo from the source code\&.