blob: 991bd41831b2c8eb259f18d358659faeebcd6ee5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
// $Id$
#include "ace/Service_Config.h"
#include "ace/Read_Buffer.h"
int
main (int argc, char *argv[])
{
int handle = argc > 1 ? ::open (argv[1], O_RDONLY) : 0;
int term = argc > 2 ? ::atoi (argv[2]) : EOF;
int search = argc > 3 ? ::atoi (argv[3]) : '\n';
int replace = argc > 4 ? ::atoi (argv[4]) : '\0';
ACE_Read_Buffer rb (handle);
char *buf;
while ((buf = rb.read (term, search, replace)) != 0)
{
::write (1, buf, rb.size ());
ACE_Allocator::instance ()->free (buf);
}
return 0;
}
|