libcfe  0.12.1
some useful C-functions
id3.h File Reference
#include <stdio.h>
#include <stdint.h>
Include dependency graph for id3.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ID3_tag
 

Macros

#define ID3_tag_add_artist(t, a)   ID3_tag_add_data(t, 84, 80, 69, 49, a);
 Shorthand to store the artist name in an ID3 tag. See ID3_tag_add_data. More...
 
#define ID3_tag_add_title(t, s)   ID3_tag_add_data(t, 84, 73, 84, 50, s);
 Shorthand to store the title in an ID3 tag. See ID3_tag_add_data. More...
 
#define ID3_tag_add_album(t, a)   ID3_tag_add_data(t, 84, 65, 76, 66, a);
 Shorthand to store the album name in an ID3 tag. See ID3_tag_add_data. More...
 
#define ID3_tag_add_year(t, y)   ID3_tag_add_data(t, 84, 89, 69, 82, y);
 Shorthand to store the release year in an ID3 tag. See ID3_tag_add_data. More...
 
#define ID3_tag_add_length(t, l)   ID3_tag_add_data(t, 84, 76, 69, 78, l);
 Shorthand to store the record length in an ID3 tag. See ID3_tag_add_data. More...
 

Functions

int ID3_tag_init (ID3_tag *t)
 
int ID3_tag_fwrite (ID3_tag *t, FILE *fp)
 
int ID3_tag_write (ID3_tag *tag, char *filename)
 
int ID3_tag_add_data (ID3_tag *tag, uint8_t t1, uint8_t t2, uint8_t t3, uint8_t t4, char *data)
 

Macro Definition Documentation

◆ ID3_tag_add_album

#define ID3_tag_add_album (   t,
  a 
)    ID3_tag_add_data(t, 84, 65, 76, 66, a);

Shorthand to store the album name in an ID3 tag. See ID3_tag_add_data.

Definition at line 61 of file id3.h.

◆ ID3_tag_add_artist

#define ID3_tag_add_artist (   t,
  a 
)    ID3_tag_add_data(t, 84, 80, 69, 49, a);

Shorthand to store the artist name in an ID3 tag. See ID3_tag_add_data.

Definition at line 55 of file id3.h.

◆ ID3_tag_add_length

#define ID3_tag_add_length (   t,
 
)    ID3_tag_add_data(t, 84, 76, 69, 78, l);

Shorthand to store the record length in an ID3 tag. See ID3_tag_add_data.

Definition at line 67 of file id3.h.

◆ ID3_tag_add_title

#define ID3_tag_add_title (   t,
 
)    ID3_tag_add_data(t, 84, 73, 84, 50, s);

Shorthand to store the title in an ID3 tag. See ID3_tag_add_data.

Definition at line 58 of file id3.h.

◆ ID3_tag_add_year

#define ID3_tag_add_year (   t,
 
)    ID3_tag_add_data(t, 84, 89, 69, 82, y);

Shorthand to store the release year in an ID3 tag. See ID3_tag_add_data.

Definition at line 64 of file id3.h.

Function Documentation

◆ ID3_tag_add_data()

int ID3_tag_add_data ( ID3_tag tag,
uint8_t  t1,
uint8_t  t2,
uint8_t  t3,
uint8_t  t4,
char *  data 
)

Store data in an ID3 tag.

Parameters
[in]tagThe ID3 tag to store the data in.
[in]t1,t2,t3,t4Identifies the type of data.
[in]dataThe data to store.
Returns
return value
  • 0 succeed
  • -1 wrong tag major version

Definition at line 26 of file id3.c.

Here is the call graph for this function:

◆ ID3_tag_fwrite()

int ID3_tag_fwrite ( ID3_tag t,
FILE *  fp 
)

Write an ID3 tag to a file.

Parameters
[in]tThe ID3 tag to write.
[in]fpA file pointer.
Returns
return value
  • 0 succeed
  • -1 wrong tag major version

Definition at line 79 of file id3.c.

Here is the call graph for this function:

◆ ID3_tag_init()

int ID3_tag_init ( ID3_tag t)

Initialize an empty ID3 tag.

Parameters
[in,out]tID3 tag
Returns
always zero

Definition at line 14 of file id3.c.

◆ ID3_tag_write()

int ID3_tag_write ( ID3_tag tag,
char *  filename 
)

Write an ID3 tag to a file.

Parameters
[in]tagThe ID3 tag to write.
[in]filenameA pointer to a string representing a filename.
Returns
return value
  • 0 succeed
  • -1 wrong tag major version

Definition at line 129 of file id3.c.

Here is the call graph for this function: