lib313 is a small C library for packing/unpacking ID3v1.3 tags. Please read ID3v1.3 specification if you haven't done it yet, it makes understanding of the library much simpler.


You can download the sources of the library from its page on SourceForge:


The library has pretty simple programming interface which consists of the following three functions defined in lib313.h:

int lib313_estimate(const struct lib313_tag *tag);
int lib313_pack(char *buf, const struct lib313_tag *tag);
int lib313_unpack(struct lib313_tag *tag, const char *buf);


This function calculates remaining free space in the extension space for the specified tag. An application can use it to inform user about amount of available space. In case of overflow this function returns negative value with number of truncated bytes.


This function packs tag into a byte array of length 128 bytes.


This function unpacks tag from a byte array of length 128 bytes. It returns 0 (LIB313_SUCCESS) on success, or negative error value otherwise.


Copyright © 2009–2010 Vitaly Sinilin