38 |
|
|
39 |
static int my_error(std::string msg) |
static int my_error(std::string msg) |
40 |
{ |
{ |
41 |
std::cout << msg << std::endl; |
std::cerr << msg << std::endl; |
42 |
return 1; |
return 1; |
43 |
} |
} |
44 |
|
|
45 |
int main( int argc, char *argv[] ) |
int main( int argc, char *argv[] ) |
46 |
{ |
{ |
47 |
|
argc = 0; |
48 |
|
*argv = NULL; |
49 |
c_list_user *list_user = new c_list_user(); |
c_list_user *list_user = new c_list_user(); |
50 |
|
|
51 |
// charge les utilisateurs existants |
// charge les utilisateurs existants |
53 |
if (list_user->load_user() != 0) |
if (list_user->load_user() != 0) |
54 |
return my_error(ERROR1); |
return my_error(ERROR1); |
55 |
|
|
56 |
// demande création utilisateur ou pas |
// demande création utilisateur ou pas |
57 |
|
// avec enregistrement de la voix |
58 |
if (list_user->new_user_or_not() == 0) |
if (list_user->new_user_or_not() == 0) |
59 |
// vérifie s'il existe un utilisateur au min. |
// vérifie s'il existe un utilisateur au min. |
60 |
if (list_user->get_list_user().size() != 0) |
if (list_user->get_list_user().size() != 0) |
61 |
// identification de l'utilisateur par mdp |
// identification de l'utilisateur par mdp |
62 |
if (list_user->identify_user() == 0) |
if (list_user->identify_user() == 0) |
63 |
// choix des actions pour l'utilisateur |
// choix des actions pour l'utilisateur |
64 |
list_user->action_user(); |
if (list_user->action_user() != 0) |
65 |
|
return my_error(ERROR1); |
66 |
|
else return 0; |
67 |
else |
else |
68 |
return my_error(ERROR4); |
return my_error(ERROR4); |
69 |
else |
else |