Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 091a173aae826ca4dcb54d96ccb4ccf7ed8ac02b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*******************************************************************************
 * Copyright (c) 2000, 2009 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at 
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *     Silenio Quarti
 *******************************************************************************/

#ifndef ECLIPSE_SHM_H
#define ECLIPSE_SHM_H

/* Shared memory utilities */

/**
 * Creates and initializes a shared memory segment
 * with the specified size in bytes. The id for the
 * shared memory segment is stored in the id argument
 * and can be used from any process. It must be freed
 * with free().
 *
 * Returns 0 if success.
 */
extern int createSharedData(_TCHAR** id, int size);

/**
 * Destroy the shared memory segment specified by the
 * id argument. The id is the same as the one return
 * by createSharedData(). This function must be called
 * by the same process that created the segment.
 *
 * Returns 0 if success.
 */
extern int destroySharedData(_TCHAR* id);

/**
 * Gets a copy of the shared memory segment specified
 * by the id argument. The copy is stored in the data
 * argument as a null terminated string and must be
 * freed by free().
 *
 * Returns 0 if success.
 */
extern int getSharedData(_TCHAR* id, _TCHAR** data);

/**
 * Sets the shared memory segment specified by the id
 * argument with a null terminated string specified by
 * data.
 *
 * Returns 0 if sucess.
 */
extern int setSharedData(const _TCHAR* id, const _TCHAR* data);

#endif /* ECLIPSE_SHM_H */


Back to the top