diff README.md @ 2:d00bc412900e

*: fix up lots of stuff and make the thing actually usable
author Paper <mrpapersonic@gmail.com>
date Sun, 24 Dec 2023 20:01:30 -0500
parents 0ea1ec2da443
children bd99b6549eb4
line wrap: on
line diff
--- a/README.md	Tue Jul 04 22:50:26 2023 -0400
+++ b/README.md	Sun Dec 24 20:01:30 2023 -0500
@@ -1,5 +1,43 @@
-# edl-parser
-edl-parser is a parser library for Vegas Pro EDL files and translates them into a usable format for manipulation in C/C++.
+# 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);
 
-# How do I use this?
-Drag it into your C/C++ project and adjust your compiler flags accordingly. Then you can call `parse_EDL` with a `char*` containing the entire contents of any EDL file.
\ No newline at end of file
+    /* 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;
+}
+```