KDK_FREE_DISKLIST(3)

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

💖 KDK_FREE_DISKLIST(3) 💖

okay bestie, so this one is a library functions manual page, and honestly? it's giving "cleanup era." it's KDK_FREE_DISKLIST(3), and it's the lil bestie whose whole job is making sure you don't leak memory like it's a broken water bottle in your backpack. 🎀


✨ NAME ✨

kdk_get_disklist — 释放由 kdk_get_disklist 返回的磁盘列表

(yeah, the NAME line lowkey says kdk_get_disklist even though the page itself is all about kdk_free_disklist — we don't ask questions, we just report the facts fr fr 🙈)


🌸 SYNOPSIS 🌸

#include <libkydiskinfo.h>

extern void kdk_free_disklist(char** disklist);

and don't forget, you gotta link with -lkydiskinfo — no linking, no slaying. 💅


🦋 Detailed Description 🦋

the main character function of this interface is to recycle a list of strings of type char **. like, you got your disklist, you had your fun, now you give it back to the system. that's the whole vibe. periodt.

the argument ptr is a list of strings of type char **. yes bestie, it's literally that. the pointer goes in, the memory gets recycled. it's giving responsible adult energy and we love that for us. 🫶


⭐ RETURN VALUE ⭐

no return value. none. zero. it's a void situation — it just does the thing and dips. iconic behaviour honestly. 💀✨


🍓 EXAMPLES 🍓

here's the whole thing in action, bestie — copy it exactly, don't get creative:

#include "libkydiskinfo.h"
#include <stdio.h>

int main()
{
    char **disklist = kdk_get_disklist();
    for (int i = 0; disklist[i]; i ++)
    {
        printf("%s0, disklist[i]);
    }

    kdk_free_disklist(disklist);

    return 0;
}

so you grab the disklist, you loop through it while disklist[i] is still truthy, you print (and yes, that printf line is exactly as written up there — "%s0, disklist[i]); — we are NOT touching it, we are NOT fixing it, we are just ✨observing✨), then you kdk_free_disklist(disklist) and return 0. chef's kiss. 🌈


💜 CONFORMING TO 💜

these functions are as per the withdrawn POSIX.1e draft specification. 👀 (withdrawn, bestie — it's retired, it's living its best cottagecore life now.)

the following functions are Linux extensions: kdk_get_diskinfo(), kdk_get_hard_disk(), and kdk_get_hard_disk_size(). so those ones are extra-special homegrown Linux girlypop moves. 🧚


👑 SEE ALSO 👑

go read those too, bestie, that's your homework. iykyk. 📚✨


and that's the page!! this whole thing came out of the Linux Programmer's Manual, dated Thu Aug 10 2023 — so go forth, free your disklists, and hydrate. mwah. 💖💅🦋

📦 where this page comes from