extern char *malloc();
#endif
-#include <system.h>
+#include "system.h"
+#include <stdio.h>
#ifndef INP_NPUSHBACK
#define INP_NPUSHBACK 1
register long *size;
char **pbuf; /* output parameter */
{
- extern long sys_filesize();
- int rsize;
+ long rsize;
if (
((*size = sys_filesize(fn))) < 0
INP_PRIVATE struct INP_i_buf *i_ptr;
_PROTOTYPE(INP_PRIVATE char * INP_pbuf, (void));
-INP_PRIVATE char *
-INP_pbuf()
+
+INP_PRIVATE char *INP_pbuf(void)
{
register struct INP_i_buf *ib =
(struct INP_i_buf *) malloc(sizeof(struct INP_i_buf));
_PROTOTYPE(INP_PRIVATE struct INP_buffer_header *INP_push_bh, (void));
_PROTOTYPE(INP_PRIVATE int INP_pop_bh, (void));
-INP_PRIVATE struct INP_buffer_header *
-INP_push_bh()
+INP_PRIVATE struct INP_buffer_header *INP_push_bh(void)
{
register struct INP_buffer_header *bh;
of headers. 0 is returned if there are no more
inputbuffers on the stack, 1 is returned in the other case.
*/
-INP_PRIVATE int
-INP_pop_bh()
+INP_PRIVATE int INP_pop_bh(void)
{
register struct INP_buffer_header *bh = INP_head;
char *buf;
int *n;
{
+ long readSize;
+ readSize = (size_t)*n;
- if (!sys_read(fd, buf, INP_BUFSIZE, n)) {
+ if (!sys_read(fd, buf, INP_BUFSIZE, &readSize)) {
return 0;
}
+ *n = (int)readSize;
buf[*n] = '\0';
return 1;
}
/* INP_mk_filename() concatenates a dir and filename.
*/
-INP_PRIVATE int
-INP_mk_filename(dir, file, newname)
- register char *dir, *file;
- char **newname;
+INP_PRIVATE int INP_mk_filename(register char *dir, register char *file, char **newname)
{
register char *dst;
/* Interface routines : InsertFile, InsertText, and loadbuf
*/
-int
-InsertFile(filnam, table, result)
- char *filnam;
- char *table[];
- char **result;
+int InsertFile(char *filnam, char *table[], char **result)
{
char *newfn = 0;
return 0;
}
-int
-InsertText(text, length)
- char *text;
+int InsertText(char *text, int length)
{
register struct INP_buffer_header *bh = INP_push_bh();
((void)((dest = *_ipp++) || (dest = loadbuf())))
/* Reads the next character, converting CRLF into LF. */
-int
-loadchar(void)
+int loadchar(void)
{
int ch;
RAWLOAD(ch);
Note: this routine is exported due to its occurence in the definition
of LoadChar [input.h], that is defined as a macro.
*/
-int
-loadbuf()
+int loadbuf(void)
{
register struct INP_buffer_header *bh = INP_head;
static char buf[INP_NPUSHBACK + 1];