liblolowlevel(3)
โจ NAME โจ
okay so bestie, meet liblolowlevel(3) from the Library Functions Manual ๐ โ it's the Low-level OSC API. That's the whole name situation, and yes, it's giving foundational C library energy.
๐ฆ SYNOPSIS ๐ฆ
๐ฆ Data Structures ๐ฆ
struct lo_server_configโ a configuration struct for initializinglo_serverusinglo_server_new_from_config(). Think of it as the setup sheet before the main character server makes its entrance โจ.
๐ท๏ธ Typedefs ๐ท๏ธ
typedef long double lo_hiresโ type used to represent numerical values in conversions between OSC types. It's the numeric bestie for OSC type conversions, periodt ๐ .
๐ Enumerations ๐
enum lo_slip_encodingโ used withlo_address_set_stream_slip()to specify whether sent messages should be encoded with SLIP, and whether the encoding should be single- or double-ENDed. So it's the switch that decides SLIP encoding vibes and ENDing style ๐ฆ.
Functions ๐โจ
okay so this is the actual menu of everything you can call, bestie. Every single one, no skips. Go get your snack, this is a long one. ๐
int lo_send_message (lo_address targ, const char *path, lo_message msg)โ yeets alo_messageobject over to targettarg. ๐int lo_send_message_from (lo_address targ, lo_server serv, const char *path, lo_message msg)โ same energy, but the message goes totargfrom the address ofserv. it's giving "who's your sender" ๐int lo_send_bundle (lo_address targ, lo_bundle b)โ sends alo_bundleobject to addresstarg. bundle goes brrr ๐int lo_send_bundle_from (lo_address targ, lo_server serv, lo_bundle b)โ sends alo_bundleobject to addresstarg, except it's coming from the address ofserv. ๐
lo_message lo_message_new (void)โ creates a brand newlo_messageobject. newborn icon ๐ถโจvoid lo_message_incref (lo_message m)โ adds one to a message's reference count. +1 bestie ๐int lo_message_decref (lo_message m)โ subtracts one from a message's reference count. bye girl ๐lo_message lo_message_clone (lo_message m)โ creates a newlo_messageobject by cloning one that already exists. literally its twin ๐ชvoid lo_message_free (lo_message m)โ frees the memory allocated bylo_message_new()and any subsequentlo_message_add_int32lo_message_add*()calls. clean up after yourself fr fr ๐งนvoid lo_message_clear (lo_message m)โ clears the elements out of alo_messagebut does not free the allocated memory. emptied, not evicted ๐ซถint lo_message_add (lo_message m, const char *types,...)โ appends a number of arguments to a message. pile 'em on ๐ฅint lo_message_add_varargs (lo_message m, const char *types, va_list ap)โ appends a varargs list to a message. the varargs girlies ate ๐
int lo_message_add_int32 (lo_message m, int32_t a)โ appends a data item and typechar of the specified type to a message. this one's the blueprint, everyone else points here ๐int lo_message_add_float (lo_message m, float a)โ appends a data item and typechar of the specified type to a message. seelo_message_add_int32()for details.int lo_message_add_string (lo_message m, const char *a)โ appends a data item and typechar of the specified type to a message. seelo_message_add_int32()for details.int lo_message_add_blob (lo_message m, lo_blob a)โ appends a data item and typechar of the specified type to a message. seelo_message_add_int32()for details.int lo_message_add_int64 (lo_message m, int64_t a)โ appends a data item and typechar of the specified type to a message. seelo_message_add_int32()for details.int lo_message_add_timetag (lo_message m, lo_timetag a)โ appends a data item and typechar of the specified type to a message. seelo_message_add_int32()for details.int lo_message_add_double (lo_message m, double a)โ appends a data item and typechar of the specified type to a message. seelo_message_add_int32()for details.int lo_message_add_symbol (lo_message m, const char *a)โ appends a data item and typechar of the specified type to a message. seelo_message_add_int32()for details.int lo_message_add_char (lo_message m, char a)โ appends a data item and typechar of the specified type to a message. seelo_message_add_int32()for details.int lo_message_add_midi (lo_message m, uint8_t a[4])โ appends a data item and typechar of the specified type to a message. seelo_message_add_int32()for details.int lo_message_add_true (lo_message m)โ appends a data item and typechar of the specified type to a message. seelo_message_add_int32()for details.int lo_message_add_false (lo_message m)โ appends a data item and typechar of the specified type to a message. seelo_message_add_int32()for details.int lo_message_add_nil (lo_message m)โ appends a data item and typechar of the specified type to a message. seelo_message_add_int32()for details.int lo_message_add_infinitum (lo_message m)โ appends a data item and typechar of the specified type to a message. seelo_message_add_int32()for details. infinite, literally โ ๐ญ
lo_address lo_message_get_source (lo_message m)โ returns the source (lo_address) of an incoming message. who sent this?? ๐ฌlo_timetag lo_message_get_timestamp (lo_message m)โ returns the timestamp (lo_timetag *) of a bundled incoming message. when did this happen โฐchar * lo_message_get_types (lo_message m)โ return the message type tag string. the receipts ๐งพint lo_message_get_argc (lo_message m)โ return the message argument count. how many arguments, bestie ๐ขlo_arg ** lo_message_get_argv (lo_message m)โ return the message arguments. do not free the returned data. > hands off, it's not yours to free ๐size_t lo_message_length (lo_message m, const char *path)โ return the length of a message in bytes. measuring tape out ๐void * lo_message_serialise (lo_message m, const char *path, void *to, size_t *size)โ serialises thelo_messageobject to an area of memory and returns a pointer to the serialised form. it's the opposite oflo_message_deserialise(). glowed up into raw bytes โจlo_message lo_message_deserialise (void *data, size_t size, int *result)โ deserialises a raw OSC message and returns a newlo_messageobject. opposite oflo_message_serialise(). raw bytes, but make it a message ๐ซint lo_server_dispatch_data (lo_server s, void *data, size_t size)โ dispatch a raw block of memory containing an OSC message. send it where it needs to go ๐โโ๏ธ
const char * lo_address_get_hostname (lo_address a)โ return the hostname of alo_addressobject. where do you live ๐const char * lo_address_get_port (lo_address a)โ return the port/service name of alo_addressobject. which door ๐ชint lo_address_get_protocol (lo_address a)โ return the protocol of alo_addressobject. how do you travel ๐ผchar * lo_address_get_url (lo_address a)โ return a URL representing an OSC address. link in bio ๐void lo_address_set_ttl (lo_address t, int ttl)โ set the Time-to-Live value for a given target address. how many hops before it gives up ๐ตint lo_address_get_ttl (lo_address t)โ get the Time-to-Live value for a given target address. same but read-only bestie ๐int lo_address_set_iface (lo_address t, const char *iface, const char *ip)โ set the network interface to use for a given target address. pick your lane ๐ฃ๏ธconst char * lo_address_get_iface (lo_address t)โ get the name of the network interface assigned to an OSC address. which lane tho ๐งint lo_address_set_tcp_nodelay (lo_address t, int enable)โ set theTCP_NODELAYflag on outgoing TCP connections. no waiting around, we move fast โกint lo_address_set_stream_slip (lo_address t, lo_slip_encoding encoding)โ set outgoing stream connections (e.g., TCP) to be transmitted using the SLIP packetizing protocol. slipping into something comfy ๐ฉฐ
lo_bundle lo_bundle_new (lo_timetag tt)โ create a new bundle object. bundle baby ๐void lo_bundle_incref (lo_bundle b)โ add one to a bundle's reference count. +1 for the bundle ๐int lo_bundle_add_message (lo_bundle b, const char *path, lo_message m)โ adds an OSC message to an existing bundle. tuck it in ๐ผint lo_bundle_add_bundle (lo_bundle b, lo_bundle n)โ adds an OSC bundle to an existing bundle. bundle-ception, nesting era ๐ชsize_t lo_bundle_length (lo_bundle b)โ return the length of a bundle in bytes. ๐unsigned int lo_bundle_count (lo_bundle b)โ return the number of top-level elements in a bundle. top-level only, don't count the babies ๐ขlo_element_type lo_bundle_get_type (lo_bundle b, int index)โ gets the element type contained within a bundle. what even are you ๐lo_bundle lo_bundle_get_bundle (lo_bundle b, int index)โ gets a nested bundle contained within a bundle. the bundle inside the bundle ๐ชlo_message lo_bundle_get_message (lo_bundle b, int index, const char **path)โ gets a message contained within a bundle. found her ๐lo_timetag lo_bundle_get_timestamp (lo_bundle b)โ get the timestamp associated with a bundle. โฐvoid * lo_bundle_serialise (lo_bundle b, void *to, size_t *size)โ serialise the bundle object to an area of memory and return a pointer to the serialised form. bytes era โจvoid lo_bundle_free (lo_bundle b)โ frees the memory taken by a bundle object. say bye ๐void lo_bundle_free_recursive (lo_bundle b)โ frees the memory taken by a bundle object and its messages and nested bundles recursively. the whole tree, gone, no crumbs ๐งนvoid lo_bundle_free_messages (lo_bundle b)โ obsolete, uselo_bundle_free_recursiveinstead. > she's retired bestie, don't call her ๐
int lo_is_numerical_type (lo_type a)โ return true if the type specified has a numerical value, such asLO_INT32,LO_FLOATetc. is it math-coded ๐งฎint lo_is_string_type (lo_type a)โ return true if the type specified has a textual value, such asLO_STRINGorLO_SYMBOL. is it word-coded ๐int lo_coerce (lo_type type_to, lo_arg *to, lo_type type_from, lo_arg *from)โ attempt to convert one OSC type to another. glow-up transformation ๐lo_hires lo_hires_val (lo_type type, lo_arg *p)โ return the numerical value of the given argument with the maximum native system precision. maximum precision, no rounding, we're precise ๐ค
lo_server lo_server_new (const char *port, lo_err_handler err_h)โ create a new server instance. hi server ๐ซถlo_server lo_server_new_with_proto (const char *port, int proto, lo_err_handler err_h)โ create a new server instance, specifying protocol. same but you pick the protocol ๐lo_server lo_server_new_multicast (const char *group, const char *port, lo_err_handler err_h)โ create a new server instance, and join a UDP multicast group. joining the group chat fr fr ๐ขlo_server lo_server_new_multicast_iface (const char *group, const char *port, const char *iface, const char *ip, lo_err_handler err_h)โ create a new server instance, and join a UDP multicast group, optionally specifying which network interface to use. note that usually only one ofifaceoripare specified. pick one, not both, iykyk ๐lo_server lo_server_new_from_url (const char *url, lo_err_handler err_h)โ create a new server instance, taking port and the optional multicast group IP from an URL string. everything from the link ๐lo_server lo_server_new_from_config (lo_server_config *config)โ create a new server instance, using a configuration struct. structured and organized ๐int lo_server_enable_coercion (lo_server server, int enable)โ enables or disables type coercion during message dispatch. on or off, your call ๐void lo_server_free (lo_server s)โ free up memory used by thelo_serverobject. bye server ๐
int lo_server_wait (lo_server s, int timeout)โ wait for an OSC message to be received. sitting pretty, waiting โint lo_servers_wait (lo_server *s, int *status, int num_servers, int timeout)โ wait on multiple servers for an OSC message to be received. multitasking queen ๐int lo_server_recv_noblock (lo_server s, int timeout)โ look for an OSC message waiting to be received. peek, don't block ๐int lo_servers_recv_noblock (lo_server *s, int *recvd, int num_servers, int timeout)โ look for an OSC message waiting to be received on multiple servers. peeking at all of them at once ๐ญint lo_server_recv (lo_server s)โ block, waiting for an OSC message to be received. she will stand there until it arrives, periodt โ
lo_method lo_server_add_method (lo_server s, const char *path, const char *typespec, lo_method_handler h, const void *user_data)โ add an OSC method to the specifed server. new method just dropped ๐void lo_server_del_method (lo_server s, const char *path, const char *typespec)โ delete an OSC method from the specified server. method, you're fired ๐int lo_server_del_lo_method (lo_server s, lo_method m)โ delete a specific OSC method from the specified server. targeted removal, very specific ๐ฏint lo_server_add_bundle_handlers (lo_server s, lo_bundle_start_handler sh, lo_bundle_end_handler eh, void *user_data)โ add bundle notification handlers to the specified server. start AND end, both notified ๐int lo_server_get_socket_fd (lo_server s)โ return the file descriptor of the server socket. the fd, hand it over ๐ซint lo_server_get_port (lo_server s)โ return the port number that the server has bound to. which port did she claim ๐ช
and bestie, we are NOT done, there's more coming, stay with me ๐
int lo_server_get_protocol (lo_server s)โ Returns the protocol that the server is using. slay ๐char * lo_server_get_url (lo_server s)โ Returns an OSC URL that can be used to contact the server. so handy ๐ฆint lo_server_enable_queue (lo_server s, int queue_enabled, int dispatch_remaining)โ 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, uselo_message_get_timestamp()to get the message timestamp from within a method handler. time vibes โฐint lo_server_events_pending (lo_server s)โ Returns true if there are scheduled events (eg. from bundles) waiting to be dispatched by the server. eyes on the queue ๐double lo_server_next_event_delay (lo_server s)โ Returns the time in seconds until the next scheduled event. countdown โณint lo_server_max_msg_size (lo_server s, int req_size)โ Set the maximum message size accepted by a server. size matters ๐char * lo_url_get_protocol (const char *url)โ Returns the protocol portion of an OSC URL, eg.udp,tcp. protocol tea ๐int lo_url_get_protocol_id (const char *url)โ Returns the protocol ID of an OSC URL. ID check ๐char * lo_url_get_hostname (const char *url)โ Returns the hostname portion of an OSC URL. where you at ๐char * lo_url_get_port (const char *url)โ Returns the port portion of an OSC URL. port numbers ๐char * lo_url_get_path (const char *url)โ Returns the path portion of an OSC URL. the path less traveled ๐ค๏ธint lo_strsize (const char *s)โ A function to calculate the amount of OSC message space required by a Cchar *. math but make it cute ๐uint32_t lo_blobsize (lo_blob b)โ A function to calculate the amount of OSC message space required by alo_blobobject. blob math ๐งฎint lo_pattern_match (const char *str, const char *p)โ Test a string against an OSC pattern glob. matchmaker ๐ฏint lo_string_contains_pattern (const char *str)โ Test if a string contains any OSC pattern characters. detective work ๐double lo_timetag_diff (lo_timetag a, lo_timetag b)โ Find the time difference between two timetags. time math โฑ๏ธvoid lo_timetag_now (lo_timetag *t)โ Return a timetag for the current time. right now โsize_t lo_arg_size (lo_type type, void *data)โ Return the storage size, in bytes, of the given argument. size of arg ๐ฆchar * lo_get_path (void *data, ssize_t size)โ Given a raw OSC message, return the message path. path reveal ๐ฃ๏ธvoid lo_arg_host_endian (lo_type type, void *data)โ Convert the specified argument to host byte order where necessary. endian switch ๐void lo_arg_network_endian (lo_type type, void *data)โ Convert the specified argument to network byte order where necessary. network endian ๐
โจ Detailed Description โจ
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. iykyk ๐
๐ Typedef Documentation ๐
typedef long double lo_hires
Type used to represent numerical values in conversions between OSC types.
Definition at line 56 of file lo_lowlevel.h. fancy precision โจ
๐ท๏ธ Enumeration Type Documentation ๐ท๏ธ
enum lo_slip_encoding
Used with lo_address_set_stream_slip() to specify whether sent messages should be encoded with SLIP, and whether the encoding should be single- or double-ENDed.
Definition at line 85 of file lo_lowlevel.h. slip slidin' ๐ท
๐ ๏ธ Function Documentation ๐ ๏ธ
const char * lo_address_get_hostname (lo_address a)
Return the hostname of a lo_address object. Returned value must not be modified or free'd. Value will be a dotted quad, colon'd IPV6 address, or resolvable name. hostname tea ๐
const char * lo_address_get_iface (lo_address t)
Get the name of the network interface assigned to an OSC address. interface vibes ๐ฅ๏ธ
Parameters:
tโ An OSC address.
Returns:
- A string pointer or
0if no interface has been assigned. Caller should not modify the provided string. It is a legal pointer until the next call tolo_address_set_ifaceorlo_address_free. don't touch ๐ โโ๏ธ
const char * lo_address_get_port (lo_address a)
Return the port/service name of a lo_address object. Returned value must not be modified or free'd. Value will be a service name or ASCII representation of the port number. port please ๐
int lo_address_get_protocol (lo_address a)
Return the protocol of a lo_address object. Returned value will be one of LO_UDP, LO_TCP or LO_UNIX. protocol check ๐
int lo_address_get_ttl (lo_address t)
Get the Time-to-Live value for a given target address. TTL baby โณ
Parameters:
tโ An OSC address.
Returns:
- An integer specifying the scope of a multicast UDP message. scope it out ๐
char * lo_address_get_url (lo_address a)
Return a URL representing an OSC address. Returned value must be free'd. free it later ๐๏ธ
int lo_address_set_iface (lo_address t, const char * iface, const char * ip)
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. interface assignment ๐ ๏ธ
Parameters:
tโ An OSC address.ifaceโ The name of a network interface on the local system.ipโ The IP address of a network interface on the local system.
Returns:
0if the interface was successfully identified, or non-zero otherwise. zero is good โ
int lo_address_set_stream_slip (lo_address t, lo_slip_encoding encoding)
Set outgoing stream connections (e.g., TCP) to be transmitted using the SLIP packetizing protocol. slip it ๐ท
Parameters:
tโ The address to set this flag for.encodingโ Specify single- or double-ENDed SLIP, or disable SLIP.
Returns:
- the previous value of this flag. flag history ๐ฉ
int lo_address_set_tcp_nodelay (lo_address t, int enable)
Set the TCP_NODELAY flag on outgoing TCP connections. no delay โก
Parameters:
tโ The address to set this flag for.enableโ Non-zero to set the flag, zero to unset it.
Returns:
- the previous value of this flag. flag check ๐ฉ
void lo_address_set_ttl (lo_address t, int ttl)
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. TTL rules ๐
Parameters:
tโ An OSC address.ttlโ An integer specifying the scope of a multicast UDP message.
void lo_arg_host_endian (lo_type type, void * data)
Convert the specified argument to host byte order where necessary. endian flip ๐
Parameters:
typeโ The OSC type of the data item (eg.LO_FLOAT).dataโ A pointer to the data item to be converted. It is changed in-place.
void lo_arg_network_endian (lo_type type, void * data)
Convert the specified argument to network byte order where necessary. network flip ๐
Parameters:
typeโ The OSC type of the data item (eg.LO_FLOAT).dataโ A pointer to the data item to be converted. It is changed in-place.
size_t lo_arg_size (lo_type type, void * data)
Return the storage size, in bytes, of the given argument. size it ๐
uint32_t lo_blobsize (lo_blob b)
A function to calculate the amount of OSC message space required by a lo_blob object. Returns the storage size in bytes, which will always be a multiple of four. blob math ๐งฎ
int lo_bundle_add_bundle (lo_bundle b, lo_bundle n)
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. bundle inception ๐
Returns:
0if successful, less than0otherwise. zero or bust โ
int lo_bundle_add_message (lo_bundle b, const char * path, lo_message m)
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'. message drop ๐จ
Returns:
0if successful, less than0otherwise. success vibes โ
unsigned int lo_bundle_count (lo_bundle b)
Return the number of top-level elements in a bundle. count 'em ๐ข
Parameters:
bโ The bundle to be counted.
void lo_bundle_free (lo_bundle b)
Frees the memory taken by a bundle object. free it ๐๏ธ
Parameters:
bโ The bundle to be freed.
void lo_bundle_free_messages (lo_bundle b)
Obsolete, use lo_bundle_free_recursive instead. old and busted โ ๏ธ
Parameters:
bโ The bundle, which may contain messages and nested bundles, to be freed.
void lo_bundle_free_recursive (lo_bundle b)
Frees the memory taken by a bundle object and its messages and nested bundles recursively. deep free ๐
Parameters:
bโ The bundle, which may contain messages and nested bundles, to be freed.
lo_bundle lo_bundle_get_bundle (lo_bundle b, int index)
Gets a nested bundle contained within a bundle. Returns a lo_bundle at a given index within a bundle. nested bundle ๐
Returns:
- The requested
lo_bundleif successful, otherwise0. get it โ
lo_message lo_bundle_get_message (lo_bundle b, int index, const char ** path)
Gets a message contained within a bundle. Returns a lo_message at a given index within a bundle, and optionally the path associated with that message. message extraction ๐ฉ
Returns:
- The requested
lo_messageif successful, otherwise0. got it โ
lo_timetag lo_bundle_get_timestamp (lo_bundle b)
Get the timestamp associated with a bundle. timestamp tea โฑ๏ธ
Parameters:
bโ The bundle for which the timestamp should be returned.
Returns:
- The timestamp of the bundle as a
lo_timetag. time stamp ๐ฐ๏ธ
lo_element_type lo_bundle_get_type (lo_bundle b, int index)
Gets the element type contained within a bundle. Returns a lo_element_type at a given index within a bundle. type check ๐
Returns:
- The requested
lo_element_typeif successful, otherwise0. type vibes โ
void lo_bundle_incref (lo_bundle b)
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. ref count ๐ข
size_t lo_bundle_length (lo_bundle b)
Return the length of a bundle in bytes. Includes the marker and typetag length. length check ๐
Parameters:
bโ The bundle to be sized
lo_bundle lo_bundle_new (lo_timetag tt)
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. new bundle who dis ๐
Parameters:
ttโ The timestamp when the bundle should be handled by the receiver. PassLO_TT_IMMEDIATEif you want the receiving server to dispatch the bundle as soon as it receives it.
void * lo_bundle_serialise (lo_bundle b, void * to, size_t * size)
Serialise the bundle object to an area of memory and return a pointer to the serialised form. serialise it ๐ฆ
โฆand we're still deep in that parameter list from the serialise situation, so let's finish it off bestie:
bโ the bundle to be serialised ๐toโ the address to serialise to, memory will be allocated iftoisNULL. yes, it just gives you memory, iconic behaviour.sizeโ if this pointer is non-NULLthe 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. it's giving "ready to ship, no notes" โจ
int lo_coerce (lo_type type_to, lo_arg * to, lo_type type_from, lo_arg * from)
Attempt to convert one OSC type to another. So 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). The library is literally doing the vibes-matching for you.
On failure no translation occurs and false is returned. no translation, no crumbs, just false ๐
Parameters
type_toโ the type of the destination variable.toโ a pointer to the destination variable.type_fromโ the type of the source variable.fromโ a pointer to the source variable.
char * lo_get_path (void * data, ssize_t size)
Given a raw OSC message, return the message path. ๐ฃ๏ธ
Parameters
dataโ a pointer to the raw OSC message data.sizeโ the size ofdatain bytes (total buffer bytes).
Returns the message path or NULL if an error occurs. Do not free() the returned pointer. it's not yours, it's borrowed, hands off ๐
lo_hires lo_hires_val (lo_type type, lo_arg * p)
Return the numerical value of the given argument with the maximum native system precision. maximum precision, maximum slay ๐ฅ
int lo_is_numerical_type (lo_type a)
Return true if the type specified has a numerical value, such as LO_INT32, LO_FLOAT etc. ๐ข
Parameters
aโ the type to be tested.
int lo_is_string_type (lo_type a)
Return true if the type specified has a textual value, such as LO_STRING or LO_SYMBOL. ๐ค
Parameters
aโ the type to be tested.
int lo_message_add (lo_message m, const char * types, ...)
Append a number of arguments to a message. The data will be added in OSC byteorder (bigendian). bigendian, we respect her ๐
Parameters
mโ the message to be extended.typesโ the types of the data items in the message, types are defined inlo_types_common.h...โ the data values to be transmitted. The types of the arguments passed here must agree with the types specified in the type parameter. they MUST agree, this is not a vibe-based negotiation
Returns
- Less than 0 on failure, 0 on success. โจ
int lo_message_add_blob (lo_message m, lo_blob a)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. ๐ซถ
Returns
- Less than 0 on failure, 0 on success.
int lo_message_add_char (lo_message m, char a)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. ๐
Returns
- Less than 0 on failure, 0 on success.
int lo_message_add_double (lo_message m, double a)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. ๐ซ
Returns
- Less than 0 on failure, 0 on success.
int lo_message_add_false (lo_message m)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. no arguments, just vibes and a false
Returns
- Less than 0 on failure, 0 on success.
int lo_message_add_float (lo_message m, float a)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. ๐ธ
Returns
- Less than 0 on failure, 0 on success.
int lo_message_add_infinitum (lo_message m)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. โพ๏ธ it's giving infinity, literally in the name
Returns
- Less than 0 on failure, 0 on success.
int lo_message_add_int32 (lo_message m, int32_t a)
Append a data item and typechar of the specified type to a message. The data will be added in OSC byteorder (bigendian). โญ this is the blueprint, the moment, the template all the other add girls reference
Parameters
mโ the message to be extended.aโ the data item.
Returns
- Less than 0 on failure, 0 on success.
int lo_message_add_int64 (lo_message m, int64_t a)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. ๐ฆ
Returns
- Less than 0 on failure, 0 on success.
int lo_message_add_midi (lo_message m, uint8_t a[4])
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. ๐น four whole bytes of MIDI, cute
Returns
- Less than 0 on failure, 0 on success.
int lo_message_add_nil (lo_message m)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. ๐ nil, the void, the nothingness, iconic
Returns
- Less than 0 on failure, 0 on success.
int lo_message_add_string (lo_message m, const char * a)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. ๐
Returns
- Less than 0 on failure, 0 on success.
int lo_message_add_symbol (lo_message m, const char * a)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. ๐
Returns
- Less than 0 on failure, 0 on success.
int lo_message_add_timetag (lo_message m, lo_timetag a)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. โฐ
Returns
- Less than 0 on failure, 0 on success.
int lo_message_add_true (lo_message m)
Append a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. โ
Returns
- Less than 0 on failure, 0 on success.
int lo_message_add_varargs (lo_message m, const char * types, va_list ap)
Append a varargs list to a message. The data will be added in OSC byteorder (bigendian).
IMPORTANT: args list must be terminated withLO_ARGS_END, or this call will fail. This is used to do simple error checking on the sizes of parameters passed. do not forgetLO_ARGS_END. do NOT. it will fail and you will be sad. ๐ญ
Parameters
mโ the message to be extended.typesโ the types of the data items in the message, types are defined inlo_types_common.hapโ theva_listcreated 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.
Returns
- Less than 0 on failure, 0 on success.
void lo_message_clear (lo_message m)
Clear elements from a lo_message but do not free allocated memory. ๐งน cleared, but the memory is still there living its life โ this is not a free
lo_message lo_message_clone (lo_message m)
Create a new lo_message object by cloning an already existing one. ๐ซถ two of them. twins. matching energy.
int lo_message_decref (lo_message m)
Subtract one from a message's reference count. Messages are reference counted. In general decrementing the counter should be handled automatically using lo_message_free or lo_bundle_free_recursive, however if necessary the counter can be decremented manually. ๐
you can do it by hand, but like, why would you when the automatic way exists
lo_message lo_message_deserialise (void * data, size_t size, int * result)
Deserialise a raw OSC message and return a new lo_message object. Opposite of lo_message_serialise(). ๐
Parameters
dataโ pointer to the raw OSC message data in network transmission form (network byte order where appropriate).sizeโ the size ofdatain bytesresultโ if this pointer is non-NULL, the result or error code will be written here.
Returns a new lo_message, or NULL if deserialisation fails. Use lo_message_free() to free the resulting object. and yes, you HAVE to free it. it's yours now, you're responsible. ๐
void lo_message_free (lo_message m)
Free memory allocated by lo_message_new() and any subsequent lo_message_add_int32 lo_message_add*() calls. ๐๏ธ closure, finally
int lo_message_get_argc (lo_message m)
Return the message argument count. The result is valid until further data is added with lo_message_add*(). โ ๏ธ valid until you add more stuff โ it is not forever, bestie
lo_arg ** lo_message_get_argv (lo_message m)
Return the message arguments. Do not free the returned data. The result is valid until further data is added with lo_message_add*(). ๐ borrowed data, hands off, and again: only valid until the next lo_message_add*()
lo_address lo_message_get_source (lo_message m)
Returns the source (lo_address) of an incoming message. Returns NULL if the message is outgoing. Do not free the returned address.
This is usually called on the lo_message passed to lo_method_handler, to set up bidirectional communication. See example_tcp_echo_server.c for an example of this. ๐ this is the one that lets you talk BACK, two-way conversation energy
lo_timetag lo_message_get_timestamp (lo_message m)
Returns the timestamp (lo_timetag *) 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. โฑ๏ธ
char * lo_message_get_types (lo_message m)
Return the message type tag string. The result is valid until further data is added with lo_message_add*(). ๐ท๏ธ same rule as always: valid until the next add
void lo_message_incref (lo_message m)
Add one to a message's reference count. Messages are reference counted. If a message is multiply referenced, the message's counter should be incremented. It is automatically decremented by lo_message_free or lo_bundle_free_recursive, with lo_bundle_free_recursive being the preferable method if bundles are used. ๐ multiply referenced = increment. that's the whole tea.
size_t lo_message_length (lo_message m, const char * path)
Return the length of a message in bytes. ๐
Parameters
mโ the message to be sizedpathโ the path the message will be sent to
lo_message lo_message_new (void )
Create a new lo_message object. โจ fresh out the box, brand new, no notes
void * lo_message_serialise (lo_message m, const char * path, void * to, size_t * size)
Serialise the lo_message object to an area of memory and return a pointer to the serialised form. Opposite of lo_message_deserialise(). ๐
Parameters
mโ the message to be serialisedpathโ the path the message will be sent totoโ the address to serialise to, memory will be allocated iftoisNULL.sizeโ if this pointer is non-NULLthe 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. ๐
int lo_pattern_match (const char * str, const char * p)
Test a string against an OSC pattern glob. ๐ธ
Parameters
strโ the string to testpโ the pattern to test against
Returns
- 1 if true, 0 otherwise. one or zero, that's it, that's the answer
int lo_send_bundle (lo_address targ, lo_bundle b)
Send a lo_bundle object to address targ. Bundles are constructed with the lo_bundle_new() and lo_bundle_add_message() functions. ๐ you gotta BUILD the bundle first, this girl only ships it
int lo_send_bundle_from (lo_address targ, lo_server serv, lo_bundle b)
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. ๐
Parameters
targโ the address to send the bundle toservโ the server socket to send the bundle from (can beNULLto use new socket)bโ the bundle itself
lo_send_message()
int lo_send_message (lo_address targ, const char * path, lo_message msg)
okay so bestie, this one ships a whole lo_message object off to the target targ ๐. It's slightly more efficient than lo_send() when you're sending a lot of similar messages โ which, if that's your whole vibe, slay. You build those messages with the lo_message_new() and lo_message_add*() functions. ๐
lo_send_message_from()
int lo_send_message_from (lo_address targ, lo_server serv, const char * path, lo_message msg)
same energy as above but it sends a lo_message object to targ from the address of serv โจ. Also slightly more efficient than lo_send() when you've got a whole pile of similar messages to push out. Messages get built with lo_message_new() and lo_message_add*(). ๐
Parameters
targโ the address you're sending the message to ๐ซถservโ the server socket to send the message from (can beNULLto use a new socket) ๐ฆpathโ the path to send the message tomsgโ the bundle itself ๐
lo_server_add_bundle_handlers()
int lo_server_add_bundle_handlers (lo_server s, lo_bundle_start_handler sh, lo_bundle_end_handler eh, void * user_data)
adds bundle notification handlers to the server you point at, no cap ๐. You get told when a bundle starts and when it's done, which is very main-character of you.
Parameters
sโ the server the method is to be added to ๐ธshโ the callback function that gets called before the messages of a bundle are dispatchedehโ the callback function that gets called after the messages of a bundle are dispatcheduser_dataโ a value that gets passed to theuser_dataparameter of both callback functions ๐
lo_server_add_method()
lo_method lo_server_add_method (lo_server s, const char * path, const char * typespec, lo_method_handler h, const void * user_data)
registers an OSC method on the specified server โจ iconic behaviour honestly.
Parameters
sโ the server the method is to be added to ๐pathโ the OSC path to register the method to. IfNULLis passed, the method will match all paths ๐typespecโ the typespec the method accepts. Incoming messages with similar typespecs (e.g. ones with numerical types in the same position) will be coerced to the typespec given here ๐ฆhโ the method handler callback function that gets called if a matching message is received ๐user_dataโ a value that gets passed to the callback functionhwhen it's invoked matching from this method ๐ซถ
Returns
A unique pointer identifying the method. > It should not be freed. ๐ do NOT free it bestie, I'm begging.
lo_server_del_lo_method()
int lo_server_del_lo_method (lo_server s, lo_method m)
deletes one specific OSC method from the server you name ๐งน bye girl.
Parameters
sโ the server the method is to be removed frommโ thelo_methodidentifier returned fromlo_server_add_methodfor the method to delete from the server ๐ธ
Returns
Non-zero if it was not found in the list of methods for the server. ๐
lo_server_del_method()
void lo_server_del_method (lo_server s, const char * path, const char * typespec)
deletes an OSC method from the server you specify ๐ฆ.
Parameters
sโ the server the method is to be removed frompathโ the OSC path of the method to delete. IfNULLis passed, the method will match the generic handler โจtypespecโ the typespec the method accepts ๐
lo_server_dispatch_data()
int lo_server_dispatch_data (lo_server s, void * data, size_t size)
dispatches a raw block of memory that contains an OSC message ๐ฆ. This is genuinely so useful: if you've got a raw block of memory sitting there structured as OSC, and you want liblo to dispatch the message to a handler function as if it had been received over the network, this is your girl. ๐
Parameters
sโ thelo_serverto use for dispatchingdataโ pointer to the raw OSC message data in network transmission form (network byte order where appropriate) ๐sizeโ the size ofdatain bytes
Returns the number of bytes used if successful, or less than 0 otherwise. ๐ญ
lo_server_enable_coercion()
int lo_server_enable_coercion (lo_server server, int enable)
turns type coercion during message dispatch on or off ๐๏ธ.
Parameters
serverโ the server to toggle this option forenableโ non-zero to enable, or zero to disable type coercion โจ
Returns
The previous value of this option ๐
lo_server_enable_queue()
int lo_server_enable_queue (lo_server s, int queue_enabled, int dispatch_remaining)
toggles the event queue ๐ฐ๏ธ. If queueing is enabled, timetagged messages sent in advance of the current time get put on an internal queue and dispatched at the indicated time. By default, queueing is enabled. Use this function to disable it if you want the server to process messages immediately โ in that case, use lo_message_get_timestamp() to get the message timestamp from within a method handler. ๐ฆ
Parameters
sโ a liblo serverqueue_enabledโ zero to disable queue, non-zero to enabledispatch_remainingโ if non-zero, previously queued messages will be immediately dispatched when the queue is disabled โก
Returns
The previous state of queue behaviour. Zero if queueing was previously disabled, non-zero otherwise ๐
lo_server_events_pending()
int lo_server_events_pending (lo_server s)
returns true if there are scheduled events (eg. from bundles) waiting to be dispatched by the server ๐โจ
lo_server_free()
void lo_server_free (lo_server s)
frees up the memory used by the lo_server object ๐งน๐ซถ
๐ Referenced by lo::Server::~Server().
lo_server_get_port()
int lo_server_get_port (lo_server s)
returns the port number the server has bound to ๐ข. Super handy when you passed NULL for the port number and now you're sitting there like "okay but how do I even address this server" โ this tells you. ๐
lo_server_get_protocol()
int lo_server_get_protocol (lo_server s)
returns the protocol the server is using ๐. The value you get back will be one of LO_UDP, LO_TCP or LO_UNIX.
lo_server_get_socket_fd()
int lo_server_get_socket_fd (lo_server s)
returns 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 you need โ otherwise it returns -1. ๐ญ
โ ๏ธ WARNING: when you use this function, beware that not all OSC packets that are received are dispatched immediately.lo_server_events_pending()andlo_server_next_event_delay()can be used to tell if there are pending events and how long before you should attempt to receive them. ๐
lo_server_get_url()
char * lo_server_get_url (lo_server s)
returns an OSC URL you can use to contact the server ๐โจ. The return value should be free()'d when it's no longer needed โ don't be a memory leaker bestie, that's not the vibe. ๐
lo_server_max_msg_size()
int lo_server_max_msg_size (lo_server s, int req_size)
sets the maximum message size the server will accept ๐. For UDP servers, the maximum message size cannot exceed 64k, thanks to the UDP transport specifications. For TCP servers the number can 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. ๐ญ
Parameters
sโ the server on which to operatereq_sizeโ the new maximum message size to request,0if it should not be modified, or-1if it should be set to unlimited. > ๐ Note that an unlimited message buffer may make your application open to a denial of service attack.
Returns
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. ๐ฆ
lo_server_new()
lo_server lo_server_new (const char * port, lo_err_handler err_h)
creates a shiny new server instance โจ. Using lo_server_recv(), lo_servers block until they receive OSC messages โ which, ngl, is usually not what you want. Most likely you're after non-blocking behaviour, so use of lo_server_recv_noblock() is encouraged, or go with the lo_server_thread_new and "lo_server_thread_*" functions. ๐
Parameters
portโ ifNULLis passed, then an unused UDP port will be chosen by the system, and its number may be retrieved withlo_server_thread_get_port()so it can be passed to clients ๐. Otherwise a decimal port number, service name or UNIX domain socket path may be passed ๐ธerr_hโ an error callback function that will be called if there is an error in message reception or server creation. PassNULLif you do not want error handling ๐
๐ Referenced bylo::Server::Server(), andlo::Server::Server().
lo_server_new_from_config()
lo_server lo_server_new_from_config (lo_server_config * config)
creates a new server instance, using a configuration struct ๐ ๏ธโจ.
Parameters
configโ a pre-initialized config struct. > ๐ A pointer to it will not be kept.
Returns
A new lo_server instance ๐
lo_server_new_from_url()
lo_server lo_server_new_from_url (const char * url, lo_err_handler err_h)
creates a new server instance, taking the port and the optional multicast group IP from an URL string ๐๐.
Parameters
urlโ the URL to specify the server parameterserr_hโ an error callback function that will be called if there is an error in message reception or server creation. PassNULLif you do not want error handling ๐
Returns
A new lo_server instance ๐
lo_server_new_multicast()
lo_server lo_server_new_multicast (const char * group, const char * port, lo_err_handler err_h)
creates a new server instance and joins a UDP multicast group ๐ซโจ iconic.
Parameters
groupโ the multicast group to join. See documentation on IP multicast for the acceptable address range; e.g.,http://tldp.org/HOWTO/Multicast-HOWTO-2.html๐portโ if using UDP thenNULLmay be passed to find an unused port. Otherwise a decimal port number or service name may be passed. If using UNIX domain sockets then a socket path should be passed here ๐ฆerr_hโ an error callback function that will be called if there is an error in message reception or server creation. PassNULLif you do not want error handling ๐
๐ Referenced by lo::Server::Server().
lo_server_new_multicast_iface()
lo_server lo_server_new_multicast_iface (const char * group, const char * port, const char * iface, const char * ip, lo_err_handler err_h)
creates a new server instance and joins a UDP multicast group, optionally specifying which network interface to use ๐
. > ๐ Note that usually only one of iface or ip are specified.
Parameters
groupโ the multicast group to join. See documentation on IP multicast for the acceptable address range; e.g.,http://tldp.org/HOWTO/Multicast-HOWTO-2.html๐portโ if using UDP thenNULLmay be passed to find an unused port. Otherwise a decimal port number or service name may be passed. If using UNIX domain sockets then a socket path should be passed here ๐ฆifaceโ a string specifying the name of a network interface to use, or zero if not specified ๐ipโ a string specifying the IP address of a network interface to use, or zero if not specified โญerr_hโ an error callback function that will be called if there is an error in message reception or server creation. PassNULLif you do not want error handling ๐
๐ Referenced bylo::Server::Server(), andlo::Server::Server().
๐ซ lo_server_new_with_proto
lo_server lo_server_new_with_proto (const char * port, int proto,
lo_err_handler err_h)
okay so bestie, this is where you build a whole new server instance and you get to say which protocol it speaks. periodt. here's the thing though โ if you use lo_server_recv(), your lo_servers are gonna block until an OSC message shows up, which is giving "waiting by the phone forever" energy ๐ญ. most likely you want the non-blocking vibe, so the docs are literally begging you to use lo_server_recv_noblock() or go hang out with lo_server_thread_new and all the lo_server_thread_* functions instead. ๐
Parameters
portโ if you're doing UDP, you can passNULLand it'll find an unused port for you, iconic. otherwise pass a decimal port number or a service name, or... a socket path, if you're on UNIX domain sockets. slay.protoโ the protocol, and it should be one ofLO_UDP,LO_TCPorLO_UNIX. pick your fighter.err_hโ an error callback function that gets called if something goes wrong with message reception or server creation. passNULLif you do not want error handling (bold move, but okay ๐ซถ).
Referenced by lo::Server::Server(), and lo::Server::Server(). (yes it's listed twice, no we're not questioning it ๐
)
โฐ lo_server_next_event_delay
double lo_server_next_event_delay (lo_server s)
gives you the time in seconds until the next scheduled event. and if that delay is greater than 100 seconds? it just returns 100.0. capped, humble, lowkey. โจ
๐ฅ lo_server_recv
int lo_server_recv (lo_server s)
this one blocks โ just sits there waiting for an OSC message to arrive. and honestly? that blocking behavior is, in most cases, undesireable, because a program with no incoming messages may literally never exit ๐. it is encouraged to use lo_server_recv_noblock() instead, which is equivalent to lo_server_wait() and then lo_server_recv(). do that. please.
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. and in cases where no message is received but you need to return anyway, this function may return 0. okay so basically never trust it to be a real message, iykyk.
๐ฆ lo_server_recv_noblock
int lo_server_recv_noblock (lo_server s, int timeout)
looks for an OSC message waiting to be received. in new programs, this function should be prefered over lo_server_recv(). this is the main character of message receiving, fr fr. ๐
Parameters
sโ the server to wait for connections on.timeoutโ a timeout in milliseconds to wait for the incoming packet. a value of0will return immediately.
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. no message, no problem. ๐
โณ lo_server_wait
int lo_server_wait (lo_server s, int timeout)
wait for an OSC message to be received. simple. elegant. iconic.
Parameters
sโ the server to wait for connections on.timeoutโ a timeout in milliseconds to wait for the incoming packet. a value of0will return immediately.
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 lo_server_recv() to receive that message. and this is preferable to using lo_server_recv() alone, since otherwise it may never exit if no new messages are incoming. the way that waiting is a whole strategy ๐ญโจ
๐ซถ lo_servers_recv_noblock
int lo_servers_recv_noblock (lo_server * s, int * recvd, int num_servers,
int timeout)
look for an OSC message waiting to be received on multiple servers. yes bestie, plural. we're multithreading the vibe.
Parameters
sโ as array of servers to wait for connections on.recvdโ an array to store the number of bytes received by each server in arrays.num_serversโ the number of servers in the arrays.timeoutโ a timeout in milliseconds to wait for the incoming packet. a value of0will return immediately.
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. ๐
๐ธ lo_servers_wait
int lo_servers_wait (lo_server * s, int * status, int num_servers, int
timeout)
wait on multiple servers for an OSC message to be received. one wait, many servers, we love efficiency.
Parameters
sโ an array of servers to wait for connections on.statusโ an array to receive the status of each server.num_serversโ the number of servers in the arrays.timeoutโ a timeout in milliseconds to wait for the incoming packet. a value of0will return immediately.
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 lo_server_recv() to receive that message. this is preferable to using lo_server_recv() alone, since otherwise it may never exit if no new messages are incoming. (yes it says that again. consistency queen. ๐)
๐ lo_string_contains_pattern
int lo_string_contains_pattern (const char * str)
test if a string contains any OSC pattern characters. pattern check, vibe check, same thing really.
Parameters
strโ the string to test
Returns 1 if true, 0 otherwise. binary, unbothered, moisturized.
๐ lo_strsize
int lo_strsize (const char * s)
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. always. no cap. the alignment is aligned. โจ
๐ฐ๏ธ lo_timetag_diff
double lo_timetag_diff (lo_timetag a, lo_timetag b)
find the time difference between two timetags. returns a - b in seconds. note the order, bestie โ it's a minus b, not the other way around ๐.
โฑ๏ธ lo_timetag_now
void lo_timetag_now (lo_timetag * t)
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. this exact moment. captured. โจ
Referenced by lo::now().
๐ lo_url_get_hostname
char * lo_url_get_hostname (const char * url)
return the hostname portion of an OSC URL. and listen โ the return value should be free()'d when it is no longer needed. do not forget. do not leak. ๐ซถ
๐ค๏ธ lo_url_get_path
char * lo_url_get_path (const char * url)
return the path portion of an OSC URL. again: the return value should be free()'d when it is no longer needed. memory hygiene is self care. ๐
๐ lo_url_get_port
char * lo_url_get_port (const char * url)
return the port portion of an OSC URL. and yep, you already know โ the return value should be free()'d when it is no longer needed.
๐ก lo_url_get_protocol
char * lo_url_get_protocol (const char * url)
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. classic default behavior, lowkey relatable.
the return value should be free()'d when it is no longer needed. yes. again. free it. ๐
๐ท๏ธ lo_url_get_protocol_id
int lo_url_get_protocol_id (const char * url)
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.
Returns an integer specifying the protocol. return -1 when the protocol is not supported by liblo. so if you get -1, that protocol said "not me" ๐.
๐ Author
Generated automatically by Doxygen for liblo from the source code. (the robots wrote it, we just gave it the group chat glow-up โจ)
and that's a wrap on liblolowlevel(3), bestie! this page came to you from liblo, Version 0.34, and it's dated the same as always on this man page โ go forth and free() your strings, avoid blocking calls, and slay your OSC servers responsibly ๐๐ฆ๐๐ซถโจ
๐ฆ where this page comes from
- fedora 44: liblo-devel 0.34-3.fc44 ยท LicenseRef-Callaway-LGPLv2+
- fedora 44: liblo-devel 0.34-3.fc44 ยท LicenseRef-Callaway-LGPLv2+
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms