Exemplo n.º 1
0
hash_free()
	{
	chfree(hashtab,sizeof(*hashtab) * maxhash);
	hashtab = 0;
	chfree(chain,sizeof(*chain) * maxhash);
	chain = 0;
	chfree(value,sizeof(*value) * maxhash);
	value = 0;
	}
Exemplo n.º 2
0
structure()
	{
	VERT v, *head;

	if (progress)
		fprintf(stderr,"	getreach:\n");
	getreach();
	if (routerr) return;
	if (progress)
		fprintf(stderr,"	getflow:\n");
	getflow();
	if (progress)
		fprintf(stderr,"	getthen:\n");
	getthen(START);
	head = challoc(nodenum * sizeof(*head));
	for (v = 0; v < nodenum; ++v)
		head[v] = UNDEFINED;
	for (v = START; DEFINED(v); v = RSIB(v))
		fixhd(v,UNDEFINED,head);
			/* fixhd must be called before getloop so that
				it gets applied to IFVX which becomes NXT(w) for UNTVX w */
	if (progress)
		fprintf(stderr,"	getloop:\n");
	getloop();
	if (progress)
		fprintf(stderr,"	getbranch:\n");
	getbranch(head);
	chfree(head,nodenum * sizeof(*head));
	head = 0;
	}
Exemplo n.º 3
0
getreach()		/* obtain REACH(v) for each node v */
	{
	VERT v;
	struct pair *pr;
	for (v = 0; v < nodenum; ++v)
		REACH(v) = UNDEFINED;
	number(START);
	for (v = START; DEFINED(v); v = RSIB(v))
		{
		pr = exits(v);	/* need to free the space for pr */
		chfree(pr,sizeof(*pr));
		}
	}
Exemplo n.º 4
0
output()
	{
	VERT w;
	int i;
	brace = challoc(nodenum * sizeof(*brace));
	for (i = 0; i < nodenum; ++i)
		brace[i] = FALSE;
	if (progress) fprintf(stderr,"ndbrace:\n");
	for (w = START; DEFINED(w); w = RSIB(w))
		ndbrace(w);
	if (progress) fprintf(stderr,"outrat:\n");
	for (w = START; DEFINED(w); w = RSIB(w))
		outrat(w,0,YESTAB);
	OUTSTR("END\n");
	chfree(brace,nodenum * sizeof(*brace));
	brace = 0;
	}
Exemplo n.º 5
0
void PDFDocClose ( PDFDocHandle Doc )
{
	ppUns32 i;


#ifdef WINDOWS_PLATFORM
	ReleaseDC(0,_DOC->DC);
#endif


	for ( i = 1; i < _DOC->Size; i++){
		if (_DOC->Entries[i].Loaded) 
			CosFree(_DOC->Entries[i].Obj);
	};
	mfree(_LIB, _DOC->Entries);
	if (!_IsCosNull(_DOC->CryptoInfo.FileID ) ) 
        CosFree( _DOC->CryptoInfo.FileID);
	chfree(_LIB, _DOC->CryptoInfo.AlgList );
	CosFree ( _DOC->CryptoInfo.Algorithms);
	if (_DOC->UPassword) 
        mfree(_LIB, _DOC->UPassword);
	if (_DOC->OPassword) 
        mfree(_LIB, _DOC->OPassword);
	if (_DOC->AutoRemove)
		if (_DOC->Strm) ULStreamClose(_DOC->Strm);
	if (_DOC->Pages){
		for (i=0;i<_DOC->Pages->Size;i++){ 
			CosFree ( ( ( PPDFPageInfo ) _DOC->Pages->FList[i] )->Inh );
			mfree(_LIB, _DOC->Pages->FList[i]);
		}
		ULListFree(_DOC->Pages);
	}
	if ( _DOC->FontList ){
		for ( i = 0; i < _DOC->FontList->Size; i++ ){ 
			switch ((ppUns32)(( PPDFFontInfo )_DOC->FontList->FList[i])->Type ){
				case PDFTrueTypeFont:
					PDFFontTrueTypeClear(_LIB,  (( PPDFFontInfo )_DOC->FontList->FList[i]));
					break;
				case PDFType1Font:
					mfree(_LIB,  (( PPDFFontInfo )_DOC->FontList->FList[i])->FontInfo.T1Info );
					break;
			}
			mfree(_LIB, _DOC->FontList->FList[i]);
		}
		ULListFree(_DOC->FontList);
	}

    if ( _DOC->ImageList ){
        for (i=0;i<_DOC->ImageList->Size;i++){ 
            mfree(_LIB, _DOC->ImageList->FList[i]);
        }
        ULListFree(_DOC->ImageList);
    }
    if ( _DOC->GStateList ){
        ULExtListFree ( _DOC->GStateList );
    }

    if ( _DOC->AcroFormList ){
		for ( i = 0; i < _DOC->AcroFormList->Size;i++ ){
			PDFAcroObjectFree ( Doc, i );
		}
        ULListFree ( _DOC->AcroFormList );
    }

    if ( _DOC->ActionList ){
        ULExtListFree ( _DOC->ActionList );
    }

#ifdef WINDOWS_PLATFORM
	if (_DOC->TTFList){
		for (i=0;i<_DOC->TTFList->Size;i++)
			mfree(_LIB, _DOC->TTFList->FList[i]);
		ULListFree(_DOC->TTFList); 
	}
	if (_DOC->UseScreen)
		ReleaseDC(0, _DOC->DC);
	else
		DeleteDC(_DOC->DC);
#endif
#ifndef NOT_USE_SIGN
	sig_DisposeContext(_LIB, _DOC->SigCtx);
	_DOC->SigCtx=NULL;
#endif
	PDFAcroFreeForms ( Doc );
	mfree(_LIB, Doc);
}