Skip to content

Commit 98dff7f

Browse files
committed
Added 'ext' expansion for proper trigger file detection
No need to specify the full plugin suffix (64 or not) or extension (.dll, .so or .dylib)
1 parent 2eea98d commit 98dff7f

5 files changed

Lines changed: 15 additions & 15 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ See also:
6868
* `$env:EnvVariableName$`: `EnvVariableName` is expanded to its environment variable value if it exists or left unexpanded otherwise
6969
* `$pkgbase$`: Specify a package base directory. Can be used as part of a dependency file path.
7070
* `$pkgmodname$`: This is mainly used inside the `reload` directive. It replaces the path seperators with dots (which works nicely as a fully qualified module name). Please see the [package dependency](test_scripts/pkg-dependency/README.md) example file.
71+
* `$ext$`: This resolves to the plugin suffix and extension ("64.dll", ".so", "64.dylib", etc.). See the trigger native deps files for reference.
7172

7273
## Using QScripts with trigger files
7374

TODO.md

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,18 @@
55
- Check for $(pwd)/.qscripts/<sourcefilename.depsfiles> first before checking the current directory
66
- This allows less pollution in the current folder
77

8-
## Native bitness detection
9-
10-
Introduce an automatic 64 detection macro. We don't want two seperate deps files like this:
11-
12-
```
13-
/triggerfile /keep $env:IDASDK$\bin\plugins\qplugin.dll
14-
/triggerfile /keep $env:IDASDK$\bin\plugins\qplugin[64].dll
15-
```
16-
178
# TODO
189

19-
- Isolate the timer code from the UI logic
2010
- Automatically select the previous active script when the UI launches
2111
- Restore the QScripts window layout when closed and re-opened
2212
- Use OS specific file change monitors
2313

2414

25-
- Refactor filemonitor into a utility class
26-
-- Perhaps implement per OS on Win32, and as is for Linux/Mac
27-
-- For Linux, perhaps call an external process like 'inotify-wait' ?
15+
# Monitor code and refactoring
16+
17+
- Isolate the timer code from the UI logic
18+
- Refactor filemonitor into a utility class
19+
- Perhaps implement per OS on Win32, and as is for Linux/Mac
20+
- For Linux, perhaps call an external process like 'inotify-wait' ?
2821

2922

qscripts.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ struct qscripts_chooser_t: public plugmod_t, public chooser_t
381381
// env:Variable_Name Expands the 'Variable_Name'
382382
// pkgbase Sets the current pkgbase path
383383
// pkgmodname Expands the file name using the pckbase into the form: 'module.submodule1.submodule2'
384+
// ext Addon suffix including bitness and extension (example: 64.dll, .so, 64.so, .dylib, etc.)
384385
void expand_string(qstring &input, qstring &output, const expand_ctx_t& ctx)
385386
{
386387
output = std::regex_replace(
@@ -409,6 +410,11 @@ struct qscripts_chooser_t: public plugmod_t, public chooser_t
409410
}
410411
return "";
411412
}
413+
else if (strncmp(match1.c_str(), "ext", 3) == 0)
414+
{
415+
static_assert(LOADER_DLL[0] == '*');
416+
return LOADER_DLL + 1;
417+
}
412418
else if (strncmp(match1.c_str(), "pkgbase", 7) == 0)
413419
{
414420
return ctx.pkg_base.c_str();
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/triggerfile /keep $env:IDASDK$\bin\plugins\qscripts_native_triton64.dll
1+
/triggerfile /keep $env:IDASDK$\bin\plugins\qscripts_native_triton$ext$
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/triggerfile /keep $env:IDASDK$\bin\plugins\qscripts_native.dll
1+
/triggerfile /keep $env:IDASDK$\bin\plugins\qscripts_native$ext$

0 commit comments

Comments
 (0)