river/src/main.zig

43 lines
1.2 KiB
Zig
Raw Normal View History

2020-05-02 17:21:10 +00:00
// This file is part of river, a dynamic tiling wayland compositor.
//
// Copyright 2020 Isaac Freund
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
const std = @import("std");
2020-05-02 17:21:10 +00:00
2020-03-29 17:36:15 +00:00
const c = @import("c.zig");
2020-03-19 15:29:22 +00:00
2020-05-02 17:21:10 +00:00
const Log = @import("log.zig").Log;
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);
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
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 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
}