summaryrefslogtreecommitdiffstats
path: root/commands.h
blob: ea5aed202701faba6fd8c768d593bb54e97967dd (plain)
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
66
67
/*
 * call specifications for commands.c
 *
 *	Copyright (c) 2007-2019, Mark Wong
 */

#ifndef _COMMANDS_H_
#define _COMMANDS_H_

#include "pg_top.h"

struct cmd {
	int ch;
	int (*func)(struct pg_top_context *);
};

#define EXPLAIN 0
#define EXPLAIN_ANALYZE 1

#ifdef ENABLE_COLOR
int cmd_color(struct pg_top_context *);
#endif /* ENABLE_COLOR */
int cmd_cmdline(struct pg_top_context *);
int cmd_current_query(struct pg_top_context *);
int cmd_delay(struct pg_top_context *);
int cmd_displays(struct pg_top_context *);
int cmd_errors(struct pg_top_context *);
int cmd_explain(struct pg_top_context *);
int cmd_explain_analyze(struct pg_top_context *);
int cmd_help(struct pg_top_context *);
int cmd_idletog(struct pg_top_context *);
int cmd_indexes(struct pg_top_context *);
int cmd_io(struct pg_top_context *);
#ifdef ENABLE_KILL
int cmd_kill(struct pg_top_context *);
#endif /* ENABLE_KILL */
int cmd_locks(struct pg_top_context *);
int cmd_number(struct pg_top_context *);
int cmd_quit(struct pg_top_context *);
int cmd_order(struct pg_top_context *);
int cmd_order_cpu(struct pg_top_context *);
int cmd_order_mem(struct pg_top_context *);
int cmd_order_pid(struct pg_top_context *);
int cmd_order_time(struct pg_top_context *);
int cmd_redraw(struct pg_top_context *);
#ifdef ENABLE_KILL
int cmd_renice(struct pg_top_context *);
#endif /* ENABLE_KILL */
int cmd_statements(struct pg_top_context *);
int cmd_tables(struct pg_top_context *);
int cmd_toggle(struct pg_top_context *);
int cmd_update(struct pg_top_context *);
int cmd_user(struct pg_top_context *);

int execute_command(struct pg_top_context *, char);

void show_help(struct statics *);
int scanint(char *str, int *intp);
int error_count();
void show_errors();
char *kill_procs(char *str);
char *renice_procs(char *str);
void show_current_query(const char **, int);
void show_explain(const char **, int, int);
void show_locks(const char **, int);

#endif   /* _COMMANDS_H_ */