Previous Topic Table Of Contents Parent Topic Next Topic |  | # High-Level Language SWSFCNT (SWPFFC) Function Related Topics Web Server API Function Index
| May be used in Shadow/REXX
| May be used from Other REXX Interpreters
| HLL Entry point name is SWPFFC
SWSFCNT (entry point "`SWPFFC`") is a high level function used to determine the number of files sent to the server in a File Post operation. Because multiple files can be presented in a single Post method, SWSFCNT returns the number of files present. The protocol for sending files in a Post operation is described in RCF 1867. To determine the number of files sent, you can either: Use the SWSFCNT function. Reference the built-in REXX varialbe WWW.FILE.0. SWSPostFileCount is the "c" definition for the entry point. SWSPOSTFILECOUNT is the "COBOL" definition for the entry point. SWSFCNT is the "PL/I" definition for the entry point. SWSFCNT will return zero if no files are present in the current Post. ## CALL Arguments The SWSFCNT (entry point "`SWPFFC`") function takes two arguments. Both arguments must be specified on the call.
Arg No. | HLL Argument Type | I/O | Description of Argument
--- | --- | --- | ---
C | COBOL | PL/I
1 | HDBC | Usage Pointer | PTR | Input | The Web Server connection handle. It is an opaque, four byte address pointer. Because the connection handle is not currently used, it must be set to zero (NULL).
2 | UDWORD | PIC S9(5) COMP | FIXED BIN(31) | Output | A four-byte integer that contains the number of files present.

Top

## Return Values

SWSFCNT:

- Returns the number of files present in the second argument.
- Always sets a signed numeric return code value.

Possible values are:

SWS_SUCCESS
  The operation succeeded. The number of Post files present has been placed in the provided area.
SWS_ERROR
  A parameter validation or run-time error was encountered. Error information is available using the SWSERROR function
SWS_ENVIRONMENT_ERROR
  The request cannot be processed because of a run-time environmental error. For example, you invoked the API service outside of a Web transaction procedure or from outside the server's address space. Use the server's wrap-around trace to obtain diagnostic information.
SWS_INVALID_HANDLE
  The connection handle argument is invalid. No error information can be returned using SWSERROR
Any other value
  The operation has failed.

The SWSFCNT operation is logged to the Server's wrap-around trace file with the returned value and completion code.

## PL/I Example

        DCL   SCONN     PTR;            /* Connection Handle      */
        DCL   FICNT     FIXED BIN(31);  /* Header length          */
        ADDR(SCONN)->DMHX=0;            /* Zero connection handle */
        CALL SWSFCNT(SCONN              /* Get the file count     */
                 FICNT);
        RC=PLIRETV();                   /* Get return code        */
        IF RC ^=SWS_SUCCESS THEN        /* exit if bad RC         */
                 EXIT;

Top

## C Example

        HDBC   sConn     = NULL;          /* Connection Handle  */
        long   FICNT;                     /* file count         */
        long   RC;                        /* return code        */
        rc = SWSPostFileCount(&sConn,     /* Get the file count */
              &FICNT);
        If(rc ^=SWS_SUCCESS) return;      /* exit if bad rc     */

## COBOL Example

        77 SCONN         USAGE IS POINTER.
        77 FICNT         PIC S9(5) COMP.
        CALL SWSPOSTFILECOUNT USING SCONN,
                 FICNT.
        MOVE RETURN CODE TO WS-SWSAPI-RETURN-CODE.
        IF NOT SWS-SUCCESS GOBACK.

Top