KDK_DISPLAY_GET_VERSION(3)

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

💖 kdk_display_get_version(3) — Library Functions Manual 💖

okay bestie, gather round, because we're doing a Library Functions Manual deep dive and honestly? it's giving main character energy. this is the page for kdk_display_get_version, no cap. 🦋


✨ NAME ✨

kdk_display_get_version — 获取显卡的设备版本

(yeah it's in Chinese, and yeah we're keeping it exactly as-is, because the facts are sacred and I do not edit the facts 💅)


🌸 SYNOPSIS 🌸

#include <libkydisplay.h>

extern char* kdk_display_get_version();

Link with -lkyhw.

not me reminding you to link with -lkyhw or the linker will simply end you. 🫶

🎀 Detailed Description 🎀

The main function of the interface is to obtain the device version of the Video card

like. that's the whole vibe. you call it, it goes and gets the device version of the Video card. iconic behavior, zero notes. 👑


💜 RETURN VALUE 💜

  • On success — returns the Video card device version of type char*. ⭐ the returned string needs to be released by free
  • On error — return NULL.
bestie listen to me: free that string. the manpage said it, I said it, the ancestors said it. memory leaks are not the look. 😭

🌈 EXAMPLES 🌈

here's the full little demo program, copied character for character because I would never do you dirty like that:

#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;
}

notice how every single one of those gets freed? that's the group chat being responsible for each other. we love to see it. 🧚


🌟 CONFORMING TO 🌟

These functions are as per the withdrawn POSIX.1e draft specification.

The following functions are Linux extensions: 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_width(), kdk_display_get_clock(), kdk_display_get_capabilities(), kdk_display_get_configuration() and kdk_display_get_resources().

heads up: "withdrawn" means that POSIX.1e draft is gone, bestie. it's a ghost. still, these functions conform to it, and the rest are Linux extensions. periodt. 💀

🦋 SEE ALSO 🦋

go read them all, they're all friends, they all hang out. iykyk. 🍓


and that's the page!! this little angel lives in the Linux Programmer's Manual, dated Thu Aug 24 2023. mwah, go free your strings, love you, bye!! 💖✨🎀🦋🌸💅🫶👑🌈⭐💜

📦 where this page comes from