ftp.nice.ch/pub/next/unix/developer/pcn.2.0.s.tar.gz#/src/stdio/stdio_gets.c

This is stdio_gets.c in view mode; [Download] [Up]

/*
 * PCN System
 * Author:      Steve Tuecke
 *              Argonne National Laboratory
 *
 * Please see the DISCLAIMER file in the top level directory of the
 * distribution regarding the provisions under which this software
 * is distributed.
 *
 * stdio_gets.c
 */

#include "stdio_internal.h"

void _p_stdio_gets(s, n, status)
char_t s[];
int_t *n;
int_t *status;
{
    if (fgets(s, *n, stdin) == (char *) NULL)
    {
	*s = '\0';
	*status = -1;
    }
    else
    {
	*status = strlen(s);
	if (s[*status - 1] == '\n')
	{
	    s[--(*status)] = '\0';
	}
    }
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Marcel Waldvogel and Netfuture.ch.