KDK_DISPLAY_GET_PHYSICAL_ID(3)

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

💖 KDK_DISPLAY_GET_PHYSICAL_ID(3) 💖

okay bestie, welcome to the Library Functions Manual section 3, where we talk about kdk_display_get_physical_id — the lil cutie whose whole job is 获取显卡的物理id (aka grabbing your video card's physical id). 🎀


✨ NAME ✨

kdk_display_get_physical_id — 获取显卡的物理id

like. that's it. that's her whole personality and she SERVES it. 👑


🌸 SYNOPSIS 🌸

#include <libkydisplay.h>

extern char* kdk_display_get_physical_id();

Link with -lkyhw.

not me reminding you to link with -lkyhw because if you forget, the linker will simply pass away and take your whole build with it 💀

🦋 DETAILED DESCRIPTION 🦋

so the main character mission of this interface? it's to obtain the physical ID of the Video card. that's the vibe. that's the whole assignment. fr fr. ✨


💅 RETURN VALUE 💅

  • On success — she returns the physical ID of the Video card, of type char*. 💖 and bestie, listen: the returned string needs to be released by free. no cap. if you don't free it, that's a memory leak and the memory leak is not the moment. 😭
  • On error — return NULL.

🍓 EXAMPLES 🍓

here's the whole squad showing out together, kdk_display_get_physical_id included, doing her little printf moment in the middle of it all:

#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 gets freed? yeah. that's the group chat rule. everybody frees. 🫶


🌈 CONFORMING TO 🌈

These functions are as per the withdrawn POSIX.1e draft specification. (withdrawn, bestie — so it's giving vintage, it's giving archival, it's giving "we still respect her tho" 💜)

The following functions are Linux extensions:

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

(yeah, kdk_display_get_physical_id herself is not on that Linux-extensions list — she's the POSIX.1e draft girlie. know the difference, iykyk. 💅)


👑 SEE ALSO 👑

go read the whole friend group, they're all iconic in their own way ⭐


and that's the page, bestie!! 🎀 brought to you by the Linux Programmer's Manual, dated Thu Aug 24 2023, filed under KDK_DISPLA...PHYSICAL_ID(3) — literally the manual name got cropped like a bad selfie but we still ate. 💖✨🦋 no cap, free your strings, and stan -lkyhw. periodt. 💅🌸

📦 where this page comes from