paraslash Paraslash Audio Streaming
About   News   Download   Documentation   Development

Macros | Functions
stat.c File Reference

Functions used for sending/receiving the status of para_server and para_audiod. More...

#include <regex.h>
#include "para.h"
#include "error.h"
#include "string.h"

Macros

#define MIN_STAT_ITEM_LEN   9 /* 5 + 2 + 2, e.g. '0005 00:\n' */
 The minimal length of a status item buffer. More...
 

Functions

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...
 

Detailed Description

Functions used for sending/receiving the status of para_server and para_audiod.

Macro Definition Documentation

◆ MIN_STAT_ITEM_LEN

#define MIN_STAT_ITEM_LEN   9 /* 5 + 2 + 2, e.g. '0005 00:\n' */

The minimal length of a status item buffer.

Function Documentation

◆ for_each_stat_item()

int for_each_stat_item ( char *  item_buf,
size_t  num_bytes,
int(*)(int, char *)  item_handler 
)

Call a function for each complete status item of a buffer.

Parameters
item_bufThe source buffer.
num_bytesThe length of buf.
item_handlerFunction to call for each complete item.
Returns
Negative on errors, the number of bytes not passed to item_handler on success.

Status items are expected in the format used by parser-friendly output mode of the stat command of para_client/para_audioc.

References MIN_STAT_ITEM_LEN, PARA_WARNING_LOG, and read_size_header().