📄 ds_table.h
字号:
#ifndef __DS_TABLE_H__
#define __DS_TABLE_H__
#include "ds_array.h"
#include "ds_list.h"
#define FT_I1 1
#define FT_UI1 FT_I1+1
#define FT_I2 FT_I1+2
#define FT_UI2 FT_I1+3
#define FT_I4 FT_I1+4
#define FT_UI4 FT_I1+5
#define FT_R4 FT_I1+6
#define FT_R8 FT_I1+7
#define FT_INT FT_I1+8
#define FT_STR FT_I1+9
#define FT_VOID FT_I1+10
#define FT_CHAR FT_I1
#define FT_BYTE FT_UI1
#define FT_SHORT FT_I2
#define FT_WORD FT_UI2
#define FT_LONG FT_I4
#define FT_DWORD FT_UI4
#define FT_FLOAT FT_R4
#define FT_DOUBLE FT_R8
#define TABLE_NAME_MAXLEN 20
#define FIELD_NAME_MAXLEN 10
typedef enum
{
OPER_ADD,
OPER_DELETE,
OPER_MODIFY,
}OPER_TYPE;
typedef struct
{
OPER_TYPE oper_type;
LPOSITION oper_record;
INT oper_field;
}OPER_EVENT;
typedef struct
{
UINT index;
char name[FIELD_NAME_MAXLEN+1];
BYTE type;
long size;
}TB_FIELD;
typedef struct{
union {
char cVal; // FT_I1.
BYTE bVal; // FT_UI1.
short iVal; // FT_I2.
unsigned short uiVal; // FT_UI2.
long lVal; // FT_I4.
unsigned long ulVal; // FT_UI4.
float fltVal; // FT_R4.
double dblVal; // FT_R8.
int intVal; // FT_INT
char* pStrVal; // FT_STR
void* pVoidVal; // FT_VOID
};
}TB_VARIANT;
typedef long (*FILTERPROC)();
typedef struct{
void* view_handle;
FILTERPROC filter_proc;
}TB_VIEW;
typedef struct
{
DWORD table_id; //judge whether the table exist.
DWORD attribute;
char table_name[TABLE_NAME_MAXLEN+1];
UINT field_num;
UINT record_num;
DS_ARRAY field_info;
DS_LIST record_list;
LPOSITION current_position;
DS_LIST self_views;
}DS_TABLE;
#define HTABLE DS_TABLE*
#define HVIEW DS_VIEW*
HTABLE DST_CreateTable( const char* table_name, UINT field_num );
BOOL DST_DestroyTable( HTABLE hTable );
BOOL DST_SetFieldInfo( HTABLE hTable, UINT field_index, TB_FIELD fieldinfo );
BOOL DST_GetFieldInfo( HTABLE hTable, UINT field_index, TB_FIELD* fieldinfo );
BOOL DST_AddRecord( HTABLE hTable );
BOOL DST_DeleteCurRecord( HTABLE hTable );
BOOL DST_DeleteRecord( HTABLE hTable, LPOSITION pos );
BOOL DST_SetFieldValue( HTABLE hTable, UINT field_index, TB_VARIANT field_value );
BOOL DST_GetFieldValue( HTABLE hTable, UINT field_index, TB_VARIANT* field_value );
void DST_MoveNext( HTABLE hTable );
void DST_MovePrev( HTABLE hTable );
void DST_MoveFirst( HTABLE hTable );
void DST_MoveLast( HTABLE hTable );
int DST_GetRecordCount( HTABLE hTable );
BOOL DST_IsTable( HTABLE hTable );
void DST_SetAbsolutePostion( HTABLE hTable, LPOSITION pos );
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -