#include <string.h>
#include <stdlib.h>
#include <stdio.h>
+#include <stdint.h>
#include "filehandler.h"
{
FILE *out = fopen(output, "w");
- for (int i = 0; i < disc->length; i++) {
+ for (uint32_t i = 0; i < disc->length; i++) {
fprintf(out, "%s\n", disc->filearray[i]->name);
}
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <stdint.h>
#include "config_spandisc.h"
#include "logic.h"
split_all(srcdata, col);
char* outname = malloc(sizeof(char) * (strlen(output) + NUM_LEN));
- for (int i = 0; i < col->length; i++) {
+ for (uint32_t i = 0; i < col->length; i++) {
sprintf(outname, "%s%04d", output, col->disc[i]->nr);
on_status_print(outname, col->disc[i]);
write_output_file(outname, col->disc[i]);
#include <stdlib.h>
+#include <stdint.h>
#include "spandisc.h"
collection_t* init_collection()
void free_collection(collection_t *col)
{
- for (int i = 0; i < col->length; i++) {
+ for (uint32_t i = 0; i < col->length; i++) {
free_medium_complete(col->disc[i]);
col->disc[i] = NULL;
}
typedef struct {
char* name;
- unsigned long long fsize;
- unsigned int type;
+ uint64_t fsize;
+ uint32_t type;
} file_size_t;
typedef struct {
- int nr;
- unsigned long long freespace;
- int length;
+ int16_t nr;
+ uint64_t freespace;
+ uint32_t length;
file_size_t **filearray;
} medium_t;
typedef struct {
- int length;
+ uint32_t length;
medium_t **disc;
} collection_t;
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
+#include <stdint.h>
#include "splitter.h"
int cmpfunc(const void *filea, const void *fileb)
{
- unsigned long long a = (*(const file_size_t**)filea)->fsize;
- unsigned long long b = (*(const file_size_t**)fileb)->fsize;
+ uint64_t a = (*(const file_size_t**)filea)->fsize;
+ uint64_t b = (*(const file_size_t**)fileb)->fsize;
if (a < b)
return 1;
bool can_add_file_to_medium(medium_t *disc, file_size_t *file)
{
- unsigned long long filesize = ceil(file->fsize / BLOCK_SIZE) * BLOCK_SIZE;
+ uint64_t filesize = ceil(file->fsize / BLOCK_SIZE) * BLOCK_SIZE;
if (disc->freespace < filesize)
return false;
bool bigger_file_ignore_medium(medium_t *disc, file_size_t *file)
{
- unsigned long long filesize = ceil(file->fsize / BLOCK_SIZE) * BLOCK_SIZE;
+ uint64_t filesize = ceil(file->fsize / BLOCK_SIZE) * BLOCK_SIZE;
if ((file->type & S_IFREG) != S_IFREG)
return true;
if (i > sizeof(einheit)/sizeof(einheit[0]))
i = 0;
- fprintf(stdout, "free space on %s: %lld bytes (%ld %c)\n", output,
+ fprintf(stdout, "free space on %s: %ld bytes (%ld %c)\n", output,
medium->freespace, humanread, einheit[i]);
}