orca/src/orca.zig

16 lines
552 B
Zig
Raw Normal View History

2023-09-12 03:50:05 +00:00
const std = @import("std");
2023-09-09 03:54:27 +00:00
const c = @cImport({
@cDefine("__ORCA__", "");
@cInclude("orca.h");
});
2023-09-12 03:50:05 +00:00
pub fn log_info(comptime fmt: []const u8, args: anytype, source: std.builtin.SourceLocation) void {
var format_buf: [512:0]u8 = undefined;
_ = std.fmt.bufPrintZ(&format_buf, fmt, args) catch 0; // just discard NoSpaceLeft error for now
2023-09-09 03:54:27 +00:00
2023-09-12 03:50:05 +00:00
var line: c_int = @intCast(source.line);
c.oc_log_ext(c.OC_LOG_LEVEL_INFO, source.fn_name.ptr, source.file.ptr, line, format_buf[0..].ptr);
2023-09-09 03:54:27 +00:00
}
2023-09-12 03:50:05 +00:00
pub const oc_request_quit = c.oc_request_quit;