Hello,
Project adapted to Pelles C Version 12 :
QuoteA lightweight tar library written in ANSI C
https://github.com/rxi/microtar
Example code from the GitHub repository :
#include <stdio.h>
#include "microtar.h"
int main(void)
{
mtar_t tar;
mtar_header_t h;
char *p;
/* Open archive for reading */
mtar_open(&tar, "test.tar", "r");
/* Print all file names and sizes */
while ( (mtar_read_header(&tar, &h)) != MTAR_ENULLRECORD ) {
printf("%s (%d bytes)\n", h.name, h.size);
mtar_next(&tar);
}
/* Load and print contents of file "test.txt" */
mtar_find(&tar, "test.txt", &h);
p = calloc(1, h.size + 1);
mtar_read_data(&tar, p, h.size);
printf("%s", p);
free(p);
/* Close archive */
mtar_close(&tar);
return 0;
}
Thank you for providing such a great library.
:)
This library is so good and simple. I like it.
Hi cosh,
Thanks for your feedback. The real provider is the author of the original code, rxi
All what I did are some minor modiicafions to compile the code with Pelles C.
Hi Vortex,
Another nice contribution! Thanks. I don't use the tar format for anything but nice to have options for Pelles C libraries. Sometimes minor mods are the hardest :)
John Z