1 /* Copyright 2007-2012 Fredrik Wikstrom. All rights reserved.
3 ** Redistribution and use in source and binary forms, with or without
4 ** modification, are permitted provided that the following conditions
7 ** 1. Redistributions of source code must retain the above copyright
8 ** notice, this list of conditions and the following disclaimer.
10 ** 2. Redistributions in binary form must reproduce the above copyright
11 ** notice, this list of conditions and the following disclaimer in the
12 ** documentation and/or other materials provided with the distribution.
14 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
15 ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 ** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
18 ** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19 ** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20 ** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21 ** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22 ** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23 ** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24 ** POSSIBILITY OF SUCH DAMAGE.
27 #ifndef INTERFACES_DIPLUGIN_H
28 #define INTERFACES_DIPLUGIN_H
30 #include <SDI_compiler.h>
32 struct InterfaceData
{
33 struct Library
*LibBase
;
37 struct DIPluginIFace
{
38 struct InterfaceData Data
;
39 LONG (*DOS2IOErr
)(struct DIPluginIFace
*Self
, LONG error
);
40 APTR (*OpenImage
)(struct DIPluginIFace
*Self
, APTR unit
, BPTR file
, CONST_STRPTR name
);
41 LONG (*CreateTempFile
)(struct DIPluginIFace
*Self
, APTR unit
, CONST_STRPTR ext
,
42 BPTR
*tmpdir
, CONST_STRPTR
*tmpname
);
43 BPTR (*OpenTempFile
)(struct DIPluginIFace
*Self
, APTR unit
, ULONG mode
);
44 void (*RemoveTempFile
)(struct DIPluginIFace
*Self
, APTR unit
);
45 STRPTR (*RequestPassword
)(struct DIPluginIFace
*Self
, APTR unit
);
46 APTR (*CreateProgressBar
)(struct DIPluginIFace
*Self
, APTR unit
, BOOL stop
);
47 void (*DeleteProgressBar
)(struct DIPluginIFace
*Self
, APTR bar
);
48 BOOL (*ProgressBarInput
)(struct DIPluginIFace
*Self
, APTR bar
);
49 void (*SetProgressBarAttrsA
)(struct DIPluginIFace
*Self
, APTR bar
, const struct TagItem
*tags
);
50 VARARGS68K
void (*SetProgressBarAttrs
)(struct DIPluginIFace
*Self
, APTR bar
, ...);
51 void (*SetDiskImageErrorA
)(struct DIPluginIFace
*Self
, APTR unit
, LONG error
, LONG error_string
, CONST_APTR error_args
);
52 VARARGS68K
void (*SetDiskImageError
)(struct DIPluginIFace
*Self
, APTR unit
, LONG error
, LONG error_string
, ...);
55 #define IPlugin_DOS2IOErr(a) IPlugin->DOS2IOErr(IPlugin,a)
56 #define IPlugin_OpenImage(a,b,c) IPlugin->OpenImage(IPlugin,a,b,c)
57 #define IPlugin_CreateTempFile(a,b,c,d) IPlugin->CreateTempFile(IPlugin,a,b,c,d)
58 #define IPlugin_OpenTempFile(a,b) IPlugin->OpenTempFile(IPlugin,a,b)
59 #define IPlugin_RemoveTempFile(a) IPlugin->RemoveTempFile(IPlugin,a)
60 #define IPlugin_RequestPassword(a) IPlugin->RequestPassword(IPlugin,a)
61 #define IPlugin_CreateProgressBar(a,b) IPlugin->CreateProgressBar(IPlugin,a,b)
62 #define IPlugin_DeleteProgressBar(a) IPlugin->DeleteProgressBar(IPlugin,a)
63 #define IPlugin_ProgressBarInput(a) IPlugin->ProgressBarInput(IPlugin,a)
64 #define IPlugin_SetProgressBarAttrsA(a,b) IPlugin->SetProgressBarAttrsA(IPlugin,a,b)
65 #define IPlugin_SetProgressBarAttrs(a,...) IPlugin->SetProgressBarAttrs(IPlugin,a,__VA_ARGS__)
66 #define IPlugin_SetDiskImageErrorA(a,b,c,d) IPlugin->SetDiskImageErrorA(IPlugin,a,b,c,d)
67 #define IPlugin_SetDiskImageError(a,b,...) IPlugin->SetDiskImageError(IPlugin,a,b,__VA_ARGS__)