summaryrefslogtreecommitdiff
path: root/qmake/include/private/qsharedmemory_p.h
Unidiff
Diffstat (limited to 'qmake/include/private/qsharedmemory_p.h') (more/less context) (ignore whitespace changes)
-rw-r--r--qmake/include/private/qsharedmemory_p.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/qmake/include/private/qsharedmemory_p.h b/qmake/include/private/qsharedmemory_p.h
index 4a8339d..927de89 100644
--- a/qmake/include/private/qsharedmemory_p.h
+++ b/qmake/include/private/qsharedmemory_p.h
@@ -1,84 +1,87 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$ 2** $Id$
3** 3**
4** Includes system files for shared memory 4** Includes system files for shared memory
5** 5**
6** Created : 020124 6** Created : 020124
7** 7**
8** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 8** Copyright (C) 2002 Trolltech AS. All rights reserved.
9** 9**
10** This file is part of the kernel module of the Qt GUI Toolkit. 10** This file is part of the kernel module of the Qt GUI Toolkit.
11** 11**
12** This file may be distributed and/or modified under the terms of the 12** This file may be distributed and/or modified under the terms of the
13** GNU General Public License version 2 as published by the Free Software 13** GNU General Public License version 2 as published by the Free Software
14** Foundation and appearing in the file LICENSE.GPL included in the 14** Foundation and appearing in the file LICENSE.GPL included in the
15** packaging of this file. 15** packaging of this file.
16** 16**
17** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition 17** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
18** licenses for Qt/Embedded may use this file in accordance with the 18** licenses for Qt/Embedded may use this file in accordance with the
19** Qt Embedded Commercial License Agreement provided with the Software. 19** Qt Embedded Commercial License Agreement provided with the Software.
20** 20**
21** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 21** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
22** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 22** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
23** 23**
24** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 24** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
25** information about Qt Commercial License Agreements. 25** information about Qt Commercial License Agreements.
26** See http://www.trolltech.com/gpl/ for GPL licensing information. 26** See http://www.trolltech.com/gpl/ for GPL licensing information.
27** 27**
28** Contact info@trolltech.com if any conditions of this licensing are 28** Contact info@trolltech.com if any conditions of this licensing are
29** not clear to you. 29** not clear to you.
30** 30**
31**********************************************************************/ 31**********************************************************************/
32 32
33#ifndef QSHAREDMEMORY_P_H
34#define QSHAREDMEMORY_P_H
35
33// 36//
34// W A R N I N G 37// W A R N I N G
35// ------------- 38// -------------
36// 39//
37// This file is not part of the Qt API. It exists for the convenience 40// This file is not part of the Qt API. It exists for the convenience
38// of qapplication_qws.cpp and qgfxvnc_qws.cpp. This header file may 41// of qapplication_qws.cpp and qgfxvnc_qws.cpp. This header file may
39// change from version to version without notice, or even be removed. 42// change from version to version without notice, or even be removed.
40// 43//
44// We mean it.
45//
41// 46//
42
43#if !defined(QT_QSHM_H)
44#define QT_QSHM_H
45 47
46#include <qstring.h> 48#include <qstring.h>
47 49
48#if !defined (QT_QWS_NO_SHM) 50#if !defined (QT_QWS_NO_SHM)
49 51
50#include <sys/types.h> 52#include <sys/types.h>
51#include <sys/ipc.h> 53#include <sys/ipc.h>
52 54
53class QSharedMemory { 55class QSharedMemory {
54public: 56public:
55 QSharedMemory(){}; 57 QSharedMemory(){};
56 QSharedMemory(int, QString, char c = 'Q'); 58 QSharedMemory(int, QString, char c = 'Q');
57 ~QSharedMemory(){}; 59 ~QSharedMemory(){};
58 60
59 bool create(); 61 bool create();
60 void destroy(); 62 void destroy();
61 63
62 bool attach(); 64 bool attach();
63 void detach(); 65 void detach();
64 66
65 void setPermissions(mode_t mode); 67 void setPermissions(mode_t mode);
66 int size(); 68 int size();
67 void * base() { return shmBase; }; 69 void * base() { return shmBase; };
68 70
69private: 71private:
70 void *shmBase; 72 void *shmBase;
71 int shmSize; 73 int shmSize;
72 QString shmFile; 74 QString shmFile;
73 char character; 75 char character;
74#if defined(QT_POSIX_QSHM) 76#if defined(QT_POSIX_QSHM)
75 int shmFD; 77 int shmFD;
76#else 78#else
77 int shmId; 79 int shmId;
78 key_t key; 80 key_t key;
79 int idInitted; 81 int idInitted;
80#endif 82#endif
81}; 83};
82 84
83#endif 85#endif
86
84#endif 87#endif