Skip to content

Commit 065f762

Browse files
committed
Make some utility functions and types public
Make read_u16 and read_order available to call outside efibootmgr.c. Make var_entry_t public to be used by other source files. Prepare efibootmgr for JSON output support by making required utility functions and types publicly available to other source files. Signed-off-by: Jose M. Guisado <jguisado@soleta.eu>
1 parent 0ca99d4 commit 065f762

2 files changed

Lines changed: 17 additions & 13 deletions

File tree

src/efibootmgr.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
#include <efiboot.h>
5252
#include <inttypes.h>
5353

54-
#include "list.h"
5554
#include "efi.h"
5655
#include "parse_loader_data.h"
5756
#include "efibootmgr.h"
@@ -63,16 +62,6 @@
6362

6463
int verbose;
6564

66-
typedef struct _var_entry {
67-
char *name;
68-
efi_guid_t guid;
69-
uint8_t *data;
70-
size_t data_size;
71-
uint32_t attributes;
72-
uint16_t num;
73-
list_t list;
74-
} var_entry_t;
75-
7665
/* global variables */
7766
static LIST_HEAD(entry_list);
7867
static LIST_HEAD(blk_list);
@@ -348,7 +337,7 @@ make_var(const char *prefix, list_t *var_list)
348337
return NULL;
349338
}
350339

351-
static int
340+
int
352341
read_order(const char *name, var_entry_t **order)
353342
{
354343
int rc;
@@ -548,7 +537,7 @@ remove_from_order(const char *name, uint16_t num)
548537
return rc;
549538
}
550539

551-
static int
540+
int
552541
read_u16(const char *name)
553542
{
554543
efi_guid_t guid = EFI_GLOBAL_GUID;

src/include/efibootmgr.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
#define EFIBOOTMGR_PATH_ABBREV_NONE 3
3737
#define EFIBOOTMGR_PATH_ABBREV_FILE 4
3838

39+
#include "list.h"
40+
3941
typedef enum {
4042
boot,
4143
driver,
@@ -98,6 +100,19 @@ typedef struct {
98100
uint16_t index;
99101
} efibootmgr_opt_t;
100102

103+
typedef struct _var_entry {
104+
char *name;
105+
efi_guid_t guid;
106+
uint8_t *data;
107+
size_t data_size;
108+
uint32_t attributes;
109+
uint16_t num;
110+
list_t list;
111+
} var_entry_t;
112+
101113
extern efibootmgr_opt_t opts;
102114

115+
int read_u16(const char *name);
116+
int read_order(const char *name, var_entry_t **order);
117+
103118
#endif

0 commit comments

Comments
 (0)