Do not install wrong cache routine if called before SysBase is complete.
[AROS.git] / workbench / libs / iffparse / stoponexit.c
blobf04a00542bfdd2b0b650c56546b124f56bdf76db
1 /*
2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define DEBUG 0
7 #include <aros/debug.h>
8 #include "iffparse_intern.h"
10 /*****************************************************************************
12 NAME */
13 #include <proto/iffparse.h>
15 AROS_LH3(LONG, StopOnExit,
17 /* SYNOPSIS */
18 AROS_LHA(struct IFFHandle *, iff, A0),
19 AROS_LHA(LONG , type, D0),
20 AROS_LHA(LONG , id, D1),
22 /* LOCATION */
23 struct Library *, IFFParseBase, 25, IFFParse)
25 /* FUNCTION
26 Inserts an exit handler for the given type and id, that will cause the parser
27 to stop when such a chunk is left.
29 INPUTS
30 iff - Pointer to IFFHandle struct. (does not need to be open).
31 type - IFF chunk type declarator for chunk to stop at.
32 id - IFF chunk id identifier for chunk to stop at.
34 RESULT
35 error - 0 if successfull, IFFERR_#? otherwise.
37 NOTES
39 EXAMPLE
41 BUGS
43 SEE ALSO
44 ParseIFF()
46 INTERNALS
48 *****************************************************************************/
50 AROS_LIBFUNC_INIT
52 DEBUG_STOPONEXIT(dprintf("StopOnExit: iff 0x%lx type 0x%08lx (%c%c%c%c) id 0x%08lx (%c%c%c%c)\n",
53 iff, type, dmkid(type), id, dmkid(id)));
55 #if DEBUG
56 bug ("StopOnExit (iff=%p, type=%c%c%c%c, id=%c%c%c%c)\n",
57 iff,
58 dmkid(type),
59 dmkid(id)
61 #endif
63 /* Install an ExitHandler */
64 return
66 ExitHandler
68 iff,
69 type,
70 id,
71 IFFSLI_TOP,
72 &(IPB(IFFParseBase)->exitcontexthook),
73 iff
77 AROS_LIBFUNC_EXIT
78 } /* StopOnExit */
81 /**********************/
82 /* Exit entry-handler */
83 /**********************/
85 LONG ExitContextFunc
87 struct Hook *hook,
88 APTR obj,
89 APTR p
92 return (IFFERR_EOC);