~ubuntu-branches/ubuntu/jaunty/graphviz/jaunty

« back to all changes in this revision

Viewing changes to lefty/io.h

  • Committer: Bazaar Package Importer
  • Author(s): Stephen M Moraco
  • Date: 2002-02-05 18:52:12 UTC
  • Revision ID: james.westby@ubuntu.com-20020205185212-8i04c70te00rc40y
Tags: upstream-1.7.16
ImportĀ upstreamĀ versionĀ 1.7.16

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    This software may only be used by you under license from AT&T Corp.
 
3
    ("AT&T").  A copy of AT&T's Source Code Agreement is available at
 
4
    AT&T's Internet website having the URL:
 
5
    <http://www.research.att.com/sw/tools/graphviz/license/source.html>
 
6
    If you received this software without first entering into a license
 
7
    with AT&T, you have an infringing copy of this software and cannot use
 
8
    it without violating AT&T's intellectual property rights.
 
9
*/
 
10
 
 
11
#pragma prototyped
 
12
/* Lefteris Koutsofios - AT&T Bell Laboratories */
 
13
 
 
14
#ifndef _IO_H
 
15
#define _IO_H
 
16
 
 
17
typedef enum {
 
18
    IO_FILE, IO_PTY, IO_PIPE, IO_SOCKET,
 
19
#ifdef FEATURE_CS
 
20
    IO_CS,
 
21
#endif
 
22
    IO_SIZE
 
23
} iotype_t;
 
24
 
 
25
typedef struct io_t {
 
26
    int inuse, ismonitored;
 
27
    iotype_t type;
 
28
    FILE *ifp, *ofp;
 
29
    int pid;
 
30
    char *buf;
 
31
} io_t;
 
32
 
 
33
#ifdef FEATURE_MS
 
34
#define IOmonitor(ioi, set) do { \
 
35
    iop[ioi].ismonitored = TRUE; \
 
36
} while (0)
 
37
#define IOunmonitor(ioi, set) do { \
 
38
    iop[ioi].ismonitored = FALSE; \
 
39
} while (0)
 
40
#else
 
41
#define IOmonitor(ioi, set) do { \
 
42
    iop[ioi].ismonitored = TRUE; \
 
43
    FD_SET (fileno (iop[ioi].ifp), &set); \
 
44
} while (0)
 
45
#define IOunmonitor(ioi, set) do { \
 
46
    iop[ioi].ismonitored = FALSE; \
 
47
    FD_CLR (fileno (iop[ioi].ifp), &set); \
 
48
} while (0)
 
49
#endif
 
50
 
 
51
#define IOismonitored(ioi) (iop[ioi].ismonitored == TRUE)
 
52
#define IOINCR 5
 
53
#define IOSIZE sizeof (io_t)
 
54
#define IOBUFSIZE 2048
 
55
 
 
56
extern io_t *iop;
 
57
extern int ion;
 
58
 
 
59
void IOinit (void);
 
60
void IOterm (void);
 
61
int IOopen (char *, char *, char *, char *);
 
62
int IOclose (int, char *);
 
63
int IOreadline (int, char *, int);
 
64
int IOread (int, char *, int);
 
65
int IOwriteline (int, char *);
 
66
 
 
67
#endif /* _IO_H */