Date: Wed, 23 Nov 2011 19:11:03 +0000 (UTC) From: Max Khon <fjoe@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r227903 - head/usr.sbin/sade Message-ID: <201111231911.pANJB3a4059292@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: fjoe Date: Wed Nov 23 19:11:03 2011 New Revision: 227903 URL: http://svn.freebsd.org/changeset/base/227903 Log: Remove unused functions. Modified: head/usr.sbin/sade/misc.c head/usr.sbin/sade/sade.h Modified: head/usr.sbin/sade/misc.c ============================================================================== --- head/usr.sbin/sade/misc.c Wed Nov 23 19:06:30 2011 (r227902) +++ head/usr.sbin/sade/misc.c Wed Nov 23 19:11:03 2011 (r227903) @@ -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 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) { Modified: head/usr.sbin/sade/sade.h ============================================================================== --- head/usr.sbin/sade/sade.h Wed Nov 23 19:06:30 2011 (r227902) +++ head/usr.sbin/sade/sade.h Wed Nov 23 19:11:03 2011 (r227903) @@ -387,19 +387,11 @@ extern int diskLabelCommit(dialogMenuIte /* 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201111231911.pANJB3a4059292>