2002-08-02 10:01:35 +00:00
|
|
|
#ifndef _UTIL_H_
|
|
|
|
#define _UTIL_H_
|
|
|
|
|
2004-03-29 20:21:00 +00:00
|
|
|
#ifndef _WIN32
|
|
|
|
# include <iconv.h>
|
|
|
|
#endif
|
2002-08-02 10:01:35 +00:00
|
|
|
#include "ResourceEditor.h"
|
|
|
|
|
|
|
|
// these are the standard pause-before-quit shit.
|
|
|
|
extern int g_dopause;
|
|
|
|
extern void dopause(void);
|
|
|
|
|
|
|
|
// Adds the bitmap in filename using resource editor re as id id.
|
|
|
|
// If width or height are specified it will also make sure the bitmap is in that size
|
2003-05-09 21:11:14 +00:00
|
|
|
int update_bitmap(CResourceEditor* re, WORD id, char* filename, int width=0, int height=0, int maxbpp=0);
|
2002-08-02 10:01:35 +00:00
|
|
|
|
|
|
|
// reads icon file filename and places its icons in the resource wIconId using resource editor re. Also updates icondata_size.
|
|
|
|
int replace_icon(CResourceEditor* re, WORD wIconId, char* filename);
|
|
|
|
|
|
|
|
#ifdef NSIS_CONFIG_UNINSTALL_SUPPORT
|
|
|
|
// returns the data of the uninstaller icon (inside filename) that should replace the installer icon data
|
|
|
|
unsigned char* generate_uninstall_icon_data(char* filename);
|
|
|
|
// Fill the array of icons for uninstall with their offsets
|
|
|
|
int generate_unicons_offsets(unsigned char* exeHeader, unsigned char* uninstIconData);
|
2004-03-12 20:43:54 +00:00
|
|
|
#endif//NSIS_CONFIG_UNINSTALL_SUPPORT
|
2002-08-02 10:01:35 +00:00
|
|
|
|
2004-03-29 20:21:00 +00:00
|
|
|
// returns the number of WCHARs in str including null charcter
|
|
|
|
int WCStrLen(const WCHAR* szwStr);
|
|
|
|
|
2004-08-18 16:14:44 +00:00
|
|
|
size_t my_strftime(char *s, size_t max, const char *fmt, const struct tm *tm);
|
|
|
|
|
2004-03-29 20:21:00 +00:00
|
|
|
#ifndef _WIN32
|
|
|
|
char *CharPrev(const char *s, const char *p);
|
|
|
|
char *CharNext(const char *s);
|
|
|
|
int wsprintf(char *s, const char *format, ...);
|
2004-05-08 13:05:35 +00:00
|
|
|
char *my_realpath(char *path);
|
|
|
|
void my_free_realpath(char *path, char *buffer);
|
2004-03-29 20:21:00 +00:00
|
|
|
// iconv const inconsistency workaround by Alexandre Oliva
|
|
|
|
template <typename T>
|
|
|
|
inline size_t __iconv_adaptor
|
|
|
|
(size_t (*iconv_func)(iconv_t, T, size_t *, char**,size_t*),
|
|
|
|
iconv_t cd, char **inbuf, size_t *inbytesleft,
|
|
|
|
char **outbuf, size_t *outbytesleft)
|
|
|
|
{
|
|
|
|
return iconv_func (cd, (T)inbuf, inbytesleft, outbuf, outbytesleft);
|
|
|
|
}
|
2002-08-06 11:24:49 +00:00
|
|
|
#endif
|
|
|
|
|
2004-03-12 20:43:54 +00:00
|
|
|
#endif //_UTIL_H_
|