File: main.h

package info (click to toggle)
ndctl 82-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,460 kB
  • sloc: ansic: 42,027; sh: 3,974; makefile: 28
file content (35 lines) | stat: -rw-r--r-- 958 bytes parent folder | download | duplicates (3)
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
/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (C) 2015-2020 Intel Corporation. All rights reserved. */
/* Copyright (C) 2006 Linus Torvalds. All rights reserved. */

/* originally copied from perf and git */

#ifndef __MAIN_H__
#define __MAIN_H__

enum program {
	PROG_NDCTL,
	PROG_DAXCTL,
	PROG_CXL,
};

struct ndctl_ctx;
struct daxctl_ctx;
struct cxl_ctx;

struct cmd_struct {
	const char *cmd;
	union {
		int (*n_fn)(int, const char **, struct ndctl_ctx *ctx);
		int (*d_fn)(int, const char **, struct daxctl_ctx *ctx);
		int (*c_fn)(int, const char **, struct cxl_ctx *ctx);
	};
};

int main_handle_options(const char ***argv, int *argc, const char *usage_msg,
		struct cmd_struct *cmds, int num_cmds);
void main_handle_internal_command(int argc, const char **argv, void *ctx,
		struct cmd_struct *cmds, int num_cmds, enum program prog);
int help_show_man_page(const char *cmd, const char *util_name,
		const char *viewer);
#endif /* __MAIN_H__ */