mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Prefix proc syntax
This commit is contained in:
+3
-3
@@ -2,11 +2,11 @@
|
||||
#load "os_x.odin" when ODIN_OS == "osx";
|
||||
#load "os_linux.odin" when ODIN_OS == "linux";
|
||||
|
||||
const write_string = proc(fd: Handle, str: string) -> (int, Errno) {
|
||||
proc write_string(fd: Handle, str: string) -> (int, Errno) {
|
||||
return write(fd, []u8(str));
|
||||
}
|
||||
|
||||
const read_entire_file = proc(name: string) -> ([]u8, bool) {
|
||||
proc read_entire_file(name: string) -> ([]u8, bool) {
|
||||
var fd, err = open(name, O_RDONLY, 0);
|
||||
if err != 0 {
|
||||
return nil, false;
|
||||
@@ -35,7 +35,7 @@ const read_entire_file = proc(name: string) -> ([]u8, bool) {
|
||||
return data[0..<bytes_read], true;
|
||||
}
|
||||
|
||||
const write_entire_file = proc(name: string, data: []u8) -> bool {
|
||||
proc write_entire_file(name: string, data: []u8) -> bool {
|
||||
var fd, err = open(name, O_WRONLY, 0);
|
||||
if err != 0 {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user