~ubuntu-branches/ubuntu/trusty/cuneiform/trusty

« back to all changes in this revision

Viewing changes to cuneiform_src/Kern/cfio/sources/h/ctcclasses.h

  • Committer: Bazaar Package Importer
  • Author(s): Jakub Wilk, c-assert.diff, slovenian-slv.diff
  • Date: 2011-01-26 21:53:07 UTC
  • mfrom: (5.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20110126215307-62x61mcesr607qb7
Tags: 1.0.0+dfsg-2
* Upload to unstable.
* Explicitly build-depend on pkg-config. Thanks to Stefano Rivera for the
  bug report.
* Add Vcs-* fields.
* Use the standard C assert() macro, rather than custom Cuneiform one.
  [c-assert.diff]
* Pass CFLAGS, CXXFLAGS and LDFLAGS (get from dpkg-buildflags) to cmake
  (closes: #608345). Thanks to Sami Liedes for the bug report.
  + Build depend on dpkg-dev (>= 1.15.7).
* Pass --parallel to dh.
  + Bump debhelper minimum version to 7.4.10.
* Update debian/copyright to the latest DEP-5 version.
* Bump year in debian/copyright.
* Explicitly link to GraphicsMagick (rather than via the ImageMagick
  compatibility layer).
* Don't ship /usr/lib/cuneiform/*.so symlinks. These libraries are
  considered private, at least until #598616 is fixed.
* Rename some private variables in debian/rules to make them lowercase.
* Update patch headers.
* Provide proper ‘build-arch’ and ‘build-indep’ targets in debian/rules.
* Document input format in the manual page (closes: #572061). Thanks to
  Janusz S. Bień for the bug report.
* Use ‘slv’ (rather than ‘slo’) as language code for Slovenian.
  [slovenian-slv.diff]
* Fix package description: Slovenian is supported, Slovak is not.
* Improve documentation of the language (-l) option (closes: #602512).
  Thanks to Jari Aalto for the bug report.
* Install reasons file for vrms.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
Copyright (c) 1993-2008, Cognitive Technologies
3
3
All rights reserved.
4
4
 
5
 
����������� ��������� ��������������� � ������������� ��� � ���� ��������� ����,
6
 
��� � � �������� �����, � ����������� ��� ���, ��� ���������� ��������� �������:
7
 
 
8
 
      * ��� ��������� ��������������� ��������� ���� ������ ���������� ���������
9
 
        ���� ����������� �� ��������� �����, ���� ������ ������� � �����������
10
 
        ����� �� ��������.
11
 
      * ��� ��������� ��������������� ��������� ���� � ������������ �/��� �
12
 
        ������ ����������, ������������ ��� ���������������, ������ �����������
13
 
        ��������� ���� ���������� �� ��������� �����, ���� ������ ������� �
14
 
        ����������� ����� �� ��������.
15
 
      * �� �������� Cognitive Technologies, �� ����� �� ����������� �� �����
16
 
        ���� ������������ � �������� �������� ��������� �/��� �����������
17
 
        ���������, ���������� �� ���� ��, ��� ���������������� �����������
18
 
        ����������.
19
 
 
20
 
��� ��������� ������������� ����������� ��������� ���� �/��� ������� ������ "���
21
 
��� ����" ��� ������-���� ���� ��������, ���������� ���� ��� ���������������,
22
 
������� �������� ������������ �������� � ����������� ��� ���������� ����, �� ��
23
 
������������� ���. �� �������� ��������� ���� � �� ���� ������ ����, �������
24
 
����� �������� �/��� �������� �������������� ���������, �� � ���� ������ ��
25
 
��Ѩ� ���������������, ������� ����� �����, ���������, ����������� ���
26
 
������������� ������, ��������� � �������������� ��� ���������� ����������
27
 
������������� ������������� ��������� (������� ������ ������, ��� ������,
28
 
������� ���������, ��� ������ �/��� ������ �������, ���������� ��-�� ��������
29
 
������� ��� �/��� ������ ��������� �������� ��������� � ������� �����������,
30
 
�� �� ������������� ����� ��������), �� �� ������������� ���, ���� ���� �����
31
 
�������� ��� ������ ���� ���� �������� � ����������� ����� ������� � ������.
 
5
Разрешается повторное распространение и использование как в виде исходного кода,
 
6
так и в двоичной форме, с изменениями или без, при соблюдении следующих условий:
 
7
 
 
8
      * При повторном распространении исходного кода должны оставаться указанное
 
9
        выше уведомление об авторском праве, этот список условий и последующий
 
10
        отказ от гарантий.
 
11
      * При повторном распространении двоичного кода в документации и/или в
 
12
        других материалах, поставляемых при распространении, должны сохраняться
 
13
        указанная выше информация об авторском праве, этот список условий и
 
14
        последующий отказ от гарантий.
 
15
      * Ни название Cognitive Technologies, ни имена ее сотрудников не могут
 
16
        быть использованы в качестве средства поддержки и/или продвижения
 
17
        продуктов, основанных на этом ПО, без предварительного письменного
 
18
        разрешения.
 
19
 
 
20
ЭТА ПРОГРАММА ПРЕДОСТАВЛЕНА ВЛАДЕЛЬЦАМИ АВТОРСКИХ ПРАВ И/ИЛИ ДРУГИМИ ЛИЦАМИ "КАК
 
21
ОНА ЕСТЬ" БЕЗ КАКОГО-ЛИБО ВИДА ГАРАНТИЙ, ВЫРАЖЕННЫХ ЯВНО ИЛИ ПОДРАЗУМЕВАЕМЫХ,
 
22
ВКЛЮЧАЯ ГАРАНТИИ КОММЕРЧЕСКОЙ ЦЕННОСТИ И ПРИГОДНОСТИ ДЛЯ КОНКРЕТНОЙ ЦЕЛИ, НО НЕ
 
23
ОГРАНИЧИВАЯСЬ ИМИ. НИ ВЛАДЕЛЕЦ АВТОРСКИХ ПРАВ И НИ ОДНО ДРУГОЕ ЛИЦО, КОТОРОЕ
 
24
МОЖЕТ ИЗМЕНЯТЬ И/ИЛИ ПОВТОРНО РАСПРОСТРАНЯТЬ ПРОГРАММУ, НИ В КОЕМ СЛУЧАЕ НЕ
 
25
НЕСЁТ ОТВЕТСТВЕННОСТИ, ВКЛЮЧАЯ ЛЮБЫЕ ОБЩИЕ, СЛУЧАЙНЫЕ, СПЕЦИАЛЬНЫЕ ИЛИ
 
26
ПОСЛЕДОВАВШИЕ УБЫТКИ, СВЯЗАННЫЕ С ИСПОЛЬЗОВАНИЕМ ИЛИ ПОНЕСЕННЫЕ ВСЛЕДСТВИЕ
 
27
НЕВОЗМОЖНОСТИ ИСПОЛЬЗОВАНИЯ ПРОГРАММЫ (ВКЛЮЧАЯ ПОТЕРИ ДАННЫХ, ИЛИ ДАННЫЕ,
 
28
СТАВШИЕ НЕГОДНЫМИ, ИЛИ УБЫТКИ И/ИЛИ ПОТЕРИ ДОХОДОВ, ПОНЕСЕННЫЕ ИЗ-ЗА ДЕЙСТВИЙ
 
29
ТРЕТЬИХ ЛИЦ И/ИЛИ ОТКАЗА ПРОГРАММЫ РАБОТАТЬ СОВМЕСТНО С ДРУГИМИ ПРОГРАММАМИ,
 
30
НО НЕ ОГРАНИЧИВАЯСЬ ЭТИМИ СЛУЧАЯМИ), НО НЕ ОГРАНИЧИВАЯСЬ ИМИ, ДАЖЕ ЕСЛИ ТАКОЙ
 
31
ВЛАДЕЛЕЦ ИЛИ ДРУГОЕ ЛИЦО БЫЛИ ИЗВЕЩЕНЫ О ВОЗМОЖНОСТИ ТАКИХ УБЫТКОВ И ПОТЕРЬ.
32
32
 
33
33
Redistribution and use in source and binary forms, with or without modification,
34
34
are permitted provided that the following conditions are met:
92
92
{
93
93
public:
94
94
        CTCMemoryHeader();
95
 
        CTCMemoryHeader(Handle hMemory, Word32 wBlockSize);
 
95
        CTCMemoryHeader(Handle hMemory, uint32_t wBlockSize);
96
96
        ~CTCMemoryHeader();
97
 
        PChar8 GetOwner(void) { return mcOwner; };
98
 
        PChar8 GetComment(void) { return mcComment; };
 
97
        char* GetOwner(void) { return mcOwner; };
 
98
        char* GetComment(void) { return mcComment; };
99
99
 
100
100
public:
101
 
        CTCMemoryHeader(Handle hMemory, Word32 wBlockSize, const char *OwnerName, const char *Commentary);
 
101
        CTCMemoryHeader(Handle hMemory, uint32_t wBlockSize, const char *OwnerName, const char *Commentary);
102
102
        CTCMemoryHeader * GetNext()    { return (CTCMemoryHeader *)(CTCGlobalHeader::GetNext()); };
103
103
private:
104
 
        Char8 mcComment[CFIO_MAX_COMMENT];
105
 
        Char8 mcOwner[CFIO_MAX_OWNER];
 
104
        char mcComment[CFIO_MAX_COMMENT];
 
105
        char mcOwner[CFIO_MAX_OWNER];
106
106
};
107
107
 
108
108
typedef CTCMemoryHeader *PCTCMemoryHeader, **PPCTCMemoryHeader;
128
128
private:
129
129
        CTCGlobalFile *      pFile;
130
130
        Handle               hStorage;
131
 
        Word32               wFlag;
 
131
        uint32_t               wFlag;
132
132
        Bool32 KeepFileName;
133
133
 
134
134
public:
136
136
        Bool32 LockToStorage(void);
137
137
        CTCFileHeader();
138
138
        CTCFileHeader(CTCGlobalFile * pNewFile,
139
 
                          Word32 Flag =CFIO_FILE_READ|CFIO_FILE_WRITE,
 
139
                          uint32_t Flag =CFIO_FILE_READ|CFIO_FILE_WRITE,
140
140
                                  Handle hStorage = NULL);
141
141
        ~CTCFileHeader();
142
142
 
156
156
 
157
157
};
158
158
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
159
 
//   ������ ����� ������ ��� ����������� ������ ���������� � ���������
160
 
// ������. � �������� ������������ ��� ������ ���������, ��� ��������
161
 
// ���������� ��������� � ����� ������ � ��� ��������� � �������������!
 
159
//   Данный класс служит для составления списка сохраненых в хранилище
 
160
// файлов. в основном используется при записи хранилища, при открытии
 
161
// созданного хранилища к концу работы с ним нуждается в корректировке!
162
162
/*
163
163
class  CTCStorageContents
164
164
{
165
165
private:
166
 
        Word32               wContentsSize;
 
166
        uint32_t               wContentsSize;
167
167
        CTCStorageContents * pNext;
168
168
        Handle               hItem;
169
 
        Word32               wItemID;
170
 
        Word32               wItemSize;
 
169
        uint32_t               wItemID;
 
170
        uint32_t               wItemSize;
171
171
 
172
172
public:
173
173
        CTCStorageContents():wItemID(3),wItemSize(0),wContentsSize( sizeof ( class CTCStorageContents))
174
174
        {pNext = NULL; hItem = NULL;};
175
 
        CTCStorageContents(Handle H, Word32 ID = 0, Word32 Size = 0, CTCStorageContents * Next = NULL): wItemID(ID),wItemSize(Size),wContentsSize( sizeof ( class CTCStorageContents) )
 
175
        CTCStorageContents(Handle H, uint32_t ID = 0, uint32_t Size = 0, CTCStorageContents * Next = NULL): wItemID(ID),wItemSize(Size),wContentsSize( sizeof ( class CTCStorageContents) )
176
176
        { hItem = H;  pNext = Next;};
177
177
        ~CTCStorageContents() {};
178
178
 
179
179
public:
180
180
        Handle       GetHandle() { return hItem; };
181
 
        Word32       GetID()     { return wItemID; };
182
 
    Word32       GetSize()   { return wItemSize; };
183
 
        Word32       GetContentsSize() { return wContentsSize; };
 
181
        uint32_t       GetID()     { return wItemID; };
 
182
    uint32_t       GetSize()   { return wItemSize; };
 
183
        uint32_t       GetContentsSize() { return wContentsSize; };
184
184
        CTCStorageContents * GetNext() { return pNext; };
185
185
 
186
186
public:
187
187
        Bool32     DeleteItemFromStorage(Handle Item);
188
188
        void       SetHandle(Handle Item) { hItem = Item; };
189
 
        void       SetID(Word32 ID)     { wItemID = ID; };
190
 
    void       SetSize(Word32 Size)   { wItemSize = Size; };
 
189
        void       SetID(uint32_t ID)     { wItemID = ID; };
 
190
    void       SetSize(uint32_t Size)   { wItemSize = Size; };
191
191
        void       SetNext(CTCStorageContents * Next) {  pNext = Next; };
192
192
};
193
193
*/
194
194
typedef struct
195
195
{
196
 
        Word32    siHeaderSize;
197
 
        Word32    siItemSize;
198
 
        Word32    siFlag;
 
196
        uint32_t    siHeaderSize;
 
197
        uint32_t    siItemSize;
 
198
        uint32_t    siFlag;
199
199
        char      siName[CFIO_MAX_PATH];
200
200
}   STORAGEITEM;
201
201
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
207
207
        char                 pcName[CFIO_MAX_PATH];
208
208
        char                 pcFolder[CFIO_MAX_PATH];
209
209
//      CTCStorageContents   Contents;
210
 
        Word32               wContensCounter;
 
210
        uint32_t               wContensCounter;
211
211
 
212
212
//private:
213
213
 
214
214
public:
215
215
        CTCStorageHeader();
216
216
        CTCStorageHeader( CTCGlobalFile * pNewStorage,
217
 
                          Word32 Flag = CFIO_FILE_READ|CFIO_FILE_WRITE,
 
217
                          uint32_t Flag = CFIO_FILE_READ|CFIO_FILE_WRITE,
218
218
                                          const char* pcNewStorageFolder = NULL );
219
219
        ~CTCStorageHeader();
220
220
 
221
221
public:
222
222
        CTCStorageHeader * GetNext(void) { return (CTCStorageHeader *)(CTCGlobalHeader::GetNext()); };
223
223
        CTCGlobalFile *    GetStorageFile(void) { return pStorageFile; };
224
 
        Word32             IncreaseContentsCounter() { return ++wContensCounter; };
225
 
        Word32             DecreaseContentsCounter() { return --wContensCounter; };
 
224
        uint32_t             IncreaseContentsCounter() { return ++wContensCounter; };
 
225
        uint32_t             DecreaseContentsCounter() { return --wContensCounter; };
226
226
        CTCGlobalFile *    GetStorage() { return pStorageFile; };
227
 
        PChar8             GetStorageFolder() { return pcFolder; };
 
227
        char*             GetStorageFolder() { return pcFolder; };
228
228
//      Handle             EnumItemContents(Handle Item = NULL);
229
229
//      Bool32             DeleteItemFromStorage(Handle Item);
230
 
//      Bool32             AddItemToStorage(Handle hNewItem, Word32 wID = 0, Word32 wNewSize = 0);
 
230
//      Bool32             AddItemToStorage(Handle hNewItem, uint32_t wID = 0, uint32_t wNewSize = 0);
231
231
 
232
232
private:
233
233
        Handle             AcceptFile(CTCGlobalFile * File) { return (pStorageFile = File)->GetFileHandle(); };
241
241
class CTCMemoryList
242
242
{
243
243
private:
244
 
        Word32               wListSize;
 
244
        uint32_t               wListSize;
245
245
        CTCMemoryHeader      mhFirstItem;
246
246
    CTCMemoryHeader      mhLastItem;
247
 
        Word32               wMemoryCounter;
248
 
        Word32               wItemCounter;
 
247
        uint32_t               wMemoryCounter;
 
248
        uint32_t               wItemCounter;
249
249
 
250
250
public:
251
251
        CTCMemoryList();
252
252
        ~CTCMemoryList();
253
253
 
254
254
public:
255
 
        Bool32 AddItem(Handle hMemory, Word32 wSize, Word32 wIsGlobal, const char *cOwner, const char *Coment);
 
255
        Bool32 AddItem(Handle hMemory, uint32_t wSize, uint32_t wIsGlobal, const char *cOwner, const char *Coment);
256
256
        CTCMemoryHeader * GetItem(Handle hMemory);
257
257
        Bool32 LockUnlockItem(Handle hMemory, Bool32 bLock);
258
 
        Bool32 TakeItem(Handle hMemory, Word32 * wSize, Word32 * wFlag);
259
 
        Bool32 DeleteItem(Handle hMemory, Word32 wParam = 0x0);
 
258
        Bool32 TakeItem(Handle hMemory, uint32_t * wSize, uint32_t * wFlag);
 
259
        Bool32 DeleteItem(Handle hMemory, uint32_t wParam = 0x0);
260
260
 
261
261
private:
262
262
        Bool32 KillItem(PCTCMemoryHeader pItem, PCTCMemoryHeader pPrevItem);
263
263
        CTCMemoryHeader * pFirst();
264
264
        CTCMemoryHeader * pLast();
265
 
        Word32 IncreaseMemoryCounter(Word32 wSize);
266
 
        Word32 DecreaseMemoryCounter(Word32 wSize);
 
265
        uint32_t IncreaseMemoryCounter(uint32_t wSize);
 
266
        uint32_t DecreaseMemoryCounter(uint32_t wSize);
267
267
};
268
268
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
269
269
//
270
270
class CTCFileList
271
271
{
272
272
private:
273
 
        Word32               wListSize;
 
273
        uint32_t               wListSize;
274
274
        CTCStorageHeader *   pList;
275
 
        Word32               wFileCounter;
276
 
        Word32               wSpaceCounter;
 
275
        uint32_t               wFileCounter;
 
276
        uint32_t               wSpaceCounter;
277
277
        CTCFileHeader        mfFirstItem;
278
278
        CTCFileHeader        mfLastItem;
279
279
 
280
280
public:
281
 
        Handle FindFile(PChar8 lpFileName);
 
281
        Handle FindFile(char* lpFileName);
282
282
        CTCFileList();
283
283
        ~CTCFileList();
284
284
 
285
285
public:
286
 
        Handle              AddItem(CTCGlobalFile * pNewFile, Word32 wNewFlag, Handle Storage);
287
 
        Bool32              DeleteItem(Handle File, Word32 Flag = 0);
 
286
        Handle              AddItem(CTCGlobalFile * pNewFile, uint32_t wNewFlag, Handle Storage);
 
287
        Bool32              DeleteItem(Handle File, uint32_t Flag = 0);
288
288
        Handle              GetAttachedFileHeader(Handle Storage, CTCFileHeader * File = NULL);
289
289
        CTCFileHeader *     GetItemHeader(Handle File);
290
290
        CTCGlobalFile *     GetItem(Handle File);
292
292
private:
293
293
        CTCFileHeader *     pLast() { return &mfLastItem; };
294
294
        CTCFileHeader *     pFirst() { return &mfFirstItem; };
295
 
        Word32              IncreaseFileCounter(void)    { return ++wFileCounter; }
296
 
        Word32              DecreaseFileCounter(void)    { return --wFileCounter; }
297
 
        Word32              IncreaseSpaceCounter(void)   { return ++wSpaceCounter; }
298
 
        Word32              DecreaseSpaceCounter(void)   { return --wSpaceCounter; }
 
295
        uint32_t              IncreaseFileCounter(void)    { return ++wFileCounter; }
 
296
        uint32_t              DecreaseFileCounter(void)    { return --wFileCounter; }
 
297
        uint32_t              IncreaseSpaceCounter(void)   { return ++wSpaceCounter; }
 
298
        uint32_t              DecreaseSpaceCounter(void)   { return --wSpaceCounter; }
299
299
};
300
300
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
301
301
//
302
302
class CTCStorageList
303
303
{
304
304
private:
305
 
        Word32               wHeaderSize;
 
305
        uint32_t               wHeaderSize;
306
306
        CTCStorageHeader     msFirstItem;
307
307
        CTCStorageHeader     msLastItem;
308
308
        CTCStorageHeader   * pList;
309
 
        Word32               wItemCounter;
 
309
        uint32_t               wItemCounter;
310
310
 
311
311
public:
312
 
        Handle FindStorage(PChar8 lpName);
 
312
        Handle FindStorage(char* lpName);
313
313
        CTCStorageList();
314
314
        ~CTCStorageList();
315
315
 
316
316
public:
317
 
        Handle             AddItem(CTCGlobalFile * NewStorage, Word32 wParametr);
318
 
        Bool32             DeleteItem(Handle Storage, Word32 Flag = 0);
 
317
        Handle             AddItem(CTCGlobalFile * NewStorage, uint32_t wParametr);
 
318
        Bool32             DeleteItem(Handle Storage, uint32_t Flag = 0);
319
319
        CTCGlobalFile *    GetItem(Handle Storage);
320
320
        CTCStorageHeader * GetFirstItemHeader() { return pFirst()->GetNext(); };
321
321
        CTCStorageHeader * GetItemHeader(Handle Storage);
324
324
private:
325
325
        CTCStorageHeader * pFirst(void) { return &msFirstItem; };
326
326
        CTCStorageHeader * pLast(void) { return &msLastItem; };
327
 
        Word32 IncreaseItemCounter(void) { return ++wItemCounter; };
328
 
        Word32 DecreaseItemCounter(void) { return --wItemCounter; };
329
 
        Word32 HowItems(void) { return wItemCounter; };
 
327
        uint32_t IncreaseItemCounter(void) { return ++wItemCounter; };
 
328
        uint32_t DecreaseItemCounter(void) { return --wItemCounter; };
 
329
        uint32_t HowItems(void) { return wItemCounter; };
330
330
};
331
331
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
332
332
//