1 #include <../../nrnconf.h> 31 const char*
concat(
const char* s1,
const char* s2) {
38 tmp =
new char[l1 + l2 + 1];
40 return (
const char*)tmp;
67 void load_mechanism(
Prop*,
int,
const char*);
72 void make_pathname(
const char*,
const char*,
const char*,
int s =
'.');
94 for (i=0; i <
cnt; ++
i) {
99 for (i=0; i <
cnt; ++
i) {
122 if (sym->
type == TEMPLATE) {
180 return si->pysec_ ?
true :
false;
189 if (si->pysec_type_ == PYSECOBJ) {
229 for (
long i=0;
i <
cnt; ++
i) {
248 for (
long i=0;
i <
cnt; ++
i) {
276 if (ob && ob->ctemplate->constructor) {
296 if (ob && ob->ctemplate->is_point_) {
307 cp =
strstr(buf,
"[all]");
310 for (++cp; cp[2]; ++cp) {
339 for (
long i=0;
i <
cnt; ++
i) {
377 whole_array_ = whole_array;
386 whole_array_ = whole_array;
434 if (symbol_)
switch (symbol_->type) {
457 sprintf(buf,
"%s%s%s%c", parent, name, index, suffix);
465 load(type, hoc_built_in_symlist);
466 load(type, hoc_top_level_symlist);
470 load(type, hoc_built_in_symlist);
478 load(type, hoc_symlist);
479 if (hoc_symlist != hoc_built_in_symlist) {
482 load(type, hoc_built_in_symlist);
485 if (hoc_symlist != hoc_top_level_symlist) {
486 load(type, hoc_top_level_symlist);
493 for (sym = sl->
first; sym; sym = sym->
next) {
502 }
else if (sym->
type == type) {
511 if (
obj_->ctemplate->constructor) {
557 load_mechanism(
p, 0, xarg);
575 void SymDirectoryImpl::load_mechanism(
Prop*
p,
int type,
const char*
xarg) {
586 sprintf(buf,
"%s[all]%s", sym->name, xarg);
589 sprintf(buf,
"%s[%d]%s", sym->name, 0, xarg);
591 sprintf(buf,
"%s[%d]%s", sym->name, n-1, xarg);
594 sprintf(buf,
"%s%s", sym->name, xarg);
613 if (n > 5 && sym->
type == VAR) {
616 for (i=0; i <
n; ++
i) {
635 for (i=0; i <
cnt; ++
i) {
int var_type(Symbol *) const
SymDirectory * newsymdir(int index)
size_t hoc_total_array_data(Symbol *s, Objectdata *obd)
char * strstr(cs, ct) char *cs
int hoc_array_index(Symbol *, Objectdata *)
#define ITERATE(itm, lst)
virtual const String & name(int index) const
double nrn_arc_position(Section *sec, Node *node)
const String & name() const
virtual int whole_vector(int index)
implementPtrList(SymbolList, SymbolItem)
char * hoc_object_name(Object *ob)
Object ** object_pobj(Symbol *sym, Objectdata *od)
void append(Symbol *sym, Objectdata *od, Object *o=NULL)
static bool match(const String &name, const String &pattern)
sprintf(buf," if (secondorder) {\ " int _i;\" " for(_i=0;_i< %d;++_i) {\" " _p[_slist%d[_i]]+=dt *_p[_dlist%d[_i]];\" " }}\", numeqn, listnum, listnum)
virtual int count() const
static void Attach(Object *, Observer *)
const char * string() const
int ivoc_vector_size(Object *o)
static void Detach(cTemplate *, Observer *)
int const size_t const size_t n
virtual int index(const String &) const
Symbol * symbol(int index) const
virtual double * variable(int index)
virtual void whole_name(int index, CopyString &) const
Objectdata * hoc_objectdata
static void Attach(cTemplate *, Observer *)
static int compare_entries(const void *k1, const void *k2)
hoc_Item ** object_psecitm(Symbol *sym, Objectdata *od)
void nrn_pushsec(Section *sec)
void hoc_execerror(const char *, const char *)
void make_pathname(const char *, const char *, const char *, int s='.')
#define ForAllSections(sec)
Symlist * hoc_built_in_symlist
void update(Observable *)
HocStruct Object * object_
void nrn_symdir_load_pysec(SymbolList &sl, void *v)
bool is_directory() const
virtual const String & path() const
#define TableIterator(Table)
void section_ref(Section *)
SymbolItem(const char *, int whole_array=0)
virtual bool is_directory(int index) const
friend class SymDirectory
HocStruct cTemplate * ctemplate
double * hoc_val_pointer(const char *s)
int is_obj_type(Object *obj, const char *type_name)
int array_index(int index) const
const char * concat(const char *s1, const char *s2)
static void Detach(Object *, Observer *)
void disconnect(Observable *)
Symlist * hoc_top_level_symlist
char * hoc_araystr(Symbol *sym, int index, Objectdata *obd)
void section_unref(Section *)
virtual bool is_pysec(int index) const
double * ivoc_vector_ptr(Object *o, int index)
Objectdata * hoc_top_level_data