aaronngi / jj Goto Github PK
View Code? Open in Web Editor NEWAn evolution of the suckless ii(1) file-based IRC client
License: MIT License
An evolution of the suckless ii(1) file-based IRC client
License: MIT License
make
cc -O2 -pipe -pedantic -Wall -I. -I/usr/include -D_POSIX_C_SOURCE=200809L -D_POSIX_C_SOURCE=200809L -c jjd.c
CC -o jjd
cc -o jjd jjd.o -s -L/usr/lib -lc -lsocket
ld: error: unable to find library -lsocket
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error 1 in /tmp/jj (Makefile:21 'jjd')
cc
is clang
on OpenBSD
Utilizing locate
, I see /usr/include/sys/socket.h
present.
I also tried with CC = egcc
in Makefile
(egcc is gcc from repo to distinguish it from gcc from base),
and gmake
, same:
gmake
CC -o jjd
egcc -o jjd jjd.o -s -L/usr/lib -lc -lsocket
ld: error: unable to find library -lsocket
collect2: error: ld returned 1 exit status
gmake: *** [Makefile:21: jjd] Error 1
The way the code is set up to blindly fire CAP REQ :echo-message and CAP END before NICK and USER, which can lead to * being used in the ACK response (or even NAK) which confuses jjc and leads it to hang. The lines responsible are: https://github.com/aaronNGi/jj/blob/master/jjc#L321-L322
It would be ideal to either do a proper CAP LS (302) negotiation and only request echo-message if it is listed, or at the very least, handle cases where the nickname can be a * . this might also happen if one uses a nickname which is already in use while connecting, amongst other possible cases.
The "hanging" behavior is especially noticeable on current UnrealIRCd (6) releases which all have echo-message available by default. If desired or necessary, I can gladly provide a link to my own Unreal 6 instance for testing purposes.
EDIT: It may also be that one's own (U)UID is used in place of a nickname (possibly at least), although untested if jjc handles cases where it is referred to as by a different "nickname" (like (U)UID, enforced nickname by the server) when said other nickname is not * .
function parse_bold(s,
tail)
{
tail = s
s = ""
while (match(tail, "\002[^\002]*\002")) {
s = s substr(tail, 1, RSTART - 1) "\033[1m"
s = s substr(tail, RSTART + 1, RLENGTH - 2) "\033[m"
tail = substr(tail, RSTART + RLENGTH)
}
return s tail
}
This function reads text with irc escape sequence, and returns the same string with the ^B
converted to \033[1m
or \033[m
(if beginning or end).
Text with ^Bbold^B characters
-> Text with \033[1mbold\033[m characters
I let you decide whether and how to integrate it
Environment:
> uname -smr
SunOS 5.11 i86pc
Building:
[~]> cd jj
[~/jj]> make
CC jjd.c
cc -c -pedantic -Wall -I. -I/usr/include -D_POSIX_C_SOURCE=200809L jjd.c
jjd.c: In function 'input_from_socket':
jjd.c:113:6: warning: implicit declaration of function 'dprintf'; did you mean 'vprintf'? [-Wimplicit-function-declaration]
113 | if (dprintf(*pipe_fd, "i %ju %s\n", (uintmax_t)time(NULL), buf) < 0)
| ^~~~~~~
| vprintf
CC -o jjd
cc -o jjd jjd.o -s -L/usr/lib -lc
Undefined first referenced
symbol in file
__xnet_connect jjd.o
__xnet_socket jjd.o
__xnet_getaddrinfo jjd.o
dprintf jjd.o
freeaddrinfo jjd.o
ld: fatal: symbol referencing errors. No output written to jjd
collect2: error: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `jjd'
I would imagine that there are more dependencies needed than just a C compiler and awk.
The compile succeeds after adding #include <stdint.h>
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.