ifelse(M4PRODUCT, XML, m4_xml, m4_db) Reference Guide: $2

dnl $Id: m4.html,v 10.117 2008/01/08 20:58:21 bostic Exp $ dnl ################################################################### dnl Fonts. dnl ################################################################### dnl Bold font define(m4_bold, $1) dnl Constant width bold font -- same as m4_bold in HTML define(m4_cbold, $1) dnl Italic font define(m4_italic, $1) dnl Environmental variable. dnl #1: variable define(m4_envvar, $1) dnl Pathname. dnl #1: path define(m4_path, $1) dnl Function argument. dnl #1: argument name define(m4_arg, $1) dnl Utility option/flag. define(m4_option, -$1) dnl Utility argument define(m4_utilarg, __LB__-$1__RB__) dnl UNIX manual reference. dnl #1: man page name dnl #2: section define(m4_manref, [$1($2)]) dnl ################################################################### dnl Special Characters, Escapes. dnl ################################################################### dnl Superimposed define(m4_sup, [$1$2]) dnl Backslash preceded string. dnl #1: characters after the backslash define(m4_backslash, [\$1]) dnl Angle-bracket quoted string. define(m4_htmlquote, [<$1>]) dnl C include file dnl #1: include file name define(m4_include, [__OCT__include <$1>]) dnl ################################################################### dnl Miscellaneous. dnl ################################################################### dnl Berkeley DB define(m4_db, [Berkeley DB]) dnl Comment define(m4_comment, ) dnl Copyright strings. define(m4_copyright_source, [dnl ]) define(m4_copyright_footer, [dnl

Copyright (c) 1996,2008 Oracle. All rights reserved.]) dnl M4_meta definition moved to html.sed to prevent line breaks define(m4_meta, __M4_META__) dnl Just discard. define(m4_ignore,) dnl ################################################################### dnl Layout: basic. dnl ################################################################### dnl Header define(m4_header,
$1) dnl Section define(m4_section, $1) dnl Subsection define(m4_subsection,

#### $1

) dnl Paragraph define(m4_p, [

$1

]) dnl Horizontal line. define(m4_hl, [

]) dnl Single blank line. define(m4_blank, [

]) dnl Literal text block. dnl #1: string define(m4_literal,

    $1

) dnl Indent literal text block. dnl #1: string define(m4_indent,

>     $1

) dnl Indent text block. dnl #1: string define(m4_indentv,

> $1

) dnl PicGif display - Pic for ROFF/Gif for HTML dnl #1: align, e.g., center dnl #2: img src, e.g., M4RELDIR/ref/xxx dnl #3: alternate string define(m4_picgif, [

]) dnl ################################################################### dnl Layout: headers, titles and page bottoms. dnl ################################################################### dnl Reference Guide page leader. dnl #1: section dnl #2: page name dnl #3: index entries dnl #4,#5: prev, next define(m4_ref_title, [dnl ifelse($#, 5, , [errprint([$0: arg mismatch ])]) define(__m4_pagename, [$2]) m4_copyright_source
m4_meta
m4_idefz($3)

ifelse(M4PRODUCT, XML, m4_xml, m4_db) Reference Guide: $1 | dnl ifelse($4,,, )dnl dnl dnl ifelse($5,,, )

$2

define(m4_page_footer, [dnl

| dnl ifelse($4,,, )dnl dnl dnl ifelse($5,,, )

m4_copyright_footer
])]) dnl General purpose page leader dnl #1: page name define(m4_page_title, [dnl m4_copyright_source
ifelse(M4PRODUCT, XML, m4_xml:, m4_db:) $1 m4_meta

$1

define(m4_page_footer, [dnl m4_copyright_footer
])]) dnl General purpose page header, included by specific page headers. dnl #1: page title string dnl #2: section header dnl #3: API/Ref links in header/footer {yes, no} define(m4_page_header, [dnl define(__m4_pagename, [$1]) m4_copyright_source
ifelse(M4PRODUCT, XML, m4_xml:, m4_db:) $1 m4_meta
ifelse([$2],,, [dnl

[$2] ifelse([$3],,, [dnl | dnl ])

m4_hl]) `define(m4_page_footer, [dnl` ifelse([$3],,, [dnl

| dnl dnl

]) m4_copyright_footer
])]) dnl Description header for C/C++ API manual pages. define(m4_pf_description, [dnl m4_hl Description: [$1]]) dnl Page header for C/C++ API manual pages. dnl #1: function name dnl #2: function declaration dnl #3: extra stuff define(m4_pf_header, [dnl m4_page_header([$1], [$1], yes)

    m4_incextra([$3])
    ifelse([$2],,, [dnl

    $2])

m4_pf_description([$1])]) dnl Page header for Tcl manual pages. dnl #1: tcl command name dnl #2: tcl command name (correctly formatted) dnl #3: utility Synopsis line define(m4_tcl_header, [dnl m4_page_header([$1], [$2], yes)

    $3

Description($1)]) dnl Page header for utilities. dnl #1: utility name dnl #2: utility Synopsis line define(m4_util_header, [dnl m4_page_header([$1], [$1])

    $2

Description]) dnl ################################################################### dnl HTML links dnl ################################################################### dnl m4_link dnl Link to titled DB Reference Guide page. dnl #1: page dnl #2: string define(m4_link, [$2]) dnl m4_linkpage dnl Link to specific address in any HTML page. dnl #1: page dnl #2: address (optional) dnl #2/3: string to display define(m4_linkpage, [dnl ifelse($#, 3, [$3],dnl [$2])]) dnl m4_linkweb: dnl Link to specific address in any page. dnl #1: page dnl #2: address (optional) dnl #2/3: string to display define(m4_linkweb, [dnl ifelse($#, 3, [$3],dnl [$2])]) dnl m4_mailto dnl Mailto construct. dnl #1: address dnl #2: string define(m4_mailto, [$2]) dnl ################################################################### dnl Three forms of lists: dnl - tagged dnl - numbered dnl - bullet item dnl ################################################################### dnl m4_tagbegin define(m4_tagbegin,
) dnl m4_tag: standard tag list dnl #1: tag dnl #2: definition define(m4_tag, $1

- $2

) dnl m4_tagopt: option tag list dnl #1: option dnl #2: definition define(m4_tagopt, m4_option($1)

- $2

) dnl m4_tagend define(m4_tagend,
) define(m4_nlistbegin,

) define(m4_nlist,

1. $1) define(m4_nlistns,
2. $1) define(m4_nlistend,

) define(m4_bulletbegin,

) define(m4_bullet,
- $1) define(m4_bulletend,

) dnl ################################################################### dnl Tables dnl ################################################################### dnl m4_table_begin: a table with N elements. dnl #1: optional title dnl #2: option alignment (_left, _right, _center) dnl dnl m4_table_header: column headers, emboldened dnl dnl m4_table_element: table element dnl #1: optional empty flag (_empty) dnl #1: optional alignment (_left, _right, _center) dnl dnl m4_table_end: table end dnl define(m4_table_begin, [dnl [

]) define(m4_table_end,

) define(m4_table_header, [
__m4_table_header($@)
]) define(__m4_table_header, [dnl ifelse([$1],,,[$1],_empty,
[__m4_table_header(shift($@))], $1 [__m4_table_header(shift($@))])]) define(m4_table_element, [
__m4_table_element($@)
]) define(__m4_table_element, [dnl ifelse([$1],,, [$1], _left, [dnl ifelse([$2],,, [$2] [__m4_table_element(_left, shift(shift($@)))])], [$1], _center, [dnl ifelse([$2],,, [$2] [__m4_table_element(_center, shift(shift($@)))])], [$1], _right, [dnl ifelse([$2],,, [$2] [__m4_table_element(_right, shift(shift($@)))])], [$1], _empty,
[__m4_table_element(shift($@))], [$1] [__m4_table_element(shift($@))])]) dnl ################################################################### dnl Index. dnl ################################################################### dnl __m4_icnt -- dnl In HTML land, each index element gets its own unique address that dnl we generate based on an incremented variable, __m4_icnt. define(__m4_icnt, 1) dnl m4_idefz -- dnl $N string(s) to index define(m4_idefz, [dnl ifelse([$1],,, [dnl m4_idef([],dnl ifelse(index($1,@),-1,@$1,$1))m4_idefz(shift($@))])]) dnl m4_idef -- dnl Index definition. dnl $1 display text dnl $2 string to index [optional] define(m4_idef, [dnl ifelse($#, 1, [dnl $1dnl syscmd(echo "__APIREL__/M4PAGEPATH[__OCT__]$1 __m4_pagename@$1" >> _m4_ipath)],[dnl define([__m4_icnt], incr(__m4_icnt))dnl $1dnl syscmd(echo "__APIREL__/M4PAGEPATH[__OCT__]__m4_icnt $2" >> _m4_ipath)])])