-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathshell_users.h
49 lines (38 loc) · 927 Bytes
/
shell_users.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
/*
* This is the header file for the shell_users functions.
*
* Authors: John Jones and Russell Toris
* Version: April. 28, 2010
*/
#ifndef SHELL_DEF
#define SHELL_DEF
typedef char byte;
typedef int bool;
#define TRUE 1;
#define FALSE 0;
#define NULL '\0'
//Note: printing 0x08 moves the cursor back
//This macro prints 0x08, a space to clear, and 0x08 again
#define BACKSPACE char clr[4];clr[0]=0x08;clr[1]=' ';clr[2]=0x08;clr[3]=NULL;dino_print(clr);
//the max length for the input
#define MAX_INPUT 60
struct command_line {
char cmd[60];
char arg[60];
};
#include "lib/string.h"
#include "lib/stdio.h"
#endif
//max number of commands to store in the history
#define HISTORY_MAX 25
struct user {
char usr[8];
char pwd[8];
};
struct user_dir {
struct user all_users[256];
};
void create_user(char *usr, char *pwd);
bool validate();
void encrypt(char *usr, char *pwd);
void decrypt(char *usr, char *pwd);