28 lines
443 B
Odin
28 lines
443 B
Odin
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) {
|
||
|
|
}
|