initial commit
This commit is contained in:
@@ -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) {
|
||||
}
|
||||
Reference in New Issue
Block a user