river/src/main.zig

25 lines
517 B
Zig
Raw Normal View History

const std = @import("std");
2020-03-29 10:36:15 -07:00
const c = @import("c.zig");
2020-03-29 12:05:34 -07:00
const Log = @import("log.zig").Log;
2020-03-19 08:29:22 -07:00
2020-03-23 08:50:20 -07:00
const Server = @import("server.zig").Server;
2020-03-19 08:29:22 -07:00
pub fn main() !void {
2020-03-29 12:05:34 -07:00
Log.init(Log.Debug);
c.wlr_log_init(.WLR_ERROR, null);
2020-03-19 08:29:22 -07:00
2020-03-29 12:05:34 -07:00
Log.Info.log("Initializing server", .{});
2020-03-19 08:29:22 -07:00
var server: Server = undefined;
try server.init(std.heap.c_allocator);
2020-04-18 03:21:43 -07:00
defer server.deinit();
2020-03-22 17:21:15 -07:00
try server.start();
2020-03-20 14:44:08 -07:00
2020-03-29 12:05:34 -07:00
Log.Info.log("Running server...", .{});
2020-03-22 17:21:15 -07:00
server.run();
2020-04-18 03:21:43 -07:00
Log.Info.log("Shutting down server", .{});
2020-03-19 08:29:22 -07:00
}