1 #include <../../nrnconf.h> 30 static const char**
make_m(
bool,
int&,
Symlist*,
char*,
char*);
58 int type = ob->ctemplate->symtable->last->subtype;
63 last_created_pp_ob_ = ob;
80 if (ob->ctemplate->steer) {
90 if (!pp || !pp->
prop) {
98 if (strcmp(name,
"loc") == 0) {
99 int type = ob->ctemplate->symtable->last->subtype;
110 }
else if (strcmp(name,
"has_loc") == 0) {
114 }
else if (strcmp(name,
"get_loc") == 0) {
133 if (nrn_point_prop_) {
135 p->
ob = nrn_point_prop_->
ob;
139 if (last_created_pp_ob_) {
150 last_created_pp_ob_ =
NULL;
172 for (i=0; i <
cnt; ++
i) {
180 for (i=0; i <
cnt; ++
i) {
188 Pvmi cur, jacob, stat, initialize;
200 register_mech(m, hm_alloc, cur, jacob, stat, initialize, -1, 0);
216 char* parnames =
NULL;
218 parnames =
new char[strlen(
gargstr(3)) + 1];
223 if (classsym->
type != TEMPLATE) {
228 const char** m =
make_m(
true, cnt, slist, mname, parnames);
232 for (sp = slist->
first; sp; sp = sp->
next) {
239 for (i=0; i <
cnt; ++
i) {
255 char* parnames =
NULL;
257 parnames =
new char[strlen(
gargstr(2)) + 1];
262 if (classsym->
type != TEMPLATE) {
271 fprintf(stderr,
"%d object(s) of type %s already exist.\n", tp->
count, classsym->
name);
272 hoc_execerror(
"Can't make a template into a PointProcess when instances already exist", 0);
275 const char** m =
make_m(
false, cnt, slist, classsym->
name, parnames);
309 for (i=0; i < s2->
s_varn; ++
i) {
314 for (i=0; i <
cnt; ++
i) {
332 for (sp = slist->
first; sp; sp = sp->
next) {
333 if (sp->
type == VAR) {
340 const char** m =
new const char*[
cnt];
341 for (i=0; i<
cnt; ++
i) {
346 strcpy(cc,
"0"); m[
i] = cc;
349 cc =
new char[strlen(mname)+1];
350 strcpy(cc, mname); m[
i] = cc;
368 char* cp, *csp =
NULL;
369 if(parnames)
for (cp = parnames; cp && *cp; cp = csp) {
370 csp = strchr(cp,
' ');
374 if (!isalpha(*csp)) {
379 sprintf(buf,
"%s_%s", cp, m[1]);
388 cc =
new char[strlen(cp) + strlen(m[1]) + 20];
392 sprintf(cc,
"%s[%d]", buf, imax);
403 for (sp = slist->
first; sp; sp = sp->
next) {
412 for (j=1; j < jmax; ++
j) {
421 cc =
new char[strlen(buf) + 20];
425 sprintf(cc,
"%s[%d]", buf, imax);
void hoc_link_symbol(Symbol *, Symlist *)
size_t hoc_total_array_data(Symbol *s, Objectdata *obd)
char * strstr(cs, ct) char *cs
void print_symlist(const char *, Symlist *)
static const char ** make_m(bool, int &, Symlist *, char *, char *)
double nrn_arc_position(Section *sec, Node *node)
Object * hoc_new_opoint(int)
Symbol * hoc_lookup(const char *)
static void check_list(const char *s, Symlist *sl)
char * hoc_object_name(Object *ob)
static HocMech * common_register(const char **m, Symbol *classsym, Symlist *slist, void(hm_alloc)(Prop *), int &type)
Point_process * ob2pntproc(Object *ob)
sprintf(buf," if (secondorder) {\ " int _i;\" " for(_i=0;_i< %d;++_i) {\" " _p[_slist%d[_i]]+=dt *_p[_dlist%d[_i]];\" " }}\", numeqn, listnum, listnum)
Symbol * hoc_install(const char *, int, double, Symlist **)
void hoc_construct_point(Object *, int)
void * create_point_process(int, Object *)
Point_process * ob2pntproc_0(Object *ob)
int nrn_get_mechtype(const char *mechname)
HocStruct Symbol ** ppsym
void(* Pvmi)(struct NrnThread *, Memb_list *, int)
void nrn_pushsec(Section *sec)
void hoc_free_list(Symlist **)
void hoc_execerror(const char *, const char *)
fprintf(stderr, "Don't know the location of params at %p\, pp)
void nrn_loc_point_process(int, Point_process *, Section *, Node *)
void hoc_unlink_symbol(Symbol *, Symlist *)
int special_pnt_call(Object *ob, Symbol *sym, int narg)
Object * hoc_newobj1(Symbol *, int)
struct Symbol::@52::@53 rng
static void alloc_pnt(Prop *p)
void hoc_register_cvode(int i, nrn_ode_count_t cnt, nrn_ode_map_t map, Pvmi spec, Pvmi matsol)
void register_mech(const char **, Pvmp, Pvmi, Pvmi, Pvmi, Pvmi, int, int)
short cpublic
Note: public is a reserved keyword.
int point_reg_helper(Symbol *)
HocStruct cTemplate * ctemplate
Symbol * hoc_table_lookup(const char *, Symlist *)
Datum * hoc_look_inside_stack(int, int)
double get_loc_point_process(void *)
static void alloc_mech(Prop *p)
static Object * last_created_pp_ob_
double hoc_call_objfunc(Symbol *s, int narg, Object *ob)
static void check(const char *s)
static Node * node(Object *)
Section * chk_access(void)
void * hoc_Ecalloc(size_t nmemb, size_t size)
Node * node_exact(Section *sec, double x)
static void call(Symbol *s, Node *nd, Prop *p)