id3dev 26.01 An ID3 metadata library

Loading...
Searching...
No Matches
id3v2Frame.h
Go to the documentation of this file.
1x
12
13#ifndef ID3V2_FRAME
14#define ID3V2_FRAME
15
16#ifdef __cplusplus
17 extern "C"{
18#endif
19
20#include "id3v2Types.h"
21
22/*
23 Frame header
24*/
25
26 Id3v2FrameHeader *id3v2CreateFrameHeader(uint8_t id[ID3V2_FRAME_ID_MAX_SIZE], bool tagAlter, bool fileAlter,
27 bool readOnly, bool unsync, uint32_t decompressionSize,
28 uint8_t encryptionSymbol, uint8_t groupSymbol);
29
30 void id3v2DestroyFrameHeader(Id3v2FrameHeader **toDelete);
31
32 Id3v2ContentEntry *id3v2CreateContentEntry(void *entry, size_t size);
33
34// List/Hash API required functions
35
36 void id3v2DeleteContentEntry(void *toBeDeleted);
37
38 int id3v2CompareContentEntry(const void *first, const void *second);
39
40 char *id3v2PrintContentEntry(const void *toBePrinted);
41
42 void *id3v2CopyContentEntry(const void *toBeCopied);
43
44 void id3v2DeleteFrame(void *toBeDeleted);
45
46 int id3v2CompareFrame(const void *first, const void *second);
47
48 char *id3v2PrintFrame(const void *toBePrinted);
49
50 void *id3v2CopyFrame(const void *toBeCopied);
51
52/*
53 Frame
54*/
55
56 Id3v2Frame *id3v2CreateFrame(Id3v2FrameHeader *header, List *context, List *entries);
57
58 void id3v2DestroyFrame(Id3v2Frame **toDelete);
59
60 Id3v2Frame *id3v2CreateEmptyFrame(const char id[ID3V2_FRAME_ID_MAX_SIZE], uint8_t version, HashTable *userPairs);
61
62/*
63 Frame access
64*/
65
66 bool id3v2CompareFrameId(const Id3v2Frame *frame, const char id[ID3V2_FRAME_ID_MAX_SIZE]);
67
68ListIter id3v2CreateFrameTraverser(Id3v2Tag *tag);
69
70 Id3v2Frame *id3v2FrameTraverse(ListIter *traverser);
71
72
73ListIter id3v2CreateFrameEntryTraverser(Id3v2Frame *frame);
74
75 void *id3v2ReadFrameEntry(ListIter *traverser, size_t *dataSize);
76
77 char *id3v2ReadFrameEntryAsChar(ListIter *traverser, size_t *dataSize);
78
79uint8_t id3v2ReadFrameEntryAsU8(ListIter *traverser);
80
81uint16_t id3v2ReadFrameEntryAsU16(ListIter *traverser);
82
83uint32_t id3v2ReadFrameEntryAsU32(ListIter *traverser);
84
85 bool id3v2WriteFrameEntry(Id3v2Frame *frame, ListIter *entries, size_t entrySize, const void *entry);
86
87 bool id3v2AttachFrameToTag(Id3v2Tag *tag, Id3v2Frame *frame);
88
89 Id3v2Frame *id3v2DetachFrameFromTag(Id3v2Tag *tag, Id3v2Frame *frame);
90
91
92/*
93 output
94*/
95
96uint8_t *id3v2FrameHeaderSerialize(Id3v2FrameHeader *header, uint8_t version, uint32_t frameSize, size_t *outl);
97
98 char *id3v2FrameHeaderToJSON(const Id3v2FrameHeader *header, uint8_t version);
99
100uint8_t *id3v2FrameSerialize(Id3v2Frame *frame, uint8_t version, size_t *outl);
101
102 char *id3v2FrameToJSON(Id3v2Frame *frame, uint8_t version);
103
104
105#ifdef __cplusplus
106} //extern c end
107#endif
108
109#endif
id3v2FrameHeaderToJSON
char * id3v2FrameHeaderToJSON(const Id3v2FrameHeader *header, uint8_t version)
Converts a frame header structure to its JSON representation based on ID3v2 version.
Definition id3v2Frame.c:1136
id3v2CompareFrame
int id3v2CompareFrame(const void *first, const void *second)
Performs deep comparison of two ID3v2 frame structures.
Definition id3v2Frame.c:241
id3v2WriteFrameEntry
bool id3v2WriteFrameEntry(Id3v2Frame *frame, ListIter *entries, size_t entrySize, const void *entry)
Writes data to the entry at the iterator's current position, clamping size to context constraints.
Definition id3v2Frame.c:865
id3v2FrameSerialize
uint8_t * id3v2FrameSerialize(Id3v2Frame *frame, uint8_t version, size_t *outl)
Serializes a complete ID3v2 frame to binary format according to the specified version.
Definition id3v2Frame.c:1260
id3v2CopyContentEntry
void * id3v2CopyContentEntry(const void *toBeCopied)
Creates a deep copy of a content entry.
Definition id3v2Frame.c:196
id3v2CreateFrameTraverser
ListIter id3v2CreateFrameTraverser(Id3v2Tag *tag)
Creates a list iterator for traversing frames in an ID3v2 tag.
Definition id3v2Frame.c:524
id3v2ReadFrameEntryAsU32
uint32_t id3v2ReadFrameEntryAsU32(ListIter *traverser)
Reads the current entry as a 32-bit unsigned integer, advancing the iterator.
Definition id3v2Frame.c:812
id3v2FrameToJSON
char * id3v2FrameToJSON(Id3v2Frame *frame, uint8_t version)
Converts a complete ID3v2 frame structure to its JSON representation.
Definition id3v2Frame.c:1843
id3v2ReadFrameEntry
void * id3v2ReadFrameEntry(ListIter *traverser, size_t *dataSize)
Reads and returns a deep copy of the current entry's data, advancing the iterator.
Definition id3v2Frame.c:591
id3v2CreateEmptyFrame
Id3v2Frame * id3v2CreateEmptyFrame(const char id[ID3V2_FRAME_ID_MAX_SIZE], uint8_t version, HashTable *userPairs)
Creates an empty frame structure with zero-initialized entries based on context lookup.
Definition id3v2Frame.c:435
id3v2FrameHeaderSerialize
uint8_t * id3v2FrameHeaderSerialize(Id3v2FrameHeader *header, uint8_t version, uint32_t frameSize, size_t *outl)
Serializes a frame header to binary format according to the specified ID3v2 version.
Definition id3v2Frame.c:1002
id3v2CreateFrameHeader
Id3v2FrameHeader * id3v2CreateFrameHeader(uint8_t id[ID3V2_FRAME_ID_MAX_SIZE], bool tagAlter, bool fileAlter, bool readOnly, bool unsync, uint32_t decompressionSize, uint8_t encryptionSymbol, uint8_t groupSymbol)
Creates an ID3v2 frame header structure with specified flags and metadata.
Definition id3v2Frame.c:68
id3v2AttachFrameToTag
bool id3v2AttachFrameToTag(Id3v2Tag *tag, Id3v2Frame *frame)
Inserts a frame at the end of a tag's frames list.
Definition id3v2Frame.c:953
id3v2ReadFrameEntryAsChar
char * id3v2ReadFrameEntryAsChar(ListIter *traverser, size_t *dataSize)
Reads a frame entry as a UTF-8 encoded string with escaped special characters, advancing the iterator...
Definition id3v2Frame.c:632
id3v2CreateFrame
Id3v2Frame * id3v2CreateFrame(Id3v2FrameHeader *header, List *context, List *entries)
Creates an ID3v2 frame structure from provided components.
Definition id3v2Frame.c:391
id3v2CreateFrameEntryTraverser
ListIter id3v2CreateFrameEntryTraverser(Id3v2Frame *frame)
Creates a list iterator for traversing content entries within a frame.
Definition id3v2Frame.c:563
id3v2CopyFrame
void * id3v2CopyFrame(const void *toBeCopied)
Creates a deep copy of an ID3v2 frame structure.
Definition id3v2Frame.c:364
id3v2CreateContentEntry
Id3v2ContentEntry * id3v2CreateContentEntry(void *entry, size_t size)
Creates a content entry structure with a deep copy of the provided data.
Definition id3v2Frame.c:115
id3v2PrintContentEntry
char * id3v2PrintContentEntry(const void *toBePrinted)
Generates a string representation of a content entry for debugging.
Definition id3v2Frame.c:175
id3v2DestroyFrame
void id3v2DestroyFrame(Id3v2Frame **toDelete)
Frees all memory allocated for an ID3v2 frame structure and nullifies the pointer.
Definition id3v2Frame.c:409
id3v2DeleteContentEntry
void id3v2DeleteContentEntry(void *toBeDeleted)
Frees all memory allocated for a content entry structure.
Definition id3v2Frame.c:210
id3v2CompareContentEntry
int id3v2CompareContentEntry(const void *first, const void *second)
Compares two content entries byte-by-byte and returns the difference.
Definition id3v2Frame.c:145
id3v2DestroyFrameHeader
void id3v2DestroyFrameHeader(Id3v2FrameHeader **toDelete)
Frees all memory allocated for a frame header and nullifies the pointer.
Definition id3v2Frame.c:96
id3v2DetachFrameFromTag
Id3v2Frame * id3v2DetachFrameFromTag(Id3v2Tag *tag, Id3v2Frame *frame)
Removes a frame from a tag's frames list and returns it to the caller.
Definition id3v2Frame.c:978
id3v2ReadFrameEntryAsU8
uint8_t id3v2ReadFrameEntryAsU8(ListIter *traverser)
Reads the first byte of the current entry as an 8-bit unsigned integer, advancing the iterator.
Definition id3v2Frame.c:748
id3v2PrintFrame
char * id3v2PrintFrame(const void *toBePrinted)
Generates a string representation of a frame for debugging.
Definition id3v2Frame.c:341
id3v2CompareFrameId
bool id3v2CompareFrameId(const Id3v2Frame *frame, const char id[ID3V2_FRAME_ID_MAX_SIZE])
Compares a frame's identifier with a provided ID string.
Definition id3v2Frame.c:501
id3v2FrameTraverse
Id3v2Frame * id3v2FrameTraverse(ListIter *traverser)
Advances the iterator and returns the next frame in the list.
Definition id3v2Frame.c:549
id3v2DeleteFrame
void id3v2DeleteFrame(void *toBeDeleted)
Frees all memory allocated for an ID3v2 frame structure.
Definition id3v2Frame.c:226
id3v2ReadFrameEntryAsU16
uint16_t id3v2ReadFrameEntryAsU16(ListIter *traverser)
Reads the current entry as a 16-bit unsigned integer, advancing the iterator.
Definition id3v2Frame.c:778
id3v2Types.h
Definitions for ID3v2.x tag structure, constants, and genre enumeration.
Id3v2ContentEntry
struct _Id3v2ContentEntry Id3v2ContentEntry
Parsed data field from an ID3v2 frame.
Id3v2Tag
struct _Id3v2Tag Id3v2Tag
Complete ID3v2 tag structure containing header and metadata frames.
ID3V2_FRAME_ID_MAX_SIZE
#define ID3V2_FRAME_ID_MAX_SIZE
Maximum size in bytes for a frame ID field (4 bytes).
Definition id3v2Types.h:70
Id3v2Frame
struct _Id3v2Frame Id3v2Frame
Complete ID3v2 frame structure with header, parsing contexts, and data.
Id3v2FrameHeader
struct _Id3v2FrameHeader Id3v2FrameHeader
ID3v2 frame header containing identification and processing flags.