KDK_USB_FREE(3)

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

💖 KDK_USB_FREE 💖

okay bestie, gather round, because today we're talking about kdk_usb_free from the Library Functions Manual (that's manual section 3, iykyk) 🫶

✨ NAME ✨

kdk_usb_free — 释放 kdk_usb_get_list 返回的 usb 信息结构体

(translation for my monolingual girlies: it frees the USB info struct that kdk_usb_get_list handed back to you 💅)

🌸 SYNOPSIS 🌸

#include <libkyusb.h>

extern void kdk_usb_free(pDriverInfoList list);

Link with -lkyusb.

🦋 DETAILED DESCRIPTION 🦋

The main function of the interface is to release the usb information structure returned by the kdk_usb_get_list.

The argument list is the return value of the kdk_usb_get_list.

That's it. That's the whole job. You got a list, you're done with the list, you hand the list back so nobody leaks memory. main character energy: cleaning up after yourself ✨

🎀 RETURN VALUE 🎀

No return value. It's a void function, bestie — she gives you nothing back, and honestly? iconic. 💅

🔥 EXAMPLES 🔥

#include "stdio.h"
#include "libkyusb.h"

int main()
{
    pDriverInfoList list = kdk_usb_get_list();
    if(list)
    {
        pDriverInfoList tmp = list;
        while (tmp)
        {
            printf("Name: %s",tmp->data->name);
            printf("Class: %s",tmp->data->type);
            printf("PID: %s",tmp->data->pid);
            printf("VID: %s",tmp->data->vid);
            printf("Serial: %s",tmp->data->serialNo);
            printf("DevNode: %s0,tmp->data->devNode);
            tmp = tmp->next;
        }

    }
    kdk_usb_free(list);
    return 0;
}
not me zooming in on line printf("DevNode: %s0,tmp->data->devNode); — yes babes, that's exactly how it appears, I am NOT touching it. Copy it verbatim, quirks and all, no cap. 🙈

💜 CONFORMING TO 💜

These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: kdk_usb_get_list().

heads up: that POSIX.1e draft is withdrawn, so don't go expecting it in your standards doc, fr fr.

🌈 SEE ALSO 🌈


and that's the whole page, my love 🫶 this one lives in the Linux Programmer's Manual, dated Fri Aug 25 2023, and it answers to the name KDK_USB_FREE(3). go free your lists. periodt. 💖✨

📦 where this page comes from