4 * [Generated from chunk, 25 September 1996]
7 #if !defined(__CC_NORCROFT) || !defined(__arm)
8 #error You must use the Norcroft ARM Compiler for Sapphire programs
11 #pragma include_only_once
12 #pragma force_top_level
21 /*----- Overview ----------------------------------------------------------*
34 /* --- chunk_create --- *
38 * On exit: R0 == chunk file handle
41 * Use: Creates a new chunk file structure and returns a handle to
45 extern routine chunk_create;
47 /* --- chunk_destroy --- *
49 * On entry: R0 == chunk file handle
53 * Use: Removes a chunk file structure from memory. Chunk data in
54 * flex blocks is freed; chunk claimers who free flex blocks
55 * should clear the anchors to 0.
58 extern routine chunk_destroy;
60 /* --- chunk_claim --- *
62 * On entry: R0 == chunk file handle
63 * R1 == pointer to chunk name
64 * R2 == pointer to saver routine, or 0 for none, or -1 for no
66 * R3 == R10 value to pass to saver
67 * R4 == R12 value to pass to saver
69 * On exit: R1 == chunk handle/anchor
70 * CS if the chunk already existed
73 * Use: Claims a chunk, installing a save handler for it. The chunk
74 * handle returned is actually the address of a flex anchor for
75 * the chunk's data (use flex_size to find the block's size).
76 * If the save handle is 0, the data in the flex block (which
77 * may be modified) is saved directly from the block. Otherwise
78 * the save routine is expected to save its data, using xsave.
80 * The anchor is followed by 3 unused words -- you can use them
81 * for whatever you want.
83 * Warning: this routine may move flex blocks.
86 extern routine chunk_claim;
88 /* --- chunk_makeBinary --- *
90 * On entry: R0 == chunk file handle
95 * Use: Marks a given chunk as containing binary data.
98 extern routine chunk_makeBinary;
100 /* --- chunk_read --- *
102 * On entry: R0 == chunk file handle
103 * R1 == address of a flex anchor
105 * On exit: May return an error
107 * Use: Merges the data contained in the flex block with that already
108 * in the chunk file. If the chunk file is empty, this is
109 * equivalent to a load. Data from the flex block is appended
110 * to chunks already loaded where appropriate.
112 * Warning: this routine may move flex blocks.
115 extern routine chunk_read;
117 /* --- chunk_enum --- *
119 * On entry: R0 == chunk file handle
120 * R1 == 0 for first call or continuation value
122 * On exit: CC if this isn't over yet, and
123 * R1 == continuation value for next call
124 * R2 == pointer to chunk name
129 * Use: Allows you to enumerate the chunks in a chunk file structure.
132 extern routine chunk_enum;
134 /* --- chunk_save --- *
136 * On entry: R0 == chunk file handle
138 * On exit: May return an error
140 * Use: Saves a chunk file to xsave's current output.
143 extern routine chunk_save;
145 /*----- That's all, folks -------------------------------------------------*/