~ubuntu-branches/ubuntu/lucid/fceux/lucid

« back to all changes in this revision

Viewing changes to fceu/src/drivers/common/config.h

  • Committer: Bazaar Package Importer
  • Author(s): Fabrice Coutadeur
  • Date: 2009-12-14 08:05:17 UTC
  • Revision ID: james.westby@ubuntu.com-20091214080517-abi5tj8avthfan7c
Tags: upstream-2.1.2+repack
ImportĀ upstreamĀ versionĀ 2.1.2+repack

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _DRIVERS_CONFIGH
 
2
typedef struct {
 
3
        char *name;
 
4
        void *ptr;
 
5
        int len;
 
6
} CFGSTRUCT;
 
7
 
 
8
void SaveFCEUConfig(const char *filename, const CFGSTRUCT *cfgst);
 
9
void LoadFCEUConfig(const char *filename, CFGSTRUCT *cfgst);
 
10
 
 
11
//Macros for building CFGSTRUCT structures.
 
12
 
 
13
// CFGSTRUCT structures must always end with ENDCFGSTRUCT
 
14
#define ENDCFGSTRUCT    { 0,0,0 }
 
15
 
 
16
 //When this macro is used, the config loading/saving code will parse
 
17
 //the new config structure until the end of it is detected, then it
 
18
 //will continue parsing the original config structure.
 
19
#define ADDCFGSTRUCT(x) { 0,&x,0 }
 
20
 
 
21
// Oops.  The NAC* macros shouldn't have the # in front of the w, but
 
22
// fixing this would break configuration files of previous versions and it 
 
23
// isn't really hurting much.
 
24
 
 
25
// Single piece of data(integer).
 
26
#define AC(x)   { #x,&x,sizeof(x)}
 
27
#define NAC(w,x) { #w,&x,sizeof(x)}
 
28
 
 
29
// Array.
 
30
#define ACA(x)   {#x,x,sizeof(x)}
 
31
#define NACA(w,x) {#w,x,sizeof(x)}
 
32
 
 
33
// String(pointer) with automatic memory allocation.
 
34
#define ACS(x)  {#x,&x,0}
 
35
#define NACS(w,x)  {#w,&x,0}
 
36
 
 
37
#define _DRIVERS_CONFIGH
 
38
#endif