1 #include <../../nrnconf.h>
33 auto* sym =
sec->prop->dparam[0].get<
Symbol*>();
34 auto* ob =
sec->prop->dparam[6].get<
Object*>();
35 auto i =
sec->prop->dparam[5].get<
int>();
37 return ob->
u.dataspace[sym->u.oboff].psecitm +
i;
56 static double dummy(
void*
v) {
75 auto* ob =
sec->prop->dparam[6].get<
Object*>();
82 sec->prop->dparam[6] =
static_cast<Object*
>(
nullptr);
84 sec->prop->dparam[0] =
static_cast<Symbol*
>(
nullptr);
103 Printf(
"SectionRef[???].sec is a deleted section\n");
113 if (
sec->prop->dparam[0].get<
Symbol*>()) {
131 Printf(
"The new name already exists and is not a SECTION or has a dimension > 1\n");
138 for (
i = 0;
i <
n; ++
i) {
140 Printf(
"Previously existing %s[%d] points to a section which is being deleted\n",
168 sec->prop->dparam[6] =
static_cast<Object*
>(
nullptr);
171 for (
i = 0;
i < size; ++
i) {
180 if (
sec->prop->dparam[0].get<
Symbol*>()) {
181 Printf(
"Item %d of second list arg, %s, must first be unnamed\n",
i,
secname(
sec));
185 sec->prop->dparam[0] = sym;
186 sec->prop->dparam[5] =
i;
187 sec->prop->dparam[6] =
static_cast<Object*
>(
nullptr);
192 printf(
"SectionRef[???}.rename");
193 i =
sec->prop->dparam[5].i;
200 printf(
"sec->prop->dparam[0].sym->name = %s\n", sym->
name);
204 printf(
"ob->u.dataspace[sym->u.oboff].psecitm = %lx\n", pitm);
206 printf(
"hoc_top_level_data[sym->u.oboff].psecitm = %lx\n", pitm);
213 printf(
"symbol array info ");
220 printf(
"dataspace array info ");
256 return (
double) (
sec->parentsec != (
Section*) 0);
271 return (
double) (
sec->prop != (
Prop*) 0);
326 for (
s =
sec;
s->parentsec;
s =
s->parentsec) {
347 for (
i = 0,
s =
sec->child; i < index && s; s = s->sibling) {
370 s->type = SECTIONREF;
373 s->type = SECTIONREF;
376 s->type = SECTIONREF;
379 s->type = SECTIONREF;
382 s->type = SECTIONREF;
386 s->arayinfo->refcount = 1;
387 s->arayinfo->a_varn =
nullptr;
388 s->arayinfo->nsub = 1;
389 s->arayinfo->sub[0] = 0;
const char * secname(Section *sec)
name of section (for use in error messages)
Section * nrn_trueparent(Section *sec)
void class2oc(const char *, ctor_f *cons, dtor_f *destruct, Member_func *, Member_ret_obj_func *, Member_ret_str_func *)
Symbol * hoc_table_lookup(const char *, Symlist *)
HocReturnType hoc_return_type_code
Object * ivoc_list_item(Object *olist, int i)
size_t hoc_total_array_data(const Symbol *s, Objectdata *obd)
int hoc_arayinfo_install(Symbol *sp, int nsub)
int ivoc_list_count(Object *)
void hoc_freearay(Symbol *sp)
Symbol * hoc_install(const char *, int, double, Symlist **)
bool hoc_stack_type_is_ndim()
Objectdata * hoc_objectdata
char * hoc_object_name(Object *ob)
void hoc_install_object_data_index(Symbol *sp)
Symbol * hoc_lookup(const char *)
Object ** hoc_objgetarg(int)
Symlist * hoc_top_level_symlist
void hoc_execerror(const char *s1, const char *s2)
void * ecalloc(size_t n, size_t size)
static void * emalloc(size_t size)
void hoc_warning(const char *s1, const char *s2)
constexpr do_not_search_t do_not_search
void section_ref(Section *)
void section_unref(Section *)
void sec_free(hoc_Item *)
int const size_t const size_t n
Objectdata * hoc_top_level_data
HOC interpreter function declarations (included by hocdec.h)
Section * nrn_secarg(int i)
void SectionRef_reg(void)
static double s_has_parent(void *v)
Section * nrn_sectionref_steer(Section *sec, Symbol *sym, int *pnindex)
static double s_has_trueparent(void *v)
static Member_func members[]
static hoc_Item ** sec2pitm(Section *sec)
int nrn_secref_nchild(Section *sec)
static void destruct(void *v)
static double s_unname(void *v)
static void * cons(Object *ho)
static double s_rename(void *v)
static double s_nchild(void *v)
static double s_exists(void *v)
static double s_cas(void *v)
Symbol * nrn_trueparent_sym
int Printf(const char *fmt, Args... args)