-
Notifications
You must be signed in to change notification settings - Fork 10
/
morse.h
44 lines (28 loc) · 773 Bytes
/
morse.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
#ifndef MORSE_H_
#define MORSE_H_
typedef int bool;
#define false 0
#define true 1
/*
* FAKE_SPACE IS MARKING FOR A SPACE
*/
#define FAKE_SPACE '/'
/*
* THE CHARACTER THAT BETWEEN TWO MORSE STRING
*/
#define SEPARATOR ' '
typedef struct Morse Morse_t;
struct Morse{
char c[9];
};
Morse_t* new_morse();
bool str2morse(char m , Morse_t *morse);
bool morse2str(Morse_t *morse, char *ch);
bool mark2morse(char n, Morse_t *morse);
bool morse2mark(Morse_t *morse, char *n);
bool num2morse(char n, Morse_t *morse);
bool morse2num(Morse_t *morse, char *n);
void morse_str_to_str(char *morse ,char *string, int buf_len);
void str_to_morse_str(char *string ,char *morse, int buf_len);
void str2lowcase(char *str, char *out, int buf_len);
#endif /* MORSE_H_ */