Paraslash Audio Streaming | |
About News Download Documentation Development |
Attribute handling functions. More...
#include <regex.h>
#include <osl.h>
#include <lopsub.h>
#include "server_cmd.lsg.h"
#include "para.h"
#include "error.h"
#include "crypt.h"
#include "string.h"
#include "afh.h"
#include "afs.h"
#include "ipc.h"
#include "sideband.h"
#include "command.h"
Enumerations | |
enum | attribute_table_columns { ATTCOL_BITNUM, ATTCOL_NAME, NUM_ATT_COLUMNS } |
The columns of the attribute table. More... | |
Functions | |
int | get_attribute_bitnum_by_name (const char *att_name, unsigned char *bitnum) |
Retrieve the identifier (number) of an attribute. More... | |
void | get_attribute_bitmap (const uint64_t *atts, char *buf) |
Return a binary representation of the given attribute value. More... | |
int | get_attribute_text (uint64_t *atts, const char *delim, char **text) |
Get a string containing the set attributes in text form. More... | |
int | attribute_check_callback (struct afs_callback_arg *aca) |
Compute the attribute bit mask and check each afs info bitmap. More... | |
Variables | |
const struct server_cmd_user_data | lsg_server_cmd_com_lsatt_user_data = { .handler = com_lsatt } |
const struct server_cmd_user_data | lsg_server_cmd_com_addatt_user_data = { .handler = com_addatt } |
const struct server_cmd_user_data | lsg_server_cmd_com_mvatt_user_data = { .handler = com_mvatt } |
const struct server_cmd_user_data | lsg_server_cmd_com_rmatt_user_data = { .handler = com_rmatt } |
const struct afs_table_operations | attr_ops |
The attribute table stores name/bitnum pairs. More... | |
Attribute handling functions.
int get_attribute_bitnum_by_name | ( | const char * | att_name, |
unsigned char * | bitnum | ||
) |
Retrieve the identifier (number) of an attribute.
att_name | The name of the attribute. |
bitnum | Result pointer. |
References osl().
Referenced by mp_is_set().
void get_attribute_bitmap | ( | const uint64_t * | atts, |
char * | buf | ||
) |
Return a binary representation of the given attribute value.
atts | Pointer to the attribute value. |
buf | Result. |
This function prints a string of at most 64 characters plus the terminating NULL
character into buf which must be provided by the caller and at least 65 bytes long. The "x" character is used for set attributes and "-" is used for unset attributes.
In practice, not all 64 attributes are defined. In this case, the function only prints N + 1 characters where N is the greatest id of a defined attribute.
int get_attribute_text | ( | uint64_t * | atts, |
const char * | delim, | ||
char ** | text | ||
) |
Get a string containing the set attributes in text form.
atts | The attribute bitmap. |
delim | The delimiter to separate matching attribute names. |
text | Result pointer. |
int attribute_check_callback | ( | struct afs_callback_arg * | aca | ) |
Compute the attribute bit mask and check each afs info bitmap.
aca | The query field of aca is ignored. |
This iterates over all attributes in the attribute table and computes the logical or of 1 << b where b is the bit number of the attribute. The resulting bit mask is passed to aft_check_attributes() which performs the actual check.
const struct server_cmd_user_data lsg_server_cmd_com_lsatt_user_data = { .handler = com_lsatt } |
const struct server_cmd_user_data lsg_server_cmd_com_addatt_user_data = { .handler = com_addatt } |
const struct server_cmd_user_data lsg_server_cmd_com_mvatt_user_data = { .handler = com_mvatt } |
const struct server_cmd_user_data lsg_server_cmd_com_rmatt_user_data = { .handler = com_rmatt } |
const struct afs_table_operations attr_ops |
The attribute table stores name/bitnum pairs.