LICK
 All Data Structures Files Functions Variables Enumerations Enumerator
utils.h
Go to the documentation of this file.
1 
5 #pragma once
6 
7 #include <stdio.h>
8 
9 #include "../lickdir.h"
10 
11 #define LOADER_DESC "LICK Boot Loader"
12 #define START_LOADER_DESC "Start LICK Boot Loader"
13 
14 #define ID_LEN 37
15 #define COMMAND_BUFFER_LEN 1024
16 
22 char *advance_to_newline(char *s);
31 int find_section(const char *haystack, const char *needle, char **start, char **end);
41 char *after_last_entry(char *sec, char *sec_end, const char *needle);
53 char *check_timeout(char *f, char *key, char *sep);
59 int backup_file(const char *f);
72 int get_id_from_command_range(const char *c, char *out, char *start, char *end);
79 int get_id_from_command(const char *c, char *out);
84 char *get_bcdedit();
98 int apply_fn_to_file(const char *file, char *(*fn)(char *, lickdir_t *),
99  int backup, lickdir_t *lick);
110 char *find_drive_with_file(const char *suggested_drive, const char *file);
121 char *boot_drive(const char *boot_file);
char * get_bcdedit()
get the path to bcdedit.exe
Definition: utils.c:191
int get_id_from_command(const char *c, char *out)
get an ID from a command
Definition: utils.c:187
int find_section(const char *haystack, const char *needle, char **start, char **end)
find the extents of an INI section
Definition: utils.c:29
char * after_last_entry(char *sec, char *sec_end, const char *needle)
find the line after the last needle in an INI section
Definition: utils.c:41
char * boot_drive(const char *boot_file)
find the boot drive
Definition: utils.c:277
char * check_timeout(char *f, char *key, char *sep)
check the timeout value of an INI file
Definition: utils.c:68
Paths to the LICK directory and its components.
Definition: lickdir.h:15
char * advance_to_newline(char *s)
returns a pointer to the next newline in a string
Definition: utils.c:12
int backup_file(const char *f)
create a backup of a file
Definition: utils.c:132
char * find_drive_with_file(const char *suggested_drive, const char *file)
find a drive which contains a file
Definition: utils.c:249
int get_id_from_command_range(const char *c, char *out, char *start, char *end)
get an ID from a command, between two strings
Definition: utils.c:144
int apply_fn_to_file(const char *file, char *(*fn)(char *, lickdir_t *), int backup, lickdir_t *lick)
applies a function to a file
Definition: utils.c:209