Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

mbkfopen(3) [debian man page]

MBKFOPEN(3)						       MBK UTILITY FUNCTIONS						       MBKFOPEN(3)

NAME
mbkfopen - open a file with several search pathes ORIGIN
This software belongs to the ALLIANCE CAD SYSTEM developed by the ASIM team at LIP6 laboratory of Universite Pierre et Marie CURIE, in Paris, France. Web : http://asim.lip6.fr/recherche/alliance/ E-mail : alliance-users@asim.lip6.fr SYNOPSYS
#include "mut.h" FILE *mbkfopen(name, extension, mode) char *name, *extension, *mode; PARAMETERS
name Name of the file to be opened extension Extension to the file name model File opening mode DESCRIPTION
mbkfopen opens a file, searching it through the pathes given in the environment variables MBK_CATA_LIB(1) and MBK_WORK_LIB(1). Its main issue is to enable simple file access for any program that works with mbk path environment variables. The file to be opened is called name.extension, if extension is not NULL, else it is name. If extension is the empty string, "", then the file name will be name. . The legal values for mode are READ_TEXT opens for reading WRITE_TEXT discards and opens for writting since disk access should be a straight forward operation knowing mbk's needs. The search algorithm depends on the value of mode. If mode is WRITE_TEXT, then the file is open for writting in MBK_WORK_LIB(1). If mode is READ_TEXT then the file is first searched through MBK_WORK_LIB(1), and if not found, through each directory specified in MBK_CATA_LIB(1), in the order of declaration under unix. No internal hash table is generated, in order to let the user choose its direc- tory priority. As soon as the file is found, it is opened. There is no check for redundant files in the specified pathes, since it is neither illegal nor bad to have many files with the same names. RETURN VALUE
mbkfopen returns a pointer to the opened file. If the file read or write access are violated, or the file not found, a NULL pointer is returned. ERROR
"*** mbk error *** mbkfopen : unknown file opening mode mode" The mode parameter is not one of the two legal values. EXAMPLE
#include "mut.h" #include "mph.h" phfig_list *load_vti_ph(name) char *name; { FILE *file; if ((file = mbkfopen(name, "cp", READ_TEXT)) == NULL) { (void)fprintf(stderr, "Pfhhh, can't open name.cp "); EXIT(); } ph_parse(file); } SEE ALSO
mbk(1), MBK_CATA_LIB(1), MBK_WORK_LIB(1), loadlofig(3), loadphfig(3), savelofig(3), savephfig(3), fopen(3). BUG REPORT
This tool is under development at the ASIM department of the LIP6 laboratory. We need your feedback to improve documentation and tools. ASIM
/LIP6 October 1, 1997 MBKFOPEN(3)

Check Out this Related Man Page

LOADPHFIG(3)						  MBK PHYSICAL UTILITY FUNCTIONS					      LOADPHFIG(3)

NAME
loadphfig - load a new physical cell model from disk ORIGIN
This software belongs to the ALLIANCE CAD SYSTEM developed by the ASIM team at LIP6 laboratory of Universite Pierre et Marie CURIE, in Paris, France. Web : http://asim.lip6.fr/recherche/alliance/ E-mail : alliance-users@asim.lip6.fr SYNOPSYS
#include "mph.h" void loadphfig(ptfig, figname, mode) phfig_list *ptfig; char *figname; char mode; PARAMETERS
ptfig Pointer to an allocated but empty phfig figname Name of the figure to be loaded mode Loading mode DESCRIPTION
loadphfig fills the phfig pointed to by ptfig with the contents of a disk file called figname. The loading mode may be either 'A', then the entire content is parsed, or 'P' then only connectors, abutment box, and through routes are loaded, or 'C', that finishes to fill an already loaded figure in 'P' mode, in order to have it all in memory. This last mode allows to keep the same ptfig pointer when reaccessing the same file. The loadphfig function in fact performs a call to a parser, choosen by the MBK_IN_PH(1) environment variable. The directories seached for the file are first the one set by MBK_WORK_LIB(1) and then, in the described order, the ones set by MBK_CATA_LIB(1). See MBK_IN_PH(1), MBK_WORK_LIB(1), MBK_CATA_LIB(1) and mbkenv(3) for details. ERRORS
Some errors resulting from a call to loadphfig are due to the parsers, and are prefixed by the parser format (pf). "*** mbk error *** not supported physical input format 'xxx'" The environment variable MBK_IN_PH is not set to a legal physical format. "*** mbk error *** pfloadphfig : could not open file figname" No file called figname.ext, where ext is the file format extension, has been found in the directories set by the environment. "*** mbk error *** pfloadphfig : syntax error line x parsing figname.ext" Either the file has been corrupted and its syntax is not legal, or there is a bug in the given parser. EXAMPLE
#include "mph.h" phfig_list *get_the_phfig(figname, mode) char *figname; char mode; { phfig_list *pt; for (pt = HEAD_PHFIG; pt; pt = pt->NEXT) /* scan figure list */ if (!strcmp(pt->NAME, figname)) break; if (!pt) { /* figure doesn't exist */ pt = addphfig(figname); pt->MODE = mode == 'A' ? mode : 'P'; loadphfig(pt, figname, pt->MODE); return pt; } if (ptfig->MODE != 'A') { /* figure exists interface only */ if (mode == 'A') { pt->MODE = 'A'; loadphfig(pt, figname, 'C'); return pt; } else return pt; } else /* figure exists interface and body */ return pt; } SEE ALSO
mbk(1), mbkenv(3), phfig(3), addphfig(3), getphfig(3), delphfig(3), savephfig(3), flattenphfig(3), rflattenphfig(3), MBK_IN_PH(1), MBK_WORK_LIB(1), MBK_CATA_LIB(1). BUG REPORT
This tool is under development at the ASIM department of the LIP6 laboratory. We need your feedback to improve documentation and tools. ASIM
/LIP6 October 1, 1997 LOADPHFIG(3)
Man Page