27 #define DBG_PROGNAME "OPENCBM-XUM1541.DLL"
28 #endif // #ifndef DBG_PROGNAME
41 #define OPENCBM_PLUGIN 1
44 #include "archlib-windows.h"
57 static const struct option longopts[] =
59 {
"help", no_argument, NULL,
'h' },
60 {
"version", no_argument, NULL,
'V' },
65 static const char shortopts[] =
"-hV";
67 static const char usagetext[] =
68 "\n\nUsage: instcbm [options] xum1541 [plugin-options]\n"
69 "Install the XUM1541 plugin and driver on the system, or remove it.\n"
71 "plugin-options is one of:\n"
72 " -h, --help display this help and exit\n"
73 " -V, --version display version information about cbm4win\n"
77 static opencbm_plugin_install_neededfiles_t NeededFilesXUM1541[] =
79 { SYSTEM_DIR,
"opencbm-xum1541.dll", NULL },
80 { LIST_END,
"", NULL }
88 fprintf(stderr,
"Try \"instcbm xum1541 --help\" for more information.\n");
97 printf(
"opencbm xum1541 plugin version " ", built on " __DATE__
" at " __TIME__
"\n");
107 printf(
"%s", usagetext);
143 processNumber(
const PCHAR Argument, PCHAR *NextChar, PBOOL ParameterGiven, PULONG ParameterValue)
189 *ParameterValue = strtoul(p, &p, base);
193 error = ((*p != 0) && (*p !=
',')) ? TRUE : FALSE;
197 error = *p != 0 ? TRUE : FALSE;
202 if (NextChar != NULL)
204 *NextChar = p + ((*p) ? 1 : 0);
207 if (ParameterGiven != NULL)
209 *ParameterGiven = TRUE;
231 char **localOptarg = Data->OptArg;
235 BOOL quitLocalProcessing = FALSE;
247 if (Data->Argc == 0) {
261 parameter->
OsVersion = Data->InstallParameter->OsVersion;
264 while ( ! quitLocalProcessing && (c = Data->GetoptLongCallback(Data->Argc, Data->Argv, shortopts, longopts)) != -1) {
268 Data->InstallParameter->NoExecute = TRUE;
273 Data->InstallParameter->NoExecute = TRUE;
277 quitLocalProcessing = 1;
282 fprintf(stderr,
"error...\n");
350 unsigned int size =
sizeof(NeededFilesXUM1541);
356 if (NULL == Destination) {
360 memcpy(Destination, NeededFilesXUM1541, size);
BOOL CBMAPIDECL opencbm_plugin_install_do_install(void *Context)
@@@
Define makros for debugging purposes.
The parameter which are given on the command-line.
struct CbmPluginInstallProcessCommandlineData_s CbmPluginInstallProcessCommandlineData_t
Define the IOCTL codes for the opencbm driver.
#define FUNC_LEAVE_UINT(_xxx)
struct xu1541_parameter_s xu1541_parameter_t
The parameter which are given on the command-line.
#define FUNC_LEAVE_BOOL(_xxx)
BOOL CBMAPIDECL opencbm_plugin_install_do_uninstall(void *Context)
@@@
Defining OpenCBM version.
unsigned int CBMAPIDECL opencbm_plugin_install_process_commandline(CbmPluginInstallProcessCommandlineData_t *Data)
@@@
Some functions for string handling.
unsigned int CBMAPIDECL opencbm_plugin_install_get_needed_files(CbmPluginInstallProcessCommandlineData_t *Data, opencbm_plugin_install_neededfiles_t *Destination)
@@@