-
Notifications
You must be signed in to change notification settings - Fork 0
/
password.h
45 lines (36 loc) · 927 Bytes
/
password.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
#ifndef __PASSWORD_H
#define __PASSWORD_H
#include <stdlib.h>
#include <string.h>
#include "common.h"
typedef struct password Password;
typedef struct password *PasswordPtr;
struct password {
char *content;
int size;
int position;
boolean correct;
boolean removed;
};
/**
* Allocates space for a new Password and its contents.
*/
PasswordPtr createPassword( const char *str, int position );
/**
* Allocates space for a new hack and its contents. Generates a hack of random
* length.
*/
PasswordPtr createHack();
/**
* Set the position of a hack.
*/
void setHackPosition( PasswordPtr hack, int newPosition);
/**
* Compares the bracket type of two different hacks. Returns true if they match.
*/
boolean sameBracketType( PasswordPtr hack_a, PasswordPtr hack_b );
/**
* Frees the Password parameter along with its contents.
*/
void freePassword( PasswordPtr password );
#endif /* password.h */