Debian Codegraph @

lib/linux/lnxdatabase.h

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * Application Database for Linux version
21 *
22 * $NoKeywords: $
23 */
24
25 #ifndef LINUXDATABASE
26 #define LINUXDATABASEcxx . . $ `lib/linux/lnxdatabase.h:26:9`!
27
28 #include <stdio.h>
29 #include <stdlib.h>
30
31 class CRegistrycxx . . $ CRegistry#;
32
33 #include "Macros.h"cxx . . $ `<file>/lib/Macros.h`/
34 #include "appdatabase.h"cxx . . $ `<file>/lib/appdatabase.h`/
35
36 /* oeLnxAppDatabase
37 to get info about the application from a managed database (or a custom info file)
38 */
39
40 class oeLnxAppDatabasecxx . . $ oeLnxAppDatabase# : public oeAppDatabasecxx . . $ oeAppDatabase# {
41
42 protected:
43 CRegistrycxx . . $ CRegistry# *databasecxx . . $ oeLnxAppDatabase#database.;
44
45 public:
46 oeLnxAppDatabasecxx . . $ oeLnxAppDatabase#oeLnxAppDatabase(49f6e7a06ebc5aa8).();
47 oeLnxAppDatabasecxx . . $ oeLnxAppDatabase#oeLnxAppDatabase(7e3a78ff70dc88ae).(oeLnxAppDatabasecxx . . $ oeLnxAppDatabase# *parent);
48 virtual ~cxx . . $ oeLnxAppDatabase#`~oeLnxAppDatabase`(ced63f7c635d850d).oeLnxAppDatabasecxx . . $ oeLnxAppDatabase#();
49 CRegistrycxx . . $ CRegistry# *GetSystemRegistrycxx . . $ oeLnxAppDatabase#GetSystemRegistry(50e13c8b5aaced6c).();
50
51 // creates an empty classification or structure where you can store information
52 virtual bool create_recordcxx . . $ oeLnxAppDatabase#create_record(c5f7da30cbc0f4e9).(const char *pathname);
53
54 // set current database focus to a particular record
55 virtual bool lookup_recordcxx . . $ oeLnxAppDatabase#lookup_record(c5f7da30cbc0f4e9).(const char *pathname);
56
57 // read either an integer or string from the current record
58 virtual bool readcxx . . $ oeLnxAppDatabase#read(3bcbb53201fcdcb8).(const char *label, char *entry, int *entrylen);
59 virtual bool readcxx . . $ oeLnxAppDatabase#read(340cb0a925eda13d).(const char *label, void *entry, int wordsize); // read a variable-size int
60 virtual bool readcxx . . $ oeLnxAppDatabase#read(c1ce79fc3dc965f1).(const char *label, bool *entry);
61
62 // write either an integer or string to a record.
63 virtual bool writecxx . . $ oeLnxAppDatabase#write(f827cee075336303).(const char *label, const char *entry, int entrylen);
64 virtual bool writecxx . . $ oeLnxAppDatabase#write(2551bed5d6fc04f6).(const char *label, int entry);
65
66 // get the current user's name.
67 virtual void get_user_namecxx . . $ oeLnxAppDatabase#get_user_name(5edd826d049e7804).(char *buffer, size_t *size);
68 };
69
70 // Handy macro to read an int without having to specify the wordsize
71 #define read_intcxx . . $ `lib/linux/lnxdatabase.h:71:9`!(label, varp) read(label, varp, sizeof(*varp))
72
73 // Macro to write a string
74 #define write_stringcxx . . $ `lib/linux/lnxdatabase.h:74:9`!(label, varp) write(label, varp, strlen(varp))
75
76 #endif