Skip to content

Commit

Permalink
ReaR/GRUB had trouble to automatically boot with 8.3 file format, so …
Browse files Browse the repository at this point in the history
…it was disabled until RRIP will be implemented (v0.1.1).

ISO is now not fully ISO9660 compatible, but shout work anyhow...
-R option was add as placeholder for RRIP
  • Loading branch information
gozora committed Sep 20, 2015
1 parent 3c3e773 commit 566e082
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 50 deletions.
19 changes: 12 additions & 7 deletions ebiso.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* ebiso.c
*
* Version: 0.0.3-alfa
* Version: 0.1.0
*
* Release date: 17.09.2015
* Release date: 20.09.2015
*
* Copyright 2015 Vladimir (sodoma) Gozora <[email protected]>
*
Expand Down Expand Up @@ -41,6 +41,7 @@ int main(int argc, char *argv[]) {
int option = 0;
int e_flag = 0;
int o_flag = 0;
int R_flag = 0;
int rv = 0;

memset(list, 0, sizeof(struct file_list_t));
Expand Down Expand Up @@ -70,7 +71,7 @@ int main(int argc, char *argv[]) {
{0, 0, 0, 0}
};

while ((option = getopt_long(argc, argv, "e:ho:v", longOptions, NULL)) != -1) {
while ((option = getopt_long(argc, argv, "e:ho:Rv", longOptions, NULL)) != -1) {
switch(option) {
case 'h':
msg(MSG_USAGE);
Expand Down Expand Up @@ -104,6 +105,10 @@ int main(int argc, char *argv[]) {
o_flag++;
}
break;
case 'R':
/* Just a placeholder RRIP is not yet implemented */
R_flag++;
break;
default:
rv = E_BADSYNTAX;
goto cleanup;
Expand All @@ -115,7 +120,7 @@ int main(int argc, char *argv[]) {
* First syntax check
* I dont line argc != 6 this will be chnaged later ;-)
*/
if (e_flag != 1 || o_flag != 1 || argc != 6) {
if (e_flag != 1 || o_flag != 1 || R_flag > 1 || argc < 6) {
msg(MSG_SYNTAX);
rv = E_BADSYNTAX;
goto cleanup;
Expand Down Expand Up @@ -218,7 +223,7 @@ int main(int argc, char *argv[]) {
int i = 0;
switch (DEBUG) {
case 1:
printf("%-5s %-4s %-50s %-11s %-3s %-7s %-5s %-7s %-30s\n", "Level", "PID", "Name", "Size", "ID", "LBA", "Flag", "Blocks", "Date");
printf("%-5s %-4s %-50s %-11s %-3s %-7s %-5s %-7s %-12s %-5s %-30s\n", "Level", "PID", "Name", "Size", "ID", "LBA", "Flag", "Blocks", "Write name", "Len", "Date");
for (i = 0; i <= 8; i++)
disp_level(list, i);
break;
Expand Down Expand Up @@ -253,8 +258,8 @@ static void disp_level(struct file_list_t *list_to_display, int level) {
ts = localtime(&list_to_display->mtime);
strftime(buff, sizeof(buff), "%a %Y-%m-%d %H:%M:%S %Z", ts);

printf("%-5d %-4d %-50s %-11d %-3d %-7d %-5c %-7d %-30s\n", level, list_to_display->parent_id, list_to_display->name_path, list_to_display->size, \
list_to_display->dir_id, list_to_display->LBA, flag, list_to_display->blocks, buff);
printf("%-5d %-4d %-50s %-11d %-3d %-7d %-5c %-7d %-12s %-5d %-30s\n", level, list_to_display->parent_id, list_to_display->name_path, list_to_display->size, \
list_to_display->dir_id, list_to_display->LBA, flag, list_to_display->blocks, list_to_display->name_conv, list_to_display->name_conv_len, buff);
}

list_to_display = list_to_display->next;
Expand Down
8 changes: 4 additions & 4 deletions include/ebiso.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
* ebiso.h
*
* Version: 0.0.3-alfa
* Version: 0.1.0
*
* Release date: 17.09.2015
* Release date: 20.09.2015
*
* Copyright 2015 Vladimir (sodoma) Gozora <[email protected]>
*
Expand Down Expand Up @@ -33,9 +33,9 @@
#include <getopt.h>

#define PROGNAME "ebiso"
#define VERSION "0.0.3-alfa"
#define VERSION "0.1.0"

//#define DEBUG 1
#define DEBUG 1
#ifdef DEBUG
static void disp_level(struct file_list_t *list_to_display, int level);
#endif
Expand Down
38 changes: 0 additions & 38 deletions lib/filename.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,44 +27,6 @@

#include "filename.h"

//int main() {
//struct file_list_t *list = (struct file_list_t*) malloc(sizeof(struct file_list_t));
//struct file_list_t *list_start = list;

//int filename_len = -40;
//int conv_len = -40;
//int level_len = -7;

//memset(list, 0, sizeof(struct file_list_t));

///* Convert data to 8.3 filename format */
//list = list_start;
//while(list->next != NULL) {
//convert_name(list->name_short, list->name_conv, CONV_ISO9660);

//list = list->next;
//}

///* Add counter string, if any duplicates are found */
//printf("Searching for duplicates ...\n");
//list = list_start;
//rename_duplicates(list);

///* Display data */
//printf("\n%*s %*s %*s\n", filename_len, "Filename", conv_len, "Conv name", level_len, "Level");
//list = list_start;
//while(list->next != NULL) {
//printf("%*s %*s %*d\n", filename_len, list->name_short, conv_len, list->name_conv, level_len, list->level);

//list = list->next;
//}

///* Cleanup part */
//list_clean(list_start);

//return 0;
//}

void filename_rename_duplicates(struct file_list_t *list) {
struct file_list_t *rr_list = list;
struct file_list_t *rr2_list = list;
Expand Down
9 changes: 8 additions & 1 deletion lib/list.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,15 @@ int list_create(const char *dirname, struct file_list_t **flist) {
strncpy((*flist)->name_path, path, path_len + 1); // Copy trailing null
strncpy((*flist)->name_short, dir_content->d_name, MAX_DIR_STR_LEN - 1);

/*
* Temporary disabled, until implementation of RRIP is finished
* Medium is currently not fully ISO compatible, but should be working anyhow
*/
/* convert filename to 8.3 format */
(*flist)->name_conv_len = convert_name((*flist)->name_short, (*flist)->name_conv, CONV_ISO9660);
//(*flist)->name_conv_len = convert_name((*flist)->name_short, (*flist)->name_conv, CONV_ISO9660);
(*flist)->name_conv_len = strlen((*flist)->name_short);
strncpy((*flist)->name_conv, (*flist)->name_short, (*flist)->name_conv_len);


if ((read_test = fopen(path, "r")) == NULL) {
printf("Error: list_create(): Failed to open [%s]: %s\n", path, strerror(errno));
Expand Down

0 comments on commit 566e082

Please sign in to comment.