-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrsg.h
64 lines (58 loc) · 1.23 KB
/
rsg.h
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef rsg
#define rsg
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <png.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <zlib.h>
#include <png.h>
#include <errno.h>
#include <pngconf.h>
#include <argp.h>
#include <termios.h>
struct s_lcg{
unsigned long int seed;
int a;
int c;
int m;
int n;
int current;
};
typedef struct s_lcg Lcg;
struct s_png_conf{
png_structp read_pngp;
png_infop read_infop;
png_structp write_pngp;
png_infop write_infop;
png_uint_32 width;
png_uint_32 height;
png_bytep *row_pointers;
int color_type ;
int bit_depth ;
};
typedef struct s_png_conf Conf;
struct s_arguments {
char *image_path;
int verbose;
int setup;
int decode;
};
typedef struct s_arguments Arguments;
void next_number(Lcg*);
int* generate(int,Lcg*);
int * fy_shuffle(Lcg*);
int generate_single(Lcg*);
Lcg* init_seed(char*,int);
Conf* init(char*);
void free_config(Conf*);
void copy_file(char *, char *,char*);
void write_png_file(char *, png_structp , png_infop , png_bytep *);
void encode_bytes(Conf *, int *, char *);
char *decode_bytes(Conf *, int *) ;
void create_diff(Conf *, int *) ;
#endif // !rsg