1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-22 11:17:19 +00:00

Remove unused functions.

This commit is contained in:
Max Khon 2011-11-23 19:11:03 +00:00
parent 66b007568a
commit 2dc3da8c3f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=227903
2 changed files with 0 additions and 109 deletions

View File

@ -56,27 +56,6 @@ file_readable(char *fname)
return FALSE; return FALSE;
} }
/* Quick check to see if a file is executable */
Boolean
file_executable(char *fname)
{
if (!access(fname, X_OK))
return TRUE;
return FALSE;
}
/* Concatenate two strings into static storage */
char *
string_concat(char *one, char *two)
{
static char tmp[FILENAME_MAX];
/* Yes, we're deliberately cavalier about not checking for overflow */
strcpy(tmp, one);
strcat(tmp, two);
return tmp;
}
/* sane strncpy() function */ /* sane strncpy() function */
char * char *
sstrncpy(char *dst, const char *src, int size) sstrncpy(char *dst, const char *src, int size)
@ -85,19 +64,6 @@ sstrncpy(char *dst, const char *src, int size)
return strncpy(dst, src, size); return strncpy(dst, src, size);
} }
/* Concatenate three strings into static storage */
char *
string_concat3(char *one, char *two, char *three)
{
static char tmp[FILENAME_MAX];
/* Yes, we're deliberately cavalier about not checking for overflow */
strcpy(tmp, one);
strcat(tmp, two);
strcat(tmp, three);
return tmp;
}
/* Clip the whitespace off the end of a string */ /* Clip the whitespace off the end of a string */
char * char *
string_prune(char *str) string_prune(char *str)
@ -118,29 +84,6 @@ string_skipwhite(char *str)
return str; return str;
} }
/* copy optionally and allow second arg to be null */
char *
string_copy(char *s1, char *s2)
{
if (!s1)
return NULL;
if (!s2)
s1[0] = '\0';
else
strcpy(s1, s2);
return s1;
}
/* convert an integer to a string, using a static buffer */
char *
itoa(int value)
{
static char buf[13];
snprintf(buf, 12, "%d", value);
return buf;
}
Boolean Boolean
directory_exists(const char *dirname) directory_exists(const char *dirname)
{ {
@ -159,22 +102,6 @@ directory_exists(const char *dirname)
return (TRUE); return (TRUE);
} }
char *
pathBaseName(const char *path)
{
char *pt;
char *ret = (char *)path;
pt = strrchr(path,(int)'/');
if (pt != 0) /* if there is a slash */
{
ret = ++pt; /* start the file after it */
}
return(ret);
}
/* A free guaranteed to take NULL ptrs */ /* A free guaranteed to take NULL ptrs */
void void
safe_free(void *ptr) safe_free(void *ptr)
@ -198,34 +125,6 @@ safe_malloc(size_t size)
return ptr; return ptr;
} }
/* A realloc that checks errors */
void *
safe_realloc(void *orig, size_t size)
{
void *ptr;
if (size <= 0)
msgFatal("Invalid realloc size of %ld!", (long)size);
ptr = reallocf(orig, size);
if (!ptr)
msgFatal("Out of memory!");
return ptr;
}
/* Create a path biased from the VAR_INSTALL_ROOT variable (if not /) */
char *
root_bias(char *path)
{
static char tmp[FILENAME_MAX];
char *cp = variable_get(VAR_INSTALL_ROOT);
if (!strcmp(cp, "/"))
return path;
strcpy(tmp, variable_get(VAR_INSTALL_ROOT));
strcat(tmp, path);
return tmp;
}
int int
Mkdir(char *ipath) Mkdir(char *ipath)
{ {

View File

@ -387,19 +387,11 @@ extern int diskLabelCommit(dialogMenuItem *self);
/* misc.c */ /* misc.c */
extern Boolean file_readable(char *fname); extern Boolean file_readable(char *fname);
extern Boolean file_executable(char *fname);
extern Boolean directory_exists(const char *dirname); extern Boolean directory_exists(const char *dirname);
extern char *root_bias(char *path);
extern char *itoa(int value);
extern char *string_concat(char *p1, char *p2);
extern char *string_concat3(char *p1, char *p2, char *p3);
extern char *string_prune(char *str); extern char *string_prune(char *str);
extern char *string_skipwhite(char *str); extern char *string_skipwhite(char *str);
extern char *string_copy(char *s1, char *s2);
extern char *pathBaseName(const char *path);
extern void safe_free(void *ptr); extern void safe_free(void *ptr);
extern void *safe_malloc(size_t size); extern void *safe_malloc(size_t size);
extern void *safe_realloc(void *orig, size_t size);
extern int Mkdir(char *); extern int Mkdir(char *);
extern int Mount(char *, void *data); extern int Mount(char *, void *data);