comparison src/symtab.cc @ 5864:e884ab4f29ee

[project @ 2006-06-22 00:57:27 by jwe]
author jwe
date Thu, 22 Jun 2006 00:57:28 +0000
parents 2a6cb4ed8f1e
children 4036e6fca790
comparison
equal deleted inserted replaced
5863:4c16f3104aa5 5864:e884ab4f29ee
85 retval = "user-defined function"; 85 retval = "user-defined function";
86 else if (is_builtin_function ()) 86 else if (is_builtin_function ())
87 retval = "built-in function"; 87 retval = "built-in function";
88 else if (is_dld_function ()) 88 else if (is_dld_function ())
89 retval = "dynamically-linked function"; 89 retval = "dynamically-linked function";
90 else if (is_mex_function ())
91 retval = "dynamically-linked mex function";
90 92
91 return retval; 93 return retval;
92 } 94 }
93 95
94 void 96 void
146 std::string 148 std::string
147 SYMBOL_DEF::which (const std::string& name) 149 SYMBOL_DEF::which (const std::string& name)
148 { 150 {
149 std::string retval; 151 std::string retval;
150 152
151 if (is_user_function () || is_dld_function ()) 153 if (is_user_function () || is_dld_function () || is_mex_function ())
152 { 154 {
153 octave_function *defn = definition.function_value (); 155 octave_function *defn = definition.function_value ();
154 156
155 if (defn) 157 if (defn)
156 retval = defn->fcn_file_name (); 158 retval = defn->fcn_file_name ();
164 void 166 void
165 SYMBOL_DEF::which (std::ostream& os, const std::string& name) 167 SYMBOL_DEF::which (std::ostream& os, const std::string& name)
166 { 168 {
167 os << name; 169 os << name;
168 170
169 if (is_user_function () || is_dld_function ()) 171 if (is_user_function () || is_dld_function () || is_mex_function ())
170 { 172 {
171 octave_function *defn = definition.function_value (); 173 octave_function *defn = definition.function_value ();
172 174
173 std::string fn = defn ? defn->fcn_file_name () : std::string (); 175 std::string fn = defn ? defn->fcn_file_name () : std::string ();
174 176
825 { 827 {
826 symbol_record *ptr = table[i].next (); 828 symbol_record *ptr = table[i].next ();
827 829
828 while (ptr) 830 while (ptr)
829 { 831 {
830 if (ptr->is_user_function () || ptr->is_dld_function ()) 832 if (ptr->is_user_function ()
833 || ptr->is_dld_function ()
834 || ptr->is_mex_function ())
831 ptr->clear (); 835 ptr->clear ();
832 836
833 ptr = ptr->next (); 837 ptr = ptr->next ();
834 } 838 }
835 } 839 }
925 symbol_record *ptr = table[index].next (); 929 symbol_record *ptr = table[index].next ();
926 930
927 while (ptr) 931 while (ptr)
928 { 932 {
929 if (ptr->name () == nm 933 if (ptr->name () == nm
930 && (ptr->is_user_function () || ptr->is_dld_function ())) 934 && (ptr->is_user_function ()
935 || ptr->is_dld_function ()
936 || ptr->is_mex_function ()))
931 { 937 {
932 ptr->clear (); 938 ptr->clear ();
933 return true; 939 return true;
934 } 940 }
935 ptr = ptr->next (); 941 ptr = ptr->next ();
1009 { 1015 {
1010 symbol_record *ptr = table[i].next (); 1016 symbol_record *ptr = table[i].next ();
1011 1017
1012 while (ptr) 1018 while (ptr)
1013 { 1019 {
1014 if (ptr->is_user_function () || ptr->is_dld_function ()) 1020 if (ptr->is_user_function ()
1021 || ptr->is_dld_function ()
1022 || ptr->is_mex_function ())
1015 { 1023 {
1016 glob_match pattern (pat); 1024 glob_match pattern (pat);
1017 1025
1018 if (pattern.match (ptr->name ())) 1026 if (pattern.match (ptr->name ()))
1019 { 1027 {