1 /***************************************************************************
2 * *
3 * LIBDSK: General floppy and diskimage access library *
4 * Copyright (C) 2003 John Elliott <seasip.webmaster@gmail.com> *
5 * *
6 * This library is free software; you can redistribute it and/or *
7 * modify it under the terms of the GNU Library General Public *
8 * License as published by the Free Software Foundation; either *
9 * version 2 of the License, or (at your option) any later version. *
10 * *
11 * This library is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14 * Library General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Library General Public *
17 * License along with this library; if not, write to the Free *
18 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, *
19 * MA 02111-1307, USA *
20 * *
21 ***************************************************************************/
22
23 #include "drvi.h"
24
25
26 static DSK_REPORTFUNC st_repfunc;
27 static DSK_REPORTEND st_repend;
28
29 /* Register callbacks for LibDsk functions to display information on the
30 * * screen. */
dsk_reportfunc_set(DSK_REPORTFUNC report,DSK_REPORTEND repend)31 LDPUBLIC32 void LDPUBLIC16 dsk_reportfunc_set(DSK_REPORTFUNC report,
32 DSK_REPORTEND repend)
33 {
34 st_repfunc = report;
35 st_repend = repend;
36 }
37
38
39 /* Retrieve the values of the callbacks */
dsk_reportfunc_get(DSK_REPORTFUNC * report,DSK_REPORTEND * repend)40 LDPUBLIC32 void LDPUBLIC16 dsk_reportfunc_get(DSK_REPORTFUNC *report,
41 DSK_REPORTEND *repend)
42 {
43 if (report) *report = st_repfunc;
44 if (repend) *repend = st_repend;
45 }
46
47
dsk_report(const char * s)48 LDPUBLIC32 void LDPUBLIC16 dsk_report(const char *s)
49 {
50 if (st_repfunc) (*st_repfunc)(s);
51 }
52
53
dsk_report_end()54 LDPUBLIC32 void LDPUBLIC16 dsk_report_end()
55 {
56 if (st_repend) (*st_repend)();
57 }
58
59