KDK_EDID_GET_RESOLUTION(3)

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

💖 KDK_EDID_GET_RESOLUTION 💖

okay bestie, gather round, because we're talking about kdk_edid_get_resolution(3) from the Library Functions Manual and honestly? she's a whole vibe. 🦋


✨ NAME ✨

kdk_edid_get_resolution — 获取分辨率 (yes girl, that's get resolution, we're getting the resolution, that's the whole job 💅)


🌸 SYNOPSIS 🌸

#include <libkyedid.h>

extern char* kdk_edid_get_resolution(char *name);

Link with -lkyedid.


🎀 Detailed Description 🎀

so like, the main function of the interface is to obtain the resolution of the screen. that's it. that's her purpose. no cap. 👑

the argument name is the current interface of the screen. that's what you're handing her — the interface name — and she gives you back the resolution. periodt.


💜 RETURN VALUE 💜

  • On success — returns the resolution of type char*. and listen, bestie, the returned string needs to be released by free. do not forget. do not leave her hanging. free your strings, it's giving responsible. 🫶
  • On error — return NULL.

🌈 EXAMPLES 🌈

here's the full glow-up example, copied exactly as she lives, typos and all, because we respect the source material in this house:

#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 through every interface, prints the vibe of each one, and frees the things that need freeing? that's main character energy fr fr. and at the very end she calls kdk_edid_freeall(name) because we clean up after ourselves. 💖


⭐ CONFORMING TO ⭐

these functions are as per the withdrawn POSIX.1e draft specification. (withdrawn, bestie. gone. no longer with us. rip. 😭)

the following functions are Linux extensions:

  • kdk_edid_get_interface()
  • 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_ratio()
  • kdk_edid_get_character()
  • kdk_edid_freeall()

🔥 SEE ALSO 🔥

like, go read her sisters too, they're all iconic in their own way. iykyk. 💅


and that's the tea, bestie 🍓 — this lil page came straight out of the Linux Programmer's Manual, dated Fri Aug 25 2023, and yeah she's filed under KDK_EDID_GET_RESOLUTION(3). mwah, go free your strings, drink water, and slay. 💖✨🎀

📦 where this page comes from