~ubuntu-branches/ubuntu/precise/unzip/precise-proposed

« back to all changes in this revision

Viewing changes to theos/_isatty.c

  • Committer: Bazaar Package Importer
  • Author(s): Santiago Vila
  • Date: 2004-06-06 17:57:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040606175746-nl7p2dgp3aobyc2c
Tags: upstream-5.51
ImportĀ upstreamĀ versionĀ 5.51

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  Copyright (c) 1990-2000 Info-ZIP.  All rights reserved.
 
3
 
 
4
  See the accompanying file LICENSE, version 2000-Apr-09 or later
 
5
  (the contents of which are also included in zip.h) for terms of use.
 
6
  If, for some reason, all these files are missing, the Info-ZIP license
 
7
  also may be found at:  ftp://ftp.info-zip.org/pub/infozip/license.html
 
8
*/
 
9
/* replace standard library function who needs a FILE* */
 
10
 
 
11
#pragma library
 
12
 
 
13
#include <stdio.h>
 
14
#include <fcntl.h>
 
15
#include <sc.h>
 
16
#include <lub.h>
 
17
 
 
18
short _isatty(int fd)
 
19
{
 
20
    register short lub;
 
21
 
 
22
    lub = (int) _fcntl(&stdin[fd], 5, (size_t) 0);
 
23
    return (lub >= CONIN && lub <= CONOUT)
 
24
        || (lub >= COM1 && lub <= COM4)
 
25
        || (lub >= COM5 && lub <= COM16);
 
26
}