LibreOffice
LibreOffice 5.3 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pipe.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 
21 #ifndef INCLUDED_OSL_PIPE_H
22 #define INCLUDED_OSL_PIPE_H
23 
24 #include <sal/config.h>
25 
26 #include <osl/security.h>
27 #include <rtl/ustring.h>
28 #include <sal/saldllapi.h>
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 typedef enum {
35  osl_Pipe_E_None, /* no error */
36  osl_Pipe_E_NotFound, /* Pipe could not be found */
37  osl_Pipe_E_AlreadyExists, /* Pipe already exists */
38  osl_Pipe_E_NoProtocol, /* Protocol not available */
39  osl_Pipe_E_NetworkReset, /* Network dropped connection because of reset */
40  osl_Pipe_E_ConnectionAbort, /* Software caused connection abort */
41  osl_Pipe_E_ConnectionReset, /* Connection reset by peer */
42  osl_Pipe_E_NoBufferSpace, /* No buffer space available */
43  osl_Pipe_E_TimedOut, /* Connection timed out */
44  osl_Pipe_E_ConnectionRefused, /* Connection refused */
45  osl_Pipe_E_invalidError, /* unmapped error: always last entry in enum! */
47 } oslPipeError;
48 
49 typedef sal_uInt32 oslPipeOptions;
50 #define osl_Pipe_OPEN 0x0000 /* open existing pipe */
51 #define osl_Pipe_CREATE 0x0001 /* create pipe and open it, fails if already exists */
52 
53 typedef struct oslPipeImpl * oslPipe;
54 
57 SAL_DLLPUBLIC oslPipe SAL_CALL osl_createPipe(
58  rtl_uString *strPipeName, oslPipeOptions Options, oslSecurity Security);
59 
63 SAL_DLLPUBLIC void SAL_CALL osl_releasePipe( oslPipe );
64 
67 SAL_DLLPUBLIC void SAL_CALL osl_acquirePipe( oslPipe Pipe );
68 
71 SAL_DLLPUBLIC void SAL_CALL osl_closePipe( oslPipe );
72 
73 
74 SAL_DLLPUBLIC oslPipe SAL_CALL osl_acceptPipe(oslPipe Pipe);
75 
76 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_sendPipe(oslPipe Pipe, const void* pBuffer, sal_Int32 BufferSize);
77 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_receivePipe(oslPipe Pipe, void* pBuffer, sal_Int32 BufferSize);
78 
82 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_readPipe( oslPipe Pipe, void *pBuffer, sal_Int32 BufferSize );
83 
87 SAL_DLLPUBLIC sal_Int32 SAL_CALL osl_writePipe( oslPipe Pipe, const void *pBuffer, sal_Int32 BufferSize );
88 
89 SAL_DLLPUBLIC oslPipeError SAL_CALL osl_getLastPipeError(oslPipe Pipe);
90 
91 #ifdef __cplusplus
92 }
93 #endif
94 
95 #endif // INCLUDED_OSL_PIPE_H
96 
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Definition: pipe.h:45
SAL_DLLPUBLIC oslPipeError osl_getLastPipeError(oslPipe Pipe)
Definition: pipe.h:42
SAL_DLLPUBLIC void osl_acquirePipe(oslPipe Pipe)
increases the refcount of the pipe.
#define SAL_DLLPUBLIC
Definition: saldllapi.h:30
Definition: pipe.h:46
Definition: pipe.h:37
oslPipeError
Definition: pipe.h:34
Definition: pipe.h:40
Definition: pipe.h:41
#define SAL_MAX_ENUM
Definition: types.h:242
sal_uInt32 oslPipeOptions
Definition: pipe.h:49
Definition: pipe.h:35
SAL_DLLPUBLIC oslPipe osl_acceptPipe(oslPipe Pipe)
Definition: pipe.h:39
SAL_DLLPUBLIC oslPipe osl_createPipe(rtl_uString *strPipeName, oslPipeOptions Options, oslSecurity Security)
SAL_DLLPUBLIC sal_Int32 osl_writePipe(oslPipe Pipe, const void *pBuffer, sal_Int32 BufferSize)
Writes blocking onto the pipe.
SAL_DLLPUBLIC void osl_releasePipe(oslPipe)
decreases the refcount of the pipe.
SAL_DLLPUBLIC sal_Int32 osl_sendPipe(oslPipe Pipe, const void *pBuffer, sal_Int32 BufferSize)
Definition: pipe.h:36
SAL_DLLPUBLIC void osl_closePipe(oslPipe)
closes the pipe, any read,write or accept actions stop immeadiatly.
Definition: pipe.h:44
SAL_DLLPUBLIC sal_Int32 osl_receivePipe(oslPipe Pipe, void *pBuffer, sal_Int32 BufferSize)
Definition: pipe.h:38
Definition: pipe.h:43
void * oslSecurity
Process handle.
Definition: security.h:45
SAL_DLLPUBLIC sal_Int32 osl_readPipe(oslPipe Pipe, void *pBuffer, sal_Int32 BufferSize)
Reads blocking from the pipe.
struct oslPipeImpl * oslPipe
Definition: pipe.h:53