tfile.h 1.6 KB
Newer Older
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
 *
 * This program is free software: you can use, redistribute, and/or modify
 * it under the terms of the GNU Affero General Public License, version 3
 * or later ("AGPL"), as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

16 17
#ifndef _TD_UTIL_FILE_H
#define _TD_UTIL_FILE_H
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
18

L
Liu Jicong 已提交
19 20
#include "os.h"

陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
21 22 23 24
#ifdef __cplusplus
extern "C" {
#endif

陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
25
// init taos file module
S
TD-1895  
Shengliang Guan 已提交
26
int32_t tfInit();
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
27 28

// clean up taos file module
S
TD-1895  
Shengliang Guan 已提交
29
void tfCleanup();
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
30

陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
31 32
// the same syntax as UNIX standard open/close/read/write
// but FD is int64_t and will never be reused
33 34 35 36 37 38 39 40 41 42 43 44 45 46
// int64_t tfOpenRead(const char *pathname);
// int64_t tfOpenReadWrite(const char *pathname);
// int64_t tfOpenCreateWrite(const char *pathname);
// int64_t tfOpenCreateWriteAppend(const char *pathname);

// int64_t tfClose(int64_t tfd);
// int64_t tfWrite(int64_t tfd, void *buf, int64_t count);
// int64_t tfRead(int64_t tfd, void *buf, int64_t count);
// int64_t tfPread(int64_t tfd, void *buf, int64_t count, int64_t offset);
// int32_t tfFsync(int64_t tfd);
// bool    tfValid(int64_t tfd);
// int64_t tfLseek(int64_t tfd, int64_t offset, int32_t whence);
// int32_t tfFtruncate(int64_t tfd, int64_t length);
// void *  tfMmapReadOnly(int64_t tfd, int64_t length);
陶建辉(Jeff)'s avatar
陶建辉(Jeff) 已提交
47 48 49 50
#ifdef __cplusplus
}
#endif

dengyihao's avatar
dengyihao 已提交
51
#endif /*_TD_UTIL_FILE_H*/