Compare commits

...

50 Commits
1.6 ... master

Author SHA1 Message Date
Quentin Rameau 39907c79a4 usage: Normalize a bit the usage and man-page 2022-09-05 23:19:14 +02:00
Hiltjo Posthuma 25c000bf98 ii.1: fix some lint warnings from mandoc -Tlint 2022-09-02 12:25:11 +02:00
Hiltjo Posthuma 5bd50577a9 ii: fix mistake in usage, the host is actually mandatory
Reported by Petr Vaněk <arkamar@atlas.cz>, thanks!
2022-09-02 12:23:40 +02:00
Hiltjo Posthuma 00698e45ea Makefile: fix make dist if it is run more than once
... and stream directly to compressed tarball.
2022-09-02 11:52:58 +02:00
Hiltjo Posthuma 3fab03ea0b remove unmaintained changelog 2022-09-02 11:50:51 +02:00
Hiltjo Posthuma 36c77931fd Makefile: simplify and use system flags by default 2022-09-02 11:49:34 +02:00
Hiltjo Posthuma acbc72748d LICENSE: bump license year 2022-09-02 11:35:15 +02:00
Hiltjo Posthuma 2d0480ce81 ii.1: improve documentation of usage options
* Also improve the order of options and consistency with the usage in ii.c.
* Remove some redundant sections.

Adapted from a patch by Petr Vaněk <arkamar@atlas.cz>, thanks!
2022-09-02 11:33:46 +02:00
Tom Schwindl 71c1e50da0 ii: Add a die() function to replace fprintf(3) + exit(3) calls 2022-08-12 09:10:20 +02:00
Hiltjo Posthuma 01537d014b bump version to 1.9 2022-01-07 12:37:48 +01:00
Christoph Lohmann cfb3464c6e Reduce effective buffer size per channel input.
This will curb the easy way to trigger a too long line sent to the
server and prevent this error and connection drop.
2021-12-25 12:12:54 +01:00
Christoph Lohmann d9be11ad05 Increase ping timeout for bad connections. 2021-12-25 12:10:10 +01:00
Hiltjo Posthuma ecf390259c ewritestr: Remove duplicate shift of offset
Patch by mizmar@protonmail.com, thanks.
2020-07-05 22:32:13 +02:00
David Demelier 49e239fbb1 remove useless c->next = NULL 2020-01-17 14:55:06 +01:00
Hiltjo Posthuma a192aa3113 minor style fix for ARGEND
see:
https://9fans.github.io/plan9port/man/man3/arg.html
2019-12-16 18:28:10 +01:00
Hiltjo Posthuma 1411224b16 fix undefined behaviour of use of isalpha, isdigit and tolower
"The argument c must be EOF or representable as an unsigned char;
 otherwise, the result is undefined."
2019-12-16 18:26:01 +01:00
Michael Forney bf06f14188 Fix traversal of addrinfo list
Although the loop is executed once for every result, in each iteration
it connects to the first result.
2019-05-26 15:38:52 +02:00
Hiltjo Posthuma dfecb5c0f4 fix typo in NOTICE messages 2019-02-12 18:14:18 +01:00
Hiltjo Posthuma b25423f765 check input length before reading
thanks halbeno and quinq for the patches and feedback.
2018-07-23 21:42:59 +02:00
Quentin Rameau 51cb204eb2 Add a config option to link against system or shipped strlcpy 2018-06-02 14:25:28 +02:00
Quentin Rameau e32415744c Refactor Makefile
Declare it as POSIX-compliant
Use $() instead of ${}
Separate stock CFLAGS from user CFLAGS
2018-06-02 14:25:15 +02:00
Hiltjo Posthuma 25ee995ead fix typo in comment
pointed out by halbeno
2018-05-22 08:43:32 +02:00
David Demelier 804cb72666 Remove .hgtags 2018-05-10 11:25:54 +02:00
Hiltjo Posthuma 9288de6126 bump version to 1.8 2018-02-04 14:11:39 +01:00
Quentin Rameau 95963c46eb Makefile: add a dependency on arg.h 2017-12-03 22:34:14 +01:00
Quentin Rameau fd867aebd1 Fix arg.h 2017-12-03 22:34:14 +01:00
Hiltjo Posthuma 31b2445000 don't modify argv, use a counter
on some platforms (OpenBSD) this changes the exposed argv in tools
using the kvm_* interface, such as ps and pgrep.
2017-11-18 12:35:33 +01:00
Hiltjo Posthuma 0fedff44e3 Makefile: simplify 2017-11-18 12:28:30 +01:00
Hiltjo Posthuma bb1e5569d0 allow some more characters in the channel name 2017-07-09 12:28:08 +02:00
Hiltjo Posthuma 704ab925e9 merge my changes to master
Special thanks to:
- Wolfgang Corcoran-Mathe for sending patches and testing.
- Nico Golde for maintaining ii for so long.
2017-06-02 09:54:54 +02:00
Nico Golde 714bd0cb6a define EXIT_TIMEOUT and use that on ping timeouts. thanks Evan Gates for the idea! 2016-10-13 15:21:47 -07:00
Nico Golde f8f3a096bc errm eprint isnt declared here. thanks Ali H. Fardan 2016-09-07 21:17:12 +02:00
Nico Golde 584290f264 use pledge by default if compiled on openbsc and provide errno string 2016-09-06 19:58:28 +02:00
Nico Golde a4434536cd fix double backslash 2016-09-02 18:43:08 +02:00
Nico Golde 18580a159f add OpenBSD pledge support - thanks Gleydson Soares 2016-09-02 16:13:43 +02:00
Vasily Kolobkov f79e2f0953 Fix channel use after freeing in main loop
Signed-off-by: Nico Golde <nico@ngolde.de>
2016-02-24 23:02:19 +01:00
Vasily Kolobkov 165638e3c8 Check up on server messages
Signed-off-by: Nico Golde <nico@ngolde.de>
2016-02-24 23:02:13 +01:00
Nico Golde 1bc3e103c0 prevent nick collisions by only setting the nick after the server accepted it and print a message about change to server log 2015-11-04 19:35:23 -05:00
Nico Golde 29ff454e80 remove duplicate word, thanks Michael Stevens! 2015-11-04 19:35:20 -05:00
Nico Golde 63b5736e6e use _POSIX_PIPE_BUF if PIPE_BUF is not defined (as on FreeBSD); thanks Gleydson Soares! 2015-03-22 13:37:53 +01:00
Nico Golde 41ce43bf8c add gitignore 2013-10-12 10:34:32 +02:00
Nico Golde 28feb9a40e fix "typo" in manpage, thanks Enrique Garbi 2013-04-25 09:00:54 +02:00
Nico Golde 76e6ff5a4b 1.7 release 2013-01-05 14:26:47 +01:00
Nico Golde 7a99152ce6 add respective header for select and not implicitely include it 2012-08-14 11:57:30 +02:00
Nico Golde aed65ee703 convert slashes to , rather than _ in channel names. , is not allowed by the RFC, _ is. 2012-07-03 17:43:56 +02:00
Nico Golde a5a7d1b376 fix parsing of JOIN messages for certain servers, thanks van Kanakarakis 2012-06-28 15:41:57 +02:00
Nico Golde 9a0ea4ada1 mark 1.7 as the next release version 2012-06-16 17:00:51 +02:00
Nico Golde c68beccf59 -k now points to an environment variable containing the password 2012-06-16 17:00:31 +02:00
Nico Golde 2bcd27c9e8 a little cleanup by Connor Lane Smith, thanks! 2011-10-31 21:35:12 +01:00
Nico Golde 6e0a38ee6c Added tag 1.6 for changeset f09f802a8037 2011-01-31 21:47:02 +01:00
13 changed files with 992 additions and 570 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
ii
*.a
*.o

View File

@ -1,9 +0,0 @@
0391602b2f06e0c7e89b7328719bec5695f57d9c ii-1.2
daf8fc17d14014f312721c1d56ffa049392393fc ii-1.2
987fc9d57808948b4bcf626b096c9c60226455d3 ii-1.3
7c7c000b4f42a48676e8f98a953a981bf6b29029 1.4
4c6892284a9ae73de3c84c164e214d31e76427a4 1.5
4c6892284a9ae73de3c84c164e214d31e76427a4 1.5
6f504f412a5997158b651eac8785f8331408b2e5 1.5
6f504f412a5997158b651eac8785f8331408b2e5 1.5
550ee110071903b9676d848d8947e96e02a8a662 1.5

32
CHANGES
View File

@ -1,32 +0,0 @@
1.6 (2011-01-31):
- fix regression introduced for handling unknown commands
1.5 (2011-01-24):
- fix channel name comparison in add_channel(), compare lowercase
to prevent leaking file descriptors in the long run => Thanks samurai!
- only handle commands ii explicitely understands and treat the rest
as raw irc (only worked for raw commands in capital lettersin the past) => Thanks samurai!
- create in FIFO on receiving a privmsg directly instead of requiring a new
/j command first => Thanks Evan Gates
this also implies that in FIFOs aren't deleted on channel leaves any longer because
this itself creates a channel event again which in turn would recreate the file
- minor changes
1.4 (2008-08-09):
- fix directory traversal on servers that support SAJOIN
NOTE: not marking as security relevant as it is only possible to
create directories outside (which is of course annoying) of the irc
hierarchy but not overwriting arbitrary files with the channel name.
- documentation fixes
- general cleanup
1.3 (2007-07-14):
- server messages about users (QUIT,JOIN) will no longer
go to the user directories but to the server out file to
give an easy method to monitor it and to prevent spamming
the irc directory.
1.2 (2007-06-23):
- Exit on channel creation failure, thanks Michael Prokop
- Implemented joining of password protected channels
- Removed -v option from the manpage since it's not implemented

19
FAQ
View File

@ -6,6 +6,7 @@ Where is IRC command xy (ignore etc.)?
ii is for advanced users, please use standard tools like awk, sed and grep for
this. This can be done easily and will not bloat the code.
Where is a graphical interface?
-------------------------------
Basically ii follows the UNIX philosophy so it is only file based. But it
@ -14,12 +15,14 @@ the FIFOs and output files. Feel free to implement or wait until we have done
this. Actually I use ii in combination with vim, multitail and screen and it works
like a charm.
Which commands are supported?
-----------------------------
j (join or msg), t (topic), a (away), n (nick), l (leave). The missing are
obsolete or can be easily used by typing the IRC commands itself (i.e. /WHO
instead of /who).
How can I recognize queries?
----------------------------
ii itself doesn't support this but the queries.sh script is an example
@ -28,9 +31,23 @@ To get an instant notice of a new file other mechanisms like inotify/dnotify
could be used as well but I was too lazy to try it out since the script
is enough for me.
What other fancy stuff can I do with ii?
----------------------------------------
It is very easy to write irc bots in ii:
tail -f \#/out | while read foo; do name=echo $foo | awk '{print $2}' | sed 's,<\\(.*\\)>,\\1,'; if 0 -eq expr $RANDOM % 10 then echo "$name: WHAT??" ; fi; done
#!/bin/sh
chan="#yourchannel"
tail -f "${chan}/out" | while read -r line; do
cmd=$(printf '%s\n' "$line" | cut -d ' ' -f 4-)
name=$(printf '%s\n' "$line" | cut -d ' ' -f 3 | tr -d '<>')
if [ "$cmd" = "!rand" ]; then
r="$RANDOM"
if expr "$r" "%" "10"; then
echo "$name: $r" >> "${chan}/in"
fi
fi
done
This will just spam a channel but think about using nagios2irc or you can
use ii to generate channel stats. Your imagination should be boundless.

View File

@ -1,7 +1,8 @@
MIT/X Consortium License
(C)opyright MMV-MMVI Anselm R. Garbe <garbeam@wmii.de>
(C)opyright MMV-MMVIII Nico Golde <nico at ngolde dot de>
(C)opyright 2014-2022 Hiltjo Posthuma <hiltjo at codemadness dot org>
(C)opyright 2005-2006 Anselm R. Garbe <garbeam@wmii.de>
(C)opyright 2005-2011 Nico Golde <nico at ngolde dot de>
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),

View File

@ -1,55 +1,60 @@
# ii - irc it - simple but flexible IRC client
# (C)opyright MMV-MMVI Anselm R. Garbe
# (C)opyright MMV-MMVII Anselm R. Garbe, Nico Golde
.POSIX:
include config.mk
VERSION = 1.9
SRC = ii.c
OBJ = ${SRC:.c=.o}
# paths
PREFIX = /usr/local
MANPREFIX = $(PREFIX)/share/man
DOCPREFIX = $(PREFIX)/share/doc
all: options ii
@echo built ii
SRC = ii.c
OBJ = $(SRC:.c=.o)
# use system flags.
II_CFLAGS = $(CFLAGS)
II_LDFLAGS = $(LDFLAGS)
# on systems which provide strlcpy(3),
# remove NEED_STRLCPY from CPPFLAGS and
# remove strlcpy.o from LIBS
II_CPPFLAGS = $(CPPFLAGS) -DVERSION=\"$(VERSION)\" -D_DEFAULT_SOURCE -DNEED_STRLCPY
LIBS = strlcpy.o
all: ii
options:
@echo ii build options:
@echo "LIBS = ${LIBS}"
@echo "INCLUDES = ${INCLUDES}"
@echo "CFLAGS = ${CFLAGS}"
@echo "LDFLAGS = ${LDFLAGS}"
@echo "CC = ${CC}"
@echo "CFLAGS = $(CFLAGS)"
@echo "LDFLAGS = $(LDFLAGS)"
@echo "CC = $(CC)"
.c.o:
@echo CC $<
@${CC} -c ${CFLAGS} $<
$(CC) -c $< $(II_CFLAGS) $(II_CPPFLAGS)
dist: clean
@mkdir -p ii-${VERSION}
@cp -R query.sh Makefile CHANGES README FAQ LICENSE config.mk ii.c ii.1 ii-${VERSION}
@tar -cf ii-${VERSION}.tar ii-${VERSION}
@gzip ii-${VERSION}.tar
@rm -rf ii-${VERSION}
@echo created distribution ii-${VERSION}.tar.gz
ii: $(OBJ) $(LIBS)
$(CC) -o $@ $(OBJ) $(LIBS) $(II_LDFLAGS)
ii: ${OBJ}
@echo LD $@
@${CC} -o $@ ${OBJ} ${LDFLAGS}
$(OBJ): arg.h
install: all
@mkdir -p ${DESTDIR}${DOCDIR}
@mkdir -p ${DESTDIR}${BINDIR}
@mkdir -p ${DESTDIR}${MAN1DIR}
@install -d ${DESTDIR}${BINDIR} ${DESTDIR}${MAN1DIR}
@install -m 644 CHANGES README query.sh FAQ LICENSE ${DESTDIR}${DOCDIR}
@install -m 775 ii ${DESTDIR}${BINDIR}
@install -m 444 ii.1 ${DESTDIR}${MAN1DIR}
@echo "installed ii"
mkdir -p $(DESTDIR)$(PREFIX)/bin
mkdir -p $(DESTDIR)$(MANPREFIX)/man1
mkdir -p $(DESTDIR)$(DOCPREFIX)/ii
install -m 644 README FAQ LICENSE $(DESTDIR)$(DOCPREFIX)/ii
install -m 775 ii $(DESTDIR)$(PREFIX)/bin
sed "s/VERSION/$(VERSION)/g" < ii.1 > $(DESTDIR)$(MANPREFIX)/man1/ii.1
chmod 644 $(DESTDIR)$(MANPREFIX)/man1/ii.1
uninstall: all
@rm -f ${DESTDIR}${MAN1DIR}/ii.1
@rm -rf ${DESTDIR}${DOCDIR}
@rm -f ${DESTDIR}${BINDIR}/ii
@echo "uninstalled ii"
rm -f $(DESTDIR)$(MANPREFIX)/man1/ii.1 $(DESTDIR)$(PREFIX)/bin/ii
rm -rf $(DESTDIR)$(DOCPREFIX)/ii
dist: clean
mkdir -p ii-$(VERSION)
cp -R Makefile README FAQ LICENSE strlcpy.c arg.h \
ii.c ii.1 ii-$(VERSION)
tar -cf - ii-$(VERSION) | gzip -c > ii-$(VERSION).tar.gz
rm -rf ii-$(VERSION)
clean:
rm -f ii *~ *.o *core *.tar.gz
rm -f ii *.o

53
README
View File

@ -1,8 +1,8 @@
Abstract
--------
ii is a minimalistic FIFO and filesystem based IRC client. It creates an irc
directory tree with server, channel and nick name directories. In every
directory a FIFO file (in) and and normal file (out) is placed.
directory tree with server, channel and nick name directories. In every
directory a FIFO file (in) and normal file (out) is placed.
The in file is used to communicate with the servers and the out files include
the server messages. For every channel and every nick name there will be new in
@ -13,6 +13,7 @@ standard command line tools. For example if you want to join a channel just do
echo "/j #channel" > in and ii creates a new channel directory with in and out
file.
Installation
------------
Edit config.mk to match your local setup. ii is installed into
@ -23,6 +24,7 @@ necessary as root):
$ make clean install
Running ii
------------
Simply invoke the 'ii' command with required arguments
@ -41,19 +43,50 @@ Thanks to Matthias Kopfermann for this hint.
You can find an example of how this nested environment could look like on:
http://nion.modprobe.de/blog/archives/440-Using-the-ii-irc-client.html
SSL/TLS support
---------------
Below is an example using OpenBSD relayd which sets up a TCP TLS relay
connection on localhost. A similar setup can be accomplished using
stunnel or netcat with TLS support. This also works for other programs
that don't support TLS natively.
/etc/relayd.conf:
table <freenode> { irc.freenode.net }
table <oftc> { irc.oftc.net }
protocol "irctls" {
tcp { nodelay, sack }
}
relay "freenode" {
listen on 127.0.0.1 port 6668
protocol "irctls"
forward with tls to <freenode> port 6697
}
relay "oftc" {
listen on 127.0.0.1 port 6669
protocol "irctls"
forward with tls to <oftc> port 6697
}
Then connect:
./irc -n nick -u name -s 127.0.0.1 -p 6668
./irc -n nick -u name -s 127.0.0.1 -p 6669
Configuration
-------------
No configuration is needed.
Changelog
---------
Since I missed the chance to add a proper changelog right from the beginning,
please have a look at the commit messages on http://code.suckless.org/hg/ii/
please have a look at the commit messages on http://git.suckless.org/ii/
they are fairly descriptive on releases prior to 1.2.
Contact
-------
If you want to contact the developers just write a mail to
ii (at) modprobe (dot) de
-- Nico Golde, Anselm R. Garbe

50
arg.h Normal file
View File

@ -0,0 +1,50 @@
/*
* Copy me if you can.
* by 20h
*/
#ifndef ARG_H__
#define ARG_H__
extern char *argv0;
/* use main(int argc, char *argv[]) */
#define ARGBEGIN for (argv0 = *argv, argv++, argc--;\
argv[0] && argv[0][0] == '-'\
&& argv[0][1];\
argc--, argv++) {\
char argc_;\
char **argv_;\
int brk_;\
if (argv[0][1] == '-' && argv[0][2] == '\0') {\
argv++;\
argc--;\
break;\
}\
int i_;\
for (i_ = 1, brk_ = 0, argv_ = argv;\
argv[0][i_] && !brk_;\
i_++) {\
if (argv_ != argv)\
break;\
argc_ = argv[0][i_];\
switch (argc_)
#define ARGEND }\
}
#define ARGC() argc_
#define EARGF(x) ((argv[0][i_+1] == '\0' && argv[1] == NULL)?\
((x), abort(), (char *)0) :\
(brk_ = 1, (argv[0][i_+1] != '\0')?\
(&argv[0][i_+1]) :\
(argc--, argv++, argv[0])))
#define ARGF() ((argv[0][i_+1] == '\0' && argv[1] == NULL)?\
(char *)0 :\
(brk_ = 1, (argv[0][i_+1] != '\0')?\
(&argv[0][i_+1]) :\
(argc--, argv++, argv[0])))
#endif

View File

@ -1,27 +0,0 @@
# Customize to fit your system
# paths
PREFIX = /usr/local
BINDIR = ${PREFIX}/bin
MANDIR = ${PREFIX}/share/man
MAN1DIR = ${MANDIR}/man1
DOCDIR = ${PREFIX}/share/doc/ii
# Set the following to install to a different root
DESTDIR =
INCDIR = ${PREFIX}/include
LIBDIR = ${PREFIX}/lib
VERSION = 1.6
# includes and libs
INCLUDES = -I. -I${INCDIR} -I/usr/include
LIBS = -L${LIBDIR} -L/usr/lib -lc
# uncomment and comment other variables for compiling on Solaris
#LIBS = -L${LIBDIR} -L/usr/lib -lc -lsocket -lnsl
#CFLAGS = -g ${INCLUDES} -DVERSION=\"${VERSION}\"
# compiler
CC = cc
CFLAGS = -g -O0 -W -Wall ${INCLUDES} -DVERSION=\"${VERSION}\"
LDFLAGS = ${LIBS}

137
ii.1
View File

@ -1,16 +1,29 @@
.de FN
\fI\|\\$1\|\fP\\$2
..
.TH ii 1
.TH II 1 ii-VERSION
.SH NAME
ii \- irc it or irc improved
ii - irc it or irc improved
.SH SYNOPSIS
.B ii
.B -s
.I host
.RB [ -p
.I port
|
.B -u
.IR sockname ]
.RB [ -i
.IR ircdir ]
.RB [ -n
.IR nickname ]
.RB [ -f
.IR realname ]
.RB [ -k
.IR env_pass ]
.SH DESCRIPTION
.B ii
is a minimalistic FIFO and filesystem based IRC client.
It creates an irc directory tree with server, channel and
nick name directories.
In every directory a FIFO file (in) and and normal file (out)
In every directory a FIFO file (in) and normal file (out)
is placed. This will be for example ~/irc/irc.freenode.net/.
The in file is used to communicate with the servers and the out
files includes the server messages. For every channel and every nick
@ -19,80 +32,90 @@ The basic idea of this is to be able to communicate with an IRC
server with basic command line tools.
For example if you will join a channel just do echo "/j #channel" > in
and ii creates a new channel directory with in and out file.
.SH SYNOPSIS
.B ii
.RB [ \-s
.IR servername ]
.RB [ \-p
.IR port ]
.RB [ \-k
.IR password ]
.RB [ \-i
.IR prefix ]
.RB [ \-n
.IR nickname ]
.RB [ \-f
.IR realname ]
.SH OPTIONS
.TP
.BI \-s " servername"
lets you override the default servername (irc.freenode.net)
.BI -s " host"
server/host to connect to, for example: irc.freenode.net
.TP
.BI \-p " port"
.BI -p " port"
lets you override the default port (6667)
.TP
.BI \-k " password"
lets you use a password to authenticate your nick on the server
(be aware of the problem that this is visible in the process list, if you
don't want this use a query to submit your password)
.BI -u " sockname"
connect to a UNIX domain socket instead of directly to a server.
If set, the
.B -p
option will be ignored.
.TP
.BI \-i " prefix"
.BI -i " ircdir"
lets you override the default irc path (~/irc)
.TP
.BI \-n " nickname"
.BI -n " nickname"
lets you override the default nick ($USER)
.TP
.BI \-f " realname"
.BI -f " realname"
lets you specify your real name associated with your nick
.TP
.BI -k " env_pass"
lets you specify an environment variable that contains your IRC password,
e.g. IIPASS="foobar" ii -k IIPASS.
This is done in order to prevent other users from eavesdropping the server
password via the process list.
.SH DIRECTORIES
.TP
.FN ~/irc
.B ~/irc
In this directory the irc tree will be created. In this directory you
will find a directory for your server (default: irc.freenode.net) in
which the FIFO and the output file will be stored.
If you join a channel a new directory with the name of the channel
will be created in the ~/irc/$servername/ directory.
will be created in the
.BI ~/irc/ servername /
directory.
.SH COMMANDS
.TP
.FN /a " [<message>]"
mark yourself as away
.BI /a " [message]"
mark yourself as away,
with the optional
.I message
as an away reason.
.TP
.FN /j " #channel/nickname [<message>]"
join a channel or open private conversation with user
.BI /j " #channel [password]"
join a
.IR #channel ,
with the optional
.IR password .
.TP
.FN /l " #channel/nickname"
leave a channel or query
.BI /j " nickname [message]"
open private conversation with user
.I nickname
and directly send the optional
.IR message .
.TP
.FN /n " nick"
change the nick name
.BI /l " [reason]"
leave a channel or query,
giving the optional
.I reason
message.
.TP
.FN /t " topic"
set the topic of a channel
.BI /n " nick"
change the nick name to
.IR nick .
.TP
Everything which is not a command will simply be posted into the channel or to the server.
So if you need /who just write /WHO as described in the RFC to the server in FIFO.
.BI /q " [reason]"
quit ii,
giving the optional
.I reason
message.
.TP
.FN "out file usage"
Write wrappers, pagers or use your tools of choice to display the out file contents (loco, multitail, etc.).
.SH CONTACT
.TP
Write to ii (at) modprobe (dot) de for suggestions, fixes, 7|-|>< ;) etc.
.SH AUTHORS
Copyright \(co 2005-2006 by Anselm R. Garbe <garbeam (at) gmail (dot) com> and
Copyright \(co 2005-2008 by Nico Golde <nico (at) ngolde (dot) de>
.BI /t " topic"
set the topic of a channel with
.IR topic.
.SH RAW COMMANDS
Everything which is not a command will be posted into the channel or to the
server. So if you need /who just write /WHO as described in RFC#1459 to the
server in FIFO.
.SH SSL/TLS PROTOCOL SUPPORT
For SSL/TLS protocol support you can connect to a local tunnel, for example
with stunnel or socat.
.SH SEE ALSO
.BR echo (1),
.BR tail (1),
.BR tail (1)

1083
ii.c

File diff suppressed because it is too large Load Diff

View File

@ -1,29 +0,0 @@
#!/bin/sh
# ----------------------------------------------------
# Nico Golde <nico@ngolde.de>
# License: do whatever you want with this code
# Purpose: locate new queries for the ii irc client
# ----------------------------------------------------
IRCPATH=$HOME/irc
TMPFILE=$IRCPATH/queries.tmp
if [ ! -f $TMPFILE ]; then
touch $TMPFILE
fi
echo "searching new query data"
for i in `find $IRCPATH -newer $TMPFILE -name 'out'`
do
grep -v '\-!\-' $i > /dev/null 2>&1 # if file doesnt just contain server stuff
if [ $? -ne 1 ]; then
# strip server, nickserv and channel out files
echo $i | egrep -v -i "nickserv|#|$IRCPATH/(irc\.freenode\.net|irc\.oftc\.net)/out" > /dev/null 2>&1
if [ $? -ne 1 ]; then
printf "new data in: %s\n========================================================\n" "$i"
tail -5 $i
fi
fi
done
touch $TMPFILE

32
strlcpy.c Normal file
View File

@ -0,0 +1,32 @@
/* Taken from OpenBSD */
#include <sys/types.h>
#include <string.h>
/*
* Copy src to string dst of size siz. At most siz-1 characters
* will be copied. Always NUL terminates (unless siz == 0).
* Returns strlen(src); if retval >= siz, truncation occurred.
*/
size_t
strlcpy(char *dst, const char *src, size_t siz)
{
char *d = dst;
const char *s = src;
size_t n = siz;
/* Copy as many bytes as will fit */
if (n != 0) {
while (--n != 0) {
if ((*d++ = *s++) == '\0')
break;
}
}
/* Not enough room in dst, add NUL and traverse rest of src */
if (n == 0) {
if (siz != 0)
*d = '\0'; /* NUL-terminate dst */
while (*s++)
;
}
return(s - src - 1); /* count does not include NUL */
}