Descent3/linux/registry.h

75 lines
1.5 KiB
C
Raw Normal View History

2024-04-16 03:43:29 +00:00
/*
2024-04-16 18:56:40 +00:00
* $Logfile: /DescentIII/Main/linux/registry.h $
* $Revision: 1.2 $
* $Date: 2004/02/09 04:14:51 $
* $Author: kevinb $
*
* Linux registry header
*
* $Log: registry.h,v $
* Revision 1.2 2004/02/09 04:14:51 kevinb
* Added newlines to all headers to reduce number of warnings printed
*
* Made some small changes to get everything compiling.
*
* All Ready to merge the 1.5 tree.
*
* Revision 1.1.1.1 2000/04/18 00:00:39 icculus
* initial checkin
*
*
2024-04-16 03:43:29 +00:00
* 4 7/14/99 9:09p Jeff
* added comment header
2024-04-16 18:56:40 +00:00
*
* $NoKeywords: $
*/
2024-04-16 03:43:29 +00:00
#ifndef __REGISTRY_H_
#define __REGISTRY_H_
2024-04-16 18:56:40 +00:00
#define MAX_RECORD_NAME 256
#define REGT_STRING 0
#define REGT_DWORD 1
2024-04-16 03:43:29 +00:00
#include <stdio.h>
2024-04-16 18:56:40 +00:00
typedef struct tRecord {
2024-04-16 03:43:29 +00:00
char name[MAX_RECORD_NAME];
char type;
void *data;
tRecord *next;
2024-04-16 18:56:40 +00:00
} tRecord;
2024-04-16 03:43:29 +00:00
2024-04-16 18:56:40 +00:00
typedef struct tKey {
2024-04-16 03:43:29 +00:00
char name[MAX_RECORD_NAME];
tKey *next;
tRecord *records;
2024-04-16 18:56:40 +00:00
} tKey;
2024-04-16 03:43:29 +00:00
2024-04-16 18:56:40 +00:00
class CRegistry {
2024-04-16 03:43:29 +00:00
public:
CRegistry(char *name);
~CRegistry();
void Export();
bool Import();
void CreateKey(char *name);
bool LookupKey(char *name);
2024-04-16 18:56:40 +00:00
bool CreateRecord(char *name, char type, void *data);
tRecord *LookupRecord(char *record, void *data);
2024-04-16 03:43:29 +00:00
int GetDataSize(char *record);
void GetSystemName(char *name);
void SetSystemName(char *name);
2024-04-16 18:56:40 +00:00
2024-04-16 03:43:29 +00:00
private:
void Destroy(void);
void DestroyKey(tKey *key);
void DestroyRecord(tRecord *record);
2024-04-16 18:56:40 +00:00
void ExportKey(tKey *key, FILE *file);
void ExportRecord(tRecord *record, FILE *file);
2024-04-16 03:43:29 +00:00
char name[MAX_RECORD_NAME];
tKey *root;
tKey *currentkey;
};
#endif