Загрузить файлы в «C»

This commit is contained in:
8nlight 2023-08-16 10:53:53 +03:00
parent ad09f6fba5
commit a31b8a5bab
3 changed files with 99 additions and 39 deletions

16
C/irc.c
View file

@ -74,7 +74,7 @@ unsigned int IRCC_recv(IRCC_client *irc){
}
else {
//puts(irc->raw);
puts(irc->raw);
//Check end of motd
if (strstr(irc->raw, "PRIVMSG ") == NULL && strstr(irc->raw, "MOTD"))
@ -91,6 +91,16 @@ unsigned int IRCC_recv(IRCC_client *irc){
return IRCC_NICK;
}
else if (strstr(irc->raw, "TOPIC ")){
IRCC_parse(strstr(irc->raw, "TOPIC "), irc);
return IRCC_TOPIC;
}
else if (strstr(irc->raw, "MODE ")){
IRCC_parse(strstr(irc->raw, "MODE "), irc);
return IRCC_MODE;
}
else if (strstr(irc->raw, "JOIN ")){
IRCC_parse(strstr(irc->raw, "JOIN "), irc);
return IRCC_JOIN;
@ -123,8 +133,8 @@ void IRCC_send(IRCC_client *irc, char *msg, char *channel){
}
unsigned int IRCC_init(IRCC_client *irc, size_t size){
if (size <= 200){
fprintf(stderr, "Low buffer size (IRCC_init)\n");
if (size <= 250){
fprintf(stderr, "Low buffer size (IRCC_init) (Min 250/512)\n");
return IRCC_ERROR;
}