merge my fix
git-svn-id: http://192.168.1.226/svn/proxy@4 454eff88-639b-444f-9e54-f578c98de674
| | |
| | | char* user="supervisor"; |
| | | char* pass="supervisor"; |
| | | int Channel=0; |
| | | int s_year=2016,s_month=12,s_day=6,s_hour=17,s_min=27,s_sec=41; |
| | | int e_year=2016,e_month=12,e_day=7,e_hour=19,e_min=27,e_sec=41; |
| | | int s_year=2016,s_month=12,s_day=8,s_hour=10,s_min=27,s_sec=41; |
| | | int e_year=2016,e_month=12,e_day=8,e_hour=14,e_min=27,e_sec=41; |
| | | printf("========================start============\n"); |
| | | result=GetPHPSearchMetaInfo(AnaylserIP,user,pass,Channel,s_year,s_month,s_day,s_hour,s_min,s_sec,e_year,e_month,e_day,e_hour,e_min,e_sec); //potection function |
| | | //result=GetDeviceInfo(AnaylserIP); |
| | | printf("serchresult=%s\n",result); |
| | | |
| | | //Channel=1; |
| | | //s_day=7; |
| | | //printf("========================start============\n"); |
| | | //result=GetPHPSearchMetaInfo(AnaylserIP,user,pass,Channel,s_year,s_month,s_day,s_hour,s_min,s_sec,e_year,e_month,e_day,e_hour,e_min,e_sec); //potection function |
| | | ////result=GetDeviceInfo(AnaylserIP); |
| | | //printf("serchresult=%s\n",result); |
| | | // |
| | | //Channel=0; |
| | | //s_day=8; |
| | | //printf("========================start============\n"); |
| | | //result=GetPHPSearchMetaInfo(AnaylserIP,user,pass,Channel,s_year,s_month,s_day,s_hour,s_min,s_sec,e_year,e_month,e_day,e_hour,e_min,e_sec); //potection function |
| | | ////result=GetDeviceInfo(AnaylserIP); |
| | | //printf("serchresult=%s\n",result); |
| | | // |
| | | // |
| | | //Channel=1; |
| | | //s_day=7; |
| | | //printf("========================start============\n"); |
| | | //result=GetPHPSearchMetaInfo(AnaylserIP,user,pass,Channel,s_year,s_month,s_day,s_hour,s_min,s_sec,e_year,e_month,e_day,e_hour,e_min,e_sec); //potection function |
| | | ////result=GetDeviceInfo(AnaylserIP); |
| | | //printf("serchresult=%s\n",result); |
| | | |
| | | return 1; |
| | | } |
| | |
| | | rm /tmp/tmpZip -r |
| | | |
| | | rm demo *.o *.so |
| | | rm /usr/local/lib/libproxy.so |
| | | |
| | | gcc -g -c -fPIC -o proxy.o proxyserver.c |
| | | gcc -shared -pthread -o libproxy.so proxy.o -lmysqlclient |
| | | gcc -std=gnu99 -g -c -fPIC -o proxy.o proxyserver.c |
| | | gcc -std=gnu99 -shared -pthread -o libproxy.so proxy.o -lmysqlclient |
| | | |
| | | if [ $? -ne 0 ]; then |
| | | exit |
| | | fi |
| | | |
| | | cp libproxy.so /usr/local/lib |
| | | /sbin/ldconfig |
| | | gcc -g -o demo main.c -lproxy |
| | | gcc -std=gnu99 -g -o demo main.c -lproxy |
| | | |
| | | service apache2 restart |
| | |
| | | |
| | | #include<dirent.h> |
| | | #include"proxyserver.h" |
| | | #include <syslog.h> |
| | | |
| | | |
| | | int RequestChannel; |
| | | char* gAnalyzerIP; |
| | | char* gUser; |
| | |
| | | int ZipSerFileNum=0; |
| | | int ZipCountidx; |
| | | char NetInfo[128]; |
| | | char EventString[5000 * 1024]; |
| | | EVENT_LOG myEventLogs[1000 * 1024]; |
| | | char EventString[1 * 1024 * 1024]; |
| | | EVENT_LOG myEventLogs[2000]; |
| | | int EventCount=0; |
| | | int EventCountInSearchRange=0; |
| | | |
| | |
| | | #define fileread_buf 128 |
| | | AlarmInfo RealAlarmEvent[16][1000]; |
| | | |
| | | //#define DBG_LOG |
| | | #define DBG_LOG |
| | | #define ZIP_HOME "/tmp" |
| | | |
| | | ///////////////////////////////////////////////// |
| | |
| | | } |
| | | char* GetDeviceInfo(char* AnalyserIP) |
| | | { |
| | | memset(EventString,0,100000); |
| | | memset(EventString,0,sizeof(EventString)); |
| | | gAnalyzerIP = AnalyserIP; |
| | | |
| | | if(AnalyserIP==NULL || AnalyserIP[0]==0) return "Param Error"; |
| | |
| | | length = sprintf(byte_array,"GET /PSIA/System/deviceInfo HTTP/1.1\r\nContent-Type: text/xml\r\nHost: %s\r\nContent-Length: 0\r\nConnection: Keep-Alive\r\n\r\n",AnalyserIP); |
| | | write(GSocket,byte_array,length); |
| | | // printf("%s",byte_array); |
| | | memset(EventString,0,100000); |
| | | memset(EventString,0,sizeof(EventString)); |
| | | while(1){ |
| | | memset(buff,0,sizeof(buff)); |
| | | length=read(GSocket,&buff,sizeof(buff)); |
| | |
| | | return ret; |
| | | |
| | | } |
| | | char* GetAnalyserAll() //9.查询设备 参数:无 返回:分析器的名称和ip |
| | | char* GetAnalyserAll() //9.鏌ヨ璁惧 鍙傛暟锛氭棤 杩斿洖锛氬垎鏋愬櫒鐨勫悕绉板拰ip |
| | | { |
| | | memset(EventString,0,100000); |
| | | memset(EventString,0,sizeof(EventString)); |
| | | int ret = Read_MysqlData(); |
| | | if(ret==0) return EventString; |
| | | else return "fail"; |
| | | } |
| | | char* GetAnalyserNet(void) //5.获取当前转发器的ip 参数:无。返回:当前的ip地址子网掩码和网关 |
| | | char* GetAnalyserNet(void) //5.鑾峰彇褰撳墠杞彂鍣ㄧ殑ip 鍙傛暟锛氭棤銆傝繑鍥烇細褰撳墠鐨刬p鍦板潃瀛愮綉鎺╃爜鍜岀綉鍏? |
| | | { |
| | | memset(NetInfo,0,128); |
| | | /// function |
| | | return NetInfo; |
| | | } |
| | | |
| | | int SetAnalyserNet(char* NetInfo) //6.手动设置转发器的ip 参数:ip,子网掩码,默认网关 。 返回:修改状态(成功或者失败) |
| | | int SetAnalyserNet(char* NetInfo) //6.鎵嬪姩璁剧疆杞彂鍣ㄧ殑ip 鍙傛暟锛歩p锛屽瓙缃戞帺鐮侊紝榛樿缃戝叧 銆?杩斿洖锛氫慨鏀圭姸鎬?鎴愬姛鎴栬€呭け璐? |
| | | { |
| | | int ret=0; |
| | | /// function |
| | |
| | | char* GetRealEvent(char* AnalyserIP) //3.查看实时监控 参数:分析器IP。返回:信道号及其对应的视频流地址 |
| | | { |
| | | int Idx=FindIdx(AnalyserIP); |
| | | memset(EventString,0,100000); |
| | | memset(EventString,0,sizeof(EventString)); |
| | | if(Idx>=0 && Idx<16 && RealAlarmEventNum[Idx]>0){ |
| | | for (int i=0;i<RealAlarmEventNum[Idx];i++) |
| | | { |
| | |
| | | //// 输出:查询结果。(包括信道号,报警时间,播放地址,等。) |
| | | char* GetPHPSearchMetaInfo(char* AnalyserIP,char* user,char* pass,int Channel,int s_year,int s_month,int s_day,int s_hour,int s_minute,int s_sec,int e_year,int e_month,int e_day,int e_hour,int e_minute,int e_sec) |
| | | { |
| | | openlog("proxyserver", LOG_CONS | LOG_PID, 0); |
| | | |
| | | char* result; |
| | | MyTime mstart_time; |
| | | mstart_time.Year=s_year; |
| | |
| | | } |
| | | |
| | | |
| | | void DownloadSerFile(const char* uri) |
| | | { |
| | | return; |
| | | char buff[1024]; |
| | | sprintf(buff, "cd " ZIP_HOME "/tmpZip/;" " curl -u supervisor:supervisor 'http://%s%s' -O" , gAnalyzerIP, uri); |
| | | int ret = system(buff); |
| | | printf("DownloadSerFile, ret=%d, %s\n", ret, buff); |
| | | |
| | | } |
| | | |
| | | |
| | | //// 查询报警记录 |
| | |
| | | //// 输出:查询结果。(包括信道号,报警时间,播放地址,等。) |
| | | char* GetSearchMetaInfo(char* AnalyserIP,char* user,char* pass,int Channel,lpMyTime StartTm,lpMyTime EndTm) |
| | | { |
| | | //reset |
| | | memset(ZipSerFileName, 0, sizeof(ZipSerFileName)); |
| | | ZipSerFileNum=0; |
| | | ZipCountidx; |
| | | EventCount = 0; |
| | | EventCountInSearchRange = 0; |
| | | RequestChannel = -1; |
| | | memset(myEventLogs, 0, sizeof(myEventLogs)); |
| | | memset(EventString, 0, sizeof(EventString)); |
| | | memset(byte_array, 0, sizeof(byte_array)); |
| | | |
| | | RequestChannel = Channel; |
| | | gAnalyzerIP = AnalyserIP; |
| | | gUser = user; |
| | |
| | | if(AnalyserIP==NULL || AnalyserIP[0]==0) return "-1"; |
| | | // if(gGettingStep>0) return -2; |
| | | |
| | | chmod(ZIP_HOME,0777); |
| | | //delete_file(ZIP_HOME "/tmp/tmp.zip"); |
| | | //chmod(ZIP_HOME,0777); |
| | | //delete_file(ZIP_HOME "/tmp.zip"); |
| | | //delete_file(ZIP_HOME "/tmpZip/*"); |
| | | |
| | | struct tm ttm; |
| | |
| | | int length; |
| | | char* httpUri; |
| | | char sss[24],eee[24]; |
| | | chmod("/home",0777);//#todo ZIP_HOME |
| | | chmod(ZIP_HOME,0777); |
| | | const char* folderr; |
| | | const char* filename1; |
| | | folderr="/home/tmpZip"; |
| | | filename1="/home/tmp.zip"; |
| | | folderr=ZIP_HOME "/tmpZip"; |
| | | filename1=ZIP_HOME "/tmp.zip"; |
| | | struct stat sb; |
| | | if(stat(folderr,&sb)==0 && S_ISDIR(sb.st_mode)) |
| | | { |
| | | delete_folder("/home/tmpZip"); |
| | | } |
| | | if (doesFileExist(filename1)) |
| | | { |
| | | delete_file("/home/tmp.zip"); |
| | | } |
| | | //if(stat(folderr,&sb)==0 && S_ISDIR(sb.st_mode)) |
| | | // { |
| | | delete_folder(ZIP_HOME "/tmpZip"); |
| | | // } |
| | | //if (doesFileExist(filename1)) |
| | | // { |
| | | delete_file(ZIP_HOME "/tmp.zip"); |
| | | // } |
| | | if(RequestChannel==0) httpUri= "/PSIA/VIQ/Event/metadata/0/files"; |
| | | if(RequestChannel==1) httpUri= "/PSIA/VIQ/Event/metadata/1/files"; |
| | | if(RequestChannel==2) httpUri= "/PSIA/VIQ/Event/metadata/2/files"; |
| | |
| | | SearchEndTm -= 8 * 60 * 60; |
| | | |
| | | #ifdef DBG_LOG |
| | | printf("stm=%d,etm=%d\n",(int)SearchStartTm,(int)SearchEndTm); |
| | | syslog(LOG_USER | LOG_INFO, "SearchStartTm=%d,SearchEndTm=%d\n",(int)SearchStartTm,(int)SearchEndTm); |
| | | #endif |
| | | |
| | | //for (StepTm=SearchEndTm; StepTm>SearchStartTm; StepTm-=1*3600) |
| | |
| | | struct sockaddr_in servaddr; |
| | | int strlen1=sizeof(servaddr); |
| | | if((GSocket=socket(PF_INET,SOCK_STREAM,0))<0){ |
| | | perror("socket fail2"); |
| | | syslog(LOG_USER | LOG_INFO, "socket fail2"); |
| | | return "-3"; |
| | | } |
| | | memset(&servaddr,0,strlen1); |
| | |
| | | servaddr.sin_port=htons(80); |
| | | |
| | | if(connect(GSocket,(struct sockaddr*)&servaddr,strlen1)<0){ |
| | | printf("Equipment connect fail-%s:%d\n",gAnalyzerIP,80); |
| | | syslog(LOG_USER | LOG_INFO, "Equipment connect fail-%s:%d\n",gAnalyzerIP,80); |
| | | close(GSocket); |
| | | return "-4"; |
| | | } |
| | |
| | | sprintf(eee,"%d-%02d-%02dT%02d:%02d:%02d.000",t->tm_year+1900,t->tm_mon+1,t->tm_mday,t->tm_hour,t->tm_min,t->tm_sec);// = "2016-08-26T07:31:00.000"; |
| | | eee[23]=0; |
| | | #ifdef DBG_LOG |
| | | printf("sss=%s, eee=%s\n", sss, eee); |
| | | syslog(LOG_USER | LOG_INFO, "SearchStartTm=%s, SearchEndTm=%s\n", sss, eee); |
| | | #endif |
| | | RequestMetaFiles(gAnalyzerIP,httpUri,sss,eee); |
| | | write(GSocket,byte_array,strlen(byte_array)); |
| | |
| | | memcpy(buff,tmpp,SSize); |
| | | free(tmpp); |
| | | goto lpp123; |
| | | printf("**********Special*******************************ZipSerFileNum = %d",ZipSerFileNum); |
| | | syslog(LOG_USER | LOG_INFO, "**********Special*******************************ZipSerFileNum = %d",ZipSerFileNum); |
| | | } |
| | | } |
| | | else{ |
| | |
| | | free(memoryband[0]); |
| | | bandCount = 0; |
| | | bMetadataSaving = 0; |
| | | buff[eidx]=0; |
| | | buff[eidx]=0; //meta buff complete |
| | | int ptr=0; |
| | | ////// analyze buffer |
| | | lpp123: sidx = stringcmp((char*)&buff[ptr],"http://changeit:80/media",24); |
| | |
| | | char pathbuf[250] ; |
| | | strncpy(pathbuf,(char*)&buff[ptr+sidx+18],kkk-sidx-18+4); |
| | | pathbuf[kkk-sidx-18+4]=0; |
| | | syslog(LOG_USER | LOG_INFO, "pathbuf=%s\n", pathbuf); |
| | | int i; |
| | | for (i=0;i<ZipSerFileNum;i++) |
| | | { |
| | |
| | | }//for |
| | | |
| | | //////// get |
| | | #ifdef DBG_LOG |
| | | syslog(LOG_USER | LOG_INFO, "ZipSerFileNum=%d\n", ZipSerFileNum); |
| | | #endif |
| | | |
| | | for(ZipCountidx = 0; ZipCountidx<ZipSerFileNum; ZipCountidx++) |
| | | { |
| | | if(stringcmp((char*)ZipSerFileName[ZipCountidx],".ser",4)>=0) continue; |
| | | #ifdef DBG_LOG |
| | | syslog(LOG_USER | LOG_INFO, "ZipSerFileName[%d]=%s\n", ZipCountidx, (char*)ZipSerFileName[ZipCountidx]); |
| | | #endif |
| | | |
| | | if(stringcmp((char*)ZipSerFileName[ZipCountidx],".ser",4)>=0) |
| | | { |
| | | DownloadSerFile(ZipSerFileName[ZipCountidx]); |
| | | continue; |
| | | } |
| | | |
| | | zclock_sleep(200); |
| | | // printf(" ==== Search loop function execution =================%d,%d \n",(int)StepTm,(int)SearchStartTm); |
| | | struct sockaddr_in servaddr; |
| | | int strlen1=sizeof(servaddr); |
| | | if((GSocket=socket(PF_INET,SOCK_STREAM,0))<0){ |
| | | perror("socket fail2"); |
| | | syslog(LOG_USER | LOG_INFO, "socket fail2"); |
| | | return "-3"; |
| | | } |
| | | memset(&servaddr,0,strlen1); |
| | |
| | | servaddr.sin_port=htons(80); |
| | | |
| | | if(connect(GSocket,(struct sockaddr*)&servaddr,strlen1)<0){ |
| | | printf("Equipment connect fail-%s:%d\n",gAnalyzerIP,80); |
| | | syslog(LOG_USER | LOG_INFO, "Equipment connect fail-%s:%d\n",gAnalyzerIP,80); |
| | | close(GSocket); |
| | | return "-4"; |
| | | } |
| | |
| | | bZipFileSaving = 0; |
| | | close(GSocket); |
| | | //Convert Zip file to Ser file |
| | | system("unzip -o " ZIP_HOME "/tmp.zip -d " ZIP_HOME "/tmpZip"); |
| | | int ret=system("unzip -o " ZIP_HOME "/tmp.zip -d " ZIP_HOME "/tmpZip"); |
| | | #ifdef DBG_LOG |
| | | syslog(LOG_USER | LOG_INFO, "unzip1 ret=%d\n", ret); |
| | | #endif |
| | | } |
| | | } |
| | | else{ |
| | |
| | | bZipFileSaving = 0; |
| | | close(GSocket); |
| | | //Convert Zip file to Ser file |
| | | system("unzip -o " ZIP_HOME "/tmp.zip -d " ZIP_HOME "/tmpZip"); |
| | | int ret=system("unzip -o " ZIP_HOME "/tmp.zip -d " ZIP_HOME "/tmpZip"); |
| | | #ifdef DBG_LOG |
| | | syslog(LOG_USER | LOG_INFO, "unzip0 ret=%d\n", ret); |
| | | #endif |
| | | } |
| | | } |
| | | } |
| | |
| | | char stringpath[1024]; |
| | | unsigned char p_save_buf[6144000]; |
| | | |
| | | for(i=0;i<num;i++) |
| | | for(int i=0;i<num;i++) |
| | | { |
| | | if(filename[i].name[0]=='.') continue; |
| | | memset(stringpath,0,1024); |
| | |
| | | memset(EventString,0,sizeof(EventString)); |
| | | //for(i=0;i<1000;i++) |
| | | #ifdef DBG_LOG |
| | | printf("EventCount===========================%d\n",EventCount); |
| | | printf("EventCountInSearchRange==============%d\n",EventCountInSearchRange); |
| | | syslog(LOG_USER | LOG_INFO, "EventCount===========================%d\n",EventCount); |
| | | syslog(LOG_USER | LOG_INFO, "EventCountInSearchRange==============%d\n",EventCountInSearchRange); |
| | | #endif |
| | | |
| | | strcat(EventString,"["); |
| | | |
| | | for (i=0;i<EventCount;i++) |
| | | for (int i=0;i<EventCount;i++) |
| | | { |
| | | #ifndef DBG_LOG |
| | | if (! myEventLogs[i].InSearchRange) |
| | |
| | | |
| | | strcat(EventString,"]"); |
| | | |
| | | //reset |
| | | //EventCount = 0;//#todo |
| | | //EventCountInSearchRange = 0; |
| | | //RequestChannel = -1; |
| | | //memset(&myEventLogs, 0, sizeof(myEventLogs)); |
| | | |
| | | return EventString; |
| | | //return "333333333333333333333333333333333333333333333333333333333333333333789"; |
| | | } |
| | |
| | | struct sockaddr_in servaddr; |
| | | int strlen1=sizeof(servaddr); |
| | | if((GSocket=socket(PF_INET,SOCK_STREAM,0))<0){ |
| | | perror("socket fail2"); |
| | | syslog(LOG_USER | LOG_INFO, "socket fail2"); |
| | | return -1; |
| | | } |
| | | memset(&servaddr,0,strlen1); |
| | |
| | | servaddr.sin_port=htons(80); |
| | | |
| | | if(connect(GSocket,(struct sockaddr*)&servaddr,strlen1)<0){ |
| | | printf("Equipment connect fail-%s:%d\n",gAnalyzerIP,80); |
| | | syslog(LOG_USER | LOG_INFO, "Equipment connect fail-%s:%d\n",gAnalyzerIP,80); |
| | | close(GSocket); |
| | | return -2; |
| | | } |
| | |
| | | |
| | | } |
| | | close(GSocket); |
| | | if (bbbb==0) return -1; |
| | | if (bbbb==0) |
| | | { |
| | | syslog(LOG_USER | LOG_INFO, "bbbb==0"); |
| | | return -1; |
| | | } |
| | | // zclock_sleep(200); |
| | | if((GSocket=socket(PF_INET,SOCK_STREAM,0))<0){ |
| | | perror("socket fail2"); |
| | | syslog(LOG_USER | LOG_INFO, "socket fail2"); |
| | | return -1; |
| | | } |
| | | memset(&servaddr,0,strlen1); |
| | |
| | | servaddr.sin_port=htons(80); |
| | | |
| | | if(connect(GSocket,(struct sockaddr*)&servaddr,strlen1)<0){ |
| | | printf("Equipment connect fail-%s:%d\n",gAnalyzerIP,80); |
| | | syslog(LOG_USER | LOG_INFO, "Equipment connect fail-%s:%d\n",gAnalyzerIP,80); |
| | | close(GSocket); |
| | | return -2; |
| | | } |
| | |
| | | |
| | | void RequestMetaFiles(char* AnaylyIP,char* httpUri,char* Tm1,char* Tm2) |
| | | { |
| | | #ifdef DBG_LOG |
| | | syslog(LOG_USER | LOG_INFO, "RequestMetaFiles, httpUri=%s\n", httpUri); |
| | | #endif |
| | | |
| | | char byte_arrayxxx[1600]; |
| | | int lengthxxx = 0; |
| | | memset(byte_array,0,1600); |
| | | memset(byte_array,0,sizeof(byte_array)); |
| | | |
| | | UrnStringToBytes(byte_arrayxxx,&lengthxxx,Tm1,Tm2);// xml |
| | | int iidx =0,llen=0;; |
| | |
| | | llen = sprintf(&byte_array[iidx],"Host: %s:%d\r\n",AnaylyIP,80); iidx+=llen; |
| | | llen = sprintf(&byte_array[iidx],"%s","Connection: Keep_Alive\r\n\r\n"); iidx+=llen; |
| | | strncpy(&byte_array[iidx],byte_arrayxxx,lengthxxx); iidx+=lengthxxx; |
| | | |
| | | } |
| | | void RequestZipSerFiles(char* AnaylyIP,char* httpUri) |
| | | { |
| | | memset(byte_array,0,1600); |
| | | #ifdef DBG_LOG |
| | | syslog(LOG_USER | LOG_INFO, "RequestZipSerFiles, httpUri=%s\n", httpUri); |
| | | #endif |
| | | |
| | | memset(byte_array,0,sizeof(byte_array)); |
| | | |
| | | int iidx =0,llen=0;; |
| | | llen = sprintf(byte_array,"GET %s %s",httpUri,"HTTP/1.1\r\n"); iidx+=llen; |
| | |
| | | if((myEventLogs[EventCount].DebugMessageE[0]!=0|| myEventLogs[EventCount].DebugMessageS[0]!=0) && myEventLogs[EventCount].Rule[0]==0 && myEventLogs[EventCount].Region[0]==0){ |
| | | memcpy(ttmp,(unsigned char*)p_save_buf,5000); |
| | | } |
| | | if(somewhat && EventCount<200-1){///repair //#todo 12.7 |
| | | if(somewhat && EventCount<2000-1){///repair //#todo 12.7 |
| | | sprintf(myEventLogs[EventCount].Camera,"%d",RequestChannel+1); |
| | | int i; |
| | | for (i=0;i<EventCount;i++) |
| | |
| | | char cmd[30]; |
| | | memset(cmd,0,30); |
| | | sprintf(cmd,"rm -f %s",path); |
| | | system(cmd); |
| | | int ret = system(cmd); |
| | | #ifdef DBG_LOG |
| | | syslog(LOG_USER | LOG_INFO, "delete_file, ret=%d, %s\n", ret, path); |
| | | #endif |
| | | } |
| | | void delete_folder(const char *path) |
| | | { |
| | | char cmd[30]; |
| | | memset(cmd,0,30); |
| | | sprintf(cmd,"rm -r %s",path); |
| | | system(cmd); |
| | | int ret = system(cmd); |
| | | #ifdef DBG_LOG |
| | | syslog(LOG_USER | LOG_INFO, "delete_folder, ret=%d, %s\n", ret, path); |
| | | #endif |
| | | } |
| | | int doesFileExist(const char *filename) |
| | | { |
| | |
| | | return output; |
| | | } |
| | | |
| | | |
| | | void zclock_sleep (int msecs) |
| | | { |
| | | struct timespec t; |
| | | t.tv_sec = msecs / 1000; |
| | | t.tv_nsec = (msecs % 1000) * 1000000; |
| | | nanosleep (&t, NULL); |
| | | } |
| | | |
| | | |
| | |
| | | #include<sys/time.h> |
| | | #include<stdbool.h> |
| | | #include<fcntl.h> |
| | | #include "/usr/include/mysql/mysql.h" |
| | | #include<sys/stat.h> |
| | | #define _DELETE_FILE |
| | | #include<dirent.h> |
| | |
| | | void UrnStringToBytes(char* byte_array_out,int * byte_array_length_out,char* StartTim,char* EndTime); |
| | | |
| | | void zclock_sleep (int msecs); |
| | | |
| | | |
| | | |
| | | void zclock_sleep (int msecs) |
| | | { |
| | | struct timespec t; |
| | | t.tv_sec = msecs / 1000; |
| | | t.tv_nsec = (msecs % 1000) * 1000000; |
| | | nanosleep (&t, NULL); |
| | | } |
| | | |
| | | typedef struct{ |
| | | char name[1024]; |