MCPcopy Create free account

hub / github.com/antirez/smallchat / functions

Functions21 in github.com/antirez/smallchat

↓ 4 callersFunctionchatMalloc
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 callersFunctioninputBufferHide
Hide the line the user is typing. */
smallchat-client.c:167
↓ 2 callersFunctioninputBufferAppend
Append the specified character to the buffer. */
smallchat-client.c:130
↓ 2 callersFunctioninputBufferClear
Reset the buffer to be empty. */
smallchat-client.c:179
↓ 2 callersFunctioninputBufferShow
Show again the current line. Usually called after InputBufferHide(). */
smallchat-client.c:174
↓ 2 callersFunctionsetRawMode
Raw mode: 1960 magic shit. */
smallchat-client.c:49
↓ 2 callersFunctionsocketSetNonBlockNoDelay
Set the specified socket in non-blocking mode, with no delay flag. */
chatlib.c:23
↓ 1 callersFunctionTCPConnect
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 callersFunctionacceptClient
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 callersFunctioncreateClient
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 callersFunctioncreateTCPServer
Create a TCP socket listening to 'port' ready to accept connections. */
chatlib.c:38
↓ 1 callersFunctionfreeClient
Free a client, associated resources, and unbind it from the global * state in Chat. */
smallchat-server.c:95
↓ 1 callersFunctioninitChat
Allocate and init the global stuff. */
smallchat-server.c:116
↓ 1 callersFunctioninputBufferFeedChar
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 callersFunctionsendMsgToAllClientsBut
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 callersFunctionterminalCleanCurrentLine
smallchat-client.c:110
↓ 1 callersFunctionterminalCursorAtLineStart
smallchat-client.c:114
FunctionchatRealloc
Also aborting realloc(). */
chatlib.c:146
FunctiondisableRawModeAtExit
At exit we'll try to fix the terminal to the initial conditions. */
smallchat-client.c:102
Functionmain
smallchat-client.c:188
Functionmain
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