This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copyright 2019 SiFive, Inc */ | |
/* SPDX-License-Identifier: Apache-2.0 */ | |
#include <stdio.h> | |
#include <metal/spi.h> | |
#include <metal/gpio.h> | |
struct metal_spi *spi = 0; | |
struct metal_gpio *gpio_device = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copyright 2019 SiFive, Inc */ | |
/* SPDX-License-Identifier: Apache-2.0 */ | |
#include <stdio.h> | |
#include <metal/spi.h> | |
#include <metal/gpio.h> | |
struct metal_spi *spi = 0; | |
struct metal_gpio *gpio_device = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const c = @cImport({ | |
@cInclude("zmq.h"); | |
}); | |
pub fn main() anyerror!void { | |
std.debug.warn("All your base are belong to us.\n"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Builder = @import("std").build.Builder; | |
pub fn build(b: *Builder) void { | |
const mode = b.standardReleaseOptions(); | |
const exe = b.addExecutable("pub", "src/pub.zig"); | |
exe.setBuildMode(mode); | |
exe.addLibPath("/usr/lib64"); | |
exe.linkSystemLibrary("zmq"); | |
exe.install(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const net = std.net; | |
const fs = std.fs; | |
const os = std.os; | |
pub const io_mode = .evented; | |
pub fn main() anyerror!void { | |
var general_purpose_allocator = std.heap.GeneralPurposeAllocator(.{}){}; | |
const allocator = &general_purpose_allocator.allocator; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const os = std.os; | |
const net = std.net; | |
pub fn main() anyerror!void { | |
const address_all = net.Address.initIp4([_]u8{ 0, 0, 0, 0 }, 4040); | |
const address = net.Address.initIp4([_]u8{ 127, 0, 0, 1 }, 4040); | |
const address_target_ok = net.Address.initIp4([_]u8{ 127, 0, 0, 42 }, 4040); | |
const address_target_notok = net.Address.initIp4([_]u8{ 192, 168, 1, 1 }, 4040); |