]> git.sur5r.net Git - cc65/blob - src/sim65/simdata.h
Working
[cc65] / src / sim65 / simdata.h
1 /*****************************************************************************/
2 /*                                                                           */
3 /*                                 simdata.h                                 */
4 /*                                                                           */
5 /*                 Simulator data passed to the chip plugins                 */
6 /*                                                                           */
7 /*                                                                           */
8 /*                                                                           */
9 /* (C) 2002      Ullrich von Bassewitz                                       */
10 /*               Wacholderweg 14                                             */
11 /*               D-70597 Stuttgart                                           */
12 /* EMail:        uz@musoftware.de                                            */
13 /*                                                                           */
14 /*                                                                           */
15 /* This software is provided 'as-is', without any expressed or implied       */
16 /* warranty.  In no event will the authors be held liable for any damages    */
17 /* arising from the use of this software.                                    */
18 /*                                                                           */
19 /* Permission is granted to anyone to use this software for any purpose,     */
20 /* including commercial applications, and to alter it and redistribute it    */
21 /* freely, subject to the following restrictions:                            */
22 /*                                                                           */
23 /* 1. The origin of this software must not be misrepresented; you must not   */
24 /*    claim that you wrote the original software. If you use this software   */
25 /*    in a product, an acknowledgment in the product documentation would be  */
26 /*    appreciated but is not required.                                       */
27 /* 2. Altered source versions must be plainly marked as such, and must not   */
28 /*    be misrepresented as being the original software.                      */
29 /* 3. This notice may not be removed or altered from any source              */
30 /*    distribution.                                                          */
31 /*                                                                           */
32 /*****************************************************************************/
33
34
35
36 #ifndef SIMDATA_H
37 #define SIMDATA_H
38
39
40
41 /*****************************************************************************/
42 /*                                     Data                                  */
43 /*****************************************************************************/
44
45
46
47 /* SimData structure */
48 typedef struct SimData SimData;
49 struct SimData {
50     unsigned    MajorVersion;
51     unsigned    MinorVersion;
52
53     /* -- Callback functions -- */
54
55     void* (*Malloc) (size_t Size);
56     /* Allocate a memory block of the given size */
57
58     void (*Free) (void* Block);
59     /* Free an allocated memory block */
60
61     void (*Warning) (const char* Format, ...);
62     /* Print a warning */
63
64     void (*Error) (const char* Format, ...);
65     /* Print an error and terminate the program */
66
67     void (*Internal) (const char* Format, ...);
68     /* Print an internal program error and terminate */
69
70     void (*Break) (const char* Format, ...);
71     /* Stop the CPU and display the given message */
72
73     int (*GetCfgId) (void* CfgInfo, const char* Name, char** Id);
74     /* Search CfgInfo for an attribute with the given name and type "id". If
75      * found, remove it from the configuration, pass a pointer to a dynamically
76      * allocated string containing the value to Id, and return true. If not
77      * found, return false. The memory passed in Id must be free by a call to
78      * Free();
79      */
80
81     int (*GetCfgStr) (void* CfgInfo, const char* Name, char** S);
82     /* Search CfgInfo for an attribute with the given name and type "string".
83      * If found, remove it from the configuration, pass a pointer to a
84      * dynamically allocated string containing the value to S, and return
85      * true. If not found, return false. The memory passed in S must be free
86      * by a call to Free();
87      */
88
89     int (*GetCfgNum) (void* CfgInfo, const char* Name, long* Val);
90     /* Search CfgInfo for an attribute with the given name and type "number".
91      * If found, remove it from the configuration, copy it into Val and return
92      * true. If not found, return false.
93      */
94 };
95
96
97
98 /* End of simdata.h */
99
100 #endif
101
102
103