-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmain.h
38 lines (27 loc) · 812 Bytes
/
main.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
#ifndef MAIN_H
#define MAIN_H
#include <ncurses.h>
#define FRONTEND 1
#include "postgres_fe.h"
#include "storage/block.h"
#include <stdarg.h>
#define reporterror(...) \
do { \
werase(errorw); \
mvwprintw(errorw, 0,0, __VA_ARGS__); \
wrefresh(errorw); \
} while(0);
typedef struct
{
char relname[NAMEDATALEN*2+1];
BlockNumber nblocks;
char relkind;
} relation_info;
WINDOW *errorw;
extern void db_connect(void);
extern bool db_is_connected(void);
extern relation_info *db_fetch_relations(int *nrels);
extern char *db_fetch_block(char *relname, char *forkname, BlockNumber blkno);
extern void display_block(WINDOW *hdrw, WINDOW *w, char *block, BlockNumber blkno);
extern void display_relations(WINDOW *hdrw, WINDOW *w, relation_info *rels, int nrels);
#endif