Descent3/mac/MACREGISTRY.H

43 lines
1015 B
C++
Raw Normal View History

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;
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;
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