提交 194ffc94 编写于 作者: H Hongze Cheng

more

上级 dd44e5f9
......@@ -3,6 +3,7 @@
#include <stdint.h>
#include "tstring.h"
#include "type.h"
typedef struct _scolumn {
......@@ -15,4 +16,25 @@ typedef struct SSchema {
SColumn *columns;
} SSchema;
// Column with version
typedef struct {
td_datatype_t type;
int32_t colId;
int32_t bytes;
} SVColumn;
// Schema with version
typedef struct {
int32_t version; // Schema with version
int32_t numOfCols;
int32_t columnId;
SVColumn *columns;
} SVSchema;
int32_t tdAddColumnToSchema(tstring_t pSchema, SColumn col);
td_datatype_t tdGetTypeOfCol(SSchema *pSchema, int32_t col);
int32_t tdGetLengthOfCol(SSchema *pSchema, int32_t col);
#endif // _TD_SCHEMA_H_
......@@ -3,6 +3,8 @@
#include <stdint.h>
#include "schema.h"
/* The row data should in the form of
*/
......
/* A dynamic string library
*/
#if !defined(_TD_TSTRING_H_)
#define _TD_TSTRING_H_
#include <stdint.h>
typedef char* tstring_t;
// The string header
typedef struct {
int32_t strLen; // Allocated data space
int32_t avail; // Available space
char data[];
} STStrHdr;
// Get the data length of the string
#define TSTRLEN(pstr) ((STStrHdr *)pstr)->strLen
// Get the available space
#define TSTRAVAIL(pstr) ((STStrHdr *)pstr)->avail
// Get the real allocated string length
#define TSTRRLEN(pstr) ((STStrHdr *)pstr)->strLen + sizeof(STStrHdr)
#endif // _TD_TSTRING_H_
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册