2004-03-12 20:43:54 +00:00
|
|
|
#include "../Platform.h"
|
2002-08-02 10:01:35 +00:00
|
|
|
#include "config.h"
|
2003-12-22 00:28:30 +00:00
|
|
|
#include <shlobj.h>
|
2002-08-02 10:01:35 +00:00
|
|
|
|
|
|
|
extern char ps_tmpbuf[NSIS_MAX_STRLEN*2];
|
2003-09-04 18:25:57 +00:00
|
|
|
char * NSISCALL GetNSISString(char *outbuf, int strtab);
|
|
|
|
#define GetNSISStringTT(strtab) GetNSISString(0, (strtab))
|
|
|
|
#define GetNSISStringNP(strtab) ((const char *)g_blocks[NB_STRINGS].offset+(strtab))
|
|
|
|
#define GetNSISTab(strtab) (strtab < 0 ? LANG_STR_TAB(strtab) : strtab)
|
2002-08-19 23:18:19 +00:00
|
|
|
void NSISCALL myRegGetStr(HKEY root, const char *sub, const char *name, char *out);
|
|
|
|
int NSISCALL myatoi(char *s);
|
|
|
|
void NSISCALL myitoa(char *s, int d);
|
|
|
|
char * NSISCALL mystrcpy(char *out, const char *in);
|
|
|
|
int NSISCALL mystrlen(const char *in);
|
2005-08-06 12:47:46 +00:00
|
|
|
char * NSISCALL mystrcat(char *out, const char *concat);
|
2003-02-07 23:04:25 +00:00
|
|
|
char * NSISCALL mystrstr(char *a, char *b);
|
2003-07-08 23:18:47 +00:00
|
|
|
WIN32_FIND_DATA * NSISCALL file_exists(char *buf);
|
2003-07-18 14:22:17 +00:00
|
|
|
char * NSISCALL my_GetTempFileName(char *buf, const char *dir);
|
2004-02-06 22:37:46 +00:00
|
|
|
void NSISCALL FreePIDL(LPITEMIDLIST idl);
|
2003-02-07 23:04:25 +00:00
|
|
|
|
2003-12-29 14:27:33 +00:00
|
|
|
//BOOL NSISCALL my_SetWindowText(HWND hWnd, const char *val);
|
|
|
|
#define my_SetWindowText SetWindowText
|
2002-09-21 02:34:34 +00:00
|
|
|
BOOL NSISCALL my_SetDialogItemText(HWND dlg, UINT idx, const char *val);
|
2004-01-04 17:05:03 +00:00
|
|
|
//#define my_SetDialogItemText SetDlgItemText
|
2003-02-07 23:04:25 +00:00
|
|
|
//int NSISCALL my_GetWindowText(HWND hWnd, char *val, int size);
|
|
|
|
#define my_GetWindowText GetWindowText
|
2004-01-04 17:05:03 +00:00
|
|
|
int NSISCALL my_GetDialogItemText(UINT idx, char *val);
|
|
|
|
//#define my_GetDialogItemText GetDlgItemText
|
2002-08-02 10:01:35 +00:00
|
|
|
|
|
|
|
#ifdef NSIS_CONFIG_LOG
|
|
|
|
extern char log_text[NSIS_MAX_STRLEN*4];
|
2002-08-19 23:18:19 +00:00
|
|
|
void NSISCALL log_write(int close);
|
2003-11-24 14:22:50 +00:00
|
|
|
void log_printf(char *format, ...);
|
2004-01-27 18:44:31 +00:00
|
|
|
#define log_printf2(x1,x2) log_printf(x1,x2);
|
|
|
|
#define log_printf3(x1,x2,x3) log_printf(x1,x2,x3);
|
|
|
|
#define log_printf4(x1,x2,x3,x4) log_printf(x1,x2,x3,x4);
|
|
|
|
#define log_printf5(x1,x2,x3,x4,x5) log_printf(x1,x2,x3,x4,x5);
|
|
|
|
#define log_printf6(x1,x2,x3,x4,x5,x6) log_printf(x1,x2,x3,x4,x5,x6);
|
|
|
|
#define log_printf7(x1,x2,x3,x4,x5,x6,x7) log_printf(x1,x2,x3,x4,x5,x6,x7);
|
|
|
|
#define log_printf8(x1,x2,x3,x4,x5,x6,x7,x8) log_printf(x1,x2,x3,x4,x5,x6,x7,x8);
|
2002-08-02 10:01:35 +00:00
|
|
|
extern int log_dolog;
|
|
|
|
extern char g_log_file[1024];
|
|
|
|
#else
|
|
|
|
#define log_printf(x1)
|
|
|
|
#define log_printf2(x1,x2)
|
|
|
|
#define log_printf3(x1,x2,x3)
|
|
|
|
#define log_printf4(x1,x2,x3,x4)
|
|
|
|
#define log_printf5(x1,x2,x3,x4,x5)
|
|
|
|
#define log_printf6(x1,x2,x3,x4,x5,x6)
|
2004-01-27 18:44:31 +00:00
|
|
|
#define log_printf7(x1,x2,x3,x4,x5,x6,x7)
|
2002-08-02 10:01:35 +00:00
|
|
|
#define log_printf8(x1,x2,x3,x4,x5,x6,x7,x8)
|
|
|
|
#endif
|
|
|
|
|
2002-08-19 23:18:19 +00:00
|
|
|
HANDLE NSISCALL myCreateProcess(char *cmd, char *dir);
|
|
|
|
int NSISCALL my_MessageBox(const char *text, UINT type);
|
2002-08-08 15:04:45 +00:00
|
|
|
|
2004-08-06 17:03:07 +00:00
|
|
|
void NSISCALL myDelete(char *buf, int flags);
|
2002-08-11 18:56:30 +00:00
|
|
|
|
2002-08-19 23:18:19 +00:00
|
|
|
HANDLE NSISCALL myOpenFile(const char *fn, DWORD da, DWORD cd);
|
|
|
|
int NSISCALL validpathspec(char *ubuf);
|
2002-09-25 02:13:38 +00:00
|
|
|
char * NSISCALL addtrailingslash(char *str);
|
2003-02-20 18:47:58 +00:00
|
|
|
//char NSISCALL lastchar(const char *str);
|
|
|
|
#define lastchar(str) *CharPrev(str,str+mystrlen(str))
|
2004-02-04 20:03:30 +00:00
|
|
|
char * NSISCALL findchar(char *str, char c);
|
2002-08-19 23:18:19 +00:00
|
|
|
void NSISCALL trimslashtoend(char *buf);
|
2003-09-23 19:01:19 +00:00
|
|
|
char * NSISCALL skip_root(char *path);
|
2002-08-19 23:18:19 +00:00
|
|
|
int NSISCALL is_valid_instpath(char *s);
|
2005-07-30 12:33:20 +00:00
|
|
|
void NSISCALL validate_filename(char *fn);
|
2003-09-09 14:25:16 +00:00
|
|
|
void NSISCALL MoveFileOnReboot(LPCTSTR pszExisting, LPCTSTR pszNew);
|
2004-05-08 16:07:22 +00:00
|
|
|
void NSISCALL mini_memcpy(void *out, const void *in, int len);
|
2002-09-22 19:05:43 +00:00
|
|
|
|
2005-09-02 11:35:45 +00:00
|
|
|
void * NSISCALL myGetProcAddress(char *dll, char *func);
|
2005-09-09 15:21:45 +00:00
|
|
|
void NSISCALL MessageLoop(UINT uCheckedMsg);
|
2005-09-02 11:35:45 +00:00
|
|
|
|
2002-09-22 19:05:43 +00:00
|
|
|
// Turn a pair of chars into a word
|
|
|
|
// Turn four chars into a dword
|
|
|
|
#ifdef __BIG_ENDIAN__ // Not very likely, but, still...
|
|
|
|
#define CHAR2_TO_WORD(a,b) (((WORD)(b))|((a)<<8))
|
2003-07-12 15:19:49 +00:00
|
|
|
#define CHAR4_TO_DWORD(a,b,c,d) (((DWORD)CHAR2_TO_WORD(c,d))|(CHAR2_TO_WORD(a,b)<<16))
|
2002-09-22 19:05:43 +00:00
|
|
|
#else
|
|
|
|
#define CHAR2_TO_WORD(a,b) (((WORD)(a))|((b)<<8))
|
2003-07-12 15:19:49 +00:00
|
|
|
#define CHAR4_TO_DWORD(a,b,c,d) (((DWORD)CHAR2_TO_WORD(a,b))|(CHAR2_TO_WORD(c,d)<<16))
|
2002-09-22 19:05:43 +00:00
|
|
|
#endif
|