Mercurial > urweb
comparison doc/manual.tex @ 1309:127561e4aef1
Documenting limits
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Thu, 14 Oct 2010 11:54:54 -0400 |
parents | 3a845f2ce9e9 |
children | c5799b1e4c58 |
comparison
equal
deleted
inserted
replaced
1308:714e8b84221b | 1309:127561e4aef1 |
---|---|
144 \item \texttt{exe FILENAME} sets the filename to which to write the output executable. The default for file \texttt{P.urp} is \texttt{P.exe}. | 144 \item \texttt{exe FILENAME} sets the filename to which to write the output executable. The default for file \texttt{P.urp} is \texttt{P.exe}. |
145 \item \texttt{ffi FILENAME} reads the file \texttt{FILENAME.urs} to determine the interface to a new FFI module. The name of the module is calculated from \texttt{FILENAME} in the same way as for normal source files. See the files \texttt{include/urweb.h} and \texttt{src/c/urweb.c} for examples of C headers and implementations for FFI modules. In general, every type or value \texttt{Module.ident} becomes \texttt{uw\_Module\_ident} in C. | 145 \item \texttt{ffi FILENAME} reads the file \texttt{FILENAME.urs} to determine the interface to a new FFI module. The name of the module is calculated from \texttt{FILENAME} in the same way as for normal source files. See the files \texttt{include/urweb.h} and \texttt{src/c/urweb.c} for examples of C headers and implementations for FFI modules. In general, every type or value \texttt{Module.ident} becomes \texttt{uw\_Module\_ident} in C. |
146 \item \texttt{include FILENAME} adds \texttt{FILENAME} to the list of files to be \texttt{\#include}d in C sources. This is most useful for interfacing with new FFI modules. | 146 \item \texttt{include FILENAME} adds \texttt{FILENAME} to the list of files to be \texttt{\#include}d in C sources. This is most useful for interfacing with new FFI modules. |
147 \item \texttt{jsFunc Module.ident=name} gives the JavaScript name of an FFI value. | 147 \item \texttt{jsFunc Module.ident=name} gives the JavaScript name of an FFI value. |
148 \item \texttt{library FILENAME} parses \texttt{FILENAME.urp} and merges its contents with the rest of the current file's contents. If \texttt{FILENAME.urp} doesn't exist, the compiler also tries \texttt{FILENAME/lib.urp}. | 148 \item \texttt{library FILENAME} parses \texttt{FILENAME.urp} and merges its contents with the rest of the current file's contents. If \texttt{FILENAME.urp} doesn't exist, the compiler also tries \texttt{FILENAME/lib.urp}. |
149 \item \texttt{limit class num} sets a resource usage limit for generated applications. The limit \texttt{class} will be set to the non-negative integer \texttt{num}. The classes are: | |
150 \begin{itemize} | |
151 \item \texttt{cleanup}: maximum number of cleanup operations (e.g., entries recording the need to deallocate certain temporary objects) that may be active at once per request | |
152 \item \texttt{database}: maximum size of database files (currently only used by SQLite) | |
153 \item \texttt{deltas}: maximum number of messages sendable in a single request handler with \texttt{Basis.send} | |
154 \item \texttt{globals}: maximum number of global variables that FFI libraries may set in a single request context | |
155 \item \texttt{headers}: maximum size (in bytes) of per-request buffer used to hold HTTP headers for generated pages | |
156 \item \texttt{heap}: maximum size (in bytes) of per-request heap for dynamically-allocated data | |
157 \item \texttt{inputs}: maximum number of top-level form fields per request | |
158 \item \texttt{messages}: maximum size (in bytes) of per-request buffer used to hold a single outgoing message sent with \texttt{Basis.send} | |
159 \item \texttt{page}: maximum size (in bytes) of per-request buffer used to hold HTML content of generated pages | |
160 \item \texttt{script}: maximum size (in bytes) of per-request buffer used to hold JavaScript content of generated pages | |
161 \item \texttt{subinputs}: maximum number of form fields per request, excluding top-level fields | |
162 \item \texttt{time}: maximum running time of a single page request, in units of approximately 0.1 seconds | |
163 \item \texttt{transactionals}: maximum number of custom transactional actions (e.g., sending an e-mail) that may be run in a single page generation | |
164 \end{itemize} | |
149 \item \texttt{link FILENAME} adds \texttt{FILENAME} to the list of files to be passed to the GCC linker at the end of compilation. This is most useful for importing extra libraries needed by new FFI modules. | 165 \item \texttt{link FILENAME} adds \texttt{FILENAME} to the list of files to be passed to the GCC linker at the end of compilation. This is most useful for importing extra libraries needed by new FFI modules. |
150 \item \texttt{onError Module.var} changes the handling of fatal application errors. Instead of displaying a default, ugly error 500 page, the error page will be generated by calling function \texttt{Module.var} on a piece of XML representing the error message. The error handler should have type $\mt{xbody} \to \mt{transaction} \; \mt{page}$. Note that the error handler \emph{cannot} be in the application's main module, since that would register it as explicitly callable via URLs. | 166 \item \texttt{onError Module.var} changes the handling of fatal application errors. Instead of displaying a default, ugly error 500 page, the error page will be generated by calling function \texttt{Module.var} on a piece of XML representing the error message. The error handler should have type $\mt{xbody} \to \mt{transaction} \; \mt{page}$. Note that the error handler \emph{cannot} be in the application's main module, since that would register it as explicitly callable via URLs. |
151 \item \texttt{path NAME=VALUE} creates a mapping from \texttt{NAME} to \texttt{VALUE}. This mapping may be used at the beginnings of filesystem paths given to various other configuration directives. A path like \texttt{\$NAME/rest} is expanded to \texttt{VALUE/rest}. There is an initial mapping from the empty name (for paths like \texttt{\$/list}) to the directory where the Ur/Web standard library is installed. If you accept the default \texttt{configure} options, this directory is \texttt{/usr/local/lib/urweb/ur}. | 167 \item \texttt{path NAME=VALUE} creates a mapping from \texttt{NAME} to \texttt{VALUE}. This mapping may be used at the beginnings of filesystem paths given to various other configuration directives. A path like \texttt{\$NAME/rest} is expanded to \texttt{VALUE/rest}. There is an initial mapping from the empty name (for paths like \texttt{\$/list}) to the directory where the Ur/Web standard library is installed. If you accept the default \texttt{configure} options, this directory is \texttt{/usr/local/lib/urweb/ur}. |
152 \item \texttt{prefix PREFIX} sets the prefix included before every URI within the generated application. The default is \texttt{/}. | 168 \item \texttt{prefix PREFIX} sets the prefix included before every URI within the generated application. The default is \texttt{/}. |
153 \item \texttt{profile} generates an executable that may be used with gprof. | 169 \item \texttt{profile} generates an executable that may be used with gprof. |
212 A command like this can initialize an SQLite database: | 228 A command like this can initialize an SQLite database: |
213 \begin{verbatim} | 229 \begin{verbatim} |
214 sqlite3 path/to/database/file <app.sql | 230 sqlite3 path/to/database/file <app.sql |
215 \end{verbatim} | 231 \end{verbatim} |
216 \end{itemize} | 232 \end{itemize} |
233 | |
234 \item \texttt{-limit class num}: Equivalent to the \texttt{limit} directive from \texttt{.urp} files | |
217 | 235 |
218 \item \texttt{-output FILENAME}: Set where the application executable is written. | 236 \item \texttt{-output FILENAME}: Set where the application executable is written. |
219 | 237 |
220 \item \texttt{-path NAME VALUE}: Set the value of path variable \texttt{\$NAME} to \texttt{VALUE}, for use in \texttt{.urp} files. | 238 \item \texttt{-path NAME VALUE}: Set the value of path variable \texttt{\$NAME} to \texttt{VALUE}, for use in \texttt{.urp} files. |
221 | 239 |