move definitions common to both plug-ins and stubs to api.h (part of patch #2359978)

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5815 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2008-12-09 22:53:39 +00:00
parent f6e4fefbf5
commit 4859b8702e
5 changed files with 5 additions and 60 deletions

View file

@ -31,6 +31,7 @@
#include "plugin.h"
#include "lang.h"
#include "components.h"
#include "api.h"
#ifdef NSIS_CONFIG_VISIBLE_SUPPORT
HICON g_hIcon;
@ -55,8 +56,6 @@ static char g_tmp[NSIS_MAX_STRLEN * 4];
static int m_page=-1,m_retcode,m_delta;
static page *g_this_page;
#define NOTIFY_BYE_BYE 'x'
static void NSISCALL outernotify(int delta) {
if (delta==NOTIFY_BYE_BYE)
g_quit_flag++;

View file

@ -26,6 +26,7 @@
#include "plugin.h"
#include "lang.h"
#include "resource.h"
#include "api.h"
#define EXEC_ERROR 0x7FFFFFFF
@ -45,12 +46,7 @@ static stack_t *g_st;
exec_flags g_exec_flags;
exec_flags g_exec_flags_last_used;
struct {
exec_flags *flags;
void *ExecuteCodeSegment;
void *validate_filename;
void *RegisterPluginCallback;
} plugin_extra_parameters = {
extra_parameters plugin_extra_parameters = {
&g_exec_flags,
&ExecuteCodeSegment,
&validate_filename,

View file

@ -16,6 +16,7 @@
#include "config.h"
#include "../Platform.h"
#include "api.h"
#ifndef _FILEFORM_H_
#define _FILEFORM_H_
@ -484,33 +485,6 @@ typedef struct {
#define NSIS_INSTDIR_INVALID 1
#define NSIS_INSTDIR_NOT_ENOUGH_SPACE 2
typedef struct
{
int autoclose;
int all_user_var;
int exec_error;
int abort;
#ifdef NSIS_SUPPORT_REBOOT
int exec_reboot;
int reboot_called;
#else
int _;
int __;
#endif
int XXX_cur_insttype; // depreacted
int plugin_api_version; // used to be XXX_insttype_changed, but that was deprecated
#ifdef NSIS_CONFIG_SILENT_SUPPORT
int silent;
#else
int ___;
#endif
int instdir_error;
int rtl;
int errlvl;
int alter_reg_view;
int status_update;
} exec_flags;
#define FIELDN(x, y) (((int *)&x)[y])
#ifdef EXEHEAD

View file

@ -19,28 +19,10 @@
#include "../Platform.h"
#include "fileform.h"
#include "api.h"
#ifdef NSIS_CONFIG_PLUGIN_SUPPORT
// Starting with NSIS 2.42, you can check the version of the plugin API in exec_flags->plugin_api_version
// The format is 0xXXXXYYYY where X is the major version and Y is the minor version (MAKELONG(y,x))
// When doing version checks, always remember to use >=, ex: if (pX->exec_flags->plugin_api_version >= NSISPIAPIVER_1_0) {}
#define NSISPIAPIVER_1_0 0x00010000
#define NSISPIAPIVER_CURR NSISPIAPIVER_1_0
// NSIS Plug-In Callback Messages
enum NSPIM
{
NSPIM_UNLOAD, // This is the last message a plugin gets, do final cleanup
NSPIM_GUIUNLOAD, // Called after .onGUIEnd
};
// Prototype for callbacks registered with extra_parameters->RegisterPluginCallback()
// Return NULL for unknown messages
// Should always be __cdecl for future expansion possibilities
typedef UINT_PTR (*NSISPLUGINCALLBACK)(NSPIM);
extern BOOL NSISCALL RegisterPluginCallback(HMODULE pluginHandle, NSISPLUGINCALLBACK proc);
extern void NSISCALL Plugins_SendMsgToAllPlugins(int msg);

View file

@ -36,18 +36,12 @@ void NSISCALL build_g_logfile(void);
// sent to every child window to tell it it can start executing NSIS code
#define WM_NOTIFY_START (WM_USER+0x5)
// sent to the outer window to tell it to go to the next inner window
#define WM_NOTIFY_OUTER_NEXT (WM_USER+0x8)
// sent to every child window to tell it it is closing soon
#define WM_NOTIFY_INIGO_MONTOYA (WM_USER+0xb)
// update message used by DirProc and SelProc for space display
#define WM_IN_UPDATEMSG (WM_USER+0xf)
// custom pages should send this message to let NSIS know they're ready
#define WM_NOTIFY_CUSTOM_READY (WM_USER+0xd)
// simulates clicking on the tree
#define WM_TREEVIEW_KEYHACK (WM_USER+0x13)