提交 c302d338 编写于 作者: H hjxilinx

refactor code, reorganize the header files

上级 4156af7c
......@@ -13,16 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <assert.h>
#include <regex.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define __USE_XOPEN
#include <wchar.h>
#include "os.h"
#include "shell.h"
#include "shellCommand.h"
......
......@@ -16,16 +16,6 @@
#define _XOPEN_SOURCE
#define _DEFAULT_SOURCE
#include <assert.h>
#include <pthread.h>
#include <regex.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <time.h>
#include "os.h"
#include "shell.h"
#include "shellCommand.h"
......
......@@ -13,27 +13,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <argp.h>
#include <assert.h>
#include <assert.h>
#include <error.h>
#include <pwd.h>
#include <regex.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <sys/types.h>
#include <termios.h>
#include <time.h>
#include <unistd.h>
#include <wordexp.h>
#define __USE_XOPEN
#include <wchar.h>
#include "os.h"
#include "shell.h"
#include "shellCommand.h"
......
......@@ -13,13 +13,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <locale.h>
#include <pthread.h>
#include <signal.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include "os.h"
#include "shell.h"
#include "tsclient.h"
......
......@@ -13,23 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
#include <netinet/in.h>
#include <pthread.h>
#include <pthread.h>
#include <semaphore.h>
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/epoll.h>
#include <sys/socket.h>
#include <syslog.h>
#include <unistd.h>
#include "os.h"
#include "taosmsg.h"
#include "tlog.h"
......
......@@ -23,6 +23,7 @@ extern "C" {
#include <stdio.h>
#include <stdlib.h>
#include <argp.h>
#include <arpa/inet.h>
#include <assert.h>
#include <ctype.h>
......@@ -31,6 +32,7 @@ extern "C" {
#include <errno.h>
#include <float.h>
#include <ifaddrs.h>
#include <libgen.h>
#include <limits.h>
#include <locale.h>
#include <math.h>
......@@ -41,9 +43,12 @@ extern "C" {
#include <netinet/udp.h>
#include <pthread.h>
#include <pwd.h>
#include <regex.h>
#include <semaphore.h>
#include <signal.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <strings.h>
......@@ -55,7 +60,9 @@ extern "C" {
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <sys/statvfs.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/un.h>
#include <syslog.h>
......@@ -65,6 +72,7 @@ extern "C" {
#include <wordexp.h>
#include <wctype.h>
#define taosCloseSocket(x) \
{ \
if (VALIDFD(x)) { \
......
......@@ -13,14 +13,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <pthread.h>
#include <semaphore.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include "os.h"
#include "tlog.h"
#include "tmempool.h"
......
......@@ -13,10 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <netinet/in.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include "os.h"
void taosFreeMsgHdr(void *hdr) {
struct msghdr *msgHdr = (struct msghdr *)hdr;
......
......@@ -13,16 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <assert.h>
#include <errno.h>
#include <pthread.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include "os.h"
#include "shash.h"
#include "taosmsg.h"
#include "tidpool.h"
......
......@@ -13,15 +13,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include <semaphore.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "os.h"
#include "taosmsg.h"
#include "tlog.h"
......
......@@ -13,16 +13,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include <pthread.h>
#include <semaphore.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "os.h"
#include "taosmsg.h"
#include "tlog.h"
......
......@@ -13,15 +13,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "os.h"
#include "taosmsg.h"
#include "thash.h"
......
......@@ -13,13 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <pthread.h>
#include <semaphore.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "os.h"
#include "tsdb.h"
#define MAX_STR_LEN 40
......
......@@ -13,19 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>
#include <libgen.h>
#include <pthread.h>
#include <semaphore.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "os.h"
#include "sdb.h"
#include "sdbint.h"
......
......@@ -20,11 +20,7 @@
extern "C" {
#endif
#include <errno.h>
#include <pthread.h>
#include <semaphore.h>
#include <syslog.h>
#include <stdint.h>
#include "os.h"
#include "sdb.h"
#include "tglobalcfg.h"
......@@ -34,7 +30,6 @@ extern "C" {
#include "tmempool.h"
#include "trpc.h"
#include "tsdb.h"
#include "tsdb.h"
#include "tskiplist.h"
#include "tsocket.h"
#include "ttime.h"
......
......@@ -20,9 +20,7 @@
extern "C" {
#endif
#include <pthread.h>
#include <semaphore.h>
#include <stdbool.h>
#include "os.h"
#include "dnodeSystem.h"
#include "mgmt.h"
......
......@@ -20,8 +20,6 @@
extern "C" {
#endif
#include <stdint.h>
int mgmtInitRedirect();
void mgmtCleanUpRedirect();
......
......@@ -20,11 +20,7 @@
extern "C" {
#endif
#include <errno.h>
#include <pthread.h>
#include <semaphore.h>
#include <stdint.h>
#include <syslog.h>
#include "os.h"
#include "tglobalcfg.h"
#include "tidpool.h"
......@@ -33,7 +29,6 @@ extern "C" {
#include "trpc.h"
#include "tsclient.h"
#include "tsdb.h"
#include "tsdb.h"
#include "tsocket.h"
#include "ttime.h"
#include "ttimer.h"
......
......@@ -16,7 +16,7 @@
#ifndef TDENGINE_VNODEPEER_H
#define TDENGINE_VNODEPEER_H
#include <stdint.h>
#include "os.h"
#ifdef __cplusplus
extern "C" {
......
......@@ -20,8 +20,7 @@
extern "C" {
#endif
#include <stdio.h>
#include <stdlib.h>
#include "os.h"
#include "ihash.h"
......
......@@ -20,7 +20,7 @@
extern "C" {
#endif
#include <stdint.h>
#include "os.h"
#include "tinterpolation.h"
#include "vnodeTagMgmt.h"
......
......@@ -20,7 +20,7 @@
extern "C" {
#endif
#include <stdint.h>
#include "os.h"
typedef struct {
int sid;
......
......@@ -16,8 +16,6 @@
#ifndef TDENGINE_VNODESTORE_H
#define TDENGINE_VNODESTORE_H
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
......
......@@ -16,8 +16,6 @@
#ifndef TDENGINE_VNODESYSTEM_H
#define TDENGINE_VNODESYSTEM_H
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
......
......@@ -14,9 +14,8 @@
*/
#define _DEFAULT_SOURCE
#include <arpa/inet.h>
#include <assert.h>
#include <unistd.h>
#include "os.h"
#include "dnodeSystem.h"
#include "taosmsg.h"
......
......@@ -14,20 +14,8 @@
*/
#define _DEFAULT_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <locale.h>
#include <pthread.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <syslog.h>
#include <unistd.h>
#include <unistd.h>
#include <wordexp.h>
#include "os.h"
#include "dnodeSystem.h"
#include "tglobalcfg.h"
......
......@@ -14,11 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include <pthread.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include "os.h"
#include "mgmt.h"
#include "vnode.h"
......
......@@ -14,7 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include <arpa/inet.h>
#include "os.h"
#include "mgmt.h"
#include "tschemautil.h"
......
......@@ -14,8 +14,10 @@
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "mgmt.h"
#include <arpa/inet.h>
#include "taosmsg.h"
#include "tschemautil.h"
......
......@@ -15,9 +15,7 @@
#define _DEFAULT_SOURCE
#include <arpa/inet.h>
#include <endian.h>
#include <stdbool.h>
#include "os.h"
#include "dnodeSystem.h"
#include "mgmt.h"
......
......@@ -14,8 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include <arpa/inet.h>
#include <endian.h>
#include "os.h"
#include "dnodeSystem.h"
#include "mgmt.h"
......
......@@ -14,10 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include <arpa/inet.h>
#include <assert.h>
#include <limits.h>
#include <stdint.h>
#include "os.h"
#include "mgmt.h"
#include "mgmtUtil.h"
......
......@@ -14,8 +14,9 @@
*/
#define _DEFAULT_SOURCE
#include "os.h"
#include "mgmt.h"
#include <arpa/inet.h>
#include "mgmtProfile.h"
#include "taosmsg.h"
#include "tschemautil.h"
......
......@@ -14,7 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include <arpa/inet.h>
#include "os.h"
#include "dnodeSystem.h"
#include "mgmt.h"
......
......@@ -14,10 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include <arpa/inet.h>
#include <float.h>
#include <math.h>
#include <sys/time.h>
#include "os.h"
#include "mgmt.h"
#include "mgmtUtil.h"
......
......@@ -14,16 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include <arpa/inet.h>
#include <netinet/in.h>
#include <pwd.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <syslog.h>
#include <unistd.h>
#include "os.h"
#include "dnodeSystem.h"
#include "mgmt.h"
......
......@@ -14,7 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include <arpa/inet.h>
#include "os.h"
#include "mgmt.h"
#include "tschemautil.h"
......
......@@ -14,10 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include <arpa/inet.h>
#include <sys/time.h>
#include <math.h>
#include <float.h>
#include "os.h"
#include "mgmt.h"
#include "mgmtUtil.h"
......
......@@ -14,7 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include <arpa/inet.h>
#include "os.h"
#include "mgmt.h"
#include "tschemautil.h"
......
......@@ -14,9 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include <arpa/inet.h>
#include <sys/time.h>
#include <unistd.h>
#include "os.h"
#include "taosmsg.h"
#include "vnode.h"
......
......@@ -14,15 +14,7 @@
*/
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <fcntl.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "os.h"
#include "tsdb.h"
#include "vnode.h"
......
......@@ -14,15 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include <arpa/inet.h>
#include <assert.h>
#include <fcntl.h>
#include <libgen.h>
#include <sys/stat.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include "os.h"
#include "tscompression.h"
#include "tutil.h"
......
......@@ -14,11 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "os.h"
#include "vnode.h"
......
......@@ -14,11 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include <float.h>
#include <math.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "os.h"
#include "taosmsg.h"
#include "tsqlfunction.h"
......
......@@ -14,10 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include <arpa/inet.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "os.h"
#include "trpc.h"
#include "ttimer.h"
......
......@@ -14,10 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include <arpa/inet.h>
#include <assert.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "os.h"
#include "trpc.h"
#include "tschemautil.h"
......
......@@ -14,10 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "os.h"
#include "taosmsg.h"
#include "textbuffer.h"
......
......@@ -14,12 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include <arpa/inet.h>
#include <assert.h>
#include <fcntl.h>
#include <limits.h>
#include <time.h>
#include <unistd.h>
#include "os.h"
#include "ihash.h"
#include "taosmsg.h"
......
......@@ -14,10 +14,8 @@
*/
#define _DEFAULT_SOURCE
#include <arpa/inet.h>
#include <assert.h>
#include <endian.h>
#include <stdint.h>
#include "os.h"
#include "taosmsg.h"
#include "vnode.h"
#include "vnodeShell.h"
......
......@@ -14,11 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include <dirent.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "os.h"
#include "dnodeSystem.h"
#include "trpc.h"
......
......@@ -14,15 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include <pthread.h>
#include <pwd.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <syslog.h>
#include <unistd.h>
#include "os.h"
#include "tsdb.h"
#include "tsocket.h"
......
......@@ -14,9 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
#include "os.h"
#include "tsdb.h"
#include "tlog.h"
......
......@@ -14,10 +14,7 @@
*/
#define _DEFAULT_SOURCE
#include <arpa/inet.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include "os.h"
#include "tast.h"
#include "tscUtil.h"
......
......@@ -13,13 +13,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <pthread.h>
#include <semaphore.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "os.h"
typedef struct _str_node_t {
......
......@@ -13,15 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <pthread.h>
#include <string.h>
#include "os.h"
#include "tcache.h"
#include "tlog.h"
......
......@@ -46,12 +46,6 @@
* of the XORed value with informations. If not, record the first corresponding bytes.
*
*/
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "os.h"
#include "lz4.h"
......
......@@ -13,17 +13,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <float.h>
#include <math.h>
#include <errno.h>
#include "os.h"
#include "taos.h"
#include "taosmsg.h"
......
......@@ -13,13 +13,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <pthread.h>
#include <semaphore.h>
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "os.h"
#include "tmempool.h"
......
......@@ -13,13 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <assert.h>
#include <float.h>
#include <math.h>
#include <memory.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include "os.h"
#include "taosmsg.h"
#include "thistogram.h"
......
......@@ -13,10 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "os.h"
#include "tlog.h"
typedef struct {
......
......@@ -13,22 +13,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <pthread.h>
#include <semaphore.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/types.h>
#include <time.h>
#include "os.h"
#include "tlog.h"
#include "tutil.h"
......
......@@ -13,13 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <assert.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <errno.h>
#include "os.h"
#include "tlog.h"
extern int32_t taosGetTimestampSec();
......
......@@ -13,12 +13,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <errno.h>
#include <pthread.h>
#include <semaphore.h>
#include <signal.h>
#include <stdio.h>
#include "os.h"
#include "tmodule.h"
#include "tutil.h"
......
......@@ -13,14 +13,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <errno.h>
#include <pthread.h>
#include <semaphore.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "os.h"
#include "tlog.h"
#include "tsched.h"
......
......@@ -13,17 +13,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <fcntl.h>
#include <pthread.h>
#include <stdarg.h>
#include <sys/types.h>
#include "os.h"
#include "tglobalcfg.h"
#include "tlog.h"
......
......@@ -13,12 +13,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <assert.h>
#include <errno.h>
#include <pthread.h>
#include <sched.h>
#include <stdio.h>
#include <stdlib.h>
#include "os.h"
#include "tlog.h"
#include "tsched.h"
......
......@@ -13,15 +13,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <assert.h>
#include <errno.h>
#include <float.h>
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "os.h"
#include "taos.h"
#include "tsdb.h"
......
......@@ -13,14 +13,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <assert.h>
#include <locale.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <errno.h>
#include "os.h"
#ifdef USE_LIBICONV
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册