mcpp index

compat.libudev

#include

libudev-zero 1.0.5 — the libudev ABI without systemd or a daemon, for libinput

#include <libudev.h>
mcpp add compat.libudev@1.0.5

用法

来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。

// compat.libudev — behavioral test against /sys, no daemon.
//
// libudev-zero reads /sys directly instead of talking to udevd, which is the
// whole reason it is here: a subos has no udev daemon, and an implementation
// that needed one would work on a developer's machine and nowhere else. So the
// test enumerates REAL devices — that is the thing that would silently return
// nothing if the package were built wrong.

#ifdef __linux__

#include <libudev.h>

#include <dlfcn.h>
#include <cstdio>
#include <cstring>
#include <string>

namespace {
int failures = 0;
void check(bool ok, const char *what)
{
    std::printf("%-58s %s\n", what, ok ? "ok" : "FAILED");
// …

tests/examples/libudev/tests/libudev.cpp · 项目 tests/examples/libudev

构建

targets
udev (shared)
language
c++23
C standard
c11
import std
no
include dirs
*, mcpp_generated

源文件 (5)

  • */udev.c
  • */udev_device.c
  • */udev_enumerate.c
  • */udev_list.c
  • */udev_monitor.c

生成的文件

  • mcpp_generated/libudev.h

版本

版本平台 镜像sha256
1.0.5 最新 Linux GLOBAL CN bf4372f79ddb…