Skip to content

Commit cb595c5

Browse files
stefan11111emekoi
andauthored
remove some magic numbers, clean up DCC ipv4/ipv6 global variable mess and use a union to save memory. (#139)
Co-authored-by: Emeka Nkurumeh <[email protected]>
1 parent 5153fc9 commit cb595c5

File tree

5 files changed

+773
-287
lines changed

5 files changed

+773
-287
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
.POSIX:
2-
ALL_WARNING = -Wall -Wextra -pedantic
2+
ALL_WARNING = -Wall -Wextra -pedantic -std=c99
33
PREFIX ?= /usr/local
44
BINDIR = $(PREFIX)/bin
55
MANDIR = $(PREFIX)/share/man
66

77
kirc: kirc.c kirc.h
8-
$(CC) $(CFLAGS) $(LDFLAGS) ${ALL_WARNING} kirc.c -o kirc
8+
$(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 $(LDFLAGS) ${ALL_WARNING} kirc.c -o kirc
99
all: kirc
1010

1111
install: kirc

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,29 @@ Building and installing from source:
1515

1616
Consult `man kirc` for a full list and explanation of available arguments.
1717

18-
kirc [-s hostname] [-p port] [-c channels] [-n nickname] [-r realname]
19-
[-u username] [-k password] [-a token] [-o logfile] [-e|x|v|V]
18+
kirc [-s hostname] [-p port] [-c channels] [-n nickname] [-r realname] [-a auth]
19+
[-u username] [-k password] [-a token] [-o logfile] [-D directory] [-4|6|d|e|x|v|V]
2020

2121
## DCC
22-
DCC transfers are always accpeted without user interaction and downloaded to the current directory.
22+
DCC transfers are only accepted if the -d flag is passed to kirc.
23+
If -d is passed to kirc, DCC transfers are always accpeted without user interaction
24+
and downloaded to the configured directory.
25+
If no directory is set with the -D option, files are downloaded to the current directory.
26+
27+
## DCC SEND
28+
DCC SEND is only enabled if the -d flag is passed to kirc.
29+
You can send files via DCC SEND using the folowing command:
30+
/dcc <target nick> <path to file> <internal ip> <external ip> <port>
31+
If you are sending files to clients outside of your lan, you must
32+
make sure that the chosen port is open and forwarded to
33+
the sending machine's internal address.
34+
Thus is usually done from your router's settings.
35+
For example:
36+
/dcc dcc_client /home/user/upload/file.txt 192.168.1.100 12.34.56.78 10000
37+
This command would send the file located at /home/user/upload/file.txt to the nick
38+
dcc_client, assuming the sending machine's local ip is 192.168.1.100, and
39+
the sending machine's external ip is 12.34.56.78, and that the port 10000
40+
is open and forwarded to the sending machine's local address.
2341

2442
## Command Aliases
2543

kirc.1

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,24 @@ Specifies the PASS connection password
4545
.BI \-a " auth"
4646
Specifies SASL PLAIN mechanism authentication token
4747
.TP
48+
.BI \-D " dir"
49+
Specifies DCC download directory
50+
.TP
51+
.BI \-o " logfile"
52+
Specifies logfile
53+
.TP
54+
.BI \-4
55+
Connect via ipv4 only
56+
.TP
57+
.BI \-6
58+
Connect via ipv6 only
59+
.TP
60+
.BI \-d
61+
Toggle DCC support
62+
.TP
63+
.BI \-f
64+
Filter ansi color codes
65+
.TP
4866
.BI \-e
4967
Specifies SASL EXTERNAL mechanism
5068
.TP
@@ -63,7 +81,7 @@ received.
6381
.BI /<command>
6482
Send message to IRC host (e.g. /JOIN, /PART, /WHOIS, etc.)
6583
.TP
66-
.BI /setprivmsg <nick>
84+
.BI /query " <nick>"
6785
Set privmsg target. Useful when sending privmsg's to a nick instead of a chan.
6886
.TP
6987
.BI // " <text>"

0 commit comments

Comments
 (0)