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