-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from shao0099876/qt
Qt
- Loading branch information
Showing
64 changed files
with
5,749 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
!/bin/sh | ||
|
||
#test1.cgi | ||
echo "Content-Type:text/html\n\r\n" | ||
echo "" | ||
echo "" | ||
echo "hello!" | ||
echo "\n\r\n" | ||
echo "the time is:" | ||
echo "\n\r\n" | ||
date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include<stdio.h> | ||
#include<stdlib.h> | ||
#include<string.h> | ||
#include"tools.h" | ||
#include"/arm2410cl/Trolltech/qt-embedded-4.4.0/myqt/YJSQLite.h" | ||
#define DEBUG 0 | ||
int main(){ | ||
printf("Content-type: text/html\n\n"); | ||
char* type=getenv("CONTENT_TYPE"); | ||
int length=atoi(getenv("CONTENT_LENGTH")); | ||
if(strcmp(type,"application/x-www-form-urlencoded")==0){ | ||
char *a=(char*)malloc(sizeof(char)*100); | ||
fread(a, sizeof(char), length, stdin); | ||
a[length]='\0'; | ||
char* name=analyze(a,"name"); | ||
char* langitude=analyze(a,"langitude"); | ||
char* latitude=analyze(a,"latitude"); | ||
char* altitude="0"; | ||
char* speed="0"; | ||
char* time=name; | ||
int res=sqliteDB_open(); | ||
puts(name);puts(langitude);puts(latitude);puts(altitude);puts(speed);puts(time); | ||
printf("%d",res); | ||
res=sqliteDB_opt_addpath(name,langitude,latitude,altitude,speed,time,"1"); | ||
//printf("%d",res); | ||
sqliteDB_close(); | ||
return 0; | ||
} | ||
return 0; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include<stdio.h> | ||
#include<stdlib.h> | ||
#include<string.h> | ||
#include"tools.h" | ||
#include"/arm2410cl/Trolltech/qt-embedded-4.4.0/myqt/YJSQLite.h" | ||
#define DEBUG 0 | ||
int main(){ | ||
printf("Content-type: text/html\n\n"); | ||
char* type=getenv("CONTENT_TYPE"); | ||
int length=atoi(getenv("CONTENT_LENGTH")); | ||
if(strcmp(type,"application/x-www-form-urlencoded")==0){ | ||
char *a=(char*)malloc(sizeof(char)*100); | ||
fread(a, sizeof(char), length, stdin); | ||
a[length]='\0'; | ||
char* name=analyze(a,"name"); | ||
char* langitude=analyze(a,"langitude"); | ||
char* latitude=analyze(a,"latitude"); | ||
char* altitude="0"; | ||
char* speed="0"; | ||
char* time=name; | ||
int res=sqliteDB_open(); | ||
puts(name);puts(langitude);puts(latitude);puts(altitude);puts(speed);puts(time); | ||
printf("%d",res); | ||
res=sqliteDB_opt_addpath(name,langitude,latitude,altitude,speed,time); | ||
//printf("%d",res); | ||
sqliteDB_close(); | ||
return 0; | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include<stdio.h> | ||
#include<stdlib.h> | ||
#include<string.h> | ||
#include"tools.h" | ||
#include"/arm2410cl/Trolltech/qt-embedded-4.4.0/myqt/YJSQLite.h" | ||
#define DEBUG 1 | ||
int main(){ | ||
char* type=getenv("CONTENT_TYPE"); | ||
int length=atoi(getenv("CONTENT_LENGTH")); | ||
if(strcmp(type,"application/x-www-form-urlencoded")==0){ | ||
char a[100]; | ||
fread(a, sizeof(char), length, stdin); | ||
a[length]='\0'; | ||
char* name=analyze(a,"name"); | ||
sqliteDB_open(); | ||
sqliteDB_opt_deletepath(name); | ||
sqliteDB_close(); | ||
return 0; | ||
} | ||
return 0; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include<stdio.h> | ||
#include<stdlib.h> | ||
#include<string.h> | ||
#include"tools.h" | ||
#include"/arm2410cl/Trolltech/qt-embedded-4.4.0/myqt/YJSQLite.h" | ||
#define DEBUG 1 | ||
int main(){ | ||
char* type=getenv("CONTENT_TYPE"); | ||
int length=atoi(getenv("CONTENT_LENGTH")); | ||
if(strcmp(type,"application/x-www-form-urlencoded")==0){ | ||
char a[100]; | ||
fread(a, sizeof(char), length, stdin); | ||
a[length]='\0'; | ||
char* name=analyze(a,"name"); | ||
sqliteDB_open(); | ||
sqliteDB_opt_delete_path(name); | ||
sqliteDB_close(); | ||
return 0; | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#include<stdio.h> | ||
#include<stdlib.h> | ||
#include"tools.h" | ||
#include<string.h> | ||
#include"/arm2410cl/Trolltech/qt-embedded-4.4.0/myqt/YJSQLite.h" | ||
#define DEBUG 0 | ||
void data_to_str(char *data_str){ | ||
int tip; | ||
int i; | ||
for(i=0;i<strlen(data_str);i++){ | ||
if(data_str[i]=='.'){ | ||
tip=i; | ||
break; | ||
} | ||
} | ||
tip-=2; | ||
double data=0,m=0; | ||
for(i=0;i<tip;i++){ | ||
data*=10; | ||
data+=data_str[i]-'0'; | ||
} | ||
for(i=tip;i<tip+2;i++){ | ||
m*=10; | ||
m+=data_str[i]-'0'; | ||
} | ||
|
||
int tmp=10; | ||
for(i=tip+1;i<tip+7;i++){ | ||
m+=(data_str[i]-'0')/tmp; | ||
tmp*=10; | ||
} | ||
data+=m/60.0; | ||
|
||
///122.09395837,37.52878708 | ||
//12204.671390,3731.523980 | ||
memset(data_str,'\0',sizeof(char)*50); | ||
sprintf(data_str,"%.3f",data); | ||
} | ||
int main(){ | ||
puts("Content-type: text/plain\n\n"); | ||
char *data=getenv("QUERY_STRING"); | ||
char* operate=analyze(data,"operate"); | ||
if(strcmp(operate,"getpointlist")==0){ | ||
char* res; | ||
int test=sqliteDB_open(); | ||
res=sqliteDB_opt_select_allpath(); | ||
sqliteDB_close(); | ||
if(DEBUG){ | ||
res="哈尔滨工业大学(威海)#122.067#37.517#0#0#0#1#123.067#38.517#0#0#P1#2#123.067#36.517#0#0#P2#3#121.067#36.517#0#0#P3#4#121.067#38.517#0#0#P4"; | ||
} | ||
puts(res); | ||
} | ||
else{ | ||
printf("error"); | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include<stdio.h> | ||
#include<stdlib.h> | ||
#include"tools.h" | ||
#include<string.h> | ||
#include"/arm2410cl/Trolltech/qt-embedded-4.4.0/myqt/YJSQLite.h" | ||
#define DEBUG 0 | ||
int main(){ | ||
puts("Content-type: text/plain\n\n"); | ||
char *data=getenv("QUERY_STRING"); | ||
char* operate=analyze(data,"operate"); | ||
if(strcmp(operate,"getpointlist")==0){ | ||
char* res; | ||
int test=sqliteDB_open(); | ||
res=sqliteDB_opt_select_allpath(); | ||
sqliteDB_close(); | ||
if(DEBUG){ | ||
res="哈尔滨工业大学(威海)#122.067#37.517#0#0#0#1#123.067#38.517#0#0#P1#2#123.067#36.517#0#0#P2#3#121.067#36.517#0#0#P3#4#121.067#38.517#0#0#P4"; | ||
} | ||
puts(res); | ||
} | ||
else{ | ||
printf("error"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include | ||
void main(){ | ||
printf("Content-type: text/html\n\n"); | ||
printf("\n"); | ||
printf("\n"); | ||
printf("\n"); | ||
printf("Hello, world.\n"); | ||
printf("\n"); | ||
printf("\n"); | ||
exit(0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/sh | ||
|
||
type=0 | ||
period=1 | ||
|
||
case $QUERY_STRING in | ||
*ping*) | ||
type=0 | ||
;; | ||
*counter*) | ||
type=1 | ||
;; | ||
*stop*) | ||
type=2 | ||
;; | ||
esac | ||
|
||
case $QUERY_STRING in | ||
*slow*) | ||
period=0.25 | ||
;; | ||
*normal*) | ||
period=0.125 | ||
;; | ||
*fast*) | ||
period=0.0625 | ||
;; | ||
esac | ||
|
||
/bin/echo $type $period > /tmp/led-control | ||
|
||
echo "Content-type: text/html; charset=gb2312" | ||
echo | ||
/bin/cat led-result.template | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include<stdio.h> | ||
#include<stdlib.h> | ||
#include<string.h> | ||
#include"tools.h" | ||
#include"/arm2410cl/Trolltech/qt-embedded-4.4.0/myqt/YJSQLite.h" | ||
#define DEBUG 0 | ||
int main(){ | ||
printf("Content-type: text/html\n\n"); | ||
char *data=getenv("QUERY_STRING"); | ||
char* username=analyze(data,"username"); | ||
char* password=analyze(data,"password"); | ||
char* a; | ||
sqliteDB_open(); | ||
a=Login(username,password); | ||
sqliteDB_close(); | ||
if(DEBUG){ | ||
//a=1; | ||
} | ||
puts(a); | ||
if(strcmp(a,"successed")==0){ | ||
printf("<script>window.location.replace(\"/map.html\")</script>\n"); | ||
} | ||
else{ | ||
printf("error"); | ||
} | ||
return 0; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include<stdio.h> | ||
#include<stdlib.h> | ||
#include<string.h> | ||
#include"tools.h" | ||
//#include"/arm2410cl/Trolltech/qt-embedded-4.4.0/myqt/YJSQLite.h" | ||
#define DEBUG 0 | ||
int main(){ | ||
printf("Content-type: text/html\n\n"); | ||
char *data=getenv("QUERY_STRING"); | ||
char* username=analyze(data,"username"); | ||
char* password=analyze(data,"password"); | ||
char* a; | ||
// sqliteDB_open(); | ||
//a=Login(username,password); | ||
//sqliteDB_close(); | ||
if(DEBUG){ | ||
//a=1; | ||
} | ||
puts(a); | ||
if(strcmp(a,"successed")==0){ | ||
printf("<script>window.location.replace(\"/map.html\")</script>\n"); | ||
} | ||
else{ | ||
printf("error"); | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
arm-linux-gcc -o login.cgi login.c -L /arm2410cl/Trolltech/qt-embedded-4.4.0/lib -lsqlite3 | ||
arm-linux-gcc -o addpoint.cgi addpoint.c -L /arm2410cl/Trolltech/qt-embedded-4.4.0/lib -lsqlite3 | ||
arm-linux-gcc -o delpoint.cgi delpoint.c -L /arm2410cl/Trolltech/qt-embedded-4.4.0/lib -lsqlite3 | ||
arm-linux-gcc -o refreshpos.cgi refreshpos.c -L /arm2410cl/Trolltech/qt-embedded-4.4.0/lib -lsqlite3 | ||
arm-linux-gcc -o getpointlist.cgi getpointlist.c -L /arm2410cl/Trolltech/qt-embedded-4.4.0/lib -lsqlite3 |
Oops, something went wrong.