未验证 提交 57da3186 编写于 作者: H hzcheng 提交者: GitHub

Merge pull request #2 from guanshengliang/master

Modify grammatical errors in some example codes
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include <unistd.h> #include <unistd.h>
#include <string.h> #include <string.h>
#include <taos/taos.h> #include <taos.h>
int points = 5; int points = 5;
int numOfTables = 3; int numOfTables = 3;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <taos/taos.h> // TAOS header file #include <taos.h> // TAOS header file
void taosMsleep(int mseconds); void taosMsleep(int mseconds);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
ROOT=./ ROOT=./
TARGET=exe TARGET=exe
LFLAGS = '-Wl,-rpath,/usr/local/lib/taos/' -ltaos -lpthread -lm -lrt LFLAGS = '-Wl,-rpath,/usr/local/taos/driver' -ltaos -lpthread -lm -lrt
CFLAGS = -O3 -g -Wall -Wno-deprecated -fPIC -Wno-unused-result -Wconversion -Wno-char-subscripts -D_REENTRANT -Wno-format -D_REENTRANT -DLINUX -msse4.2 -Wno-unused-function -D_M_X64 -std=gnu99 CFLAGS = -O3 -g -Wall -Wno-deprecated -fPIC -Wno-unused-result -Wconversion -Wno-char-subscripts -D_REENTRANT -Wno-format -D_REENTRANT -DLINUX -msse4.2 -Wno-unused-function -D_M_X64 -std=gnu99
all: $(TARGET) all: $(TARGET)
......
...@@ -16,7 +16,9 @@ ...@@ -16,7 +16,9 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <taos/taos.h> // include TDengine header file #include <pthread.h>
#include <unistd.h>
#include <taos.h> // include TDengine header file
typedef struct { typedef struct {
char server_ip[64]; char server_ip[64];
...@@ -25,7 +27,7 @@ typedef struct { ...@@ -25,7 +27,7 @@ typedef struct {
} param; } param;
int g_thread_exit_flag = 0; int g_thread_exit_flag = 0;
int insert_rows(void *sarg); void* insert_rows(void *sarg);
void streamCallBack(void *param, TAOS_RES *res, TAOS_ROW row) void streamCallBack(void *param, TAOS_RES *res, TAOS_ROW row)
{ {
...@@ -46,7 +48,6 @@ int main(int argc, char *argv[]) ...@@ -46,7 +48,6 @@ int main(int argc, char *argv[])
char db_name[64]; char db_name[64];
char tbl_name[64]; char tbl_name[64];
char sql[1024] = { 0 }; char sql[1024] = { 0 };
char command[1024] = { 0 };
if (argc != 4) { if (argc != 4) {
printf("usage: %s server-ip dbname tblname\n", argv[0]); printf("usage: %s server-ip dbname tblname\n", argv[0]);
...@@ -72,7 +73,7 @@ int main(int argc, char *argv[]) ...@@ -72,7 +73,7 @@ int main(int argc, char *argv[])
strcpy(t_param->tbl_name, tbl_name); strcpy(t_param->tbl_name, tbl_name);
pthread_t pid; pthread_t pid;
pthread_create(&pid, NULL, insert_rows, t_param); pthread_create(&pid, NULL, (void * (*)(void *))insert_rows, t_param);
sleep(3); // waiting for database is created. sleep(3); // waiting for database is created.
// open connection to database // open connection to database
...@@ -118,7 +119,7 @@ int main(int argc, char *argv[]) ...@@ -118,7 +119,7 @@ int main(int argc, char *argv[])
} }
int insert_rows(void *sarg) void* insert_rows(void *sarg)
{ {
TAOS *taos; TAOS *taos;
char command[1024] = { 0 }; char command[1024] = { 0 };
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <taos/taos.h> // include TDengine header file #include <taos.h> // include TDengine header file
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册