2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
8 #include <exec/memory.h>
9 #include <proto/exec.h>
10 #include <dos/exall.h>
11 #include <dos/rdargs.h>
12 #include "dos_intern.h"
14 /*****************************************************************************
17 #include <proto/dos.h>
19 AROS_LH2(void, FreeDosObject
,
22 AROS_LHA(ULONG
, type
, D1
),
23 AROS_LHA(APTR
, ptr
, D2
),
26 struct DosLibrary
*, DOSBase
, 39, Dos
)
29 Frees an object allocated with AllocDosObject.
32 type - object type. The same parameter as given to AllocDosObject().
33 ptr - Pointer to object.
47 *****************************************************************************/
50 AROS_LIBBASE_EXT_DECL(struct DosLibrary
*,DOSBase
)
56 struct FileHandle
*fh
=(struct FileHandle
*)ptr
;
57 if(fh
->fh_Flags
&FHF_BUF
)
58 FreeMem(fh
->fh_Buf
,fh
->fh_Size
);
59 FreeMem(fh
,sizeof(struct FileHandle
));
63 FreeMem(ptr
,sizeof(struct FileInfoBlock
));
67 FreeMem((APTR
)(ptr
-(APTR
)(&((struct StandardPacket
*)0)->sp_Pkt
)),sizeof(struct StandardPacket
));
70 case DOS_EXALLCONTROL
:
71 if (((struct InternalExAllControl
*)ptr
)->fib
)
72 FreeDosObject(DOS_FIB
, ((struct InternalExAllControl
*)ptr
)->fib
);
74 FreeMem(ptr
, sizeof(struct InternalExAllControl
));
79 struct CommandLineInterface
*cli
=(struct CommandLineInterface
*)ptr
;
81 cur
=(BPTR
*)BADDR(cli
->cli_CommandDir
);
82 FreeVec(BADDR(cli
->cli_SetName
));
83 FreeVec(BADDR(cli
->cli_CommandName
));
84 FreeVec(BADDR(cli
->cli_CommandFile
));
85 FreeVec(BADDR(cli
->cli_Prompt
));
86 FreeMem(ptr
,sizeof(struct CommandLineInterface
));
89 next
=(BPTR
*)BADDR(cur
[0]);
97 FreeArgs() will not free a RDArgs without a RDA_DAList,
98 see that function for more information as to why...
101 if(((struct RDArgs
*)ptr
)->RDA_DAList
!= NULL
)
110 } /* FreeDosObject */