btrfs: Attempt to fix GCC2 build.
[haiku.git] / src / bin / keymap / Keymap.h
blobdea03b4fcf2ed8df04a95971f5779428cc5cec40
1 /*
2 * Copyright 2004-2010, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Jérôme Duval
7 * Axel Dörfler, axeld@pinc-software.de.
8 */
9 #ifndef KEYMAP_H
10 #define KEYMAP_H
13 #include <Keymap.h>
15 #ifdef HAIKU_TARGET_PLATFORM_HAIKU
16 # include <TextView.h>
17 #endif
19 #include <stdio.h>
20 #ifndef __USE_GNU
21 # define __USE_GNU
22 #endif
23 #include <regex.h>
26 class Keymap : public BKeymap {
27 public:
28 Keymap();
29 ~Keymap();
31 status_t LoadSource(const char* name);
32 status_t LoadSource(FILE* file);
33 status_t SaveAsCurrent();
34 status_t Save(const char* name);
35 status_t SaveAsSource(const char* name);
36 status_t SaveAsSource(FILE* file);
37 status_t SaveAsCppHeader(const char* name,
38 const char* mapName);
40 status_t Use();
42 void RestoreSystemDefault();
44 static bool GetKey(const char* chars, int32 offset,
45 char* buffer, size_t bufferSize);
47 private:
48 #ifdef HAIKU_TARGET_PLATFORM_HAIKU
49 void _SaveSourceText(FILE* file,
50 text_run_array** _textRuns = NULL);
51 #else
52 void _SaveSourceText(FILE* file);
53 #endif
54 void _ComputeChars(const char* buffer,
55 struct re_registers& regs, int i,
56 int& offset);
57 void _ComputeTables(const char* buffer,
58 struct re_registers& regs, uint32& table);
61 #define KEYMAP_ERROR_UNKNOWN_VERSION (B_ERRORS_END + 1)
63 #endif // KEYMAP_H