1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
26 // eindeutiger Name f�r die Pipe
27 const char pszPipeName
[] = "TestPipe";
32 void fail( const char * pszText
, int retval
)
34 fprintf( stderr
, "TestPipe Client: %s", pszText
);
35 fprintf( stderr
, "TestPipe Client: test failed, ErrNo: %d.\n", retval
);
42 * Teste die Pipe-Implementation in osl
48 rtl_uString
* ustrPipeName
=0;
51 rtl_uString_newFromAscii(&ustrPipeName
,pszPipeName
);
54 Pipe
= osl_createPipe( ustrPipeName
, osl_Pipe_OPEN
, 0 );
57 fail( "unable to open pipe.\n",
58 osl_getLastPipeError(NULL
));
61 // empfange Daten vom Server
62 nChars
= osl_receivePipe( Pipe
, szBuffer
, 256 );
65 fail( "unable to read from pipe.\n",
66 osl_getLastPipeError( Pipe
) );
68 printf( "TestPipe Client: data received: %s.\n", szBuffer
);
70 // Sende die Daten wieder zur�ck.
71 nChars
= osl_sendPipe( Pipe
, szBuffer
, nChars
);
74 fail( "unable to write on pipe.\n",
75 osl_getLastPipeError( Pipe
) );
78 osl_releasePipe( Pipe
);
80 printf( "TestPipe Client: test passed.\n" );
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */