Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 78 lines (65 sloc) 2.617 kb
cf92e3be »
2011-12-10 Import Elvis 2.0 (written by Steve Kirkendall)
1 /* opsys.h */
2 /* Copyright 1995 by Steve Kirkendall */
3
4
5
6 typedef enum
7 {
8 DIR_INVALID, /* malformed filename (can't happen with UNIX) */
9 DIR_BADPATH, /* unable to check file */
9f1c6f0f »
2011-12-10 Import Elvis 2.2_0 (written by Steve Kirkendall)
10 DIR_NOTFILE, /* file exists but is neither normal nor directory */
11 DIR_DIRECTORY, /* file is a directory */
cf92e3be »
2011-12-10 Import Elvis 2.0 (written by Steve Kirkendall)
12 DIR_NEW, /* file doesn't exist yet */
13 DIR_UNREADABLE, /* file exists but is unreadable */
14 DIR_READONLY, /* file is readable but not writable */
15 DIR_READWRITE /* file is readable and writable. */
16 } DIRPERM;
17
18 BEGIN_EXTERNC
9f1c6f0f »
2011-12-10 Import Elvis 2.2_0 (written by Steve Kirkendall)
19 extern ELVBOOL blkopen P_((ELVBOOL force, BLK *buf));
cf92e3be »
2011-12-10 Import Elvis 2.0 (written by Steve Kirkendall)
20 extern void blkclose P_((BLK *buf));
21 extern void blkwrite P_((BLK *buf, _BLKNO_ blkno));
22 extern void blkread P_((BLK *buf, _BLKNO_ blkno));
23 extern void blksync P_((void));
24
9f1c6f0f »
2011-12-10 Import Elvis 2.2_0 (written by Steve Kirkendall)
25 extern char *dirfirst P_((char *wildexpr, ELVBOOL ispartial));
cf92e3be »
2011-12-10 Import Elvis 2.0 (written by Steve Kirkendall)
26 extern char *dirnext P_((void));
9f1c6f0f »
2011-12-10 Import Elvis 2.2_0 (written by Steve Kirkendall)
27 extern ELVBOOL diriswild P_((char *wildexpr));
28 extern ELVBOOL dirwildcmp P_((char *fname, char *wild));
cf92e3be »
2011-12-10 Import Elvis 2.0 (written by Steve Kirkendall)
29 extern DIRPERM dirperm P_((char *filename));
30 extern char *dirdir P_((char *pathname));
31 extern char *dirfile P_((char *pathname));
9f1c6f0f »
2011-12-10 Import Elvis 2.2_0 (written by Steve Kirkendall)
32 extern char *dirtime P_((char *filename));
cf92e3be »
2011-12-10 Import Elvis 2.0 (written by Steve Kirkendall)
33 extern char *dirpath P_((char *dir, char *file));
34 extern char *dircwd P_((void));
9f1c6f0f »
2011-12-10 Import Elvis 2.2_0 (written by Steve Kirkendall)
35 extern ELVBOOL dirchdir P_((char *pathname));
cf92e3be »
2011-12-10 Import Elvis 2.0 (written by Steve Kirkendall)
36
9f1c6f0f »
2011-12-10 Import Elvis 2.2_0 (written by Steve Kirkendall)
37 extern ELVBOOL prgopen P_((char *command, ELVBOOL willwrite, ELVBOOL willread));
cf92e3be »
2011-12-10 Import Elvis 2.0 (written by Steve Kirkendall)
38 extern int prgwrite P_((CHAR *buf, int nbytes));
9f1c6f0f »
2011-12-10 Import Elvis 2.2_0 (written by Steve Kirkendall)
39 extern ELVBOOL prggo P_((void));
cf92e3be »
2011-12-10 Import Elvis 2.0 (written by Steve Kirkendall)
40 extern int prgread P_((CHAR *buf, int nbytes));
41 extern int prgclose P_((void));
42
9f1c6f0f »
2011-12-10 Import Elvis 2.2_0 (written by Steve Kirkendall)
43 extern int txtopen P_((char *filename, _char_ rwa, ELVBOOL binary));
cf92e3be »
2011-12-10 Import Elvis 2.0 (written by Steve Kirkendall)
44 extern void txtclose P_((void));
45 extern int txtwrite P_((CHAR *buf, int nbytes));
46 extern int txtread P_((CHAR *buf, int nbytes));
47
8d1ac0c1 »
2011-12-10 Import Elvis 2.1 (written by Steve Kirkendall)
48 #if defined(PROTOCOL_HTTP) || defined(PROTOCOL_FTP)
49 typedef struct
50 {
51 int fd; /* file descriptor of a socket to read from */
52 int left; /* number of chars used from buf */
53 int right; /* total number of chars in buf */
54 char buf[4096]; /* buffer */
55 } sockbuf_t;
56
57 #define netbuffer(sb) ((sb)->buf + (sb)->left)
58 #define netbytes(sb) ((sb)->right - (sb)->left)
59 #define netconsume(sb, n) ((sb)->left += (n))
60
61 sockbuf_t *netconnect P_((char *site_port, unsigned int defport));
62 void netdisconnect P_((sockbuf_t *sb));
9f1c6f0f »
2011-12-10 Import Elvis 2.2_0 (written by Steve Kirkendall)
63 ELVBOOL netread P_((sockbuf_t *sb));
8d1ac0c1 »
2011-12-10 Import Elvis 2.1 (written by Steve Kirkendall)
64 char *netgetline P_((sockbuf_t *sb));
9f1c6f0f »
2011-12-10 Import Elvis 2.2_0 (written by Steve Kirkendall)
65 ELVBOOL netwrite P_((sockbuf_t *sb, char *data, int len));
66 ELVBOOL netputline P_((sockbuf_t *sb, char *command, char *arg1, char *arg2));
8d1ac0c1 »
2011-12-10 Import Elvis 2.1 (written by Steve Kirkendall)
67 char *netself P_((void));
68 #endif
69
cf92e3be »
2011-12-10 Import Elvis 2.0 (written by Steve Kirkendall)
70 #ifdef OSINIT
71 extern void osinit P_((char *argv0));
72 #endif
8d1ac0c1 »
2011-12-10 Import Elvis 2.1 (written by Steve Kirkendall)
73
74 #if ANY_UNIX
75 extern char *expanduserhome P_((char *pathname, char *dest));
76 #endif
77
cf92e3be »
2011-12-10 Import Elvis 2.0 (written by Steve Kirkendall)
78 END_EXTERNC
Something went wrong with that request. Please try again.