/*static char *SCCSID = "@(#)fs_fcls.c	6.1 90/11/18";*/
/*static char *SCCSID = "@(#)fs_fcls.c	13.2 90/01/25";*/
#define _BTXT _BTXT
#define INCL_DOSERRORS
#include <os2.h>
#include "heap.h"
#include "api.h"
#include "const.h"
#include "misc.h"
#include "chain.h"
#include "buf.h"
#include "dir.h"
#include "find.h"
#include "storage.h"
#include "volume.h"
#include "tables.h"
#include "pb_ifs.h"
#include "pbmacros.h"
#include "superb.h"
#include "lw.h"
#include "frame.h"
#include "fsdata.h"
#include "ea.h"
#include "pr_fsd.h"
#include "pr_FIND.h"
#include "pr_HEAP.h"

/* put stand-alone fs_xxx functions in separate code segment */


int far pascal
FS_FINDCLOSE (pfsfsi, pfsfsd)
struct fsfsi far * pfsfsi;
struct fsfsd far * pfsfsd;
{
    PFWORK pfw = (PFWORK) ( (PPB_FSFSD)pfsfsd )->hfind;

    if ( pfw->psbd != NULL )
	pfw->psbd->cusFinds--;
    REMOVE_FWORK ( pfw )		/* remove FWORK from find list */

    if ( pfw->fFindDone == FALSE && pfw->pspLastName != NULL )
	RetHeap ( pfw->pspLastName );	/* release last name */

    RetHeap ( pfw );			/* release FWORK */
//#114986
    (PFWORK) ( (PPB_FSFSD)pfsfsd )->hfind = NULL;

    return NO_ERROR;

    /* to prevent /W3 warnings */
    pfsfsi;
}
