www.pudn.com > Tornado_Train_Workshop_demo_program.rar > sample.c


/* sample - example of shell-less application */

#include "vxWorks.h"
#include "stdio.h"
#include "ioLib.h"
#include "usrLib.h"

#define BUF_SIZE (80)

int sample(void)
{
char buf [BUF_SIZE];
int length;

version();
printf ("\n\nWelcome to this stunning VxWorks application program\n\n");
FOREVER
{
printf ("Type something\n");
length = read (STD_IN, buf, sizeof(buf) - 1);
if (length <= 1)
continue;
buf [length-1] = '\0';
printf ("You typed \">s\"\n\n", buf);
}
}