From f9c6b549f14072b08e0f380b8de8333ff7f6d3e9 Mon Sep 17 00:00:00 2001 From: jodavies Date: Fri, 3 Mar 2023 13:19:19 +0000 Subject: [PATCH] Define pre-proc vars for FORMTMP and FORMTMPSORT. Sometimes these paths can be useful in a form script, for use with #system, for example. --- doc/manual/prepro.tex | 2 ++ sources/startup.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/doc/manual/prepro.tex b/doc/manual/prepro.tex index 34015005..23b87794 100644 --- a/doc/manual/prepro.tex +++ b/doc/manual/prepro.tex @@ -87,6 +87,8 @@ \section{The preprocessor variables} processes in a job use the same number. A recovered session from a checkpoint (\ref{checkpoints}) keeps using the PID of the crushed session. +\item[FORMTMP\_] The path of the FORMTMP directory. +\item[FORMTMPSORT\_] The path of the FORMTMPSORT directory. \item[STOPWATCH\_] Same as `TIMER\_'. \item[SYSTEMERROR\_] The return value of the last \#system\ref{presystem} command when invoked with the -e\index{SYSTEMERROR\_} option. diff --git a/sources/startup.c b/sources/startup.c index 29971b0b..906bb74f 100644 --- a/sources/startup.c +++ b/sources/startup.c @@ -654,6 +654,12 @@ VOID ReserveTempFiles(int par) if ( AM.TempSortDir == 0 ) AM.TempSortDir = AM.TempDir; } } +/* + Make these paths available to the user as pre-processor variables: +*/ + PutPreVar((UBYTE *)"FORMTMP_", AM.TempDir, 0, 0); + PutPreVar((UBYTE *)"FORMTMPSORT_", AM.TempSortDir, 0, 0); + /* We have now in principle a path but we will use its first element only. Later that should become more complicated. Then we will use a path and