home *** CD-ROM | disk | FTP | other *** search
/ Hackers Magazine 57 / CdHackersMagazineNr57.iso / Software / Programming / nsis-2.46-setup.exe / Examples / Plugin / nsis / pluginapi.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-12-20  |  1.9 KB  |  75 lines

  1. #ifndef ___NSIS_PLUGIN__H___
  2. #define ___NSIS_PLUGIN__H___
  3.  
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7.  
  8. #include "api.h"
  9.  
  10. #ifndef NSISCALL
  11. #  define NSISCALL __stdcall
  12. #endif
  13.  
  14. #define EXDLL_INIT()           {  \
  15.         g_stringsize=string_size; \
  16.         g_stacktop=stacktop;      \
  17.         g_variables=variables; }
  18.  
  19. typedef struct _stack_t {
  20.   struct _stack_t *next;
  21.   char text[1]; // this should be the length of string_size
  22. } stack_t;
  23.  
  24. enum
  25. {
  26. INST_0,         // $0
  27. INST_1,         // $1
  28. INST_2,         // $2
  29. INST_3,         // $3
  30. INST_4,         // $4
  31. INST_5,         // $5
  32. INST_6,         // $6
  33. INST_7,         // $7
  34. INST_8,         // $8
  35. INST_9,         // $9
  36. INST_R0,        // $R0
  37. INST_R1,        // $R1
  38. INST_R2,        // $R2
  39. INST_R3,        // $R3
  40. INST_R4,        // $R4
  41. INST_R5,        // $R5
  42. INST_R6,        // $R6
  43. INST_R7,        // $R7
  44. INST_R8,        // $R8
  45. INST_R9,        // $R9
  46. INST_CMDLINE,   // $CMDLINE
  47. INST_INSTDIR,   // $INSTDIR
  48. INST_OUTDIR,    // $OUTDIR
  49. INST_EXEDIR,    // $EXEDIR
  50. INST_LANG,      // $LANGUAGE
  51. __INST_LAST
  52. };
  53.  
  54. extern unsigned int g_stringsize;
  55. extern stack_t **g_stacktop;
  56. extern char *g_variables;
  57.  
  58. int NSISCALL popstring(char *str); // 0 on success, 1 on empty stack
  59. int NSISCALL popstringn(char *str, int maxlen); // with length limit, pass 0 for g_stringsize
  60. int NSISCALL popint(); // pops an integer
  61. int NSISCALL popint_or(); // with support for or'ing (2|4|8)
  62. int NSISCALL myatoi(const char *s); // converts a string to an integer
  63. unsigned NSISCALL myatou(const char *s); // converts a string to an unsigned integer, decimal only
  64. int NSISCALL myatoi_or(const char *s); // with support for or'ing (2|4|8)
  65. void NSISCALL pushstring(const char *str);
  66. void NSISCALL pushint(int value);
  67. char * NSISCALL getuservariable(const int varnum);
  68. void NSISCALL setuservariable(const int varnum, const char *var);
  69.  
  70. #ifdef __cplusplus
  71. }
  72. #endif
  73.  
  74. #endif//!___NSIS_PLUGIN__H___
  75.