-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelper.h
More file actions
32 lines (28 loc) · 792 Bytes
/
helper.h
File metadata and controls
32 lines (28 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef NYUENC_HELPER_H
#define NYUENC_HELPER_H
#include "macros.h"
#include <stdint.h>
struct ProgramArguments {
int multithreaded;
int threadCount;
char **files;
int filesCount;
};
struct TaskV2 {
char *startChar;
unsigned short numberOfCharacters;
};
struct ResultV2 {
char *characters;
uint8_t *counts;
unsigned long size;
};
unsigned long MIN(unsigned long a, unsigned long b);
struct ProgramArguments parseArguments(int argc, char *argv[]);
void writeTuple(char c, uint8_t count);
int sequential(struct ProgramArguments *args);
unsigned long *getFileSizes(struct ProgramArguments args);
unsigned long getTasksCount(unsigned long *fileSizes, int filesCount);
struct ResultV2 *performRLEV2(struct TaskV2 task);
void printResultParallelV2();
#endif