/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <limits.h>
#include <com_sun_java_util_jar_pack_NativeUnpack.h>
#include "jni_util.h"
#include "defines.h"
#include "bytes.h"
#include "utils.h"
#include "coding.h"
#include "bands.h"
#include "constants.h"
#include "zip.h"
#include "unpack.h"
return null;
}
//fprintf(stderr, "get_unpacker(%p) uPtr=%p initializing\n", pObj, uPtr);
}
return uPtr;
}
// This is the harder trick: Pull the current state out of mid-air.
//fprintf(stderr, "get_unpacker()\n");
// other VM implements may differ, thus for correctness, we need these checks
return null;
//fprintf(stderr, "get_unpacker() env=%p\n", env);
return null;
//fprintf(stderr, "get_unpacker0() pObj=%p\n", pObj);
// Got pObj and env; now do it the easy way.
}
// this should really not happen, if it does something is seriously
// wrong throw an exception
return null;
}
//fprintf(stderr, "free_unpacker(%p) uPtr=%p\n", pObj, uPtr);
delete uPtr;
}
}
return get_unpacker();
}
// Callback for fetching data, Java style. Calls NativeUnpack.readInputFn().
}
#ifndef PRODUCT
#endif
"(Ljava/nio/ByteBuffer;J)J");
if (unpackerPtrFID == null ||
currentInstMID == null ||
readInputMID == null ||
getUnpackerPtrMID == null) {
THROW_IOE("cannot init class members");
}
}
// try to get the unpacker pointer the hard way first, we do this to ensure
// valid object pointers and env is intact, if not now is good time to bail.
//fprintf(stderr, "start(%p) uPtr=%p initializing\n", pObj, uPtr);
return -1;
}
// redirect our io to the default log file or whatever.
uPtr->redirect_stdio();
else
}
// before we start off we make sure there is no other error by the time we
// get here
return 0;
}
return 0;
}
return ((jlong)
+ uPtr->get_files_remaining();
}
return false;
}
return false; // end of the sequence
}
return true;
}
return false;
}
// We have fetched all the files.
// Now swallow up any remaining input.
if (uPtr->input_remaining() == 0) {
return null;
} else {
}
}
return consumed;
}
return retval;
}
}