This is a little description of how HSX works (with filename).
--------------------------------------------------------------

1) in main.c

   * load plugins
   * prepare data structure and verify parameters

2) in main_loop.c
   
   This file contains HSX main_loop.

   * wait for incoming connection, then create new data for it (fnc_init_cnx.c)
   * manage existing connection. When data comes, go to fnc_idle.c
   * manage running transfer.
   * run periodic tasks.


For each connection, when data comes, HSX goes into fnc_idle.c to try to perform
the requested command. If the command is not yet completed, HSX returns into the
main loop to wait for new data.

When a command is fully received, HSX processes it. If the command is short to
process, it is directly executed. Most of the functions run in this mode.
The command packet is analyzed by the function, wanted command is executed and
a reply is sent to the client.

If the command is longer to process (most of the files command (ls,rm,...)),
use another system. HSX has a subprocess (all files named IOxxx.c) which can run
a task in background. One task at a time. HSX handles subprocess crash without
problem. For such command. HSX preprocesses the function, check rights and if
everything is ok, send the command to the IO subsytem. Then, it returns into
the main_loop so other clients doesn't hang. When the IO subsystem command ends,
a reply is sent to HSX which sent it to the client.

To find a basic description of Hotline protocol, take a look at file HL_PROTO
of the plugin toolkit. Some functions of HSX core are pretty old and still does
not use newly introduced packet decoding facility, you should take a look at
some plugins as good sample.


Most of HSX function names try to describe clearly what the function does.

