#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
#include <string.h>
void fun1()
{
char a[10] = {0};
char payload[10]= {'1','2','3','4','5','6'};
memcpy(a,payload,10);
char path[20] = {0};
sprintf(path,"%s",a);
printf("path = %s\n",path);
char cmd[255] = {0};
sprintf(cmd,"mkdir -p %s > /dev/null 2>&1 | echo ${?}",path);
FILE *fp = NULL;
fp = popen(cmd,"r");
fclose(fp);
}
void (*mediacallback)(char type, char status, char *path, void *tempdata, int arg) = NULL;
void api_setTakeCallBack(void(*callback)(char type, char status, char *path, void *tempdata, int arg)) {
puts("---------api_setTakeCallBack--------------");
mediacallback = callback;
}
int api_takePic(char type, char status, char *_pic_path, char *_name) {
puts("----------api_takePic------------");
}
void MediaRegister(char type, char st, char *path, void *tempdata, int arg) {
puts("---------MediaRegister-----------");
}
void fun()
{
static int i = 0;
i++;
printf("--------i = %d---------\n",i);
}
void fun2()
{ int i;
printf("----------i = %d--------\n",i);
}
int main()
{
// api_setTakeCallBack(MediaRegister);
// api_takePic(0, 0, 0, 0);
// mediacallback(1, 0, 0, 0, 0);
// fun();
// sleep(1);
// fun();
// fun2();
unsigned short int a = 0;
while (1)
{
/* code */
a++;
printf("---------a = %d---------\n",a);
};
return 0;
}