OpenCBM
opencbm-plugin-install.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version
5  * 2 of the License, or (at your option) any later version.
6  *
7  * Copyright 2008-2009, 2011, 2014 Spiro Trikaliotis
8  */
9 
18 #ifndef OPENCBM_PLUGIN_INSTALL_H
19 #define OPENCBM_PLUGIN_INSTALL_H
20 
21 #include "opencbm-plugin.h"
22 
23 #ifdef WIN32
24  /*
25  * special functions for installing on Windows
26  * These functions are not used in the normal process, only for installation.
27  * Thus, they are missing in opencbm_plugin_s and opencbm_plugin_t.
28  */
29 
30  // int (*p_opencbm_install_getopt)(int argc, char * const argv[], const char *optstring);
31 
32 
33 
46  typedef int CBMAPIDECL opencbm_plugin_install_getopt_long_callback_t(int Argc, char * const Argv[], const char *Optstring, const struct option *Longopts);
47 
49  typedef
50  enum osversion_e
51  {
52  WINUNSUPPORTED,
53  WINNT3,
54  WINNT4,
55  WIN2000,
56  WINXP,
57  WINVISTA,
58  WIN7,
59  WIN8,
60  WIN8_1,
61  WINNEWER
62  } osversion_t;
63 
65  typedef
66  struct opencbm_plugin_install_neededfiles_s opencbm_plugin_install_neededfiles_t;
67 
69  typedef
70  struct cbm_install_parameter_plugin_s
71  {
72  struct cbm_install_parameter_plugin_s *Next;
73  char * FileName;
74  char * Name;
75  void * OptionMemory;
76  opencbm_plugin_install_neededfiles_t * NeededFiles;
79 
80 
82  typedef
83  struct cbm_install_parameter_s
84  {
86  BOOL NoExecute;
87 
89  BOOL AdminNeeded;
90 
92  BOOL ExecuteParameterGiven;
93 
95  BOOL Install;
96 
98  BOOL Remove;
99 
101  BOOL Purge;
102 
104  BOOL NoCopy;
105 
107  BOOL Update;
108 
110  BOOL CheckInstall;
111 
113  BOOL OutputDebuggingBuffer;
114 
116  BOOL DebugFlagsDriverWereGiven;
117 
119  BOOL DebugFlagsDllWereGiven;
120 
122  BOOL DebugFlagsInstallWereGiven;
123 
125  ULONG DebugFlagsDriver;
126 
128  ULONG DebugFlagsDll;
129 
131  ULONG DebugFlagsInstall;
132 
134  osversion_t OsVersion;
135 
144  // @@@ char ** PluginNames;
145  cbm_install_parameter_plugin_t * PluginList;
146 
148  BOOL NoExplicitPluginGiven;
149 
151  char * DefaultAdapter;
152 
153  } opencbm_install_parameter_t;
154 
164  typedef struct CbmPluginInstallProcessCommandlineData_s {
165  int Argc;
166  char * const * Argv;
167  void * OptionMemory;
168  char **OptArg;
169  int * OptInd;
170  int * OptErr;
171  int * OptOpt;
173  opencbm_plugin_install_getopt_long_callback_t * GetoptLongCallback;
174  opencbm_install_parameter_t * InstallParameter;
177 
178 
185  typedef unsigned int CBMAPIDECL opencbm_plugin_install_process_commandline_t(CbmPluginInstallProcessCommandlineData_t * ProcessCommandlineData);
186 
187 
194  typedef BOOL CBMAPIDECL opencbm_plugin_install_do_install_t(void * OptionMemory);
195 
202  typedef BOOL CBMAPIDECL opencbm_plugin_install_do_uninstall_t(void * OptionMemory);
203 
209  typedef
210  enum opencbm_plugin_install_location_e
211  {
212  LOCAL_DIR,
213  LOCAL_PLUGIN_DIR,
214  SYSTEM_DIR,
215  DRIVER_DIR,
216  LIST_END
217  } opencbm_plugin_install_location_t;
218 
223  typedef
224  struct opencbm_plugin_install_neededfiles_s
225  {
226  opencbm_plugin_install_location_t FileLocation;
227  const char Filename[100];
228  const char * FileLocationString;
231  } opencbm_plugin_install_neededfiles_t;
232 
233 
242  typedef unsigned int CBMAPIDECL opencbm_plugin_install_get_needed_files_t(CbmPluginInstallProcessCommandlineData_t * Data, opencbm_plugin_install_neededfiles_t * Destination);
243 
244 
245  #define INDEX_DEFAULT_FILENAME_LOCAL 0
246  #define INDEX_DEFAULT_FILENAME_USERDIR 1
247  #define INDEX_DEFAULT_FILENAME_WINDIR 2
248 
259  typedef BOOL CBMAPIDECL opencbm_plugin_install_generic_t(const char * DefaultPluginname, unsigned int DefaultLocation);
260 
271  typedef BOOL CBMAPIDECL opencbm_plugin_install_plugin_data_t(const char * Pluginname, const char * Filepath, const CbmPluginInstallProcessCommandlineData_t * CommandlineData);
272 
273 
282  typedef BOOL CBMAPIDECL opencbm_plugin_get_all_plugin_names_callback_t(opencbm_install_parameter_t * InstallParameter, const char * Pluginname);
283 
288  typedef struct opencbm_plugin_get_all_plugin_names_context_s {
289  opencbm_plugin_get_all_plugin_names_callback_t * Callback;
290  opencbm_install_parameter_t * InstallParameter;
291  } opencbm_plugin_get_all_plugin_names_context_t;
292 
299  typedef BOOL CBMAPIDECL opencbm_plugin_get_all_plugin_names_t(opencbm_plugin_get_all_plugin_names_context_t * Callback);
300 
305  typedef int CBMAPIDECL opencbm_plugin_self_init_plugin_t(void);
306 
311  typedef int CBMAPIDECL opencbm_plugin_self_uninit_plugin_t(void);
312 
313 #endif
314 
315 #endif // #ifndef OPENCBM_PLUGIN_INSTALL_H
struct cbm_install_parameter_plugin_s cbm_install_parameter_plugin_t
Definition: instcbm.h:27
struct CbmPluginInstallProcessCommandlineData_s CbmPluginInstallProcessCommandlineData_t
Definition: instcbm.h:25
#define CBMAPIDECL
Definition: opencbm.h:85
Plugin DLL interface.
Definition: getopt.h:94