LIBKYHWINFO(3)

📦 version 3.0.1.4, in arch rolling, ubuntu resolute, ubuntu stonking

✨ LIBKYHWINFO ✨

okay bestie, welcome to the libkyhwinfo page — it's a library functions manual, section 3, and it's literally your one-stop shop for snooping on hardware 💅


🌸 NAME 🌸

kdk_hw_get_hwinfo, kdk_hw_free_hw, kdk_hw_get_powerinfo, kdk_hw_free_power_info — 获取键盘,鼠标,声卡,光驱,usb和电源硬件信息

(that's "get keyboard, mouse, sound card, optical drive, usb and power supply hardware info" for my monolingual girlies 🫶)


🎀 SYNOPSIS 🎀

#include <libkyhw.h>

extern struct HWInfo *kdk_hw_get_hwinfo(int type);

extern void kdk_hw_free_hw(struct HWInfo *list);

extern struct Power *kdk_hw_get_powerinfo();

extern void kdk_hw_free_power_info(struct Power *info);

Link with -lkyhwinfo. yes, that's the whole vibe check, no cap 🔥


💖 DETAILED DESCRIPTION 💖

So this library is carrying keyboard, mouse, sound card, optical drive, USB and power supply hardware information. That's it, that's the whole job, and it ate ✨


🦋 DATA STRUCTURES 🦋

💜 Structure HWInfo

HWInfo is where all the keyboard, mouse, sound card, optical drive and USB hardware tea lives:

       struct HWInfo {
            char model[ATTRSIZE];
           char vendor[ATTRSIZE];
           char device[ATTRSIZE];
           char driver[ATTRSIZE];
           char revision[ATTRSIZE];
           char busid[ATTRSIZE];
           char devicenum[ATTRSIZE];
           char width[8];
           char clock[8];
           struct HWInfo *next;
       };
there are other members not documented here, and they're only meant for libkyhwinfo internal use — so like, don't touch them, they're not for you 🙈

💜 Structure Power

Power is the power supply information girly:

       struct Power {
            char daemon_version[32];
           bool on_battery;
           bool lid_is_closed;
           bool lid_is_present;
           char critical_action[32];
           struct power_device *devices;
       };
again: other members not documented here, libkyhwinfo internal use only, hands off bestie 💀

💜 Structure power_device

and power_device is the one that gets specific about a power supply:

       struct power_device {
            char name[256];
           char native_path[32];
           bool power_supply;
           char updated[64];
           bool has_history;
           bool has_statistics;
           bool is_persent;
           bool is_rechargeable;
           char state[32];
           char warning_level[32];
           double energy;
           double energy_empty;
           double energy_full;
           double energy_full_design;
           double energy_rate;
           double voltage;
           long time_to_empty;
           long time_to_full;
           double percentage;
           double temperature;
           double capacity;
           char technology[32];
           bool online;
           char icon_name[64];
           struct power_device *next;
       };
and yes, same disclaimer one more time: other members not documented here, only meant for libkyhwinfo internal use ✨

⭐ RETURN VALUE ⭐

ngl the return value is generally specific to the individual function you called — so it's giving "read the function, bestie", no single answer here 🫶


🌈 CONFORMING TO 🌈

These functions are as per the withdrawn POSIX.1e draft specification (withdrawn, okay, so we're all just living our lives here).

The following functions are Linux extensions: kdk_hw_get_hwinfo(), kdk_hw_free_hw(), kdk_hw_get_powerinfo() and kdk_hw_free_power_info().


👑 SEE ALSO 👑


and that's the whole page, periodt 💅

cute little sign-off from the Linux Programmer's Manual, dated Fri Aug 25 2023 — and yeah, this page is LIBKYHWINFO(3), iykyk 🎀✨

📦 where this page comes from