KDK_EDID_GET_INTERFACE(3)

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

💖 KDK_EDID_GET_INTERFACE 💖

okay so bestie, this is a page from the Library Functions Manual — yes, section 3, the "functions you link against" section, we love her 💅 — and it's all about kdk_edid_get_interface, the little function that tells you which interface your screen is currently living its main character life on. let's get into it 🦋


✨ NAME ✨

kdk_edid_get_interface — 获取显示器的当前接口 (aka: grab the current interface of your display, no cap)


🌸 SYNOPSIS 🌸

#include <libkyedid.h>

extern char** kdk_edid_get_interface();

and like, don't forget the link step, she needs her bestie:

Link with -lkyedid.


🎀 DESCRIPTION (Detailed Description) 🎀

So the whole point of this function — its entire vibe, its whole job — is to obtain the current interface name of the screen. that's it. that's the function. she does one thing and she does it well, periodt 👑


💜 RETURN VALUE 💜

  • On success — you get back a list of the current interface name(s) of the screen, and the list is ending with a NULL string so you know where to stop walking it 🚶♀️ It's Generated by alloc and needs to be recycled by kdk_edid_freeall — so yes bestie, you HAVE to free it, don't just leave her hanging 😭
  • On error — you get NULL. that's it. nothing. void. the silence 💀

🌈 EXAMPLES 🌈

okay here's a whole little program that walks the list and prints literally everything about every interface. iconic behavior honestly:

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

int main()
{
    char** name = kdk_edid_get_interface();
    size_t count = 0;
    while (name[count])
    {
        printf("当前接口 = %s0, name[count]);
        float gamma = kdk_edid_get_gamma(name[count]);
        printf("gamma = %0.2f0, gamma);
        float size = kdk_edid_get_size(name[count]);
        printf("size = %0.1f0, size);
        char *max_resolution = kdk_edid_get_max_resolution(name[count]);
        printf("max_resolution = %s0, max_resolution);
        free(max_resolution);
        char *model = kdk_edid_get_model(name[count]);
        printf("model = %s0, model);
        free(model);
        char *area = kdk_edid_get_visible_area(name[count]);
        printf("area = %s0, area);
        free(area);
        char *manufacturer = kdk_edid_get_manufacturer(name[count]);
        printf("manufacturer = %s0, manufacturer);
        free(manufacturer);
        int week = kdk_edid_get_week(name[count]);
        printf("week = %d0, week);
        int year = kdk_edid_get_year(name[count]);
        printf("year = %d0, year);
        int primary = kdk_edid_get_primary(name[count]);
        printf("%s0, primary == 1 ? "是" : "否");

        char *resolution = kdk_edid_get_resolution(name[count]);
        printf("resolution = %s0, resolution);
        free(resolution);

        char *ratio = kdk_edid_get_ratio(name[count]);
        printf("ratio = %s0, ratio);
        free(ratio);

        char *character = kdk_edid_get_character(name[count]);
        printf("character = %s0, character);
        free(character);

        printf("---------------------------------------0);
        count ++;
    }
    kdk_edid_freeall(name);
    return 0;
}

see how she loops until name[count] hits that NULL, prints a cute little --------------------------------------- divider between each one, and then — the moment of self-care — calls kdk_edid_freeall(name) before return 0;? that's the whole arc. chef's kiss 🫶


👑 CONFORMING TO 👑

These functions are as per the withdrawn POSIX.1e draft specification — yes, withdrawn, we're being vintage about it, it's giving archival 🏛️

The following functions are Linux extensions:

  • kdk_edid_get_gamma()
  • kdk_edid_get_size()
  • kdk_edid_get_max_resolution()
  • kdk_edid_get_model()
  • kdk_edid_get_visible_area()
  • kdk_edid_get_manufacturer()
  • kdk_edid_get_week()
  • kdk_edid_get_year()
  • kdk_edid_get_primary()
  • kdk_edid_get_resolution()
  • kdk_edid_get_ratio()
  • kdk_edid_get_character()
  • kdk_edid_freeall()

🦋 SEE ALSO 🦋

the whole friend group, go read them all fr fr:


and that's the page bestie!! this one came straight out of the Linux Programmer's Manual, dated Fri Aug 25 2023 — so like, she's been serving accurate information since 2023 and she's still slaying 💅✨ remember: alloc it, use it, kdk_edid_freeall it. no leaks, only looks 💖🌸
📦 where this page comes from