-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSYS_Manager.h
65 lines (42 loc) · 1.57 KB
/
SYS_Manager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// Created by 唐艺峰 on 2018/12/18.
//
#ifndef HUST_BASE_KERNEL_SYS_MANAGER_H
#define HUST_BASE_KERNEL_SYS_MANAGER_H
#include "IX_Manager.h"
#include "PF_Manager.h"
#include "RM_Manager.h"
#include "str.h"
extern char sys_dbpath[255];
extern char sys_dbname[255];
extern RM_FileHandle * table_file_handle, * col_file_handle;
#define TABLENAME_SIZE 21
#define ATTRCOUNT_SIZE 4
#define ATTRNAME_SIZE 21
#define ATTRTYPE_SIZE 4
#define ATTRLENGTH_SIZE 4
#define ATTROFFSET_SIZE 4
#define IX_FLAG_SIZE 1
#define INDEXNAME_SIZE 21
#define IX_FLAG_OFFSET ((size_t) (21 + 21 + 4 + 4 + 4))
#define MAX_FILE_SIZE 65535
#define TABLE_ROW_SIZE ((size_t) (21 + 4))
#define COL_ROW_SIZE ((size_t) (21 + 21 + 4 + 4 + 4 + 1 + 21))
//void ExecuteAndMessage(char * ,CEditArea*);
//bool CanButtonClick();
RC CreateDB(char *dbpath, char *dbname);
RC DropDB(char *dbname);
RC OpenDB(char *dbname);
RC CloseDB();
RC execute(char *sql);
RC CreateTable(char *relName, int attrCount, AttrInfo *attributes);
RC DropTable(char *relName);
RC CreateIndex(char *indexName, char *relName, char *attrName);
RC DropIndex(char *indexName);
RC Insert(char *relName, int nValues, Value *values);
RC Delete(char *relName, int nConditions, Condition *conditions);
RC Update(char *relName, char *attrName, Value *value, int nConditions, Condition *conditions);
RC GetColsInfo(char *relName, char ** attrName, AttrType * attrType, int * attrLength, int * attrOffset,
bool * ixFlag, char ** indexName);
RC GetTableInfo(char *relName, int *colNum);
#endif //HUST_BASE_KERNEL_SYS_MANAGER_H