Compare commits
2 Commits
84024fb05a
...
83d25e0822
Author | SHA1 | Date | |
---|---|---|---|
83d25e0822 | |||
6c078ffbca |
7
c-example/makefile
Normal file
7
c-example/makefile
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
all: build
|
||||||
|
|
||||||
|
build:
|
||||||
|
gcc -o example ./example.c -L ../zig-out/lib/ -lhexa
|
||||||
|
|
||||||
|
run: build
|
||||||
|
LD_LIBRARY_PATH=../zig-out/lib/ ./example
|
6
makefile
6
makefile
@ -2,9 +2,3 @@ all: build
|
|||||||
|
|
||||||
build:
|
build:
|
||||||
zig build
|
zig build
|
||||||
|
|
||||||
build-test: build
|
|
||||||
gcc -o example c-example/example.c -L ./zig-out/lib/ -lhexa
|
|
||||||
|
|
||||||
run-test: build
|
|
||||||
LD_LIBRARY_PATH=./zig-out/lib/ ./example
|
|
||||||
|
@ -13,21 +13,21 @@ export fn hexdump(title: [*]const u8, title_len: u32,
|
|||||||
const writer_output = hexfbs.writer();
|
const writer_output = hexfbs.writer();
|
||||||
hexa.hexdump(writer_output, title[0..title_len], input_buffer[0..input_buffer_len]) catch |err| {
|
hexa.hexdump(writer_output, title[0..title_len], input_buffer[0..input_buffer_len]) catch |err| {
|
||||||
switch(err) {
|
switch(err) {
|
||||||
error.DiskQuota => log.warn("error.DiskQuota", .{}),
|
error.DiskQuota => log.warn("error.DiskQuota", .{}),
|
||||||
error.FileTooBig => log.warn("error.FileTooBig", .{}),
|
error.FileTooBig => log.warn("error.FileTooBig", .{}),
|
||||||
error.InputOutput => log.warn("error.InputOutput", .{}),
|
error.InputOutput => log.warn("error.InputOutput", .{}),
|
||||||
error.NoSpaceLeft => log.warn("error.NoSpaceLeft", .{}),
|
error.NoSpaceLeft => log.warn("error.NoSpaceLeft", .{}),
|
||||||
error.DeviceBusy => log.warn("error.DeviceBusy", .{}),
|
error.DeviceBusy => log.warn("error.DeviceBusy", .{}),
|
||||||
error.InvalidArgument => log.warn("error.InvalidArgument", .{}),
|
error.InvalidArgument => log.warn("error.InvalidArgument", .{}),
|
||||||
error.AccessDenied => log.warn("error.AccessDenied", .{}),
|
error.AccessDenied => log.warn("error.AccessDenied", .{}),
|
||||||
error.BrokenPipe => log.warn("error.BrokenPipe", .{}),
|
error.BrokenPipe => log.warn("error.BrokenPipe", .{}),
|
||||||
error.SystemResources => log.warn("error.SystemResources", .{}),
|
error.SystemResources => log.warn("error.SystemResources", .{}),
|
||||||
error.OperationAborted => log.warn("error.OperationAborted", .{}),
|
error.OperationAborted => log.warn("error.OperationAborted", .{}),
|
||||||
error.NotOpenForWriting => log.warn("error.NotOpenForWriting", .{}),
|
error.NotOpenForWriting => log.warn("error.NotOpenForWriting", .{}),
|
||||||
error.LockViolation => log.warn("error.LockViolation", .{}),
|
error.LockViolation => log.warn("error.LockViolation", .{}),
|
||||||
error.WouldBlock => log.warn("error.WouldBlock", .{}),
|
error.WouldBlock => log.warn("error.WouldBlock", .{}),
|
||||||
error.ConnectionResetByPeer => log.warn("error.ConnectionResetByPeer", .{}),
|
error.ConnectionResetByPeer => log.warn("error.ConnectionResetByPeer", .{}),
|
||||||
error.Unexpected => log.warn("error.Unexpected", .{}),
|
error.Unexpected => log.warn("error.Unexpected", .{}),
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user