Skip to content
This repository
Newer
Older
100644 82 lines (69 sloc) 2.193 kb
29252b6b »
2010-08-15 More refactoring; chopping up quirc.c. '#pragma once'-ing headers
1 #pragma once
2
9f0cff13 »
2010-07-26 Initial commit.
3 /*
4 quIRC - simple terminal-based IRC client
5 Copyright (C) 2010 Edward Cree
6
7 See quirc.c for license information
8 irc: networking functions
9 */
10
11 #include <stdio.h>
12 #include <stdlib.h>
13 #include <stdbool.h>
14 #include <string.h>
15 #include <unistd.h>
8844d523 »
2010-09-01 Fix various compile errors in prev. commit
16 #include <fcntl.h>
556a5210 »
2010-09-03 Functions for irc-style casemapping
17 #include <ctype.h>
9f0cff13 »
2010-07-26 Initial commit.
18 #include <sys/socket.h>
19 #include <sys/utsname.h>
20 #include <netdb.h>
21 #include <arpa/inet.h>
22 #include <netinet/in.h>
5bd9397a »
2010-09-01 Asynchronous connect(), fixes, and liveness (unfinished)
23 #include <errno.h>
29252b6b »
2010-08-15 More refactoring; chopping up quirc.c. '#pragma once'-ing headers
24
bdca1e0e »
2010-09-03 More correct casemapping handling (doesn't yet detect from RPL_ISUPPORT)
25 typedef enum
26 {
27 RFC1459,
28 STRICT_RFC1459,
29 ASCII
30 }
31 cmap;
32
61b26588 »
2010-09-15 irc_breakdown() function, parses :prefix cmd args...
33 typedef struct
34 {
35 char *prefix;
36 char *cmd;
37 int nargs;
38 char *args[15]; // RFC specifies maximum of 15 args
39 }
40 message;
41
a9c16e9e »
2010-07-27 Things generally are now buffer-aware
42 #include "bits.h"
29252b6b »
2010-08-15 More refactoring; chopping up quirc.c. '#pragma once'-ing headers
43 #include "buffer.h"
44 #include "colour.h"
45 #include "config.h"
83af8c16 »
2010-08-15 Move handling of numeric responses out to irc.c
46 #include "numeric.h"
bdca1e0e »
2010-09-03 More correct casemapping handling (doesn't yet detect from RPL_ISUPPORT)
47 #include "names.h"
9f0cff13 »
2010-07-26 Initial commit.
48
bfdcd847 »
2010-08-21 Handle Low-Level Quoting
49 #define MQUOTE '\020'
50
5bd9397a »
2010-09-01 Asynchronous connect(), fixes, and liveness (unfinished)
51 int irc_connect(char *server, char *portno, fd_set *master, int *fdmax); // non-blocking
52 int irc_conn_rest(int b, char *nick, char *username, char *fullname); // call this when the non-blocking connect() has finished
e5159896 »
2010-09-03 Allow multiple automatic connects and joins in .quirc
53 int autoconnect(fd_set *master, int *fdmax, servlist *serv);
9f0cff13 »
2010-07-26 Initial commit.
54 int irc_tx(int fd, char * packet);
55 int irc_rx(int fd, char ** data);
61b26588 »
2010-09-15 irc_breakdown() function, parses :prefix cmd args...
56
57 message irc_breakdown(char *packet);
bfdcd847 »
2010-08-21 Handle Low-Level Quoting
58 void low_quote(char *from, char to[512]);
59 char * low_dequote(char *buf);
e928ecfe »
2010-08-16 Refactor PING, MODE and KILL handling
60
bdca1e0e »
2010-09-03 More correct casemapping handling (doesn't yet detect from RPL_ISUPPORT)
61 char irc_to_upper(char c, cmap casemapping);
62 char irc_to_lower(char c, cmap casemapping);
63 int irc_strcasecmp(char *c1, char *c2, cmap casemapping);
64 int irc_strncasecmp(char *c1, char *c2, int n, cmap casemapping);
556a5210 »
2010-09-03 Functions for irc-style casemapping
65
6fee7244 »
2010-09-15 Some work on the new RX parsing
66 // Received-IRC message handlers
67 int irc_numeric(message pkt, int b);
e928ecfe »
2010-08-16 Refactor PING, MODE and KILL handling
68 int rx_ping(int fd);
e5159896 »
2010-09-03 Allow multiple automatic connects and joins in .quirc
69 int rx_mode(servlist * serv, int b); // the first MODE triggers auto-join. Apart from using it as a trigger, we don't look at modes just yet
b6731b3a »
2010-08-20 More refactoring; created crush() function (is still old code)
70 int rx_kill(int b, fd_set *master);
95baa8ff »
2010-09-01 Recognise KICK messages
71 int rx_kick(int b);
b6731b3a »
2010-08-20 More refactoring; created crush() function (is still old code)
72 int rx_error(int b, fd_set *master);
73 int rx_privmsg(int b, char *packet, char *pdata);
8cceb3be »
2010-08-20 Refactor NOTICE
74 int rx_notice(int b, char *packet);
606e6c3f »
2010-08-21 Recognise TOPIC command
75 int rx_topic(int b, char *packet);
e5159896 »
2010-09-03 Allow multiple automatic connects and joins in .quirc
76 int rx_join(int b, char *packet, char *pdata);
5ba68302 »
2010-08-20 Refactor JOIN, PART
77 int rx_part(int b, char *packet, char *pdata);
c33e200f »
2010-08-20 Refactor QUIT, NICK
78 int rx_quit(int b, char *packet, char *pdata);
79 int rx_nick(int b, char *packet, char *pdata);
097f13bb »
2010-08-20 Refactoring (CTCP handling from rx_privmsg() to ctcp())
80
81 int ctcp(char *msg, char *from, char *src, int b2); // Handle CTCP (Client-To-Client Protocol) messages (from is crushed-src)
Something went wrong with that request. Please try again.