Remove building with NOCRYPTO option
[minix.git] / external / bsd / nvi / dist / perl_api / perlsfio.c
blob748c47019da07ab250e2bd2233af5b626dc64d11
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 #include <sys/cdefs.h>
11 #if 0
12 #ifndef lint
13 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 ";
14 #endif /* not lint */
15 #else
16 __RCSID("$NetBSD: perlsfio.c,v 1.3 2014/01/26 21:43:45 christos Exp $");
17 #endif
19 #include <sys/types.h>
20 #include <sys/queue.h>
21 #include <sys/time.h>
23 #include <bitstring.h>
24 #include <ctype.h>
25 #include <limits.h>
26 #include <signal.h>
27 #include <stdio.h>
28 #include <stdlib.h>
29 #include <string.h>
30 #include <termios.h>
31 #include <unistd.h>
33 #include <EXTERN.h>
34 #include <perl.h>
35 #include <XSUB.h>
37 /* perl redefines them
38 * avoid warnings
40 #undef USE_DYNAMIC_LOADING
41 #undef DEBUG
42 #undef PACKAGE
43 #undef ARGS
44 #define ARGS ARGS
46 #include "config.h"
48 #include "../common/common.h"
49 #include "perl_api_extern.h"
52 * PUBLIC: #ifdef USE_SFIO
54 #ifdef USE_SFIO
56 #define NIL(type) ((type)0)
58 static int
59 sfnviwrite(f, buf, n, disc)
60 Sfio_t* f; /* stream involved */
61 char* buf; /* buffer to read into */
62 int n; /* number of bytes to read */
63 Sfdisc_t* disc; /* discipline */
65 SCR *scrp;
67 scrp = (SCR *)SvIV((SV*)SvRV(perl_get_sv("curscr", FALSE)));
68 msgq(scrp, M_INFO, "%.*s", n, buf);
69 return n;
73 * sfdcnewnvi --
74 * Create nvi discipline
76 * PUBLIC: Sfdisc_t* sfdcnewnvi __P((SCR*));
79 Sfdisc_t *
80 sfdcnewnvi(scrp)
81 SCR *scrp;
83 Sfdisc_t* disc;
85 MALLOC(scrp, disc, Sfdisc_t*, sizeof(Sfdisc_t));
86 if (!disc) return disc;
88 disc->readf = (Sfread_f)NULL;
89 disc->writef = sfnviwrite;
90 disc->seekf = (Sfseek_f)NULL;
91 disc->exceptf = (Sfexcept_f)NULL;
92 return disc;
96 * PUBLIC: #endif
98 #endif /* USE_SFIO */