ftp.nice.ch/pub/next/unix/network/system/NeXTICS.NIHS.bs.tar.gz#/NeXTICS/Source/ics_filter.c

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

#include <stdio.h>

#define MAXBUF 2048
char lineBuf[MAXBUF];
int numchars=0;
void (*boardLine)();

void setBoardLineFunc( blf )
  void (*blf)();
{
  boardLine = blf;
}

extern char *strstr();

void GotALine( char *line )
{
  char *bLine;
  if (bLine = strstr(line, "#@#")) {
    /* Seems like a board line */
    boardLine( bLine );
  }
}

extern void filterChars( char *buf, int num )
{
   int i;
   for (i=0;i<num;i++) {
     if (numchars == MAXBUF) {
       fprintf( stderr, "Input buffer overrun!\n" );
       return;
     }
     if (buf[i] == '\n') {
       lineBuf[numchars] = '\0';
       GotALine( lineBuf );
       numchars = 0;
     } else {
       lineBuf[numchars++] = buf[i];
     }
   }
}

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