KDK_DISPLAY_GET_CONFIGURATION(3)

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

💖 KDK_DISPLAY_GET_CONFIGURATION(3) 💖

okay bestie, so this one lives in the Library Functions Manual section of the libkydisplay crew, and it's literally the moment your code gets to peek at your graphics card's whole fit. no cap.


✨ NAME ✨

kdk_display_get_configuration — 获取显卡的配置 (aka: grab the video card's configuration, bestie 💅)


🌸 SYNOPSIS 🌸

#include <libkydisplay.h>

extern char* kdk_display_get_configuration();

and don't forget to link it, okay?? 👑

Link with -lkyhw.

🦋 DETAILED DESCRIPTION 🦋

okay so the whole point of this function, the main character energy of it all, is to obtain the configuration of the Video card. that's it. that's the job. she's simple, she's iconic, she delivers. ✨


💜 RETURN VALUE 💜

  • on success — she hands you back the Video card configuration of type char* 🎀 and heads up: the returned string needs to be released by free. like, you have to free it yourself, nobody's gonna do it for you, that's the vibe.
  • on error — she returns NULL. that's it. that's the whole error report. 💀

🍓 EXAMPLES 🍓

here's the full demo, copy it exactly, don't be out here improvising:

#include "libkydisplay.h"
#include <stdio.h>

int main()
{
    char *vendor = kdk_display_get_vendor();
    printf("生产厂商:%s\n", vendor);
    free(vendor);
    char *product = kdk_display_get_product();
    printf("型号:%s\n", product);
    free(product);
    char *description = kdk_display_get_description();
    printf("设备类型:%s\n", description);
    free(description);
    char *id = kdk_display_get_physical_id();
    printf("物理id:%s\n", id);
    free(id);
    char *bus = kdk_display_get_bus_info();
    printf("总线地址:%s\n", bus);
    free(bus);
    char *version = kdk_display_get_version();
    printf("设备版本:%s\n", version);
    free(version);
    char *width = kdk_display_get_width();
    printf("数据宽度:%s\n", width);
    free(width);
    char *clock = kdk_display_get_clock();
    printf("频率:%s\n", clock);
    free(clock);
    char *capabilities = kdk_display_get_capabilities();
    printf("功能:%s\n", capabilities);
    free(capabilities);
    char *configuration = kdk_display_get_configuration();
    printf("配置:%s\n", configuration);
    free(configuration);
    char *resources = kdk_display_get_resources();
    printf("资源:%s\n", resources);
    free(resources);
    return 0;
}

see how every single one gets a free?? that's not a suggestion, that's the rule. the way that memory leaks are NOT cute. 🙈


🌈 CONFORMING TO 🌈

okay so here's the lore: these functions are as per the withdrawn POSIX.1e draft specification. withdrawn. gone. she's a ghost but she still shows up to the function call. 💀

and the following functions are Linux extensions (iykyk, the extra ones):

  • kdk_display_get_product()
  • kdk_display_get_description()
  • kdk_display_get_physical_id()
  • kdk_display_get_bus_info()
  • kdk_display_get_vendor()
  • kdk_display_get_version()
  • kdk_display_get_width()
  • kdk_display_get_clock()
  • kdk_display_get_capabilities()
  • kdk_display_get_resources()

👑 SEE ALSO 👑

go read her sisters, they're all slaying in their own pages:


and that's the whole page bestie!! this lil masterpiece comes straight out of the Linux Programmer's Manual, dated Thu Aug 24 2023 — remember her name, she ate and left no crumbs 💅✨🫶

📦 where this page comes from