Add json support
[ric-plt/xapp-frame-cpp.git] / doc / src / lib / setup.im
1 .if false
2 ==================================================================================
3     Copyright (c) 2020 Nokia
4     Copyright (c) 2020 AT&T Intellectual Property.
5
6    Licensed under the Apache License, Version 2.0 (the "License");
7    you may not use this file except in compliance with the License.
8    You may obtain a copy of the License at
9
10        http://www.apache.org/licenses/LICENSE-2.0
11
12    Unless required by applicable law or agreed to in writing, software
13    distributed under the License is distributed on an "AS IS" BASIS,
14    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15    See the License for the specific language governing permissions and
16    limitations under the License.
17 ==================================================================================
18 .fi
19
20 .if false
21     Mnemonic:   setup.im
22     Abstract:   Look at environment variables and pull in the correct setup prep
23                 imbed file based on the desired output type (when running tfm).
24                 Obviously, when running pfm we are always generating postscript
25                 so this isn't really doing much.
26     Date:       29 July 2019
27 .fi
28
29
30 .if ! _setup_im
31         .gv e XFM_IM_LIB lib
32         .if ! lib
33                 .dv lib ../lib
34         .fi
35
36         .** sane default for everything except rst
37         .dv col_width 6.5i
38         .dv textsize 10
39         .dv textfont Helvetica
40
41         .**  imbed output type specific macro file
42         .gv e OUTPUT_TYPE ot
43         .im  &{lib}/&{ot}.im
44
45         .gv e XFM_PASS pass
46         .dv pass &{pass!1}
47
48
49         .**  define a 'subroutine' to add a variable and place it into the forward reference file
50         .**  fref_sub.ca contains code to execute by the set_fref macor and fref.ca contains the
51         .**  forward references to include during pass2. The macro set_ref will define the variable
52         .**  passed as $1 (name) with the value passed as $2 and will add it to the fref.ca file.
53         .**
54 .ca shift start fref_sub.ca
55         .ca expand extend fref.ca
56         .dv &vname &vval
57         .ca end
58 .ca end
59         .dv set_fref .dv vname $1 ^: .dv vval $2 ^: .dv $1 $2 ^: .im fref_sub.ca
60
61
62         .if &pass 2 =
63                 .im fref.ca
64         .ei
65                 .** initialise the forward ref file
66                 .ca start fref.ca
67                         .** forward reference variables; auto generated
68 .ca end
69         .fi
70
71
72         .** set up for an index when using pfm and snare file is defined
73         .if pfm
74                 .if index_snare_file
75                         .ix space .sp 1 .cc 5 %c .ln  ^: .sp 0
76                         .ix term .br %s  `^`   ^`` %d
77                         .ix groupb .sp .5 %s .br .ll -.25i .in +.25i
78                         .ix groupe .sp .1 .in -.25i .ll +.25i
79                         .if ! index_cols
80                                 .dv index_cols 2
81                         .fi
82
83                         .dv index_col_width [ 6.5 &index_cols / .25 &index_cols 1 - * - ]
84                         .dv index_here  .pa .ju off .st &textsize .cd 1 i=1i w=7 ^: .h1 INDEX ^: .pn off .lw 0 .sp 0 .tt ^: .cd &index_cols i=1i w=&{index_col_width}i  g=.25i ^: .in -i .ll &{index_col_width}i .ix insert
85                         .im &index_snare_file
86                 .fi
87         .fi
88
89         .dv _setup_im 1
90
91 .fi