-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.h
49 lines (41 loc) · 1.08 KB
/
main.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
#include <string.h>
#include <unistd.h>
#include <alloca.h>
#include "BarnabasBox/barnabas.h"
#include "BarnabasBox/Itoa/itoa.h"
#ifndef MAIN_H
#define MAIN_H
#define max(a,b) (a>b?a:b)
#define min(a,b) (a<b?a:b)
#define MAX_STAT_NAME 27
#define MAX_INV_NAME 100
#define MAX_META_VAL 20
typedef struct {
char *name;
int val;
} Attribute;
typedef struct {
char name[MAX_STAT_NAME];
int val;
Attribute *type[2];
} Stat;
typedef struct {
char name[MAX_INV_NAME];
int count;
} Item;
typedef struct {
char *name;
char val[MAX_META_VAL];
} Metadata;
void print_metadata(Metadata *list, int len, int selection, int offset);
void print_attributes(Attribute *list, int len, int selection, int offset);
void print_stats(Stat *list, int len, int selection, int offset);
void print_inventory(Item *list, int len, int selection, int offset);
void print_skills(char **list, int len, int selection, int offset);
int main(int, char **);
const char* map_attr(Attribute *);
const char attr_index(Attribute *);
Stat default_stat();
Item default_item();
void read_stats(Stat *, int, FILE *, Attribute *);
#endif