Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/form.1
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ Output only to log file. Further like \fB-L\fR or \fB-ll\fR.
Wait for some key to be touched before finishing the run. Basically only for some old window
based systems.
.TP
.BR "-install"
Install the package specified by the next argument.
.TP
.BR "-I"
Next argument/option is the path of a directory for include, procedure and subroutine files.
.TP
Expand Down
52 changes: 52 additions & 0 deletions doc/manual/prepro.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2117,6 +2117,58 @@ \section{\#usedictionary}
\noindent Starts using a dictionary for output translation.

%--#] usedictionary :
%--#[ usepackage :

\section{\#usepackage}
\label{preusepackage}

\noindent Syntax:

\#usepackage [$-+$] [site/]group/name@version [: [$-+$] filename [\# foldname]]

\noindent See also include (\ref{preinclude}),
prependpath (\ref{preprependpath}).

\noindent Loads the specified package\index{package!manager}. If the package is
not in the system, \FORM{} will try to download and install it, which can be
also done via the {\tt -install} option. This is implemented with the use of
the shell and {\tt curl} or {\tt wget} utility, therefore works only on Unix
systems. Packages will be installed into the {\tt .form} directory inside the
user's home directory.

The package to be loaded by this instruction is specified in the following
format:
\begin{verbatim}
[site/]group/name@version
\end{verbatim}
Packages are expected to have been uploaded as public repositories on GitHub,
Bitbucket or GitLab. The optional {\tt site} component specifies the website
where the package exists: {\tt github.com}, {\tt bitbucket.org} or
{\tt gitlab.com}; the default value is {\tt github.com}. The {\tt group}
component specifies the group/owner account name and the {\tt name} component
is the repository name. The {\tt version} component is indeed to specify a
tag/commit in the repository. An example is:
\begin{verbatim}
benruijl/[email protected]
\end{verbatim}

If the package is available in the system, or both the downloading and
installation succeed, then the preprocessor prepends the package path to the
\FORM{} path. Next, the package file is opened and read as in the \#include
instruction. By default, the header file that has the same name as the package,
{\tt name.h}, will be included. Alternatively, one can specify which file
should be included (with an optional foldname) by writing it after a colon
({\tt :}). The optional $+$ or $-$ sign is, as in \#include, to control the
listing of the contents of the file. Examples:
\begin{verbatim}
#usepackage benruijl/[email protected]
\end{verbatim}

\begin{verbatim}
#usepackage benruijl/[email protected] : forcer/forcer-aux.h # decl
\end{verbatim}

%--#] usepackage :
%--#[ write :

\section{\#write}
Expand Down
3 changes: 3 additions & 0 deletions doc/manual/startup.tex
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ \chapter{Running FORM}
\item[-F] Output only to log file. Further like -L or -ll.
\item[-h] Wait for some key to be touched before finishing the run.
Basically only for some old window based systems.
\item[-install] Install the package\index{package!manager} specified by the
next argument. The package is specified in the format described in
\#usepackage (\ref{preusepackage}).
\item[-I] Next argument/option is the path of a directory for
include, procedure and subroutine files.
\item[-l] Make a regular log file.
Expand Down
1 change: 1 addition & 0 deletions sources/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ SRCBASE = \
notation.c \
opera.c \
optimize.cc \
package.cc \
pattern.c \
poly.cc \
poly.h \
Expand Down
3 changes: 3 additions & 0 deletions sources/declare.h
Original file line number Diff line number Diff line change
Expand Up @@ -1658,6 +1658,9 @@ extern int AddToScratch(FILEHANDLE *,POSITION *,UBYTE *,POSITION *,int);
extern int DoPreAppendPath(UBYTE *);
extern int DoPrePrependPath(UBYTE *);

extern int InstallPackage(UBYTE *);
extern int DoPreUsePackage(UBYTE *);

extern int DoSwitch(PHEAD WORD *, WORD *);
extern int DoEndSwitch(PHEAD WORD *, WORD *);
extern SWITCHTABLE *FindCase(WORD, WORD);
Expand Down
Loading