1LOADPHFIG(3) MBK PHYSICAL UTILITY FUNCTIONS LOADPHFIG(3)
2
3
4
6 loadphfig - load a new physical cell model from disk
7
9 #include "mph.h"
10 void loadphfig(ptfig, figname, mode)
11 phfig_list ∗ptfig;
12 char ∗figname;
13 char mode;
14
16 ptfig Pointer to an allocated but empty phfig
17
18 figname Name of the figure to be loaded
19
20 mode Loading mode
21
23 loadphfig fills the phfig pointed to by ptfig with the contents of a
24 disk file called figname. The loading mode may be either 'A', then the
25 entire content is parsed, or 'P' then only connectors, abutment box,
26 and through routes are loaded, or 'C', that finishes to fill an already
27 loaded figure in 'P' mode, in order to have it all in memory. This last
28 mode allows to keep the same ptfig pointer when reaccessing the same
29 file.
30 The loadphfig function in fact performs a call to a parser, chosen by
31 the MBK_IN_PH(1) environment variable. The directories searched for the
32 file are first the one set by MBK_WORK_LIB(1) and then, in the
33 described order, the ones set by MBK_CATA_LIB(1). See MBK_IN_PH(1),
34 MBK_WORK_LIB(1), MBK_CATA_LIB(1) and mbkenv(3) for details.
35
37 Some errors resulting from a call to loadphfig are due to the parsers,
38 and are prefixed by the parser format (pf).
39 "∗∗∗ mbk error ∗∗∗ not supported physical input format 'xxx'"
40 The environment variable MBK_IN_PH is not set to a legal physi‐
41 cal format.
42 "∗∗∗ mbk error ∗∗∗ pfloadphfig : could not open file figname"
43 No file called figname.ext, where ext is the file format exten‐
44 sion, has been found in the directories set by the environment.
45 "∗∗∗ mbk error ∗∗∗ pfloadphfig : syntax error line x parsing fig‐
46 name.ext"
47 Either the file has been corrupted and its syntax is not legal,
48 or there is a bug in the given parser.
49
51 #include "mph.h"
52 phfig_list ∗get_the_phfig(figname, mode)
53 char ∗figname;
54 char mode;
55 {
56 phfig_list ∗pt;
57 for (pt = HEAD_PHFIG; pt; pt = pt->NEXT) /∗ scan figure list ∗/
58 if (!strcmp(pt->NAME, figname))
59 break;
60 if (!pt) { /∗ figure doesn't exist ∗/
61 pt = addphfig(figname);
62 pt->MODE = mode == 'A' ? mode : 'P';
63 loadphfig(pt, figname, pt->MODE);
64 return pt;
65 }
66 if (ptfig->MODE != 'A') { /∗ figure exists interface only ∗/
67 if (mode == 'A') {
68 pt->MODE = 'A';
69 loadphfig(pt, figname, 'C');
70 return pt;
71 } else
72 return pt;
73 } else /∗ figure exists interface and body ∗/
74 return pt;
75 }
76
78 mbk(1), mbkenv(3), phfig(3), addphfig(3), getphfig(3), delphfig(3),
79 savephfig(3), flattenphfig(3), rflattenphfig(3), MBK_IN_PH(1),
80 MBK_WORK_LIB(1), MBK_CATA_LIB(1).
81
82
83
84
85
86
87ASIM/LIP6 October 1, 1997 LOADPHFIG(3)