⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 options.c

📁 汇编大全 中国矿业大学计算机学院 汇编实验5
💻 C
字号:
#ifndef LINT
static char sccsid[]="@(#) options.c 2.1 87/12/25 12:23:56";
#endif /* LINT */

/*
Copyright (C) 1986, 1987 Rahul Dhesi -- All rights reserved
*/
/*
Here we define routines specific to only a few systems.  Routines are
selected based on defined symbols.  Routines specific to only one
system are in machine.c for the appropriate system.
*/

#include "options.h"
#include "zooio.h"
#include "various.h"
#include "zoo.h"
#include "zoofns.h"
#include "errors.i"

#ifdef REN_LINK         
/* rename using link() followed by unlink() */
/* 
The following code assumes that if unlink() returns nonzero, then the
attempt to unlink failed.  If unlink() ever returns nonzero after actually
unlinking the file, then the file being renamed will be lost!!!  Test this 
thoroughly.  It is assumed that link() and unlink() return zero if no
error else nonzero.
*/
int chname (newname, oldname)
char *newname, *oldname;
{
   int status;
   if (link (oldname, newname) == 0) { /* if we can create new name */
      status = unlink (oldname);          /*   unlink old one */
      if (status != 0) {                  /*   if unlink of old name failed */
         unlink (newname);                /*     cancel new link */
         return (-1);                     /*     return error */
      } else
         return (0);
   }
   else                    /* couldn't create new link */
      return (-1);
}
#else
/* else not REN_LINK */

int chname (newname, oldname)
char *newname, *oldname;
{
#ifdef REN_STDC
   if (rename(oldname, newname) != 0)     /* ANSI standard */
#else
   if (rename(newname, oldname) != 0)     /* its reverse */
#endif
      return (-1);
   else
      return (0);
}
#endif /* end of not REN_LINK */

/*
Standard exit handler;  not used if specific system defines its
own.
*/
#ifndef SPECEXIT
void zooexit (status)
int status;
{
	exit (status);
}
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -