char i = 0;
humanread = splitgroesse;
- while(humanread >= 1024) {
+ while (humanread >= 1024) {
i++;
humanread /= 1024;
- switch(i) {
+ switch (i) {
case 1:
einheit = 'K';
break;
long long unsigned int a = ((const struct file_size*)filea)->fsize;
long long unsigned int b = ((const struct file_size*)fileb)->fsize;
- if(a < b)
+ if (a < b)
return 1;
- else if(a > b)
+ else if (a > b)
return -1;
- else if(a == b)
+ else if (a == b)
return 0;
else
return -2;
int lines = 0;
char pfad[255];
- while(fscanf(in, "%[^\n]\n", pfad) == 1) {
+ while (fscanf(in, "%[^\n]\n", pfad) == 1) {
lines++;
}
rewind(in);
struct stat st;
int lines = 0;
- while(fscanf(in, "%[^\n]\n", pfad) == 1) {
+ while (fscanf(in, "%[^\n]\n", pfad) == 1) {
// Lese Dateieigenschaften in st struct
stat(pfad, &st);
- if(st.st_size <= split) {
+ if (st.st_size <= split) {
strcpy(fs[lines].name, pfad);
fs[lines++].fsize = st.st_size;
} else {
// irgnore List erstellen
- if(ignore == NULL)
+ if (ignore == NULL)
ignore = fopen("ignore", "w");
fprintf(ignore, "%s\n", pfad);
}
lines--;
- if(ignore != NULL)
+ if (ignore != NULL)
fclose(ignore);
return lines;
FILE *out;
out = fopen(output, "w");
- for(int i = 0; i <= length; i++) {
+ for (int i = 0; i <= length; i++) {
// ISO9660 filesystem overhead
filesize = ceil(input[i].fsize / 2048.0) * 2048;
- if(splitgroesse >= filesize) {
+ if (splitgroesse >= filesize) {
splitgroesse -= filesize;
fprintf(out, "%s\n", input[i].name);
} else {
printHumanReadSize(output, splitgroesse);
- if(restcount > 0) {
+ if (restcount > 0) {
memcpy(input, rest, length * sizeof(struct file_size));
input = (struct file_size *)
realloc(input, restcount * sizeof(struct file_size));
unsigned long long split = dvd5;
// gib die Funktionsübersicht aus bei zu wenig Parameter
- if(argc <= 3) {
+ if (argc <= 3) {
usage();
return 1;
}
// Lese Parameter ein
int c;
- while((c = getopt(argc, argv, ":59bcf:")) != -1) {
- switch(c) {
+ while ((c = getopt(argc, argv, ":59bcf:")) != -1) {
+ switch (c) {
case '5':
split = dvd5;
break;
char outname[strlen(output) + 3];
int num = 1;
- while(s_length > 0) {
+ while (s_length > 0) {
sprintf(outname, "%s%03d", output, num++);
s_length = splitter(fs, outname, split, s_length);
}