Commit 1b8f4045 authored by saeed's avatar saeed
Browse files

modification on getobs

parent f24c960c
......@@ -10,7 +10,7 @@ if [ $issh -eq 1 ];then
fi
if [ $iobs -eq 1 ];then
gcc -o getobs -O2 -march=native -std=c99 -Wall -D_GNU_SOURCE getobs.c
gcc -o getobs -O2 -march=native -std=c99 -Wall -D_GNU_SOURCE -Dsort=1 getobs.c
fi
if [ $isvg -eq 1 ];then
......
......@@ -17,7 +17,7 @@ int main(int argc,char *argv[])
int portno = 80;
char *host = "oceandata.smhi.se";
//char message[] = "GET /ssh/viken/OBSERVATION?from=2017100100&too=2018032000 HTTP/1.1\r\nHost: oceandata.smhi.se\r\nConnection:close\r\n\r\n";
char message[] = "GET /ssh/goteborg/OBSERVATION?from=2017010100&too=2018032800 HTTP/1.0\r\nHost: oceandata.smhi.se\r\n\r\n";
char message[] = "GET /ssh/goteborg/OBSERVATION?from=2017030100&too=2018030100 HTTP/1.0\r\nHost: oceandata.smhi.se\r\n\r\n";
int M = sizeof(message);
//printf("%s\n",message);
//printf("%d\n",M);
......@@ -146,6 +146,7 @@ int main(int argc,char *argv[])
int icom = 0, iicom = 0;
char **cout =split(st, ',', &icom);
if ( icom > 1){
char **ccout = NULL;
int *atime = (int *)malloc(sizeof(int)*icom);
float *adata = (float *)malloc(sizeof(float)*icom);
......@@ -162,10 +163,10 @@ int main(int argc,char *argv[])
free(ccout);
}
free(content);
free(cout);
#if sort
sortfull(atime,adata,icom);
#endif
for (int i=0; i < (icom); ++i){
printf("%d\t%f\n",atime[i] ,adata[i]);
......@@ -173,8 +174,12 @@ int main(int argc,char *argv[])
free(atime);
free(adata);
}
//printf("%s",content);
free(content);
free(cout);
/* process response */
//printf("Response:\n%s\n",response);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment