#include "gcc.h"
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <string.h>
Go to the source code of this file.
Data Structures | |
struct | tag_item |
One tag value. More... | |
struct | tag |
The meta information about a song file. More... | |
Enumerations | |
enum | tag_type { TAG_ITEM_ARTIST, TAG_ITEM_ALBUM, TAG_ITEM_ALBUM_ARTIST, TAG_ITEM_TITLE, TAG_ITEM_TRACK, TAG_ITEM_NAME, TAG_ITEM_GENRE, TAG_ITEM_DATE, TAG_ITEM_COMPOSER, TAG_ITEM_PERFORMER, TAG_ITEM_COMMENT, TAG_ITEM_DISC, TAG_MUSICBRAINZ_ARTISTID, TAG_MUSICBRAINZ_ALBUMID, TAG_MUSICBRAINZ_ALBUMARTISTID, TAG_MUSICBRAINZ_TRACKID, TAG_NUM_OF_ITEM_TYPES } |
Codes for the type of a tag item. More... | |
Functions | |
enum tag_type | tag_name_parse (const char *name) |
Parse the string, and convert it into a tag_type. | |
enum tag_type | tag_name_parse_i (const char *name) |
Parse the string, and convert it into a tag_type. | |
struct tag * | tag_new (void) |
Creates an empty tag. | |
void | tag_lib_init (void) |
Initializes the tag library. | |
void | tag_clear_items_by_type (struct tag *tag, enum tag_type type) |
Clear all tag items with the specified type. | |
void | tag_free (struct tag *tag) |
Frees a tag object and all its items. | |
void | tag_begin_add (struct tag *tag) |
Gives an optional hint to the tag library that we will now add several tag items; this is used by the library to optimize memory allocation. | |
void | tag_end_add (struct tag *tag) |
Finishes the operation started with tag_begin_add(). | |
void | tag_add_item_n (struct tag *tag, enum tag_type type, const char *value, size_t len) |
Appends a new tag item. | |
static void | tag_add_item (struct tag *tag, enum tag_type type, const char *value) |
Appends a new tag item. | |
struct tag * | tag_dup (const struct tag *tag) |
Duplicates a tag object. | |
struct tag * | tag_merge (const struct tag *base, const struct tag *add) |
Merges the data from two tags. | |
struct tag * | tag_merge_replace (struct tag *base, struct tag *add) |
Merges the data from two tags. | |
static bool | tag_is_empty (const struct tag *tag) |
Returns true if the tag contains no items. | |
static bool | tag_is_defined (const struct tag *tag) |
Returns true if the tag contains any information. | |
const char * | tag_get_value (const struct tag *tag, enum tag_type type) |
Returns the first value of the specified tag type, or NULL if none is present in this tag object. | |
bool | tag_has_type (const struct tag *tag, enum tag_type type) |
Checks whether the tag contains one or more items with the specified type. | |
bool | tag_equal (const struct tag *tag1, const struct tag *tag2) |
Compares two tags, including the duration and all tag items. | |
Variables | |
const char * | tag_item_names [] |
An array of strings, which map the tag_type to its machine readable name (specific to the MPD protocol). | |
struct tag_item | mpd_packed |
One tag value. |
enum tag_type |
Codes for the type of a tag item.
void tag_begin_add | ( | struct tag * | tag | ) |
Gives an optional hint to the tag library that we will now add several tag items; this is used by the library to optimize memory allocation.
Only one tag may be in this state, and this tag must not have any items yet. You must call tag_end_add() when you are done.
Clear all tag items with the specified type.
void tag_end_add | ( | struct tag * | tag | ) |
Finishes the operation started with tag_begin_add().
Checks whether the tag contains one or more items with the specified type.
static bool tag_is_defined | ( | const struct tag * | tag | ) | [inline, static] |
static bool tag_is_empty | ( | const struct tag * | tag | ) | [inline, static] |
void tag_lib_init | ( | void | ) |
Initializes the tag library.
Merges the data from two tags.
If both tags share data for the same tag_type, only data from "add" is used.
Merges the data from two tags.
Any of the two may be NULL. Both are freed by this function.
enum tag_type tag_name_parse | ( | const char * | name | ) |
Parse the string, and convert it into a tag_type.
Returns TAG_NUM_OF_ITEM_TYPES if the string could not be recognized.
enum tag_type tag_name_parse_i | ( | const char * | name | ) |
Parse the string, and convert it into a tag_type.
Returns TAG_NUM_OF_ITEM_TYPES if the string could not be recognized.
Case does not matter.
struct tag_item mpd_packed |
const char* tag_item_names[] |
An array of strings, which map the tag_type to its machine readable name (specific to the MPD protocol).