# libedl
libedl is a library for parsing Vegas Pro EDL files and translating them into usable C structures.

## Usage
```c
#include <stdio.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);

    fclose(file);

    /* pass it to libedl */
    EDL_file edl = EDL_parse(data, fsize + 1);

    /* do what we have to do with it */
    for (int i = 0; i < edl.size; i++) {
        printf("%s", edl.arr[i].filename);
    }

    /* free our memory */
    EDL_free(edl);
    free(data);

	return 0;
}
```
