summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sade
diff options
context:
space:
mode:
authorfjoe <fjoe@FreeBSD.org>2011-11-23 19:11:03 +0000
committerfjoe <fjoe@FreeBSD.org>2011-11-23 19:11:03 +0000
commitc95d65ea667756677966839597cb276a7e7cdf5d (patch)
tree5caa207d09d69e5740081b3fca185cf7329eda6c /usr.sbin/sade
parent1b36cd1ee6dd7b3fceedb98c21f14e74995f6dd3 (diff)
downloadFreeBSD-src-c95d65ea667756677966839597cb276a7e7cdf5d.zip
FreeBSD-src-c95d65ea667756677966839597cb276a7e7cdf5d.tar.gz
Remove unused functions.
Diffstat (limited to 'usr.sbin/sade')
-rw-r--r--usr.sbin/sade/misc.c101
-rw-r--r--usr.sbin/sade/sade.h8
2 files changed, 0 insertions, 109 deletions
diff --git a/usr.sbin/sade/misc.c b/usr.sbin/sade/misc.c
index ef9a2d9..6f0abac 100644
--- a/usr.sbin/sade/misc.c
+++ b/usr.sbin/sade/misc.c
@@ -56,27 +56,6 @@ file_readable(char *fname)
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 */
char *
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);
}
-/* 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 */
char *
string_prune(char *str)
@@ -118,29 +84,6 @@ string_skipwhite(char *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
directory_exists(const char *dirname)
{
@@ -159,22 +102,6 @@ directory_exists(const char *dirname)
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 */
void
safe_free(void *ptr)
@@ -198,34 +125,6 @@ safe_malloc(size_t size)
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
Mkdir(char *ipath)
{
diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h
index 170c9b1..62f26f6 100644
--- a/usr.sbin/sade/sade.h
+++ b/usr.sbin/sade/sade.h
@@ -387,19 +387,11 @@ extern int diskLabelCommit(dialogMenuItem *self);
/* misc.c */
extern Boolean file_readable(char *fname);
-extern Boolean file_executable(char *fname);
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_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_malloc(size_t size);
-extern void *safe_realloc(void *orig, size_t size);
extern int Mkdir(char *);
extern int Mount(char *, void *data);
OpenPOWER on IntegriCloud