/[rvvs89]/uvm/core/loader.h


UCC Code Repository

Contents of /uvm/core/loader.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 355 - (show annotations) (download)
Mon Mar 1 08:05:23 2010 UTC (11 years, 9 months ago) by rvvs89
File MIME type: text/plain
File size: 2873 byte(s)
Syncing to work on netbook.
1 /*
2 * File: loader.h
3 * Author: Rufus Garton Smith
4 *
5 * Primordial Java classloader.
6 *
7 * $Id$
8 * Created on 20 February 2010, 7:16 PM
9 */
10
11 #ifndef _LOADER_H
12 #define _LOADER_H
13
14 #include <stdint.h>
15
16 #ifdef __cplusplus
17 //extern "C" {
18 #endif
19
20 /** Indicates the input source ran out of data */
21 #define UVME_EOF (1)
22 /** Indicates some problem with the input source other than its termination */
23 #define UVME_EIO (2)
24 /** Indicates that the system could not allocate enough space to contain the class described by the input source */
25 #define UVME_NOMEM (3)
26 /** Indicates an invalid magic number was read from the input source */
27 #define UVME_MAGIC (4)
28 /** Indicates the version of the class file is not supported */
29 #define UVME_VERSION (5)
30 /** Indicates the class had a constant pool count that is too low to contain a real class */
31 #define UVME_CPSIZ (6)
32 /** Indicates the class had a constant pool tag that was not recognised by the loader */
33 #define UVME_CPTAG (7)
34 /** Indicates the class had a UTF8 constant pool entry that was invalid */
35 #define UVME_CPUTF (8)
36 /** Indicates the class had a constant pool entry spanning two indices in the constant pool at the end of the pool */
37 #define UVME_CP64ATEOCP (9)
38 /** Indicates the class had an invalid combination of access permissions set */
39 #define UVME_CACCESS (10)
40 /** Indicates the referenced constant pool entry was not the correct type or is the second entry of a multi-tag entry or is beyond the end of the constant pool */
41 #define UVME_CPREF (11)
42 /** Indicates that a part of the loader required by the specified class is not yet implemented */
43 #define UVM_IMPL (100)
44
45 /** The binary input interface used by the loader */
46 struct binput {
47 /** Read one octet and store in out */
48 int (*read1)(struct binput *in, uint8_t *out);
49 /** Read two octets and store in out */
50 int (*read2)(struct binput *in, uint16_t *out);
51 /** Read four octets and store in out */
52 int (*read4)(struct binput *in, uint32_t *out);
53 /** Read eight octets and store in out */
54 int (*read8)(struct binput *in, uint64_t *out);
55 /** Skip i octets */
56 int (*skip)(struct binput *in, size_t i);
57 /** Clean up any data being used by the implementation */
58 int (*close)(struct binput *in);
59 };
60
61 /** Implementation of read2 that delegates to read1 */
62 int uvm_read2(struct binput *in, uint16_t *out);
63 /** Implementation of read4 that delegates to read2 */
64 int uvm_read4(struct binput *in, uint32_t *out);
65 /** Implementation of read8 that delegates to read4 */
66 int uvm_read8(struct binput *in, uint64_t *out);
67 /** Implementation of skip that deletgates to the read calls */
68 int uvm_skip(struct binput *in, size_t i);
69 /** Loads the class from the specified input source */
70 int uvm_load(struct binput *in);
71
72 #ifdef __cplusplus
73 //}
74 #endif
75
76 #endif /* _LOADER_H */

Properties

Name Value
svn:keywords Id

Managed by UCC Webmasters ViewVC Help
Powered by ViewVC 1.1.26