KMR
Macros | Functions | Variables
wc.mapper.c File Reference

Example for KMR shell command pipeline. More...

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>

Go to the source code of this file.

Macros

#define LINELEN   32767
 Maximum line length. More...
 

Functions

int main (int argc, char *argv[])
 Main function. More...
 
static void ReplaceChar (char *wp)
 Replace Character. More...
 

Variables

static char ignoreChar [] = { '\t' }
 Ignore characters. More...
 

Detailed Description

Example for KMR shell command pipeline.

It is a mapper for word count.

Definition in file wc.mapper.c.

Macro Definition Documentation

#define LINELEN   32767

Maximum line length.

Definition at line 11 of file wc.mapper.c.

Function Documentation

static void ReplaceChar ( char *  wp)
inlinestatic

Replace Character.

Replace ignore characters to a space character.

Definition at line 22 of file wc.mapper.c.

int main ( int  argc,
char *  argv[] 
)

Main function.

Read line from stdin, replace character, separate word by space, and output "WORD 1" to stdout.

Definition at line 43 of file wc.mapper.c.

Variable Documentation

char ignoreChar[] = { '\t' }
static

Ignore characters.

These characters are replaced to a space character.

Definition at line 17 of file wc.mapper.c.