09.06.2013 Views

Intel XENIX 286 Programmers Guide (86) - Tenox.tc

Intel XENIX 286 Programmers Guide (86) - Tenox.tc

Intel XENIX 286 Programmers Guide (86) - Tenox.tc

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>XENIX</strong> Programming Programming Commands<br />

m4 (continued)<br />

Macro Calls<br />

Macro calls have the form<br />

name(arg 1 ,arg2, ... , argn)<br />

The ( must immediately follow the name of the macro. If a defined macro name is not<br />

followed by a (, it is deemed to have no arguments. Leading unquoted blanks, tabs, and<br />

newlines are ignored while collecting arguments. When the first character is not a<br />

digit, the macro name could consist of a letter, digit, or underscore (_) .<br />

Left and right single quotation marks are used to quote strings. The value of a quoted<br />

string is the string stripped of the quotation marks.<br />

When a macro name is recognized, its argu ments are collected by searching for a<br />

ma<strong>tc</strong>hing right parenthesis. Macro evaluation proceeds normally during the collection<br />

of the arguments, and any com mas or right parentheses that happen to turn up within<br />

the value of a nested call are as effective as those in the original input text. After<br />

argument collection, the value of the macro is pushed back onto the input stream and<br />

rescanned.<br />

m4 makes available the following built-in macros. They may be redefined, but once this<br />

is done the original meaning is lost. Their values are null unless otherwise stated.<br />

define<br />

The second argument is installed as the value of the macro whose name is the<br />

first argument. Each occurrence of $n in the replacement of text, where n is a<br />

digit, is replaced by the n-th argument. Argument 0 is the name of the macro;<br />

missing arguments are replaced by the null string; $# is replaced by the number<br />

of arguments; $* is replaced by a list of all the arguments separated by commas;<br />

$@. is like $*, but each argu ment is quoted (with the current quotation marks).<br />

undefine<br />

Removes the definition of the macro named in its argu ment.<br />

defn<br />

pushdef<br />

Like define, but saves any previous definition.<br />

popdef<br />

ifdef<br />

Returns the quoted definition of its argument(s). It is useful for renaming<br />

macros, especially built-ins.<br />

Removes current definition of its argu ment(s), exposing the previous ones if any.<br />

If the first argument is defined, the value is the second argument, otherwise the<br />

third. If there is no third argument, the value is null. The word <strong>XENIX</strong> is<br />

predefined in m4.<br />

B-85

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!