Fix r_bin.h (should fix bindings) and more MAKE_JOBS

This commit is contained in:
pancake 2014-05-03 02:17:30 +02:00
parent f285f098b3
commit a0da04cb16
3 changed files with 14 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* radare - LGPL - Copyright 2009-2014 - pancake, nibble */
/* radare - LGPL - Copyright 2009-2014 - pancake, nibble, dso */
// TODO: dlopen library and show address
@ -317,6 +317,7 @@ static void set_bin_items(RBinFile *binfile, RBinPlugin *cp) {
// XXX - this is a rather hacky way to do things, there may need to be a better way.
R_API int r_bin_load(RBin *bin, const char *file, ut64 baseaddr, ut64 loadaddr, int xtr_idx, int fd, int rawstr) {
// ALIAS? return r_bin_load_as (bin, file, baseaddr, loadaddr, xtr_idx, fd, rawstr, 0, file);
RIOBind *iob = &(bin->iob);
RIO *io = iob ? iob->get_io(iob) : NULL;
RIODesc *desc = NULL;
@ -333,9 +334,12 @@ R_API int r_bin_load_as(RBin *bin, const char *file, ut64 baseaddr, ut64 loadadd
RIODesc *desc = NULL;
if (!io) return R_FALSE;
desc = fd == -1 ? iob->desc_open (io, file, O_RDONLY, 0644) : iob->desc_get_by_fd (io, fd);
desc = fd == -1 ?
iob->desc_open (io, file, O_RDONLY, 0644) :
iob->desc_get_by_fd (io, fd);
if (!desc) return R_FALSE;
return r_bin_load_io_at_offset_as (bin, desc, baseaddr, loadaddr, xtr_idx, fileoffset, name);
return r_bin_load_io_at_offset_as (bin, desc, baseaddr,
loadaddr, xtr_idx, fileoffset, name);
}
R_API int r_bin_load_io(RBin *bin, RIODesc *desc, ut64 baseaddr, ut64 loadaddr, int xtr_idx) {
@ -360,8 +364,6 @@ R_API int r_bin_load_io_at_offset_as(RBin *bin, RIODesc *desc, ut64 baseaddr, ut
if (sz == UT64_MAX || sz>(64*1024*1024)) // too big, probably wrong
return R_FALSE;
buf_bytes = iob->desc_read (io, desc, &len_bytes);
if (!buf_bytes || offset >= sz) {
free (buf_bytes);

View File

@ -329,11 +329,16 @@ typedef struct r_bin_bind_t {
/* bin.c */
// XXX - delete r_bin_load after June 2014 if no issues arise
//R_API int r_bin_load(RBin *bin, const char *file, ut64 baseaddr, ut64 loadaddr, int xtr_idx, int fd, int rawstr);
R_API int r_bin_load(RBin *bin, const char *file, ut64 baseaddr, ut64 loadaddr, int xtr_idx, int fd, int rawstr);
R_API int r_bin_load_as(RBin *bin, const char *file, ut64 baseaddr, ut64 loadaddr, int xtr_idx, int fd, int rawstr, int fileoffset, const char *name);
R_API int r_bin_load_io(RBin *bin, RIODesc *desc, ut64 baseaddr, ut64 loadaddr, int xtr_idx);
R_API int r_bin_load_io_at_offset_as(RBin *bin, RIODesc *desc, ut64 baseaddr, ut64 loadaddr, int xtr_idx, ut64 offset, const char *name);
R_API int r_bin_load_io_at_offset(RBin *bin, RIODesc *desc, ut64 baseaddr, ut64 loadaddr, int xtr_idx);
R_API void r_bin_bind(RBin *b, RBinBind *bnd);
R_API int r_bin_add(RBin *bin, RBinPlugin *foo);
R_API int r_bin_xtr_add(RBin *bin, RBinXtrPlugin *foo);
R_API void* r_bin_free(RBin *bin);
// ref
R_API int r_bin_file_deref_by_bind (RBinBind * binb);
R_API int r_bin_file_deref (RBin *bin, RBinFile * a);
R_API int r_bin_file_ref_by_bind (RBinBind * binb);

View File

@ -38,4 +38,4 @@ ${MAKE} mrproper > /dev/null 2>&1
[ "`uname`" = Linux ] && export LDFLAGS="-Wl,--as-needed"
rm -f plugins.cfg
./configure ${CFGARG} --prefix=${PREFIX} || exit 1
exec ${MAKE} -s -j ${MAKE_JOBS}
exec ${MAKE} -s -j${MAKE_JOBS} MAKE_JOBS=${MAKE_JOBS}