Rename r_file_exist into r_file_exists

This commit is contained in:
pancake 2012-09-06 08:59:13 +02:00
parent 46e29afb98
commit be247348b5
12 changed files with 20 additions and 20 deletions

View File

@ -77,7 +77,7 @@ static void list_io_plugins(RIO *io) {
// TODO: use thread to load this, split contents line, per line and use global lock
#if USE_THREADS
static int rabin_delegate(RThread *th) {
if (rabin_cmd && r_file_exist (r.file->filename)) {
if (rabin_cmd && r_file_exists (r.file->filename)) {
char *nptr, *ptr, *cmd = r_sys_cmd_str (rabin_cmd, NULL, NULL);
ptr = cmd;
if (ptr)

View File

@ -576,16 +576,16 @@ R_API int r_core_config_init(RCore *core) {
#endif
r_config_desc (cfg, "cfg.editor", "Select default editor program");
free (p);
if (r_file_exist ("/usr/bin/htmlgraph.sh"))
if (r_file_exists ("/usr/bin/htmlgraph.sh"))
r_config_set (cfg, "cmd.graph", "!htmlgraph.sh a.dot");
else
if (r_file_exist ("/usr/bin/xdot"))
if (r_file_exists ("/usr/bin/xdot"))
r_config_set (cfg, "cmd.graph", "!xdot a.dot");
else
if (r_file_exist ("/usr/bin/open"))
if (r_file_exists ("/usr/bin/open"))
r_config_set (cfg, "cmd.graph", "!dot -Tgif -oa.gif a.dot;!open a.gif");
else
if (r_file_exist ("/usr/bin/gqview"))
if (r_file_exists ("/usr/bin/gqview"))
r_config_set (cfg, "cmd.graph", "!dot -Tgif -oa.gif a.dot;!gqview a.gif");
else
r_config_set (cfg, "cmd.graph", "!dot -Tgif -oa.gif a.dot;!gqview a.gif");
@ -609,12 +609,12 @@ R_API int r_core_config_init(RCore *core) {
#if __WINDOWS__
r_config_set (cfg, "http.browser", "start");
#else
if (r_file_exist ("/sbin/adbd"))
if (r_file_exists ("/sbin/adbd"))
r_config_set (cfg, "http.browser",
"am start -a android.intent.action.VIEW -d");
else if (r_file_exist ("/usr/bin/xdg-open"))
else if (r_file_exists ("/usr/bin/xdg-open"))
r_config_set (cfg, "http.browser", "xdg-open");
else if (r_file_exist ("/usr/bin/open"))
else if (r_file_exists ("/usr/bin/open"))
r_config_set (cfg, "http.browser", "open");
else r_config_set (cfg, "http.browser", "firefox");
#endif

View File

@ -77,7 +77,7 @@ R_API int r_core_rtr_http(RCore *core, int launch) {
rs->path = strdup ("/index.html");
}
snprintf (path, sizeof (path), "%s/%s", root, rs->path);
if (r_file_exist (path)) {
if (r_file_exists (path)) {
int sz = 0;
char *f = r_file_slurp (path, &sz);
if (f) {

View File

@ -31,7 +31,7 @@ static int r_core_visual_hud(RCore *core) {
res = r_cons_hud_file (homehud);
if (!res) {
const char *f = R2_LIBDIR"/radare2/"R2_VERSION"/hud/main";
if (r_file_exist (f))
if (r_file_exists (f))
res = r_cons_hud_file (f);
else r_cons_message ("Cannot find hud file");
}

View File

@ -1325,7 +1325,7 @@ static RList *r_debug_native_threads(RDebug *dbg, int pid) {
/* LOL! linux hides threads from /proc, but they are accessible!! HAHAHA */
//while ((de = readdir (dh))) {
snprintf (cmdline, sizeof (cmdline), "/proc/%d/task", pid);
if (r_file_exist (cmdline)) {
if (r_file_exists (cmdline)) {
struct dirent *de;
DIR *dh = opendir (cmdline);
while ((de = readdir (dh))) {

View File

@ -115,7 +115,7 @@ static char *find_include(const char *prefix, const char *file) {
{
char *filepath = r_str_concatf (NULL, "%s/%s/%s", str, pfx, file);
// eprintf ("try (%s)\n", filepath);
if (r_file_exist (filepath)) {
if (r_file_exists (filepath)) {
free (env);
free (pfx);
return filepath;

View File

@ -433,7 +433,7 @@ R_API char *r_file_slurp_random_line(const char *file);
R_API ut8 *r_file_slurp_hexpairs(const char *str, int *usz);
R_API boolt r_file_dump(const char *file, const ut8 *buf, int len);
R_API boolt r_file_rm(const char *file);
R_API boolt r_file_exist(const char *str);
R_API boolt r_file_exists(const char *str);
R_API char *r_file_slurp_line(const char *file, int line, int context);
R_API int r_file_mkstemp(const char *prefix, char **oname);
R_API char *r_file_tmpdir();

View File

@ -35,7 +35,7 @@ static int run(void *user, const char *code, int len)
static int slurp_ruby(const char *file)
{
if (r_file_exist(file)) {
if (r_file_exists(file)) {
rb_load_file(file);
ruby_exec();
return R_TRUE;

View File

@ -15,7 +15,7 @@ static int r_vala_file(RLang *lang, const char *file) {
if (!strstr (file, ".vala"))
sprintf (name, "%s.vala", file);
else strcpy (name, file);
if (!r_file_exist (name)) {
if (!r_file_exists (name)) {
eprintf ("file not found (%s)\n", name);
return R_FALSE;
}

View File

@ -83,7 +83,7 @@ R_API char *r_lib_path(const char *libname) {
if (next) *next = 0;
snprintf (libpath, sizeof (libpath), "%s/%s%s", path0, libname, ext);
//eprintf ("--> %s\n", libpath);
if (r_file_exist (libpath)) {
if (r_file_exists (libpath)) {
free (env);
return strdup (libpath);
}

View File

@ -61,7 +61,7 @@ R_API int r_syscall_setup(RSyscall *ctx, const char *arch, const char *os, int b
#define SYSCALLPATH R2_LIBDIR"/radare2/"R2_VERSION"/syscall"
snprintf (file, sizeof (file), "%s/%s-%s-%d.sdb",
SYSCALLPATH, os, arch, bits);
if (!r_file_exist (file)) {
if (!r_file_exists (file)) {
//eprintf ("r_syscall_setup: Cannot find '%s'\n", file);
return R_FALSE;
}

View File

@ -26,7 +26,7 @@ R_API boolt r_file_is_directory(const char *str) {
return ((S_IFDIR &buf.st_mode))? R_TRUE: R_FALSE;
}
R_API boolt r_file_exist(const char *str) {
R_API boolt r_file_exists(const char *str) {
struct stat buf;
if (stat (str, &buf)==-1)
return R_FALSE;
@ -67,7 +67,7 @@ R_API char *r_file_path(const char *bin) {
if (ptr) {
*ptr = '\0';
snprintf (file, sizeof (file), "%s/%s", str, bin);
if (r_file_exist (file)) {
if (r_file_exists (file)) {
free (path);
free (path_env);
return strdup (file);
@ -86,7 +86,7 @@ R_API char *r_file_slurp(const char *str, int *usz) {
char *ret;
FILE *fd;
long sz;
if (!r_file_exist (str))
if (!r_file_exists (str))
return NULL;
fd = fopen (str, "rb");
if (fd == NULL)