This document briefly describes the porting of ccsxtream stuff library
architecture different from unix.

Generic Stuff
-------------

ccutil.c:
    This is mainly memory allocation stuff.  Only thing to be done
    here is to make cc_fatal function such that it does what it is
    wanted to do.  In unix it just prints an error message and exits
    but for example in some embedded system, right thing to do could
    be to reboot the thing.


ccbuffer.c:
    Nothing to do here.  This however relies on memory allocations
    above. 


Client Stuff
------------

ccxclient.c:
    This one should portable code.

ccxclientconn.c:
  Functions
    cc_xstream_client_read_data, cc_xstream_client_write_data,
    cc_xstream_client_connect, and cc_xstream_client_disconnect
    should be implemented for the new architecture.  Also definition
    of type CcXstreamServerConnection in ccxclient.h should be tued
    accordingly.  In unix CcXstreamServerConnection is simply an
    integer that represents the file descriptor of the server
    connection socket.

ccxtest.c:
    This is a main program for testing the client interface.  It can
    be ported quite easily given that system has a way to read line
    oriented stuff from the terminal and print to the terminal.  This
    stuff is not needed in "real" client applications, but can be used
    as an example.


Server Stuff
------------

ccxfile.c:
    This stuff provides with some basic interface towards the file
    system, such as:
        - Lists entries in the directories and returns list of strings;
        - Reads attributes of the file or directory and return them as
          an xml string;
        - Test whether an entry is a directory or a regular file.
    No way around it.  These ones needs to be ported.

ccxstream.c:
    Media server main program that contains server side implementation
    of the protocol.  The protocol code is portable but a few things
    remain to be ported:
        - Command line option handling and possibly making it use some
          kind of preference file instead.
        - Server socket establishing.
        - Event loop.  In unix event loop has been built around
          select(2) system call.  Server socket and all client
          connections are all in nonblocking mode and they are passed
          to select.  Whenever select returns, program accepts
          possible new connection, tries to flush pending writes from
          write buffers, and reads incoming data from the clients to
          read buffers.  After that, incoming stuff is processed by
          the portable protocol code.  So, event loop needs to be
          ported.
