1 #include "ace/OS_main.h"
2 #include "ace/OS_NS_fcntl.h"
3 #include "ace/OS_NS_unistd.h"
4 #include "ace/Malloc_Base.h"
5 #include "ace/Service_Config.h"
6 #include "ace/Read_Buffer.h"
7 #include "ace/OS_NS_stdlib.h"
10 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
12 ACE_HANDLE handle
= argc
> 1 ? ACE_OS::open (argv
[1], O_RDONLY
) : ACE_STDIN
;
13 int term
= argc
> 2 ? ACE_OS::atoi (argv
[2]) : EOF
;
14 int search
= argc
> 3 ? ACE_OS::atoi (argv
[3]) : '\n';
15 int replace
= argc
> 4 ? ACE_OS::atoi (argv
[4]) : '\0';
17 ACE_Read_Buffer
rb (handle
);
21 while ((buf
= rb
.read (term
, search
, replace
)) != 0)
23 ACE_OS::write (ACE_STDOUT
, buf
, rb
.size ());
24 ACE_Allocator::instance ()->free (buf
);