summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/asymptote/util.cc')
-rw-r--r--Build/source/utils/asymptote/util.cc52
1 files changed, 0 insertions, 52 deletions
diff --git a/Build/source/utils/asymptote/util.cc b/Build/source/utils/asymptote/util.cc
index 81398491c00..85e9320cfdc 100644
--- a/Build/source/utils/asymptote/util.cc
+++ b/Build/source/utils/asymptote/util.cc
@@ -398,58 +398,6 @@ const char *setPath(const char *s, bool quiet)
return p;
}
-void fatal(const char *msg, const char *s=NULL)
-{
- ostringstream buf;
- buf << msg;
- if(s) {
- buf << " " << getPath();
- if(*s) buf << "/";
- buf << s;
- }
- buf << ": " << strerror(errno) << endl;
- camp::reportError(buf);
-}
-
-void empty_current_dir()
-{
- static struct stat buf;
- DIR *dir=opendir(".");
- if(dir == NULL) fatal("Cannot open directory","");
- dirent *p;
- while((p=readdir(dir)) != NULL) {
- if(strcmp(p->d_name,".") == 0 || strcmp(p->d_name,"..") == 0) continue;
- if(lstat(p->d_name,&buf) == 0) {
- if(S_ISDIR(buf.st_mode)) {
- if(chdir(p->d_name)) fatal("Cannot change directory to",p->d_name);
- empty_current_dir();
- if(chdir(".."))
- fatal("Cannot change to parent directory of",p->d_name);
- if(rmdir(p->d_name))
- fatal("Cannot remove directory",p->d_name);
- } else {
- if(unlink(p->d_name)) fatal("Cannot remove file",p->d_name);
- }
- }
- }
- if(closedir(dir)) fatal("Invalid current directory stream descriptor");
-}
-
-void recursive_delete(char *name)
-{
- static struct stat buf;
- if(lstat(name,&buf) == 0) {
- if(S_ISDIR(buf.st_mode)) {
- const char *path=getPath();
- if(chdir(name)) fatal("Cannot change directory to",name);
- empty_current_dir();
- if(chdir(path)) fatal("Cannot change to directory","");
- if(rmdir(name)) fatal("Cannot remove directory", name);
- }
- else unlink(name);
- }
-}
-
void push_command(mem::vector<string>& a, const string& s)
{
a.push_back(s);