



                           FTP Client Engine

                           Library for C/C++


                                (FCE4C)


                           REFERENCE MANUAL



                            Version 1.0

                            March 22, 1999




                     This software is provided as-is.
              There are no warranties, expressed or implied.




                           Copyright (C) 1999
                           All rights reserved



                       MarshallSoft Computing, Inc.
                           Post Office Box 4543
                           Huntsville AL 35815


                           Voice : 256-881-4630
                             FAX : 256-880-0925
                           email : info@marshallsoft.com
                             web : www.marshallsoft.com

                               _______
                          ____|__     |                (R)
                       --+       |    +-------------------
                         |   ____|__  |  Association of
                         |  |       |_|  Shareware
                         |__|   o   |    Professionals
                       --+--+   |   +---------------------
                            |___|___|    MEMBER


      MARSHALLSOFT is a registered trademark of MarshallSoft Computing.




     FCE4C Reference Manual                                    Page 1

                            C O N T E N T S



        Chapter                                     Page

        Table of Contents.............................2

        General Remarks...............................3

        FCE Functions.................................3

           fceAbort...................................3

           fceAttach..................................5

           fceClose...................................5

           fceConnect.................................6

           fceDelFile.................................7

           fceDriver..................................8

           fceErrorText...............................9

           fceExtract................................10

           fceGetFile................................11

           fceGetInteger.............................12

           fceGetList................................14

           fceGetLocalDir............................15

           fceGetServerDir...........................16

           fceGetString..............................17

           fcePutFile................................18

           fceRelease................................19

           fceSetInteger.............................20

           fceSetLocalDir............................21

           fceSetMode................................22

           fceSetServerDir...........................23

           fceSetString..............................24





     FCE4C Reference Manual                                    Page 2

      General Remarks

      All functions return an integer code. Negative values are always
      errors. See Section 11.3 "FCE Error Return Code List" in the FCE
      Users Manual (FCE4C_U.TXT). Non-negative return codes are never
      errors.

      Note that the fceErrorText function is used to get the text message
      associated with any error code. Also note that LPSTR is defined in
      windows.h and is used as a generic WIN16/WIN32 pointer to text.

      FCE Functions


      +----------+--------------------------------------------------------+
      | fceAbort | Abort file seeDriver.                                  |
      +----------+--------------------------------------------------------+


        SYNTAX  int fceAbort(
                      int Chan)        // channel number

       REMARKS  The fceAbort function is used to abort the FCE state
                driver. This is used when calling the FCE state driver
                (fceDriver) directly and it is neccessary to abort.

                After calling fceAbort, subsequent calls to fceDriver will
                return 0 (IDLE). Thus, FCE is ready for the next command.

                This function is not required unless the state driver
                fceDriver is being called directly.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                ...
                // turn AUTO CALL off.
                fceSetInteger(0,FCE_SET_AUTO_CALL_DRIVER, 0)
                // ask for file
                fceGetFile(0,"PRODUCTS.TXT");
                // call the driver until it returns 0
                while (fceDriver(0)!=0)
                  {if(...the user has pressed ESC...)
                     {fceAbort(0);
                      break;
                     }
                  }
                // turn AUTO CALL back on
                fceSetInteger(0,FCE_SET_AUTO_CALL_DRIVER, 1)
                ...

      ALSO SEE fceDriver





     FCE4C Reference Manual                                    Page 3

      +-----------+-------------------------------------------------------+
      | fceAttach | Initializes FCE.                                      |
      +-----------+-------------------------------------------------------+


        SYNTAX  int fceAttach(
                      int NbrChans);   // number of channels or threads

       REMARKS  The fceAttach function must be the first FCE call made.
                Pass the maximum number of channels or threads that will be
                in use. Use NbrChans = 1 for non-threaded applications.

                The 'Chan' parameter for subsequent calls to FCE functions
                must be in the range of 0 to NbrChans-1.

                In WIN32, up to 32 threads (numbered from 0 to 31) can be
                started, each of which can be connected to a different FTP
                server and run independently.


       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                // Initialize FCE
                fceAttach(1);

                // call any FCE function except fceAttach and fceRelease.
                // Pass 0 as the first argument.

                // Terminate FCE
                fceRelease();

      ALSO SEE fceRelease.
























     FCE4C Reference Manual                                    Page 4

      +----------+--------------------------------------------------------+
      | fceClose | Closes connection opened by fceConnect.                |
      +----------+--------------------------------------------------------+


        SYNTAX  int fceClose(
                      int Chan)        // channel number

       REMARKS  The fceClose function closes the connection to the FTP
                server opened with fceConnect. After closing, another
                connection on channel 'Chan' may be opened with fceConnect.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                // Attach FCE
                fceAttach(1);
                // Connect to FTP server
                fceConnect(0,"ftp.hiwaay.net","ftp","you@yourisp.com");

                // ...List, delete, upload, and download files.

                // close connection.
                fceClose(0);
                // release FCE
                fceRelease();

      ALSO SEE fceConnect.





























     FCE4C Reference Manual                                    Page 5

      +------------+------------------------------------------------------+
      | fceConnect | Connects to a FTP server.                            |
      +------------+------------------------------------------------------+


        SYNTAX  int fceConnect(
                      int Chan,        // Channel number.
                      LPSTR Server,    // Server name or dotted IP address
                      LPSTR User,      // Users account name or "anonymous"
                      LPSTR Pass)      // Password for above

       REMARKS  The fceConnect function connects to the FTP server
                'Server' and logs on as 'User' with password 'Pass'.

                FTP servers that allow anonymous access will accept "ftp"
                or "anonymous" for the user name and your email address for
                the password.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                // Attach FCE
                fceAttach(1);
                // Connect to FTP server
                Code =
                   fceConnect(0,"ftp.hiwaay.net","ftp","you@yourisp.com");
                if(Code<0)
                   {
                    ...handle error...
                   }
                // ...List, delete, upload, and download files.

                // close connection.
                fceClose(0);
                // release FCE
                fceRelease();


      ALSO SEE fceClose.


















     FCE4C Reference Manual                                    Page 6

      +------------+------------------------------------------------------+
      | fceDelFile | Deletes file from the FTP server.                    |
      +------------+------------------------------------------------------+


        SYNTAX  int fceDelFile(
                      int Chan,        // channel number
                      LPSTR FileName); // Name of file to delete

       REMARKS  The fceDelFile function is used to delete the file
                'FileName' from the FTP server.

                The delete may fail if either you don't have the necessary
                permission (as is typical when you connect as an anonymous
                user) or the file itself is marked as read-only.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                // Attach FCE
                Code = fceAttach(1);
                if(Code<0) ErrorExit(Code);
                // Connect to FTP server
                Code = fceConnect(0,"ftp.yourisp.com",
                                    "yourname",
                                    "yourpassword");
                if(Code<0) ErrorExit(Code);
                // delete file
                Code = fceDelFile(0,"PRODUCTS.TXT");
                // close connection.
                fceClose(0);
                // release FCE
                fceRelease();


      ALSO SEE fcePutFile





















     FCE4C Reference Manual                                    Page 7

      +-----------+-------------------------------------------------------+
      | fceDriver | Executes the next state in the FCE state engine.      |
      +-----------+-------------------------------------------------------+


        SYNTAX  int fceDriver(
                      Chan);           // Channel

       REMARKS  The fceDriver function executes the next state in the FCE
                state engine.

                This function is only used when FCE_AUTO_CALL_DRIVER is set
                to 0.

                Refer to section "Theory of Operation" in the FCE Users
                Manual (FCE4C_U.TXT) for more details.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                // Attach FCE
                fceAttach(1);
                // Connect to FTP server
                fceConnect(0,"ftp.hiwaay.net","ftp","you@yourisp.com");
                // turn AUTO CALL off.
                fceSetInteger(0,FCE_SET_AUTO_CALL_DRIVER, 0)
                // ask for file
                fceGetFile(0,"PRODUCTS.TXT");
                // call the driver until it returns 0
                while (fceDriver(0)!=0)
                  {// print dot for each call to driver
                   printf(".");
                  }
                // turn AUTO CALL back on
                fceSetInteger(0,FCE_SET_AUTO_CALL_DRIVER, 1)
                // close connection.
                fceClose(0);
                // release FCE
                fceRelease();

      ALSO SEE "Theory of Operation" in Users Manual (FCE4C_U.TXT).
















     FCE4C Reference Manual                                    Page 8

      +--------------+----------------------------------------------------+
      | fceErrorText | Formats an error message.                          |
      +--------------+----------------------------------------------------+


        SYNTAX  int fceErrorText(
                      int Chan,        // channel number
                      int Code,        // Error code
                      LPSTR Buffer,    // location to put error message
                      int BufLen);     // size of above

       REMARKS  The fceErrorText function formats the error message for
                error 'Code' in 'Buffer'.

                Call this function when an error (a negative value) is
                returned from a FCE function so that the error message can
                be displayed or logged.

       RETURNS  The number of characters copied to 'Buffer'.

       EXAMPLE

                int n, Code;
                char Buffer[100];

                Code = fceConnect(...);
                if(Code<0)
                  {// display error message
                   n = fceErrorText(0,Code,(LPSTR)Buffer,100);
                   if(n>0) printf("ERROR %s\n", Buffer);
                   ...
                  }

      ALSO SEE
























     FCE4C Reference Manual                                    Page 9

      +------------+------------------------------------------------------+
      | fceExtract | Extracts strings from FTP formatted file list.       |
      +------------+------------------------------------------------------+


        SYNTAX  int fceExtract(
                      LPSTR Buffer,  //  buffer returned by fceGetList.
                      int LineNbr,   //  line number [1,2,...] wanted.
                      int FieldNbr,  //  field number [1,2,...] wanted.
                      LPSTR BufPtr,  //  Resultant buffer.
                      int BufLen)    //  Size of above.

       REMARKS  The fceExtract function extracts fields from FTP formatted
                file lists for line 'LineNbr' and field 'FieldNbr'. The
                extracted substring is copied into 'BufPtr'. Use 'FieldNbr'
                0 in order to copy the entire line rather than a field.

                A typical line in a full FTP directory listing may look
                like the following. Note that there are 9 fields.

                -rw-r--r-- 1 345 15 100424 Feb 8 16:26 fce4c10b.zip

                Note that in the line above, field 5 is the file length.

                The fceExtract function is typically called after calling
                fceGetList. See CONFTP.C for an example of use.

       RETURNS The number of characters copied to 'BufPtr'.

       EXAMPLE

                int Line;
                int Code;
                char LineBuf[100];

                /* ask for full list */
                Code = fceGetList(0,FCE_FULL_LIST,(LPSTR)DataBuffer,MAX_BUF);
                if(Code<0) ShowError(Code);
                /* get each field for line 8 */
                Line = 8;
                for(i=1;i<=9;i++)
                  {Code = fceExtract((LPSTR)DataBuffer, Line, i,
                                     (LPSTR)LineBuf, 100);
                   printf("LINE %d, FIELD %d: Len %2d [%s] \n",
                          n, i, Code, LineBuf);
                  }

      ALSO SEE fceGetList










     FCE4C Reference Manual                                    Page 10

      +------------+------------------------------------------------------+
      | fceGetFile | Gets (downloads) file from FTP server.               |
      +------------+------------------------------------------------------+


        SYNTAX  int fceGetFile(
                      int Chan,        // channel number
                      LPSTR FileName); // Name of file to download

       REMARKS  The fceGetFile function is used to download the file
                'FileName' from the FTP server.

                Note that ASCII transfer mode is normally the default. Call
                fceSetMode(Chan,'B') to set the transfer mode to binary for
                non ASCII files.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                // Attach FCE
                Code = fceAttach(1);
                if(Code<0) ErrorExit(Code);
                // Connect to FTP server
                Code = fceConnect(0,"ftp.hiwaay.net","ftp","you@yourisp.com");
                if(Code<0) ErrorExit(Code);
                // download file
                Code = fceGetFile(0,"PRODUCTS.TXT");
                // close connection.
                fceClose(0);
                // release FCE
                fceRelease();


      ALSO SEE fcePutFile























     FCE4C Reference Manual                                    Page 11

      +---------------+---------------------------------------------------+
      | fceGetInteger | Returns numeric parameter.                        |
      +---------------+---------------------------------------------------+


        SYNTAX  ULONG fceGetInteger(
                      int Chan,        // channel number
                      int ParamName);  // Parameter name


       REMARKS  The fceGetInteger function returns the value of the
                specified parameter 'ParamName'.

                Note that the return type is unsigned long.

                FCE_GET_VERSION : Returns FCE version.
                FCE_GET_BUILD : Returns FCE build number.
                FCE_GET_SOCK_ERROR : Returns last socket error code.
                FCE_GET_SOCKET : Returns control socket number.
                FCE_GET_COUNTER : Returns # times FCE driver was called.
                FCE_GET_RESPONSE : Returns last FTP response.
                FCE_GET_FILE_BYTES_RCVD : Returns # file bytes received.
                FCE_GET_TOTAL_BYTES_RCVD : Returns total bytes received.
                FCE_GET_FILE_BYTES_SENT : Returns # file bytes sent.
                FCE_GET_TOTAL_BYTES_SENT : Returns total file bytes sent.
                FCE_GET_CONNECT_STATUS : Returns 1 if connected.

       RETURNS  Value of parameter requested.

       EXAMPLE

                // display FCE version and build number.
                Version = fceGetInteger(0,FCE_GET_VERSION);
                Build   = fceGetInteger(0,FCE_GET_BUILD);
                printf("FCE32 Version: %1d.%1d.%1d Build %d\n",
                  0x0f&(Version>>8),0x0f&(Version>>4),0x0f&Version,Build);

                // display last FTP server response code
                Code = fceGetInteger(0,FCE_GET_RESPONSE);
                printf("Last FTP response was %d\n", Code);

      ALSO SEE fceGetString
















     FCE4C Reference Manual                                    Page 12

      +------------+------------------------------------------------------+
      | fceGetList | Gets file list from FTP server.                      |
      +------------+------------------------------------------------------+


        SYNTAX  int fceGetList(
                      int Chan,        // channel number
                      int Flag,        // FULL or NAME list flag.
                      LPSTR Buffer,    // List buffer.
                      int BufLen);     // size of 'Buffer'

       REMARKS  The fceGetList function downloads the directory list from the
                FTP server.

                If 'FCE_FULL_LIST' is passed for 'Flag', a full directory
                listing is returned in 'Buffer'. Note that the exact
                format of the list depends on the particular FTP server.

                If 'FCE_NAME_LIST' is passed for 'Flag', a listing is
                returned consisting of file names only. Note that some FTP
                servers do not support the name list function.

                File lists consists of a zero terminated list of file
                entries, each of which is terminated by a carriage return,
                line feed pair.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.
               >= 0 : Number of characters copied to 'Buffer'.

       EXAMPLE

                char Buffer[2000];

                // Attach FCE
                Code = fceAttach(1);
                if(Code<0) ErrorExit(Code);
                // Connect to FTP server
                Code = fceConnect(0,"ftp.hiwaay.net","ftp","you@yourisp.com");
                if(Code<0) ErrorExit(Code);
                // get file name list
                Code = fceGetList(0,FCE_LIST_NAME,(LPSTR)Buffer,2000);
                printf("%s", Buffer);
                // close connection.
                fceClose(0);
                // release FCE
                fceRelease();

      ALSO SEE  fceExtract.










     FCE4C Reference Manual                                    Page 13

      +----------------+--------------------------------------------------+
      | fceGetLocalDir | Returns the local upload/download directory.     |
      +----------------+--------------------------------------------------+


        SYNTAX  int fceGetLocalDir(
                      int Chan,        // channel number
                      LPSTR Buffer,    // string buffer
                      int BufLen);     // size of 'Buffer'

       REMARKS  The fceGetLocalDir function returns the local
                upload/download directory.

                The local upload/download directory is the directory used
                for all uploads and downloads. The default is the current
                directory (".").

                Both relative and absolute directories may be specified.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.
               >= 0 : The number of characters copied.

       EXAMPLE

               // Set local upload/download directory. Note that the
               // double slashes are necessary (in C/C++)

               fceSetLocalDir(0,"DOWNLOADS\\TEXT");

      ALSO SEE fceSetLocalDir




























     FCE4C Reference Manual                                    Page 14

      +-----------------+-------------------------------------------------+
      | fceGetServerDir | Returns the FTP server directory.               |
      +-----------------+-------------------------------------------------+


        SYNTAX  int fceGetServerDir(
                      int Chan,        // channel number
                      LPSTR Buffer,    // string buffer
                      int BufLen);     // size of 'Buffer'

       REMARKS  The fceGetServerDir function returns the FTP server
                directory.

                Note that most all FTP servers will restrict clients as to
                which directories on the server that can be accessed.

                The default is the current logged directory on the FTP
                server.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.
               >= 0 : The number of characters copied.

       EXAMPLE

               char Buffer[65];

               // copy directory string to 'Buffer'
               fceGetServerDir(0, (LPSTR)Buffer, 65);
               printf("Server directory is %s\n", Buffer);

      ALSO SEE  fceSetServerDir



























     FCE4C Reference Manual                                    Page 15

      +--------------+----------------------------------------------------+
      | fceGetString | Returns string parameter.                          |
      +--------------+----------------------------------------------------+


        SYNTAX  int fceGetString(
                      int Chan,        // channel number
                      int ParamName,   // parameter name
                      LPSTR Buffer,    // string buffer
                      int BufLen);     // size of 'Buffer'

       REMARKS  The fceGetString function returns the string parameter
                'ParamName'.

                FCE_GET_REGISTRATION : Returns registration string.
                FCE_GET_LAST_RESPONSE : Returns last FTP response.
                FCE_GET_SERVER_IP : Returns IP address of FTP server.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.
               >= 0 : Number of characters copied to 'Buffer'.

       EXAMPLE

               char Buffer[50];


               // display registration string within the DLL
               fceGetString(0,FCE_GET_REGISTRATION,(LPSTR)Buffer,50);
               printf("Registration = '%s'\n", Buffer);

               // display server IP address in dotted format.
               fceGetString(0,FCE_GET_SERVER_IP,(LPSTR)Buffer,20);
               printf("Server IP address = %s\n", Buffer);

      ALSO SEE fceGetInteger























     FCE4C Reference Manual                                    Page 16

      +------------+------------------------------------------------------+
      | fcePutFile | Uploads file to FTP server.                          |
      +------------+------------------------------------------------------+


        SYNTAX  int fcePutFile(
                      int Chan,        // channel number
                      LPSTR FileName); // name of file to upload

       REMARKS  The fcePutFile function uploads the file 'FileName' to the
                FTP server.

                The file 'FileName' to be uploaded must be in the local
                upload/download directory.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                // Attach FCE
                Code = fceAttach(1);
                if(Code<0) ErrorExit(Code);
                // Connect to FTP server
                Code = fceConnect(0,"ftp.hiwaay.net","ftp","you@yourisp.com");
                if(Code<0) ErrorExit(Code);
                // upload file
                Code = fcePutFile(0,"COMMENTS.TXT");
                // close connection.
                fceClose(0);
                // release FCE
                fceRelease();

      ALSO SEE fceGetFile.

























     FCE4C Reference Manual                                    Page 17

      +------------+------------------------------------------------------+
      | fceRelease | Releases FCE.                                        |
      +------------+------------------------------------------------------+


        SYNTAX  int fceRelease(void);

       REMARKS  The fceRelease function releases the FCE system. This
                should be the very last function called.

                fceClose should be called for all channels before calling
                fceRelease.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                // Initialize FCE
                fceAttach(1);

                // call any FCE function except fceAttach and fceRelease.

                // Terminate FCE
                fceRelease();

      ALSO SEE fceAttach.
































     FCE4C Reference Manual                                    Page 18

      +---------------+---------------------------------------------------+
      | fceSetInteger | Sets numeric parameter.                           |
      +---------------+---------------------------------------------------+


        SYNTAX  int fceSetInteger(
                      int Chan,        // channel number
                      int ParamName,   // parameter name
                      ULONG ParamValue);  // parameter value

       REMARKS  The fceSetInteger function sets the numeric parameter
                'ParamName' to the value 'ParamValue'.

                        Parameter Name      Default

                FCE_SET_MIN_RESPONSE_WAIT : 0
                FCE_SET_MAX_RESPONSE_WAIT : 10000
                     FCE_SET_CONNECT_WAIT : 60000
                    FCE_SET_MIN_LINE_WAIT : 0
                    FCE_SET_MAX_LINE_WAIT : 20000
                 FCE_SET_AUTO_CALL_DRIVER : 1
                       FCE_SET_SLEEP_TIME : 20 (WIN32 only)
                         FCE_SET_FTP_PORT : 21
                     FCE_SET_CLOSE_LINGER : 50 (WIN32) or 500 (WIN16)
                    FCE_SET_WRITE_BUFSIZE : 512 (WIN16) or 1024 (WIN32)

                FCE_SET_MIN_RESPONSE_WAIT is the delay before looking for
                the server's response.

                FCE_SET_MAX_RESPONSE_WAIT is the time after which a
                "time-out" error occurs if the server has not responded.

                FCE_SET_MIN_LINE_WAIT is the delay before checking if the
                server is ready to accept the next line of input.

                FCE_SET_MAX_LINE_WAIT is the time after which a "time-out"
                error is declared if the server has not responded.

                FCE_SET_CONNECT_WAIT is the maximum time allowed to
                complete a connection to the SMTP server.


















     FCE4C Reference Manual                                    Page 19

                FCE_SET_SLEEP_TIME is the sleep time (in milliseconds) when
                waiting for socket I/O to complete. Usefull in
                multi-threaded environments.

                FCE_SET_FTP_PORT is the port number to use when connecting
                to the FTP server. The default is the well-known port
                number 21.

                FCE_SET_CLOSE_LINGER is the "linger" time after an upload
                is completed before closing the data socket. Setting this
                value too small (at least in WIN16) causes the data socket
                to be closed before the last block of data is transmitted.

                FCE_SET_WRITE_BUFSIZE is the transmit block size. The
                maximum value is 4096 for WIN16 and 8192 for WIN32.


       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                // disable the automatic calling of the state driver.
                fceSetInteger(0, FCE_SET_AUTO_CALL_DRIVER, 0);

                // set the write buffer size to 2048.
                fceSetInteger(0, FCE_SET_WRITE_BUFSIZE, 2048);

                // set the WIN32 sleep time to 100 mS.
                fceSetInteger(0, FCE_SET_SLEEP_TIME, 100);

      ALSO SEE fceSetString



























     FCE4C Reference Manual                                    Page 20

      +----------------+--------------------------------------------------+
      | fceSetLocalDir | Sets the local upload/download directory.        |
      +----------------+--------------------------------------------------+


        SYNTAX  int fceSetLocalDir(
                      int Chan,        // channel number
                      LPSTR DirName);  // local directory path

       REMARKS  The fceSetLocalDir function sets the local computer
                upload/download directory. The upload/download directory is
                the directory used by FCE for all uploads and downloads.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                // specify the local upload/download directory.
                // note the double slash below

                fceSetLocalDir(0, "C:\\TEMP");

                // all upload and download requests will now use directory
                C:\TEMP.

      ALSO SEE fceGetLocalDir
































     FCE4C Reference Manual                                    Page 21

      +------------+------------------------------------------------------+
      | fceSetMode | Sets FTP transfer mode.                              |
      +------------+------------------------------------------------------+


        SYNTAX  int fceSetMode(
                      int Chan,        // channel number
                      char Mode);      // transfer mode ('A' or 'B')

       REMARKS  The fceSetMode function sets the FTP transfer mode. Pass
                'A' to specify ASCII mode and 'B' to specify binary mode.

                Since the FTP default is usually ASCII, it is good practice
                to always specify the transfer mode before the first call
                to fceGetFile or fcePutFile.

                If unsure of the transfer mode, choose binary.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                // set ASCII mode
                fceSetMode(0, 'A');

                // set binary mode
                fceSetMode(0, 'B');

      ALSO SEE fceGetFile and fcePutFile.





























     FCE4C Reference Manual                                    Page 22

      +-----------------+-------------------------------------------------+
      | fceSetServerDir | Sets the FTP directory.                         |
      +-----------------+-------------------------------------------------+


        SYNTAX  int fceSetServerDir(
                      int Chan,        // channel number
                      LPSTR DirName);  // directory name

       REMARKS  The fceSetServerDir sets the FTP directory to 'DirName'
                which is used for subsequent FCE calls.

                Note that UNIX FTP servers use forward slashes for
                directories while Windows FTP servers use backward
                slashes.


       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

               Code = fceSetServer(0, "marshallsoft/other")
               if(Code<0)
                 {
                  ...handle error...
                 }
               // server directory requested is accepted

      ALSO SEE





























     FCE4C Reference Manual                                    Page 23

      +--------------+----------------------------------------------------+
      | fceSetString | Sets string parameter.                             |
      +--------------+----------------------------------------------------+


        SYNTAX  int fceSetString(
                      int Chan,        // channel number
                      int ParamName,   // parameter name
                      LPSTR ParamPtr); // parameter string

       REMARKS  The fceSetString function sets the string parameter
                'ParamName' to 'ParamPtr'.

                FCE_SET_LOG_FILE is used to specify the log file name. Log
                files can be quite large, so use only when necessary.

                FCE_WRITE_TO_LOG is used to write a string (message) to
                log file.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

               // open LOG file
               fceSetString(0, FCE_SET_LOG_FILE, "program.log");

               // write "hello" to LOG file.
               fceSetString(0, FCE_WRITE_TO_LOG, "Hello");

      ALSO SEE fceSetInteger




























     FCE4C Reference Manual                                    Page 24

