Update ooo320-m1
[ooovba.git] / sal / inc / osl / pipe.h
blob69c008b10b75a28524db37fa19968db7f057b1cb
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: pipe.h,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
32 #ifndef _OSL_PIPE_H_
33 #define _OSL_PIPE_H_
35 # include <rtl/ustring.h>
38 # include <osl/security.h>
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
44 typedef enum {
45 osl_Pipe_E_None, /* no error */
46 osl_Pipe_E_NotFound, /* Pipe could not be found */
47 osl_Pipe_E_AlreadyExists, /* Pipe already exists */
48 osl_Pipe_E_NoProtocol, /* Protocol not available */
49 osl_Pipe_E_NetworkReset, /* Network dropped connection because of reset */
50 osl_Pipe_E_ConnectionAbort, /* Software caused connection abort */
51 osl_Pipe_E_ConnectionReset, /* Connection reset by peer */
52 osl_Pipe_E_NoBufferSpace, /* No buffer space available */
53 osl_Pipe_E_TimedOut, /* Connection timed out */
54 osl_Pipe_E_ConnectionRefused, /* Connection refused */
55 osl_Pipe_E_invalidError, /* unmapped error: always last entry in enum! */
56 osl_Pipe_E_FORCE_EQUAL_SIZE = SAL_MAX_ENUM
57 } oslPipeError;
59 typedef sal_uInt32 oslPipeOptions;
60 #define osl_Pipe_OPEN 0x0000 /* open existing pipe */
61 #define osl_Pipe_CREATE 0x0001 /* create pipe and open it, fails if already existst */
63 typedef struct oslPipeImpl * oslPipe;
65 /**
67 oslPipe SAL_CALL osl_createPipe(rtl_uString *strPipeName, oslPipeOptions Options, oslSecurity Security);
69 /** decreases the refcount of the pipe.
70 If the refcount drops to zero, the handle is destroyed.
72 void SAL_CALL osl_releasePipe( oslPipe );
74 /** increases the refcount of the pipe.
76 void SAL_CALL osl_acquirePipe( oslPipe Pipe );
78 /** closes the pipe, any read,write or accept actions stop immeadiatly.
80 void SAL_CALL osl_closePipe( oslPipe );
83 oslPipe SAL_CALL osl_acceptPipe(oslPipe Pipe);
85 sal_Int32 SAL_CALL osl_sendPipe(oslPipe Pipe, const void* pBuffer, sal_Int32 BufferSize);
86 sal_Int32 SAL_CALL osl_receivePipe(oslPipe Pipe, void* pBuffer, sal_Int32 BufferSize);
88 /** Reads blocking from the pipe.
89 @return Number of read bytes. If less than BufferSize, the pipe was closed.
91 sal_Int32 SAL_CALL osl_readPipe( oslPipe Pipe, void *pBuffer, sal_Int32 BufferSize );
93 /** Writes blocking onto the pipe.
94 @return Number of written bytes. If less than BufferSize, the pipe was closed.
96 sal_Int32 SAL_CALL osl_writePipe( oslPipe Pipe, const void *pBuffer, sal_Int32 BufferSize );
98 oslPipeError SAL_CALL osl_getLastPipeError(oslPipe Pipe);
100 #ifdef __cplusplus
102 #endif
104 #endif /* _OSL_PIPE_H_ */