asciification du code source
This commit is contained in:
26
broadcast.c
26
broadcast.c
@@ -127,7 +127,7 @@ int broadcast (int t, const char *f, const char *m) {
|
||||
"de = %s\n",
|
||||
sid,
|
||||
t == 1 ? "QUITTER" :
|
||||
t == 2 ? "TOURNÉE" :
|
||||
t == 2 ? "TOURNEE" :
|
||||
t == 3 ? "MESSAGE" : "RIEN",
|
||||
f);
|
||||
#endif
|
||||
@@ -175,20 +175,20 @@ void get_broadcastmsg (int *t, char **f, char **m) {
|
||||
/* id */
|
||||
token = strtok_r (bdcast, SEP, &saveptr);
|
||||
#ifdef DEBUG
|
||||
printf ("Reçu : ID = %s\n", token);
|
||||
printf ("Recu : ID = %s\n", token);
|
||||
#endif
|
||||
|
||||
/* type */
|
||||
token = strtok_r (NULL, SEP, &saveptr);
|
||||
#ifdef DEBUG
|
||||
printf ("Reçu : TYPE = %s\n", token);
|
||||
printf ("Recu : TYPE = %s\n", token);
|
||||
#endif
|
||||
*t = atoi (token);
|
||||
|
||||
/* from */
|
||||
token = strtok_r (NULL, SEP, &saveptr);
|
||||
#ifdef DEBUG
|
||||
printf ("Reçu : FROM = %s\n", token);
|
||||
printf ("Recu : FROM = %s\n", token);
|
||||
#endif
|
||||
*f = NULL;
|
||||
if (token) *f = xstrdup (token);
|
||||
@@ -196,7 +196,7 @@ void get_broadcastmsg (int *t, char **f, char **m) {
|
||||
/* message */
|
||||
token = strtok_r (NULL, SEP, &saveptr);
|
||||
#ifdef DEBUG
|
||||
printf ("Reçu : MESSAGE = %s\n", token);
|
||||
printf ("Recu : MESSAGE = %s\n", token);
|
||||
#endif
|
||||
*m = NULL;
|
||||
if (token) *m = xstrdup (token);
|
||||
@@ -210,7 +210,7 @@ void get_broadcastmsg (int *t, char **f, char **m) {
|
||||
if (count == 0) {
|
||||
remove_elt_n (&bdcast_list, 0);
|
||||
#ifdef DEBUG
|
||||
printf ("Suppression du premier élément. Liste = %s\n",
|
||||
printf ("Suppression du premier element. Liste = %s\n",
|
||||
bdcast_list ? "OK." : "NULL !");
|
||||
#endif
|
||||
next_broadcast (FALSE);
|
||||
@@ -232,25 +232,25 @@ int send_broadcast (int socket_service, userinfos *infos) {
|
||||
printlog (LOG_NOTIFY, "Broadcast pour [%s] : %s\n",
|
||||
infos->nom,
|
||||
type == 1 ? "QUITTER" :
|
||||
type == 2 ? "TOURNÉE" :
|
||||
type == 2 ? "TOURNEE" :
|
||||
type == 3 ? "MESSAGE" :
|
||||
"ERREUR");
|
||||
printlog (LOG_NOTIFY, " de [%s] : %s\n", from, mesg ? mesg : "RIEN");
|
||||
|
||||
switch (type) {
|
||||
case QUITTER: /* Un utilisateur se déconnecte */
|
||||
snprintf (datas, MAXSTRLEN - 1, "Déconnexion de [%s] : %s",
|
||||
case QUITTER: /* Un utilisateur se deconnecte */
|
||||
snprintf (datas, MAXSTRLEN - 1, "Deconnexion de [%s] : %s",
|
||||
from, mesg);
|
||||
break;
|
||||
case TOURNEE: /* Tournée générale */
|
||||
case TOURNEE: /* Tournee generale */
|
||||
if (mesg == NULL) {
|
||||
snprintf (head, MAXSTRLEN - 1,
|
||||
" -+- Tournée générale offerte par %s ! -+-",
|
||||
" -+- Tournee generale offerte par %s ! -+-",
|
||||
from);
|
||||
breuv = drinks_get (infos->prefb);
|
||||
} else {
|
||||
snprintf (head, MAXSTRLEN - 1,
|
||||
" -+- Tournée de %s offerte par %s ! -+-",
|
||||
" -+- Tournee de %s offerte par %s ! -+-",
|
||||
mesg, from);
|
||||
breuv = drinks_get (mesg);
|
||||
}
|
||||
@@ -261,7 +261,7 @@ int send_broadcast (int socket_service, userinfos *infos) {
|
||||
snprintf (datas, MAXSTRLEN - 1, "<%s> %s\n", from, mesg);
|
||||
break;
|
||||
default:
|
||||
printlog (LOG_ERROR, "Type de message broadcast non supporté.\n");
|
||||
printlog (LOG_ERROR, "Type de message broadcast non supporte.\n");
|
||||
type = -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user