KDK_FREE_DATEINFO(3)
💖 KDK_FREE_DATEINFO 💖
okay bestie, welcome to the Library Functions Manual 🎀 this page is the one for kdk_free_dateinfo, and ngl it's a short one — but it's important, because it's literally the cleanup crew for the libkydate date-info family. no cap. 🧚
✨ NAME ✨
kdk_free_dateinfo — 释放由 kdk_system_tran_dateformat 返回的日期信息结构体
for my besties who don't read Chinese: this is the one that frees the date information structure that kdk_system_tran_dateformat gave you. she's the cleanup girlie. 🫶
🌸 SYNOPSIS 🌸
#include <libkydate.h>
extern void kdk_free_dateinfo(kdk_dateinfo *date);
and you link it with -lkydate, periodt. 🔥
🦋 Detailed Description 🦋
The main function of this interface is to release the date information structure returned by kdk_system_tran_dateformat. 💅
The argument date is a pointer of type structure kdk_dateinfo.
like… that's it. that's the whole job. she takes the pointer, she lets the struct go. iconic, honestly. ✨
🌈 RETURN VALUE 🌈
No return value.
she gives you nothing back and she doesn't need to. she's giving void and she's thriving. 💀
💜 EXAMPLES 💜
here's the whole demo, copied exactly because we do not mess with the code:
#include "libkydate.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <stdlib.h>
#include <glib.h>
#include <glib-object.h>
int main()
{
int ret = kdk_system_set_long_dateformat("2230年3月4日");
ret = kdk_system_set_short_dateformat("22/5/3");
char *ld = kdk_system_get_longformat_date();
printf("long res = %s0, ld);
free(ld);
char *sd = kdk_system_get_shortformat_date();
printf("short res = %s0, sd);
free(sd);
char *ll = kdk_system_get_longformat();
printf("longformat = %s0, ll);
free(ll);
char *ss = kdk_system_get_shortformat();
printf("shortformat = %s0, ss);
free(ss);
struct tm ptr;
ptr.tm_year = 2322;
ptr.tm_mon = 9;
ptr.tm_mday = 3;
char *lt = kdk_system_longformat_transform(&ptr);
printf("longformat_transform = %s0, lt);
free(lt);
ptr.tm_year = 2022;
ptr.tm_mon = 3;
ptr.tm_mday = 2;
char *st = kdk_system_shortformat_transform(&ptr);
printf("shortformat_transform = %s0, st);
free(st);
kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm");
printf("date = %s,time = %s,week = %s0,info->date,info->time,info->week);
kdk_free_logn_dateinfo(info);
ptr.tm_hour = 19;
ptr.tm_min = 3;
ptr.tm_sec = 2;
kdk_timeinfo *ti = kdk_system_timeformat_transform(&ptr);
printf("time = %s, timesec = %s0, ti->time, ti->timesec);
kdk_free_timeinfo(ti);
return 0;
}
notice how many different free-ers there are in there?? free(), kdk_free_logn_dateinfo(), kdk_free_timeinfo()… and our girl kdk_free_dateinfo() is right there in the same family. a whole squad of deallocators. 🍓
fr fr though — every one of those names is exactly as written in the original, typos and all. I am not touching a single character. 🙈
👑 CONFORMING TO 👑
These functions are as per the withdrawn POSIX.1e draft specification. 👀 yes, withdrawn — she's vintage, she's archival, she's a draft spec that never made it to the big leagues, and we respect her anyway. 💅
The following functions are Linux extensions:
kdk_system_get_dateformat(), kdk_system_set_dateformat(), kdk_system_set_24_timeformat(), kdk_system_set_12_timeformat(), kdk_system_get_now_dateformat(), kdk_system_get_now_timeformat(), kdk_system_tran_dateformat(), kdk_system_nowtime(), kdk_system_nowdate(), kdk_system_shortweek(), kdk_system_longweek(), kdk_system_second(), kdk_system_logn_dateinfo(), kdk_system_gjx_time(), kdk_date_freeall(), kdk_free_logn_dateinfo(), kdk_system_set_long_dateformat(), kdk_system_set_short_dateformat(), kdk_system_get_longformat_date(), kdk_system_get_shortformat_date(), kdk_system_get_longformat(), kdk_system_get_shortformat(), kdk_system_longformat_transform(), kdk_system_shortformat_transform(), kdk_system_login_lock_dateinfo(), kdk_system_timeformat_transform() and kdk_free_timeinfo().
that's the whole roster. the whole friend group. 🦋
⭐ SEE ALSO ⭐
kdk_system_get_dateformat(3), kdk_system_set_dateformat(3), kdk_system_set_24_timeformat(3), kdk_system_set_12_timeformat(3), kdk_system_get_now_dateformat(3), kdk_system_get_now_timeformat(3), kdk_system_tran_dateformat(3), kdk_system_nowtime(3), kdk_system_nowdate(3), kdk_system_shortweek(3), kdk_system_longweek(3), kdk_system_second(3), kdk_system_logn_dateinfo(3), kdk_system_gjx_time(3), kdk_date_freeall(3), kdk_free_logn_dateinfo(3), kdk_system_set_long_dateformat(3), kdk_system_set_short_dateformat(3), kdk_system_get_longformat_date(3), kdk_system_get_shortformat_date(3), kdk_system_get_longformat(3), kdk_system_get_shortformat(3), kdk_system_longformat_transform(3), kdk_system_shortformat_transform(3), kdk_system_login_lock_dateinfo(3), kdk_system_timeformat_transform(3) and kdk_free_timeinfo(3).
go read those next, bestie, they're the rest of the lore 📚✨
and that's the page!! 💖 this one came out of the Linux Programmer's Manual, dated Tue Sep 19 2023 — so like, a lil vintage but still slaying. mwah, go free your structs responsibly. 💅🎀🫶
📦 where this page comes from
- arch rolling: libkysdk-system 3.0.1.4-1 · LGPL-3.0-or-later AND LGPL-2.1-only OR LGPL-3.0-only AND LGPL-2.1-only WITH Qt-LGPL-exception-1.1 OR LGPL-3.0-only WITH Qt-LGPL-exception-1.1 AND MIT
- ubuntu resolute: libkysdk-system-dev 3.0.1.2-0ubuntu1 · LGPL-3.0-only
- ubuntu stonking: libkysdk-system-dev 3.0.1.3-0ubuntu1 · LGPL-3.0-or-later
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms