Skip to content

Commit

Permalink
CLEANUP: Clean up includes, base at root
Browse files Browse the repository at this point in the history
Part of #22
  • Loading branch information
noryb009 committed Mar 27, 2018
1 parent 71eb13d commit 0257650
Show file tree
Hide file tree
Showing 38 changed files with 109 additions and 86 deletions.
7 changes: 4 additions & 3 deletions liblick/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ set(sources
"boot-loader/me.c"
"boot-loader/nt.c"
"boot-loader/uefi.c"
"boot-loader/utils.c"
"boot-loader/boot-loader-utils.c"
"boot-loader/vista.c"
"distro.c"
"distro/fatdog.c"
"distro/puppy.c"
"distro/utils.c"
"distro/distro-utils.c"
"drives.c"
"install.c"
"lickdir.c"
Expand All @@ -26,7 +26,7 @@ set(sources
"menu/grub2.c"
"menu/grub4dos.c"
"menu/edit-flat-menu.c"
"menu/utils.c"
"menu/menu-utils.c"
"scandir.c"
"system-info.c"
"uniso.c"
Expand All @@ -38,6 +38,7 @@ set(sources

set(inc_dirs
${inc_dirs}
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_BINARY_DIR}/libarchive/include
${PROJECT_BINARY_DIR}/liblick)

Expand Down
3 changes: 2 additions & 1 deletion liblick/boot-loader.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "boot-loader.h"

#include <stdlib.h>

#include "boot-loader.h"
#include "boot-loader/9x.h"
#include "boot-loader/me.h"
#include "boot-loader/nt.h"
Expand Down
11 changes: 6 additions & 5 deletions liblick/boot-loader/9x.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#include "boot-loader/9x.h"

#include <stdlib.h>
#include <string.h>

#include "9x.h"
#include "boot-loader/boot-loader-utils.h"
#include "drives.h"
#include "lickdir.h"
#include "menu/grub4dos.h"
#include "utils.h"
#include "../drives.h"
#include "../lickdir.h"
#include "../menu/grub4dos.h"
#include "../utils.h"

#define MENU_ITEM_KEY "menuitem=LICK,"
#define MENU_ITEM MENU_ITEM_KEY START_LOADER_DESC "\n"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#include "boot-loader/boot-loader-utils.h"

#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif

#include "drives.h"
#include "utils.h"
#include "../drives.h"
#include "../utils.h"

char *advance_to_newline(char *s) {
if(s == NULL)
Expand Down
File renamed without changes.
13 changes: 7 additions & 6 deletions liblick/boot-loader/me.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#include "boot-loader/me.h"

#include <stdlib.h>

#include "9x.h"
#include "me.h"
#include "boot-loader/9x.h"
#include "boot-loader/boot-loader-utils.h"
#include "drives.h"
#include "lickdir.h"
#include "menu/grub4dos.h"
#include "utils.h"
#include "../drives.h"
#include "../lickdir.h"
#include "../menu/grub4dos.h"
#include "../utils.h"

int supported_loader_me(sys_info_t *info) {
return info->version == V_WINDOWS_ME;
Expand Down
11 changes: 6 additions & 5 deletions liblick/boot-loader/nt.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#include "boot-loader/nt.h"

#include <stdlib.h>
#include <string.h>

#include "nt.h"
#include "boot-loader/boot-loader-utils.h"
#include "drives.h"
#include "lickdir.h"
#include "menu/grub4dos.h"
#include "utils.h"
#include "../drives.h"
#include "../lickdir.h"
#include "../menu/grub4dos.h"
#include "../utils.h"

#define BOOT_ITEM "=\"" START_LOADER_DESC "\""
#define BOOT_FILE "boot.ini"
Expand Down
11 changes: 6 additions & 5 deletions liblick/boot-loader/uefi.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#include "boot-loader/uefi.h"

#include <stdlib.h>
#include <string.h>

#include "uefi.h"
#include "boot-loader/boot-loader-utils.h"
#include "drives.h"
#include "lickdir.h"
#include "menu/grub2.h"
#include "utils.h"
#include "../drives.h"
#include "../lickdir.h"
#include "../menu/grub2.h"
#include "../utils.h"

// install
#define COMMAND_COPY "%s /copy {bootmgr} /d \"" LOADER_DESC "\""
Expand Down
2 changes: 1 addition & 1 deletion liblick/boot-loader/uefi.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#pragma once

#include "../boot-loader.h"
#include "boot-loader.h"

/**
* @brief get the UEFI boot loader plugin
Expand Down
11 changes: 6 additions & 5 deletions liblick/boot-loader/vista.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#include "boot-loader/vista.h"

#include <stdlib.h>
#include <string.h>

#include "boot-loader/boot-loader-utils.h"
#include "drives.h"
#include "lickdir.h"
#include "menu/grub4dos.h"
#include "utils.h"
#include "vista.h"
#include "../drives.h"
#include "../lickdir.h"
#include "../menu/grub4dos.h"
#include "../utils.h"

// install
#define COMMAND_CREATE "%s /create /d \"" LOADER_DESC "\" /application bootsector"
Expand Down
6 changes: 3 additions & 3 deletions liblick/distro.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include "distro.h"

#include <stdlib.h>
#include <string.h>

#include "distro.h"
#include "utils.h"

#include "distro/fatdog.h"
#include "distro/puppy.h"
#include "utils.h"

distro_node_t *get_all_distros() {
distro_node_t *lst = NULL;
Expand Down
2 changes: 2 additions & 0 deletions liblick/distro/utils.c → liblick/distro/distro-utils.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "distro/distro-utils.h"

#include <stdlib.h>
#include <string.h>

Expand Down
2 changes: 1 addition & 1 deletion liblick/distro/utils.h → liblick/distro/distro-utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#pragma once

#include "../distro.h"
#include "distro.h"

distro_info_t *new_distro_info(char *k, char *i, char *op, char *ft);
distro_info_t *new_empty_distro_info();
Expand Down
9 changes: 5 additions & 4 deletions liblick/distro/fatdog.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#include "distro/fatdog.h"

#include <stdlib.h>
#include <string.h>

#include "fatdog.h"
#include "puppy.h"
#include "distro/puppy.h"
#include "distro/distro-utils.h"
#include "llist.h"
#include "utils.h"
#include "../llist.h"
#include "../utils.h"

distro_info_node_t *distro_fatdog(string_node_t *files, const char *dst, const char *name, lickdir_t *lick) {
distro_info_node_t *lst = distro_puppy(files, dst, name, lick);
Expand Down
2 changes: 1 addition & 1 deletion liblick/distro/fatdog.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#pragma once

#include "../distro.h"
#include "distro.h"

#define DISTRO_FATDOG_KEY "fatdog"

Expand Down
5 changes: 3 additions & 2 deletions liblick/distro/puppy.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#include "distro/puppy.h"

#include <stdlib.h>
#include <string.h>

#include "puppy.h"
#include "distro/distro-utils.h"
#include "utils.h"
#include "../utils.h"

distro_info_node_t *distro_puppy(string_node_t *files, const char *dst, const char *name, lickdir_t *lick) {
distro_info_t *i = new_empty_distro_info();
Expand Down
2 changes: 1 addition & 1 deletion liblick/distro/puppy.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#pragma once

#include "../distro.h"
#include "distro.h"

#define DISTRO_PUPPY_KEY "puppy"

Expand Down
3 changes: 2 additions & 1 deletion liblick/drives.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "drives.h"

#include <stdlib.h>

#include "drives.h"
#include "utils.h"

drive_t *new_drive(char *name, drive_type_e type) {
Expand Down
3 changes: 2 additions & 1 deletion liblick/install.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include "install.h"

#include <dirent.h>
#include <stdbool.h>
#include <stdio.h>
Expand All @@ -6,7 +8,6 @@

#include "boot-loader.h"
#include "distro.h"
#include "install.h"
#include "scandir.h"
#include "utils.h"

Expand Down
3 changes: 2 additions & 1 deletion liblick/lickdir.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#include "lickdir.h"

#include <libgen.h>
#include <stdlib.h>

#include "drives.h"
#include "lickdir.h"
#include "utils.h"
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
Expand Down
4 changes: 2 additions & 2 deletions liblick/llist.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <stdlib.h>

#include "llist.h"

#include <stdlib.h>

node_t *new_node(void *val, node_t *next) {
node_t *n = malloc(sizeof(node_t));
n->val = val;
Expand Down
4 changes: 2 additions & 2 deletions liblick/menu/edit-flat-menu.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <stdlib.h>
#include <string.h>

#include "edit-flat-menu.h"
#include "../utils.h"
#include "menu/edit-flat-menu.h"
#include "utils.h"

typedef struct {
enum {
Expand Down
4 changes: 2 additions & 2 deletions liblick/menu/edit-flat-menu.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <stdio.h>

#include "../lickdir.h"
#include "../llist.h"
#include "lickdir.h"
#include "llist.h"

typedef enum {
S_UNLABELED,
Expand Down
10 changes: 5 additions & 5 deletions liblick/menu/grub2.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
#include <stdlib.h>
#include <string.h>

#include "edit-flat-menu.h"
#include "grub2.h"
#include "menu/edit-flat-menu.h"
#include "menu/grub2.h"
#include "menu/menu-utils.h"
#include "drives.h"
#include "lickdir.h"
#include "utils.h"
#include "../drives.h"
#include "../lickdir.h"
#include "../utils.h"

#define GRUB2_TITLE "menuentry \'%s\' {\n"
#define GRUB2_SEARCH INDENT "search --set=root --file %s\n"
Expand Down
2 changes: 1 addition & 1 deletion liblick/menu/grub2.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#pragma once

#include "../menu.h"
#include "menu.h"

// Either PreLoader or shim can be used.
#define USE_PRELOADER
Expand Down
12 changes: 6 additions & 6 deletions liblick/menu/grub4dos.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
#include <stdlib.h>
#include <string.h>

#include "edit-flat-menu.h"
#include "grub4dos.h"
#include "menu/edit-flat-menu.h"
#include "menu/grub4dos.h"
#include "menu/menu-utils.h"
#include "drives.h"
#include "lickdir.h"
#include "menu.h"
#include "utils.h"
#include "../drives.h"
#include "../lickdir.h"
#include "../menu.h"
#include "../utils.h"

int install_grub4dos(lickdir_t *lick) {
char *menu = unix_path(concat_strs(2, lick->drive, "/lickmenu.lst"));
Expand Down
2 changes: 1 addition & 1 deletion liblick/menu/grub4dos.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#pragma once

#include "../menu.h"
#include "menu.h"

/**
* @brief get the grub4dos menu plugin
Expand Down
5 changes: 3 additions & 2 deletions liblick/menu/utils.c → liblick/menu/menu-utils.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <stdio.h>
#include "edit-flat-menu.h"
#include "../utils/file-utils.h"

#include "menu/edit-flat-menu.h"
#include "utils/file-utils.h"

int has_valuable_info(const char *menu) {
FILE *f = fopen(menu, "r");
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions liblick/scandir.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "scandir.h"

#include <assert.h>
#include <stdlib.h>
#include <string.h>

#include "scandir.h"

int alphasort2(const struct dirent **a, const struct dirent **b) {
return strcmp((*a)->d_name, (*b)->d_name);
}
Expand Down
4 changes: 2 additions & 2 deletions liblick/system-info.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "system-info.h"

#include <stdio.h>
#include <stdlib.h>

#include "system-info.h"

#ifdef _WIN32

#define WIN32_LEAN_AND_MEAN
Expand Down
Loading

0 comments on commit 0257650

Please sign in to comment.