dmd.root.response
Parse command line arguments from response files.
Discussion
This file is not shared with other compilers which use the DMD front-end.
License
Source: root/response.d
Documentation: https://dlang.org/phobos/dmd_root_response.html
-
Declaration
aliasresponseExpand= responseExpandFrom!(lookupInEnvironment).responseExpandFrom; -
Declaration
nothrow const(char)*responseExpandFrom(alias lookup)(ref Stringsargs);Expand any response files in command line. Response files are arguments that look like: @NAME The names are resolved by calling the 'lookup' function passed as a template parameter. That function is expected to first check the environment and then the file system. Arguments are separated by spaces, tabs, or newlines. These can be imbedded within arguments by enclosing the argument in "". Backslashes can be used to escape a ". A line comment can be started with #. Recursively expands nested response files.
Discussion
To use, put the arguments in a Strings object and call this on it.
Digital Mars's MAKE program can be notified that a program can accept long command lines via environment variables by preceding the rule line for the program with a *.Parameters
lookupalias to a function that is called to look up response file arguments in the environment. It is expected to accept a
null- terminated string and return a mutable char[] that ends with anull-terminator ornullif the response file could not be resolved.Stringsargsarray containing arguments as
null-terminated stringsReturn Value
nullon success, or the first response file that could not be found -
Declaration
pure nothrow boolinsertArgumentsFromResponse(char[]buffer, ref Stringsargs, ref size_targIndex);Take the contents of a response-file '
buffer', parse it and put the resulting arguments in 'args' at 'argIndex'. 'argIndex' will be updated to point just after the inserted arguments. The logic of this should match that in setargv()Parameters
char[]buffermutable string containing the response file
Stringsargslist of arguments
size_targIndexposition in '
args' where response arguments are insertedReturn Value
trueif another response argument was found