Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/antirez/smallchat
/ functions
Functions
21 in github.com/antirez/smallchat
⨍
Functions
21
◇
Types & classes
9
↓ 4 callers
Function
chatMalloc
We also define an allocator that always crashes on out of memory: you * will discover that in most programs designed to run for a long time, that *
chatlib.c:136
↓ 4 callers
Function
inputBufferHide
Hide the line the user is typing. */
smallchat-client.c:167
↓ 2 callers
Function
inputBufferAppend
Append the specified character to the buffer. */
smallchat-client.c:130
↓ 2 callers
Function
inputBufferClear
Reset the buffer to be empty. */
smallchat-client.c:179
↓ 2 callers
Function
inputBufferShow
Show again the current line. Usually called after InputBufferHide(). */
smallchat-client.c:174
↓ 2 callers
Function
setRawMode
Raw mode: 1960 magic shit. */
smallchat-client.c:49
↓ 2 callers
Function
socketSetNonBlockNoDelay
Set the specified socket in non-blocking mode, with no delay flag. */
chatlib.c:23
↓ 1 callers
Function
TCPConnect
Create a TCP socket and connect it to the specified address. * On success the socket descriptor is returned, otherwise -1. * * If 'nonblock' is non
chatlib.c:65
↓ 1 callers
Function
acceptClient
If the listening socket signaled there is a new connection ready to * be accepted, we accept(2) it and return -1 on error or the new client * socket
chatlib.c:114
↓ 1 callers
Function
createClient
Create a new client bound to 'fd'. This is called when a new client * connects. As a side effect updates the global Chat state. */
smallchat-server.c:77
↓ 1 callers
Function
createTCPServer
Create a TCP socket listening to 'port' ready to accept connections. */
chatlib.c:38
↓ 1 callers
Function
freeClient
Free a client, associated resources, and unbind it from the global * state in Chat. */
smallchat-server.c:95
↓ 1 callers
Function
initChat
Allocate and init the global stuff. */
smallchat-server.c:116
↓ 1 callers
Function
inputBufferFeedChar
Process every new keystroke arriving from the keyboard. As a side effect * the input buffer state is modified in order to reflect the current line *
smallchat-client.c:145
↓ 1 callers
Function
sendMsgToAllClientsBut
Send the specified string to all connected clients but the one * having as socket descriptor 'excluded'. If you want to send something * to every cl
smallchat-server.c:135
↓ 1 callers
Function
terminalCleanCurrentLine
smallchat-client.c:110
↓ 1 callers
Function
terminalCursorAtLineStart
smallchat-client.c:114
Function
chatRealloc
Also aborting realloc(). */
chatlib.c:146
Function
disableRawModeAtExit
At exit we'll try to fix the terminal to the initial conditions. */
smallchat-client.c:102
Function
main
smallchat-client.c:188
Function
main
The main() function implements the main chat logic: * 1. Accept new clients connections if any. * 2. Check if any client sent us some new message.
smallchat-server.c:151