|
#define | MAXLINE 255 |
| used in various contexts More...
|
|
#define | PARA_MIN(x, y) |
| Compute the minimum of x and y. More...
|
|
#define | PARA_MAX(x, y) |
| Compute the maximum of x and y. More...
|
|
#define | PARA_ABS(x) |
| Compute the absolute value of x. More...
|
|
#define | DEFINE_STDERR_LOGGER(funcname, loglevel_barrier) |
| Define a standard log function that always writes to stderr. More...
|
|
#define | INIT_STDERR_LOGGING(loglevel_barrier) |
| Define the standard log function and activate it. More...
|
|
#define | AUTH_REQUEST_MSG "auth rsa " |
| Sent by para_client to initiate the authentication procedure. More...
|
|
#define | ROUND_UP(x, y) |
| Round up x to next multiple of y. More...
|
|
#define | ROUND_DOWN(x, y) |
| Round down x to multiple of y. More...
|
|
#define | DIV_ROUND_UP(x, y) |
| Divide and round up to next integer. More...
|
|
#define | EXPR_BUILD_ASSERT(cond) (sizeof(char [1 - 2 * !(cond)]) - 1) |
| Assert a build-time dependency, as an expression. More...
|
|
#define | _array_size_chk(arr) |
| &a[0] degrades to a pointer: a different type from an array More...
|
|
#define | ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + _array_size_chk(arr)) |
| Get the size of an array. More...
|
|
#define | para_isspace(c) isspace((int)(unsigned char)(c)) |
| Wrapper for isspace. More...
|
|
#define | FEC_EOF_PACKET |
| Data that indicates an eof-condition for a fec-encoded stream. More...
|
|
#define | FEC_EOF_PACKET_LEN 32 |
| The number of bytes of the FEC_EOF_PACKET. More...
|
|
#define | EMBRACE(...) { __VA_ARGS__} |
| Used to avoid a shortcoming in vim's syntax highlighting. More...
|
|
#define | do_nothing do {/* nothing */} while (0) |
| A nice cup of STFU for Mr gcc. More...
|
|
#define | SAMPLE_FORMATS |
| The sample formats supported by paraslash. More...
|
|
#define | PARA_DEBUG_LOG(f, ...) para_log(LL_DEBUG, "%s: " f, __FUNCTION__, ## __VA_ARGS__) |
|
#define | PARA_INFO_LOG(f, ...) para_log(LL_INFO, "%s: " f, __FUNCTION__, ## __VA_ARGS__) |
|
#define | PARA_NOTICE_LOG(f, ...) para_log(LL_NOTICE, "%s: " f, __FUNCTION__, ## __VA_ARGS__) |
|
#define | PARA_WARNING_LOG(f, ...) para_log(LL_WARNING, "%s: " f, __FUNCTION__, ## __VA_ARGS__) |
|
#define | PARA_ERROR_LOG(f, ...) para_log(LL_ERROR, "%s: " f, __FUNCTION__, ## __VA_ARGS__) |
|
#define | PARA_CRIT_LOG(f, ...) para_log(LL_CRIT, "%s: " f, __FUNCTION__, ## __VA_ARGS__) |
|
#define | PARA_EMERG_LOG(f, ...) para_log(LL_EMERG, "%s: " f, __FUNCTION__, ## __VA_ARGS__) |
|
#define | FOR_EACH_STATUS_ITEM(i) for (i = 0; i < NUM_STAT_ITEMS; i++) |
| Loop over each status item. More...
|
|
|
int | para_exec_cmdline_pid (pid_t *pid, const char *cmdline, int *fds) |
| Exec the given command. More...
|
|
int | tv_diff (const struct timeval *b, const struct timeval *a, struct timeval *diff) |
| Compute the difference of two time values. More...
|
|
long unsigned | tv2ms (const struct timeval *tv) |
| Convert struct timeval to milliseconds. More...
|
|
void | tv_add (const struct timeval *a, const struct timeval *b, struct timeval *sum) |
| Add two time values. More...
|
|
void | tv_scale (const unsigned long mult, const struct timeval *tv, struct timeval *result) |
| Compute integer multiple of given struct timeval. More...
|
|
void | tv_divide (const unsigned long divisor, const struct timeval *tv, struct timeval *result) |
| Compute a fraction of given struct timeval. More...
|
|
int | tv_convex_combination (const long a, const struct timeval *tv1, const long b, const struct timeval *tv2, struct timeval *result) |
| Compute a convex combination of two time values. More...
|
|
void | ms2tv (long unsigned n, struct timeval *tv) |
| Convert milliseconds to a struct timeval. More...
|
|
void | compute_chunk_time (long unsigned chunk_num, struct timeval *chunk_tv, struct timeval *stream_start, struct timeval *result) |
| Compute when to send a chunk of an audio file. More...
|
|
struct timeval * | clock_get_realtime (struct timeval *tv) |
| Retrieve the time of the realtime clock. More...
|
|
_static_inline_ long int | para_random (unsigned max) |
| Return a random non-negative integer in an interval. More...
|
|
_static_inline_ bool | iov_valid (const struct iovec *iov) |
| Simple sanity check for I/O vectors. More...
|
|
int | for_each_stat_item (char *item_buf, size_t num_bytes, int(*item_handler)(int, char *)) |
| Call a function for each complete status item of a buffer. More...
|
|
global paraslash definitions
Value: SAMPLE_FORMAT(SF_S8, "8 bit signed"), \
SAMPLE_FORMAT(SF_U8, "8 bit unsigned"), \
SAMPLE_FORMAT(SF_S16_LE, "16 bit signed, little endian"), \
SAMPLE_FORMAT(SF_S16_BE, "16 bit signed, big endian"), \
SAMPLE_FORMAT(SF_U16_LE, "16 bit unsigned, little endian"), \
SAMPLE_FORMAT(SF_U16_BE, "16 bit unsigned, big endian"), \
The sample formats supported by paraslash.
It may be determined by one of the following sources:
1. The decoding filter (para_audiod only). In this case, it is always
\p SF_S16_LE which is the canonical format used within decoders.
2. The wav header (para_write only).
3. The --sample-format option of para_write.
int para_exec_cmdline_pid |
( |
pid_t * |
pid, |
|
|
const char * |
cmdline, |
|
|
int * |
fds |
|
) |
| |
Exec the given command.
- Parameters
-
pid | Will hold the pid of the created process upon return. |
cmdline | Holds the command and its arguments, separated by spaces. |
fds | A pointer to a value-result array. |
This function uses fork/exec to create a new process. fds must be a pointer to three integers, corresponding to stdin, stdout and stderr respectively. It specifies how to deal with fd 0, 1, 2 in the child. The contents of fds are interpreted as follows:
- fd[i] < 0: leave fd \a i alone.
- fd[i] = 0: dup fd \a i to \p /dev/null.
- fd[i] > 0: create a pipe and dup i to one end of that pipe.
Upon return, fd[i] contains the file descriptor of the pipe.
In any case, all unneeded file descriptors are closed.
- Returns
- Standard.
References create_argv().
int tv_convex_combination |
( |
const long |
a, |
|
|
const struct timeval * |
tv1, |
|
|
const long |
b, |
|
|
const struct timeval * |
tv2, |
|
|
struct timeval * |
result |
|
) |
| |
Compute a convex combination of two time values.
- Parameters
-
a | The first coefficient. |
tv1 | The first time value. |
b | The second coefficient. |
tv2 | The second time value. |
result | Contains the convex combination upon return. |
Compute x := (a * tv1 + b * tv2) / (|a| + |b|) and store |x| in result. Both a and b may be negative.
- Returns
- Zero, 1 or -1, if x is zero, positive or negative, respectively.
References PARA_ABS, tv_add(), tv_diff(), tv_divide(), and tv_scale().
struct timeval* clock_get_realtime |
( |
struct timeval * |
tv | ) |
|
Retrieve the time of the realtime clock.
- Parameters
-
tv | Where to store the result. |
Gets the current value of the system-wide real-time clock (identified by id CLOCK_REALTIME
). If tv is NULL
, the value is stored in a static buffer, otherwise it is stored at the location given by tv.
- Returns
- This function aborts on errors. On success it returns a pointer to memory containing the current time.
- See also
- clock_gettime(2), gettimeofday(2).
Referenced by schedule().