3 $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/search.c,v 1.4 2005/09/15 18:26:52 rtoy Rel $
5 This code was written as part of the CMU Common Lisp project at
6 Carnegie Mellon University, and has been placed in the public domain.
12 #include "internals.h"
17 search_for_type(int type, lispobj ** start, int *count)
21 while ((*count == -1 || (*count > 0)) &&
22 valid_addr((os_vm_address_t) * start)) {
28 if (TypeOf(obj) == type)
38 search_for_symbol(char *name, lispobj ** start, int *count)
40 struct symbol *symbol;
41 struct vector *symbol_name;
43 while (search_for_type(type_SymbolHeader, start, count)) {
44 symbol = (struct symbol *) PTR((lispobj) * start);
45 if (LowtagOf(symbol->name) == type_OtherPointer) {
46 symbol_name = (struct vector *) PTR(symbol->name);
47 if (valid_addr((os_vm_address_t) symbol_name) &&
48 TypeOf(symbol_name->header) == type_SimpleString &&
49 strcmp((char *) symbol_name->data, name) == 0)