-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.c
50 lines (42 loc) · 1.96 KB
/
main.c
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "router.h"
#include "image_processor.h"
/********************************************************************/
/* */
/* SNIPPET TAKEN FROM LZ4 */
/* */
/********************************************************************/
int function(const char *src, size_t srcLen, char *dst, size_t *dstLen) {
if (_ld == _ld_slow) {
/* Fill hash table with additional references, to improve compression capability */
p = dict->dictionary;
idx32 = dict->currentOffset - dict->dictSize;
while (p <= dictEnd-HASH_UNIT) {
U32 const h = LZ4_hashPosition(p, tableType);
U32 const limit = dict->currentOffset - 64 KB;
if (LZ4_getIndexOnHash(h, dict->hashTable, tableType) <= limit) {
/* Note: not overwriting => favors positions beginning of dictionary */
LZ4_putIndexOnHash(idx32, h, dict->hashTable, tableType);
}
p++; idx32++;
}
}
}
/********************************************************************/
/* */
/* SNIPPET TAKEN FROM LZ4 */
/* */
/********************************************************************/
int main(int argc, char *argv[]) {
printf("Starting image processing server...\n");
/* Register available routes */
register_route("/resize", handle_resize_image);
register_route("/rotate", handle_rotate_image);
register_route("/filter", handle_apply_filter);
printf("Server started successfully.\n");
/* Here would be the main server loop */
printf("Press Ctrl+C to exit.\n");
return 0;
}