KDK_BOARD_GET_VENDOR(3)

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

🦋 KDK_BOARD_GET_VENDOR(3) 🦋

okay so this one lives in the Library Functions Manual, bestie, and it's literally the cutest little function that tells you who made your motherboard. no cap. let's get into it 💖


🎀 NAME 🎀

kdk_board_get_vendor — 获取主板厂商

(that's "get the mainboard vendor", iykyk ✨)


🌸 SYNOPSIS 🌸

#include <libkyboard.h>

extern const char* kdk_board_get_vendor();

and like, don't forget to Link with -lkyhw. fr fr, it will not work otherwise 💅


✨ DETAILED DESCRIPTION ✨

The main function of the interface is to obtain mainboard manufacturer. that's it, that's the whole vibe — she's a one-job girlie and she does her job flawlessly. 👑


💅 RETURN VALUE 💅

  • On success, returns the mainboard manufacturer of type char*. and listen — the returned string needs to be released by free. do NOT forget to free it, bestie, that's a leak and we don't do leaks in this house 🫶
  • On error, return NULL. so like, always vibe check for NULL before you go printing it, okay? 😭

🍓 EXAMPLES 🍓

here's the whole girl squad in action, name + vendor + date + serial, all at once, iconic:

#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 every single one gets free'd at the end? that's the main character energy we're looking for ✨🧚


🌈 CONFORMING TO 🌈

These functions are as per the withdrawn POSIX.1e draft specification. yes, withdrawn — it's giving vintage, it's giving archival, we still love her 💜

The following functions are Linux extensions:

  • kdk_board_get_serial()
  • kdk_board_get_date()
  • kdk_board_get_name()
  • kdk_board_free()

👑 SEE ALSO 👑

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

go read those too, they're all besties, they hang out together 🦋💖


and that's the whole page, babe! this was pulled straight from the Linux Programmer's Manual, dated Thu Aug 24 2023 — so yeah, it's a lil retro, but it still ate. mwah 💅✨🎀

📦 where this page comes from