Skip to content

Commit fee84f0

Browse files
committed
src: merge api-types.h content into types.h
There is no need for the api-types.h header anymore. Furthermore, the struct nvme_transport_handle and struct nvme_global_ctx type is used throughout the library and is now part of the main API. We should ensure any user of <nvme/libnvme.h> gets this type. Signed-off-by: Daniel Wagner <[email protected]>
1 parent cb228cb commit fee84f0

10 files changed

Lines changed: 21 additions & 48 deletions

File tree

libnvme/doc/meson.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#
1010

1111
api_files = [
12-
'api-types.h',
1312
'fabrics.h',
1413
'filters.h',
1514
'ioctl.h',

libnvme/src/meson.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ install_headers([
9494
install_mode: mode,
9595
)
9696
install_headers([
97-
'nvme/api-types.h',
9897
'nvme/fabrics.h',
9998
'nvme/filters.h',
10099
'nvme/ioctl.h',

libnvme/src/nvme/api-types.h

Lines changed: 0 additions & 40 deletions
This file was deleted.

libnvme/src/nvme/ioctl.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include <sys/ioctl.h>
1919

2020
#include <nvme/types.h>
21-
#include <nvme/api-types.h>
2221

2322
/*
2423
* We can not always count on the kernel UAPI being installed. Use the same

libnvme/src/nvme/mi.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989

9090
#include <nvme/types.h>
9191
#include <nvme/tree.h>
92-
#include <nvme/api-types.h>
9392

9493
/**
9594
* NVME_MI_MSGTYPE_NVME - MCTP message type for NVMe-MI messages.

libnvme/src/nvme/tree.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
#include <nvme/ioctl.h>
2020
#include <nvme/util.h>
21-
#include <nvme/api-types.h>
2221

2322
/**
2423
* DOC: tree.h

libnvme/src/nvme/types.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,30 @@
1212

1313
#include <stdbool.h>
1414
#include <stdint.h>
15+
#include <stdio.h>
1516

1617
#include <linux/types.h>
1718

19+
struct nvme_global_ctx;
20+
struct nvme_transport_handle;
21+
22+
/**
23+
* nvme_create_global_ctx() - Initialize global context object
24+
* @fp: File descriptor for logging messages
25+
* @log_level: Logging level to use
26+
*
27+
* Return: Initialized &struct nvme_global_ctx object
28+
*/
29+
struct nvme_global_ctx *nvme_create_global_ctx(FILE *fp, int log_level);
30+
31+
/**
32+
* nvme_free_global_ctx() - Free global context object
33+
* @ctx: &struct nvme_global_ctx object
34+
*
35+
* Free an &struct nvme_global_ctx object and all attached objects
36+
*/
37+
void nvme_free_global_ctx(struct nvme_global_ctx *ctx);
38+
1839
/**
1940
* DOC: types.h
2041
*

libnvme/test/ioctl/ana.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <libnvme.h>
1212

1313
#include "mock.h"
14-
#include "nvme/api-types.h"
1514
#include "util.h"
1615

1716
#define TEST_FD 0xFD

libnvme/test/ioctl/misc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
#include "mock.h"
66
#include "util.h"
7-
#include <nvme/api-types.h>
87
#include <nvme/ioctl.h>
98
#include <nvme/types.h>
109
#include <string.h>

libnvme/test/ioctl/zns.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
#include "mock.h"
66
#include "util.h"
7-
#include <nvme/api-types.h>
87
#include <nvme/ioctl.h>
98
#include <nvme/types.h>
109

0 commit comments

Comments
 (0)