Skip to content

Commit

Permalink
Rename r_buf_new_slurp -> r_buf_new_from_file
Browse files Browse the repository at this point in the history
  • Loading branch information
jukuisma committed Jan 17, 2025
1 parent e5533e3 commit d0069c6
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions libr/anal/flirt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1388,7 +1388,7 @@ static inline void flirt_free(RFlirt *f) {

// dump a flirt signature content on screen
R_API void r_sign_flirt_dump(const RAnal *anal, const char *flirt_file) {
RBuffer *flirt_buf = r_buf_new_slurp (flirt_file);
RBuffer *flirt_buf = r_buf_new_from_file (flirt_file);
if (!flirt_buf) {
R_LOG_ERROR ("Can't slurp %s", flirt_file);
return;
Expand All @@ -1406,7 +1406,7 @@ R_API void r_sign_flirt_dump(const RAnal *anal, const char *flirt_file) {

// parses a flirt signature file and scan the currently opened file with it
R_API void r_sign_flirt_scan(RAnal *anal, const char *flirt_file) {
RBuffer *flirt_buf = r_buf_new_slurp (flirt_file);
RBuffer *flirt_buf = r_buf_new_from_file (flirt_file);
if (!flirt_buf) {
R_LOG_ERROR ("Can't slurp %s", flirt_file);
return;
Expand Down
2 changes: 1 addition & 1 deletion libr/bin/format/pdb/pdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1502,7 +1502,7 @@ R_API bool init_pdb_parser_with_buf(RPdb *pdb, RBuffer* buf) {
}

R_API bool init_pdb_parser(RPdb *pdb, const char *filename) {
RBuffer *buf = r_buf_new_slurp (filename);
RBuffer *buf = r_buf_new_from_file (filename);
if (!buf) {
R_LOG_ERROR ("%s: Error reading file \"%s\"", __func__, filename);
return false;
Expand Down
2 changes: 1 addition & 1 deletion libr/core/p/core_prj.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ static ut8 *rprj_find(RBuffer *b, ut32 type, ut32 *size) {
}

static void prj_load(RCore *core, const char *file, int mode) {
RBuffer *b = r_buf_new_slurp (file);
RBuffer *b = r_buf_new_from_file (file);
if (!b) {
R_LOG_ERROR ("Cannot open file");
return;
Expand Down
2 changes: 1 addition & 1 deletion libr/include/r_util/r_buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ R_API RBuffer *r_buf_new_with_string(const char *msg);
R_API RBuffer *r_buf_new_with_pointers(const ut8 *bytes, ut64 len, bool steal);
R_API RBuffer *r_buf_new_file(const char *file, int perm, int mode);
R_API RBuffer *r_buf_new_with_buf(RBuffer *b);
R_API RBuffer *r_buf_new_slurp(const char *file);
R_API RBuffer *r_buf_new_from_file(const char *file);
R_API RBuffer *r_buf_new_slice(RBuffer *b, ut64 offset, ut64 size);
R_API RBuffer *r_buf_new_empty(ut64 len);
R_API RBuffer *r_buf_new_mmap(const char *file, int flags);
Expand Down
3 changes: 1 addition & 2 deletions libr/util/buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,7 @@ R_API RBuffer *r_buf_new_file(const char *file, int perm, int mode) {
return new_buffer (R_BUFFER_FILE, &u);
}

// R2_600 : rename to new_from_file ?
R_API RBuffer *r_buf_new_slurp(const char *file) {
R_API RBuffer *r_buf_new_from_file(const char *file) {
size_t len;
char *tmp = r_file_slurp (file, &len);
if (!tmp) {
Expand Down

0 comments on commit d0069c6

Please sign in to comment.