|
Real Time Open Sound Control librtosc
|
Header for pretty printer and scanner. More...
#include <rtosc/rtosc.h>Go to the source code of this file.
Classes | |
| struct | rtosc_print_options |
Functions | |
| size_t | rtosc_print_arg_val (const rtosc_arg_val_t *arg, char *buffer, size_t buffersize, const rtosc_print_options *opt, int *cols_used) |
| Pretty-print rtosct_arg_val_t structure into buffer. | |
| size_t | rtosc_print_arg_vals (const rtosc_arg_val_t *args, size_t n, char *buffer, size_t bs, const rtosc_print_options *opt, int cols_used) |
| Pretty-print rtosct_arg_val_t array into buffer. | |
| size_t | rtosc_print_message (const char *address, const rtosc_arg_val_t *args, size_t n, char *buffer, size_t bs, const rtosc_print_options *opt, int cols_used) |
| Pretty-print OSC message into string buffer. | |
| const char * | rtosc_skip_next_printed_arg (const char *src, int *skipped, char *type, const char *llhssrc, int follow_ellipsis, int inside_bundle) |
| Skip characters from a string until one argument value would have been scanned. | |
| int | rtosc_count_printed_arg_vals (const char *src) |
| Count arguments that would be scanned and do a complete syntax check. | |
| int | rtosc_count_printed_arg_vals_of_msg (const char *msg) |
| Count arguments of a message that would be scanned and do a complete syntax check. | |
| size_t | rtosc_scan_arg_val (const char *src, rtosc_arg_val_t *arg, size_t n, char *buffer_for_strings, size_t *bufsize, size_t args_before, int follow_ellipsis) |
| Scan one argument value from a string. | |
| size_t | rtosc_scan_arg_vals (const char *src, rtosc_arg_val_t *args, size_t n, char *buffer_for_strings, size_t bufsize) |
| Scan a fixed number of argument values from a string. | |
| size_t | rtosc_scan_message (const char *src, char *address, size_t adrsize, rtosc_arg_val_t *args, size_t n, char *buffer_for_strings, size_t bufsize) |
| Scan an OSC message from a string. | |
Header for pretty printer and scanner.
| int rtosc_count_printed_arg_vals | ( | const char * | src | ) |
Count arguments that would be scanned and do a complete syntax check.
This function should be run before rtosc_scan_arg_vals() in order to know the number of argument values. Also, rtosc_scan_arg_vals() does no complete syntax check.
| src | The string to scan from |
| int rtosc_count_printed_arg_vals_of_msg | ( | const char * | msg | ) |
Count arguments of a message that would be scanned and do a complete syntax check.
| msg | The message to scan from |
| size_t rtosc_print_arg_val | ( | const rtosc_arg_val_t * | arg, |
| char * | buffer, | ||
| size_t | buffersize, | ||
| const rtosc_print_options * | opt, | ||
| int * | cols_used ) |
Pretty-print rtosct_arg_val_t structure into buffer.
Ranges are not being compressed (use rtosc_print_arg_vals instead).
| arg | Pointer to the structure that shall be printed |
| buffer | The buffer to write to |
| buffersize | The maximum size to write to, includin a trailing 0 byte |
| opt | Printer options, NULL for default options |
| cols_used | How many columns have been used for writing in this line (will be updated by this function) |
| size_t rtosc_print_arg_vals | ( | const rtosc_arg_val_t * | args, |
| size_t | n, | ||
| char * | buffer, | ||
| size_t | bs, | ||
| const rtosc_print_options * | opt, | ||
| int | cols_used ) |
Pretty-print rtosct_arg_val_t array into buffer.
Ranges are being compressed if opt->compress_ranges is true.
| size_t rtosc_print_message | ( | const char * | address, |
| const rtosc_arg_val_t * | args, | ||
| size_t | n, | ||
| char * | buffer, | ||
| size_t | bs, | ||
| const rtosc_print_options * | opt, | ||
| int | cols_used ) |
Pretty-print OSC message into string buffer.
Ranges are being compressed if opt->compress_ranges is true. A newline will be appended.
| address | OSC pattern to send message to |
| args | The array to print |
| n | Number of args from the array that should be printed |
| buffer | The buffer to write to |
| bs | The maximum size to write to, includin a trailing 0 byte |
| opt | Printer options, NULL for default options |
| cols_used | How many columns have been used for writing in this line |
| size_t rtosc_scan_arg_val | ( | const char * | src, |
| rtosc_arg_val_t * | arg, | ||
| size_t | n, | ||
| char * | buffer_for_strings, | ||
| size_t * | bufsize, | ||
| size_t | args_before, | ||
| int | follow_ellipsis ) |
Scan one argument value from a string.
This function does no complete syntaxcheck. Call rtosc_count_printed_arg_vals() before.
| src | The string |
| arg | Pointer to an array where to store the argument value |
| n | Size of the array arg. Since only one arg is being scanned, for almost all cases (except arrays), n being 1 is sufficient. |
| buffer_for_strings | A buffer with enough space for scanned strings and blobs |
| bufsize | Size of buffer_for_strings , will be shrinked to the bufferbytes left after the scan |
| args_before | Number of arguments scanned before this one |
| follow_ellipsis | Whether an argument followed by an ellipsis is interpreted as a range start or as only the argument itself |
| size_t rtosc_scan_arg_vals | ( | const char * | src, |
| rtosc_arg_val_t * | args, | ||
| size_t | n, | ||
| char * | buffer_for_strings, | ||
| size_t | bufsize ) |
Scan a fixed number of argument values from a string.
This function does no complete syntaxcheck. Call rtosc_count_printed_arg_vals() before. This will also give you the n parameter.
| size_t rtosc_scan_message | ( | const char * | src, |
| char * | address, | ||
| size_t | adrsize, | ||
| rtosc_arg_val_t * | args, | ||
| size_t | n, | ||
| char * | buffer_for_strings, | ||
| size_t | bufsize ) |
Scan an OSC message from a string.
This function does no complete syntaxcheck. Call rtosc_count_printed_arg_vals() before. This will also give you the n parameter. Preceding and trailing whitespace will be consumed.
| src | The string |
| address | A buffer where the port address will be written |
| adrsize | Size of buffer address |
| args | Pointer to an array of argument values; the output will be written here |
| n | The amount of argument values to scan |
| buffer_for_strings | A buffer with enough space for scanned strings and blobs |
| bufsize | Size of buffer_for_strings |
| const char * rtosc_skip_next_printed_arg | ( | const char * | src, |
| int * | skipped, | ||
| char * | type, | ||
| const char * | llhssrc, | ||
| int | follow_ellipsis, | ||
| int | inside_bundle ) |
Skip characters from a string until one argument value would have been scanned.
| src | The current position |
| skipped | The number of arg_vals that would be skipped when scanning, typically 1 (though not for arrays) |
| type | The skipped type |
| llhssrc | The recent reading position before this (it will get the left of left hand sign of this argument) |
| follow_ellipsis | Whether an argument followed by an ellipsis is interpreted as a range start or as only the argument itself |
| inside_bundle | Whether the current position is inside a bundle |