KDK_BOARD_GET_NAME(3)

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

✨ KDK_BOARD_GET_NAME(3) ✨

okay bestie so this is a page from the Library Functions Manual and it's all about kdk_board_get_name 🎀 — yes that's the whole entire vibe, let's go 💅


🌸 NAME 🌸

kdk_board_get_name — 获取主板型号 (yeah, that's the real line, it literally means "get the mainboard model" and I'm not touching it because facts are facts 🫶)


🦋 SYNOPSIS 🦋

#include <libkyboard.h>

extern const char* kdk_board_get_name();

Link with -lkyhw. ✨ that's the magic spell, don't forget it or nothing links and you'll be sad 😭


💖 Detailed Description 💖

The main function of the interface is to obtain mainboard model. that's it, that's the whole job. she gets the model, she serves looks, she leaves 👑


🌈 RETURN VALUE 🌈

  • On success, returns the mainboard model of type char*; the returned string needs to be released by free — no cap, bestie, you HAVE to free it or that memory is never coming back 💀
  • On error, return NULL.

⭐ EXAMPLES ⭐

here's the full glow-up, copied character for character because we do NOT freestyle code in this house 🙈

#include "stdio.h"
#include "libkyboard.h"

int main()
{

    char *name = kdk_board_get_name();
    char *vendor = kdk_board_get_vendor();
    char *date = kdk_board_get_date();
    char *serial = kdk_board_get_serial();
    printf("name : %s", name);
    printf("vendor : %s", vendor);
    printf("date : %s", date);
    printf("serial : %s", serial);
    free(name);
    free(vendor);
    free(date);
    free(serial);
    return 0;
}

see how she frees all four? main character energy fr fr 💅✨


👑 CONFORMING TO 👑

These functions are as per the withdrawn POSIX.1e draft specification. (withdrawn!! she's a legacy icon, respect the elders 🎀)

The following functions are Linux extensions: kdk_board_get_vendor(), kdk_board_get_date(), kdk_board_get_serial() and kdk_board_free().


💜 SEE ALSO 💜

kdk_board_get_vendor(3), kdk_board_get_date(3), kdk_board_get_serial(3) and kdk_board_free(3).

go read those next, they're the rest of the friend group 🦋🌸


reminder bestie: free every string you get back. not me being the responsible one for once 😭

kisses, this was the Linux Programmer's Manual, page dated Thu Aug 24 2023 — signing off, slay, periodt 💖

📦 where this page comes from