perl: remove conflicting re_compile define
[nvi.git] / perl_api / perlsfio.c
blob1df79141c90512034632a071356e5308770f41b7
1 /*-
2 * Copyright (c) 1996
3 * Keith Bostic. All rights reserved.
4 * Copyright (c) 1996
5 * Sven Verdoolaege. All rights reserved.
7 * See the LICENSE file for redistribution information.
8 */
10 #ifndef lint
11 static const char sccsid[] = "$Id: perlsfio.c,v 8.3 2000/04/30 17:00:15 skimo Exp $ (Berkeley) $Date: 2000/04/30 17:00:15 $";
12 #endif /* not lint */
14 #include <sys/types.h>
15 #include <sys/queue.h>
16 #include <sys/time.h>
18 #include <bitstring.h>
19 #include <ctype.h>
20 #include <limits.h>
21 #include <signal.h>
22 #include <stdio.h>
23 #include <stdlib.h>
24 #include <string.h>
25 #include <termios.h>
26 #include <unistd.h>
28 #include <EXTERN.h>
29 #include <perl.h>
30 #include <XSUB.h>
32 /* perl redefines them
33 * avoid warnings
35 #undef re_compile
36 #undef USE_DYNAMIC_LOADING
37 #undef DEBUG
38 #undef PACKAGE
39 #undef ARGS
40 #define ARGS ARGS
42 #include "config.h"
44 #include "../common/common.h"
45 #include "extern.h"
48 * PUBLIC: #ifdef USE_SFIO
50 #ifdef USE_SFIO
52 #define NIL(type) ((type)0)
54 static int
55 sfnviwrite(f, buf, n, disc)
56 Sfio_t* f; /* stream involved */
57 char* buf; /* buffer to read into */
58 int n; /* number of bytes to read */
59 Sfdisc_t* disc; /* discipline */
61 SCR *scrp;
63 scrp = (SCR *)SvIV((SV*)SvRV(perl_get_sv("curscr", FALSE)));
64 msgq(scrp, M_INFO, "%.*s", n, buf);
65 return n;
69 * sfdcnewnvi --
70 * Create nvi discipline
72 * PUBLIC: Sfdisc_t* sfdcnewnvi __P((SCR*));
75 Sfdisc_t *
76 sfdcnewnvi(scrp)
77 SCR *scrp;
79 Sfdisc_t* disc;
81 MALLOC(scrp, disc, Sfdisc_t*, sizeof(Sfdisc_t));
82 if (!disc) return disc;
84 disc->readf = (Sfread_f)NULL;
85 disc->writef = sfnviwrite;
86 disc->seekf = (Sfseek_f)NULL;
87 disc->exceptf = (Sfexcept_f)NULL;
88 return disc;
92 * PUBLIC: #endif
94 #endif /* USE_SFIO */