Загрузить файлы в «C»
This commit is contained in:
parent
a1c28f22e0
commit
a25dbc52fd
4 changed files with 246 additions and 0 deletions
37
C/irc.h
Normal file
37
C/irc.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
#ifndef IRC_LINUX
|
||||
#define IRC_LINUX
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
#define IRCC_NICK 8
|
||||
#define IRCC_PRIVMSG 7
|
||||
#define IRCC_JOIN 6
|
||||
#define IRCC_PART 5
|
||||
#define IRCC_PING 4
|
||||
|
||||
#define IRCC_DISCONNECTED 2
|
||||
#define IRCC_ERROR 1
|
||||
#define IRCC_SUCCESS 0
|
||||
|
||||
typedef struct {
|
||||
int socket;
|
||||
size_t size;
|
||||
char *raw;
|
||||
char *msg;
|
||||
char *channel;
|
||||
char *nick;
|
||||
} IRCC_client;
|
||||
|
||||
unsigned int IRCC_connect(IRCC_client *irc, const char *ip, const unsigned int port);
|
||||
unsigned int IRCC_register(IRCC_client *irc, const char *nickname);
|
||||
unsigned int IRCC_recv(IRCC_client *irc);
|
||||
void IRCC_send(IRCC_client *irc, char *msg, char *channel);
|
||||
unsigned int IRCC_init(IRCC_client *irc, size_t size);
|
||||
void IRCC_close(IRCC_client *irc);
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue