Mercurial > libedl
view README.md @ 5:a6ab6d9c0dac
readme: fix typos, str: remove outdated note
our allocator is actually fairly smart now :)
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Mon, 25 Dec 2023 16:26:46 -0500 |
parents | c2408abb258a |
children | 0c98b46eaf73 |
line wrap: on
line source
# libedl libedl is a library for parsing Vegas Pro EDL files and translating them into usable C structures. ## Build ```console $ autoreconf -i $ mkdir build $ cd build $ ../configure $ make $ sudo make install ``` ## Usage ```c #include <stdio.h> #include <stdlib.h> #include "edl.h" int main() { /* open the file */ FILE* file = fopen("MyProject.TXT", "rb"); if (!file) return 1; /* get filesize */ fseek(file, 0L, SEEK_END); long fsize = ftell(file); fseek(file, 0L, SEEK_SET); /* grab the contents */ char* data = malloc(fsize + 1); if (!data) return 1; fread(data, fsize, 1, file); data[fsize] = '\0'; fclose(file); /* pass it to libedl */ EDL edl = EDL_parse(data, fsize + 1); /* dump the EDL to a string */ char* edl_str = EDL_dump(edl); printf("%s\n", edl_str); free(edl_str); /* free our memory */ EDL_free(edl); free(data); return 0; } ```