|
2769 | 2769 | bool
|
2770 | 2770 | zsock_has_in (void *self);
|
2771 | 2771 |
|
| 2772 | +// Get socket option `priority`. |
| 2773 | +// Available from libzmq 4.3.0. |
| 2774 | +int |
| 2775 | + zsock_priority (void *self); |
| 2776 | +
|
| 2777 | +// Set socket option `priority`. |
| 2778 | +// Available from libzmq 4.3.0. |
| 2779 | +void |
| 2780 | + zsock_set_priority (void *self, int priority); |
| 2781 | +
|
| 2782 | +// Get socket option `reconnect_stop`. |
| 2783 | +// Available from libzmq 4.3.0. |
| 2784 | +int |
| 2785 | + zsock_reconnect_stop (void *self); |
| 2786 | +
|
| 2787 | +// Set socket option `reconnect_stop`. |
| 2788 | +// Available from libzmq 4.3.0. |
| 2789 | +void |
| 2790 | + zsock_set_reconnect_stop (void *self, int reconnect_stop); |
| 2791 | +
|
2772 | 2792 | // Set socket option `only_first_subscribe`.
|
2773 | 2793 | // Available from libzmq 4.3.0.
|
2774 | 2794 | void
|
|
3832 | 3852 |
|
3833 | 3853 | // Format a string using printf formatting, returning a freshly allocated
|
3834 | 3854 | // buffer. If there was insufficient memory, returns NULL. Free the returned
|
3835 |
| -// string using zstr_free(). The hinted version allows to optimize by using |
| 3855 | +// string using zstr_free(). The hinted version allows one to optimize by using |
3836 | 3856 | // a larger starting buffer size (known to/assumed by the developer) and so
|
3837 | 3857 | // avoid reallocations.
|
3838 | 3858 | char *
|
|
3944 | 3964 | int
|
3945 | 3965 | zsys_thread_name_prefix (void);
|
3946 | 3966 |
|
| 3967 | +// Configure the numeric prefix to each thread created for the internal |
| 3968 | +// context's thread pool. This option is only supported on Linux. |
| 3969 | +// If the environment variable ZSYS_THREAD_NAME_PREFIX_STR is defined, that |
| 3970 | +// provides the default. |
| 3971 | +// Note that this method is valid only before any socket is created. |
| 3972 | +void |
| 3973 | + zsys_set_thread_name_prefix_str (const char *prefix); |
| 3974 | +
|
| 3975 | +// Return thread name prefix. |
| 3976 | +const char * |
| 3977 | + zsys_thread_name_prefix_str (void); |
| 3978 | +
|
3947 | 3979 | // Adds a specific CPU to the affinity list of the ZMQ context thread pool.
|
3948 | 3980 | // This option is only supported on Linux.
|
3949 | 3981 | // Note that this method is valid only before any socket is created.
|
|
4670 | 4702 | const char *
|
4671 | 4703 | zosc_format (zosc_t *self);
|
4672 | 4704 |
|
| 4705 | +// Append data to the osc message. The format describes the data that |
| 4706 | +// needs to be appended in the message. This essentially relocates all |
| 4707 | +// data! |
| 4708 | +// The format type tags are as follows: |
| 4709 | +// i - 32bit integer |
| 4710 | +// h - 64bit integer |
| 4711 | +// f - 32bit floating point number (IEEE) |
| 4712 | +// d - 64bit (double) floating point number |
| 4713 | +// s - string (NULL terminated) |
| 4714 | +// t = timetag: an OSC timetag in NTP format (uint64_t) |
| 4715 | +// S - symbol |
| 4716 | +// c - char |
| 4717 | +// m - 4 byte midi packet (8 digits hexadecimal) |
| 4718 | +// T - TRUE (no value required) |
| 4719 | +// F - FALSE (no value required) |
| 4720 | +// N - NIL (no value required) |
| 4721 | +// I - Impulse (for triggers) or INFINITUM (no value required) |
| 4722 | +// b - binary blob |
| 4723 | +int |
| 4724 | + zosc_append (zosc_t *self, const char *format, ...); |
| 4725 | +
|
4673 | 4726 | // Retrieve the values provided by the given format. Note that zosc_retr
|
4674 | 4727 | // creates the objects and the caller must destroy them when finished.
|
4675 | 4728 | // The supplied pointers do not need to be initialized. Returns 0 if
|
|
4699 | 4752 | zosc_t *
|
4700 | 4753 | zosc_unpack (zframe_t *frame);
|
4701 | 4754 |
|
4702 |
| -// Dump OSC message to stderr, for debugging and tracing. |
| 4755 | +// Dump OSC message to stdout, for debugging and tracing. |
4703 | 4756 | void
|
4704 | 4757 | zosc_print (zosc_t *self);
|
4705 | 4758 |
|
4706 | 4759 | // Probe the supplied object, and report if it looks like a zosc_t.
|
4707 | 4760 | bool
|
4708 | 4761 | zosc_is (void *self);
|
4709 | 4762 |
|
| 4763 | +// Return a pointer to the item at the head of the OSC data. |
| 4764 | +// Sets the given char argument to the type tag of the data. |
| 4765 | +// If the message is empty, returns NULL and the sets the |
| 4766 | +// given char to NULL. |
| 4767 | +const void * |
| 4768 | + zosc_first (zosc_t *self, char *type); |
| 4769 | +
|
| 4770 | +// Return the next item of the OSC message. If the list is empty, returns |
| 4771 | +// NULL. To move to the start of the OSC message call zosc_first (). |
| 4772 | +const void * |
| 4773 | + zosc_next (zosc_t *self, char *type); |
| 4774 | +
|
| 4775 | +// Return a pointer to the item at the tail of the OSC message. |
| 4776 | +// Sets the given char argument to the type tag of the data. If |
| 4777 | +// the message is empty, returns NULL. |
| 4778 | +const void * |
| 4779 | + zosc_last (zosc_t *self, char *type); |
| 4780 | +
|
| 4781 | +// Set the provided 32 bit integer from value at the current cursor position in the message. |
| 4782 | +// If the type tag at the current position does not correspond it will fail and |
| 4783 | +// return -1. Returns 0 on success. |
| 4784 | +int |
| 4785 | + zosc_pop_int32 (zosc_t *self, int *val); |
| 4786 | +
|
| 4787 | +// Set the provided 64 bit integer from the value at the current cursor position in the message. |
| 4788 | +// If the type tag at the current position does not correspond it will fail and |
| 4789 | +// return -1. Returns 0 on success. |
| 4790 | +int |
| 4791 | + zosc_pop_int64 (zosc_t *self, int64_t *val); |
| 4792 | +
|
| 4793 | +// Set the provided float from the value at the current cursor position in the message. |
| 4794 | +// If the type tag at the current position does not correspond it will fail and |
| 4795 | +// return -1. Returns 0 on success. |
| 4796 | +int |
| 4797 | + zosc_pop_float (zosc_t *self, float *val); |
| 4798 | +
|
| 4799 | +// Set the provided double from the value at the current cursor position in the message. |
| 4800 | +// If the type tag at the current position does not correspond it will fail and |
| 4801 | +// return -1. Returns 0 on success. |
| 4802 | +int |
| 4803 | + zosc_pop_double (zosc_t *self, double *val); |
| 4804 | +
|
| 4805 | +// Set the provided string from the value at the current cursor position in the message. |
| 4806 | +// If the type tag at the current position does not correspond it will fail and |
| 4807 | +// return -1. Returns 0 on success. Caller owns the string! |
| 4808 | +int |
| 4809 | + zosc_pop_string (zosc_t *self, char **val); |
| 4810 | +
|
| 4811 | +// Set the provided char from the value at the current cursor position in the message. |
| 4812 | +// If the type tag at the current position does not correspond it will fail and |
| 4813 | +// return -1. Returns 0 on success. |
| 4814 | +int |
| 4815 | + zosc_pop_char (zosc_t *self, char *val); |
| 4816 | +
|
| 4817 | +// Set the provided boolean from the type tag in the message. Booleans are not represented |
| 4818 | +// in the data in the message, only in the type tag. If the type tag at the current |
| 4819 | +// position does not correspond it will fail and return -1. Returns 0 on success. |
| 4820 | +int |
| 4821 | + zosc_pop_bool (zosc_t *self, bool *val); |
| 4822 | +
|
| 4823 | +// Set the provided 4 bytes (unsigned 32bit int) from the value at the current |
| 4824 | +// cursor position in the message. If the type tag at the current position does |
| 4825 | +// not correspond it will fail and return -1. Returns 0 on success. |
| 4826 | +int |
| 4827 | + zosc_pop_midi (zosc_t *self, uint32_t *val); |
| 4828 | +
|
4710 | 4829 | // Self test of this class.
|
4711 | 4830 | void
|
4712 | 4831 | zosc_test (bool verbose);
|
|
0 commit comments