Category : OS/2 Files
Archive   : ZOO21E.ZIP
Filename : OPTIONS.C

 
Output of file : OPTIONS.C contained in archive : ZOO21E.ZIP
#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


  3 Responses to “Category : OS/2 Files
Archive   : ZOO21E.ZIP
Filename : OPTIONS.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/