initial commit
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
package pdf_example
|
||||||
|
|
||||||
|
import pdf "../"
|
||||||
|
|
||||||
|
main :: proc() {
|
||||||
|
pdf.open_file("example.pdf")
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package pdf
|
||||||
|
|
||||||
|
import "core:os"
|
||||||
|
|
||||||
|
Error :: enum {
|
||||||
|
File_Read_Error,
|
||||||
|
}
|
||||||
|
|
||||||
|
Document :: struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
open :: proc{
|
||||||
|
open_file,
|
||||||
|
open_bytes,
|
||||||
|
}
|
||||||
|
|
||||||
|
open_file :: proc(path: string) -> (pdf: ^Document, err: Error) {
|
||||||
|
data, read_err := os.read_entire_file(path, context.allocator)
|
||||||
|
if read_err != nil {
|
||||||
|
return nil, .File_Read_Error
|
||||||
|
}
|
||||||
|
|
||||||
|
return open_bytes(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
open_bytes :: proc(data: []u8) -> (pdf: ^Document, err: Error) {
|
||||||
|
}
|
||||||
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Reference in New Issue
Block a user