KDK_FAN_GET_INFORMATION(3)

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

💖 KDK_FAN_GET_INFORMATION 💖

okay so bestie, we're in the Library Functions Manual, section 3 — it's the KDK_FAN_GET_INFORMATION page and it's all about asking your fans how they're doing 🌀✨


✨ NAME ✨

kdk_fan_get_information — 获取风扇的信息 (aka get the fan information, that's literally it, no notes)


🌸 SYNOPSIS 🌸

#include <libkyfan.h>

extern char** kdk_fan_get_information();

Link with -lkyfan. 🫶


🦋 DESCRIPTION 🦋

The main function of the interface is to obtain the fan information. That's the whole vibe — it's the main character of this interface and its one job is grabbing the fan info. No side quests, no drama, just fan facts. 💅


🎀 RETURN VALUE 🎀

  • On success, returns a list of fan information of type char*, including name and speed, ending with a NULL string; Generated by alloc and needs to be recycled by kdk_fan_freeall ♻️
  • On error, return NULL. 💀
not the alloc'd memory being your responsibility now — bestie, if you don't hand it to kdk_fan_freeall you're lowkey leaking. recycle ur list, queen 👑

🔥 EXAMPLES 🔥

here's the moment you've all been waiting for, the example, copied with love and character for character 🍓

#include "libkyfan.h"
#include <stdio.h>
#include <stdlib.h>

int main()
{
    char **fan = kdk_fan_get_information();
    int index = 0;
    while (fan[index])
    {
        printf("%s0, fan[index]);
        index++;
    }
    kdk_fan_freeall(fan);
    return 0;
}

walk the list til you hit that NULL, print each entry, then free the whole thing. iconic behavior fr fr 🌈


💜 CONFORMING TO 💜

These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: kdk_fan_freeall(). 🐧

"withdrawn" bestie… the POSIX.1e draft is a ghost, it's giving vintage, we still respect it tho 🕯️

👑 SEE ALSO 👑


and that's the whole page, bestie — no cap, you now know everything this manual knows 💖

🌸 this one came straight out of the Linux Programmer's Manual, dated Fri Aug 25 2023, and yes the title is still KDK_FAN_GET_INFORMATION(3) in case you forgot, which you didn't, because you're a genius 🎀✨

📦 where this page comes from