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…