1
//============================================================
3
// minimisc.c - Minimal core miscellaneous functions
5
//============================================================
7
// Copyright Aaron Giles
8
// All rights reserved.
10
// Redistribution and use in source and binary forms, with or
11
// without modification, are permitted provided that the
12
// following conditions are met:
14
// * Redistributions of source code must retain the above
15
// copyright notice, this list of conditions and the
16
// following disclaimer.
17
// * Redistributions in binary form must reproduce the
18
// above copyright notice, this list of conditions and
19
// the following disclaimer in the documentation and/or
20
// other materials provided with the distribution.
21
// * Neither the name 'MAME' nor the names of its
22
// contributors may be used to endorse or promote
23
// products derived from this software without specific
24
// prior written permission.
26
// THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND
27
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
29
// FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
30
// EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
31
// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32
// DAMAGE (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
34
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
35
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
38
// IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40
//============================================================
46
//============================================================
48
//============================================================
50
void *osd_malloc(size_t size)
56
//============================================================
58
//============================================================
60
void *osd_malloc_array(size_t size)
66
//============================================================
68
//============================================================
70
void osd_free(void *ptr)
76
//============================================================
77
// osd_alloc_executable
78
//============================================================
80
void *osd_alloc_executable(size_t size)
82
// to use this version of the code, we have to assume that
83
// code injected into a malloc'ed region can be safely executed
88
//============================================================
89
// osd_free_executable
90
//============================================================
92
void osd_free_executable(void *ptr, size_t size)
98
//============================================================
99
// osd_break_into_debugger
100
//============================================================
102
void osd_break_into_debugger(const char *message)
104
// there is no standard way to do this, so ignore it
108
//============================================================
109
// osd_get_clipboard_text
110
//============================================================
112
char *osd_get_clipboard_text(void)
114
// can't support clipboards generically
119
//============================================================
120
// osd_get_slider_list
121
//============================================================
123
const void *osd_get_slider_list()
125
// nothing to slide in mini OSD