- 博客(7)
- 收藏
- 关注
转载 删除目录
#include <sys/types.h>#include <dirent.h>#include <fcntl.h>#include <stdio.h>#include <sys/stat.h>#include <strings.h>#include <stdlib.h>#include <s...
2019-05-08 19:55:49
628
原创 函数指针的经典使用
typedef enum{ RK_UPGRADE_START, RK_UPGRADE_FINISHED, RK_UPGRADE_ERR,}RK_Upgrade_Status_t; typedef void(*RK_upgrade_callback)(void *user_data, RK_Upgrade_Status_t status); //函数指...
2019-05-02 15:15:03
336
原创 修改json对象的值并进行保存
//修改json对象的值并进行保存static int parse_app_config(char *file) //file为config.json{ char *cfg = read_config_file(file, NULL); static char *state_table[] = { "words=ni hao xiao le;thresh=0.3;ma...
2019-03-11 19:23:28
9859
原创 根据时间字符串提取数字
//根据时间字符串提取数字(例:“19:30:00”)hour_minute_t num(char *p){ hour_minute_t time; int num = 0; char q[20] = {0}; int i; int j = 0; for(i = 0; p[i] != '\0'; i++) { if(p[...
2019-03-11 19:10:21
662
转载 根据日期获得星期几
//根据日期获得星期几unsigned char CaculateWeekDay(int y,int m, int d){ unsigned char buf; if(m==1||m==2) { m+=12; y--; } int iWeek=(d+2*m+3*(m+1)/5+y+y/4-y/100+y/400)%7; s...
2019-03-11 19:07:37
357
原创 将一个十进制的数转换为二进制
void binary(unsigned char val){ printf("val:%d\n",val); unsigned char tmp = 0b10000000; printf("0b"); for(int i = 0; i < 8; i++) { if((val & tmp) != 0) {...
2019-03-10 23:14:44
3049
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人