< prev index next >
src/hotspot/share/classfile/sharedPathsMiscInfo.hpp
Print this page
@@ -99,12 +99,24 @@
add_path(path, NON_EXIST);
}
// The path must exist, and must contain exactly <num_entries> files/dirs
void add_boot_classpath(const char* path) {
- add_path(path, BOOT);
+ add_path(path, BOOT_PATH);
}
+
+ void add_app_classpath(const char* path) {
+ add_path(path, APP_PATH);
+ }
+ void record_app_offset() {
+ _app_offset = get_used_bytes();
+ }
+ void pop_app() {
+ _cur_ptr = _buf_start + _app_offset;
+ write_jint(0);
+ }
+
int write_jint(jint num) {
write(&num, sizeof(num));
return 0;
}
void write_time(time_t t) {
@@ -119,50 +131,40 @@
return (os::write(fd, _buf_start, n) == (size_t)n);
}
// reading --
+private:
enum {
- BOOT = 1,
- NON_EXIST = 2,
- APP = 5,
- MODULE = 6
+ BOOT_PATH = 1,
+ APP_PATH = 2,
+ MODULE_PATH = 3,
+ NON_EXIST = 4
};
const char* type_name(int type) {
switch (type) {
- case BOOT: return "BOOT";
+ case BOOT_PATH: return "BOOT";
+ case APP_PATH: return "APP";
+ case MODULE_PATH: return "MODULE";
case NON_EXIST: return "NON_EXIST";
- case APP: return "APP";
- case MODULE: return "MODULE";
default: ShouldNotReachHere(); return "?";
}
}
void print_path(outputStream* os, int type, const char* path);
- bool check();
bool read_jint(jint *ptr) {
return read(ptr, sizeof(jint));
}
bool read_long(long *ptr) {
return read(ptr, sizeof(long));
}
bool read_time(time_t *ptr) {
return read(ptr, sizeof(time_t));
}
- void add_app_classpath(const char* path) {
- add_path(path, APP);
- }
-
- void record_app_offset() {
- _app_offset = get_used_bytes();
- }
- void pop_app() {
- _cur_ptr = _buf_start + _app_offset;
- write_jint(0);
- }
-
+public:
+ bool check();
};
#endif // SHARE_VM_CLASSFILE_SHAREDPATHSMISCINFO_HPP
< prev index next >