-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu_funs.h
51 lines (43 loc) · 1.27 KB
/
menu_funs.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
/**
* Oświadczam, że niniejsza praca stanowiąca podstawę do uznania osiągnięcia efektów
* uczenia się z przedmiotu SOP1 została wykonana przeze mnie samodzielnie.
* Piotr Rogulski
* 305867
*/
#pragma once
#include <errno.h>
#include <ftw.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <wordexp.h>
#include <sys/stat.h>
#include "print_funs.h"
#include "types.h"
#include "util_funs.h"
#define ERROR(source) (perror(source),\
fprintf(stderr, "%s:%d\n", __FILE__, __LINE__),\
exit(EXIT_FAILURE))
#define TRY(expr) if (expr) ERROR(#expr)
#define UNUSED(x) (void)(x)
#define MAXFD 20
#define SET_GAME_MODE(mode) TRY(setenv("IS_GAME_MODE", #mode, 1) < 0)
int walk_print(const char *name, const struct stat *s, int type, struct FTW *f);
/**
* Create a map from files in the specified directory.
*/
void map_from_dir_tree(char *cmd);
/**
* Generate a random connected graph of size n.
*/
void generate_random_map(char *cmd, WINDOW *win);
/**
* Initialize the game structure woth random objects on a given map.
*/
void start_game(char *cmd, gameState_t *game, WINDOW *win);
/**
* Load a saved game from a file.
*/
void load_game(char *cmd, gameState_t *game, WINDOW *win);