libkysdk-system/0000775000175000017500000000000015171302542012636 5ustar fengfenglibkysdk-system/man/0000775000175000017500000000000015171302542013411 5ustar fengfenglibkysdk-system/man/systemtime/0000775000175000017500000000000015171302542015614 5ustar fengfenglibkysdk-system/man/systemtime/kdk_system_set_long_dateformat.30000664000175000017500000000756015171302542024165 0ustar fengfeng.TH "KDK_SYSTEM_SET_LONG_DATEFORMAT" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_set_long_dateformat - 设置日期长格式 .SH SYNOPSIS .nf .B #include .sp .BI "extern int kdk_system_set_long_dateformat(char *"format ");" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to set the long date format. .PP The argument .I format is the date format, Please pass in one of the long formats. .SH "RETURN VALUE" On success, returns 1 .PP On error, return .BR -1. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_system_nowdate.30000664000175000017500000000752715171302542021611 0ustar fengfeng.TH "KDK_SYSTEM_NOWDATE" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_nowdate - 获取当前日期 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_nowdate();" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to obtain the current date. .PP .SH "RETURN VALUE" On success, returns current date with type of char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_system_longweek.30000664000175000017500000000753415171302542021761 0ustar fengfeng.TH "KDK_SYSTEM_LONGWEEK" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_longweek - 获取当前星期 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_longweek();" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to obtain the day of the week today. .PP .SH "RETURN VALUE" On success, returns weekday such as "星期一"; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_system_login_lock_dateinfo.30000664000175000017500000001025615171302542024132 0ustar fengfeng.TH "KDK_SYSTEM_LOGIN_LOCK_DATEINFO" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_login_lock_dateinfo - 获取登录锁屏的时间,星期,长格式日期 .SH SYNOPSIS .nf .B #include .sp .BI "extern kdk_logn_dateinfo *kdk_system_login_lock_dateinfo(char *"user ");" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to obtain the time, week, and long format date of the logged in user's lock screen. .PP The argument .I user is the target username. .SH "RETURN VALUE" On success, returns a pointer to a .I kdk_logn_dateinfo structure is defined in .I as follows: typedef struct _kdk_logn_dateinfo{ char *date; // 日期 char *time; // 时间 char *week; }kdk_logn_dateinfo; .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_system_get_longformat.30000664000175000017500000000760315171302542023152 0ustar fengfeng.TH "KDK_SYSTEM_GET_LONGFORMAT" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_longformat - 获取当前的长日期格式 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_get_longformat();" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to obtain the current long date format. .PP .SH "RETURN VALUE" On success, returns current long date format with type of char *; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_system_timeformat_transform.30000664000175000017500000001023315171302542024376 0ustar fengfeng.TH "KDK_SYSTEM_TIMEFORMAT_TRANSFORM" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_timeformat_transform - 时间格式转化 .SH SYNOPSIS .nf .B #include .sp .BI "extern kdk_timeinfo *kdk_system_timeformat_transform(struct tm *"ptr ");" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to convert the time obtained from the struct tm of the standard library into a structure in the user settings format. .PP The argument .I ptr It is a pointer to .I struct tm. .SH "RETURN VALUE" On success, returns a pointer to a .I kdk_timeinfo structure is defined in .I as follows: typedef struct _kdk_timeinfo{ char *time; // 时间 char *timesec; //带秒钟数时间 }kdk_timeinfo; .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/libkydate.30000664000175000017500000001332315171302542017652 0ustar fengfeng.TH "LIBKYDATE" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME 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_dateinfo,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, kdk_free_timeinfo - 日期和时间格式信息 .SH SYNOPSIS .nf .B #include .sp .BI "extern char** kdk_system_get_dateformat();" .sp .BI "extern int kdk_system_set_dateformat(char *"date ");" .sp .BI "extern int kdk_system_set_24_timeformat();" .sp .BI "extern int kdk_system_set_12_timeformat();" .sp .BI "extern char* kdk_system_get_now_dateformat();" .sp .BI "extern char* kdk_system_get_now_timeformat();" .sp .BI "extern kdk_dateinfo *kdk_system_tran_dateformat(struct tm *"ptr ");" .sp .BI "extern char* kdk_system_nowtime();" .sp .BI "extern char* kdk_system_nowdate();" .sp .BI "extern char* kdk_system_shortweek();" .sp .BI "extern char* kdk_system_longweek();" .sp .BI "extern char* kdk_system_second();" .sp .BI "extern kdk_logn_dateinfo *kdk_system_logn_dateinfo(char *"user ");" .sp .BI "extern char* kdk_system_gjx_time(char *"date ");" .sp .BI "extern inline void kdk_date_freeall(char **"ptr ");" .sp .BI "extern void kdk_free_dateinfo(kdk_dateinfo *"date ");" .sp .BI "extern void kdk_free_logn_dateinfo(kdk_logn_dateinfo *"date ");" .sp .BI "extern int kdk_system_set_long_dateformat(char *"format ");" .sp .BI "extern int kdk_system_set_short_dateformat(char *"format ");" .sp .BI "extern char* kdk_system_get_longformat_date();" .sp .BI "extern char* kdk_system_get_shortformat_date();" .sp .BI "extern char* kdk_system_get_longformat();" .sp .BI "extern char* kdk_system_get_shortformat();" .sp .BI "extern char* kdk_system_longformat_transform(struct tm *"ptr ");" .sp .BI "extern char* kdk_system_shortformat_transform(struct tm *"ptr ");" .sp .BI "extern kdk_logn_dateinfo *kdk_system_login_lock_dateinfo(char *"user ");" .sp .BI "extern kdk_timeinfo *kdk_system_timeformat_transform(struct tm *"ptr ");" .sp .BI "extern void kdk_free_timeinfo(kdk_timeinfo *"time ");" Link with \fI\-lkydate\fP. .SH DATA STRUCTURES Structure \fBkdk_dateinfo\fR contains information related to a date: \fBtypedef struct _kdk_dateinfo{ { .br char *date; // 日期 char *time; // 时间 char *timesec; //带秒钟数时间 .br }kdk_dateinfo;\fP There are other members not documented here, which are only meant for libkydate internal use. Structure \fBkdk_logn_dateinfo\fR contains information related to a login date: \fBtypedef struct _kdk_logn_dateinfo { .br char *date; // 日期 char *time; // 时间 char *week; .br }kdk_logn_dateinfo;\fP There are other members not documented here, which are only meant for libkydate internal use. Structure \fBkdk_timeinfo\fR contains information related to a time: \fBtypedef struct _kdk_timeinfo { .br char *time; // 时间 char *timesec; //带秒钟数时间 .br }kdk_timeinfo;\fP There are other members not documented here, which are only meant for libkynetinfo internal use. .SH "Detailed Description" This library obtains or sets date and time formats. .SH "RETURN VALUE" The return value is generally specific to the individual function called. .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_system_logn_dateinfo.30000664000175000017500000001022315171302542022743 0ustar fengfeng.TH "KDK_SYSTEM_LOGN_DATEINFO" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_logn_dateinfo - 获取未登录的时间,星期,月份 .SH SYNOPSIS .nf .B #include .sp .BI "extern kdk_logn_dateinfo *kdk_system_logn_dateinfo(char *"user ");" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to obtain the time and date of the login interface when no user is logged in. .PP The argument .I user is the user name .SH "RETURN VALUE" On success, returns a pointer to a .I kdk_logn_dateinfo structure is defined in .I as follows: typedef struct _kdk_logn_dateinfo{ char *date; // 日期 char *time; // 时间 char *week; }kdk_logn_dateinfo; .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_system_tran_dateformat.30000664000175000017500000001023615171302542023311 0ustar fengfeng.TH "KDK_SYSTEM_TRAN_DATEFORMAT" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_tran_dateformat - 时间格式转换接口 .SH SYNOPSIS .nf .B #include .sp .BI "extern kdk_dateinfo *kdk_system_tran_dateformat(struct tm *"ptr ");" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to convert the time obtained from the struct tm of the standard library into a string in the current system time format. .PP The argument .I ptr It is a pointer to .I struct tm. .SH "RETURN VALUE" On success, returns a pointer to a .I kdk_dateinfo structure is defined in .I as follows: typedef struct _kdk_dateinfo{ char *date; // 日期 char *time; // 时间 char *timesec; //带秒钟数时间 }kdk_dateinfo; .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_system_get_shortformat.30000664000175000017500000000760615171302542023355 0ustar fengfeng.TH "KDK_SYSTEM_GET_SHORTFORMAT" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_shortformat - 获取当前的短日期格式 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_get_shortformat();" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to obtain the current short date format. .PP .SH "RETURN VALUE" On success, returns current short date format with type of char *; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_system_get_now_time_format.30000664000175000017500000000760115171302542024171 0ustar fengfeng.TH "KDK_SYSTEM_GET_NOW_TIMEFORMAT" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_now_timeformat - 获取当前的时间格式 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_get_now_timeformat();" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to set the time format of the system. .PP .SH "RETURN VALUE" On success, returns the current time format with type of char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_system_get_dateformat.30000664000175000017500000000771315171302542023132 0ustar fengfeng.TH "KDK_SYSTEM_GET_DATEFORMAT" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_dateformat - 获取系统支持的日期格式 .SH SYNOPSIS .nf .B #include .sp .BI "extern char** kdk_system_get_dateformat();" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to obtain the date format supported by the system. .PP .SH "RETURN VALUE" On success, returns a list of supported date formats with type char **, ending with a .BR NULL string; Generated by .I alloc and needs to be recycled by .BR kdk_date_freeall .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_system_set_short_dateformat.30000664000175000017500000000756315171302542024370 0ustar fengfeng.TH "KDK_SYSTEM_SET_SHORT_DATEFORMAT" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_set_short_dateformat - 设置日期短格式 .SH SYNOPSIS .nf .B #include .sp .BI "extern int kdk_system_set_short_dateformat(char *"format ");" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to set the short date format. .PP The argument .I format is the date format, Please pass in one of the short formats. .SH "RETURN VALUE" On success, returns 1 .PP On error, return .BR -1. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_system_set_24_timeformat.30000664000175000017500000000742515171302542023474 0ustar fengfeng.TH "KDK_SYSTEM_SET_24_TIMEFORMAT" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_set_24_timeformat - 设置24小时制 .SH SYNOPSIS .nf .B #include .sp .BI "extern int kdk_system_set_24_timeformat();" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to set the time format to 24-hour format. .PP .SH "RETURN VALUE" On success, returns 1 .PP On error, return .BR -1. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_system_second.30000664000175000017500000000754015171302542021416 0ustar fengfeng.TH "KDK_SYSTEM_SECOND" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_second - 获取当前秒钟接口 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_second();" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to obtain the current second. .PP .SH "RETURN VALUE" On success, returns current second with type of char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/systime.80000664000175000017500000001052115171302542017401 0ustar fengfeng.TH KYSDK-SYSTIME 8 "2025" "Version 0.1" "System Administration Utilities" .SH NAME kysdk-systime \- KYLIN SDK System Time Monitoring Service .SH SYNOPSIS .B kysdk-systime .SH DESCRIPTION .B kysdk-systime is a system time monitoring service in the KYLIN SDK system. This service provides real-time system time broadcasting and monitoring capabilities, detecting system time changes and timezone changes, and broadcasting time information through D-Bus signals. The service runs as a system daemon that continuously monitors the system clock for changes and broadcasts time updates every minute. It also monitors for system time adjustments and timezone changes, ensuring accurate time information is available to all subscribed applications. .SH FEATURES .TP .B Real-time Time Broadcasting Broadcasts current system time every minute through D-Bus signals .TP .B System Time Change Detection Monitors and detects system time adjustments using timerfd .TP .B Timezone Change Monitoring Monitors changes to system timezone settings using inotify .TP .B D-Bus Signal Broadcasting Provides time information through D-Bus signals for inter-process communication .TP .B Precise Timing Uses high-precision timers for accurate time synchronization .SH D-Bus INTERFACE The service implements the following D-Bus interface `com.kylin.kysdk.TimeInterface` with these signals: .TP .B TimeSignal Emitted every minute with current time information in format: "YYYY/MM/DD HH:MM:SS" .TP .B TimeChangeSignal Emitted when system time or timezone changes, providing updated time information .SH MONITORED EVENTS .TP .B System Time Changes Detects manual time adjustments, NTP synchronization, and other time modifications .TP .B Timezone Changes Monitors changes to /etc/localtime for timezone updates .TP .B Clock Drift Handles clock synchronization and drift correction .SH THREADING MODEL The service uses a multi-threaded architecture: .TP .B Main Thread Handles D-Bus communication and main event loop .TP .B Time Change Monitor Thread Monitors system time changes using timerfd .TP .B Timezone Monitor Thread Monitors timezone changes using inotify .TP .B Time Broadcast Thread Manages periodic time broadcasting .SH TIMER SYSTEM .TP .B Periodic Timer Runs every 60 seconds for regular time broadcasting .TP .B Single-shot Timer Used for immediate time change notifications .TP .B Timer Synchronization Automatically resynchronizes when time changes are detected .SH FILES .TP .B /usr/bin/systime Main executable file .TP .B /etc/systemd/system/kysdk-systime.service Systemd service configuration file .TP .B /etc/localtime Monitored file for timezone changes .SH SERVICE The service runs as a systemd service with: - Service name: kysdk-systime.service - D-Bus name: com.kylin.kysdk.TimeServer - Object path: /com/kylin/kysdk/Timer - Interface: com.kylin.kysdk.TimeInterface - Type: D-Bus activated service .SH DEPENDENCIES .TP .B D-Bus For inter-process communication .TP .B GLib For main loop integration .TP .B libkytimer For timer management functionality .TP .B systemd For service management .SH SIGNAL HANDLING .TP .B SIGTERM, SIGINT Graceful shutdown signals .TP .B TFD_TIMER_CANCEL_ON_SET Special timer flag for detecting time changes .SH TIME FORMATS All time information is broadcast in the following format: .B YYYY/MM/DD HH:MM:SS - 4-digit year - 2-digit month (01-12) - 2-digit day (01-31) - 2-digit hour (00-23) - 2-digit minute (00-59) - 2-digit second (00-59) .SH SYNCHRONIZATION .TP .B Automatic Resync Automatically resynchronizes timers when time changes are detected .TP .B Mis-sync Handling Detects and corrects timing drift or missed notifications .TP .B Timer Management Intelligently manages periodic and single-shot timers .SH AUTHOR KylinSoft Co., Ltd. .SH COPYRIGHT Copyright (C) 2023-2025, KylinSoft Co., Ltd. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. .SH SEE ALSO .BR dbus-daemon (1), .BR systemd (1), .BR timedatectl (1), .BR ntp (8), .BR tzset (3)libkysdk-system/man/systemtime/kdk_system_gjx_time.30000664000175000017500000000770515171302542021754 0ustar fengfeng.TH "KDK_SYSTEM_GJX_TIME" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_gjx_time - 转换工具箱时间 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_gjx_time(char *"date ");" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to convert the time format of the toolbox to the set time format. .PP The argument .I date is the time and date read from toolbox .SH "RETURN VALUE" On success, returns date with type of char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "../libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_free_dateinfo.30000664000175000017500000000763515171302542021336 0ustar fengfeng.TH "KDK_FREE_DATEINFO" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_free_dateinfo - 释放由kdk_system_tran_dateformat返回的日期信息结构体 .SH SYNOPSIS .nf .B #include .sp .BI "extern void kdk_free_dateinfo(kdk_dateinfo *"date ");" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to release the date information structure returned by .I kdk_system_tran_dateformat. .PP The argument .I date is a pointer of type structure .I kdk_dateinfo .SH "RETURN VALUE" No return value .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_system_nowtime.30000664000175000017500000000752715171302542021632 0ustar fengfeng.TH "KDK_SYSTEM_NOWTIME" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_nowtime - 获取当前时间 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_nowtime();" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to obtain the current time. .PP .SH "RETURN VALUE" On success, returns current time with type of char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_system_longformat_transform.30000664000175000017500000001000715171302542024376 0ustar fengfeng.TH "KDK_SYSTEM_LONGFORMAT_TRANSFORM" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_longformat_transform - 长格式转化 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_longformat_transform(struct tm *"ptr ");" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to convert the time obtained from the struct tm of the standard library into a string in the current long format. .PP The argument .I ptr It is a pointer to .I struct tm. .SH "RETURN VALUE" On success, returns a long formatted date with type of char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_system_get_now_dateformat.30000664000175000017500000000761215171302542024013 0ustar fengfeng.TH "KDK_SYSTEM_GET_NOW_DATEFORMAT" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_now_dateformat - 获取当前的日期格式 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_get_now_dateformat();" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to obtain the current date format of the system. .PP .SH "RETURN VALUE" On success, returns the current date format with type of char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_system_set_12_timeformat.30000664000175000017500000000742515171302542023471 0ustar fengfeng.TH "KDK_SYSTEM_SET_12_TIMEFORMAT" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_set_12_timeformat - 设置12小时制 .SH SYNOPSIS .nf .B #include .sp .BI "extern int kdk_system_set_12_timeformat();" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to set the time format to 12-hour format. .PP .SH "RETURN VALUE" On success, returns 1 .PP On error, return .BR -1. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_system_set_dateformat.30000664000175000017500000000773515171302542023152 0ustar fengfeng.TH "KDK_SYSTEM_SET_DATEFORMAT" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_set_dateformat - 设置日期格式 .SH SYNOPSIS .nf .B #include .sp .BI "extern int kdk_system_set_dateformat(char *"date ");" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to set the date format of the system. .PP The argument .I date is the date format, Please refer to the return value of .I kdk_system_get_format for specific format. .SH "RETURN VALUE" On success, returns 1 .PP On error, return .BR -1. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_system_get_shortformat_date.30000664000175000017500000000761315171302542024350 0ustar fengfeng.TH "KDK_SYSTEM_GET_SHORTFORMAT_DATE" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_shortformat_date - 获取当前的短格式日期 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_get_shortformat_date();" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to obtain the current short format date. .PP .SH "RETURN VALUE" On success, returns current short format date with type of char *; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_system_shortformat_transformat.30000664000175000017500000001001215171302542025117 0ustar fengfeng.TH "KDK_SYSTEM_SHORTFORMAT_TRANSFORM" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_shortformat_transform - 短格式转化 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_shortformat_transform(struct tm *"ptr ");" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to convert the time obtained from the struct tm of the standard library into a string in the current short format. .PP The argument .I ptr It is a pointer to .I struct tm. .SH "RETURN VALUE" On success, returns a short formatted date with type of char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_free_timeinfo.30000664000175000017500000000765015171302542021354 0ustar fengfeng.TH "KDK_FREE_TIMEINFO" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_free_timeinfo - 释放由kdk_system_timeformat_transform返回的时间信息结构体 .SH SYNOPSIS .nf .B #include .sp .BI "extern void kdk_free_timeinfo(kdk_timeinfo *"time ");" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to release the date information structure returned by .I kdk_system_timeformat_transform. .PP The argument .I time is a pointer of type structure .I kdk_timeinfo. .SH "RETURN VALUE" No return value .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo () and .BR kdk_system_timeformat_transform (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3) and .BR kdk_system_timeformat_transform (3).libkysdk-system/man/systemtime/kdk_system_get_longformat_date.30000664000175000017500000000761015171302542024145 0ustar fengfeng.TH "KDK_SYSTEM_GET_LONGFORMAT_DATE" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_longformat_date - 获取当前的长格式日期 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_get_longformat_date();" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to obtain the current long format date. .PP .SH "RETURN VALUE" On success, returns current long format date with type of char *; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_free_logn_dateinfo.30000664000175000017500000000767315171302542022357 0ustar fengfeng.TH "KDK_FREE_LOGN_DATEINFO" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_free_logn_dateinfo - 释放由kdk_free_logn_dateinfo返回的日期信息结构体 .SH SYNOPSIS .nf .B #include .sp .BI "extern void kdk_free_logn_dateinfo(kdk_logn_dateinfo *"date ");" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to release the date information structure returned by .I kdk_system_logn_dateinfo. .PP The argument .I date is a pointer of type structure .I kdk_logn_dateinfo for specific format. .SH "RETURN VALUE" No return value .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/sdk-date.10000664000175000017500000001004715171302542017374 0ustar fengfeng.TH KYSDK-DATE 1 "2025" "Version 0.1" "User Commands" .SH NAME kysdk-date \- KYLIN SDK Date and Time Format Management Service .SH SYNOPSIS .B kysdk-date .SH DESCRIPTION .B kysdk-date is a date and time format management service in the KYLIN SDK system. This service provides real-time date and time formatting capabilities, monitoring user configuration changes and broadcasting formatted date/time information through D-Bus signals. The service runs as a background daemon that monitors changes to date format configuration files and automatically broadcasts updated date/time information to all subscribed applications. It supports multiple date formats and time display modes (12-hour/24-hour clock). .SH FEATURES .TP .B Real-time Configuration Monitoring Monitors user date format configuration file changes in real-time using inotify .TP .B Multiple Date Format Support Supports various date formats including: - Short date formats (yy-M-d, MM/dd/yyyy, etc.) - Long date formats (yyyy MM dd, yy M d, etc.) - Custom formats with different separators (-, /, .) .TP .B Time Format Support Supports both 12-hour and 24-hour clock formats .TP .B D-Bus Signal Broadcasting Broadcasts date/time information through D-Bus signals when configurations change .TP .B Localization Support Provides localized date format strings based on system locale settings .SH D-Bus INTERFACE The service implements the following D-Bus interface `com.kylin.kysdk.DateInterface` with these signals: .TP .B DateSignal Emitted when the date format configuration changes, providing: - Formatted date string - Time format information .TP .B LongDateSignal Emitted for long date format changes, providing: - Long date format template - Formatted long date string .TP .B ShortDateSignal Emitted for short date format changes, providing: - Short date format template - Formatted short date string .TP .B TimeSignal Emitted for time format changes, providing: - Time format information (12-hour/24-hour clock) .SH CONFIGURATION The service monitors the configuration file located at: .B ~/.config/kydate/dateformat.conf Configuration options include: .TP .B DATE_FORMAT General date format setting .TP .B TIME_FORMAT Time format setting (12 or 24) .TP .B LONG_DATE_FORMAT Specific format for long date display .TP .B SHORT_DATE_FORMAT Specific format for short date display .SH FILES .TP .B /usr/bin/sdk-date Main executable file .TP .B ~/.config/kydate/dateformat.conf User configuration file for date/time formats .TP .B /var/log/kysdk-date.log Log file (if logging is enabled) .SH SERVICE The service runs as a session D-Bus service with: - Service name: com.kylin.kysdk.DateServer - Object path: /com/kylin/kysdk/Date - Interface: com.kylin.kysdk.DateInterface .SH DEPENDENCIES .TP .B D-Bus For inter-process communication .TP .B GLib For main loop integration .TP .B GNU gettext For localization support .SH THREADING The service uses a multi-threaded architecture: - Main thread: Handles D-Bus communication and main loop - Monitor thread: Watches for configuration file changes - Signal threads: Handle date/time formatting and broadcasting .SH SIGNALS .TP .B IN_CREATE, IN_DELETE, IN_MODIFY, IN_MOVE_SELF inotify events monitored for configuration file changes .TP .B SIGTERM, SIGINT Graceful shutdown signals .SH LOCALIZATION Supports localization through GNU gettext with: - Language-specific date formats - Translated time format descriptions - Locale-aware date formatting .SH AUTHOR KylinSoft Co., Ltd. .SH COPYRIGHT Copyright (C) 2023-2025, KylinSoft Co., Ltd. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. .SH SEE ALSO .BR dbus-daemon (1), .BR date (1), .BR locale (1), .BR inotify (7)libkysdk-system/man/systemtime/kdk_date_freeall.30000664000175000017500000000760415171302542021147 0ustar fengfeng.TH "KDK_DATE_FREEALL" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_date_freeall - 用于回收字符串列表 .SH SYNOPSIS .nf .B #include .sp .BI "extern inline void kdk_date_freeall(char **"ptr ");" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to release string lists. .PP The argument .I ptr is a pointer of type char**, such as the return value of .I kdk_system_get_dateformat. The return value of the dateformat. .SH "RETURN VALUE" No return value .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_shortweek (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_shortweek (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/systemtime/kdk_system_shortweek.30000664000175000017500000000753215171302542022157 0ustar fengfeng.TH "KDK_SYSTEM_SHORTWEEK" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_shortweek - 获取当前星期 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_shortweek();" .sp Link with \fI\-lkydate\fP. .SH "Detailed Description" The main function of this interface is to obtain the day of the week today. .PP .SH "RETURN VALUE" On success, returns weekday such as "周一"; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydate.h" #include #include #include #include #include #include #include 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 = %s\n", ld); free(ld); char *sd = kdk_system_get_shortformat_date(); printf("short res = %s\n", sd); free(sd); char *ll = kdk_system_get_longformat(); printf("longformat = %s\n", ll); free(ll); char *ss = kdk_system_get_shortformat(); printf("shortformat = %s\n", 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 = %s\n", 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 = %s\n", st); free(st); kdk_logn_dateinfo *info = kdk_system_login_lock_dateinfo("szm"); printf("date = %s,time = %s,week = %s\n",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 = %s\n", ti->time, ti->timesec); kdk_free_timeinfo(ti); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_dateformat (), .BR kdk_system_set_dateformat (), .BR kdk_system_set_24_timeformat (), .BR kdk_system_set_12_timeformat (), .BR kdk_system_get_now_dateformat (), .BR kdk_system_get_now_timeformat (), .BR kdk_system_tran_dateformat (), .BR kdk_system_nowtime (), .BR kdk_system_nowdate (), .BR kdk_system_longweek (), .BR kdk_system_second (), .BR kdk_system_logn_dateinfo (), .BR kdk_system_gjx_time (), .BR kdk_date_freeall (), .BR kdk_free_dateinfo (), .BR kdk_free_logn_dateinfo (), .BR kdk_system_set_long_dateformat (), .BR kdk_system_set_short_dateformat (), .BR kdk_system_get_longformat_date (), .BR kdk_system_get_shortformat_date (), .BR kdk_system_get_longformat (), .BR kdk_system_get_shortformat (), .BR kdk_system_longformat_transform (), .BR kdk_system_shortformat_transform (), .BR kdk_system_login_lock_dateinfo (), .BR kdk_system_timeformat_transform () and .BR kdk_free_timeinfo (). .SH "SEE ALSO" .BR kdk_system_get_dateformat (3), .BR kdk_system_set_dateformat (3), .BR kdk_system_set_24_timeformat (3), .BR kdk_system_set_12_timeformat (3), .BR kdk_system_get_now_dateformat (3), .BR kdk_system_get_now_timeformat (3), .BR kdk_system_tran_dateformat (3), .BR kdk_system_nowtime (3), .BR kdk_system_nowdate (3), .BR kdk_system_longweek (3), .BR kdk_system_second (3), .BR kdk_system_logn_dateinfo (3), .BR kdk_system_gjx_time (3), .BR kdk_date_freeall (3), .BR kdk_free_dateinfo (3), .BR kdk_free_logn_dateinfo (3), .BR kdk_system_set_long_dateformat (3), .BR kdk_system_set_short_dateformat (3), .BR kdk_system_get_longformat_date (3), .BR kdk_system_get_shortformat_date (3), .BR kdk_system_get_longformat (3), .BR kdk_system_get_shortformat (3), .BR kdk_system_longformat_transform (3), .BR kdk_system_shortformat_transform (3), .BR kdk_system_login_lock_dateinfo (3), .BR kdk_system_timeformat_transform (3) and .BR kdk_free_timeinfo (3).libkysdk-system/man/filesystem/0000775000175000017500000000000015171302542015575 5ustar fengfenglibkysdk-system/man/filesystem/clearWatchList.30000664000175000017500000000343415171302542020576 0ustar fengfeng.TH "clearWatchList" 3 "Wed Sep 20 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME clearWatchList - 清空监听列表 .SH SYNOPSIS .nf .B #include .sp .SS "Classes" .in +1c .ti -1c .RI "class \fBKYSDK_FILEWATCHER::FileWatcher\fP" .in -1c .sp .SS "Functions" .in +1c .ti -1c .RI "void clearWatchList();" .in -1c .sp Link with \fI\-lkyfilewatcher\fP. .SH "Detailed Description" The main function of the interface is to clear listening list. .SH "RETURN VALUE" No return value .SH EXAMPLES .EX #include #include #include "libkyfilewatcher.hpp" using namespace KYSDK_FILEWATCHER; int main(int argc, char *argv[]) { KYSDK_FILEWATCHER::FileWatcher watcher; watcher.addWatchTargetRecursive("/home/kylin/", PERIODIC, ALL, 3, REGULAR); getchar(); // qDebug() << "update attr test"; // watcher.updateWatchTargetAttribute("/data/testcode/test.c", DELETE); // getchar(); // qDebug() << "re-add test"; // watcher.addWatchTarget("/data/testcode/test.c", PERIODIC, ALL); // getchar(); // qDebug() << "update oneshot test"; // watcher.updateWatchTargetType("/data/testcode/test.c", ONESHOT); // getchar(); // qDebug() << "remove target test"; // watcher.removeWatchTarget("/data/testcode/test.c"); // getchar(); watcher.clearWatchList(); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR addWatchTargetRecursive (), .BR addWatchTargetListRecursive (), .BR removeWatchTargetRecursive (), .BR pauseWatcher () and .BR restartWatcher (). .SH "SEE ALSO" .BR addWatchTargetRecursive (3), .BR addWatchTargetListRecursive (3), .BR removeWatchTargetRecursive (3), .BR pauseWatcher (3) and .BR restartWatcher (3).libkysdk-system/man/filesystem/addWatchTargetRecursive.30000664000175000017500000000642015171302542022441 0ustar fengfeng.TH "addWatchTargetRecursive" 3 "Wed Sep 20 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME addWatchTargetRecursive - 增加需要监听的文件路径,对于目录,默认启用递归监听子目录 .SH SYNOPSIS .nf .B #include .sp .SS "Classes" .in +1c .ti -1c .RI "class \fBKYSDK_FILEWATCHER::FileWatcher\fP" .in -1c .sp .SS "Functions" .in +1c .ti -1c .RI "QStringList addWatchTargetRecursive(QString url, FileWatcherType type = PERIODIC, int attr = OPEN|CLOSE|MODIFY|DELETE, int maxdepth = 5, int recurType = DIR|REGULAR);" .in -1c .sp Link with \fI\-lkyfilewatcher\fP. .SH "Detailed Description" The main function of the interface is to add file paths that need to be listened to, and for directories, recursive listening subdirectories are enabled by default. .PP The argument .I url is the file path. .PP The argument .I type is the file watcher type,which is an enumeration type. The content is as follows: .PP enum FileWatcherType{ ONESHOT = 0, // 仅报送一次事件。请注意事件发生后,监听符号会从监听列表中移除,下次再用需要重新add PERIODIC, NEVER }; .PP The argument .I attr is the file watcher attribute,which is an enumeration type. The content is as follows: .PP enum FileWatcherAttribute{ ACCESS = IN_ACCESS, CREATE = IN_CREATE, MODIFY = IN_MODIFY, DELETE = IN_DELETE | IN_DELETE_SELF, ATTRIB = IN_ATTRIB, MOVE = IN_MOVE | IN_MOVE_SELF, OPEN = IN_OPEN, CLOSE = IN_CLOSE, ALL = IN_ALL_EVENTS }; .PP The argument .I maxdepth is the maximum depth specified for traversal search. .PP The argument .I recurType is the recursive type,which is an enumeration type. The content is as follows: .PP enum RecursiveType{ DIR = 1 << 0, REGULAR = 1 << 1, HIDDEN = 1 << 2, TMPFILE = 1 << 3, //认为那些以~开头的是临时文件 ALLFILE = HIDDEN | TMPFILE | DIR | REGULAR }; .SH "RETURN VALUE" .SH EXAMPLES .EX #include #include #include "libkyfilewatcher.hpp" using namespace KYSDK_FILEWATCHER; int main(int argc, char *argv[]) { KYSDK_FILEWATCHER::FileWatcher watcher; watcher.addWatchTargetRecursive("/home/kylin/", PERIODIC, ALL, 3, REGULAR); getchar(); // qDebug() << "update attr test"; // watcher.updateWatchTargetAttribute("/data/testcode/test.c", DELETE); // getchar(); // qDebug() << "re-add test"; // watcher.addWatchTarget("/data/testcode/test.c", PERIODIC, ALL); // getchar(); // qDebug() << "update oneshot test"; // watcher.updateWatchTargetType("/data/testcode/test.c", ONESHOT); // getchar(); // qDebug() << "remove target test"; // watcher.removeWatchTarget("/data/testcode/test.c"); // getchar(); watcher.clearWatchList(); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR addWatchTargetListRecursive (), .BR removeWatchTargetRecursive (), .BR clearWatchList (), .BR pauseWatcher () and .BR restartWatcher (). .SH "SEE ALSO" .BR addWatchTargetListRecursive (3), .BR removeWatchTargetRecursive (3), .BR clearWatchList (3), .BR pauseWatcher (3) and .BR restartWatcher (3).libkysdk-system/man/filesystem/restartWatcher.30000664000175000017500000000343615171302542020671 0ustar fengfeng.TH "restartWatcher" 3 "Wed Sep 20 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME restartWatcher - 恢复文件监听 .SH SYNOPSIS .nf .B #include .sp .SS "Classes" .in +1c .ti -1c .RI "class \fBKYSDK_FILEWATCHER::FileWatcher\fP" .in -1c .sp .SS "Functions" .in +1c .ti -1c .RI "void restartWatcher();" .in -1c .sp Link with \fI\-lkyfilewatcher\fP. .SH "Detailed Description" The main function of the interface is to recover file listening. .SH "RETURN VALUE" No return value .SH EXAMPLES .EX #include #include #include "libkyfilewatcher.hpp" using namespace KYSDK_FILEWATCHER; int main(int argc, char *argv[]) { KYSDK_FILEWATCHER::FileWatcher watcher; watcher.addWatchTargetRecursive("/home/kylin/", PERIODIC, ALL, 3, REGULAR); getchar(); // qDebug() << "update attr test"; // watcher.updateWatchTargetAttribute("/data/testcode/test.c", DELETE); // getchar(); // qDebug() << "re-add test"; // watcher.addWatchTarget("/data/testcode/test.c", PERIODIC, ALL); // getchar(); // qDebug() << "update oneshot test"; // watcher.updateWatchTargetType("/data/testcode/test.c", ONESHOT); // getchar(); // qDebug() << "remove target test"; // watcher.removeWatchTarget("/data/testcode/test.c"); // getchar(); watcher.clearWatchList(); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR addWatchTargetRecursive (), .BR addWatchTargetListRecursive (), .BR removeWatchTargetRecursive (), .BR clearWatchList () and .BR pauseWatcher (). .SH "SEE ALSO" .BR addWatchTargetRecursive (3), .BR addWatchTargetListRecursive (3), .BR removeWatchTargetRecursive (3), .BR clearWatchList (3) and .BR pauseWatcher (3).libkysdk-system/man/filesystem/libkyfilewatcher.30000664000175000017500000000714315171302542021216 0ustar fengfeng.TH libkyfilewatcher 3 "Wed Sep 20 2023" "1.0" "File Watcher Library" .SH NAME libkyfilewatcher \- File management functionality .SH SYNOPSIS .B #include .SH DESCRIPTION .PP This library provides file management interfaces and classes. .SH CLASSES .PP .B KYSDK_FILEWATCHER::FileWatcher .RS .PP File management class. Mainly used to add file paths that need to be monitored, add file lists that need to be monitored, remove specified files from the monitoring list, clear the monitoring list, pause file monitoring, and resume file monitoring. .RE .SH ENUMERATIONS .PP .B FileWatcherType .RS .PP .nf ONESHOT = 0 PERIODIC NEVER .fi .RE .PP .B FileWatcherAttribute .RS .PP .nf ACCESS = IN_ACCESS CREATE = IN_CREATE MODIFY = IN_MODIFY DELETE = IN_DELETE | IN_DELETE_SELF ATTRIB = IN_ATTRIB MOVE = IN_MOVE | IN_MOVE_SELF OPEN = IN_OPEN CLOSE = IN_CLOSE ALL = IN_ALL_EVENTS .fi .RE .PP .B RecursiveType .RS .PP .nf DIR = 1 << 0 REGULAR = 1 << 1 HIDDEN = 1 << 2 TMPFILE = 1 << 3 ALLFILE = HIDDEN | TMPFILE | DIR | REGULAR .fi .RE .SH "MEMBER FUNCTIONS" .PP .B "QStringList addWatchTargetRecursive (QString url, FileWatcherType type = PERIODIC, int attr = OPEN|CLOSE|MODIFY|DELETE, int maxdepth = 5, int recurType = DIR|REGULAR)" .RS .PP Add a file path that needs to be monitored. For directories, recursive monitoring of subdirectories is enabled by default. .PP .B Parameters: .RS .TP .B url File path .TP .B type File monitoring type .TP .B attr File monitoring attributes .TP .B maxdepth Specify the maximum depth for traversal search .TP .B recurType Recursive type .RE .PP .B Return value: .RS .TP .B QStringList List of successfully added monitoring target paths .RE .RE .PP .B "QStringList addWatchTargetListRecursive (QStringList urlList, FileWatcherType type = PERIODIC, int attr = OPEN|CLOSE|MODIFY|DELETE, int maxdepth = 5, int recurType = DIR|REGULAR)" .RS .PP Add a list of files that need to be monitored. .PP .B Parameters: .RS .TP .B urlList List of files to be monitored .TP .B type File monitoring type .TP .B attr File monitoring attributes .TP .B maxdepth Specify the maximum depth for traversal search .TP .B recurType Recursive type .RE .PP .B Return value: .RS .TP .B QStringList List of successfully added monitoring target paths .RE .RE .PP .B "QStringList removeWatchTargetRecursive (QString url, int maxdepth = 5, int recurType = ALLFILE)" .RS .PP Remove the specified file from the monitoring list. .PP .B Parameters: .RS .TP .B url Path of the specified file .TP .B maxdepth Specify the maximum depth for traversal search .TP .B recurType Recursive type .RE .PP .B Return value: .RS .TP .B QStringList List of successfully removed monitoring target paths .RE .RE .PP .B "void clearWatchList ()" .RS .PP Clear the monitoring list. .RE .PP .B "void pauseWatcher ()" .RS .PP Pause file monitoring. .RE .PP .B "void restartWatcher ()" .RS .PP Resume file monitoring. .RE .SH "EXAMPLE USAGE" .PP .nf #include #include #include using namespace KYSDK_FILEWATCHER; int main(int argc, char *argv[]) { QCoreApplication app(argc, argv); FileWatcher watcher; // Add directory monitoring QStringList paths = watcher.addWatchTargetRecursive( "/home/user/documents", PERIODIC, MODIFY | DELETE, 3 ); // Pause and resume monitoring watcher.pauseWatcher(); // ... perform some operations watcher.restartWatcher(); return 0; } .fi .SH AUTHOR Generated automatically by Doxygen for libkyfilewatcher.hpp from the source code. .SH "SEE ALSO" .BR inotify (7), .BR QFileSystemWatcher (3qt5), .BR libkyfilewatcher (3)libkysdk-system/man/filesystem/pauseWatcher.30000664000175000017500000000343215171302542020316 0ustar fengfeng.TH "pauseWatcher" 3 "Wed Sep 20 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME pauseWatcher - 暂停文件监听 .SH SYNOPSIS .nf .B #include .sp .SS "Classes" .in +1c .ti -1c .RI "class \fBKYSDK_FILEWATCHER::FileWatcher\fP" .in -1c .sp .SS "Functions" .in +1c .ti -1c .RI "void pauseWatcher();" .in -1c .sp Link with \fI\-lkyfilewatcher\fP. .SH "Detailed Description" The main function of the interface is to pause file listening. .SH "RETURN VALUE" No return value .SH EXAMPLES .EX #include #include #include "libkyfilewatcher.hpp" using namespace KYSDK_FILEWATCHER; int main(int argc, char *argv[]) { KYSDK_FILEWATCHER::FileWatcher watcher; watcher.addWatchTargetRecursive("/home/kylin/", PERIODIC, ALL, 3, REGULAR); getchar(); // qDebug() << "update attr test"; // watcher.updateWatchTargetAttribute("/data/testcode/test.c", DELETE); // getchar(); // qDebug() << "re-add test"; // watcher.addWatchTarget("/data/testcode/test.c", PERIODIC, ALL); // getchar(); // qDebug() << "update oneshot test"; // watcher.updateWatchTargetType("/data/testcode/test.c", ONESHOT); // getchar(); // qDebug() << "remove target test"; // watcher.removeWatchTarget("/data/testcode/test.c"); // getchar(); watcher.clearWatchList(); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR addWatchTargetRecursive (), .BR addWatchTargetListRecursive (), .BR removeWatchTargetRecursive (), .BR clearWatchList () and .BR restartWatcher (). .SH "SEE ALSO" .BR addWatchTargetRecursive (3), .BR addWatchTargetListRecursive (3), .BR removeWatchTargetRecursive (3), .BR clearWatchList (3) and .BR restartWatcher (3).libkysdk-system/man/filesystem/removeWatchTargetRecursive.30000664000175000017500000000453215171302542023210 0ustar fengfeng.TH "removeWatchTargetRecursive" 3 "Wed Sep 20 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME removeWatchTargetRecursive - 从监听列表中移除指定的文件 .SH SYNOPSIS .nf .B #include .sp .SS "Classes" .in +1c .ti -1c .RI "class \fBKYSDK_FILEWATCHER::FileWatcher\fP" .in -1c .sp .SS "Functions" .in +1c .ti -1c .RI "QStringList removeWatchTargetRecursive(QString url, int maxdepth = 5, int recurType = ALLFILE);" .in -1c .sp Link with \fI\-lkyfilewatcher\fP. .SH "Detailed Description" The main function of the interface is to remove the specified file from the listening list. .PP The argument .I url is the file path. .PP The argument .I maxdepth is the maximum depth specified for traversal search. .PP The argument .I recurType is the recursive type,which is an enumeration type. The content is as follows: .PP enum RecursiveType{ DIR = 1 << 0, REGULAR = 1 << 1, HIDDEN = 1 << 2, TMPFILE = 1 << 3, //认为那些以~开头的是临时文件 ALLFILE = HIDDEN | TMPFILE | DIR | REGULAR }; .SH "RETURN VALUE" .SH EXAMPLES .EX #include #include #include "libkyfilewatcher.hpp" using namespace KYSDK_FILEWATCHER; int main(int argc, char *argv[]) { KYSDK_FILEWATCHER::FileWatcher watcher; watcher.addWatchTargetRecursive("/home/kylin/", PERIODIC, ALL, 3, REGULAR); getchar(); // qDebug() << "update attr test"; // watcher.updateWatchTargetAttribute("/data/testcode/test.c", DELETE); // getchar(); // qDebug() << "re-add test"; // watcher.addWatchTarget("/data/testcode/test.c", PERIODIC, ALL); // getchar(); // qDebug() << "update oneshot test"; // watcher.updateWatchTargetType("/data/testcode/test.c", ONESHOT); // getchar(); // qDebug() << "remove target test"; // watcher.removeWatchTarget("/data/testcode/test.c"); // getchar(); watcher.clearWatchList(); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR addWatchTargetRecursive (), .BR addWatchTargetListRecursive (), .BR clearWatchList (), .BR pauseWatcher () and .BR restartWatcher (). .SH "SEE ALSO" .BR addWatchTargetRecursive (3), .BR addWatchTargetListRecursive (3), .BR clearWatchList (3), .BR pauseWatcher (3) and .BR restartWatcher (3).libkysdk-system/man/filesystem/KYSDK_FILEWATCHER_FileWatcher.30000664000175000017500000000635115171302542022645 0ustar fengfeng.TH FileWatcher 3 "Wed Sep 20 2023" "1.0" "File Watcher Library" .SH NAME FileWatcher \- File watcher class .SH SYNOPSIS .nf .B #include .fi .SH DESCRIPTION .PP The .B FileWatcher class is mainly used to add file paths that need to be monitored, add file lists that need to be monitored, remove specified files from the monitoring list, clear the monitoring list, pause file monitoring, and resume file monitoring. .PP This class belongs to the .BR KYSDK_FILEWATCHER namespace. .SH "MEMBER FUNCTIONS" .PP .B "QStringList addWatchTargetRecursive (QString url, FileWatcherType type = PERIODIC, int attr = OPEN|CLOSE|MODIFY|DELETE, int maxdepth = 5, int recurType = DIR|REGULAR)" .RS .PP Add a file path that needs to be monitored. For directories, recursive monitoring of subdirectories is enabled by default. .PP .B Parameters: .RS .TP .B url File path .TP .B type File monitoring type .TP .B attr File monitoring attributes .TP .B maxdepth Specify the maximum depth for traversal search .TP .B recurType Recursive type .RE .PP .B Return value: .RS .TP .B QStringList List of successfully added monitoring target paths .RE .RE .PP .B "QStringList addWatchTargetListRecursive (QStringList urlList, FileWatcherType type = PERIODIC, int attr = OPEN|CLOSE|MODIFY|DELETE, int maxdepth = 5, int recurType = DIR|REGULAR)" .RS .PP Add a list of files that need to be monitored. .PP .B Parameters: .RS .TP .B urlList List of files to be monitored .TP .B type File monitoring type .TP .B attr File monitoring attributes .TP .B maxdepth Specify the maximum depth for traversal search .TP .B recurType Recursive type .RE .PP .B Return value: .RS .TP .B QStringList List of successfully added monitoring target paths .RE .RE .PP .B "QStringList removeWatchTargetRecursive (QString url, int maxdepth = 5, int recurType = ALLFILE)" .RS .PP Remove the specified file from the monitoring list. .PP .B Parameters: .RS .TP .B url Path of the specified file .TP .B maxdepth Specify the maximum depth for traversal search .TP .B recurType Recursive type .RE .PP .B Return value: .RS .TP .B QStringList List of successfully removed monitoring target paths .RE .RE .PP .B "void clearWatchList ()" .RS .PP Clear the monitoring list. .RE .PP .B "void pauseWatcher ()" .RS .PP Pause file monitoring. .RE .PP .B "void restartWatcher ()" .RS .PP Resume file monitoring. .RE .SH "ENUMERATIONS" .PP .B FileWatcherType .RS .PP .nf ONESHOT = 0 PERIODIC NEVER .fi .RE .PP .B FileWatcherAttribute .RS .PP .nf ACCESS = IN_ACCESS CREATE = IN_CREATE MODIFY = IN_MODIFY DELETE = IN_DELETE | IN_DELETE_SELF ATTRIB = IN_ATTRIB MOVE = IN_MOVE | IN_MOVE_SELF OPEN = IN_OPEN CLOSE = IN_CLOSE ALL = IN_ALL_EVENTS .fi .RE .PP .B RecursiveType .RS .PP .nf DIR = 1 << 0 REGULAR = 1 << 1 HIDDEN = 1 << 2 TMPFILE = 1 << 3 ALLFILE = HIDDEN | TMPFILE | DIR | REGULAR .fi .RE .SH "CONFORMING TO" These functions conform to the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR addWatchTargetRecursive (), .BR addWatchTargetListRecursive (), .BR removeWatchTargetRecursive (), .BR clearWatchList (), .BR pauseWatcher () and .BR restartWatcher (). .SH "SEE ALSO" .BR inotify (7), .BR libkyfilewatcher (3) .SH AUTHOR Generated automatically by Doxygen for libkyfilewatcher.hpp from the source code.libkysdk-system/man/filesystem/addWatchTargetListRecursive.30000664000175000017500000000624715171302542023304 0ustar fengfeng.TH "addWatchTargetListRecursive" 3 "Wed Sep 20 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME addWatchTargetListRecursive - 增加需要监听的文件列表 .SH SYNOPSIS .nf .B #include .sp .SS "Classes" .in +1c .ti -1c .RI "class \fBKYSDK_FILEWATCHER::FileWatcher\fP" .in -1c .sp .SS "Functions" .in +1c .ti -1c .RI "QStringList addWatchTargetListRecursive(QStringList urlList, FileWatcherType type = PERIODIC, int attr = OPEN|CLOSE|MODIFY|DELETE, int maxdepth = 5, int recurType = DIR|REGULAR);" .in -1c .sp Link with \fI\-lkyfilewatcher\fP. .SH "Detailed Description" The main function of the interface is to add a list of files that need to be monitored. .PP The argument .I urlList is a list of file paths. .PP The argument .I type is the file watcher type,which is an enumeration type. The content is as follows: .PP enum FileWatcherType{ ONESHOT = 0, // 仅报送一次事件。请注意事件发生后,监听符号会从监听列表中移除,下次再用需要重新add PERIODIC, NEVER }; .PP The argument .I attr is the file watcher attribute,which is an enumeration type. The content is as follows: .PP enum FileWatcherAttribute{ ACCESS = IN_ACCESS, CREATE = IN_CREATE, MODIFY = IN_MODIFY, DELETE = IN_DELETE | IN_DELETE_SELF, ATTRIB = IN_ATTRIB, MOVE = IN_MOVE | IN_MOVE_SELF, OPEN = IN_OPEN, CLOSE = IN_CLOSE, ALL = IN_ALL_EVENTS }; .PP The argument .I maxdepth is the maximum depth specified for traversal search. .PP The argument .I recurType is the recursive type,which is an enumeration type. The content is as follows: .PP enum RecursiveType{ DIR = 1 << 0, REGULAR = 1 << 1, HIDDEN = 1 << 2, TMPFILE = 1 << 3, //认为那些以~开头的是临时文件 ALLFILE = HIDDEN | TMPFILE | DIR | REGULAR }; .SH "RETURN VALUE" .SH EXAMPLES .EX #include #include #include "libkyfilewatcher.hpp" using namespace KYSDK_FILEWATCHER; int main(int argc, char *argv[]) { KYSDK_FILEWATCHER::FileWatcher watcher; watcher.addWatchTargetRecursive("/home/kylin/", PERIODIC, ALL, 3, REGULAR); getchar(); // qDebug() << "update attr test"; // watcher.updateWatchTargetAttribute("/data/testcode/test.c", DELETE); // getchar(); // qDebug() << "re-add test"; // watcher.addWatchTarget("/data/testcode/test.c", PERIODIC, ALL); // getchar(); // qDebug() << "update oneshot test"; // watcher.updateWatchTargetType("/data/testcode/test.c", ONESHOT); // getchar(); // qDebug() << "remove target test"; // watcher.removeWatchTarget("/data/testcode/test.c"); // getchar(); watcher.clearWatchList(); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR addWatchTargetRecursive (), .BR removeWatchTargetRecursive (), .BR clearWatchList (), .BR pauseWatcher () and .BR restartWatcher (). .SH "SEE ALSO" .BR addWatchTargetRecursive (3), .BR removeWatchTargetRecursive (3), .BR clearWatchList (3), .BR pauseWatcher (3) and .BR restartWatcher (3).libkysdk-system/man/realtime/0000775000175000017500000000000015171302542015213 5ustar fengfenglibkysdk-system/man/realtime/kdk_real_get_net_speed.30000664000175000017500000000310615171302542021740 0ustar fengfeng.TH "KDK_REAL_GET_NET_SPEED" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_real_get_net_speed - 获取上传的瞬时网速 .SH SYNOPSIS .nf .B #include .sp .BI "extern float kdk_real_get_net_speed(const char *"nc ");" .sp Link with \fI\-lkyrealtime\fP. .SH "Detailed Description" The main function of the interface is to obtain instantaneous internet speed for upload. .PP The argument .I nc is the name of the NIC, such as "eno1". .SH "RETURN VALUE" On success, returns the instantaneous network speed of upload with type float. .PP On error, return .BR -1. .SH EXAMPLES .EX #include "stdio.h" #include "libkyrealtimeinfo.h" int main() { // if(argc < 3) // { // printf("./kyrealtime-test <网卡名> <磁盘名>\n"); // return 0; // } printf("netSpeed : %f\n", kdk_real_get_net_speed("enaftgm1i0")); printf("cpuTemp: %f\n", kdk_real_get_cpu_temperature()); printf("diskTemp : %d\n", kdk_real_get_disk_temperature("/dev/nvme0n1")); printf("diskRate : %d\n", kdk_real_get_disk_rate("/dev/nvme0n1")); printf("ifnetSpeed : %f\n", kdk_real_get_if_speed("enaftgm1i0")); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_real_get_cpu_temperature (), .BR kdk_real_get_disk_temperature (), .BR kdk_real_get_disk_rate () and .BR kdk_real_get_if_speed (). .SH "SEE ALSO" .BR kdk_real_get_cpu_temperature (3), .BR kdk_real_get_disk_temperature (3), .BR kdk_real_get_disk_rate (3) and .BR kdk_real_get_if_speed (3).libkysdk-system/man/realtime/kdk_real_get_if_speed.30000664000175000017500000000313215171302542021547 0ustar fengfeng.TH "KDK_REAL_GET_IF_SPEED" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_real_get_if_speed - 获取下载的瞬时网速信息 .SH SYNOPSIS .nf .B #include .sp .BI "extern float kdk_real_get_if_speed(const char *"nc ");" .sp Link with \fI\-lkyrealtime\fP. .SH "Detailed Description" The main function of the interface is to obtain instantaneous network speed information for download. .PP The argument .I nc is the name of the NIC, such as "eno1". .SH "RETURN VALUE" On success, returns the instantaneous network speed of download with type float. .PP On error, return .BR -1. .SH EXAMPLES .EX #include "stdio.h" #include "libkyrealtimeinfo.h" int main() { // if(argc < 3) // { // printf("./kyrealtime-test <网卡名> <磁盘名>\n"); // return 0; // } printf("netSpeed : %f\n", kdk_real_get_net_speed("enaftgm1i0")); printf("cpuTemp: %f\n", kdk_real_get_cpu_temperature()); printf("diskTemp : %d\n", kdk_real_get_disk_temperature("/dev/nvme0n1")); printf("diskRate : %d\n", kdk_real_get_disk_rate("/dev/nvme0n1")); printf("ifnetSpeed : %f\n", kdk_real_get_if_speed("enaftgm1i0")); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_real_get_net_speed (), .BR kdk_real_get_cpu_temperature (), .BR kdk_real_get_disk_temperature () and .BR kdk_real_get_disk_rate (). .SH "SEE ALSO" .BR kdk_real_get_net_speed (3), .BR kdk_real_get_cpu_temperature (3), .BR kdk_real_get_disk_temperature (3) and .BR kdk_real_get_disk_rate (3).libkysdk-system/man/realtime/kdk_real_get_disk_rate.30000664000175000017500000000307215171302542021741 0ustar fengfeng.TH "KDK_REAL_GET_DISK_RATE" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_real_get_disk_rate - 获取磁盘转速 .SH SYNOPSIS .nf .B #include .sp .BI "extern int kdk_real_get_disk_rate(const char *"name ");" .sp Link with \fI\-lkyrealtime\fP. .SH "Detailed Description" The main function of the interface is to obtain the disk rotational speed. .PP The argument .I name is the name of the disk, such as absolute path such as .I /dev/sda. .SH "RETURN VALUE" On success, returns the disk rotational speed of type int. .PP On error, return .BR -1. .SH EXAMPLES .EX #include "stdio.h" #include "libkyrealtimeinfo.h" int main() { // if(argc < 3) // { // printf("./kyrealtime-test <网卡名> <磁盘名>\n"); // return 0; // } printf("netSpeed : %f\n", kdk_real_get_net_speed("enaftgm1i0")); printf("cpuTemp: %f\n", kdk_real_get_cpu_temperature()); printf("diskTemp : %d\n", kdk_real_get_disk_temperature("/dev/nvme0n1")); printf("diskRate : %d\n", kdk_real_get_disk_rate("/dev/nvme0n1")); printf("ifnetSpeed : %f\n", kdk_real_get_if_speed("enaftgm1i0")); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_real_get_net_speed (), .BR kdk_real_get_cpu_temperature (), .BR kdk_real_get_disk_temperature () and .BR kdk_real_get_if_speed (). .SH "SEE ALSO" .BR kdk_real_get_net_speed (3), .BR kdk_real_get_cpu_temperature (3), .BR kdk_real_get_disk_temperature (3) and .BR kdk_real_get_if_speed (3).libkysdk-system/man/realtime/libkyrealtime.30000664000175000017500000000247315171302542020142 0ustar fengfeng.TH "LIBKYREALTIME" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_real_get_net_speed, kdk_real_get_cpu_temperature, kdk_real_get_disk_temperature, kdk_real_get_disk_rate, kdk_real_get_if_speed - 获取瞬时信息 .SH SYNOPSIS .nf .B #include .sp .BI "extern float kdk_real_get_net_speed(const char *"nc ");" .sp .BI "extern double kdk_real_get_cpu_temperature();" .sp .BI "extern int kdk_real_get_disk_temperature(const char *"name ");" .sp .BI "extern int kdk_real_get_disk_rate(const char *"name ");" .sp .BI "extern float kdk_real_get_if_speed(const char *"nc ");" .sp Link with \fI\-lkyrealtime\fP. .SH "Detailed Description" This library contains instantaneous information about the current system. .SH "RETURN VALUE" The return value is generally specific to the individual function called. .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_real_get_net_speed (), .BR kdk_real_get_cpu_temperature (), .BR kdk_real_get_disk_temperature (), .BR kdk_real_get_disk_rate () and .BR kdk_real_get_if_speed (). .SH "SEE ALSO" .BR kdk_real_get_net_speed (3), .BR kdk_real_get_cpu_temperature (3), .BR kdk_real_get_disk_temperature (3), .BR kdk_real_get_disk_rate (3) and .BR kdk_real_get_if_speed (3).libkysdk-system/man/realtime/kdk_real_get_cpu_temperature.30000664000175000017500000000270615171302542023203 0ustar fengfeng.TH "KDK_REAL_GET_CPU_TEMPERATURE" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_real_get_cpu_temperature - 获取CPU温度 .SH SYNOPSIS .nf .B #include .sp .BI "extern double kdk_real_get_cpu_temperature();" .sp Link with \fI\-lkyrealtime\fP. .SH "Detailed Description" The main function of the interface is to obtain the CPU temperature. .SH "RETURN VALUE" On success, returns the CPU temperature of type double. .PP On error, return .BR -1. .SH EXAMPLES .EX #include "stdio.h" #include "libkyrealtimeinfo.h" int main() { // if(argc < 3) // { // printf("./kyrealtime-test <网卡名> <磁盘名>\n"); // return 0; // } printf("netSpeed : %f\n", kdk_real_get_net_speed("enaftgm1i0")); printf("cpuTemp: %f\n", kdk_real_get_cpu_temperature()); printf("diskTemp : %d\n", kdk_real_get_disk_temperature("/dev/nvme0n1")); printf("diskRate : %d\n", kdk_real_get_disk_rate("/dev/nvme0n1")); printf("ifnetSpeed : %f\n", kdk_real_get_if_speed("enaftgm1i0")); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_real_get_net_speed (), .BR kdk_real_get_disk_temperature (), .BR kdk_real_get_disk_rate () and .BR kdk_real_get_if_speed (). .SH "SEE ALSO" .BR kdk_real_get_net_speed (3), .BR kdk_real_get_disk_temperature (3), .BR kdk_real_get_disk_rate (3) and .BR kdk_real_get_if_speed (3).libkysdk-system/man/realtime/kdk_real_get_disk_temperature.30000664000175000017500000000306715171302542023347 0ustar fengfeng.TH "KDK_REAL_GET_DISK_TEMPERATURE" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_real_get_disk_temperature - 获取磁盘温度 .SH SYNOPSIS .nf .B #include .sp .BI "extern int kdk_real_get_disk_temperature(const char *"name ");" .sp Link with \fI\-lkyrealtime\fP. .SH "Detailed Description" The main function of the interface is to obtain the disk temperature. .PP The argument .I name is the name of the disk, such as absolute path such as .I /dev/sda. .SH "RETURN VALUE" On success, returns the disk temperature of type int. .PP On error, return .BR -1. .SH EXAMPLES .EX #include "stdio.h" #include "libkyrealtimeinfo.h" int main() { // if(argc < 3) // { // printf("./kyrealtime-test <网卡名> <磁盘名>\n"); // return 0; // } printf("netSpeed : %f\n", kdk_real_get_net_speed("enaftgm1i0")); printf("cpuTemp: %f\n", kdk_real_get_cpu_temperature()); printf("diskTemp : %d\n", kdk_real_get_disk_temperature("/dev/nvme0n1")); printf("diskRate : %d\n", kdk_real_get_disk_rate("/dev/nvme0n1")); printf("ifnetSpeed : %f\n", kdk_real_get_if_speed("enaftgm1i0")); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_real_get_net_speed (), .BR kdk_real_get_cpu_temperature (), .BR kdk_real_get_disk_rate () and .BR kdk_real_get_if_speed (). .SH "SEE ALSO" .BR kdk_real_get_net_speed (3), .BR kdk_real_get_cpu_temperature (3), .BR kdk_real_get_disk_rate (3) and .BR kdk_real_get_if_speed (3).libkysdk-system/man/logrotate/0000775000175000017500000000000015171302542015411 5ustar fengfenglibkysdk-system/man/logrotate/kysdk-logrotate.80000664000175000017500000000442715171302542020634 0ustar fengfeng.TH KYSDK-LOGROTATE 8 "2025" "Version 1.0" "System Administration Utilities" .SH NAME kysdk-logrotate \- KYLIN SDK Log Rotation Configuration Management Tool .SH SYNOPSIS .B kysdk-logrotate .SH DESCRIPTION .B kysdk-logrotate is a log rotation configuration management tool in the KYLIN SDK system. This tool is responsible for managing and configuring log rotation rules to ensure that system log files do not grow infinitely, thereby saving disk space and improving system performance. The tool automatically creates and maintains log rotation configuration files in the `/etc/logrotate.d/kylog-rotate/` directory, and performs rotation processing on specified log files according to default rules. .SH FEATURES .TP .B Automatic Configuration Management Automatically creates and manages log rotation configuration files in the `/etc/logrotate.d/kylog-rotate/` directory .TP .B Default Rotation Rules Uses preset rotation rule configuration, including: - Daily rotation (daily) - Retain 5 historical files (rotate 5) - Enable compression (compress) - Add date extension (dateext) - Ignore missing files (missingok) - Do not rotate empty files (notifempty) - Copy and truncate original file (copytruncate) - Execute with root user privileges (su root root) .SH FILES .TP .B /etc/logrotate.d/kylog-rotate/ Log rotation configuration file storage directory .TP .B /usr/bin/kysdk-logrotate Executable file path .SH SERVICE This tool runs as a systemd service with the service file [kysdk-logrotate.service](file:///media/kylin/tianss/openkylin/libkysdk-system/src/logrotate/kysdk-logrotate.service), communicating through D-Bus interface with service name `com.kysdk.base`. .SH AUTHOR KylinSoft Co., Ltd. .SH COPYRIGHT Copyright (C) 2023-2025, KylinSoft Co., Ltd. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. .SH SEE ALSO .BR logrotate (8), .BR systemd (1), .BR dbus-daemon (1)libkysdk-system/man/location/0000775000175000017500000000000015171302542015221 5ustar fengfenglibkysdk-system/man/location/libkylocation.30000664000175000017500000000114115171302542020145 0ustar fengfeng.TH "LIBKYLOCATION" 3 "Thu Sep 14 2023" "Linux Programmer's Manual" \" .SH NAME kdk_loaction_get - 获取地址信息 .SH SYNOPSIS .nf .B #include .sp .BI "extern char *kdk_loaction_get();" .sp Link with \fI\-lkylocation\fP. .SH "Detailed Description" This library contains address information. .SH "RETURN VALUE" The return value is generally specific to the individual function called. .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_loaction_get (). .SH "SEE ALSO" .BR kdk_loaction_get (3).libkysdk-system/man/location/location.80000664000175000017500000000776415171302542017140 0ustar fengfeng.TH LOCATION 8 "2025" "Version 1.0" "System Administration Utilities" .SH NAME location \- KYLIN SDK Location Information Service .SH SYNOPSIS .B location .SH DESCRIPTION .B location is a location information service in the KYLIN SDK system. This service provides geographic location information by determining the system's public IP address and querying location databases to obtain geographic coordinates and location details. The service is implemented as a Python daemon that runs in the background and exposes its functionality through a D-Bus interface with the service name `com.kysdk.location`. It uses the Baidu Map API to resolve IP addresses to geographic locations. .SH FEATURES .TP .B IP Address Detection Automatically detects the system's public IP address by querying external services .TP .B Geographic Location Resolution Uses Baidu Map API to resolve IP addresses to geographic coordinates and location information .TP .B D-Bus Integration Exposes location information through D-Bus for inter-process communication .TP .B JSON Format Response Returns location information in structured JSON format for easy parsing .SH D-BUS INTERFACE The service implements the D-Bus interface `com.kysdk.location` with the following methods: .TP .B getAddress() Returns geographic location information as a JSON string. The method: - Detects the system's public IP address - Queries the Baidu Map IP location API - Returns location data including coordinates, address details, and accuracy information - Returns error messages if the API query fails The returned JSON structure contains: - status: API response status (0 for success) - address: Formatted address string - content: Detailed location information including: - point: Geographic coordinates (x/y or lat/lng) - address_detail: Detailed address components - accuracy: Location accuracy information .SH FILES .TP .B /usr/bin/location Python script implementing the location service .TP .B /usr/bin/location Service executable (symbolic link or wrapper) .TP .B /etc/systemd/system/dbus_location.service Systemd service configuration file .TP .B /var/log/location.log Log file for service operations and debugging information .SH SERVICE The service runs as a systemd service with the following characteristics: - Service name: dbus_location.service - D-Bus name: com.kysdk.location - Object path: /com/kysdk/location - Type: D-Bus activated service - Restart policy: Always restarts automatically .SH DEPENDENCIES .TP .B Python 3 Required for executing the service script .TP .B python-dbus For D-Bus communication .TP .B python-requests For HTTP API requests .TP .B python-gi For GLib main loop integration .TP .B Internet connectivity Required for IP address detection and location API queries .SH API INTEGRATION The service uses the Baidu Map IP Location API: - Endpoint: http://api.map.baidu.com/location/ip - API Key: Preconfigured in the service (4DPAeozisfSCUgSLuC14Ux4iXjeEYNGa) - Coordinate system: BD09LL (Baidu coordinate system) .SH LIMITATIONS .TP .B Internet Requirement Requires active internet connection to function properly .TP .B External Service Dependency Depends on external services for IP detection (sohu.com) and location resolution (Baidu Map API) .TP .B Accuracy Location accuracy depends on the external API and may vary by region .TP .B Privacy Public IP address is sent to external services for location resolution .SH AUTHOR KylinSoft Co., Ltd. .SH COPYRIGHT Copyright (C) 2023-2025, KylinSoft Co., Ltd. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. .SH SEE ALSO .BR dbus-daemon (1), .BR systemd (1), .BR ip (8), .BR curl (1)libkysdk-system/man/location/kdk_loaction_get.30000664000175000017500000000131015171302542020600 0ustar fengfeng.TH "KDK_LOCATION_GET" 3 "Thu Sep 14 2023" "Linux Programmer's Manual" \" .SH NAME kdk_loaction_get - 获取本地地址信息 .SH SYNOPSIS .nf .B #include .sp .BI "extern char *kdk_loaction_get();" .sp Link with \fI\-lkylocation\fP. .SH "Detailed Description" The main function of the interface is to obtain local address information. .SH "RETURN VALUE" On success, returns the address information in JSON format of type char *. .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "stdio.h" #include "libkylocation.h" int main() { printf("location: %s", kdk_loaction_get()); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification.libkysdk-system/man/libkysdk-system-javascript-websocket/0000775000175000017500000000000015171302542022677 5ustar fengfenglibkysdk-system/man/libkysdk-system-javascript-websocket/kysdk-dbus-websocket.10000664000175000017500000001051215171302542027024 0ustar fengfeng.TH KYSDK-DBUS-WEBSOCKET 1 "2025" "Version 1.0" "User Commands" .SH NAME kysdk-dbus-websocket \- KYLIN SDK D-Bus to WebSocket Bridge .SH SYNOPSIS .B kysdk-dbus-websocket .SH DESCRIPTION .B kysdk-dbus-websocket is a background service that provides a bridge between D-Bus system services and WebSocket connections. This service enables JavaScript applications to access KYLIN SDK D-Bus interfaces through WebSocket connections, facilitating web-based interaction with system-level functionality. The service acts as a proxy that translates WebSocket messages to D-Bus method calls and signals, allowing web applications to interact with native system services without direct D-Bus access. .SH FEATURES .TP .B D-Bus to WebSocket Bridge Translates between D-Bus protocol and WebSocket protocol .TP .B JavaScript Interface Provides web-based access to D-Bus services for JavaScript applications .TP .B Automatic Startup Configured to start automatically with the desktop session .TP .B Background Operation Runs silently in the background without user interface .SH AUTOSTART CONFIGURATION The service is configured to start automatically with the desktop environment: .TP .B Desktop Entry Installed as a hidden desktop application (NoDisplay=true) .TP .B Startup Delay Configured with a 15-second delay (X-MATE_Autostart-Delay=15) .TP .B Execution Path /usr/bin/kysdk-dbus-websocket .SH FILES .TP .B /usr/bin/kysdk-dbus-websocket Main executable file .TP .B /etc/xdg/autostart/kysdk-dbus-websocket.desktop Autostart desktop entry file .TP .B ~/.config/autostart/kysdk-dbus-websocket.desktop User-specific autostart configuration (if customized) .SH FUNCTIONALITY .TP .B WebSocket Server Listens for WebSocket connections on a configured port .TP .B D-Bus Proxy Forwards WebSocket requests to appropriate D-Bus services .TP .B Signal Broadcasting Broadcasts D-Bus signals to connected WebSocket clients .TP .B JSON Protocol Uses JSON formatting for message exchange between WebSocket clients and D-Bus services .SH SUPPORTED INTERFACES The service typically bridges common KYLIN SDK D-Bus interfaces including: - System information services - Hardware monitoring services - Network management services - Power management services - Process management services .SH NETWORK CONFIGURATION .TP .B WebSocket Port Listens on a predefined port (typically configured in the application) .TP .B Local Access Usually restricted to localhost connections for security .TP .B Protocol Support Supports standard WebSocket protocol with JSON message format .SH SECURITY .TP .B Access Restrictions Limited to localhost connections to prevent remote exploitation .TP .B Privilege Level Runs with user privileges, not system privileges .TP .B Interface Filtering May implement filtering to restrict accessible D-Bus interfaces .SH DEPENDENCIES .TP .B D-Bus For communication with system services .TP .B WebSocket Library For WebSocket protocol implementation .TP .B Desktop Environment For autostart functionality (MATE/GNOME/KDE) .SH MONITORING .TP .B Process Status Can be monitored through standard process management tools .TP .B Connection Tracking May provide connection statistics and client tracking .TP .B Log Output Outputs to standard logging facilities .SH TROUBLESHOOTING .TP .B Service Status Check if the process is running with "ps aux | grep kysdk-dbus-websocket" .TP .B Manual Start Can be started manually by running "/usr/bin/kysdk-dbus-websocket" .TP .B Log Files Check system logs or desktop environment logs for error messages .SH ENVIRONMENT .TP .B DISPLAY Requires X11 display for desktop session integration .TP .B DBUS_SESSION_BUS_ADDRESS Needs access to session D-Bus for service communication .TP .B HOME Uses home directory for potential configuration files .SH AUTHOR KylinSoft Co., Ltd. .SH COPYRIGHT Copyright (C) 2023-2025, KylinSoft Co., Ltd. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. .SH SEE ALSO .BR dbus-daemon (1), .BR websocketd (1), .BR ws (1)libkysdk-system/man/libkysdk-system-javascript-http/0000775000175000017500000000000015171302542021670 5ustar fengfenglibkysdk-system/man/libkysdk-system-javascript-http/httpServer.80000664000175000017500000000710115171302542024126 0ustar fengfeng.TH KYSDKHTTPSERVER 8 "2025" "Version 1.0" "System Administration Utilities" .SH NAME kysdkHttpServer \- KYLIN SDK HTTP Server Service .SH SYNOPSIS .B kysdkHttpServer .SH DESCRIPTION .B kysdkHttpServer is an HTTP server service in the KYLIN SDK system. This service provides HTTP-based communication capabilities for the KYLIN SDK ecosystem, allowing applications to interact with system components through HTTP requests. The service runs as a background daemon that listens for HTTP requests and processes them according to the KYLIN SDK's HTTP API specifications. It acts as a bridge between web-based applications and system-level functionality. .SH FEATURES .TP .B HTTP Communication Provides HTTP-based interface for system interactions .TP .B RESTful API Support Supports RESTful API endpoints for various SDK functions .TP .B System Integration Integrates with other KYLIN SDK components and services .TP .B Automatic Restart Automatically restarts if the service stops unexpectedly .SH SERVICE CONFIGURATION The service is configured as a systemd service with the following properties: .TP .B Type simple - Service runs as a simple process .TP .B User root - Service runs with root privileges .TP .B Restart enabled - Service automatically restarts on failure .TP .B RestartSec 3 seconds - Wait time before restarting the service .TP .B ExecStart /usr/bin/httpServer - Service executable path .SH FILES .TP .B /usr/bin/httpServer Main executable file for the HTTP server .TP .B /etc/systemd/system/kysdkHttpServer.service Systemd service configuration file .SH SERVICE MANAGEMENT .TP .B Start Service systemctl start kysdkHttpServer .TP .B Stop Service systemctl stop kysdkHttpServer .TP .B Restart Service systemctl restart kysdkHttpServer .TP .B Check Status systemctl status kysdkHttpServer .TP .B Enable at Boot systemctl enable kysdkHttpServer .TP .B Disable at Boot systemctl disable kysdkHttpServer .SH DEPENDENCIES .TP .B systemd For service management and process control .TP .B Root privileges Required for system-level operations .SH PORTS AND NETWORKING The service typically listens on standard HTTP ports (80) or alternative ports as configured in the application. Specific port configuration would be defined within the httpServer application itself. .SH SECURITY .TP .B Privilege Level Runs as root user, providing full system access capabilities .TP .B Access Control Access control mechanisms should be implemented within the application layer .SH MONITORING .TP .B Automatic Restart Service automatically restarts after 3 seconds if it stops unexpectedly .TP .B Systemd Integration Full systemd logging and monitoring capabilities .SH TROUBLESHOOTING .TP .B Service Status Use "systemctl status kysdkHttpServer" to check service status and view recent logs .TP .B Log Files Check systemd journal with "journalctl -u kysdkHttpServer" for detailed logs .TP .B Configuration Issues Verify service file at /etc/systemd/system/kysdkHttpServer.service .SH AUTHOR KylinSoft Co., Ltd. .SH COPYRIGHT Copyright (C) 2023-2025, KylinSoft Co., Ltd. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. .SH SEE ALSO .BR systemd (1), .BR systemctl (1), .BR journalctl (1), .BR httpd (8)libkysdk-system/man/python/0000775000175000017500000000000015171302542014732 5ustar fengfenglibkysdk-system/man/python/kysdk_Mainboard.30000664000175000017500000000344015171302542020120 0ustar fengfeng.TH "kysdk.Mainboard" 3 "Thu Sep 21 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME kysdk.Mainboard \- 获取主板信息 主要用来获取主板型号、生产日期、序列号、厂商信息 .SH SYNOPSIS .br .PP .PP Inherits \fBkysdk\&.Base\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "def \fB__init__\fP (self)" .br .ti -1c .RI "def \fBgetMainboardName\fP (self)" .br .RI "获取主板型号 " .ti -1c .RI "def \fBgetMainboardDate\fP (self)" .br .RI "获取主板生产日期 " .ti -1c .RI "def \fBgetMainboardSerial\fP (self)" .br .RI "获取主板序列号 " .ti -1c .RI "def \fBgetMainboardVendor\fP (self)" .br .RI "获取主板厂商 " .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP 获取主板信息 主要用来获取主板型号、生产日期、序列号、厂商信息 .SH "Member Function Documentation" .PP .SS "def kysdk\&.Mainboard\&.getMainboardDate ( self)" .PP 获取主板生产日期 .PP \fBReturns\fP .RS 4 主板生产日期 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Mainboard\&.getMainboardName ( self)" .PP 获取主板型号 .PP \fBReturns\fP .RS 4 主板型号 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Mainboard\&.getMainboardSerial ( self)" .PP 获取主板序列号 .PP \fBReturns\fP .RS 4 主板序列号 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Mainboard\&.getMainboardVendor ( self)" .PP 获取主板厂商 .PP \fBReturns\fP .RS 4 主板厂商名 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SH "Author" .PP Generated automatically by Doxygen for kysdk.py from the source code\&. libkysdk-system/man/python/kysdk_Sysinfo.30000664000175000017500000001647215171302542017667 0ustar fengfeng.TH "kysdk.Sysinfo" 3 "Thu Sep 21 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME kysdk.Sysinfo \- 获取操作系统基础信息 主要用来获取操作系统架构信息、操作系统名称、操作系统版本号、操作系统激活状态、操作系统服务序列号、内核版本号、 当前登录用户的用户名(Effect User)、操作系统项目编号名、操作系统项目子编号名、操作系统产品标识码、操作系统宿主机的虚拟机类型、 操作系统宿主机的云平台类型、判断当前镜像系统是否为 专用机 系统、系统版本号/补丁版本号、系统当前显示屏幕,分辨率,系统支持分辨率 .SH SYNOPSIS .br .PP .PP Inherits \fBkysdk\&.Base\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "def \fB__init__\fP (self)" .br .ti -1c .RI "def \fBgetSystemArchitecture\fP (self)" .br .RI "获取操作系统架构信息 " .ti -1c .RI "def \fBgetSystemName\fP (self)" .br .RI "获取操作系统名称 " .ti -1c .RI "def \fBgetSystemVersion\fP (self, defatul=0)" .br .RI "获取操作系统版本号 " .ti -1c .RI "def \fBgetSystemActivationStatus\fP (self)" .br .RI "获取操作系统激活状态 " .ti -1c .RI "def \fBgetSystemSerialNumber\fP (self)" .br .RI "获取操作系统服务序列号 " .ti -1c .RI "def \fBgetSystemKernelVersion\fP (self)" .br .RI "获取内核版本号 " .ti -1c .RI "def \fBgetSystemEffectUser\fP (self)" .br .RI "获取当前登录用户的用户名(Effect User) " .ti -1c .RI "def \fBgetSystemProjectName\fP (self)" .br .RI "获取操作系统项目编号名 " .ti -1c .RI "def \fBgetSystemProjectSubName\fP (self)" .br .RI "获取操作系统项目子编号名 " .ti -1c .RI "def \fBgetSystemProductFeatures\fP (self)" .br .RI "获取操作系统产品标识码 " .ti -1c .RI "def \fBgetSystemHostVirtType\fP (self)" .br .RI "获取操作系统宿主机的虚拟机类型 " .ti -1c .RI "def \fBgetSystemHostCloudPlatform\fP (self)" .br .RI "获取操作系统宿主机的云平台类型 " .ti -1c .RI "def \fBgetSystemOSVersion\fP (self)" .br .RI "获取系统版本号 " .ti -1c .RI "def \fBgetSystemUpdateVersion\fP (self)" .br .RI "获取补丁版本号 " .ti -1c .RI "def \fBgetSystemIsZYJ\fP (self)" .br .RI "判断当前镜像系统是否为 专用机 系统 " .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP 获取操作系统基础信息 主要用来获取操作系统架构信息、操作系统名称、操作系统版本号、操作系统激活状态、操作系统服务序列号、内核版本号、 当前登录用户的用户名(Effect User)、操作系统项目编号名、操作系统项目子编号名、操作系统产品标识码、操作系统宿主机的虚拟机类型、 操作系统宿主机的云平台类型、判断当前镜像系统是否为 专用机 系统、系统版本号/补丁版本号、系统当前显示屏幕,分辨率,系统支持分辨率 .SH "Member Function Documentation" .PP .SS "def kysdk\&.Sysinfo\&.getSystemActivationStatus ( self)" .PP 获取操作系统激活状态 .PP \fBReturns\fP .RS 4 2表示已过期;0表示未激活,处于试用期;1表示已激活;-1表示接口内部错误; .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Sysinfo\&.getSystemArchitecture ( self)" .PP 获取操作系统架构信息 .PP \fBReturns\fP .RS 4 操作系统架构信息 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Sysinfo\&.getSystemEffectUser ( self)" .PP 获取当前登录用户的用户名(Effect User) .PP \fBReturns\fP .RS 4 当前登录用户的用户名(Effect User) .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Sysinfo\&.getSystemHostCloudPlatform ( self)" .PP 获取操作系统宿主机的云平台类型 .PP \fBReturns\fP .RS 4 获取失败返回NULL,获取成功返回一个字符串,字符串内容如下: [none, huawei] 其中 none 表示运行在物理机或未知的云平台环境中;其他字符串代表不同的云平台 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Sysinfo\&.getSystemHostVirtType ( self)" .PP 获取操作系统宿主机的虚拟机类型 .PP \fBReturns\fP .RS 4 操作系统宿主机的虚拟机类型,类型如下: [none, qemu, kvm, zvm, vmware, hyper-v, orcale virtualbox, xen, bochs, \\ uml, parallels, bhyve, qnx, arcn, openvz, lxc, lxc-libvirt, systemd-nspawn,\\ docker, podman, rkt, wsl] 其中 none 表示运行在物理机环境中;其他字符串代表具体的虚拟环境类型 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Sysinfo\&.getSystemIsZYJ ( self)" .PP 判断当前镜像系统是否为 专用机 系统 .PP \fBReturns\fP .RS 4 true代表是 false代表不是 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Sysinfo\&.getSystemKernelVersion ( self)" .PP 获取内核版本号 .PP \fBReturns\fP .RS 4 内核版本号 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Sysinfo\&.getSystemName ( self)" .PP 获取操作系统名称 .PP \fBReturns\fP .RS 4 操作系统名称 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Sysinfo\&.getSystemOSVersion ( self)" .PP 获取系统版本号 .PP \fBReturns\fP .RS 4 系统版本号 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Sysinfo\&.getSystemProductFeatures ( self)" .PP 获取操作系统产品标识码 .PP \fBReturns\fP .RS 4 返回标志码 0000 信息异常 0001 仅PC特性 0010 仅平板特性 0011 支持平板与PC特性 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Sysinfo\&.getSystemProjectName ( self)" .PP 获取操作系统项目编号名 .PP \fBReturns\fP .RS 4 操作系统项目编号名 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Sysinfo\&.getSystemProjectSubName ( self)" .PP 获取操作系统项目子编号名 .PP \fBReturns\fP .RS 4 操作系统项目子编号名 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Sysinfo\&.getSystemSerialNumber ( self)" .PP 获取操作系统服务序列号 .PP \fBReturns\fP .RS 4 操作系统服务序列号 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Sysinfo\&.getSystemUpdateVersion ( self)" .PP 获取补丁版本号 .PP \fBReturns\fP .RS 4 补丁版本号 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Sysinfo\&.getSystemVersion ( self, defatul = \fR0\fP)" .PP 获取操作系统版本号 .PP \fBParameters\fP .RS 4 \fIdefatul\fP 0获取简略版本号,1获取详细版本号 .RE .PP \fBReturns\fP .RS 4 操作系统版本号 .PP .nf defatul = 0 获取简略版本号 defatul = 1 获取详细版本号 .fi .PP .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SH "Author" .PP Generated automatically by Doxygen for kysdk.py from the source code\&. libkysdk-system/man/python/kysdk_Disk.30000664000175000017500000001105415171302542017116 0ustar fengfeng.TH "kysdk.Disk" 3 "Thu Sep 21 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME kysdk.Disk \- 获取磁盘信息 主要用来获取磁盘的列表,磁盘的扇区数量,每个扇区的字节数,容量,型号、序列号、子分区数量,类型和固件版本信息 .SH SYNOPSIS .br .PP .PP Inherits \fBkysdk\&.Base\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "def \fB__init__\fP (self)" .br .ti -1c .RI "def \fBgetDiskList\fP (self)" .br .RI "获取所有磁盘的列表 " .ti -1c .RI "def \fBgetDiskSectorSize\fP (self, dev_path)" .br .RI "获取磁盘的每个扇区的字节数 " .ti -1c .RI "def \fBgetDiskTotalSizeMiB\fP (self, dev_path)" .br .RI "获取磁盘容量 " .ti -1c .RI "def \fBgetDiskModel\fP (self, dev_path)" .br .RI "获取磁盘型号 " .ti -1c .RI "def \fBgetDiskSerial\fP (self, dev_path)" .br .RI "获取磁盘序列号 " .ti -1c .RI "def \fBgetDiskPartitionNums\fP (self, dev_path)" .br .RI "获取磁盘/分区下的子分区数量 " .ti -1c .RI "def \fBgetDiskType\fP (self, dev_path)" .br .RI "获取磁盘类型 " .ti -1c .RI "def \fBgetDiskVersion\fP (self, dev_path)" .br .RI "获取磁盘固件版本信息 " .ti -1c .RI "def \fBgetDiskSectorNum\fP (self, dev_path)" .br .RI "获取磁盘扇区数量 " .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP 获取磁盘信息 主要用来获取磁盘的列表,磁盘的扇区数量,每个扇区的字节数,容量,型号、序列号、子分区数量,类型和固件版本信息 .SH "Member Function Documentation" .PP .SS "def kysdk\&.Disk\&.getDiskList ( self)" .PP 获取所有磁盘的列表 .PP \fBReturns\fP .RS 4 磁盘的列表,每个字符串表示一个磁盘的绝对路径 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Disk\&.getDiskModel ( self, dev_path)" .PP 获取磁盘型号 .PP \fBParameters\fP .RS 4 \fIdev_path\fP 指定磁盘名称,应当是例如/dev/sda这种绝对路径 .RE .PP \fBReturns\fP .RS 4 磁盘型号 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Disk\&.getDiskPartitionNums ( self, dev_path)" .PP 获取磁盘/分区下的子分区数量 .PP \fBParameters\fP .RS 4 \fIdev_path\fP 指定磁盘名称,应当是例如/dev/sda这种绝对路径 .RE .PP \fBReturns\fP .RS 4 该磁盘/分区下的子分区数量 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Disk\&.getDiskSectorNum ( self, dev_path)" .PP 获取磁盘扇区数量 .PP \fBParameters\fP .RS 4 \fIdev_path\fP 指定磁盘名称,应当是例如/dev/sda这种绝对路径 .RE .PP \fBReturns\fP .RS 4 扇区数量 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Disk\&.getDiskSectorSize ( self, dev_path)" .PP 获取磁盘的每个扇区的字节数 .PP \fBParameters\fP .RS 4 \fIdev_path\fP 指定磁盘名称,应当是例如/dev/sda这种绝对路径 .RE .PP \fBReturns\fP .RS 4 每个扇区的字节数 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Disk\&.getDiskSerial ( self, dev_path)" .PP 获取磁盘序列号 .PP \fBParameters\fP .RS 4 \fIdev_path\fP 指定磁盘名称,应当是例如/dev/sda这种绝对路径 .RE .PP \fBReturns\fP .RS 4 磁盘序列号 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Disk\&.getDiskTotalSizeMiB ( self, dev_path)" .PP 获取磁盘容量 .PP \fBParameters\fP .RS 4 \fIdev_path\fP 指定磁盘名称,应当是例如/dev/sda这种绝对路径 .RE .PP \fBReturns\fP .RS 4 磁盘容量,MiB为单位 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Disk\&.getDiskType ( self, dev_path)" .PP 获取磁盘类型 .PP \fBParameters\fP .RS 4 \fIdev_path\fP 指定磁盘名称,应当是例如/dev/sda这种绝对路径 .RE .PP \fBReturns\fP .RS 4 磁盘类型,固态 or 机械 or 混合 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Disk\&.getDiskVersion ( self, dev_path)" .PP 获取磁盘固件版本信息 .PP \fBParameters\fP .RS 4 \fIdev_path\fP 指定磁盘名称,应当是例如/dev/sda这种绝对路径 .RE .PP \fBReturns\fP .RS 4 固件版本信息 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SH "Author" .PP Generated automatically by Doxygen for kysdk.py from the source code\&. libkysdk-system/man/python/kysdk_Packageinfo.30000664000175000017500000000405615171302542020437 0ustar fengfeng.TH "kysdk.Packageinfo" 3 "Thu Sep 21 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME kysdk.Packageinfo \- 获取包列表信息 主要用来获取系统中所有包列表、获取系统中指定包的版本号、检测指定包名的软件包是否正确安装 .SH SYNOPSIS .br .PP .PP Inherits \fBkysdk\&.Base\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "def \fB__init__\fP (self)" .br .ti -1c .RI "def \fBgetPackageList\fP (self)" .br .RI "获取系统中所有包列表 " .ti -1c .RI "def \fBgetPackageVersion\fP (self, package_name)" .br .RI "获取系统中指定包的版本号 " .ti -1c .RI "def \fBgetPackageInstalled\fP (self, package_name, version=None)" .br .RI "检测指定包名的软件包是否正确安装 " .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP 获取包列表信息 主要用来获取系统中所有包列表、获取系统中指定包的版本号、检测指定包名的软件包是否正确安装 .SH "Member Function Documentation" .PP .SS "def kysdk\&.Packageinfo\&.getPackageInstalled ( self, package_name, version = \fRNone\fP)" .PP 检测指定包名的软件包是否正确安装 .PP \fBParameters\fP .RS 4 \fIpackage_name\fP 包名 .br \fIversion\fP 版本号,大部分情况下为NULL,预留为snap做准备 .RE .PP \fBReturns\fP .RS 4 成功返回0,失败返回错误码 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Packageinfo\&.getPackageList ( self)" .PP 获取系统中所有包列表 .PP \fBReturns\fP .RS 4 系统中所有包列表 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Packageinfo\&.getPackageVersion ( self, package_name)" .PP 获取系统中指定包的版本号 .PP \fBParameters\fP .RS 4 \fIpackage_name\fP 软件包名 .RE .PP \fBReturns\fP .RS 4 版本号 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SH "Author" .PP Generated automatically by Doxygen for kysdk.py from the source code\&. libkysdk-system/man/python/kysdk_Peripheralsenum.30000664000175000017500000000207615171302542021373 0ustar fengfeng.TH "kysdk.Peripheralsenum" 3 "Thu Sep 21 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME kysdk.Peripheralsenum \- 获取usb设备信息dbus信号类 主要用来获取usb设备的名称、类型、pid、vid、序列号、路径信息 .SH SYNOPSIS .br .PP .PP Inherits \fBkysdk\&.Base\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "def \fB__init__\fP (self)" .br .ti -1c .RI "def \fBgetAllUsbInfo\fP (self)" .br .RI "获取外接usb设备信息 " .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP 获取usb设备信息dbus信号类 主要用来获取usb设备的名称、类型、pid、vid、序列号、路径信息 .SH "Member Function Documentation" .PP .SS "def kysdk\&.Peripheralsenum\&.getAllUsbInfo ( self)" .PP 获取外接usb设备信息 .PP \fBReturns\fP .RS 4 QStringList usb设备名称、类型、pid、vid、序列号、路径信息列表 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SH "Author" .PP Generated automatically by Doxygen for kysdk.py from the source code\&. libkysdk-system/man/python/kysdk_Process.30000664000175000017500000001261015171302542017641 0ustar fengfeng.TH "kysdk.Process" 3 "Thu Sep 21 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME kysdk.Process \- Get instantaneous detailed information of a process. Mainly used to get CPU usage of a process, get memory usage rate of a process, get process status, get port number occupied by a process, get process start time, get process running time, get CPU time of a process, get Command of a process, get owner of a process, get information of a process, and get all process information. .SH SYNOPSIS .br .PP .PP Inherits \fBkysdk\&.Base\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "def \fB__init__\fP (self)" .br .ti -1c .RI "def \fBgetProcInfoCpuUsage\fP (self, pid)" .br .RI "Get CPU usage of a process" .ti -1c .RI "def \fBgetProcInfoMemUsage\fP (self, pid)" .br .RI "Get memory usage rate of a process" .ti -1c .RI "def \fBgetProcInfoStatus\fP (self, pid)" .br .RI "Get process status" .ti -1c .RI "def \fBgetProcInfoPort\fP (self, pid)" .br .RI "Get port number occupied by a process" .ti -1c .RI "def \fBgetProcInfoStartTime\fP (self, pid)" .br .RI "Get process start time" .ti -1c .RI "def \fBgetProcInfoRunningTime\fP (self, pid)" .br .RI "Get process running time" .ti -1c .RI "def \fBgetProcInfoCpuTime\fP (self, pid)" .br .RI "Get CPU time of a process" .ti -1c .RI "def \fBgetProcInfoCmd\fP (self, pid)" .br .RI "Get Command of a process" .ti -1c .RI "def \fBgetProcInfoUser\fP (self, pid)" .br .RI "Get owner of a process" .ti -1c .RI "def \fBgetProcInfo\fP (self, process_name)" .br .RI "Get information of a process" .ti -1c .RI "def \fBgetAllProcInfo\fP (self)" .br .RI "Get all process information" .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP Get instantaneous detailed information of a process. Mainly used to get CPU usage of a process, get memory usage rate of a process, get process status, get port number occupied by a process, get process start time, get process running time, get CPU time of a process, get Command of a process, get owner of a process, get information of a process, and get all process information. .SH "Member Function Documentation" .PP .SS "def kysdk\&.Process\&.getAllProcInfo ( self)" .PP Get all process information .PP \fBReturns\fP .RS 4 List of all processes' CPU usage, memory usage rate, status, port number occupation, start time, running time, CPU time, Command, and owner information .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Process\&.getProcInfo ( self, process_name)" .PP Get information of a process .PP \fBParameters\fP .RS 4 \fIprocess_name\fP Process name .RE .PP \fBReturns\fP .RS 4 List of process information including CPU usage, memory usage rate, status, port number occupation, start time, running time, CPU time, Command, and owner information .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Process\&.getProcInfoCmd ( self, pid)" .PP Get Command of a process .PP \fBParameters\fP .RS 4 \fIpid\fP Process ID .RE .PP \fBReturns\fP .RS 4 Process Command .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Process\&.getProcInfoCpuTime ( self, pid)" .PP Get CPU time of a process .PP \fBParameters\fP .RS 4 \fIpid\fP Process ID .RE .PP \fBReturns\fP .RS 4 Process CPU time .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Process\&.getProcInfoCpuUsage ( self, pid)" .PP Get CPU usage of a process .PP \fBParameters\fP .RS 4 \fIpid\fP Process ID .RE .PP \fBReturns\fP .RS 4 Process CPU usage .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Process\&.getProcInfoMemUsage ( self, pid)" .PP Get memory usage rate of a process .PP \fBParameters\fP .RS 4 \fIpid\fP Process ID .RE .PP \fBReturns\fP .RS 4 Process memory usage rate .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Process\&.getProcInfoPort ( self, pid)" .PP Get port number occupied by a process .PP \fBParameters\fP .RS 4 \fIpid\fP Process ID .RE .PP \fBReturns\fP .RS 4 Port number used by the process .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Process\&.getProcInfoRunningTime ( self, pid)" .PP Get running time of a process .PP \fBParameters\fP .RS 4 \fIpid\fP Process ID .RE .PP \fBReturns\fP .RS 4 Process running time .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Process\&.getProcInfoStartTime ( self, pid)" .PP Get start time of a process .PP \fBParameters\fP .RS 4 \fIpid\fP Process ID .RE .PP \fBReturns\fP .RS 4 Process start time .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Process\&.getProcInfoStatus ( self, pid)" .PP Get process status .PP \fBParameters\fP .RS 4 \fIpid\fP Process ID .RE .PP \fBReturns\fP .RS 4 Process status .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Process\&.getProcInfoUser ( self, pid)" .PP Get owner of a process .PP \fBParameters\fP .RS 4 \fIpid\fP Process ID .RE .PP \fBReturns\fP .RS 4 Process owner .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SH "Author" .PP Generated automatically by Doxygen for kysdk.py from the source code\&.libkysdk-system/man/python/kysdk_GetSysLegalResolution.30000664000175000017500000000213215171302542022470 0ustar fengfeng.TH "kysdk.GetSysLegalResolution" 3 "Thu Sep 21 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME kysdk.GetSysLegalResolution \- 获取屏幕分辨率信息 主要用来获取系统当前显示屏幕,分辨率,系统支持分辨率 .SH SYNOPSIS .br .PP .PP Inherits \fBkysdk\&.SessionBase\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "def \fB__init__\fP (self)" .br .ti -1c .RI "def \fBgetSysLegalResolution\fP (self)" .br .RI "获取系统当前显示屏幕,分辨率,系统支持分辨率 " .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP 获取屏幕分辨率信息 主要用来获取系统当前显示屏幕,分辨率,系统支持分辨率 .SH "Member Function Documentation" .PP .SS "def kysdk\&.GetSysLegalResolution\&.getSysLegalResolution ( self)" .PP 获取系统当前显示屏幕,分辨率,系统支持分辨率 .PP \fBReturns\fP .RS 4 当前显示屏幕,分辨率,系统支持分辨率信息列表 .RE .PP .PP References kysdk\&.SessionBase\&.interface\&. .SH "Author" .PP Generated automatically by Doxygen for kysdk.py from the source code\&. libkysdk-system/man/python/kysdk_Cpuinfo.30000664000175000017500000000554515171302542017637 0ustar fengfeng.TH "kysdk.Cpuinfo" 3 "Thu Sep 21 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME kysdk.Cpuinfo \- 获取cpu信息 主要用来获取cpu的架构、制造厂商、型号、额定主频、核心数量、虚拟化支持和线程数信息 .SH SYNOPSIS .br .PP .PP Inherits \fBkysdk\&.Base\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "def \fB__init__\fP (self)" .br .ti -1c .RI "def \fBgetCpuArch\fP (self)" .br .RI "获取cpu架构 " .ti -1c .RI "def \fBgetCpuVendor\fP (self)" .br .RI "获取cpu制造厂商 " .ti -1c .RI "def \fBgetCpuModel\fP (self)" .br .RI "获取cpu型号 " .ti -1c .RI "def \fBgetCpuFreqMHz\fP (self)" .br .RI "获取cpu额定主频 " .ti -1c .RI "def \fBgetCpuCorenums\fP (self)" .br .RI "获取cpu核心数量 " .ti -1c .RI "def \fBgetCpuVirt\fP (self)" .br .RI "获取cpu对虚拟化的支持 " .ti -1c .RI "def \fBgetCpuProcess\fP (self)" .br .RI "获取cpu线程数 " .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP 获取cpu信息 主要用来获取cpu的架构、制造厂商、型号、额定主频、核心数量、虚拟化支持和线程数信息 .SH "Member Function Documentation" .PP .SS "def kysdk\&.Cpuinfo\&.getCpuArch ( self)" .PP 获取cpu架构 .PP \fBReturns\fP .RS 4 架构信息,如'x86_64' .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Cpuinfo\&.getCpuCorenums ( self)" .PP 获取cpu核心数量 .PP \fBReturns\fP .RS 4 所有可用的CPU核心数量 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Cpuinfo\&.getCpuFreqMHz ( self)" .PP 获取cpu额定主频 .PP \fBReturns\fP .RS 4 额定主频赫兹数,如“1794\&.742” .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Cpuinfo\&.getCpuModel ( self)" .PP 获取cpu型号 .PP \fBReturns\fP .RS 4 CPU型号名称,如“Intel(R) Core(TM) i7-4790K CPU @ 4\&.00GHz” .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Cpuinfo\&.getCpuProcess ( self)" .PP 获取cpu线程数 .PP \fBReturns\fP .RS 4 cpu支持的线程数 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Cpuinfo\&.getCpuVendor ( self)" .PP 获取cpu制造厂商 .PP \fBReturns\fP .RS 4 制造厂商,如“GenuineIntel” .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Cpuinfo\&.getCpuVirt ( self)" .PP 获取cpu对虚拟化的支持 .PP \fBReturns\fP .RS 4 若CPU支持虚拟化,则返回虚拟化技术,如“vmx”;若不支持,返回NULL .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SH "Author" .PP Generated automatically by Doxygen for kysdk.py from the source code\&. libkysdk-system/man/python/kysdk_NetCard.30000664000175000017500000001375215171302542017553 0ustar fengfeng.TH "kysdk.NetCard" 3 "Thu Sep 21 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME kysdk.NetCard \- Network card information class used to get network card list, check if a specified network card is in UP state, get the list of network cards currently in link up state, get the physical MAC address of a specified network card, get the first IPv4 address of a specified network card, get all IPv4 addresses of a specified network card, get the first IPv6 address of a specified network card, get all IPv6 addresses of a specified network card, get the wired/wireless type of a specified network card, and get the vendor name and device model of a specified network card .SH SYNOPSIS .br .PP .PP Inherits \fBkysdk\&.Base\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "def \fB__init__\fP (self)" .br .ti -1c .RI "def \fBgetNetCardName\fP (self)" .br .RI "Get all network cards in the system" .ti -1c .RI "def \fBgetNetCardUp\fP (self, netcard_name)" .br .RI "Check if the specified network card is in UP state" .ti -1c .RI "def \fBgetNetCardUpcards\fP (self)" .br .RI "Get the list of network cards currently in link up state" .ti -1c .RI "def \fBgetNetCardPhymac\fP (self, netcard_name)" .br .RI "Get the physical MAC address of the specified network card" .ti -1c .RI "def \fBgetNetCardPrivateIPv4\fP (self, netcard_name)" .br .RI "Get the first IPv4 address of the specified network card" .ti -1c .RI "def \fBgetNetCardIPv4\fP (self, netcard_name)" .br .RI "Get all IPv4 addresses of the specified network card" .ti -1c .RI "def \fBgetNetCardPrivateIPv6\fP (self, netcard_name)" .br .RI "Get the first IPv6 address of the specified network card" .ti -1c .RI "def \fBgetNetCardType\fP (self, netcard_name)" .br .RI "Get the wired/wireless type of the specified network card" .ti -1c .RI "def \fBgetNetCardProduct\fP (self, netcard_name)" .br .RI "Get the vendor name and device model of the specified network card" .ti -1c .RI "def \fBgetNetCardIPv6\fP (self, netcard_name)" .br .RI "Get all IPv6 addresses of the specified network card" .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP Network card information class used to get network card list, check if a specified network card is in UP state, get the list of network cards currently in link up state, get the physical MAC address of a specified network card, get the first IPv4 address of a specified network card, get all IPv4 addresses of a specified network card, get the first IPv6 address of a specified network card, get all IPv6 addresses of a specified network card, get the wired/wireless type of a specified network card, and get the vendor name and device model of a specified network card .SH "Member Function Documentation" .PP .SS "def kysdk\&.NetCard\&.getNetCardIPv4 ( self, netcard_name)" .PP Get all IPv4 addresses of the specified network card .PP \fBParameters\fP .RS 4 \fInetcard_name\fP Network card name, such as eno1 .RE .PP \fBReturns\fP .RS 4 List of IPv4 addresses .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.NetCard\&.getNetCardIPv6 ( self, netcard_name)" .PP Get all IPv6 addresses of the specified network card .PP \fBParameters\fP .RS 4 \fInetcard_name\fP Network card name, such as eno1 .RE .PP \fBReturns\fP .RS 4 List of IPv6 addresses .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.NetCard\&.getNetCardName ( self)" .PP Get all network cards in the system .PP \fBReturns\fP .RS 4 List of network card names .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.NetCard\&.getNetCardPhymac ( self, netcard_name)" .PP Get the physical MAC address of the specified network card .PP \fBParameters\fP .RS 4 \fInetcard_name\fP Network card name, such as eno1 .RE .PP \fBReturns\fP .RS 4 Physical MAC address .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.NetCard\&.getNetCardPrivateIPv4 ( self, netcard_name)" .PP Get the first IPv4 address of the specified network card .PP \fBParameters\fP .RS 4 \fInetcard_name\fP Network card name, such as eno1 .RE .PP \fBReturns\fP .RS 4 IPv4 address .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.NetCard\&.getNetCardPrivateIPv6 ( self, netcard_name)" .PP Get the first IPv6 address of the specified network card .PP \fBParameters\fP .RS 4 \fInetcard_name\fP Network card name, such as eno1 .RE .PP \fBReturns\fP .RS 4 IPv6 address .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.NetCard\&.getNetCardProduct ( self, netcard_name)" .PP Get the vendor name and device model of the specified network card .PP \fBParameters\fP .RS 4 \fInetcard_name\fP Network card name, such as eno1 .RE .PP \fBReturns\fP .RS 4 Vendor name and device model of the network card .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.NetCard\&.getNetCardType ( self, netcard_name)" .PP Get the wired/wireless type of the specified network card .PP \fBParameters\fP .RS 4 \fInetcard_name\fP Network card name, such as eno1 .RE .PP \fBReturns\fP .RS 4 0 for wired, 1 for wireless .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.NetCard\&.getNetCardUp ( self, netcard_name)" .PP Check if the specified network card is in UP state .PP \fBParameters\fP .RS 4 \fInetcard_name\fP Network card name, such as eno1 .RE .PP \fBReturns\fP .RS 4 1 if Up, 0 if Down .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.NetCard\&.getNetCardUpcards ( self)" .PP Get the list of network cards currently in link up state .PP \fBReturns\fP .RS 4 List of network cards in link up state .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SH "Author" .PP Generated automatically by Doxygen for kysdk.py from the source code\&.libkysdk-system/man/python/kysdk_Net.30000664000175000017500000000435715171302542016762 0ustar fengfeng.TH "kysdk.Net" 3 "Thu Sep 21 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME kysdk.Net \- 获取网络信息 主要用来获取指定网络端口的状态、区间端口状态、网关信息、防火墙信息 .SH SYNOPSIS .br .PP .PP Inherits \fBkysdk\&.Base\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "def \fB__init__\fP (self)" .br .ti -1c .RI "def \fBgetPortState\fP (self, port)" .br .RI "获取指定网络端口的状态 " .ti -1c .RI "def \fBgetMultiplePortStat\fP (self, start_port, end_port)" .br .RI "获取区间端口状态 " .ti -1c .RI "def \fBgetGatewayInfo\fP (self)" .br .RI "获取网关信息 " .ti -1c .RI "def \fBgetFirewallState\fP (self)" .br .RI "获取防火墙信息 " .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP 获取网络信息 主要用来获取指定网络端口的状态、区间端口状态、网关信息、防火墙信息 .SH "Member Function Documentation" .PP .SS "def kysdk\&.Net\&.getFirewallState ( self)" .PP 获取防火墙信息 .PP \fBReturns\fP .RS 4 防火墙信息列表 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Net\&.getGatewayInfo ( self)" .PP 获取网关信息 .PP \fBReturns\fP .RS 4 网关信息网卡名和地址列表 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Net\&.getMultiplePortStat ( self, start_port, end_port)" .PP 获取区间端口状态 .PP \fBParameters\fP .RS 4 \fIstart_port\fP 开始端口 .br \fIend_port\fP 结束端口 .RE .PP \fBReturns\fP .RS 4 区间端口状态列表 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Net\&.getPortState ( self, port)" .PP 获取指定网络端口的状态 .PP \fBParameters\fP .RS 4 \fIport\fP 端口号 .RE .PP \fBReturns\fP .RS 4 端口状态 TCP_ESTABLISHED:0x1 TCP_SYN_SENT:0x2 TCP_SYN_RECV:0x3 TCP_FIN_WAIT1:0x4 TCP_FIN_WAIT2:0x5 TCP_TIME_WAIT:0x6 TCP_CLOSE:0x7 TCP_CLOSE_WAIT:0x8 TCP_LAST_ACL:0x9 TCP_LISTEN:0xa TCP_CLOSING:0xb .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SH "Author" .PP Generated automatically by Doxygen for kysdk.py from the source code\&. libkysdk-system/man/python/kysdk_Runinfo.30000664000175000017500000000407315171302542017647 0ustar fengfeng.TH "kysdk.Runinfo" 3 "Thu Sep 21 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME kysdk.Runinfo \- 获取瞬时信息 主要用来获取瞬时网速,cpu温度、磁盘温度、磁盘转速 .SH SYNOPSIS .br .PP .PP Inherits \fBkysdk\&.Base\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "def \fB__init__\fP (self)" .br .ti -1c .RI "def \fBgetNetSpeed\fP (self, netcard)" .br .RI "获取瞬时网速信息 " .ti -1c .RI "def \fBgetDiskRate\fP (self, disk_path)" .br .RI "获取磁盘转速 " .ti -1c .RI "def \fBgetCpuTemperature\fP (self)" .br .RI "获取CPU温度 " .ti -1c .RI "def \fBgetDiskTemperature\fP (self, disk_path)" .br .RI "获取磁盘温度 " .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP 获取瞬时信息 主要用来获取瞬时网速,cpu温度、磁盘温度、磁盘转速 .SH "Member Function Documentation" .PP .SS "def kysdk\&.Runinfo\&.getCpuTemperature ( self)" .PP 获取CPU温度 .PP \fBReturns\fP .RS 4 CPU温度 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Runinfo\&.getDiskRate ( self, disk_path)" .PP 获取磁盘转速 .PP \fBParameters\fP .RS 4 \fIdisk_path\fP 磁盘名称,应当是例如/dev/sda这种绝对路径 .RE .PP \fBReturns\fP .RS 4 磁盘转速 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Runinfo\&.getDiskTemperature ( self, disk_path)" .PP 获取磁盘温度 .PP \fBParameters\fP .RS 4 \fIdisk_path\fP 磁盘名称,应当是例如/dev/sda这种绝对路径 .RE .PP \fBReturns\fP .RS 4 磁盘温度 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Runinfo\&.getNetSpeed ( self, netcard)" .PP 获取瞬时网速信息 .PP \fBParameters\fP .RS 4 \fInetcard\fP 网卡名称,如eno1 .RE .PP \fBReturns\fP .RS 4 瞬时网速 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SH "Author" .PP Generated automatically by Doxygen for kysdk.py from the source code\&. libkysdk-system/man/python/kysdk_Gps.30000664000175000017500000000152615171302542016760 0ustar fengfeng.TH "kysdk.Gps" 3 "Thu Sep 21 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME kysdk.Gps \- 获取地址信息 主要用来获取本地地址信息 .SH SYNOPSIS .br .PP .PP Inherits \fBkysdk\&.Base\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "def \fB__init__\fP (self)" .br .ti -1c .RI "def \fBgetGPSInfo\fP (self)" .br .RI "获取本地地址信息 " .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP 获取地址信息 主要用来获取本地地址信息 .SH "Member Function Documentation" .PP .SS "def kysdk\&.Gps\&.getGPSInfo ( self)" .PP 获取本地地址信息 .PP \fBReturns\fP .RS 4 json格式的地址信息 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SH "Author" .PP Generated automatically by Doxygen for kysdk.py from the source code\&. libkysdk-system/man/python/kysdk_Bios.30000664000175000017500000000213415171302542017117 0ustar fengfeng.TH "kysdk.Bios" 3 "Thu Sep 21 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME kysdk.Bios \- 获取bios信息 主要用来获取bios的厂商和版本信息 .SH SYNOPSIS .br .PP .PP Inherits \fBkysdk\&.Base\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "def \fB__init__\fP (self)" .br .ti -1c .RI "def \fBgetBiosVendor\fP (self)" .br .RI "获取bios厂商 " .ti -1c .RI "def \fBgetBiosVersion\fP (self)" .br .RI "获取bios版本 " .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP 获取bios信息 主要用来获取bios的厂商和版本信息 .SH "Member Function Documentation" .PP .SS "def kysdk\&.Bios\&.getBiosVendor ( self)" .PP 获取bios厂商 .PP \fBReturns\fP .RS 4 厂商名 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Bios\&.getBiosVersion ( self)" .PP 获取bios版本 .PP \fBReturns\fP .RS 4 版本号 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SH "Author" .PP Generated automatically by Doxygen for kysdk.py from the source code\&. libkysdk-system/man/python/kysdk_Resource.30000664000175000017500000001316215171302542020015 0ustar fengfeng.TH "kysdk.Resource" 3 "Thu Sep 21 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME kysdk.Resource \- System resource usage information class used to obtain total physical memory size, physical memory usage rate, physical memory usage size, actually available physical memory size, actually free physical memory size, total virtual memory allocated by all applications, total Swap partition size, Swap partition usage rate, Swap partition usage, Swap partition free size, CPU instantaneous usage rate, and operating system uptime .SH SYNOPSIS .br .PP .PP Inherits \fBkysdk\&.Base\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "def \fB__init__\fP (self)" .br .ti -1c .RI "def \fBgetMemTotalKiB\fP (self)" .br .RI "Get the total physical memory size of the system" .ti -1c .RI "def \fBgetMemUsagePercent\fP (self)" .br .RI "Get the physical memory usage rate" .ti -1c .RI "def \fBgetMemUsageKiB\fP (self)" .br .RI "Get the physical memory usage size, note that Buffer/Cache is counted as used memory" .ti -1c .RI "def \fBgetMemAvailableKiB\fP (self)" .br .RI "Get the actually available physical memory size, this value is approximately equal to Free + Buffer + Cache" .ti -1c .RI "def \fBgetMemFreeKiB\fP (self)" .br .RI "Get the actually free physical memory size, note that Buffer/Cache is counted as used memory" .ti -1c .RI "def \fBgetMemVirtAllocKiB\fP (self)" .br .RI "Get the total virtual memory allocated by all applications" .ti -1c .RI "def \fBgetMemSwapTotalKiB\fP (self)" .br .RI "Get the total Swap partition size of the system" .ti -1c .RI "def \fBgetMemSwapUsagePercent\fP (self)" .br .RI "Get the Swap partition usage rate" .ti -1c .RI "def \fBgetMemSwapUsageKiB\fP (self)" .br .RI "Get the Swap partition usage" .ti -1c .RI "def \fBgetMemSwapFreeKiB\fP (self)" .br .RI "Get the Swap partition free size" .ti -1c .RI "def \fBgetCpuCurrentUsage\fP (self)" .br .RI "Get the CPU instantaneous usage rate" .ti -1c .RI "def \fBgetUpTime\fP (self)" .br .RI "Get the operating system uptime" .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP System resource usage information class used to obtain total physical memory size, physical memory usage rate, physical memory usage size, actually available physical memory size, actually free physical memory size, total virtual memory allocated by all applications, total Swap partition size, Swap partition usage rate, Swap partition usage, Swap partition free size, CPU instantaneous usage rate, and operating system uptime .SH "Member Function Documentation" .PP .SS "def kysdk\&.Resource\&.getCpuCurrentUsage ( self)" .PP Get the CPU instantaneous usage rate .PP \fBReturns\fP .RS 4 CPU instantaneous usage rate, this value < 1.00 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Resource\&.getMemAvailableKiB ( self)" .PP Get the actually available physical memory size, this value is approximately equal to Free + Buffer + Cache .PP \fBReturns\fP .RS 4 Available physical memory size, in KiB .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Resource\&.getMemFreeKiB ( self)" .PP Get the actually free physical memory size, note that Buffer/Cache is counted as used memory .PP \fBReturns\fP .RS 4 Free physical memory size, in KiB .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Resource\&.getMemSwapFreeKiB ( self)" .PP Get the Swap partition free size .PP \fBReturns\fP .RS 4 Swap partition free size, in KiB .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Resource\&.getMemSwapTotalKiB ( self)" .PP Get the total Swap partition size of the system .PP \fBReturns\fP .RS 4 Swap partition size, in KiB .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Resource\&.getMemSwapUsageKiB ( self)" .PP Get the Swap partition usage .PP \fBReturns\fP .RS 4 Swap partition usage, in KiB .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Resource\&.getMemSwapUsagePercent ( self)" .PP Get the Swap partition usage rate .PP \fBReturns\fP .RS 4 Swap partition usage rate .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Resource\&.getMemTotalKiB ( self)" .PP Get the total physical memory size of the system .PP \fBReturns\fP .RS 4 Physical memory size, in KiB .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Resource\&.getMemUsageKiB ( self)" .PP Get the physical memory usage size, note that Buffer/Cache is counted as used memory .PP \fBReturns\fP .RS 4 Physical memory usage size, in KiB .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Resource\&.getMemUsagePercent ( self)" .PP Get the physical memory usage rate .PP \fBReturns\fP .RS 4 Physical memory usage rate .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Resource\&.getMemVirtAllocKiB ( self)" .PP Get the total virtual memory allocated by all applications .PP \fBReturns\fP .RS 4 Total virtual memory allocated, in KiB .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Resource\&.getUpTime ( self)" .PP Get the operating system uptime .PP \fBReturns\fP .RS 4 System uptime .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SH "Author" .PP Generated automatically by Doxygen for kysdk.py from the source code\&.libkysdk-system/man/python/kysdk_Print.30000664000175000017500000001476515171302542017334 0ustar fengfeng.TH "kysdk.Print" 3 "Thu Sep 21 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME kysdk.Print \- 获取打印信息 主要用来生成本地的所有打印机(包含可用打印机和不可用打印机)、获取本地的所有可用打印机(打印机处于idle状态)、 设置打印参数,每次设置会清除之前设置打印参数,这个设置是全局设置,设置了之后所有打印机都会用这个参数进行打印、 下载网络文件、打印本地文件、清除某个打印机的所有打印队列、获取当前打印机状态(状态不是实时更新)、 获取当前打印任务状态(发送打印任务之后下需要等待一会再获取状态,状态不是实时更新)、获取url内的文件名 .SH SYNOPSIS .br .PP .PP Inherits \fBkysdk\&.Base\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "def \fB__init__\fP (self)" .br .ti -1c .RI "def \fBgetPrinterList\fP (self)" .br .RI "获取本地的所有打印机(包含可用打印机和不可用打印机) " .ti -1c .RI "def \fBgetPrinterAvailableList\fP (self)" .br .RI "获取本地的所有可用打印机(打印机处于idle状态) " .ti -1c .RI "def \fBsetPrinterOptions\fP (self, num, paper_type, cups, option)" .br .RI "设置打印参数,每次设置会清除之前设置打印参数,这个设置是全局设置,设置了之后所有打印机都会用这个参数进行打印 " .ti -1c .RI "def \fBgetPrinterPrintLocalFile\fP (self, print_name, file_path)" .br .RI "打印本地文件 " .ti -1c .RI "def \fBgetPrinterCancelAllJobs\fP (self, print_name)" .br .RI "清除某个打印机的所有打印队列 " .ti -1c .RI "def \fBgetPrinterStatus\fP (self, print_name)" .br .RI "获取当前打印机状态(状态不是实时更新) " .ti -1c .RI "def \fBgetPrinterFilename\fP (self, url)" .br .RI "获取url内的文件名 " .ti -1c .RI "def \fBgetPrinterJobStatus\fP (self, print_name, jobid)" .br .RI "获取当前打印任务状态(发送打印任务之后下需要等待一会再获取状态,状态不是实时更新) " .ti -1c .RI "def \fBgetPrinterDownloadRemoteFile\fP (self, url, path)" .br .RI "下载网络文件 " .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP 获取打印信息 主要用来生成本地的所有打印机(包含可用打印机和不可用打印机)、获取本地的所有可用打印机(打印机处于idle状态)、 设置打印参数,每次设置会清除之前设置打印参数,这个设置是全局设置,设置了之后所有打印机都会用这个参数进行打印、 下载网络文件、打印本地文件、清除某个打印机的所有打印队列、获取当前打印机状态(状态不是实时更新)、 获取当前打印任务状态(发送打印任务之后下需要等待一会再获取状态,状态不是实时更新)、获取url内的文件名 .SH "Member Function Documentation" .PP .SS "def kysdk\&.Print\&.getPrinterAvailableList ( self)" .PP 获取本地的所有可用打印机(打印机处于idle状态) .PP \fBReturns\fP .RS 4 本地的所有可用打印机名称列表 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Print\&.getPrinterCancelAllJobs ( self, print_name)" .PP 清除某个打印机的所有打印队列 .PP \fBParameters\fP .RS 4 \fIprint_name\fP 打印机名 .RE .PP \fBReturns\fP .RS 4 成功返回0,失败返回-1 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Print\&.getPrinterDownloadRemoteFile ( self, url, path)" .PP 下载网络文件 .PP \fBParameters\fP .RS 4 \fIurl\fP 要打印的url .br \fIpath\fP 保存的文件路径 .RE .PP \fBReturns\fP .RS 4 打印作业的id .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Print\&.getPrinterFilename ( self, url)" .PP 获取url内的文件名 .PP \fBParameters\fP .RS 4 \fIurl\fP 路径 .RE .PP \fBReturns\fP .RS 4 解析出来的函数名 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Print\&.getPrinterJobStatus ( self, print_name, jobid)" .PP 获取当前打印任务状态(发送打印任务之后下需要等待一会再获取状态,状态不是实时更新) .PP \fBParameters\fP .RS 4 \fIprint_name\fP 打印机名 .br \fIjobid\fP 打印作业的id .RE .PP \fBReturns\fP .RS 4 状态码 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Print\&.getPrinterList ( self)" .PP 获取本地的所有打印机(包含可用打印机和不可用打印机) .PP \fBReturns\fP .RS 4 地的所有打印机名称列表 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Print\&.getPrinterPrintLocalFile ( self, print_name, file_path)" .PP 打印本地文件 .PP \fBParameters\fP .RS 4 \fIprint_name\fP 打印机名 .br \fIfile_path\fP 文件绝对路径 .RE .PP \fBReturns\fP .RS 4 打印作业的id .RE .PP @notice 虽然支持多种格式的打印,但是打印除pdf之外的格式打印的效果都不够好,建议打印pdf格式的文件 打印机处于stop状态函数返回0 格式不对的文件可以成功创建打印任务,但是打印不出来。什么叫格式不对,举个例子,比如当前要打印日志文件a\&.log, 然后把a\&.log改名叫a\&.pdf,这个时候a\&.pdf就变成了格式不对的文件,打印不出来了 .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Print\&.getPrinterStatus ( self, print_name)" .PP 获取当前打印机状态(状态不是实时更新) .PP \fBParameters\fP .RS 4 \fIprint_name\fP 打印机名 .RE .PP \fBReturns\fP .RS 4 状态码 .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SS "def kysdk\&.Print\&.setPrinterOptions ( self, num, paper_type, cups, option)" .PP 设置打印参数,每次设置会清除之前设置打印参数,这个设置是全局设置,设置了之后所有打印机都会用这个参数进行打印 .PP \fBParameters\fP .RS 4 \fInum\fP cups属性,一张纸打印几页,如2 4等 .br \fIpaper_type\fP cups属性,纸张类型,如A4 .br \fIcups\fP cups属性,如lrtb .br \fIoption\fP cups属性,单面如one-sided,双面如two-sided-long-edge(长边翻转),two-sided-short-edge(短边翻转) .RE .PP .PP References kysdk\&.SessionBase\&.interface, and kysdk\&.Base\&.interface\&. .SH "Author" .PP Generated automatically by Doxygen for kysdk.py from the source code\&. libkysdk-system/man/powermanagement/0000775000175000017500000000000015171302542016602 5ustar fengfenglibkysdk-system/man/powermanagement/kdk_set_inhibit_lockscreen.30000664000175000017500000000244115171302542024231 0ustar fengfeng.TH "KDK_SET_INHIBIT_LOCKSCREEN" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_set_inhibit_lockscreen - 设置禁止锁屏 .SH SYNOPSIS .nf .B #include .sp .BI "extern uint32_t kdk_set_inhibit_lockscreen(const char *"appName ", const char *"reason ");" .sp Link with \fI\-lkypowermanagement\fP. .SH "Detailed Description" The main function of the interface is to set the lock screen to suppress. .PP The argument .I appName is the application name. .PP The argument .I reason is the reason for disabling the lock screen. .SH "RETURN VALUE" On success, return .BR 0. .PP On error, return .BR -1. .SH EXAMPLES .EX #include #include int main(void) { char appName[] = "test-package"; char reason[] = "test-reason"; uint32_t flag; if ((flag = kdk_set_inhibit_lockscreen(appName , reason)) == 0) { printf("set inhibit lock screen fail !\n"); return -1; } if (kdk_un_inhibit_lockscreen(flag)) { printf("un inhibit lock screen fail !\n"); return -1; } return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_un_inhibit_lockscreen (). .SH "SEE ALSO" .BR kdk_un_inhibit_lockscreen (3).libkysdk-system/man/powermanagement/kdk_un_inhibit_lockscreen.30000664000175000017500000000233115171302542024056 0ustar fengfeng.TH "KDK_UN_INHIBIT_LOCKSCREEN" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_un_inhibit_lockscreen - 设置禁止锁屏 .SH SYNOPSIS .nf .B #include .sp .BI "extern int kdk_un_inhibit_lockscreen(uint32_t "flag ");" .sp Link with \fI\-lkypowermanagement\fP. .SH "Detailed Description" The main function of the interface is to undisable the lock screen. .PP The argument .I flag is the return value of the .I kdk_set_inhibit_lockscreen interface. .SH "RETURN VALUE" On success, return .BR 0. .PP On error, return .BR -1. .SH EXAMPLES .EX #include #include int main(void) { char appName[] = "test-package"; char reason[] = "test-reason"; uint32_t flag; if ((flag = kdk_set_inhibit_lockscreen(appName , reason)) == 0) { printf("set inhibit lock screen fail !\n"); return -1; } if (kdk_un_inhibit_lockscreen(flag)) { printf("un inhibit lock screen fail !\n"); return -1; } return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_set_inhibit_lockscreen (). .SH "SEE ALSO" .BR kdk_set_inhibit_lockscreen (3).libkysdk-system/man/powermanagement/libkypowermanagement.30000664000175000017500000000160615171302542023115 0ustar fengfeng.TH "LIBKYPOWERMANAGEMENT" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_set_inhibit_lockscreen, kdk_un_inhibit_lockscreen - 提供锁屏设置能力 .SH SYNOPSIS .nf .B #include .sp .BI "extern uint32_t kdk_set_inhibit_lockscreen(const char *"appName ", const char *"reason ");" .sp .BI "extern int kdk_un_inhibit_lockscreen(uint32_t "flag ");" .sp Link with \fI\-lkypowermanagement\fP. .SH "Detailed Description" This library provides lock screen setting capabilities. .SH "RETURN VALUE" The return value is generally specific to the individual function called. .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_set_inhibit_lockscreen () and .BR kdk_un_inhibit_lockscreen (). .SH "SEE ALSO" .BR kdk_set_inhibit_lockscreen (3) and .BR kdk_un_inhibit_lockscreen (3).libkysdk-system/man/powermanagement/sdk-powermanager.10000664000175000017500000001004715171302542022134 0ustar fengfeng.TH KYSDK-DATE 1 "2025" "Version 0.1" "User Commands" .SH NAME kysdk-date \- KYLIN SDK Date and Time Format Management Service .SH SYNOPSIS .B kysdk-date .SH DESCRIPTION .B kysdk-date is a date and time format management service in the KYLIN SDK system. This service provides real-time date and time formatting capabilities, monitoring user configuration changes and broadcasting formatted date/time information through D-Bus signals. The service runs as a background daemon that monitors changes to date format configuration files and automatically broadcasts updated date/time information to all subscribed applications. It supports multiple date formats and time display modes (12-hour/24-hour clock). .SH FEATURES .TP .B Real-time Configuration Monitoring Monitors user date format configuration file changes in real-time using inotify .TP .B Multiple Date Format Support Supports various date formats including: - Short date formats (yy-M-d, MM/dd/yyyy, etc.) - Long date formats (yyyy MM dd, yy M d, etc.) - Custom formats with different separators (-, /, .) .TP .B Time Format Support Supports both 12-hour and 24-hour clock formats .TP .B D-Bus Signal Broadcasting Broadcasts date/time information through D-Bus signals when configurations change .TP .B Localization Support Provides localized date format strings based on system locale settings .SH D-Bus INTERFACE The service implements the following D-Bus interface `com.kylin.kysdk.DateInterface` with these signals: .TP .B DateSignal Emitted when the date format configuration changes, providing: - Formatted date string - Time format information .TP .B LongDateSignal Emitted for long date format changes, providing: - Long date format template - Formatted long date string .TP .B ShortDateSignal Emitted for short date format changes, providing: - Short date format template - Formatted short date string .TP .B TimeSignal Emitted for time format changes, providing: - Time format information (12-hour/24-hour clock) .SH CONFIGURATION The service monitors the configuration file located at: .B ~/.config/kydate/dateformat.conf Configuration options include: .TP .B DATE_FORMAT General date format setting .TP .B TIME_FORMAT Time format setting (12 or 24) .TP .B LONG_DATE_FORMAT Specific format for long date display .TP .B SHORT_DATE_FORMAT Specific format for short date display .SH FILES .TP .B /usr/bin/sdk-date Main executable file .TP .B ~/.config/kydate/dateformat.conf User configuration file for date/time formats .TP .B /var/log/kysdk-date.log Log file (if logging is enabled) .SH SERVICE The service runs as a session D-Bus service with: - Service name: com.kylin.kysdk.DateServer - Object path: /com/kylin/kysdk/Date - Interface: com.kylin.kysdk.DateInterface .SH DEPENDENCIES .TP .B D-Bus For inter-process communication .TP .B GLib For main loop integration .TP .B GNU gettext For localization support .SH THREADING The service uses a multi-threaded architecture: - Main thread: Handles D-Bus communication and main loop - Monitor thread: Watches for configuration file changes - Signal threads: Handle date/time formatting and broadcasting .SH SIGNALS .TP .B IN_CREATE, IN_DELETE, IN_MODIFY, IN_MOVE_SELF inotify events monitored for configuration file changes .TP .B SIGTERM, SIGINT Graceful shutdown signals .SH LOCALIZATION Supports localization through GNU gettext with: - Language-specific date formats - Translated time format descriptions - Locale-aware date formatting .SH AUTHOR KylinSoft Co., Ltd. .SH COPYRIGHT Copyright (C) 2023-2025, KylinSoft Co., Ltd. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. .SH SEE ALSO .BR dbus-daemon (1), .BR date (1), .BR locale (1), .BR inotify (7)libkysdk-system/man/datacollect/0000775000175000017500000000000015171302542015670 5ustar fengfenglibkysdk-system/man/datacollect/KCustomProperty.30000664000175000017500000000105115171302542021103 0ustar fengfeng.TH "KCustomProperty" 3 "Mon Sep 25 2023" "Version version:2.3" "LIBKYSDK-DIAGNOSETEST" \" -*- nroff -*- .ad l .nh .SH NAME KCustomProperty \- 扩展属性,可为事件添加额外属性 .SH SYNOPSIS .br .PP .PP \fR#include \fP .SS "Public Attributes" .in +1c .ti -1c .RI "char * \fBkey\fP" .br .ti -1c .RI "char * \fBvalue\fP" .br .in -1c .SH "Detailed Description" .PP 扩展属性,可为事件添加额外属性 .SH "Author" .PP Generated automatically by Doxygen for LIBKYSDK-DIAGNOSETEST from the source code\&. libkysdk-system/man/datacollect/KGlobalProperty.30000664000175000017500000000122415171302542021033 0ustar fengfeng.TH "KGlobalProperty" 3 "Mon Sep 25 2023" "Version version:2.3" "LIBKYSDK-DIAGNOSETEST" \" -*- nroff -*- .ad l .nh .SH NAME KGlobalProperty \- 全局属性,由接口自动填充 .SH SYNOPSIS .br .PP .PP \fR#include \fP .SS "Public Attributes" .in +1c .ti -1c .RI "char * \fBumid\fP" .br .ti -1c .RI "char * \fBuserId\fP" .br .ti -1c .RI "char * \fBsourceIp\fP" .br .ti -1c .RI "char * \fBsourceMac\fP" .br .ti -1c .RI "char * \fBserviceKey\fP" .br .in -1c .SH "Detailed Description" .PP 全局属性,由接口自动填充 .SH "Author" .PP Generated automatically by Doxygen for LIBKYSDK-DIAGNOSETEST from the source code\&. libkysdk-system/man/datacollect/KTrackData.30000664000175000017500000000512715171302542017732 0ustar fengfeng.TH "KTrackData" 3 "Mon Sep 25 2023" "Version 2.3" "LIBKYSDK-DIAGNOSETEST" .\" -*- nroff -*- .ad l .nh .SH NAME KTrackData \- Data structure for tracking events in LIBKYSDK-DIAGNOSETEST .SH SYNOPSIS .nf .PP .B #include .fi .PP .SS "Data Fields" .in +1c .ti -1c .RI "char * \fBeventCode\fP" .br .ti -1c .RI "KEventType \fBeventType\fP" .br .ti -1c .RI "KEventSourceType \fBeventSourceType\fP" .br .ti -1c .RI "long \fBtimeStamp\fP" .br .ti -1c .RI "char * \fBpageName\fP" .br .ti -1c .RI "char * \fBpageUrl\fP" .br .ti -1c .RI "char * \fBpagePath\fP" .br .ti -1c .RI "int \fBduration\fP" .br .ti -1c .RI "char * \fBappName\fP" .br .ti -1c .RI "char * \fBappVersion\fP" .br .ti -1c .RI "char * \fBsearchWord\fP" .br .ti -1c .RI "char * \fBentrancePageFlag\fP" .br .ti -1c .RI "char * \fBexitPageFlag\fP" .br .ti -1c .RI "char * \fBnewUserFlag\fP" .br .ti -1c .RI "\fBKCustomProperty\fP * \fBcustomProperty\fP" .br .ti -1c .RI "\fBKGlobalProperty\fP * \fBglobalProperty\fP" .br .ti -1c .RI "int \fBcustomPropertyLength\fP" .br .in -1c .SH "DESCRIPTION" .PP The KTrackData structure represents tracking event data in the LIBKYSDK-DIAGNOSETEST library. It contains various fields for event tracking, page information, application details, and custom properties. .SH "FIELD DOCUMENTATION" .PP .SS "char* eventCode" .PP Unique identifier for the tracking event .PP .SS "KEventType eventType" .PP Type of the tracking event .PP .SS "KEventSourceType eventSourceType" .PP Source type of the event .PP .SS "long timeStamp" .PP Timestamp when the event occurred .PP .SS "char* pageName" .PP Name of the page where the event occurred .PP .SS "char* pageUrl" .PP URL of the page where the event occurred .PP .SS "char* pagePath" .PP Path of the page where the event occurred .PP .SS "int duration" .PP Duration associated with the event .PP .SS "char* appName" .PP Name of the application .PP .SS "char* appVersion" .PP Version of the application .PP .SS "char* searchWord" .PP Search word if applicable .PP .SS "char* entrancePageFlag" .PP Flag indicating if this is an entrance page .PP .SS "char* exitPageFlag" .PP Flag indicating if this is an exit page .PP .SS "char* newUserFlag" .PP Flag indicating if this is a new user .PP .SS "KCustomProperty* customProperty" .PP Array of custom properties for the event .PP .SS "KGlobalProperty* globalProperty" .PP Global properties for the event .PP .SS "int customPropertyLength" .PP Length of the custom properties array .SH "SEE ALSO" .PP .BR KCustomProperty (3), .BR KGlobalProperty (3) .SH "AUTHOR" .PP Generated automatically by Doxygen for LIBKYSDK-DIAGNOSETEST from the source code.libkysdk-system/man/kdkocr/0000775000175000017500000000000015171302542014666 5ustar fengfenglibkysdk-system/man/kdkocr/getRect.30000664000175000017500000000255215171302542016353 0ustar fengfeng.TH "getRect" 3 "Wed Sep 20 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME getRect - 获取文字框 .SH SYNOPSIS .nf .B #include .sp .SS "Classes" .in +1c .ti -1c .RI "class \fBkdk::kdkOCR\fP" .in -1c .sp .SS "Functions" .in +1c .ti -1c .RI "std::vector>> getRect(const std::string &imagePath);" .in -1c .sp Link with \fI\-lkyocr\fP. .SH "Detailed Description" The main function of the interface is to obtain the text box. .PP The argument .I imagePath is the image file path. .SH "RETURN VALUE" Returns the coordinate matrix of the text box points and the number of text boxes of type .BR std::vector>>. .SH EXAMPLES .EX #include "libkyocr.hpp" #include "iostream" using namespace kdk; int main(){ std::string path = "./222.png"; std::string path2 = "./sdsd.png"; std::string path3 = "./222.jpg"; kdkOCR kd1; //std::cout<<"aaaaaaaa"; std::vector result; result=kd1.getCls(path3,4); std::cout<\fP .SS "Public Member Functions" .in +1c .ti -1c .RI "std::vector< std::vector< std::vector< int > > > \fBgetRect\fP (const std::string &imagePath)" .br .RI "获取文字框 " .ti -1c .RI "std::vector< std::string > \fBgetCls\fP (const std::string &imagePath, int nums)" .br .RI "获取文字内容 " .in -1c .SH "Detailed Description" .PP OCR文字识别功能类 主要用来获取文字框和获取文字内容 .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR getRect () and .BR getCls (). .SH "SEE ALSO" .BR getRect (3) and .BR getCls (3).libkysdk-system/man/kdkocr/libkyocr.30000664000175000017500000000275615171302542016602 0ustar fengfeng.TH "libkyocr" 3 "Wed Sep 20 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME libkyocr - OCR 文字识别功能 .SH SYNOPSIS .br .PP .SS "Classes" .in +1c .ti -1c .RI "class \fBkdk::kdkOCR\fP" .br .RI "OCR文字识别功能类 主要用来获取文字框和获取文字内容 " .in -1c .SS "Functions" .in +1c .ti -1c .RI "std::vector< std::vector< std::vector< int > > > \fBkdk::kdkOCR::getRect\fP (const std::string &imagePath)" .br .RI "获取文字框 " .ti -1c .RI "std::vector< std::string > \fBkdk::kdkOCR::getCls\fP (const std::string &imagePath, int nums)" .br .RI "获取文字内容 " .ti -1c .in -1c .SH "Detailed Description" .PP 此库的主要功能是提供OCR文字识别接口和类 .SH "Function Documentation" .PP .SS "std::vector kdk::kdkOCR::getCls (const std::string & imagePath, int nums)" .PP 获取文字内容 .PP \fBParameters\fP .RS 4 \fIString\fP 图片文件路径 .br \fInums\fP 同时处理的文字栈个数 .RE .PP \fBReturns\fP .RS 4 Vector 图片中的文字字符串 .RE .PP .PP Referenced by getCls()\&. .SS "std::vector > > kdk::kdkOCR::getRect (const std::string & imagePath)" .PP 获取文字框 .PP \fBParameters\fP .RS 4 \fIString\fP 图片文件路径 .RE .PP \fBReturns\fP .RS 4 Vector 文字框点的坐标矩阵、以及文字框的个数 .RE .PP .PP Referenced by getRect()\&. .SH "Author" .PP Generated automatically by Doxygen for libkyocr.hpp from the source code\&. libkysdk-system/man/kdkocr/getCls.30000664000175000017500000000256515171302542016203 0ustar fengfeng.TH "getCls" 3 "Wed Sep 20 2023" "My Project" \" -*- nroff -*- .ad l .nh .SH NAME getCls - 获取文字内容 .SH SYNOPSIS .nf .B #include .sp .SS "Classes" .in +1c .ti -1c .RI "class \fBkdk::kdkOCR\fP" .in -1c .sp .SS "Functions" .in +1c .ti -1c .RI "std::vector getCls(const std::string &imagePath, int nums);" .in -1c .sp Link with \fI\-lkyocr\fP. .SH "Detailed Description" The main function of the interface is to obtain text content. .PP The argument .I imagePath is the image file path. .PP The argument .I nums is the number of text stacks processed simultaneously. .SH "RETURN VALUE" Returns the text string in the image of type .BR std::vector. .SH EXAMPLES .EX #include "libkyocr.hpp" #include "iostream" using namespace kdk; int main(){ std::string path = "./222.png"; std::string path2 = "./sdsd.png"; std::string path3 = "./222.jpg"; kdkOCR kd1; //std::cout<<"aaaaaaaa"; std::vector result; result=kd1.getCls(path3,4); std::cout< .sp .BI "extern char** kdk_get_disklist();" .sp .BI "extern void kdk_free_disklist(char** "disklist ");" .sp .BI "extern kdk_diskinfo *kdk_get_diskinfo(const char *"diskname ");" .sp .BI "extern char** kdk_get_hard_disk();" .sp .BI "extern char* kdk_get_hard_disk_size(const char *"hardname ");" .sp .BI "extern char* kdk_get_hard_fwrev(const char *"hardname ");" .sp .BI "extern char* kdk_get_hard_type(const char "*hardname ");" .sp .BI "extern char* kdk_get_hard_model(const char *"hardname ");" .sp .BI "extern char* kdk_get_hard_serial(const char *"hardname ");" .sp .BI "extern char* kdk_get_hard_vendor(const char *"hardname ");" .sp .BI "extern void kdk_free_diskinfo(kdk_diskinfo *"disk ");" .sp Link with \fI\-lkydiskinfo\fP. .SH "Detailed Description" This library contains disk information. .SH DATA STRUCTURES Structure \fBkdk_diskinfo\fR contains information related to a disk: \fBtypedef struct _kdk_diskinfo { .br char *name; // 绝对路径 char *vendor; // 制造商 char *model; // 型号 char *serial; // 序列号 kdk_disk_type disk_type; // 磁盘类型,固态 or 机械 or 混合 kdk_disk_interface_type inter_type; // 接口类型 unsigned int rpm; // 转速,注意固态是没有转速概念的 unsigned long long sectors_num; // 扇区数量 unsigned int sector_size; // 每个扇区的字节数 float total_size_MiB; // 磁盘容量,MiB为单位 unsigned int partition_nums; // 该磁盘/分区下的子分区数量 char *uuid; // UUID short mounted; // 是否已挂载 char *mount_path; // 挂载路径 kdk_disk_format format; // 格式化类型 kdk_disk_partition_type part_type; // 分区类型 char *fwrev; //固件版本信息 .br }kdk_diskinfo;\fP There are other members not documented here, which are only meant for libkydiskinfo internal use. .SH "RETURN VALUE" The return value is generally specific to the individual function called. .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_disklist (), .BR kdk_get_diskinfo (), .BR kdk_get_hard_disk (), and .BR kdk_get_hard_disk_size (). .SH "SEE ALSO" .BR kdk_free_disklist (3), .BR kdk_get_diskinfo (3), .BR kdk_free_diskinfo (3) .BR kdk_get_disklist (3)libkysdk-system/man/disk/kdk_get_hard_disk_size.30000664000175000017500000000637715171302542021116 0ustar fengfeng.TH "KDK_GET_HARD_DISK_SIZE" 3 "Thu Aug 10 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_hard_disk_size - 获取硬盘大小 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_get_hard_disk_size(const char *"diskname ");" .sp Link with \fI\-lkydiskinfo\fP. .SH "Detailed Description" Based on the specified disk name .I diskname, such as absolute path such as .I /dev/sda, or .BR kdk_get_hard_disk() function returns an element in the value to obtain hard disk size information. .SH "RETURN VALUE" On success, returns the hard disk size of type char*, in MIB; The returned string needs to be released by .I free .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydiskinfo.h" #include #include static void display_disk_info(kdk_diskinfo *di) { printf("---------------%s------------------\n", di->name); printf("Disk Sectors:\t%llu\n", di->sectors_num); printf("Disk Sector Size:\t%u\n", di->sector_size); printf("Disk Size:\t%f MiB\n", di->total_size_MiB); printf("Disk Model:\t%s\n", di->model ? di->model : "None"); printf("Disk Serial:\t%s\n", di->serial ? di->serial : "None"); printf("Disk Partition Number:\t%u\n", di->partition_nums); printf("Disk Type:\t%d\n", di->disk_type); printf("Disk fwrev:\t%s\n", di->fwrev); } static void display_disk_list(char **disklist) { int count = 0; while (disklist[count]) { printf("No. %d\t %s\n", count + 1, disklist[count]); count ++; } } int main() { char **disklist = kdk_get_disklist(); // display_disk_list(disklist); for (int i = 0; disklist[i]; i++) { kdk_diskinfo *sdainfo = kdk_get_diskinfo(disklist[i]); if (!sdainfo) { printf("[%s]Get disk info error.\n", disklist[i]); continue; } display_disk_info(sdainfo); kdk_free_diskinfo(sdainfo); } kdk_free_disklist(disklist); char **di = kdk_get_hard_disk(); size_t num = 0; while (di[num]) { printf("No. %ld\t %s\n", num + 1, di[num]); char *res = kdk_get_hard_disk_size(di[num]); printf("容量 = %s\n", res); free(res); res = kdk_get_hard_fwrev(di[num]); printf("固态版本 = %s\n", res); free(res); res = kdk_get_hard_vendor(di[num]); printf("厂商 = %s\n", res); free(res); res = kdk_get_hard_type(di[num]); printf("类型 = %s\n", res); free(res); res = kdk_get_hard_model(di[num]); printf("型号 = %s\n", res); free(res); res =kdk_get_hard_serial(di[num]); printf("序列号 = %s\n", res); free(res); num ++; } kdk_free_disklist(di); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_hard_disk (), .BR kdk_free_disklist (), .BR kdk_get_hard_fwrev (), .BR kdk_get_hard_type (), .BR kdk_get_hard_model (), .BR kdk_get_hard_serial (), and .BR kdk_get_hard_vendor (). .SH "SEE ALSO" .BR kdk_free_disklist (3), .BR kdk_get_hard_fwrev (3), .BR kdk_get_hard_type (3), .BR kdk_get_hard_model (3), .BR kdk_get_hard_serial (3), .BR kdk_get_hard_vendor (3), .BR kdk_get_hard_disk (3).libkysdk-system/man/disk/kdk_get_hard_model.30000664000175000017500000000635415171302542020225 0ustar fengfeng.TH "KDK_GET_HARD_MODEL" 3 "Thu Aug 10 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_hard_model - 获取硬盘型号 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_get_hard_model(const char *"diskname ");" .sp Link with \fI\-lkydiskinfo\fP. .SH "Detailed Description" Based on the specified disk name .I diskname, such as absolute path such as .I /dev/sda, or .BR kdk_get_hard_disk() function returns an element in the value to obtain hard drive model information. .SH "RETURN VALUE" On success, Returns the model of hard drive; The returned string needs to be released by .I free .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydiskinfo.h" #include #include static void display_disk_info(kdk_diskinfo *di) { printf("---------------%s------------------\n", di->name); printf("Disk Sectors:\t%llu\n", di->sectors_num); printf("Disk Sector Size:\t%u\n", di->sector_size); printf("Disk Size:\t%f MiB\n", di->total_size_MiB); printf("Disk Model:\t%s\n", di->model ? di->model : "None"); printf("Disk Serial:\t%s\n", di->serial ? di->serial : "None"); printf("Disk Partition Number:\t%u\n", di->partition_nums); printf("Disk Type:\t%d\n", di->disk_type); printf("Disk fwrev:\t%s\n", di->fwrev); } static void display_disk_list(char **disklist) { int count = 0; while (disklist[count]) { printf("No. %d\t %s\n", count + 1, disklist[count]); count ++; } } int main() { char **disklist = kdk_get_disklist(); // display_disk_list(disklist); for (int i = 0; disklist[i]; i++) { kdk_diskinfo *sdainfo = kdk_get_diskinfo(disklist[i]); if (!sdainfo) { printf("[%s]Get disk info error.\n", disklist[i]); continue; } display_disk_info(sdainfo); kdk_free_diskinfo(sdainfo); } kdk_free_disklist(disklist); char **di = kdk_get_hard_disk(); size_t num = 0; while (di[num]) { printf("No. %ld\t %s\n", num + 1, di[num]); char *res = kdk_get_hard_disk_size(di[num]); printf("容量 = %s\n", res); free(res); res = kdk_get_hard_fwrev(di[num]); printf("固态版本 = %s\n", res); free(res); res = kdk_get_hard_vendor(di[num]); printf("厂商 = %s\n", res); free(res); res = kdk_get_hard_type(di[num]); printf("类型 = %s\n", res); free(res); res = kdk_get_hard_model(di[num]); printf("型号 = %s\n", res); free(res); res =kdk_get_hard_serial(di[num]); printf("序列号 = %s\n", res); free(res); num ++; } kdk_free_disklist(di); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_hard_disk (), .BR kdk_free_disklist (), .BR kdk_get_hard_disk_size (), .BR kdk_get_hard_fwrev (), .BR kdk_get_hard_type (), .BR kdk_get_hard_serial (), and .BR kdk_get_hard_vendor (). .SH "SEE ALSO" .BR kdk_free_disklist (3), .BR kdk_get_hard_disk_size (3), .BR kdk_get_hard_fwrev (3), .BR kdk_get_hard_type (3), .BR kdk_get_hard_serial (3), .BR kdk_get_hard_vendor (3), .BR kdk_get_hard_disk (3).libkysdk-system/man/disk/kdk_get_hard_type.30000664000175000017500000000640215171302542020100 0ustar fengfeng.TH "KDK_GET_HARD_TYPE" 3 "Thu Aug 10 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_hard_type - 获取硬盘类型 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_get_hard_type(const char *"diskname ");" .sp Link with \fI\-lkydiskinfo\fP. .SH "Detailed Description" Based on the specified disk name .I diskname, such as absolute path such as .I /dev/sda, or .BR kdk_get_hard_disk() function returns an element in the value to obtain hard disk type information. .SH "RETURN VALUE" On success, Returns the type of hard drive, such as 机械 or 固态; The returned string needs to be released by .I free .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydiskinfo.h" #include #include static void display_disk_info(kdk_diskinfo *di) { printf("---------------%s------------------\n", di->name); printf("Disk Sectors:\t%llu\n", di->sectors_num); printf("Disk Sector Size:\t%u\n", di->sector_size); printf("Disk Size:\t%f MiB\n", di->total_size_MiB); printf("Disk Model:\t%s\n", di->model ? di->model : "None"); printf("Disk Serial:\t%s\n", di->serial ? di->serial : "None"); printf("Disk Partition Number:\t%u\n", di->partition_nums); printf("Disk Type:\t%d\n", di->disk_type); printf("Disk fwrev:\t%s\n", di->fwrev); } static void display_disk_list(char **disklist) { int count = 0; while (disklist[count]) { printf("No. %d\t %s\n", count + 1, disklist[count]); count ++; } } int main() { char **disklist = kdk_get_disklist(); // display_disk_list(disklist); for (int i = 0; disklist[i]; i++) { kdk_diskinfo *sdainfo = kdk_get_diskinfo(disklist[i]); if (!sdainfo) { printf("[%s]Get disk info error.\n", disklist[i]); continue; } display_disk_info(sdainfo); kdk_free_diskinfo(sdainfo); } kdk_free_disklist(disklist); char **di = kdk_get_hard_disk(); size_t num = 0; while (di[num]) { printf("No. %ld\t %s\n", num + 1, di[num]); char *res = kdk_get_hard_disk_size(di[num]); printf("容量 = %s\n", res); free(res); res = kdk_get_hard_fwrev(di[num]); printf("固态版本 = %s\n", res); free(res); res = kdk_get_hard_vendor(di[num]); printf("厂商 = %s\n", res); free(res); res = kdk_get_hard_type(di[num]); printf("类型 = %s\n", res); free(res); res = kdk_get_hard_model(di[num]); printf("型号 = %s\n", res); free(res); res =kdk_get_hard_serial(di[num]); printf("序列号 = %s\n", res); free(res); num ++; } kdk_free_disklist(di); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_hard_disk (), .BR kdk_free_disklist (), .BR kdk_get_hard_disk_size (), .BR kdk_get_hard_fwrev (), .BR kdk_get_hard_model (), .BR kdk_get_hard_serial (), and .BR kdk_get_hard_vendor (). .SH "SEE ALSO" .BR kdk_free_disklist (3), .BR kdk_get_hard_disk_size (3), .BR kdk_get_hard_fwrev (3), .BR kdk_get_hard_model (3), .BR kdk_get_hard_serial (3), .BR kdk_get_hard_vendor (3), .BR kdk_get_hard_disk (3).libkysdk-system/man/disk/kdk_get_hard_vendor.30000664000175000017500000000637615171302542020426 0ustar fengfeng.TH "KDK_GET_HARD_VENDOR" 3 "Thu Aug 10 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_hard_vendor - 获取硬盘序列号 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_get_hard_vendor(const char *"diskname ");" .sp Link with \fI\-lkydiskinfo\fP. .SH "Detailed Description" Based on the specified disk name .I diskname, such as absolute path such as .I /dev/sda, or .BR kdk_get_hard_disk() function returns an element in the value to obtain hard drive manufacturer information. .SH "RETURN VALUE" On success, Returns the manufacturer of hard drive; The returned string needs to be released by .I free .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydiskinfo.h" #include #include static void display_disk_info(kdk_diskinfo *di) { printf("---------------%s------------------\n", di->name); printf("Disk Sectors:\t%llu\n", di->sectors_num); printf("Disk Sector Size:\t%u\n", di->sector_size); printf("Disk Size:\t%f MiB\n", di->total_size_MiB); printf("Disk Model:\t%s\n", di->model ? di->model : "None"); printf("Disk Serial:\t%s\n", di->serial ? di->serial : "None"); printf("Disk Partition Number:\t%u\n", di->partition_nums); printf("Disk Type:\t%d\n", di->disk_type); printf("Disk fwrev:\t%s\n", di->fwrev); } static void display_disk_list(char **disklist) { int count = 0; while (disklist[count]) { printf("No. %d\t %s\n", count + 1, disklist[count]); count ++; } } int main() { char **disklist = kdk_get_disklist(); // display_disk_list(disklist); for (int i = 0; disklist[i]; i++) { kdk_diskinfo *sdainfo = kdk_get_diskinfo(disklist[i]); if (!sdainfo) { printf("[%s]Get disk info error.\n", disklist[i]); continue; } display_disk_info(sdainfo); kdk_free_diskinfo(sdainfo); } kdk_free_disklist(disklist); char **di = kdk_get_hard_disk(); size_t num = 0; while (di[num]) { printf("No. %ld\t %s\n", num + 1, di[num]); char *res = kdk_get_hard_disk_size(di[num]); printf("容量 = %s\n", res); free(res); res = kdk_get_hard_fwrev(di[num]); printf("固态版本 = %s\n", res); free(res); res = kdk_get_hard_vendor(di[num]); printf("厂商 = %s\n", res); free(res); res = kdk_get_hard_type(di[num]); printf("类型 = %s\n", res); free(res); res = kdk_get_hard_model(di[num]); printf("型号 = %s\n", res); free(res); res =kdk_get_hard_serial(di[num]); printf("序列号 = %s\n", res); free(res); num ++; } kdk_free_disklist(di); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_hard_disk (), .BR kdk_free_disklist (), .BR kdk_get_hard_disk_size (), .BR kdk_get_hard_fwrev (), .BR kdk_get_hard_type (), .BR kdk_get_hard_model (), and .BR kdk_get_hard_serial (). .SH "SEE ALSO" .BR kdk_free_disklist (3), .BR kdk_get_hard_disk_size (3), .BR kdk_get_hard_fwrev (3), .BR kdk_get_hard_type (3), .BR kdk_get_hard_model (3), .BR kdk_get_hard_serial (3), .BR kdk_get_hard_disk (3).libkysdk-system/man/disk/kdk_get_disklist.30000664000175000017500000000224115171302542017744 0ustar fengfeng.TH "KDK_GET_DISKLISK" 3 "Thu Aug 10 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_disklist - 获取磁盘列表信息 .SH SYNOPSIS .nf .B #include .sp .BI "extern char** kdk_get_disklist();" .sp Link with \fI\-lkydiskinfo\fP. .SH "Detailed Description" The .BR kdk_get_disklist() function obtains disk list information during the call process. .SH "RETURN VALUE" The return value is a char** type, with each string representing the absolute path of a disk and ending with a NULL character. .PP After completion, .BR kdk_free_disklist() function releases a list of disk information. .SH EXAMPLES .EX #include "libkydiskinfo.h" #include int main() { char **disklist = kdk_get_disklist(); for (int i = 0; disklist[i]; i ++) { printf("%s\n", disklist[i]); } kdk_free_disklist(disklist); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_diskinfo (), .BR kdk_get_hard_disk (), and .BR kdk_get_hard_disk_size (). .SH "SEE ALSO" .BR kdk_free_disklist (3), .BR kdk_get_diskinfo (3), .BR kdk_free_diskinfo (3)libkysdk-system/man/disk/kdk_get_hard_disk.30000664000175000017500000000640715171302542020056 0ustar fengfeng.TH "KDK_GET_HARD_DISK" 3 "Thu Aug 10 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_hard_disk - 获取系统接入所有硬盘 .SH SYNOPSIS .nf .B #include .sp .BI "extern char** kdk_get_hard_disk();" .sp Link with \fI\-lkydiskinfo\fP. .SH "Detailed Description" The .BR kdk_get_hard_disk() function obtains the system access hard disk list information during the call process. .SH "RETURN VALUE" The return value is a char** type, with each string representing the absolute path of a disk and ending with a NULL character. .PP After completion, .BR kdk_free_disklist() function releases a list of disk information. .SH EXAMPLES .EX #include "libkydiskinfo.h" #include #include static void display_disk_info(kdk_diskinfo *di) { printf("---------------%s------------------\n", di->name); printf("Disk Sectors:\t%llu\n", di->sectors_num); printf("Disk Sector Size:\t%u\n", di->sector_size); printf("Disk Size:\t%f MiB\n", di->total_size_MiB); printf("Disk Model:\t%s\n", di->model ? di->model : "None"); printf("Disk Serial:\t%s\n", di->serial ? di->serial : "None"); printf("Disk Partition Number:\t%u\n", di->partition_nums); printf("Disk Type:\t%d\n", di->disk_type); printf("Disk fwrev:\t%s\n", di->fwrev); } static void display_disk_list(char **disklist) { int count = 0; while (disklist[count]) { printf("No. %d\t %s\n", count + 1, disklist[count]); count ++; } } int main() { char **disklist = kdk_get_disklist(); // display_disk_list(disklist); for (int i = 0; disklist[i]; i++) { kdk_diskinfo *sdainfo = kdk_get_diskinfo(disklist[i]); if (!sdainfo) { printf("[%s]Get disk info error.\n", disklist[i]); continue; } display_disk_info(sdainfo); kdk_free_diskinfo(sdainfo); } kdk_free_disklist(disklist); char **di = kdk_get_hard_disk(); size_t num = 0; while (di[num]) { printf("No. %ld\t %s\n", num + 1, di[num]); char *res = kdk_get_hard_disk_size(di[num]); printf("容量 = %s\n", res); free(res); res = kdk_get_hard_fwrev(di[num]); printf("固态版本 = %s\n", res); free(res); res = kdk_get_hard_vendor(di[num]); printf("厂商 = %s\n", res); free(res); res = kdk_get_hard_type(di[num]); printf("类型 = %s\n", res); free(res); res = kdk_get_hard_model(di[num]); printf("型号 = %s\n", res); free(res); res =kdk_get_hard_serial(di[num]); printf("序列号 = %s\n", res); free(res); num ++; } kdk_free_disklist(di); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_free_disklist (), .BR kdk_get_hard_fwrev (), .BR kdk_get_hard_type (), .BR kdk_get_hard_model (), .BR kdk_get_hard_serial (), .BR kdk_get_hard_disk_size (), .BR kdk_get_hard_vendor (), and .BR kdk_get_hard_disk_size (). .SH "SEE ALSO" .BR kdk_free_disklist (3), .BR kdk_get_hard_fwrev (3), .BR kdk_get_hard_type (3), .BR kdk_get_hard_model (3), .BR kdk_get_hard_serial (3), .BR kdk_get_hard_vendor (3), .BR kdk_get_hard_disk_size (3).libkysdk-system/man/disk/kdk_get_hard_serial.30000664000175000017500000000640015171302542020374 0ustar fengfeng.TH "KDK_GET_HARD_SERIAL" 3 "Thu Aug 10 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_hard_serial - 获取硬盘序列号 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_get_hard_serial(const char *"diskname ");" .sp Link with \fI\-lkydiskinfo\fP. .SH "Detailed Description" Based on the specified disk name .I diskname, such as absolute path such as .I /dev/sda, or .BR kdk_get_hard_disk() function returns an element in the value to obtain hard drive serial number information. .SH "RETURN VALUE" On success, Returns the serial number of hard drive; The returned string needs to be released by .I free .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydiskinfo.h" #include #include static void display_disk_info(kdk_diskinfo *di) { printf("---------------%s------------------\n", di->name); printf("Disk Sectors:\t%llu\n", di->sectors_num); printf("Disk Sector Size:\t%u\n", di->sector_size); printf("Disk Size:\t%f MiB\n", di->total_size_MiB); printf("Disk Model:\t%s\n", di->model ? di->model : "None"); printf("Disk Serial:\t%s\n", di->serial ? di->serial : "None"); printf("Disk Partition Number:\t%u\n", di->partition_nums); printf("Disk Type:\t%d\n", di->disk_type); printf("Disk fwrev:\t%s\n", di->fwrev); } static void display_disk_list(char **disklist) { int count = 0; while (disklist[count]) { printf("No. %d\t %s\n", count + 1, disklist[count]); count ++; } } int main() { char **disklist = kdk_get_disklist(); // display_disk_list(disklist); for (int i = 0; disklist[i]; i++) { kdk_diskinfo *sdainfo = kdk_get_diskinfo(disklist[i]); if (!sdainfo) { printf("[%s]Get disk info error.\n", disklist[i]); continue; } display_disk_info(sdainfo); kdk_free_diskinfo(sdainfo); } kdk_free_disklist(disklist); char **di = kdk_get_hard_disk(); size_t num = 0; while (di[num]) { printf("No. %ld\t %s\n", num + 1, di[num]); char *res = kdk_get_hard_disk_size(di[num]); printf("容量 = %s\n", res); free(res); res = kdk_get_hard_fwrev(di[num]); printf("固态版本 = %s\n", res); free(res); res = kdk_get_hard_vendor(di[num]); printf("厂商 = %s\n", res); free(res); res = kdk_get_hard_type(di[num]); printf("类型 = %s\n", res); free(res); res = kdk_get_hard_model(di[num]); printf("型号 = %s\n", res); free(res); res =kdk_get_hard_serial(di[num]); printf("序列号 = %s\n", res); free(res); num ++; } kdk_free_disklist(di); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_hard_disk (), .BR kdk_free_disklist (), .BR kdk_get_hard_disk_size (), .BR kdk_get_hard_fwrev (), .BR kdk_get_hard_type (), .BR kdk_get_hard_model (), and .BR kdk_get_hard_vendor (). .SH "SEE ALSO" .BR kdk_free_disklist (3), .BR kdk_get_hard_disk_size (3), .BR kdk_get_hard_fwrev (3), .BR kdk_get_hard_type (3), .BR kdk_get_hard_model (3), .BR kdk_get_hard_vendor (3), .BR kdk_get_hard_disk (3).libkysdk-system/man/disk/kdk_get_hard_fwrev.30000664000175000017500000000642215171302542020252 0ustar fengfeng.TH "KDK_GET_HARD_FWREV" 3 "Thu Aug 10 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_hard_fwrev - 获取硬盘固态版本 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_get_hard_fwrev(const char *"diskname ");" .sp Link with \fI\-lkydiskinfo\fP. .SH "Detailed Description" Based on the specified disk name .I diskname, such as absolute path such as .I /dev/sda, or .BR kdk_get_hard_disk() function returns an element in the value to obtain the firmware version information of the hard drive. .SH "RETURN VALUE" On success, return to the hard drive firmware version; The returned string needs to be released by .I free .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkydiskinfo.h" #include #include static void display_disk_info(kdk_diskinfo *di) { printf("---------------%s------------------\n", di->name); printf("Disk Sectors:\t%llu\n", di->sectors_num); printf("Disk Sector Size:\t%u\n", di->sector_size); printf("Disk Size:\t%f MiB\n", di->total_size_MiB); printf("Disk Model:\t%s\n", di->model ? di->model : "None"); printf("Disk Serial:\t%s\n", di->serial ? di->serial : "None"); printf("Disk Partition Number:\t%u\n", di->partition_nums); printf("Disk Type:\t%d\n", di->disk_type); printf("Disk fwrev:\t%s\n", di->fwrev); } static void display_disk_list(char **disklist) { int count = 0; while (disklist[count]) { printf("No. %d\t %s\n", count + 1, disklist[count]); count ++; } } int main() { char **disklist = kdk_get_disklist(); // display_disk_list(disklist); for (int i = 0; disklist[i]; i++) { kdk_diskinfo *sdainfo = kdk_get_diskinfo(disklist[i]); if (!sdainfo) { printf("[%s]Get disk info error.\n", disklist[i]); continue; } display_disk_info(sdainfo); kdk_free_diskinfo(sdainfo); } kdk_free_disklist(disklist); char **di = kdk_get_hard_disk(); size_t num = 0; while (di[num]) { printf("No. %ld\t %s\n", num + 1, di[num]); char *res = kdk_get_hard_disk_size(di[num]); printf("容量 = %s\n", res); free(res); res = kdk_get_hard_fwrev(di[num]); printf("固态版本 = %s\n", res); free(res); res = kdk_get_hard_vendor(di[num]); printf("厂商 = %s\n", res); free(res); res = kdk_get_hard_type(di[num]); printf("类型 = %s\n", res); free(res); res = kdk_get_hard_model(di[num]); printf("型号 = %s\n", res); free(res); res =kdk_get_hard_serial(di[num]); printf("序列号 = %s\n", res); free(res); num ++; } kdk_free_disklist(di); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_hard_disk (), .BR kdk_free_disklist (), .BR kdk_get_hard_disk_size (), .BR kdk_get_hard_type (), .BR kdk_get_hard_model (), .BR kdk_get_hard_serial (), and .BR kdk_get_hard_vendor (). .SH "SEE ALSO" .BR kdk_free_disklist (3), .BR kdk_get_hard_disk_size (3), .BR kdk_get_hard_type (3), .BR kdk_get_hard_model (3), .BR kdk_get_hard_serial (3), .BR kdk_get_hard_vendor (3), .BR kdk_get_hard_disk (3).libkysdk-system/man/disk/kdk_get_diskinfo.30000664000175000017500000000751015171302542017730 0ustar fengfeng.TH "KDK_GET_DISKINFO" 3 "Thu Aug 10 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_diskinfo - 获取指定磁盘的磁盘信息 .SH SYNOPSIS .nf .B #include .sp .BI "extern kdk_diskinfo *kdk_get_diskinfo(const char *"diskname ");" .sp Link with \fI\-lkydiskinfo\fP. .SH "Detailed Description" Based on the specified disk name .I diskname, such as absolute path such as .I /dev/sda, or .BR kdk_get_disklist() function returns an element from a value to obtain disk information. .SH "RETURN VALUE" kdk_diskinfo is a structure that stores disk information, as follows: typedef struct _kdk_diskinfo{ char *name; // 绝对路径 char *vendor; // 制造商 char *model; // 型号 char *serial; // 序列号 kdk_disk_type disk_type; // 磁盘类型,固态 or 机械 or 混合 kdk_disk_interface_type inter_type; // 接口类型 unsigned int rpm; // 转速,注意固态是没有转速概念的 unsigned long long sectors_num; // 扇区数量 unsigned int sector_size; // 每个扇区的字节数 float total_size_MiB; // 磁盘容量,MiB为单位 unsigned int partition_nums; // 该磁盘/分区下的子分区数量 char *uuid; // UUID short mounted; // 是否已挂载 char *mount_path; // 挂载路径 kdk_disk_format format; // 格式化类型 kdk_disk_partition_type part_type; // 分区类型 char *fwrev; //固件版本信息 }kdk_diskinfo; .SH EXAMPLES .EX #include "libkydiskinfo.h" #include #include static void display_disk_info(kdk_diskinfo *di) { printf("---------------%s------------------\n", di->name); printf("Disk Sectors:\t%llu\n", di->sectors_num); printf("Disk Sector Size:\t%u\n", di->sector_size); printf("Disk Size:\t%f MiB\n", di->total_size_MiB); printf("Disk Model:\t%s\n", di->model ? di->model : "None"); printf("Disk Serial:\t%s\n", di->serial ? di->serial : "None"); printf("Disk Partition Number:\t%u\n", di->partition_nums); printf("Disk Type:\t%d\n", di->disk_type); printf("Disk fwrev:\t%s\n", di->fwrev); } static void display_disk_list(char **disklist) { int count = 0; while (disklist[count]) { printf("No. %d\t %s\n", count + 1, disklist[count]); count ++; } } int main() { char **disklist = kdk_get_disklist(); // display_disk_list(disklist); for (int i = 0; disklist[i]; i++) { kdk_diskinfo *sdainfo = kdk_get_diskinfo(disklist[i]); if (!sdainfo) { printf("[%s]Get disk info error.\n", disklist[i]); continue; } display_disk_info(sdainfo); kdk_free_diskinfo(sdainfo); } kdk_free_disklist(disklist); char **di = kdk_get_hard_disk(); size_t num = 0; while (di[num]) { printf("No. %ld\t %s\n", num + 1, di[num]); char *res = kdk_get_hard_disk_size(di[num]); printf("容量 = %s\n", res); free(res); res = kdk_get_hard_fwrev(di[num]); printf("固态版本 = %s\n", res); free(res); res = kdk_get_hard_vendor(di[num]); printf("厂商 = %s\n", res); free(res); res = kdk_get_hard_type(di[num]); printf("类型 = %s\n", res); free(res); res = kdk_get_hard_model(di[num]); printf("型号 = %s\n", res); free(res); res =kdk_get_hard_serial(di[num]); printf("序列号 = %s\n", res); free(res); num ++; } kdk_free_disklist(di); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_disklist (), .BR kdk_get_hard_disk (), and .BR kdk_get_hard_disk_size (). .SH "SEE ALSO" .BR kdk_get_disklist (3), .BR kdk_free_disklist (3), .BR kdk_free_diskinfo (3)libkysdk-system/man/disk/kdk_free_disklist.30000664000175000017500000000206315171302542020110 0ustar fengfeng.TH "KDK_FREE_DISKLIST" 3 "Thu Aug 10 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_disklist - 释放由kdk_get_disklist返回的磁盘列表 .SH SYNOPSIS .nf .B #include .sp .BI "extern void kdk_free_disklist(char** "disklist ");" .sp Link with \fI\-lkydiskinfo\fP. .SH "Detailed Description" The main function of the interface is to recycle a list of strings of type char **; .PP The argument .I ptr is a list of strings of type char **. .SH "RETURN VALUE" No return value .SH EXAMPLES .EX #include "libkydiskinfo.h" #include int main() { char **disklist = kdk_get_disklist(); for (int i = 0; disklist[i]; i ++) { printf("%s\n", disklist[i]); } kdk_free_disklist(disklist); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_diskinfo (), .BR kdk_get_hard_disk (), and .BR kdk_get_hard_disk_size (). .SH "SEE ALSO" .BR kdk_get_disklist (3), .BR kdk_get_diskinfo (3), .BR kdk_free_diskinfo (3)libkysdk-system/man/proc/0000775000175000017500000000000015171302542014354 5ustar fengfenglibkysdk-system/man/proc/kdk_rti_get_mem_res_free_KiB.30000664000175000017500000000523515171302542022170 0ustar fengfeng.TH "KDK_RTI_GET_MEM_RES_FREE_KIB" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_rti_get_mem_res_free_KiB - 获取实际空闲的物理内存大小 .SH SYNOPSIS .nf .B #include .sp .BI "extern unsigned long kdk_rti_get_mem_res_free_KiB();" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the actual amount of physical memory that is free, and note that Buffer/Cache is counted as used memory. .SH "RETURN VALUE" On success, returns the size of free physical memory of type unsigned long; The unit is KiB. .PP On error, return .BR 0. .SH EXAMPLES .EX #include "libkyrtinfo.h" #include int main() { printf("内存总大小:%lu KiB\n", kdk_rti_get_mem_res_total_KiB()); printf("当前已用内存:%lu KiB,%f\n", kdk_rti_get_mem_res_usage_KiB(), kdk_rti_get_mem_res_usage_percent()); printf("当前空闲内存:%lu KiB\n", kdk_rti_get_mem_res_free_KiB()); printf("可用内存大小:%lu KiB\n", kdk_rti_get_mem_res_available_KiB()); printf("应用总申请虚拟内存大小:%lu KiB\n", kdk_rti_get_mem_virt_alloc_KiB()); printf("交换分区总量:%lu KiB\n", kdk_rti_get_mem_swap_total_KiB()); printf("交换分区已用量:%lu KiB, %f\n", kdk_rti_get_mem_swap_usage_KiB(), kdk_rti_get_mem_swap_usage_percent()); printf("交换分区剩余大小:%lu KiB\n", kdk_rti_get_mem_swap_free_KiB()); printf("当前CPU使用率:%f\n", kdk_rti_get_cpu_current_usage()); unsigned int day, hour, min, sec; kdk_rti_get_uptime(&day, &hour, &min, &sec); printf("开机时长:%u天%u小时%u分钟%u秒\n", day, hour, min, sec); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_rti_get_mem_res_total_KiB (), .BR kdk_rti_get_mem_res_usage_percent (), .BR kdk_rti_get_mem_res_usage_KiB (), .BR kdk_rti_get_mem_res_available_KiB (), .BR kdk_rti_get_mem_virt_alloc_KiB (), .BR kdk_rti_get_mem_swap_total_KiB (), .BR kdk_rti_get_mem_swap_usage_percent (), .BR kdk_rti_get_mem_swap_usage_KiB (), .BR kdk_rti_get_mem_swap_free_KiB (), .BR kdk_rti_get_cpu_current_usage () and .BR kdk_rti_get_uptime (). .SH "SEE ALSO" .BR kdk_rti_get_mem_res_total_KiB (3), .BR kdk_rti_get_mem_res_usage_percent (3), .BR kdk_rti_get_mem_res_usage_KiB (3), .BR kdk_rti_get_mem_res_available_KiB (3), .BR kdk_rti_get_mem_virt_alloc_KiB (3), .BR kdk_rti_get_mem_swap_total_KiB (), .BR kdk_rti_get_mem_swap_usage_percent (3), .BR kdk_rti_get_mem_swap_usage_KiB (3), .BR kdk_rti_get_mem_swap_free_KiB (3), .BR kdk_rti_get_cpu_current_usage (3) and .BR kdk_rti_get_uptime (3).libkysdk-system/man/proc/kdk_rti_get_cpu_current_usage.30000664000175000017500000000504715171302542022531 0ustar fengfeng.TH "KDK_RTI_GET_CPU_CURRENT_USAGE" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_rti_get_cpu_current_usage - 获取CPU瞬时使用率 .SH SYNOPSIS .nf .B #include .sp .BI "extern float kdk_rti_get_cpu_current_usage();" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the instantaneous CPU usage rate. .SH "RETURN VALUE" On success, returns the instantaneous CPU usage rate of type float. .PP On error, return .BR 0. .SH EXAMPLES .EX #include "libkyrtinfo.h" #include int main() { printf("内存总大小:%lu KiB\n", kdk_rti_get_mem_res_total_KiB()); printf("当前已用内存:%lu KiB,%f\n", kdk_rti_get_mem_res_usage_KiB(), kdk_rti_get_mem_res_usage_percent()); printf("当前空闲内存:%lu KiB\n", kdk_rti_get_mem_res_free_KiB()); printf("可用内存大小:%lu KiB\n", kdk_rti_get_mem_res_available_KiB()); printf("应用总申请虚拟内存大小:%lu KiB\n", kdk_rti_get_mem_virt_alloc_KiB()); printf("交换分区总量:%lu KiB\n", kdk_rti_get_mem_swap_total_KiB()); printf("交换分区已用量:%lu KiB, %f\n", kdk_rti_get_mem_swap_usage_KiB(), kdk_rti_get_mem_swap_usage_percent()); printf("交换分区剩余大小:%lu KiB\n", kdk_rti_get_mem_swap_free_KiB()); printf("当前CPU使用率:%f\n", kdk_rti_get_cpu_current_usage()); unsigned int day, hour, min, sec; kdk_rti_get_uptime(&day, &hour, &min, &sec); printf("开机时长:%u天%u小时%u分钟%u秒\n", day, hour, min, sec); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_rti_get_mem_res_total_KiB (), .BR kdk_rti_get_mem_res_usage_percent (), .BR kdk_rti_get_mem_res_usage_KiB (), .BR kdk_rti_get_mem_res_available_KiB (), .BR kdk_rti_get_mem_res_free_KiB (), .BR kdk_rti_get_mem_virt_alloc_KiB (), .BR kdk_rti_get_mem_swap_total_KiB (), .BR kdk_rti_get_mem_swap_usage_percent (), .BR kdk_rti_get_mem_swap_usage_KiB (), .BR kdk_rti_get_mem_swap_free_KiB () and .BR kdk_rti_get_uptime (). .SH "SEE ALSO" .BR kdk_rti_get_mem_res_total_KiB (3), .BR kdk_rti_get_mem_res_usage_percent (3), .BR kdk_rti_get_mem_res_usage_KiB (3), .BR kdk_rti_get_mem_res_available_KiB (3), .BR kdk_rti_get_mem_res_free_KiB (3), .BR kdk_rti_get_mem_virt_alloc_KiB (), .BR kdk_rti_get_mem_swap_total_KiB (3), .BR kdk_rti_get_mem_swap_usage_percent (3), .BR kdk_rti_get_mem_swap_usage_KiB (3), .BR kdk_rti_get_mem_swap_free_KiB (3) and .BR kdk_rti_get_uptime (3).libkysdk-system/man/proc/kdk_get_process_all_information.30000664000175000017500000000646715171302542023060 0ustar fengfeng.TH "KDK_GET_PROCESS_ALL_INFORMATION" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_process_all_information - 获取系统中所有进程的信息 .SH SYNOPSIS .nf .B #include .sp .BI "extern char** kdk_get_process_all_information();" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain information about all processes in the system. .SH "RETURN VALUE" On success, returns all process information of type char**, ending with a NULL character; Generated by .I alloc and needs to be recycled by .I kdk_proc_freeall . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkyprocess.h" #include #include int main() { char *run_time = kdk_get_process_running_time(841); char *cpu_time = kdk_get_process_cpu_time(841); char *cmd = kdk_get_process_command(841); char *start_time = kdk_get_process_start_time(841); printf("获取某一进程的CPU利用率:%0.1f\n", kdk_get_process_cpu_usage_percent(841)); printf("获取某一进程的内存占用率:%0.1f\n", kdk_get_process_mem_usage_percent(841)); printf("获取某一进程的进程状态:%s\n", kdk_get_process_status(841)); printf("获取某一进程的进程端口号:%d\n", kdk_get_process_port(841)); printf("获取某一进程的启动时间:%s\n", start_time); printf("获取某一进程的运行时间:%s\n", run_time); printf("获取某一进程的CPU时间:%s\n", cpu_time); printf("获取某一进程的Command:%s\n", cmd); printf("获取某一进程的属主:%s\n", kdk_get_process_user(841)); free(run_time); free(cpu_time); free(cmd); free(start_time); char** pid = kdk_procname_get_process_infomation("systemd"); size_t index = 0; while (pid[index]) { printf("pid %s\n", pid[index]); index ++; } kdk_proc_freeall(pid); char** info = kdk_get_process_all_information(); size_t count = 0; while (info[count]) { printf("No. %d\t %s\n", count + 1, info[count]); count ++; } kdk_proc_freeall(info); char *name = kdk_get_process_name(1151571); printf("name = %s\n", name); free(name); int id = kdk_get_process_id("systemd"); printf("pid %d\n", id); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_process_name (), .BR kdk_get_process_id (), .BR kdk_get_process_cpu_usage_percent (), .BR kdk_get_process_mem_usage_percent (), .BR kdk_get_process_status (), .BR kdk_get_process_port (), .BR kdk_get_process_start_time (), .BR kdk_get_process_running_time (), .BR kdk_get_process_cpu_time (), .BR kdk_get_process_command (), .BR kdk_get_process_user (), .BR kdk_procname_get_process_infomation () and .BR kdk_proc_freeall (). .SH "SEE ALSO" .BR kdk_get_process_name (3), .BR kdk_get_process_id (3), .BR kdk_get_process_cpu_usage_percent (3), .BR kdk_get_process_mem_usage_percent (3), .BR kdk_get_process_status (3), .BR kdk_get_process_port (), .BR kdk_get_process_start_time (3), .BR kdk_get_process_running_time (3), .BR kdk_get_process_cpu_time (3), .BR kdk_get_process_command (3), .BR kdk_get_process_user (3), .BR kdk_procname_get_process_infomation (3) and .BR kdk_proc_freeall (3).libkysdk-system/man/proc/kdk_get_process_cpu_usage_percent.30000664000175000017500000000642015171302542023363 0ustar fengfeng.TH "KDK_GET_PROCESS_CPU_USAGE_PERCENT" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_process_cpu_usage_percent - 获取某一进程的CPU使用率 .SH SYNOPSIS .nf .B #include .sp .BI "extern float kdk_get_process_cpu_usage_percent(int "proc_num ");" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the CPU usage of the specified process. .PP The argument .I proc_num is the PID of the process. .SH "RETURN VALUE" On success, returns the CPU usage of the process of type float. .PP On error, return .BR 0.0 .SH EXAMPLES .EX #include "libkyprocess.h" #include #include int main() { char *run_time = kdk_get_process_running_time(841); char *cpu_time = kdk_get_process_cpu_time(841); char *cmd = kdk_get_process_command(841); char *start_time = kdk_get_process_start_time(841); printf("获取某一进程的CPU利用率:%0.1f\n", kdk_get_process_cpu_usage_percent(841)); printf("获取某一进程的内存占用率:%0.1f\n", kdk_get_process_mem_usage_percent(841)); printf("获取某一进程的进程状态:%s\n", kdk_get_process_status(841)); printf("获取某一进程的进程端口号:%d\n", kdk_get_process_port(841)); printf("获取某一进程的启动时间:%s\n", start_time); printf("获取某一进程的运行时间:%s\n", run_time); printf("获取某一进程的CPU时间:%s\n", cpu_time); printf("获取某一进程的Command:%s\n", cmd); printf("获取某一进程的属主:%s\n", kdk_get_process_user(841)); free(run_time); free(cpu_time); free(cmd); free(start_time); char** pid = kdk_procname_get_process_infomation("systemd"); size_t index = 0; while (pid[index]) { printf("pid %s\n", pid[index]); index ++; } kdk_proc_freeall(pid); char** info = kdk_get_process_all_information(); size_t count = 0; while (info[count]) { printf("No. %d\t %s\n", count + 1, info[count]); count ++; } kdk_proc_freeall(info); char *name = kdk_get_process_name(1151571); printf("name = %s\n", name); free(name); int id = kdk_get_process_id("systemd"); printf("pid %d\n", id); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_process_name (), .BR kdk_get_process_id (), .BR kdk_get_process_mem_usage_percent (), .BR kdk_get_process_status (), .BR kdk_get_process_port (), .BR kdk_get_process_start_time (), .BR kdk_get_process_running_time (), .BR kdk_get_process_cpu_time (), .BR kdk_get_process_command (), .BR kdk_get_process_user (), .BR kdk_procname_get_process_infomation (), .BR kdk_get_process_all_information () and .BR kdk_proc_freeall (). .SH "SEE ALSO" .BR kdk_get_process_name (3), .BR kdk_get_process_id (3), .BR kdk_get_process_mem_usage_percent (3), .BR kdk_get_process_status (3), .BR kdk_get_process_port (3), .BR kdk_get_process_start_time (), .BR kdk_get_process_running_time (3), .BR kdk_get_process_cpu_time (3), .BR kdk_get_process_command (3), .BR kdk_get_process_user (3), .BR kdk_procname_get_process_infomation (3), .BR kdk_get_process_all_information (3) and .BR kdk_proc_freeall (3).libkysdk-system/man/proc/kdk_get_process_port.30000664000175000017500000000642515171302542020661 0ustar fengfeng.TH "KDK_GET_PROCESS_PORT" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_process_port - 获取某一进程的端口号占用 .SH SYNOPSIS .nf .B #include .sp .BI "extern int kdk_get_process_port(int "proc_num ");" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the port number occupation of the specified process. .PP The argument .I proc_num is the PID of the process. .SH "RETURN VALUE" On success, returns the port number used of the process of type int. .PP On error, return .BR 0. .SH EXAMPLES .EX #include "libkyprocess.h" #include #include int main() { char *run_time = kdk_get_process_running_time(841); char *cpu_time = kdk_get_process_cpu_time(841); char *cmd = kdk_get_process_command(841); char *start_time = kdk_get_process_start_time(841); printf("获取某一进程的CPU利用率:%0.1f\n", kdk_get_process_cpu_usage_percent(841)); printf("获取某一进程的内存占用率:%0.1f\n", kdk_get_process_mem_usage_percent(841)); printf("获取某一进程的进程状态:%s\n", kdk_get_process_status(841)); printf("获取某一进程的进程端口号:%d\n", kdk_get_process_port(841)); printf("获取某一进程的启动时间:%s\n", start_time); printf("获取某一进程的运行时间:%s\n", run_time); printf("获取某一进程的CPU时间:%s\n", cpu_time); printf("获取某一进程的Command:%s\n", cmd); printf("获取某一进程的属主:%s\n", kdk_get_process_user(841)); free(run_time); free(cpu_time); free(cmd); free(start_time); char** pid = kdk_procname_get_process_infomation("systemd"); size_t index = 0; while (pid[index]) { printf("pid %s\n", pid[index]); index ++; } kdk_proc_freeall(pid); char** info = kdk_get_process_all_information(); size_t count = 0; while (info[count]) { printf("No. %d\t %s\n", count + 1, info[count]); count ++; } kdk_proc_freeall(info); char *name = kdk_get_process_name(1151571); printf("name = %s\n", name); free(name); int id = kdk_get_process_id("systemd"); printf("pid %d\n", id); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_process_name (), .BR kdk_get_process_id (), .BR kdk_get_process_cpu_usage_percent (), .BR kdk_get_process_mem_usage_percent (), .BR kdk_get_process_status (), .BR kdk_get_process_start_time (), .BR kdk_get_process_running_time (), .BR kdk_get_process_cpu_time (), .BR kdk_get_process_command (), .BR kdk_get_process_user (), .BR kdk_procname_get_process_infomation (), .BR kdk_get_process_all_information () and .BR kdk_proc_freeall (). .SH "SEE ALSO" .BR kdk_get_process_name (3), .BR kdk_get_process_id (3), .BR kdk_get_process_cpu_usage_percent (3), .BR kdk_get_process_mem_usage_percent (3), .BR kdk_get_process_status (3), .BR kdk_get_process_start_time (), .BR kdk_get_process_running_time (3), .BR kdk_get_process_cpu_time (3), .BR kdk_get_process_command (3), .BR kdk_get_process_user (3), .BR kdk_procname_get_process_infomation (3), .BR kdk_get_process_all_information (3) and .BR kdk_proc_freeall (3).libkysdk-system/man/proc/kdk_get_process_command.30000664000175000017500000000653615171302542021316 0ustar fengfeng.TH "KDK_GET_PROCESS_COMMAND" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_process_command - 获取某一进程的Command .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_get_process_command(int "proc_num ");" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the Command of the specified process. .PP The argument .I proc_num is the PID of the process. .SH "RETURN VALUE" On success, returns the Command of the process of type char*, such as "/lib/systemd/systemd-journald"; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkyprocess.h" #include #include int main() { char *run_time = kdk_get_process_running_time(841); char *cpu_time = kdk_get_process_cpu_time(841); char *cmd = kdk_get_process_command(841); char *start_time = kdk_get_process_start_time(841); printf("获取某一进程的CPU利用率:%0.1f\n", kdk_get_process_cpu_usage_percent(841)); printf("获取某一进程的内存占用率:%0.1f\n", kdk_get_process_mem_usage_percent(841)); printf("获取某一进程的进程状态:%s\n", kdk_get_process_status(841)); printf("获取某一进程的进程端口号:%d\n", kdk_get_process_port(841)); printf("获取某一进程的启动时间:%s\n", start_time); printf("获取某一进程的运行时间:%s\n", run_time); printf("获取某一进程的CPU时间:%s\n", cpu_time); printf("获取某一进程的Command:%s\n", cmd); printf("获取某一进程的属主:%s\n", kdk_get_process_user(841)); free(run_time); free(cpu_time); free(cmd); free(start_time); char** pid = kdk_procname_get_process_infomation("systemd"); size_t index = 0; while (pid[index]) { printf("pid %s\n", pid[index]); index ++; } kdk_proc_freeall(pid); char** info = kdk_get_process_all_information(); size_t count = 0; while (info[count]) { printf("No. %d\t %s\n", count + 1, info[count]); count ++; } kdk_proc_freeall(info); char *name = kdk_get_process_name(1151571); printf("name = %s\n", name); free(name); int id = kdk_get_process_id("systemd"); printf("pid %d\n", id); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_process_name (), .BR kdk_get_process_id (), .BR kdk_get_process_cpu_usage_percent (), .BR kdk_get_process_mem_usage_percent (), .BR kdk_get_process_status (), .BR kdk_get_process_port (), .BR kdk_get_process_start_time (), .BR kdk_get_process_running_time (), .BR kdk_get_process_cpu_time (), .BR kdk_get_process_user (), .BR kdk_procname_get_process_infomation (), .BR kdk_get_process_all_information () and .BR kdk_proc_freeall (). .SH "SEE ALSO" .BR kdk_get_process_name (3), .BR kdk_get_process_id (3), .BR kdk_get_process_cpu_usage_percent (3), .BR kdk_get_process_mem_usage_percent (3), .BR kdk_get_process_status (3), .BR kdk_get_process_port (), .BR kdk_get_process_start_time (3), .BR kdk_get_process_running_time (3), .BR kdk_get_process_cpu_time (3), .BR kdk_get_process_user (3), .BR kdk_procname_get_process_infomation (3), .BR kdk_get_process_all_information (3) and .BR kdk_proc_freeall (3).libkysdk-system/man/proc/kdk_get_process_user.30000664000175000017500000000656715171302542020662 0ustar fengfeng.TH "KDK_GET_PROCESS_USER" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_process_user - 获取某一进程的属主 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_get_process_user(int "proc_num ");" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the name of the user account that started the specified process. .PP The argument .I proc_num is the PID of the process. .SH "RETURN VALUE" On success, returns the name of the user account that started the process of type char*, such as "root"; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkyprocess.h" #include #include int main() { char *run_time = kdk_get_process_running_time(841); char *cpu_time = kdk_get_process_cpu_time(841); char *cmd = kdk_get_process_command(841); char *start_time = kdk_get_process_start_time(841); printf("获取某一进程的CPU利用率:%0.1f\n", kdk_get_process_cpu_usage_percent(841)); printf("获取某一进程的内存占用率:%0.1f\n", kdk_get_process_mem_usage_percent(841)); printf("获取某一进程的进程状态:%s\n", kdk_get_process_status(841)); printf("获取某一进程的进程端口号:%d\n", kdk_get_process_port(841)); printf("获取某一进程的启动时间:%s\n", start_time); printf("获取某一进程的运行时间:%s\n", run_time); printf("获取某一进程的CPU时间:%s\n", cpu_time); printf("获取某一进程的Command:%s\n", cmd); printf("获取某一进程的属主:%s\n", kdk_get_process_user(841)); free(run_time); free(cpu_time); free(cmd); free(start_time); char** pid = kdk_procname_get_process_infomation("systemd"); size_t index = 0; while (pid[index]) { printf("pid %s\n", pid[index]); index ++; } kdk_proc_freeall(pid); char** info = kdk_get_process_all_information(); size_t count = 0; while (info[count]) { printf("No. %d\t %s\n", count + 1, info[count]); count ++; } kdk_proc_freeall(info); char *name = kdk_get_process_name(1151571); printf("name = %s\n", name); free(name); int id = kdk_get_process_id("systemd"); printf("pid %d\n", id); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_process_name (), .BR kdk_get_process_id (), .BR kdk_get_process_cpu_usage_percent (), .BR kdk_get_process_mem_usage_percent (), .BR kdk_get_process_status (), .BR kdk_get_process_port (), .BR kdk_get_process_start_time (), .BR kdk_get_process_running_time (), .BR kdk_get_process_cpu_time (), .BR kdk_get_process_command (), .BR kdk_procname_get_process_infomation (), .BR kdk_get_process_all_information () and .BR kdk_proc_freeall (). .SH "SEE ALSO" .BR kdk_get_process_name (3), .BR kdk_get_process_id (3), .BR kdk_get_process_cpu_usage_percent (3), .BR kdk_get_process_mem_usage_percent (3), .BR kdk_get_process_status (3), .BR kdk_get_process_port (), .BR kdk_get_process_start_time (3), .BR kdk_get_process_running_time (3), .BR kdk_get_process_cpu_time (3), .BR kdk_get_process_command (3), .BR kdk_procname_get_process_infomation (3), .BR kdk_get_process_all_information (3) and .BR kdk_proc_freeall (3).libkysdk-system/man/proc/kdk_rti_get_mem_res_usage_percent.30000664000175000017500000000505515171302542023346 0ustar fengfeng.TH "KDK_RTI_GET_MEM_RES_USAGE_PERCENT" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_rti_get_mem_res_usage_percent - 获取物理内存使用率 .SH SYNOPSIS .nf .B #include .sp .BI "extern float kdk_rti_get_mem_res_usage_percent();" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the physical memory usage rate. .SH "RETURN VALUE" On success, returns the physical memory usage rate of type float. .PP On error, return .BR 0.00. .SH EXAMPLES .EX #include "libkyrtinfo.h" #include int main() { printf("内存总大小:%lu KiB\n", kdk_rti_get_mem_res_total_KiB()); printf("当前已用内存:%lu KiB,%f\n", kdk_rti_get_mem_res_usage_KiB(), kdk_rti_get_mem_res_usage_percent()); printf("当前空闲内存:%lu KiB\n", kdk_rti_get_mem_res_free_KiB()); printf("可用内存大小:%lu KiB\n", kdk_rti_get_mem_res_available_KiB()); printf("应用总申请虚拟内存大小:%lu KiB\n", kdk_rti_get_mem_virt_alloc_KiB()); printf("交换分区总量:%lu KiB\n", kdk_rti_get_mem_swap_total_KiB()); printf("交换分区已用量:%lu KiB, %f\n", kdk_rti_get_mem_swap_usage_KiB(), kdk_rti_get_mem_swap_usage_percent()); printf("交换分区剩余大小:%lu KiB\n", kdk_rti_get_mem_swap_free_KiB()); printf("当前CPU使用率:%f\n", kdk_rti_get_cpu_current_usage()); unsigned int day, hour, min, sec; kdk_rti_get_uptime(&day, &hour, &min, &sec); printf("开机时长:%u天%u小时%u分钟%u秒\n", day, hour, min, sec); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_rti_get_mem_res_total_KiB (), .BR kdk_rti_get_mem_res_usage_KiB (), .BR kdk_rti_get_mem_res_available_KiB (), .BR kdk_rti_get_mem_res_free_KiB (), .BR kdk_rti_get_mem_virt_alloc_KiB (), .BR kdk_rti_get_mem_swap_total_KiB (), .BR kdk_rti_get_mem_swap_usage_percent (), .BR kdk_rti_get_mem_swap_usage_KiB (), .BR kdk_rti_get_mem_swap_free_KiB (), .BR kdk_rti_get_cpu_current_usage () and .BR kdk_rti_get_uptime (). .SH "SEE ALSO" .BR kdk_rti_get_mem_res_total_KiB (3), .BR kdk_rti_get_mem_res_usage_KiB (3), .BR kdk_rti_get_mem_res_available_KiB (3), .BR kdk_rti_get_mem_res_free_KiB (3), .BR kdk_rti_get_mem_virt_alloc_KiB (3), .BR kdk_rti_get_mem_swap_total_KiB (), .BR kdk_rti_get_mem_swap_usage_percent (3), .BR kdk_rti_get_mem_swap_usage_KiB (3), .BR kdk_rti_get_mem_swap_free_KiB (3), .BR kdk_rti_get_cpu_current_usage (3) and .BR kdk_rti_get_uptime (3).libkysdk-system/man/proc/kdk_rti_get_mem_res_available_KiB.30000664000175000017500000000524215171302542023165 0ustar fengfeng.TH "KDK_RTI_GET_MEM_RES_AVAILABLE_KIB" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_rti_get_mem_res_available_KiB - 获取实际可用的物理内存大小 .SH SYNOPSIS .nf .B #include .sp .BI "extern unsigned long kdk_rti_get_mem_res_available_KiB();" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the actual amount of physical memory available, which is approximately equal to Free + Buffer + Cache. .SH "RETURN VALUE" On success, returns the available physical memory size of type unsigned long; The unit is KiB. .PP On error, return .BR 0. .SH EXAMPLES .EX #include "libkyrtinfo.h" #include int main() { printf("内存总大小:%lu KiB\n", kdk_rti_get_mem_res_total_KiB()); printf("当前已用内存:%lu KiB,%f\n", kdk_rti_get_mem_res_usage_KiB(), kdk_rti_get_mem_res_usage_percent()); printf("当前空闲内存:%lu KiB\n", kdk_rti_get_mem_res_free_KiB()); printf("可用内存大小:%lu KiB\n", kdk_rti_get_mem_res_available_KiB()); printf("应用总申请虚拟内存大小:%lu KiB\n", kdk_rti_get_mem_virt_alloc_KiB()); printf("交换分区总量:%lu KiB\n", kdk_rti_get_mem_swap_total_KiB()); printf("交换分区已用量:%lu KiB, %f\n", kdk_rti_get_mem_swap_usage_KiB(), kdk_rti_get_mem_swap_usage_percent()); printf("交换分区剩余大小:%lu KiB\n", kdk_rti_get_mem_swap_free_KiB()); printf("当前CPU使用率:%f\n", kdk_rti_get_cpu_current_usage()); unsigned int day, hour, min, sec; kdk_rti_get_uptime(&day, &hour, &min, &sec); printf("开机时长:%u天%u小时%u分钟%u秒\n", day, hour, min, sec); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_rti_get_mem_res_total_KiB (), .BR kdk_rti_get_mem_res_usage_percent (), .BR kdk_rti_get_mem_res_usage_KiB (), .BR kdk_rti_get_mem_res_free_KiB (), .BR kdk_rti_get_mem_virt_alloc_KiB (), .BR kdk_rti_get_mem_swap_total_KiB (), .BR kdk_rti_get_mem_swap_usage_percent (), .BR kdk_rti_get_mem_swap_usage_KiB (), .BR kdk_rti_get_mem_swap_free_KiB (), .BR kdk_rti_get_cpu_current_usage () and .BR kdk_rti_get_uptime (). .SH "SEE ALSO" .BR kdk_rti_get_mem_res_total_KiB (3), .BR kdk_rti_get_mem_res_usage_percent (3), .BR kdk_rti_get_mem_res_usage_KiB (3), .BR kdk_rti_get_mem_res_free_KiB (3), .BR kdk_rti_get_mem_virt_alloc_KiB (3), .BR kdk_rti_get_mem_swap_total_KiB (), .BR kdk_rti_get_mem_swap_usage_percent (3), .BR kdk_rti_get_mem_swap_usage_KiB (3), .BR kdk_rti_get_mem_swap_free_KiB (3), .BR kdk_rti_get_cpu_current_usage (3) and .BR kdk_rti_get_uptime (3).libkysdk-system/man/proc/kdk_rti_get_mem_swap_total_KiB.30000664000175000017500000000513415171302542022551 0ustar fengfeng.TH "KDK_RTI_GET_MEM_SWAP_TOTAL_KIB" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_rti_get_mem_swap_total_KiB - 获取系统中Swap分区总大小 .SH SYNOPSIS .nf .B #include .sp .BI "extern unsigned long kdk_rti_get_mem_swap_total_KiB();" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the total size of the Swap partition in the system. .SH "RETURN VALUE" On success, returns the Swap partition size of type unsigned long; The unit is KiB. .PP On error, return .BR 0. .SH EXAMPLES .EX #include "libkyrtinfo.h" #include int main() { printf("内存总大小:%lu KiB\n", kdk_rti_get_mem_res_total_KiB()); printf("当前已用内存:%lu KiB,%f\n", kdk_rti_get_mem_res_usage_KiB(), kdk_rti_get_mem_res_usage_percent()); printf("当前空闲内存:%lu KiB\n", kdk_rti_get_mem_res_free_KiB()); printf("可用内存大小:%lu KiB\n", kdk_rti_get_mem_res_available_KiB()); printf("应用总申请虚拟内存大小:%lu KiB\n", kdk_rti_get_mem_virt_alloc_KiB()); printf("交换分区总量:%lu KiB\n", kdk_rti_get_mem_swap_total_KiB()); printf("交换分区已用量:%lu KiB, %f\n", kdk_rti_get_mem_swap_usage_KiB(), kdk_rti_get_mem_swap_usage_percent()); printf("交换分区剩余大小:%lu KiB\n", kdk_rti_get_mem_swap_free_KiB()); printf("当前CPU使用率:%f\n", kdk_rti_get_cpu_current_usage()); unsigned int day, hour, min, sec; kdk_rti_get_uptime(&day, &hour, &min, &sec); printf("开机时长:%u天%u小时%u分钟%u秒\n", day, hour, min, sec); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_rti_get_mem_res_total_KiB (), .BR kdk_rti_get_mem_res_usage_percent (), .BR kdk_rti_get_mem_res_usage_KiB (), .BR kdk_rti_get_mem_res_available_KiB (), .BR kdk_rti_get_mem_res_free_KiB (), .BR kdk_rti_get_mem_virt_alloc_KiB (), .BR kdk_rti_get_mem_swap_usage_percent (), .BR kdk_rti_get_mem_swap_usage_KiB (), .BR kdk_rti_get_mem_swap_free_KiB (), .BR kdk_rti_get_cpu_current_usage () and .BR kdk_rti_get_uptime (). .SH "SEE ALSO" .BR kdk_rti_get_mem_res_total_KiB (3), .BR kdk_rti_get_mem_res_usage_percent (3), .BR kdk_rti_get_mem_res_usage_KiB (3), .BR kdk_rti_get_mem_res_available_KiB (3), .BR kdk_rti_get_mem_res_free_KiB (3), .BR kdk_rti_get_mem_virt_alloc_KiB (), .BR kdk_rti_get_mem_swap_usage_percent (3), .BR kdk_rti_get_mem_swap_usage_KiB (3), .BR kdk_rti_get_mem_swap_free_KiB (3), .BR kdk_rti_get_cpu_current_usage (3) and .BR kdk_rti_get_uptime (3).libkysdk-system/man/proc/kdk_get_process_status.30000664000175000017500000000650515171302542021217 0ustar fengfeng.TH "KDK_GET_PROCESS_STATUS" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_process_status - 获取某一进程的进程状态 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_get_process_status(int "proc_num ");" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the process state of the specified process. .PP The argument .I proc_num is the PID of the process. .SH "RETURN VALUE" On success, returns the process state of the process of type char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkyprocess.h" #include #include int main() { char *run_time = kdk_get_process_running_time(841); char *cpu_time = kdk_get_process_cpu_time(841); char *cmd = kdk_get_process_command(841); char *start_time = kdk_get_process_start_time(841); printf("获取某一进程的CPU利用率:%0.1f\n", kdk_get_process_cpu_usage_percent(841)); printf("获取某一进程的内存占用率:%0.1f\n", kdk_get_process_mem_usage_percent(841)); printf("获取某一进程的进程状态:%s\n", kdk_get_process_status(841)); printf("获取某一进程的进程端口号:%d\n", kdk_get_process_port(841)); printf("获取某一进程的启动时间:%s\n", start_time); printf("获取某一进程的运行时间:%s\n", run_time); printf("获取某一进程的CPU时间:%s\n", cpu_time); printf("获取某一进程的Command:%s\n", cmd); printf("获取某一进程的属主:%s\n", kdk_get_process_user(841)); free(run_time); free(cpu_time); free(cmd); free(start_time); char** pid = kdk_procname_get_process_infomation("systemd"); size_t index = 0; while (pid[index]) { printf("pid %s\n", pid[index]); index ++; } kdk_proc_freeall(pid); char** info = kdk_get_process_all_information(); size_t count = 0; while (info[count]) { printf("No. %d\t %s\n", count + 1, info[count]); count ++; } kdk_proc_freeall(info); char *name = kdk_get_process_name(1151571); printf("name = %s\n", name); free(name); int id = kdk_get_process_id("systemd"); printf("pid %d\n", id); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_process_name (), .BR kdk_get_process_id (), .BR kdk_get_process_cpu_usage_percent (), .BR kdk_get_process_mem_usage_percent (), .BR kdk_get_process_port (), .BR kdk_get_process_start_time (), .BR kdk_get_process_running_time (), .BR kdk_get_process_cpu_time (), .BR kdk_get_process_command (), .BR kdk_get_process_user (), .BR kdk_procname_get_process_infomation (), .BR kdk_get_process_all_information () and .BR kdk_proc_freeall (). .SH "SEE ALSO" .BR kdk_get_process_name (3), .BR kdk_get_process_id (3), .BR kdk_get_process_cpu_usage_percent (3), .BR kdk_get_process_mem_usage_percent (3), .BR kdk_get_process_port (3), .BR kdk_get_process_start_time (), .BR kdk_get_process_running_time (3), .BR kdk_get_process_cpu_time (3), .BR kdk_get_process_command (3), .BR kdk_get_process_user (3), .BR kdk_procname_get_process_infomation (3), .BR kdk_get_process_all_information (3) and .BR kdk_proc_freeall (3).libkysdk-system/man/proc/kdk_get_process_running_time.30000664000175000017500000000653715171302542022377 0ustar fengfeng.TH "KDK_GET_PROCESS_RUNNING_TIME" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_process_running_time - 获取某一进程的运行时间 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_get_process_running_time(int "proc_num ");" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the running time of the specified process. .PP The argument .I proc_num is the PID of the process. .SH "RETURN VALUE" On success, returns the running time of the process of type char*, such as "0-09:06:15"; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkyprocess.h" #include #include int main() { char *run_time = kdk_get_process_running_time(841); char *cpu_time = kdk_get_process_cpu_time(841); char *cmd = kdk_get_process_command(841); char *start_time = kdk_get_process_start_time(841); printf("获取某一进程的CPU利用率:%0.1f\n", kdk_get_process_cpu_usage_percent(841)); printf("获取某一进程的内存占用率:%0.1f\n", kdk_get_process_mem_usage_percent(841)); printf("获取某一进程的进程状态:%s\n", kdk_get_process_status(841)); printf("获取某一进程的进程端口号:%d\n", kdk_get_process_port(841)); printf("获取某一进程的启动时间:%s\n", start_time); printf("获取某一进程的运行时间:%s\n", run_time); printf("获取某一进程的CPU时间:%s\n", cpu_time); printf("获取某一进程的Command:%s\n", cmd); printf("获取某一进程的属主:%s\n", kdk_get_process_user(841)); free(run_time); free(cpu_time); free(cmd); free(start_time); char** pid = kdk_procname_get_process_infomation("systemd"); size_t index = 0; while (pid[index]) { printf("pid %s\n", pid[index]); index ++; } kdk_proc_freeall(pid); char** info = kdk_get_process_all_information(); size_t count = 0; while (info[count]) { printf("No. %d\t %s\n", count + 1, info[count]); count ++; } kdk_proc_freeall(info); char *name = kdk_get_process_name(1151571); printf("name = %s\n", name); free(name); int id = kdk_get_process_id("systemd"); printf("pid %d\n", id); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_process_name (), .BR kdk_get_process_id (), .BR kdk_get_process_cpu_usage_percent (), .BR kdk_get_process_mem_usage_percent (), .BR kdk_get_process_status (), .BR kdk_get_process_port (), .BR kdk_get_process_start_time (), .BR kdk_get_process_cpu_time (), .BR kdk_get_process_command (), .BR kdk_get_process_user (), .BR kdk_procname_get_process_infomation (), .BR kdk_get_process_all_information () and .BR kdk_proc_freeall (). .SH "SEE ALSO" .BR kdk_get_process_name (3), .BR kdk_get_process_id (3), .BR kdk_get_process_cpu_usage_percent (3), .BR kdk_get_process_mem_usage_percent (3), .BR kdk_get_process_status (3), .BR kdk_get_process_port (), .BR kdk_get_process_start_time (3), .BR kdk_get_process_cpu_time (3), .BR kdk_get_process_command (3), .BR kdk_get_process_user (3), .BR kdk_procname_get_process_infomation (3), .BR kdk_get_process_all_information (3) and .BR kdk_proc_freeall (3).libkysdk-system/man/proc/kdk_rti_get_mem_res_total_KiB.30000664000175000017500000000513315171302542022367 0ustar fengfeng.TH "KDK_RTI_GET_MEM_RES_TOTAL_KIB" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_rti_get_mem_res_total_KiB - 获取系统中物理内存总大小 .SH SYNOPSIS .nf .B #include .sp .BI "extern unsigned long kdk_rti_get_mem_res_total_KiB();" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the total size of physical memory in the system. .SH "RETURN VALUE" On success, returns the physical memory size of type unsigned long; The unit is KiB. .PP On error, return .BR 0. .SH EXAMPLES .EX #include "libkyrtinfo.h" #include int main() { printf("内存总大小:%lu KiB\n", kdk_rti_get_mem_res_total_KiB()); printf("当前已用内存:%lu KiB,%f\n", kdk_rti_get_mem_res_usage_KiB(), kdk_rti_get_mem_res_usage_percent()); printf("当前空闲内存:%lu KiB\n", kdk_rti_get_mem_res_free_KiB()); printf("可用内存大小:%lu KiB\n", kdk_rti_get_mem_res_available_KiB()); printf("应用总申请虚拟内存大小:%lu KiB\n", kdk_rti_get_mem_virt_alloc_KiB()); printf("交换分区总量:%lu KiB\n", kdk_rti_get_mem_swap_total_KiB()); printf("交换分区已用量:%lu KiB, %f\n", kdk_rti_get_mem_swap_usage_KiB(), kdk_rti_get_mem_swap_usage_percent()); printf("交换分区剩余大小:%lu KiB\n", kdk_rti_get_mem_swap_free_KiB()); printf("当前CPU使用率:%f\n", kdk_rti_get_cpu_current_usage()); unsigned int day, hour, min, sec; kdk_rti_get_uptime(&day, &hour, &min, &sec); printf("开机时长:%u天%u小时%u分钟%u秒\n", day, hour, min, sec); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_rti_get_mem_res_usage_percent (), .BR kdk_rti_get_mem_res_usage_KiB (), .BR kdk_rti_get_mem_res_available_KiB (), .BR kdk_rti_get_mem_res_free_KiB (), .BR kdk_rti_get_mem_virt_alloc_KiB (), .BR kdk_rti_get_mem_swap_total_KiB (), .BR kdk_rti_get_mem_swap_usage_percent (), .BR kdk_rti_get_mem_swap_usage_KiB (), .BR kdk_rti_get_mem_swap_free_KiB (), .BR kdk_rti_get_cpu_current_usage () and .BR kdk_rti_get_uptime (). .SH "SEE ALSO" .BR kdk_rti_get_mem_res_usage_percent (3), .BR kdk_rti_get_mem_res_usage_KiB (3), .BR kdk_rti_get_mem_res_available_KiB (3), .BR kdk_rti_get_mem_res_free_KiB (3), .BR kdk_rti_get_mem_virt_alloc_KiB (3), .BR kdk_rti_get_mem_swap_total_KiB (), .BR kdk_rti_get_mem_swap_usage_percent (3), .BR kdk_rti_get_mem_swap_usage_KiB (3), .BR kdk_rti_get_mem_swap_free_KiB (3), .BR kdk_rti_get_cpu_current_usage (3) and .BR kdk_rti_get_uptime (3).libkysdk-system/man/proc/kdk_proc_freeall.30000664000175000017500000000626215171302542017734 0ustar fengfeng.TH "KDK_PROC_FREEALL" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_proc_freeall - 用于回收字符串列表 .SH SYNOPSIS .nf .B #include .sp .BI "extern inline void kdk_proc_freeall(char **"ptr ");" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to recycle a list of strings of type char **. .PP The argument .I ptr is a list of strings of type char **. .SH "RETURN VALUE" No return value .SH EXAMPLES .EX #include "libkyprocess.h" #include #include int main() { char *run_time = kdk_get_process_running_time(841); char *cpu_time = kdk_get_process_cpu_time(841); char *cmd = kdk_get_process_command(841); char *start_time = kdk_get_process_start_time(841); printf("获取某一进程的CPU利用率:%0.1f\n", kdk_get_process_cpu_usage_percent(841)); printf("获取某一进程的内存占用率:%0.1f\n", kdk_get_process_mem_usage_percent(841)); printf("获取某一进程的进程状态:%s\n", kdk_get_process_status(841)); printf("获取某一进程的进程端口号:%d\n", kdk_get_process_port(841)); printf("获取某一进程的启动时间:%s\n", start_time); printf("获取某一进程的运行时间:%s\n", run_time); printf("获取某一进程的CPU时间:%s\n", cpu_time); printf("获取某一进程的Command:%s\n", cmd); printf("获取某一进程的属主:%s\n", kdk_get_process_user(841)); free(run_time); free(cpu_time); free(cmd); free(start_time); char** pid = kdk_procname_get_process_infomation("systemd"); size_t index = 0; while (pid[index]) { printf("pid %s\n", pid[index]); index ++; } kdk_proc_freeall(pid); char** info = kdk_get_process_all_information(); size_t count = 0; while (info[count]) { printf("No. %d\t %s\n", count + 1, info[count]); count ++; } kdk_proc_freeall(info); char *name = kdk_get_process_name(1151571); printf("name = %s\n", name); free(name); int id = kdk_get_process_id("systemd"); printf("pid %d\n", id); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_process_name (), .BR kdk_get_process_id (), .BR kdk_get_process_cpu_usage_percent (), .BR kdk_get_process_mem_usage_percent (), .BR kdk_get_process_status (), .BR kdk_get_process_port (), .BR kdk_get_process_start_time (), .BR kdk_get_process_running_time (), .BR kdk_get_process_cpu_time (), .BR kdk_get_process_command (), .BR kdk_get_process_user (), .BR kdk_procname_get_process_infomation () and .BR kdk_get_process_all_information (). .SH "SEE ALSO" .BR kdk_get_process_name (3), .BR kdk_get_process_id (3), .BR kdk_get_process_cpu_usage_percent (3), .BR kdk_get_process_mem_usage_percent (3), .BR kdk_get_process_status (3), .BR kdk_get_process_port (), .BR kdk_get_process_start_time (3), .BR kdk_get_process_running_time (3), .BR kdk_get_process_cpu_time (3), .BR kdk_get_process_command (3), .BR kdk_get_process_user (3), .BR kdk_procname_get_process_infomation (3) and .BR kdk_get_process_all_information (3).libkysdk-system/man/proc/kdk_rti_get_mem_swap_usage_KiB.30000664000175000017500000000510115171302542022524 0ustar fengfeng.TH "KDK_RTI_GET_MEM_SWAP_USAGE_KIB" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_rti_get_mem_swap_usage_KiB - 获取Swap分区使用量 .SH SYNOPSIS .nf .B #include .sp .BI "extern unsigned long kdk_rti_get_mem_swap_usage_KiB();" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the usage of the Swap partition. .SH "RETURN VALUE" On success, returns the Swap partition usage of type unsigned long; The unit is KiB. .PP On error, return .BR 0. .SH EXAMPLES .EX #include "libkyrtinfo.h" #include int main() { printf("内存总大小:%lu KiB\n", kdk_rti_get_mem_res_total_KiB()); printf("当前已用内存:%lu KiB,%f\n", kdk_rti_get_mem_res_usage_KiB(), kdk_rti_get_mem_res_usage_percent()); printf("当前空闲内存:%lu KiB\n", kdk_rti_get_mem_res_free_KiB()); printf("可用内存大小:%lu KiB\n", kdk_rti_get_mem_res_available_KiB()); printf("应用总申请虚拟内存大小:%lu KiB\n", kdk_rti_get_mem_virt_alloc_KiB()); printf("交换分区总量:%lu KiB\n", kdk_rti_get_mem_swap_total_KiB()); printf("交换分区已用量:%lu KiB, %f\n", kdk_rti_get_mem_swap_usage_KiB(), kdk_rti_get_mem_swap_usage_percent()); printf("交换分区剩余大小:%lu KiB\n", kdk_rti_get_mem_swap_free_KiB()); printf("当前CPU使用率:%f\n", kdk_rti_get_cpu_current_usage()); unsigned int day, hour, min, sec; kdk_rti_get_uptime(&day, &hour, &min, &sec); printf("开机时长:%u天%u小时%u分钟%u秒\n", day, hour, min, sec); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_rti_get_mem_res_total_KiB (), .BR kdk_rti_get_mem_res_usage_percent (), .BR kdk_rti_get_mem_res_usage_KiB (), .BR kdk_rti_get_mem_res_available_KiB (), .BR kdk_rti_get_mem_res_free_KiB (), .BR kdk_rti_get_mem_virt_alloc_KiB (), .BR kdk_rti_get_mem_swap_total_KiB (), .BR kdk_rti_get_mem_swap_usage_percent (), .BR kdk_rti_get_mem_swap_free_KiB (), .BR kdk_rti_get_cpu_current_usage () and .BR kdk_rti_get_uptime (). .SH "SEE ALSO" .BR kdk_rti_get_mem_res_total_KiB (3), .BR kdk_rti_get_mem_res_usage_percent (3), .BR kdk_rti_get_mem_res_usage_KiB (3), .BR kdk_rti_get_mem_res_available_KiB (3), .BR kdk_rti_get_mem_res_free_KiB (3), .BR kdk_rti_get_mem_virt_alloc_KiB (), .BR kdk_rti_get_mem_swap_total_KiB (3), .BR kdk_rti_get_mem_swap_usage_percent (3), .BR kdk_rti_get_mem_swap_free_KiB (3), .BR kdk_rti_get_cpu_current_usage (3) and .BR kdk_rti_get_uptime (3).libkysdk-system/man/proc/kdk_get_process_cpu_time.30000664000175000017500000000651315171302542021500 0ustar fengfeng.TH "KDK_GET_PROCESS_CPU_TIME" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_process_cpu_time - 获取某一进程的cpu时间 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_get_process_cpu_time(int "proc_num ");" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the CPU time of the specified process. .PP The argument .I proc_num is the PID of the process. .SH "RETURN VALUE" On success, returns the CPU time of the process of type char*, such as "58秒"; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkyprocess.h" #include #include int main() { char *run_time = kdk_get_process_running_time(841); char *cpu_time = kdk_get_process_cpu_time(841); char *cmd = kdk_get_process_command(841); char *start_time = kdk_get_process_start_time(841); printf("获取某一进程的CPU利用率:%0.1f\n", kdk_get_process_cpu_usage_percent(841)); printf("获取某一进程的内存占用率:%0.1f\n", kdk_get_process_mem_usage_percent(841)); printf("获取某一进程的进程状态:%s\n", kdk_get_process_status(841)); printf("获取某一进程的进程端口号:%d\n", kdk_get_process_port(841)); printf("获取某一进程的启动时间:%s\n", start_time); printf("获取某一进程的运行时间:%s\n", run_time); printf("获取某一进程的CPU时间:%s\n", cpu_time); printf("获取某一进程的Command:%s\n", cmd); printf("获取某一进程的属主:%s\n", kdk_get_process_user(841)); free(run_time); free(cpu_time); free(cmd); free(start_time); char** pid = kdk_procname_get_process_infomation("systemd"); size_t index = 0; while (pid[index]) { printf("pid %s\n", pid[index]); index ++; } kdk_proc_freeall(pid); char** info = kdk_get_process_all_information(); size_t count = 0; while (info[count]) { printf("No. %d\t %s\n", count + 1, info[count]); count ++; } kdk_proc_freeall(info); char *name = kdk_get_process_name(1151571); printf("name = %s\n", name); free(name); int id = kdk_get_process_id("systemd"); printf("pid %d\n", id); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_process_name (), .BR kdk_get_process_id (), .BR kdk_get_process_cpu_usage_percent (), .BR kdk_get_process_mem_usage_percent (), .BR kdk_get_process_status (), .BR kdk_get_process_port (), .BR kdk_get_process_start_time (), .BR kdk_get_process_running_time (), .BR kdk_get_process_command (), .BR kdk_get_process_user (), .BR kdk_procname_get_process_infomation (), .BR kdk_get_process_all_information () and .BR kdk_proc_freeall (). .SH "SEE ALSO" .BR kdk_get_process_name (3), .BR kdk_get_process_id (3), .BR kdk_get_process_cpu_usage_percent (3), .BR kdk_get_process_mem_usage_percent (3), .BR kdk_get_process_status (3), .BR kdk_get_process_port (), .BR kdk_get_process_start_time (3), .BR kdk_get_process_running_time (3), .BR kdk_get_process_command (3), .BR kdk_get_process_user (3), .BR kdk_procname_get_process_infomation (3), .BR kdk_get_process_all_information (3) and .BR kdk_proc_freeall (3).libkysdk-system/man/proc/kdk_rti_get_mem_swap_free_KiB.30000664000175000017500000000512215171302542022344 0ustar fengfeng.TH "KDK_RTI_GET_MEM_SWAP_FREE_KIB" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_rti_get_mem_swap_free_KiB - 获取Swap分区空闲大小 .SH SYNOPSIS .nf .B #include .sp .BI "extern unsigned long kdk_rti_get_mem_swap_free_KiB();" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the free size of the Swap partition. .SH "RETURN VALUE" On success, returns the free size of the Swap partition of type unsigned long; The unit is KiB. .PP On error, return .BR 0. .SH EXAMPLES .EX #include "libkyrtinfo.h" #include int main() { printf("内存总大小:%lu KiB\n", kdk_rti_get_mem_res_total_KiB()); printf("当前已用内存:%lu KiB,%f\n", kdk_rti_get_mem_res_usage_KiB(), kdk_rti_get_mem_res_usage_percent()); printf("当前空闲内存:%lu KiB\n", kdk_rti_get_mem_res_free_KiB()); printf("可用内存大小:%lu KiB\n", kdk_rti_get_mem_res_available_KiB()); printf("应用总申请虚拟内存大小:%lu KiB\n", kdk_rti_get_mem_virt_alloc_KiB()); printf("交换分区总量:%lu KiB\n", kdk_rti_get_mem_swap_total_KiB()); printf("交换分区已用量:%lu KiB, %f\n", kdk_rti_get_mem_swap_usage_KiB(), kdk_rti_get_mem_swap_usage_percent()); printf("交换分区剩余大小:%lu KiB\n", kdk_rti_get_mem_swap_free_KiB()); printf("当前CPU使用率:%f\n", kdk_rti_get_cpu_current_usage()); unsigned int day, hour, min, sec; kdk_rti_get_uptime(&day, &hour, &min, &sec); printf("开机时长:%u天%u小时%u分钟%u秒\n", day, hour, min, sec); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_rti_get_mem_res_total_KiB (), .BR kdk_rti_get_mem_res_usage_percent (), .BR kdk_rti_get_mem_res_usage_KiB (), .BR kdk_rti_get_mem_res_available_KiB (), .BR kdk_rti_get_mem_res_free_KiB (), .BR kdk_rti_get_mem_virt_alloc_KiB (), .BR kdk_rti_get_mem_swap_total_KiB (), .BR kdk_rti_get_mem_swap_usage_percent (), .BR kdk_rti_get_mem_swap_usage_KiB (), .BR kdk_rti_get_cpu_current_usage () and .BR kdk_rti_get_uptime (). .SH "SEE ALSO" .BR kdk_rti_get_mem_res_total_KiB (3), .BR kdk_rti_get_mem_res_usage_percent (3), .BR kdk_rti_get_mem_res_usage_KiB (3), .BR kdk_rti_get_mem_res_available_KiB (3), .BR kdk_rti_get_mem_res_free_KiB (3), .BR kdk_rti_get_mem_virt_alloc_KiB (), .BR kdk_rti_get_mem_swap_total_KiB (3), .BR kdk_rti_get_mem_swap_usage_percent (3), .BR kdk_rti_get_mem_swap_usage_KiB (3), .BR kdk_rti_get_cpu_current_usage (3) and .BR kdk_rti_get_uptime (3).libkysdk-system/man/proc/kdk_get_process_id.30000664000175000017500000000635215171302542020270 0ustar fengfeng.TH "KDK_GET_PROCESS_ID" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_process_id - 获取某一进程的id .SH SYNOPSIS .nf .B #include .sp .BI "extern int kdk_get_process_id(char *"proc_name ");" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the PID of the specified process. .PP The argument .I proc_num is the name of the process. .SH "RETURN VALUE" On success, returns the PID of the process of type int. .PP On error, return .BR 0. .SH EXAMPLES .EX #include "libkyprocess.h" #include #include int main() { char *run_time = kdk_get_process_running_time(841); char *cpu_time = kdk_get_process_cpu_time(841); char *cmd = kdk_get_process_command(841); char *start_time = kdk_get_process_start_time(841); printf("获取某一进程的CPU利用率:%0.1f\n", kdk_get_process_cpu_usage_percent(841)); printf("获取某一进程的内存占用率:%0.1f\n", kdk_get_process_mem_usage_percent(841)); printf("获取某一进程的进程状态:%s\n", kdk_get_process_status(841)); printf("获取某一进程的进程端口号:%d\n", kdk_get_process_port(841)); printf("获取某一进程的启动时间:%s\n", start_time); printf("获取某一进程的运行时间:%s\n", run_time); printf("获取某一进程的CPU时间:%s\n", cpu_time); printf("获取某一进程的Command:%s\n", cmd); printf("获取某一进程的属主:%s\n", kdk_get_process_user(841)); free(run_time); free(cpu_time); free(cmd); free(start_time); char** pid = kdk_procname_get_process_infomation("systemd"); size_t index = 0; while (pid[index]) { printf("pid %s\n", pid[index]); index ++; } kdk_proc_freeall(pid); char** info = kdk_get_process_all_information(); size_t count = 0; while (info[count]) { printf("No. %d\t %s\n", count + 1, info[count]); count ++; } kdk_proc_freeall(info); char *name = kdk_get_process_name(1151571); printf("name = %s\n", name); free(name); int id = kdk_get_process_id("systemd"); printf("pid %d\n", id); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_process_name (), .BR kdk_get_process_cpu_usage_percent (), .BR kdk_get_process_mem_usage_percent (), .BR kdk_get_process_status (), .BR kdk_get_process_port (), .BR kdk_get_process_start_time (), .BR kdk_get_process_running_time (), .BR kdk_get_process_cpu_time (), .BR kdk_get_process_command (), .BR kdk_get_process_user (), .BR kdk_procname_get_process_infomation (), .BR kdk_get_process_all_information () and .BR kdk_proc_freeall (). .SH "SEE ALSO" .BR kdk_get_process_name (3), .BR kdk_get_process_cpu_usage_percent (3), .BR kdk_get_process_mem_usage_percent (3), .BR kdk_get_process_status (3), .BR kdk_get_process_port (3), .BR kdk_get_process_start_time (), .BR kdk_get_process_running_time (3), .BR kdk_get_process_cpu_time (3), .BR kdk_get_process_command (3), .BR kdk_get_process_user (3), .BR kdk_procname_get_process_infomation (3), .BR kdk_get_process_all_information (3) and .BR kdk_proc_freeall (3).libkysdk-system/man/proc/kdk_get_process_name.30000664000175000017500000000645415171302542020617 0ustar fengfeng.TH "KDK_GET_PROCESS_NAME" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_process_name - 获取某一进程的名称 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_get_process_name(int "proc_num ");" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the name of the specified process. .PP The argument .I proc_num is the PID of the process. .SH "RETURN VALUE" On success, returns the name of the process of type char *; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkyprocess.h" #include #include int main() { char *run_time = kdk_get_process_running_time(841); char *cpu_time = kdk_get_process_cpu_time(841); char *cmd = kdk_get_process_command(841); char *start_time = kdk_get_process_start_time(841); printf("获取某一进程的CPU利用率:%0.1f\n", kdk_get_process_cpu_usage_percent(841)); printf("获取某一进程的内存占用率:%0.1f\n", kdk_get_process_mem_usage_percent(841)); printf("获取某一进程的进程状态:%s\n", kdk_get_process_status(841)); printf("获取某一进程的进程端口号:%d\n", kdk_get_process_port(841)); printf("获取某一进程的启动时间:%s\n", start_time); printf("获取某一进程的运行时间:%s\n", run_time); printf("获取某一进程的CPU时间:%s\n", cpu_time); printf("获取某一进程的Command:%s\n", cmd); printf("获取某一进程的属主:%s\n", kdk_get_process_user(841)); free(run_time); free(cpu_time); free(cmd); free(start_time); char** pid = kdk_procname_get_process_infomation("systemd"); size_t index = 0; while (pid[index]) { printf("pid %s\n", pid[index]); index ++; } kdk_proc_freeall(pid); char** info = kdk_get_process_all_information(); size_t count = 0; while (info[count]) { printf("No. %d\t %s\n", count + 1, info[count]); count ++; } kdk_proc_freeall(info); char *name = kdk_get_process_name(1151571); printf("name = %s\n", name); free(name); int id = kdk_get_process_id("systemd"); printf("pid %d\n", id); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_process_id (), .BR kdk_get_process_cpu_usage_percent (), .BR kdk_get_process_mem_usage_percent (), .BR kdk_get_process_status (), .BR kdk_get_process_port (), .BR kdk_get_process_start_time (), .BR kdk_get_process_running_time (), .BR kdk_get_process_cpu_time (), .BR kdk_get_process_command (), .BR kdk_get_process_user (), .BR kdk_procname_get_process_infomation (), .BR kdk_get_process_all_information () and .BR kdk_proc_freeall (). .SH "SEE ALSO" .BR kdk_get_process_id (3), .BR kdk_get_process_cpu_usage_percent (3), .BR kdk_get_process_mem_usage_percent (3), .BR kdk_get_process_status (3), .BR kdk_get_process_port (3), .BR kdk_get_process_start_time (), .BR kdk_get_process_running_time (3), .BR kdk_get_process_cpu_time (3), .BR kdk_get_process_command (3), .BR kdk_get_process_user (3), .BR kdk_procname_get_process_infomation (3), .BR kdk_get_process_all_information (3) and .BR kdk_proc_freeall (3).libkysdk-system/man/proc/kdk_rti_get_mem_res_usage_KiB.30000664000175000017500000000517415171302542022355 0ustar fengfeng.TH "KDK_RTI_GET_MEM_RES_USAGE_KIB" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_rti_get_mem_res_usage_KiB - 获取物理内存使用大小 .SH SYNOPSIS .nf .B #include .sp .BI "extern unsigned long kdk_rti_get_mem_res_usage_KiB();" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the physical memory usage size, note that Buffer/Cache is counted as used memory. .SH "RETURN VALUE" On success, returns the physical memory usage size of type unsigned long; The unit is KiB. .PP On error, return .BR 0. .SH EXAMPLES .EX #include "libkyrtinfo.h" #include int main() { printf("内存总大小:%lu KiB\n", kdk_rti_get_mem_res_total_KiB()); printf("当前已用内存:%lu KiB,%f\n", kdk_rti_get_mem_res_usage_KiB(), kdk_rti_get_mem_res_usage_percent()); printf("当前空闲内存:%lu KiB\n", kdk_rti_get_mem_res_free_KiB()); printf("可用内存大小:%lu KiB\n", kdk_rti_get_mem_res_available_KiB()); printf("应用总申请虚拟内存大小:%lu KiB\n", kdk_rti_get_mem_virt_alloc_KiB()); printf("交换分区总量:%lu KiB\n", kdk_rti_get_mem_swap_total_KiB()); printf("交换分区已用量:%lu KiB, %f\n", kdk_rti_get_mem_swap_usage_KiB(), kdk_rti_get_mem_swap_usage_percent()); printf("交换分区剩余大小:%lu KiB\n", kdk_rti_get_mem_swap_free_KiB()); printf("当前CPU使用率:%f\n", kdk_rti_get_cpu_current_usage()); unsigned int day, hour, min, sec; kdk_rti_get_uptime(&day, &hour, &min, &sec); printf("开机时长:%u天%u小时%u分钟%u秒\n", day, hour, min, sec); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_rti_get_mem_res_total_KiB (), .BR kdk_rti_get_mem_res_usage_percent (), .BR kdk_rti_get_mem_res_available_KiB (), .BR kdk_rti_get_mem_res_free_KiB (), .BR kdk_rti_get_mem_virt_alloc_KiB (), .BR kdk_rti_get_mem_swap_total_KiB (), .BR kdk_rti_get_mem_swap_usage_percent (), .BR kdk_rti_get_mem_swap_usage_KiB (), .BR kdk_rti_get_mem_swap_free_KiB (), .BR kdk_rti_get_cpu_current_usage () and .BR kdk_rti_get_uptime (). .SH "SEE ALSO" .BR kdk_rti_get_mem_res_total_KiB (3), .BR kdk_rti_get_mem_res_usage_percent (3), .BR kdk_rti_get_mem_res_available_KiB (3), .BR kdk_rti_get_mem_res_free_KiB (3), .BR kdk_rti_get_mem_virt_alloc_KiB (3), .BR kdk_rti_get_mem_swap_total_KiB (), .BR kdk_rti_get_mem_swap_usage_percent (3), .BR kdk_rti_get_mem_swap_usage_KiB (3), .BR kdk_rti_get_mem_swap_free_KiB (3), .BR kdk_rti_get_cpu_current_usage (3) and .BR kdk_rti_get_uptime (3).libkysdk-system/man/proc/kdk_rti_get_uptime.30000664000175000017500000000540415171302542020314 0ustar fengfeng.TH "KDK_RTI_GET_UPTIME" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_rti_get_uptime - 获取操作系统开机时长 .SH SYNOPSIS .nf .B #include .sp .BI "extern int kdk_rti_get_uptime(unsigned int *"day ", unsigned int *"hour ", unsigned int *"min ", unsigned int *"sec ");" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the operating system boot time. .PP The argument .I day is the number of days. The argument .I hour is the number of hours. The argument .I min is the number of minutes. The argument .I sec is the number of seconds. .SH "RETURN VALUE" On success, return .BR 0. .PP On error, return .BR -1. .SH EXAMPLES .EX #include "libkyrtinfo.h" #include int main() { printf("内存总大小:%lu KiB\n", kdk_rti_get_mem_res_total_KiB()); printf("当前已用内存:%lu KiB,%f\n", kdk_rti_get_mem_res_usage_KiB(), kdk_rti_get_mem_res_usage_percent()); printf("当前空闲内存:%lu KiB\n", kdk_rti_get_mem_res_free_KiB()); printf("可用内存大小:%lu KiB\n", kdk_rti_get_mem_res_available_KiB()); printf("应用总申请虚拟内存大小:%lu KiB\n", kdk_rti_get_mem_virt_alloc_KiB()); printf("交换分区总量:%lu KiB\n", kdk_rti_get_mem_swap_total_KiB()); printf("交换分区已用量:%lu KiB, %f\n", kdk_rti_get_mem_swap_usage_KiB(), kdk_rti_get_mem_swap_usage_percent()); printf("交换分区剩余大小:%lu KiB\n", kdk_rti_get_mem_swap_free_KiB()); printf("当前CPU使用率:%f\n", kdk_rti_get_cpu_current_usage()); unsigned int day, hour, min, sec; kdk_rti_get_uptime(&day, &hour, &min, &sec); printf("开机时长:%u天%u小时%u分钟%u秒\n", day, hour, min, sec); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_rti_get_mem_res_total_KiB (), .BR kdk_rti_get_mem_res_usage_percent (), .BR kdk_rti_get_mem_res_usage_KiB (), .BR kdk_rti_get_mem_res_available_KiB (), .BR kdk_rti_get_mem_res_free_KiB (), .BR kdk_rti_get_mem_virt_alloc_KiB (), .BR kdk_rti_get_mem_swap_total_KiB (), .BR kdk_rti_get_mem_swap_usage_percent (), .BR kdk_rti_get_mem_swap_usage_KiB (), .BR kdk_rti_get_mem_swap_free_KiB () and .BR kdk_rti_get_cpu_current_usage (). .SH "SEE ALSO" .BR kdk_rti_get_mem_res_total_KiB (3), .BR kdk_rti_get_mem_res_usage_percent (3), .BR kdk_rti_get_mem_res_usage_KiB (3), .BR kdk_rti_get_mem_res_available_KiB (3), .BR kdk_rti_get_mem_res_free_KiB (3), .BR kdk_rti_get_mem_virt_alloc_KiB (), .BR kdk_rti_get_mem_swap_total_KiB (3), .BR kdk_rti_get_mem_swap_usage_percent (3), .BR kdk_rti_get_mem_swap_usage_KiB (3), .BR kdk_rti_get_mem_swap_free_KiB (3) and .BR kdk_rti_get_cpu_current_usage (3).libkysdk-system/man/proc/kdk_rti_get_mem_swap_usage_percent.30000664000175000017500000000504715171302542023530 0ustar fengfeng.TH "KDK_RTI_GET_MEM_SWAP_USAGE_PERCENT" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_rti_get_mem_swap_usage_percent - 获取Swap分区使用率 .SH SYNOPSIS .nf .B #include .sp .BI "extern float kdk_rti_get_mem_swap_usage_percent();" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the Swap partition usage rate. .SH "RETURN VALUE" On success, returns the Swap partition usage rate of type float. .PP On error, return .BR 0. .SH EXAMPLES .EX #include "libkyrtinfo.h" #include int main() { printf("内存总大小:%lu KiB\n", kdk_rti_get_mem_res_total_KiB()); printf("当前已用内存:%lu KiB,%f\n", kdk_rti_get_mem_res_usage_KiB(), kdk_rti_get_mem_res_usage_percent()); printf("当前空闲内存:%lu KiB\n", kdk_rti_get_mem_res_free_KiB()); printf("可用内存大小:%lu KiB\n", kdk_rti_get_mem_res_available_KiB()); printf("应用总申请虚拟内存大小:%lu KiB\n", kdk_rti_get_mem_virt_alloc_KiB()); printf("交换分区总量:%lu KiB\n", kdk_rti_get_mem_swap_total_KiB()); printf("交换分区已用量:%lu KiB, %f\n", kdk_rti_get_mem_swap_usage_KiB(), kdk_rti_get_mem_swap_usage_percent()); printf("交换分区剩余大小:%lu KiB\n", kdk_rti_get_mem_swap_free_KiB()); printf("当前CPU使用率:%f\n", kdk_rti_get_cpu_current_usage()); unsigned int day, hour, min, sec; kdk_rti_get_uptime(&day, &hour, &min, &sec); printf("开机时长:%u天%u小时%u分钟%u秒\n", day, hour, min, sec); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_rti_get_mem_res_total_KiB (), .BR kdk_rti_get_mem_res_usage_percent (), .BR kdk_rti_get_mem_res_usage_KiB (), .BR kdk_rti_get_mem_res_available_KiB (), .BR kdk_rti_get_mem_res_free_KiB (), .BR kdk_rti_get_mem_virt_alloc_KiB (), .BR kdk_rti_get_mem_swap_total_KiB (), .BR kdk_rti_get_mem_swap_usage_KiB (), .BR kdk_rti_get_mem_swap_free_KiB (), .BR kdk_rti_get_cpu_current_usage () and .BR kdk_rti_get_uptime (). .SH "SEE ALSO" .BR kdk_rti_get_mem_res_total_KiB (3), .BR kdk_rti_get_mem_res_usage_percent (3), .BR kdk_rti_get_mem_res_usage_KiB (3), .BR kdk_rti_get_mem_res_available_KiB (3), .BR kdk_rti_get_mem_res_free_KiB (3), .BR kdk_rti_get_mem_virt_alloc_KiB (), .BR kdk_rti_get_mem_swap_total_KiB (3), .BR kdk_rti_get_mem_swap_usage_KiB (3), .BR kdk_rti_get_mem_swap_free_KiB (3), .BR kdk_rti_get_cpu_current_usage (3) and .BR kdk_rti_get_uptime (3).libkysdk-system/man/proc/kdk_procname_get_process_infomation.30000664000175000017500000000657615171302542023733 0ustar fengfeng.TH "KDK_PROCNAME_GET_PROCESS_INFOMATION" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_procname_get_process_infomation - 获取某一进程的信息 .SH SYNOPSIS .nf .B #include .sp .BI "extern char** kdk_procname_get_process_infomation(char *"proc_name ");" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain information about the specified process. .PP The argument .I proc_num is the name of the process. .SH "RETURN VALUE" On success, returns the information of the process of type char**, ending with a NULL character; Generated by .I alloc and needs to be recycled by .I kdk_proc_freeall . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkyprocess.h" #include #include int main() { char *run_time = kdk_get_process_running_time(841); char *cpu_time = kdk_get_process_cpu_time(841); char *cmd = kdk_get_process_command(841); char *start_time = kdk_get_process_start_time(841); printf("获取某一进程的CPU利用率:%0.1f\n", kdk_get_process_cpu_usage_percent(841)); printf("获取某一进程的内存占用率:%0.1f\n", kdk_get_process_mem_usage_percent(841)); printf("获取某一进程的进程状态:%s\n", kdk_get_process_status(841)); printf("获取某一进程的进程端口号:%d\n", kdk_get_process_port(841)); printf("获取某一进程的启动时间:%s\n", start_time); printf("获取某一进程的运行时间:%s\n", run_time); printf("获取某一进程的CPU时间:%s\n", cpu_time); printf("获取某一进程的Command:%s\n", cmd); printf("获取某一进程的属主:%s\n", kdk_get_process_user(841)); free(run_time); free(cpu_time); free(cmd); free(start_time); char** pid = kdk_procname_get_process_infomation("systemd"); size_t index = 0; while (pid[index]) { printf("pid %s\n", pid[index]); index ++; } kdk_proc_freeall(pid); char** info = kdk_get_process_all_information(); size_t count = 0; while (info[count]) { printf("No. %d\t %s\n", count + 1, info[count]); count ++; } kdk_proc_freeall(info); char *name = kdk_get_process_name(1151571); printf("name = %s\n", name); free(name); int id = kdk_get_process_id("systemd"); printf("pid %d\n", id); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_process_name (), .BR kdk_get_process_id (), .BR kdk_get_process_cpu_usage_percent (), .BR kdk_get_process_mem_usage_percent (), .BR kdk_get_process_status (), .BR kdk_get_process_port (), .BR kdk_get_process_start_time (), .BR kdk_get_process_running_time (), .BR kdk_get_process_cpu_time (), .BR kdk_get_process_command (), .BR kdk_get_process_user (), .BR kdk_get_process_all_information () and .BR kdk_proc_freeall (). .SH "SEE ALSO" .BR kdk_get_process_name (3), .BR kdk_get_process_id (3), .BR kdk_get_process_cpu_usage_percent (3), .BR kdk_get_process_mem_usage_percent (3), .BR kdk_get_process_status (3), .BR kdk_get_process_port (), .BR kdk_get_process_start_time (3), .BR kdk_get_process_running_time (3), .BR kdk_get_process_cpu_time (3), .BR kdk_get_process_command (3), .BR kdk_get_process_user (3), .BR kdk_get_process_all_information (3) and .BR kdk_proc_freeall (3).libkysdk-system/man/proc/kdk_get_process_mem_usage_percent.30000664000175000017500000000643215171302542023355 0ustar fengfeng.TH "KDK_GET_PROCESS_MEM_USAGE_PERCENT" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_process_mem_usage_percent - 获取某一进程的内存占用率 .SH SYNOPSIS .nf .B #include .sp .BI "extern float kdk_get_process_mem_usage_percent(int "proc_num ");" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the memory usage of the specified process. .PP The argument .I proc_num is the PID of the process. .SH "RETURN VALUE" On success, returns the memory usage of the process of type float. .PP On error, return .BR 0.00 .SH EXAMPLES .EX #include "libkyprocess.h" #include #include int main() { char *run_time = kdk_get_process_running_time(841); char *cpu_time = kdk_get_process_cpu_time(841); char *cmd = kdk_get_process_command(841); char *start_time = kdk_get_process_start_time(841); printf("获取某一进程的CPU利用率:%0.1f\n", kdk_get_process_cpu_usage_percent(841)); printf("获取某一进程的内存占用率:%0.1f\n", kdk_get_process_mem_usage_percent(841)); printf("获取某一进程的进程状态:%s\n", kdk_get_process_status(841)); printf("获取某一进程的进程端口号:%d\n", kdk_get_process_port(841)); printf("获取某一进程的启动时间:%s\n", start_time); printf("获取某一进程的运行时间:%s\n", run_time); printf("获取某一进程的CPU时间:%s\n", cpu_time); printf("获取某一进程的Command:%s\n", cmd); printf("获取某一进程的属主:%s\n", kdk_get_process_user(841)); free(run_time); free(cpu_time); free(cmd); free(start_time); char** pid = kdk_procname_get_process_infomation("systemd"); size_t index = 0; while (pid[index]) { printf("pid %s\n", pid[index]); index ++; } kdk_proc_freeall(pid); char** info = kdk_get_process_all_information(); size_t count = 0; while (info[count]) { printf("No. %d\t %s\n", count + 1, info[count]); count ++; } kdk_proc_freeall(info); char *name = kdk_get_process_name(1151571); printf("name = %s\n", name); free(name); int id = kdk_get_process_id("systemd"); printf("pid %d\n", id); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_process_name (), .BR kdk_get_process_id (), .BR kdk_get_process_cpu_usage_percent (), .BR kdk_get_process_status (), .BR kdk_get_process_port (), .BR kdk_get_process_start_time (), .BR kdk_get_process_running_time (), .BR kdk_get_process_cpu_time (), .BR kdk_get_process_command (), .BR kdk_get_process_user (), .BR kdk_procname_get_process_infomation (), .BR kdk_get_process_all_information () and .BR kdk_proc_freeall (). .SH "SEE ALSO" .BR kdk_get_process_name (3), .BR kdk_get_process_id (3), .BR kdk_get_process_cpu_usage_percent (3), .BR kdk_get_process_status (3), .BR kdk_get_process_port (3), .BR kdk_get_process_start_time (), .BR kdk_get_process_running_time (3), .BR kdk_get_process_cpu_time (3), .BR kdk_get_process_command (3), .BR kdk_get_process_user (3), .BR kdk_procname_get_process_infomation (3), .BR kdk_get_process_all_information (3) and .BR kdk_proc_freeall (3).libkysdk-system/man/proc/kdk_rti_get_mem_virt_alloc_KiB.30000664000175000017500000000516115171302542022532 0ustar fengfeng.TH "KDK_RTI_GET_MEM_VIRT_ALLOC_KIB" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_rti_get_mem_virt_alloc_KiB - 获取实际空闲的物理内存大小 .SH SYNOPSIS .nf .B #include .sp .BI "extern unsigned long kdk_rti_get_mem_virt_alloc_KiB();" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the total amount of virtual memory requested by all apps. .SH "RETURN VALUE" On success, returns the total virtual memory requests of type unsigned long; The unit is KiB. .PP On error, return .BR 0. .SH EXAMPLES .EX #include "libkyrtinfo.h" #include int main() { printf("内存总大小:%lu KiB\n", kdk_rti_get_mem_res_total_KiB()); printf("当前已用内存:%lu KiB,%f\n", kdk_rti_get_mem_res_usage_KiB(), kdk_rti_get_mem_res_usage_percent()); printf("当前空闲内存:%lu KiB\n", kdk_rti_get_mem_res_free_KiB()); printf("可用内存大小:%lu KiB\n", kdk_rti_get_mem_res_available_KiB()); printf("应用总申请虚拟内存大小:%lu KiB\n", kdk_rti_get_mem_virt_alloc_KiB()); printf("交换分区总量:%lu KiB\n", kdk_rti_get_mem_swap_total_KiB()); printf("交换分区已用量:%lu KiB, %f\n", kdk_rti_get_mem_swap_usage_KiB(), kdk_rti_get_mem_swap_usage_percent()); printf("交换分区剩余大小:%lu KiB\n", kdk_rti_get_mem_swap_free_KiB()); printf("当前CPU使用率:%f\n", kdk_rti_get_cpu_current_usage()); unsigned int day, hour, min, sec; kdk_rti_get_uptime(&day, &hour, &min, &sec); printf("开机时长:%u天%u小时%u分钟%u秒\n", day, hour, min, sec); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_rti_get_mem_res_total_KiB (), .BR kdk_rti_get_mem_res_usage_percent (), .BR kdk_rti_get_mem_res_usage_KiB (), .BR kdk_rti_get_mem_res_available_KiB (), .BR kdk_rti_get_mem_res_free_KiB (), .BR kdk_rti_get_mem_swap_total_KiB (), .BR kdk_rti_get_mem_swap_usage_percent (), .BR kdk_rti_get_mem_swap_usage_KiB (), .BR kdk_rti_get_mem_swap_free_KiB (), .BR kdk_rti_get_cpu_current_usage () and .BR kdk_rti_get_uptime (). .SH "SEE ALSO" .BR kdk_rti_get_mem_res_total_KiB (3), .BR kdk_rti_get_mem_res_usage_percent (3), .BR kdk_rti_get_mem_res_usage_KiB (3), .BR kdk_rti_get_mem_res_available_KiB (3), .BR kdk_rti_get_mem_res_free_KiB (3), .BR kdk_rti_get_mem_swap_total_KiB (), .BR kdk_rti_get_mem_swap_usage_percent (3), .BR kdk_rti_get_mem_swap_usage_KiB (3), .BR kdk_rti_get_mem_swap_free_KiB (3), .BR kdk_rti_get_cpu_current_usage (3) and .BR kdk_rti_get_uptime (3).libkysdk-system/man/proc/libkyrtinfo.30000664000175000017500000000626015171302542017000 0ustar fengfeng.TH "LIBKYRTINFO" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_rti_get_mem_res_total_KiB, kdk_rti_get_mem_res_usage_percent, kdk_rti_get_mem_res_usage_KiB, kdk_rti_get_mem_res_available_KiB, kdk_rti_get_mem_res_free_KiB, kdk_rti_get_mem_virt_alloc_KiB, kdk_rti_get_mem_swap_total_KiB, kdk_rti_get_mem_swap_usage_percent, kdk_rti_get_mem_swap_usage_KiB, kdk_rti_get_mem_swap_free_KiB, kdk_rti_get_cpu_current_usage, kdk_rti_get_uptime, kdk_get_process_name, kdk_get_process_id, kdk_get_process_cpu_usage_percent, kdk_get_process_mem_usage_percent, kdk_get_process_status, kdk_get_process_port, kdk_get_process_start_time, kdk_get_process_running_time, kdk_get_process_cpu_time, kdk_get_process_command, kdk_get_process_user, kdk_procname_get_process_infomation, kdk_get_process_all_information, kdk_proc_freeall - 获取当前系统资源占用信息 .SH SYNOPSIS .nf .B #include .sp .BI "extern unsigned long kdk_rti_get_mem_res_total_KiB();" .sp .BI "extern float kdk_rti_get_mem_res_usage_percent();" .sp .BI "extern unsigned long kdk_rti_get_mem_res_usage_KiB();" .sp .BI "extern unsigned long kdk_rti_get_mem_res_available_KiB();" .sp .BI "extern unsigned long kdk_rti_get_mem_res_free_KiB();" .sp .BI "extern unsigned long kdk_rti_get_mem_virt_alloc_KiB();" .sp .BI "extern unsigned long kdk_rti_get_mem_swap_total_KiB();" .sp .BI "extern float kdk_rti_get_mem_swap_usage_percent();" .sp .BI "extern unsigned long kdk_rti_get_mem_swap_usage_KiB();" .sp .BI "extern unsigned long kdk_rti_get_mem_swap_free_KiB();" .sp .BI "extern float kdk_rti_get_cpu_current_usage();" .sp .BI "extern int kdk_rti_get_uptime(unsigned int *"day ", unsigned int *"hour ", unsigned int *"min ", unsigned int *"sec ");" .sp .nf .B #include .sp .BI "extern char* kdk_get_process_name(int "proc_num ");" .sp .BI "extern int kdk_get_process_id(char *"proc_name ");" .sp .BI "extern float kdk_get_process_cpu_usage_percent(int "proc_num");" .sp .BI "extern float kdk_get_process_mem_usage_percent(int "proc_num ");" .sp .BI "extern char* kdk_get_process_status(int "proc_num ");" .sp .BI "extern int kdk_get_process_port(int "proc_num ");" .sp .BI "extern char* kdk_get_process_start_time(int "proc_num ");" .sp .BI "extern char* kdk_get_process_running_time(int "proc_num ");" .sp .BI "extern char* kdk_get_process_cpu_time(int "proc_num ");" .sp .BI "extern char* kdk_get_process_command(int "proc_num ");" .sp .BI "extern char* kdk_get_process_user(int "proc_num ");" .sp .BI "extern char** kdk_procname_get_process_infomation(char *"proc_name ");" .sp .BI "extern char** kdk_get_process_all_information();" .sp .BI "extern inline void kdk_proc_freeall(char **"ptr ");" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" This library contains current system resource consumption information. .SH "RETURN VALUE" The return value is generally specific to the individual function called. .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_rti_get_mem_res_total_KiB () and .BR kdk_get_process_name (). .SH "SEE ALSO" .BR kdk_rti_get_mem_res_total_KiB (3) and .BR kdk_get_process_name (3).libkysdk-system/man/proc/kdk_get_process_start_time.30000664000175000017500000000654715171302542022055 0ustar fengfeng.TH "KDK_GET_PROCESS_START_TIME" 3 "Mon Sep 18 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_process_start_time - 获取某一进程的启动时间 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_get_process_start_time(int "proc_num ");" .sp Link with \fI\-lkyrtinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the start time of the specified process. .PP The argument .I proc_num is the PID of the process. .SH "RETURN VALUE" On success, returns the start time of the process of type char*, such as "Mon Sep 18 08:40:37 2023"; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include "libkyprocess.h" #include #include int main() { char *run_time = kdk_get_process_running_time(841); char *cpu_time = kdk_get_process_cpu_time(841); char *cmd = kdk_get_process_command(841); char *start_time = kdk_get_process_start_time(841); printf("获取某一进程的CPU利用率:%0.1f\n", kdk_get_process_cpu_usage_percent(841)); printf("获取某一进程的内存占用率:%0.1f\n", kdk_get_process_mem_usage_percent(841)); printf("获取某一进程的进程状态:%s\n", kdk_get_process_status(841)); printf("获取某一进程的进程端口号:%d\n", kdk_get_process_port(841)); printf("获取某一进程的启动时间:%s\n", start_time); printf("获取某一进程的运行时间:%s\n", run_time); printf("获取某一进程的CPU时间:%s\n", cpu_time); printf("获取某一进程的Command:%s\n", cmd); printf("获取某一进程的属主:%s\n", kdk_get_process_user(841)); free(run_time); free(cpu_time); free(cmd); free(start_time); char** pid = kdk_procname_get_process_infomation("systemd"); size_t index = 0; while (pid[index]) { printf("pid %s\n", pid[index]); index ++; } kdk_proc_freeall(pid); char** info = kdk_get_process_all_information(); size_t count = 0; while (info[count]) { printf("No. %d\t %s\n", count + 1, info[count]); count ++; } kdk_proc_freeall(info); char *name = kdk_get_process_name(1151571); printf("name = %s\n", name); free(name); int id = kdk_get_process_id("systemd"); printf("pid %d\n", id); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_get_process_name (), .BR kdk_get_process_id (), .BR kdk_get_process_cpu_usage_percent (), .BR kdk_get_process_mem_usage_percent (), .BR kdk_get_process_status (), .BR kdk_get_process_port (), .BR kdk_get_process_running_time (), .BR kdk_get_process_cpu_time (), .BR kdk_get_process_command (), .BR kdk_get_process_user (), .BR kdk_procname_get_process_infomation (), .BR kdk_get_process_all_information () and .BR kdk_proc_freeall (). .SH "SEE ALSO" .BR kdk_get_process_name (3), .BR kdk_get_process_id (3), .BR kdk_get_process_cpu_usage_percent (3), .BR kdk_get_process_mem_usage_percent (3), .BR kdk_get_process_status (3), .BR kdk_get_process_port (), .BR kdk_get_process_running_time (3), .BR kdk_get_process_cpu_time (3), .BR kdk_get_process_command (3), .BR kdk_get_process_user (3), .BR kdk_procname_get_process_infomation (3), .BR kdk_get_process_all_information (3) and .BR kdk_proc_freeall (3).libkysdk-system/man/systeminfo/0000775000175000017500000000000015171302542015611 5ustar fengfenglibkysdk-system/man/systeminfo/kdk_system_get_eUser_login_time.30000664000175000017500000001465415171302542024274 0ustar fengfeng.TH "KDK_SYSTEM_GET_EUSER_LOGIN_TIME" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_eUser_login_time - 获取当前登录用户的登录时间 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_get_eUser_login_time();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the logon time of the currently logged-on user. .SH "RETURN VALUE" On success, returns the logon time of the currently logged-on user of type char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_resolving_freeall.30000664000175000017500000001450415171302542022234 0ustar fengfeng.TH "KDK_RESOLVING_FREEALL" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_resolving_freeall - 用于回收字符串列表 .SH SYNOPSIS .nf .B #include .sp .BI "extern inline void kdk_resolving_freeall(char **"ptr ");" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to recycle a list of strings of type char **. .PP The argument .I ptr is a list of strings of type char **. .SH "RETURN VALUE" No return value .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_system_get_appScene.30000664000175000017500000001452715171302542022540 0ustar fengfeng.TH "KDK_SYSTEM_GET_APPSCENE" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_appScene - 获取应用场景 .SH SYNOPSIS .nf .B #include .sp .BI "extern char *kdk_system_get_appScene();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain application scenarios. .SH "RETURN VALUE" On success, returns the application scenarios of type char*; The content is {EDU}; The returned string needs to be released by .I free . .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), and .BR kdk_hw_free_pci_info (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), and .BR kdk_hw_free_pci_info (3).libkysdk-system/man/systeminfo/kdk_system_get_systemName.30000664000175000017500000001447515171302542023131 0ustar fengfeng.TH "KDK_SYSTEM_GET_SYSTEMNAME" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_systemName - 获取操作系统名称 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_get_systemName();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain operating system name. .SH "RETURN VALUE" On success, returns operating system name of type char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_architecture (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_system_get_projectSubName.30000664000175000017500000001463715171302542023725 0ustar fengfeng.TH "KDK_SYSTEM_GET_PROJECTSUBNAME" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_projectSubName - 获取操作系统项目子编号名 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_get_projectSubName();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the operating system item subnumbered name. .SH "RETURN VALUE" On success, returns the operating system item subnumbered name of type char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_system_get_buildTime.30000664000175000017500000001457115171302542022717 0ustar fengfeng.TH "KDK_SYSTEM_GET_BUILDTIME" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_buildTime - 获取操作系统构建时间 .SH SYNOPSIS .nf .B #include .sp .BI "extern char *kdk_system_get_buildTime()" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain operating system build time. .SH "RETURN VALUE" On success, returns the operating system build time of type char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_system_get_productFeatures.30000664000175000017500000001467115171302542024161 0ustar fengfeng.TH "KDK_SYSTEM_GET_PRODUCTFEATURES" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_productFeatures - 获取操作系统产品标识码 .SH SYNOPSIS .nf .B #include .sp .BI "extern unsigned int kdk_system_get_productFeatures();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the operating system product identifier. .SH "RETURN VALUE" On success, returns the identifier code of type int; such as "0000-信息异常", "0001-仅PC特性", "0010-仅平板特性", "0011-支持平板与PC特性". .PP On error, return .BR 0. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_system_get_architecture.30000664000175000017500000001455515171302542023465 0ustar fengfeng.TH "KDK_SYSTEM_GET_ARCHITECTURE" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_architecture - 获取操作系统架构信息 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_get_architecture();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain operating system architecture information. .SH "RETURN VALUE" On success, returns operating system architecture information of type char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_system_is_zyj.30000664000175000017500000001447515171302542021454 0ustar fengfeng.TH "KDK_SYSTEM_IS_ZYJ" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_is_zyj - 判断当前镜像系统是否为专用机系统 .SH SYNOPSIS .nf .B #include .sp .BI "extern bool kdk_system_is_zyj(void);" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to determine whether the current mirror system is a dedicated machine system. .SH "RETURN VALUE" .I true means yes. .I false means no. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_system_get_hostCloudPlatform.30000664000175000017500000001512215171302542024443 0ustar fengfeng.TH "KDK_SYSTEM_GET_HOSTCLOUDPLATFORM" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_hostCloudPlatform - 获取操作系统宿主机的云平台类型 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_get_hostCloudPlatform();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the cloud platform type of the operating system host. .SH "RETURN VALUE" On success, returns the cloud platform type of type char*; The content is [none, huawei],where .I none means running on a physical machine or an unknown cloud platform environment; Other strings represent different cloud platforms. The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_system_get_eUser.30000664000175000017500000001466115171302542022064 0ustar fengfeng.TH "KDK_SYSTEM_GET_EUSER" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_eUser - 获取当前登录用户的用户名(Effect User) .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_get_eUser();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain username of the currently logged in user (Effect User). .SH "RETURN VALUE" On success, returns username of the currently logged in user of type char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_system_get_systemCategory.30000664000175000017500000001504315171302542024016 0ustar fengfeng.TH "KDK_SYSTEM_GET_SYSTEMCATEGORY" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_systemCategory - 获取显示系统硬件版本类别 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_get_systemCategory();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the display system hardware version category. .SH "RETURN VALUE" On success, returns the system hardware version category of type char*; The content is {Tablet, MaxTablet},"Tablet-平板","MaxTablet-大屏"; The file or field returned the string none without being read; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_get_host_serial.30000664000175000017500000001457215171302542021712 0ustar fengfeng.TH "KDK_GET_HOST_SERIAL" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_host_serial - 获取整机序列号 .SH SYNOPSIS .nf .B #include .sp .BI "extern char *kdk_get_host_serial();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the serial number of the whole machine. .SH "RETURN VALUE" On success, returns serial number of the whole machine of type char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_system_get_shutdown_time.30000664000175000017500000001461015171302542023664 0ustar fengfeng.TH "KDK_SYSTEM_GET_SHUTDOWN_TIME" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_shutdown_time - 获取系统关机时间 .SH SYNOPSIS .nf .B #include .sp .BI "extern char** kdk_system_get_shutdown_time();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the system shutdown time. .SH "RETURN VALUE" On success, returns a list of system shutdown time of type char**; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_system_get_word.30000664000175000017500000001444015171302542021747 0ustar fengfeng.TH "KDK_SYSTEM_GET_WORD" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_word - 获取操作系统位数 .SH SYNOPSIS .nf .B #include .sp .BI "extern int kdk_system_get_word()" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the operating system bits. .SH "RETURN VALUE" On success, returns the operating system bits of type int; such as "32","64". .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_system_get_version.30000664000175000017500000001472715171302542022471 0ustar fengfeng.TH "KDK_SYSTEM_GET_VERSION" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_version - 获取操作系统版本号 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_get_version(bool "verbose ");" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain operating system version number. .PP The argument .I verbose is 0 to obtain the abbreviated version number and 1 to obtain the detailed version number. .SH "RETURN VALUE" On success, returns operating system version number of type char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_system_get_hostVirtType.30000664000175000017500000001532615171302542023464 0ustar fengfeng.TH "KDK_SYSTEM_GET_HOSTVIRTTYPE" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_hostVirtType - 获取操作系统宿主机的虚拟机类型 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_get_hostVirtType();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the virtual machine type of the operating system host. .SH "RETURN VALUE" On success, returns the virtual machine type of type char*; The content is [none, qemu, kvm, zvm, vmware, hyper-v, orcale virtualbox, xen, bochs, uml, parallels, bhyve, qnx, arcn, openvz, lxc, lxc-libvirt, systemd-nspawn, docker, podman, rkt, wsl], where .I none indicates running in a physical environment; Other strings represent specific virtual environment types; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_system_get_startup_time.30000664000175000017500000001465315171302542023522 0ustar fengfeng.TH "KDK_SYSTEM_GET_STARTUP_TIME" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_startup_time - 获取系统开机时间 .SH SYNOPSIS .nf .B #include .sp .BI "extern char** kdk_system_get_startup_time();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the system power-on time. .SH "RETURN VALUE" On success, returns a list of system power-on time of type char**, ending with a NULL character; Generated by .I alloc and needs to be recycled by .I kdk_resolving_freeall . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_system_get_version_detaile.30000664000175000017500000001525515171302542024155 0ustar fengfeng.TH "KDK_SYSTEM_GET_VERSION_DETAILE" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_version_detaile - 获取系统版本号/补丁版本号 .SH SYNOPSIS .nf .B #include .sp .BI "extern version_t kdk_system_get_version_detaile();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the system version number or patch version number. .SH "RETURN VALUE" On success, returns a pointer to a .I version_t structure containing system version number and patch version number information. .PP The .I version_t structure is defined in .I as follows: typedef struct { char *os_version; //系统版本 char *update_version; //补丁版本 } version_t; .PP On error, return .BR NULL. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_system_get_kernelVersion.30000664000175000017500000001454515171302542023630 0ustar fengfeng.TH "KDK_SYSTEM_GET_KERNELVERSION" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_kernelVersion - 获取内核版本号 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_get_kernelVersion();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain kernel version number. .SH "RETURN VALUE" On success, returns kernel version number of type char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/libkysysinfo.30000664000175000017500000001315715171302542020431 0ustar fengfeng.TH "LIBKYSYSINFO" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_architecture, kdk_system_get_systemName, kdk_system_get_version, kdk_system_get_activationStatus, kdk_system_get_serialNumber, kdk_system_get_kernelVersion, kdk_system_get_eUser, kdk_system_get_eUser_login_time, kdk_system_get_projectName, kdk_system_get_projectSubName, kdk_system_get_productFeatures, kdk_system_get_hostVirtType, kdk_system_get_hostCloudPlatform, kdk_system_is_zyj, kdk_system_get_version_detaile, kdk_system_get_resolving_power, kdk_system_get_systemCategory, kdk_system_get_startup_time, kdk_system_get_shutdown_time, kdk_get_host_vendor, kdk_get_host_product, kdk_get_host_serial, kdk_system_get_hostName, kdk_system_get_word, kdk_system_get_buildTime, kdk_resolving_freeall, kdk_hw_get_pci_info, kdk_hw_free_pci_info, kdk_system_get_appScene - 获取操作系统基础信息 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_get_architecture();" .sp .BI "extern char* kdk_system_get_systemName();" .sp .BI "extern char* kdk_system_get_version(bool "verbose ");" .sp .BI "extern int kdk_system_get_activationStatus(int *"status_error_num ", int *"date_error_num ");" .sp .BI "extern char* kdk_system_get_serialNumber();" .sp .BI "extern char* kdk_system_get_kernelVersion();" .sp .BI "extern char* kdk_system_get_eUser();" .sp .BI "extern char* kdk_system_get_eUser_login_time();" .sp .BI "extern char* kdk_system_get_projectName();" .sp .BI "extern char* kdk_system_get_projectSubName();" .sp .BI "extern unsigned int kdk_system_get_productFeatures();" .sp .BI "extern char* kdk_system_get_hostVirtType();" .sp .BI "extern char* kdk_system_get_hostCloudPlatform();" .sp .BI "extern bool kdk_system_is_zyj(void);" .sp .BI "extern version_t kdk_system_get_version_detaile();" .sp .BI "extern char** kdk_system_get_resolving_power();" .sp .BI "extern char* kdk_system_get_systemCategory();" .sp .BI "extern char** kdk_system_get_startup_time();" .sp .BI "extern char** kdk_system_get_shutdown_time();" .sp .BI "extern char *kdk_get_host_vendor();" .sp .BI "extern char *kdk_get_host_product();" .sp .BI "extern char *kdk_get_host_serial();" .sp .BI "extern char *kdk_system_get_hostName();" .sp .BI "extern int kdk_system_get_word();" .sp .BI "extern char *kdk_system_get_buildTime();" .sp .BI "extern inline void kdk_resolving_freeall(char **"ptr ");" .sp .BI "extern struct KPci *kdk_hw_get_pci_info();" .sp .BI "extern void kdk_hw_free_pci_info(struct KPci *"info ");" .sp .BI "extern char *kdk_system_get_appScene();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" This library contains instantaneous information about the current system. .SH DATA STRUCTURES Structure \fBversion_t\fR contains information related to a system version number and patch version number information: \fBtypedef struct { .br char *os_version; //系统版本 char *update_version; //补丁版本 .br } version_t;\fP There are other members not documented here, which are only meant for libkysysinfo internal use. Structure \fBKPci\fR contains information related to a pci bus information: \fBstruct KPci { .br char slot_path[16]; char class_name[128]; char product_name[128]; unsigned char rev; char ss_name[256]; char driver_use[1024]; char **modules; int module_count; struct KPci *next; .br };\fP There are other members not documented here, which are only meant for libkysysinfo internal use. .SH "RETURN VALUE" The return value is generally specific to the individual function called. .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_architecture (), .BR kdk_system_get_systemName (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_architecture (3), .BR kdk_system_get_systemName (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_hw_free_pci_info.30000664000175000017500000001463315171302542022022 0ustar fengfeng.TH "KDK_HW_FREE_PCI_INFO" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_hw_free_pci_info - 释放由kdk_hw_get_pci_info返回的pci总线信息结构体 .SH SYNOPSIS .nf .B #include .sp .BI "extern void kdk_hw_free_pci_info(struct KPci *"info ");" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to release the pci bus information structure returned by the .I kdk_hw_get_pci_info. .PP The argument .I info is the return value of the .I kdk_hw_get_pci_info. .SH "RETURN VALUE" No return value .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_get_host_product.30000664000175000017500000001454015171302542022106 0ustar fengfeng.TH "KDK_GET_HOST_PRODUCT" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_host_product - 获取整机型号 .SH SYNOPSIS .nf .B #include .sp .BI "extern char *kdk_get_host_product();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the complete machine model. .SH "RETURN VALUE" On success, returns complete machine model of type char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_hw_get_pci_info.30000664000175000017500000001540315171302542021654 0ustar fengfeng.TH "KDK_HW_GET_PCI_INFO" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_hw_get_pci_info - 获取总线信息 .SH SYNOPSIS .nf .B #include .sp .BI "extern struct KPci *kdk_hw_get_pci_info();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain bus information. .SH "RETURN VALUE" On success, returns a pointer to a .I KPci structure containing pci bus information. .PP The .I KPci structure is defined in .I as follows: struct KPci { char slot_path[16]; char class_name[128]; char product_name[128]; unsigned char rev; char ss_name[256]; char driver_use[1024]; char **modules; int module_count; struct KPci *next; }; .PP On error, return .BR NULL. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_system_get_projectName.30000664000175000017500000001461715171302542023251 0ustar fengfeng.TH "KDK_SYSTEM_GET_PROJECTNAME" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_projectName - 获取操作系统项目编号名 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_get_projectName();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the operating system item number name. .SH "RETURN VALUE" On success, returns the operating system item number name of type char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_get_host_vendor.30000664000175000017500000001456015171302542021725 0ustar fengfeng.TH "KDK_GET_HOST_VENDOR" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_get_host_vendor - 获取整机制造商 .SH SYNOPSIS .nf .B #include .sp .BI "extern char *kdk_get_host_vendor();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the complete machine manufacturer. .SH "RETURN VALUE" On success, returns complete machine manufacturer of type char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_system_get_hostName.30000664000175000017500000001451215171302542022552 0ustar fengfeng.TH "KDK_SYSTEM_GET_HOSTNAME" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_hostName - 获取主机名 .SH SYNOPSIS .nf .B #include .sp .BI "extern char *kdk_system_get_hostName();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the host name. .SH "RETURN VALUE" On success, returns the host name of type char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_system_get_resolving_power.30000664000175000017500000001503615171302542024222 0ustar fengfeng.TH "KDK_SYSTEM_GET_RESOLVING_POWER" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_resolving_power - 获取系统当前显示屏幕,分辨率,系统支持分辨率 .SH SYNOPSIS .nf .B #include .sp .BI "extern char** kdk_system_get_resolving_power();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the current display screen of the system, the resolution, the resolution supported by the system. .SH "RETURN VALUE" On success, returns a list of resolution information of type char**, ending with a NULL character; Generated by .I alloc and needs to be recycled by .I kdk_resolving_freeall . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_system_get_activationStatus.30000664000175000017500000001523115171302542024340 0ustar fengfeng.TH "KDK_SYSTEM_GET_ACTIVATIONSTATUS" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_activationStatus - 获取操作系统激活状态 .SH SYNOPSIS .nf .B #include .sp .BI "extern int kdk_system_get_activationStatus(int *"status_error_num ", int *"date_error_num ");" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain operating system activation status. .PP The argument .I status_error_num is used to receive error messages about the activation status. .PP The argument .I date_error_num is used to receive get technical service status error messages. .SH "RETURN VALUE" On success, returns operating system activation status of type int; 2 means expired; 0 means not activated and in the trial period; 1 means activated. .PP On error, return .BR -1. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_serialNumber (), .BR kdk_system_get_version (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_serialNumber (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/systeminfo/kdk_system_get_serialNumber.30000664000175000017500000001462615171302542023432 0ustar fengfeng.TH "KDK_SYSTEM_GET_SERIALNUMBER" 3 "Tue Sep 19 2023" "Linux Programmer's Manual" \" .SH NAME kdk_system_get_serialNumber - 获取操作系统服务序列号 .SH SYNOPSIS .nf .B #include .sp .BI "extern char* kdk_system_get_serialNumber();" .sp Link with \fI\-lkysysinfo\fP. .SH "Detailed Description" The main function of the interface is to obtain the operating system service serial number. .SH "RETURN VALUE" On success, returns operating system service serial number of type char*; The returned string needs to be released by .I free . .PP On error, return .BR NULL. .SH EXAMPLES .EX #include #include #include int main() { char *res = kdk_system_get_architecture(); printf("架构:%s\n", res); free(res); res = kdk_system_get_systemName(); printf("系统名称:%s\n", res); free(res); res = kdk_system_get_version(0); printf("系统简略版本:%s\n", res); free(res); res = kdk_system_get_version(1); printf("系统详细版本:%s\n", res); free(res); res = kdk_system_get_kernelVersion(); printf("内核版本:%s\n", res); free(res); res = kdk_system_get_serialNumber(); printf("序列号:%s\n", res); free(res); int p; int d; int act = kdk_system_get_activationStatus(&p,&d); printf("--------------\n"); printf("激活状态码:%d\n",act); printf("激活状态:%s\n", act == 1 ? "已激活" : act == 0 ? "未激活" : "已过期"); res = kdk_system_get_eUser(); printf("当前用户:%s\n", res); // free(res); res = kdk_system_get_eUser_login_time(); printf("登录时间:%s\n", res); res = kdk_system_get_projectName(); printf("项目编号名:%s\n", res); free(res); int zyj = kdk_system_is_zyj(); printf("专用机:%s\n", zyj == 0 ? "非专用机":"专用机"); res = kdk_system_get_hostVirtType(); printf("虚拟机类型:%s\n", res); free(res); res = kdk_system_get_hostCloudPlatform(); printf("云平台类型:%s\n", res); free(res); version_t test = kdk_system_get_version_detaile( ); printf("test.os_version = %s\n",test.os_version); printf("test.update_version = %s\n",test.update_version); char** name = kdk_system_get_resolving_power(); // printf("name = %s\n", name); size_t count = 0; while (name[count]) { printf("No. %d\t %s\n", count + 1, name[count]); count ++; } kdk_resolving_freeall(name); char *ver = kdk_system_get_systemCategory(); printf("系统硬件版本类别 = %s\n", ver); free(ver); // ver = kdk_system_get_cloudPlatformType(); // printf("云平台类型 = %s\n", ver); // free(ver); char **ud_time = kdk_system_get_startup_time(); count = 0; while (ud_time[count]) { printf("开机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); ud_time = kdk_system_get_shutdown_time(); count = 0; while (ud_time[count]) { printf("关机时间 = %s\n", ud_time[count]); count++; } kdk_resolving_freeall(ud_time); res = kdk_get_host_vendor(); printf("整机制造商 = %s\n", res); free(res); res = kdk_get_host_product(); printf("整机型号 = %s\n", res); free(res); res = kdk_get_host_serial(); printf("整机序列号 = %s\n", res); free(res); res = kdk_system_get_buildTime(); printf("构建时间:%s\n", res); free(res); res = kdk_system_get_hostName(); printf("主机名:%s\n", res); free(res); printf("系统位数:%d\n", kdk_system_get_word()); struct KPci *pci = kdk_hw_get_pci_info(); struct KPci *tmp = pci; while (tmp) { printf("slot path : %s\n", tmp->slot_path); printf("\tclass name :%s\n", tmp->class_name); printf("\tproduct name :%s\n", tmp->product_name); printf("\trev :%02x\n", tmp->rev); printf("\tsubsystem name :%s\n", tmp->ss_name); printf("\tdriver user :%s\n", tmp->driver_use); printf("\tmodules :"); for(int i = 0; i < tmp->module_count; i++) { printf("\t%s", tmp->modules[i]); } printf("\n"); tmp = tmp->next; } kdk_hw_free_pci_info(pci); res = kdk_system_get_appScene(); printf("应用场景:%s\n", res); free(res); return 0; } .SH "CONFORMING TO" These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: .BR kdk_system_get_systemName (), .BR kdk_system_get_architecture (), .BR kdk_system_get_activationStatus (), .BR kdk_system_get_version (), .BR kdk_system_get_kernelVersion (), .BR kdk_system_get_eUser (), .BR kdk_system_get_eUser_login_time (), .BR kdk_system_get_projectName (), .BR kdk_system_get_projectSubName (), .BR kdk_system_get_productFeatures (), .BR kdk_system_get_hostVirtType (), .BR kdk_system_get_hostCloudPlatform (), .BR kdk_system_is_zyj (), .BR kdk_system_get_version_detaile (), .BR kdk_system_get_resolving_power (), .BR kdk_system_get_systemCategory (), .BR kdk_system_get_startup_time (), .BR kdk_system_get_shutdown_time (), .BR kdk_get_host_vendor (), .BR kdk_get_host_product (), .BR kdk_get_host_serial (), .BR kdk_system_get_hostName (), .BR kdk_system_get_word (), .BR kdk_system_get_buildTime (), .BR kdk_resolving_freeall (), .BR kdk_hw_get_pci_info (), .BR kdk_hw_free_pci_info (), and .BR kdk_system_get_appScene (). .SH "SEE ALSO" .BR kdk_system_get_systemName (3), .BR kdk_system_get_architecture (3), .BR kdk_system_get_version (3), .BR kdk_system_get_activationStatus (3), .BR kdk_system_get_kernelVersion (3), .BR kdk_system_get_eUser (3), .BR kdk_system_get_eUser_login_time (3), .BR kdk_system_get_projectName (3), .BR kdk_system_get_projectSubName (3), .BR kdk_system_get_productFeatures (3), .BR kdk_system_get_hostVirtType (3), .BR kdk_system_get_hostCloudPlatform (3), .BR kdk_system_is_zyj (3), .BR kdk_system_get_version_detaile (3), .BR kdk_system_get_resolving_power (3), .BR kdk_system_get_systemCategory (3), .BR kdk_system_get_startup_time (3), .BR kdk_system_get_shutdown_time (3), .BR kdk_get_host_vendor (3), .BR kdk_get_host_product (3), .BR kdk_get_host_serial (3), .BR kdk_system_get_hostName (3), .BR kdk_system_get_word (3), .BR kdk_system_get_buildTime (3), .BR kdk_resolving_freeall (3), .BR kdk_hw_get_pci_info (3), .BR kdk_hw_free_pci_info (3), and .BR kdk_system_get_appScene (3).libkysdk-system/man/command/0000775000175000017500000000000015171302542015027 5ustar fengfenglibkysdk-system/man/command/kylin-sysinfo.10000664000175000017500000000350115171302542017726 0ustar fengfeng.TH KYLIN-SYSINFO 1 "2025" "Version 1.0" "User Commands" .SH NAME kylin-sysinfo \- System version information display tool .SH SYNOPSIS .B kylin-sysinfo .RI