lo_lowlevel.h(3)

๐Ÿ“ฆ
version 0.34 ยท 3 versions
, in fedora 44

โœจ lo_lowlevel.h โœจ

okay so bestie, welcome to lo_lowlevel.h ๐Ÿ’– this is the low-level header for liblo, and she is thicc. we're doing this in parts because obviously. part 1 is the little intro tour: what's in here, what structs live here, what typedefs, what enums. strap in ๐ŸŽ€


๐ŸŒธ NAME ๐ŸŒธ

lo_lowlevel.h โ€” literally the low-level header file, iykyk. it's giving "the guts of liblo exposed for you" energy ๐Ÿ’…


โœจ SYNOPSIS โœจ

๐Ÿฆ‹ Data Structures

  • struct lo_server_config โ€” a configuration struct for initializing lo_server using lo_server_new_from_config(). she's the glow-up pre-game, the outfit you pick before the server goes out ๐Ÿ‘‘

๐ŸŽ€ Typedefs

  • typedef long double lo_hires โ€” the type used to represent numerical values in conversions between OSC types. that's it, that's the whole vibe: long double, but make it OSC-flavoured โญ

๐ŸŒˆ Enumerations

  • 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. double-ENDed?? yes bestie, that's a real thing, and this enum is how you pick ๐Ÿ”ฅ

ngl this part is short but it's the foundation, okay? more parts coming, don't go anywhere ๐Ÿ’œ

โœจ Functions โœจ

  • int lo_send_message (lo_address targ, const char *path, lo_message msg) โ€” Sends a lo_message object to target targ. ๐Ÿ’Œ Deliver this message, bestie, no cap.
  • int lo_send_message_from (lo_address targ, lo_server serv, const char *path, lo_message msg) โ€” Sends a lo_message object to target targ from the address of serv. ๐Ÿ“ฌ Like, from this server specifically.
  • int lo_send_bundle (lo_address targ, lo_bundle b) โ€” Sends a lo_bundle object to address targ. ๐Ÿ“ฆ Bundle up, buttercup.
  • int lo_send_bundle_from (lo_address targ, lo_server serv, lo_bundle b) โ€” Sends a lo_bundle object to address targ from the address of serv. ๐ŸŽ From serv with love.
  • lo_message lo_message_new (void) โ€” Creates a new lo_message object. โœจ Fresh out the box, main character energy.
  • void lo_message_incref (lo_message m) โ€” Adds one to a message's reference count. โž• Ref count go up.
  • int lo_message_decref (lo_message m) โ€” Subtracts one from a message's reference count. โž– Ref count go down.
  • lo_message lo_message_clone (lo_message m) โ€” Creates a new lo_message object by cloning an already existing one. ๐Ÿงฌ Clone army, but make it OSC.
  • void lo_message_free (lo_message m) โ€” Frees memory allocated by lo_message_new() and any subsequent lo_message_add_int32 lo_message_add*() calls. ๐Ÿ—‘๏ธ Clean up your mess, bestie.
  • void lo_message_clear (lo_message m) โ€” Clears elements from a lo_message but does not free allocated memory. ๐Ÿงน Just wipe the slate, keep the RAM.
  • int lo_message_add (lo_message m, const char *types,...) โ€” Appends a number of arguments to a message. ๐Ÿ“Ž Add 'em all.
  • int lo_message_add_varargs (lo_message m, const char *types, va_list ap) โ€” Appends a varargs list to a message. ๐Ÿ“‹ Varargs core, fr fr.
  • 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 is the blueprint for all the lo_message_add_* ones, iykyk.
  • int lo_message_add_float (lo_message m, float a) โ€” Appends a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. ๐ŸŒŠ Float like a butterfly.
  • int lo_message_add_string (lo_message m, const char *a) โ€” Appends a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. ๐Ÿงต String theory but make it OSC.
  • int lo_message_add_blob (lo_message m, lo_blob a) โ€” Appends a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. ๐Ÿซง Blob blob blob.
  • int lo_message_add_int64 (lo_message m, int64_t a) โ€” Appends a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. ๐Ÿ”ข Big int energy.
  • int lo_message_add_timetag (lo_message m, lo_timetag a) โ€” Appends a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. โณ Time is a construct.
  • int lo_message_add_double (lo_message m, double a) โ€” Appends a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. ๐Ÿ’ซ Double the precision, double the slay.
  • int lo_message_add_symbol (lo_message m, const char *a) โ€” Appends a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. ๐Ÿ”ฃ Symbolic, literally.
  • int lo_message_add_char (lo_message m, char a) โ€” Appends a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. ๐Ÿ”ค One character, one vibe.
  • 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. See lo_message_add_int32() for details. ๐ŸŽน MIDI in the chat.
  • int lo_message_add_true (lo_message m) โ€” Appends a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. โœ… True story.
  • int lo_message_add_false (lo_message m) โ€” Appends a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. โŒ False alarm.
  • int lo_message_add_nil (lo_message m) โ€” Appends a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. ๐Ÿ•ณ๏ธ Nil, the void, the abyss.
  • int lo_message_add_infinitum (lo_message m) โ€” Appends a data item and typechar of the specified type to a message. See lo_message_add_int32() for details. โ™พ๏ธ To infinity and beyond.
  • lo_address lo_message_get_source (lo_message m) โ€” Returns the source (lo_address) of an incoming message. ๐Ÿ“ Where did you come from, where did you go?
  • lo_timetag lo_message_get_timestamp (lo_message m) โ€” Returns the timestamp (lo_timetag *) of a bundled incoming message. โฐ When did this happen? Here's the receipt.
  • char * lo_message_get_types (lo_message m) โ€” Return the message type tag string. ๐Ÿท๏ธ Type tags, iconic.
  • int lo_message_get_argc (lo_message m) โ€” Return the message argument count. ๐Ÿ”ข How many arguments? Count 'em.
  • lo_arg ** lo_message_get_argv (lo_message m) โ€” Return the message arguments. Do not free the returned data. ๐Ÿซด Here are the args, bestie.
Do not free the returned data. Seriously, hands off. ๐Ÿ™…โ€โ™€๏ธ
  • size_t lo_message_length (lo_message m, const char *path) โ€” Return the length of a message in bytes. ๐Ÿ“ Size check.
  • 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(). ๐Ÿ“ฆ Turn it into bytes, periodt.
  • 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(). ๐Ÿ”„ Bytes back to message, reverse uno.
  • 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 into the server void.
  • const char * lo_address_get_hostname (lo_address a) โ€” Return the hostname of a lo_address object. ๐Ÿ  Where you at?
  • const char * lo_address_get_port (lo_address a) โ€” Return the port/service name of a lo_address object. ๐Ÿšช Which door?
  • int lo_address_get_protocol (lo_address a) โ€” Return the protocol of a lo_address object. ๐Ÿ“ก What protocol we on?
  • char * lo_address_get_url (lo_address a) โ€” Return a URL representing an OSC address. ๐Ÿ”— Link in bio energy.
  • void lo_address_set_ttl (lo_address t, int ttl) โ€” Set the Time-to-Live value for a given target address. โฑ๏ธ TTL, don't let it expire.
  • int lo_address_get_ttl (lo_address t) โ€” Get the Time-to-Live value for a given target address. โณ How long we got?
  • 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 interface, bestie.
  • const char * lo_address_get_iface (lo_address t) โ€” Get the name of the network interface assigned to an OSC address. ๐Ÿ“ถ Which interface we on?
  • int lo_address_set_tcp_nodelay (lo_address t, int enable) โ€” Set the TCP_NODELAY flag on outgoing TCP connections. ๐Ÿšฆ No delay, 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. ๐ŸŒ Slip into stream mode.
  • lo_bundle lo_bundle_new (lo_timetag tt) โ€” Create a new bundle object. ๐ŸŽ New bundle, who dis?
  • void lo_bundle_incref (lo_bundle b) โ€” Add one to a bundle's reference count. โž• Ref count up 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. ๐Ÿ“ฉ Slide into the bundle.
  • int lo_bundle_add_bundle (lo_bundle b, lo_bundle n) โ€” Adds an OSC bundle to an existing bundle. ๐Ÿช† Bundle-ception.
  • size_t lo_bundle_length (lo_bundle b) โ€” Return the length of a bundle in bytes. ๐Ÿ“ Bundle size check.
  • unsigned int lo_bundle_count (lo_bundle b) โ€” Return the number of top-level elements in a bundle. ๐Ÿ”ข How many top-level elements? Count 'em.
  • lo_element_type lo_bundle_get_type (lo_bundle b, int index) โ€” Gets the element type contained within a bundle. ๐Ÿท๏ธ What type is this element?
  • lo_bundle lo_bundle_get_bundle (lo_bundle b, int index) โ€” Gets a nested bundle contained within a bundle. ๐Ÿช† Nested bundle, found it.
  • lo_message lo_bundle_get_message (lo_bundle b, int index, const char **path) โ€” Gets a message contained within a bundle. ๐Ÿ“จ Message inside the bundle, got it.
  • lo_timetag lo_bundle_get_timestamp (lo_bundle b) โ€” Get the timestamp associated with a bundle. โฐ When's this bundle from?
  • 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. ๐Ÿ“ฆ Bundle to bytes.
  • void lo_bundle_free (lo_bundle b) โ€” Frees the memory taken by a bundle object. ๐Ÿ—‘๏ธ Free the bundle, bye.
  • void lo_bundle_free_recursive (lo_bundle b) โ€” Frees the memory taken by a bundle object and its messages and nested bundles recursively. ๐Ÿงน Recursive cleanup, no leftovers.
  • void lo_bundle_free_messages (lo_bundle b) โ€” Obsolete, use lo_bundle_free_recursive instead. โš ๏ธ Obsolete, bestie โ€” use lo_bundle_free_recursive instead.
  • 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. ๐Ÿ”ข Numbers only, periodt.
  • 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. ๐Ÿ”ค Textual healing.
  • 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. ๐Ÿ”„ Type conversion, let's try.
  • 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. ๐Ÿ’Ž Max precision, highkey.
  • lo_server lo_server_new (const char *port, lo_err_handler err_h) โ€” Create a new server instance. ๐Ÿ–ฅ๏ธ New server, who dis?
  • lo_server lo_server_new_with_proto (const char *port, int proto, lo_err_handler err_h) โ€” Create a new server instance, specifying protocol. ๐Ÿ“ก Server with a protocol twist.
  • 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. ๐Ÿ“ข Multicast group chat, join us.
  • 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 of iface or ip are specified. ๐Ÿ›œ Multicast with interface options, usually pick one of iface or ip.
  • 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. ๐Ÿ”— Server from a URL, link in bio.
  • lo_server lo_server_new_from_config (lo_server_config *config) โ€” Create a new server instance, using a configuration struct. โš™๏ธ Config struct, assemble.
  • int lo_server_enable_coercion (lo_server server, int enable) โ€” Enables or disables type coercion during message dispatch. ๐Ÿ”€ Coercion on or off, your call.
  • void lo_server_free (lo_server s) โ€” Free up memory used by the lo_server object. ๐Ÿ—‘๏ธ Server cleanup, bye.
  • int lo_server_wait (lo_server s, int timeout) โ€” Wait for an OSC message to be received. โณ Wait for itโ€ฆ
  • 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. ๐Ÿ‘ฏ Multiple servers, one wait.
  • int lo_server_recv_noblock (lo_server s, int timeout) โ€” Look for an OSC message waiting to be received. ๐Ÿ‘€ Non-blocking peek, no pressure.
  • 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. ๐Ÿ‘€ Multiple servers, non-blocking peek.
  • int lo_server_recv (lo_server s) โ€” Block, waiting for an OSC message to be received. ๐Ÿ›‘ Blocking recv, it's giving patient.
  • 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. โž• Add a method, specifed with love.
  • void lo_server_del_method (lo_server s, const char *path, const char *typespec) โ€” Delete an OSC method from the specified server. โž– Delete that method.
  • int lo_server_del_lo_method (lo_server s, lo_method m) โ€” Delete a specific OSC method from the specified server. ๐Ÿ—‘๏ธ Specific method, delete.
  • 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. ๐Ÿ”” Bundle handlers, ding ding.
  • int lo_server_get_socket_fd (lo_server s) โ€” Return the file descriptor of the server socket. ๐Ÿ”Œ Socket fd, plug in.
  • int lo_server_get_port (lo_server s) โ€” Return the port number that the server has bound to. ๐Ÿšช Which port? Here it is.
  • int lo_server_get_protocol (lo_server s) โ€” tells u which protocol the server is vibing on rn ๐Ÿ’ซ
  • char * lo_server_get_url (lo_server s) โ€” hands u back an OSC URL u can actually use to reach the server, periodt ๐Ÿซถ
  • int lo_server_enable_queue (lo_server s, int queue_enabled, int dispatch_remaining) โ€” toggles the event queue, bestie. When queueing is on, timetagged messages sent ahead of the current time get parked in an internal queue and then dispatched at the exact time they said they'd show up. Queueing is enabled by default btw. Use this to turn it off if u want the server processing messages immediately instead. And in that case? Use lo_message_get_timestamp() from inside a method handler to grab the message timestamp, no cap ๐Ÿ•
  • int lo_server_events_pending (lo_server s) โ€” returns true if there's scheduled events (like, from bundles yk) just chillin and waiting for the server to dispatch them โณ
  • double lo_server_next_event_delay (lo_server s) โ€” the time, in seconds, until the next scheduled event drops โฐ
  • int lo_server_max_msg_size (lo_server s, int req_size) โ€” sets the biggest message size the server will accept ๐Ÿ“
  • char * lo_url_get_protocol (const char *url) โ€” pulls out the protocol chunk of an OSC URL, like udp or tcp ๐Ÿ’…
  • int lo_url_get_protocol_id (const char *url) โ€” gives u the protocol ID of an OSC URL ๐Ÿ”‘
  • char * lo_url_get_hostname (const char *url) โ€” the hostname portion of an OSC URL ๐Ÿ 
  • char * lo_url_get_port (const char *url) โ€” the port portion of an OSC URL ๐Ÿ”Œ
  • char * lo_url_get_path (const char *url) โ€” the path portion of an OSC URL ๐Ÿ›ค๏ธ
  • int lo_strsize (const char *s) โ€” calc's how much OSC message space a C char * needs ๐Ÿ“
  • uint32_t lo_blobsize (lo_blob b) โ€” same energy but for a lo_blob object: how much OSC message space it needs ๐Ÿซง
  • int lo_pattern_match (const char *str, const char *p) โ€” tests a string against an OSC pattern glob ๐ŸŽฏ
  • int lo_string_contains_pattern (const char *str) โ€” checks if a string has any OSC pattern characters in it at all ๐Ÿ‘€
  • double lo_timetag_diff (lo_timetag a, lo_timetag b) โ€” finds the time difference between two timetags โฑ๏ธ
  • void lo_timetag_now (lo_timetag *t) โ€” returns a timetag for right now, this very second ๐ŸŒŸ
  • size_t lo_arg_size (lo_type type, void *data) โ€” the storage size, in bytes, of the argument u passed in ๐Ÿงฎ
  • char * lo_get_path (void *data, ssize_t size) โ€” give it a raw OSC message and it gives u back the message path ๐Ÿ—บ๏ธ
  • void lo_arg_host_endian (lo_type type, void *data) โ€” converts the specified argument to host byte order where necessary ๐Ÿ”„
  • void lo_arg_network_endian (lo_type type, void *data) โ€” converts the specified argument to network byte order where necessary ๐ŸŒ
  • void lo_bundle_pp (lo_bundle b) โ€” pretty-prints a lo_bundle object โœจ
  • void lo_message_pp (lo_message m) โ€” pretty-prints a lo_message object ๐Ÿ’Œ
  • void lo_arg_pp (lo_type type, void *data) โ€” pretty-prints a set of typed arguments ๐ŸŽ€
  • void lo_server_pp (lo_server s) โ€” pretty-prints a lo_server object ๐Ÿ–ฅ๏ธ
  • void lo_method_pp (lo_method m) โ€” pretty-prints a lo_method object ๐Ÿช„
  • void lo_method_pp_prefix (lo_method m, const char *p) โ€” pretty-prints a lo_method object, but it prepends whatever prefix u give it to every single field name ๐Ÿท๏ธ

โœจ DETAILED DESCRIPTION โœจ

It's the liblo headerfile that defines all the low-level API functions. That's the whole tea โ˜•

Definition lives in file lo_lowlevel.h ๐Ÿ“


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Generated automatically by Doxygen for liblo from the source code ๐Ÿค– no human wrote this one bestie, the machine did it fr fr


okay that's the whole page!! ty for reading my lil Unix TED talk ๐Ÿ’– this was liblo, Version 0.34, lo_lowlevel.h(3) โ€” go forth and slay ur OSC servers, u absolute icon ๐Ÿ‘‘โœจ

๐Ÿ“ฆ where this page comes from