Support rastport clipping rectangle for layerless rastports
[tangerine.git] / rom / dos / unloadseg.c
blobf32961845d390ba70b04f08b9e133eefdf6ec81b
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: english
7 */
9 #include <proto/exec.h>
10 #include <dos/dos.h>
11 #include <exec/types.h>
12 #include "dos_intern.h"
14 extern void Exec_FreeMem();
16 /*****************************************************************************
18 NAME */
19 #include <proto/dos.h>
21 AROS_LH1(BOOL, UnLoadSeg,
23 /* SYNOPSIS */
24 AROS_LHA(BPTR, seglist, D1),
26 /* LOCATION */
27 struct DosLibrary *, DOSBase, 26, Dos)
29 /* FUNCTION
30 Free a segment list allocated with LoadSeg().
32 INPUTS
33 seglist - The segment list.
35 RESULT
36 success = returns whether everything went ok. Returns FALSE if
37 seglist was NULL.
38 NOTES
40 EXAMPLE
42 BUGS
44 SEE ALSO
45 LoadSeg()
47 INTERNALS
49 *****************************************************************************/
51 AROS_LIBFUNC_INIT
52 AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)
54 if (seglist)
56 #if AROS_MODULES_DEBUG
57 extern struct MinList debug_seglist;
58 extern struct MinList free_debug_segnodes;
59 struct debug_segnode *segnode;
61 Forbid();
62 ForeachNode(&debug_seglist, segnode)
64 if (segnode->seglist == seglist)
66 REMOVE(segnode);
67 ADDHEAD(&free_debug_segnodes, segnode);
68 break;
71 Permit();
72 #endif
73 return InternalUnLoadSeg(seglist, __AROS_GETVECADDR(SysBase, 35));
76 return FALSE;
78 AROS_LIBFUNC_EXIT
79 } /* UnLoadSeg */