Debian Codegraph @

Source/exehead/state.h

raw
1 /*
2 * state.h
3 *
4 * This file is a part of NSIS.
5 *
6 * Copyright (C) 1999-2026 Nullsoft and Contributors
7 *
8 * Licensed under the zlib/libpng license (the "License");
9 * you may not use this file except in compliance with the License.
10 *
11 * Licence details can be found in the file COPYING.
12 *
13 * This software is provided 'as-is', without any express or implied
14 * warranty.
15 *
16 * Unicode support by Jim Park -- 08/22/2007
17 */
18
19 #ifndef NSIS_EXEHEAD_STATE_H
20 #define NSIS_EXEHEAD_STATE_H
21 #include "fileform.h"
22 #include "api.h"
23
24 #ifdef __GNUC__
25 // GCC warns about array bounds when accessing g_usrvarssection[2] because it is only [1] at compile time,
26 // the other part of this hack is in util.c where g_usrvarsstart is initialized.
27 extern const NSIS_STRING*const g_usrvarsstart;
28 #define g_usrvars ( (NSIS_STRING*) (g_usrvarsstart) )
29 #else
30 extern NSIS_STRING g_usrvarssection[1];
31 #define g_usrvars g_usrvarssection
32 #endif
33
34 #define state_command_line (((NSIS_STRING *) g_usrvars)[20])
35 #define state_install_directory (((NSIS_STRING *) g_usrvars)[21])
36 #define state_output_directory (((NSIS_STRING *) g_usrvars)[22])
37 #define state_exe_directory (((NSIS_STRING *) g_usrvars)[23])
38 #define state_language (((NSIS_STRING *) g_usrvars)[24])
39 #define state_temp_dir (((NSIS_STRING *) g_usrvars)[25])
40 #ifdef NSIS_CONFIG_PLUGIN_SUPPORT
41 # define state_plugins_dir (((NSIS_STRING *) g_usrvars)[26])
42 #endif
43 #define state_exe_path (((NSIS_STRING *) g_usrvars)[27])
44 #define state_exe_file (((NSIS_STRING *) g_usrvars)[28])
45 #define state_click_next (((NSIS_STRING *) g_usrvars)[30])
46
47 extern TCHAR g_caption[NSIS_MAX_STRLEN*2];
48 #ifdef NSIS_CONFIG_VISIBLE_SUPPORT
49 extern HWND g_hwnd;
50 extern HANDLE g_hInstance;
51 extern HWND insthwnd,insthwndbutton;
52 #else
53 #define g_hwnd 0
54 #define g_hInstance 0
55 #endif//NSIS_CONFIG_VISIBLE_SUPPORT
56
57
58 typedef struct {
59 exec_flags_t exec_flags;
60 osinfo osi;
61 } execflags_and_osinfo;
62
63 extern execflags_and_osinfo g_execflags_and_osinfo;
64 #define g_exec_flags (g_execflags_and_osinfo.exec_flags)
65 #define g_osinfo (g_execflags_and_osinfo.osi)
66
67 #endif //~ Include guard