/[ascend]/trunk/base/generic/compiler/qlfdid.h
ViewVC logotype

Contents of /trunk/base/generic/compiler/qlfdid.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 64 - (show annotations) (download) (as text)
Wed Nov 30 06:06:46 2005 UTC (14 years, 7 months ago) by johnpye
File MIME type: text/x-chdr
File size: 6817 byte(s)
Moved non-Tcl parts of qlfdid to base/generic.
Moved non-Tcl parts of SimsProc to base/generic/compiler/simlist (changeset 96).
Moved g_compiler_timing to base/generic/compiler/simlist.
1 /*
2 * Qlfdid.h
3 * by Kirk Abbott and Ben Allan
4 * Created: 1/94
5 * Version: $Revision: 1.9 $
6 * Version control file: $RCSfile: Qlfdid.h,v $
7 * Date last modified: $Date: 2003/08/23 18:43:07 $
8 * Last modified by: $Author: ballan $
9 *
10 * This file is part of the ASCEND Tcl/Tk interface
11 *
12 * Copyright 1997, Carnegie Mellon University
13 *
14 * The ASCEND Tcl/Tk interface is free software; you can redistribute
15 * it and/or modify it under the terms of the GNU General Public License as
16 * published by the Free Software Foundation; either version 2 of the
17 * License, or (at your option) any later version.
18 *
19 * The ASCEND Tcl/Tk interface is distributed in hope that it will be
20 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with the program; if not, write to the Free Software Foundation,
26 * Inc., 675 Mass Ave, Cambridge, MA 02139 USA. Check the file named
27 * COPYING. COPYING is found in ../compiler.
28 */
29
30 /** @file
31 * Interface Qualified Id Routines.
32 */
33
34 #ifndef ASC_QLFDID_H
35 #define ASC_QLFDID_H
36
37 #include "utilities/ascConfig.h"
38 #include "general/list.h"
39 #include "instance_enum.h"
40
41 struct SearchEntry {
42 char *name; /**< name of the instance */
43 struct Instance *i; /**< pointer to the instance */
44 };
45
46 extern struct Instance *g_search_inst;
47 /**< Result of the last qlfdid search of any kind in c or tcl. */
48
49 extern struct Instance *g_relative_inst;
50 /**<
51 * Result of the last qlfdid search of any kind in tcl.
52 * (C calls to qlfdid routines do not change this.)
53 * 'qlfdid' and 'probe qlfdid' are known to set it.
54 */
55
56 extern char *Asc_MakeInitString(int len);
57 /**<
58 * <!-- Asc_MakeInitString(int len); -->
59 * Will make a string of the specified length of a predefine default
60 * length if garbage is given. Will initialize the string to the mt string.
61 * Will return a pointer to the string;
62 */
63
64 extern void Asc_ReInitString(char *str);
65 /**<
66 * <!-- Asc_ReInitString; -->
67 * <!-- char *str; -->
68 * We will reinitialize a string of non-zero length to the mt string.
69 * If an ivalid string will leave it untouched.
70 */
71
72 extern struct SearchEntry *Asc_SearchEntryCreate(char *name,
73 struct Instance *i);
74 /**<
75 * <!-- Asc_SearchEntryCreate(name,i); -->
76 * <!-- char *name; -->
77 * <!-- struct Instance *i; -->
78 * Accepts a string and a pointer to an Instance and will create a
79 * and return a SearchEntry. Will save a copy of the string. Will always
80 * try to make space for the string.
81 */
82
83 extern struct Instance *Asc_SearchEntryInstance(struct SearchEntry *se);
84 /**<
85 * <!-- Asc_SearchEntryInstance(se); -->
86 * <!-- struct SearchEntry *se; -->
87 * Returns a the instance pointer from a search entry;
88 */
89
90 extern char *Asc_SearchEntryName(struct SearchEntry *se);
91 /**<
92 * <!-- Asc_SearchEntryName(se) -->
93 * <!-- struct SearchEntry *se; -->
94 * Returns the name of a search entry;
95 */
96
97 extern void Asc_SearchEntryDestroy(struct SearchEntry *se);
98 /**<
99 * <!-- Asc_SearchEntryDestroy(se); -->
100 * <!-- struct SearchEntry *se; -->
101 * Will delete the memory associated with its string, set its pointers
102 * to NULL, and free the memory associated with a SearchEntry.
103 */
104
105 extern void Asc_SearchListDestroy(struct gl_list_t *search_list);
106 /**<
107 * <!-- Asc_SearchListDestroy(search_list); -->
108 * <!-- struct gl_list_t *search_list; -->
109 * Frees up the memory that was allocated for the search_list which is
110 * a list of SearchEntry(s).
111 */
112
113 extern struct gl_list_t *Asc_BrowQlfdidSearch(char *str, char *temp);
114 /**<
115 * <!-- Asc_BrowQlfdidSearch(str,temp) -->
116 * <!-- char *str, char *temp; -->
117 * Will accept two strings, both of which will be destroyed by the
118 * operation. Searches for an instance of the qualified name. Will
119 * return of a list (of SearchEntries), with each list element being
120 * a pointer to a level in the instance tree of the qualified id and
121 * 'g_search_inst' looking at the last part of the instance name.
122 * Will return NULL, whenever the qualified instance name cannot be found.
123 * If it returns NULL, the list does not exist; don't try to destroy it.
124 */
125
126 extern int Asc_QlfdidSearch2(char *str);
127 /**<
128 * <!-- Asc_QlfdidSearch2(str); -->
129 * <!-- char *str; -->
130 * This function is perhaps the entry point suited for most users.
131 * It uses the function Asc_BrowQlfdidSearch(), and will leave the g_search_inst
132 * looking at the found instance, or NULL. It attempts to avoid the
133 * overhead of creating search entries, for cases where the user only
134 * wants to find the instance associated with the given qualfied id.
135 * However because it still uses Asc_BrowQlfdidSearch, it incurs the cost
136 * of creating the path to the instance. For cases where this path is
137 * of no interest, but just the final instance use Asc_QlfdidSearch3 below.
138 * Returns 0 if found, 1 otherwise.
139 */
140
141 extern int Asc_QlfdidSearch3(CONST char *str, int relative);
142 /**<
143 * <!-- Asc_QlfdidSearch3(str,relative); -->
144 * <!-- const char *str; -->
145 * <!-- int relative; -->
146 * This function is still yet another entry point to the search routines.
147 * It uses the function BrowQlfdidSearch3, and will leave the g_search_inst
148 * looking at the found instance, or NULL. It attempts to avoid the
149 * overhead of creating search entries, for cases where the user only
150 * wants to find the instance associated with the given qualfied id.
151 * Returns 0 if found, 1 otherwise. This is perhaps the fastest
152 * version of the search codes.<br><br>
153 / *
154 * If relative = 1 will start search at g_relative_inst whose value
155 * should be set by a call to qlfdid (tcl) or Asc_BrowQlfdidSearchCmd (c).
156 * Note that if the relative option is used str should be relative to
157 * g_relative_inst NOT to the simulation root.
158 */
159
160 #endif /* Qlfdid_module_loaded */
161

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22