📄 e_graph.c
字号:
/*------------------------------------------------------------------------** Copyright 1998 by Paul Leventis, Jonathan Rose and the University of ** Toronto. Use is permitted, provided that this attribution is retained ** and no part of the code is re-distributed or included in any commercial ** product except by written agreement with the above parties. ** ** For more information, contact us directly: ** Paul Leventis (leventi@eecg.utoronto.ca) ** Jonathan Rose (jayar@eecg.toronto.edu) ** Department of Electrical and Computer Engineering ** University of Toronto, 10 King's College Rd., ** Toronto, Ontario, CANADA M5S 1A4 ** Phone: (416) 978-6992 Fax: (416) 971-2286 **------------------------------------------------------------------------*//* * e_graph.c * * EDIF graph support routines. * This file contains any allocation or deallocation routines. * Removed all allocation routines because I was temporarily insane. * * Note: void pointers are used so that these functions can be arguments into * the hash table libarary. * * Boy, do I wish I could have used C++. * * P. Leventis, July 97*/#include <stdlib.h>#include "e_graph.h"void free_CELL(void *pPayload) { CELL *pCell = (CELL *) pPayload; NETLISTVIEW *pView; if(!pCell) return; pView = pCell->pViewLL; while(pView) { NETLISTVIEW *pTemp = pView->pNextView; free_NETLISTVIEW(pView); pView = pTemp; } free(pCell); }void free_NETLISTVIEW(void *pPayload){ NETLISTVIEW *pView = ((NETLISTVIEW *) pPayload); INSTANCE *pInst; NET *pNet; int i; if(!pView) return; free(pView->name); for(i=0; i<pView->nPorts; i++) free(pView->ports[i].name); pInst = pView->pFirstInstance; while(pInst) { INSTANCE *pTemp = pInst->pNextInstance; free(pInst->name); free(pInst->ports); free(pInst); pInst = pTemp; } pNet = pView->pFirstNet; while(pNet) { NET *pTemp = pNet->pNextNet; free(pNet->name); free(pNet->ports); free(pNet); } free(pView->TT); free(pView);}void free_PORTREF(void *pPayload) { PORTREF *pPortRef = (PORTREF *) pPayload; if(!pPortRef) return; free(pPortRef);}void free_PORT(void *pPayload) { PORT *pPort = (PORT *) pPayload; if(!pPort) return; free(pPort->name); free(pPort);}void free_LIBRARY(void *pPayload) { LIBRARY *pLibrary = (LIBRARY *) pPayload; free(pLibrary->name); hash_free(pLibrary->pCellHT); free(pPayload);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -