- create plugin.lib that contains all
- distribute plugin.h, api.h and plugin.lib - remove inc_c stuff because we don't really want to install win32 header files as something that can be used on linux (this should be revisited later) - fix up MakeFileList for newer versions of SCons (should be removed in the future) git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5826 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
e51dfd9873
commit
eceb3ce333
5 changed files with 150 additions and 36 deletions
41
Contrib/ExDLL/plugin.c
Normal file
41
Contrib/ExDLL/plugin.c
Normal file
|
@ -0,0 +1,41 @@
|
|||
#include <windows.h>
|
||||
|
||||
#include "plugin.h"
|
||||
|
||||
unsigned int g_stringsize;
|
||||
stack_t **g_stacktop;
|
||||
char *g_variables;
|
||||
|
||||
// utility functions (not required but often useful)
|
||||
int NSISCALL popstring(char *str)
|
||||
{
|
||||
stack_t *th;
|
||||
if (!g_stacktop || !*g_stacktop) return 1;
|
||||
th=(*g_stacktop);
|
||||
lstrcpyA(str,th->text);
|
||||
*g_stacktop = th->next;
|
||||
GlobalFree((HGLOBAL)th);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void NSISCALL pushstring(const char *str)
|
||||
{
|
||||
stack_t *th;
|
||||
if (!g_stacktop) return;
|
||||
th=(stack_t*)GlobalAlloc(GPTR,sizeof(stack_t)+g_stringsize);
|
||||
lstrcpynA(th->text,str,g_stringsize);
|
||||
th->next=*g_stacktop;
|
||||
*g_stacktop=th;
|
||||
}
|
||||
|
||||
char * NSISCALL getuservariable(const int varnum)
|
||||
{
|
||||
if (varnum < 0 || varnum >= __INST_LAST) return NULL;
|
||||
return g_variables+varnum*g_stringsize;
|
||||
}
|
||||
|
||||
void NSISCALL setuservariable(const int varnum, const char *var)
|
||||
{
|
||||
if (var != NULL && varnum >= 0 && varnum < __INST_LAST)
|
||||
lstrcpyA(g_variables + varnum*g_stringsize, var);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue