NEURON
cabcode.cpp File Reference
#include <../../nrnconf.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <nrnpython_config.h>
#include "section.h"
#include "nrniv_mf.h"
#include "membfunc.h"
#include "parse.hpp"
#include "hocparse.h"
#include "membdef.h"

Go to the source code of this file.

Macros

#define HOC_L_LIST   1
 
#define symlist   hoc_symlist
 
#define NSECSTACK   200
 
#define CAB_SIZE   10
 
#define PI   3.14159265358979323846
 
#define relative(pc)   (pc + (pc)->i)
 

Functions

static int range_vec_indx (Symbol *s)
 
int nrn_isecstack (void)
 
void nrn_secstack (int i)
 
void nrn_initcode (void)
 
void oc_save_cabcode (int *a1, int *a2)
 
void oc_restore_cabcode (int *a1, int *a2)
 
void nrn_pushsec (Section *sec)
 
void nrn_popsec (void)
 
void sec_access_pop (void)
 
void add_section (void)
 
Objectnrn_sec2cell (Section *sec)
 
int nrn_sec2cell_equals (Section *sec, Object *obj)
 
static Sectionnew_section (Object *ob, Symbol *sym, int i)
 
void new_sections (Object *ob, Symbol *sym, Item **pitm, int size)
 
void delete_section (void)
 
double section_length (Section *sec)
 
int arc0at0 (Section *sec)
 
double nrn_ra (Section *sec)
 
void cab_alloc (Prop *p)
 
void morph_alloc (Prop *p)
 
double nrn_diameter (Node *nd)
 
void nrn_chk_section (Symbol *s)
 
Sectionchk_access (void)
 
 if (!sec)
 
 if (sec->prop)
 
Sectionnrn_noerr_access (void)
 
void nrn_remove_sibling_list (Section *sec)
 
static double ncp_abs (Section *sec)
 
void nrn_add_sibling_list (Section *sec)
 
static void reverse_sibling_list (Section *sec)
 
void disconnect (void)
 
static void reverse_nodes (Section *sec)
 
void nrn_disconnect (Section *sec)
 
static void connectsec_impl (Section *parent, Section *sec)
 
void simpleconnectsection (void)
 
void connectsection (void)
 
static SectionSec_access (void)
 
void sec_access (void)
 
void sec_access_object (void)
 
void sec_access_push (void)
 
Sectionnrn_sec_pop (void)
 
void hoc_sec_internal_push (void)
 
voidhoc_sec_internal_name2ptr (const char *s, int eflag)
 
voidhoc_pysec_name2ptr (const char *s, int eflag)
 
void ob_sec_access_push (Item *qsec)
 
void ob_sec_access (void)
 
void mech_access (void)
 
void mech_insert1 (Section *sec, int type)
 
void mech_uninsert (void)
 
void mech_uninsert1 (Section *sec, Symbol *s)
 
void nrn_rangeconst (Section *sec, Symbol *s, double *pd, int op)
 
void range_const (void)
 
Propnrn_mechanism (int type, Node *nd)
 
Propnrn_mechanism_check (int type, Section *sec, int inode)
 
Prophoc_getdata_range (int type)
 
static Datumpdprop (Symbol *s, int indx, Section *sec, short inode)
 
void connectpointer (void)
 
void range_interpolate_single (void)
 
void range_interpolate (void)
 
int nrn_exists (Symbol *s, Node *node)
 
double * nrn_rangepointer (Section *sec, Symbol *s, double d)
 
double * nrnpy_rangepointer (Section *sec, Symbol *s, double d, int *err)
 
void rangevarevalpointer (void)
 
void rangevareval (void)
 
void rangepoint (void)
 
int node_index (Section *sec, double x)
 
int node_index_exact (Section *sec, double x)
 
double cable_prop_eval (Symbol *sym)
 
double * cable_prop_eval_pointer (Symbol *sym)
 
void keep_nseg_parm (void)
 
void nrn_change_nseg (Section *sec, int n)
 
void cable_prop_assign (Symbol *sym, double *pd, int op)
 
double nrn_connection_position (Section *sec)
 
double nrn_section_orientation (Section *sec)
 
int nrn_at_beginning (Section *sec)
 
static void nrn_rootnode_alloc (Section *sec)
 
Sectionnrn_trueparent (Section *sec)
 
void nrn_parent_info (Section *s)
 
void setup_topology (void)
 
 section_order ()
 
const char * secname (Section *sec)
 
const char * nrn_sec2pysecname (Section *sec)
 
void section_owner (void)
 
char * hoc_section_pathname (Section *sec)
 
double nrn_arc_position (Section *sec, Node *node)
 
const char * sec_and_position (Section *sec, Node *nd)
 
int segment_limits (double *pdx)
 
Nodenode_exact (Section *sec, double x)
 
Nodenode_ptr (Section *sec, double x, double *parea)
 
int nrn_get_mechtype (const char *mechname)
 
int nrn_instance_count (int mechtype)
 
double * nrn_vext_pd (Symbol *s, int indx, Node *nd)
 
double * dprop (Symbol *s, int indx, Section *sec, short inode)
 
double * nrnpy_dprop (Symbol *s, int indx, Section *sec, short inode, int *err)
 
static char * objectname (void)
 
void forall_section (void)
 
void hoc_ifsec (void)
 
void issection (void)
 
int has_membrane (char *mechanism_name, Section *sec)
 
void ismembrane (void)
 
const char * secaccessname (void)
 
void sectionname (void)
 
void hoc_secname (void)
 
static double chk_void2dbl (void *vp, const char *mes)
 
void this_section (void)
 
void this_node (void)
 
void parent_section (void)
 
void parent_connection (void)
 
void section_orientation (void)
 
void parent_node (void)
 
void pop_section (void)
 
void hoc_level_pushsec (Section *sec)
 
void push_section (void)
 
 if (!sec||!sec->prop||!sec->prop->dparam||!sec->prop->dparam[8].itm||sec->prop->dparam[8].itm->itemtype !=SECTION)
 
 hoc_level_pushsec (sec)
 
 hoc_retpushx (1.0)
 
Sectionnrn_section_exists (char *name, int indx, Object *cell)
 
void section_exists (void)
 

Variables

int hoc_execerror_messages
 
int tree_changed = 1
 
int diam_changed = 1
 
int nrn_shape_changed_
 
int v_structure_change = 1
 
char *(* nrnpy_pysec_name_p_ )(Section *)
 
Object *(* nrnpy_pysec_cell_p_ )(Section *)
 
int(* nrnpy_pysec_cell_equals_p_ )(Section *, Object *)
 
static Sectionsecstack [NSECSTACK+1]
 
static int isecstack = 0
 
static int skip_secstack_check = 0
 
 else
 
return NULL
 
int keep_nseg_parm_
 

Macro Definition Documentation

◆ CAB_SIZE

#define CAB_SIZE   10

◆ HOC_L_LIST

#define HOC_L_LIST   1

Definition at line 4 of file cabcode.cpp.

◆ NSECSTACK

#define NSECSTACK   200

Definition at line 42 of file cabcode.cpp.

◆ PI

#define PI   3.14159265358979323846

Definition at line 1954 of file cabcode.cpp.

◆ relative

#define relative (   pc)    (pc + (pc)->i)

Definition at line 2149 of file cabcode.cpp.

◆ symlist

#define symlist   hoc_symlist

Definition at line 17 of file cabcode.cpp.

Function Documentation

◆ add_section()

void add_section ( void  )

Definition at line 185 of file cabcode.cpp.

◆ arc0at0()

int arc0at0 ( Section sec)

Definition at line 387 of file cabcode.cpp.

◆ cab_alloc()

void cab_alloc ( Prop p)

Definition at line 397 of file cabcode.cpp.

◆ cable_prop_assign()

void cable_prop_assign ( Symbol sym,
double *  pd,
int  op 
)

Definition at line 1602 of file cabcode.cpp.

◆ cable_prop_eval()

double cable_prop_eval ( Symbol sym)

Definition at line 1518 of file cabcode.cpp.

◆ cable_prop_eval_pointer()

double* cable_prop_eval_pointer ( Symbol sym)

Definition at line 1538 of file cabcode.cpp.

◆ chk_access()

Section* chk_access ( void  )

Definition at line 437 of file cabcode.cpp.

◆ chk_void2dbl()

static double chk_void2dbl ( void vp,
const char *  mes 
)
static

Definition at line 2296 of file cabcode.cpp.

◆ connectpointer()

void connectpointer ( void  )

Definition at line 1125 of file cabcode.cpp.

◆ connectsec_impl()

static void connectsec_impl ( Section parent,
Section sec 
)
static

Definition at line 605 of file cabcode.cpp.

◆ connectsection()

void connectsection ( void  )

Definition at line 664 of file cabcode.cpp.

◆ delete_section()

void delete_section ( void  )

Definition at line 313 of file cabcode.cpp.

◆ disconnect()

void disconnect ( void  )

Definition at line 562 of file cabcode.cpp.

◆ dprop()

double* dprop ( Symbol s,
int  indx,
Section sec,
short  inode 
)

Definition at line 2073 of file cabcode.cpp.

◆ forall_section()

void forall_section ( void  )

Definition at line 2151 of file cabcode.cpp.

◆ has_membrane()

int has_membrane ( char *  mechanism_name,
Section sec 
)

Definition at line 2246 of file cabcode.cpp.

◆ hoc_getdata_range()

Prop* hoc_getdata_range ( int  type)

Definition at line 1106 of file cabcode.cpp.

◆ hoc_ifsec()

void hoc_ifsec ( void  )

Definition at line 2221 of file cabcode.cpp.

◆ hoc_level_pushsec() [1/2]

void hoc_level_pushsec ( Section sec)

Definition at line 2375 of file cabcode.cpp.

◆ hoc_level_pushsec() [2/2]

hoc_level_pushsec ( sec  )

◆ hoc_retpushx()

hoc_retpushx ( 1.  0)

◆ hoc_sec_internal_push()

void hoc_sec_internal_push ( void  )

Definition at line 750 of file cabcode.cpp.

◆ hoc_secname()

void hoc_secname ( void  )

Definition at line 2283 of file cabcode.cpp.

◆ hoc_section_pathname()

char* hoc_section_pathname ( Section sec)

Definition at line 1846 of file cabcode.cpp.

◆ if() [1/3]

if ( sec)

Definition at line 453 of file cabcode.cpp.

◆ if() [2/3]

if ( sec->  prop)

Definition at line 456 of file cabcode.cpp.

◆ if() [3/3]

if ( !sec||!sec->prop||!sec->prop->dparam||!sec->prop->dparam.itm||sec->prop->dparam.itm->itemtype !  [8][8] = SECTION)

Definition at line 2399 of file cabcode.cpp.

◆ ismembrane()

void ismembrane ( void  )

Definition at line 2258 of file cabcode.cpp.

◆ issection()

void issection ( void  )

Definition at line 2237 of file cabcode.cpp.

◆ keep_nseg_parm()

void keep_nseg_parm ( void  )

Definition at line 1554 of file cabcode.cpp.

◆ mech_access()

void mech_access ( void  )

Definition at line 839 of file cabcode.cpp.

◆ mech_insert1()

void mech_insert1 ( Section sec,
int  type 
)

Definition at line 845 of file cabcode.cpp.

◆ mech_uninsert()

void mech_uninsert ( void  )

Definition at line 907 of file cabcode.cpp.

◆ mech_uninsert1()

void mech_uninsert1 ( Section sec,
Symbol s 
)

Definition at line 913 of file cabcode.cpp.

◆ morph_alloc()

void morph_alloc ( Prop p)

Definition at line 413 of file cabcode.cpp.

◆ ncp_abs()

static double ncp_abs ( Section sec)
static

Definition at line 510 of file cabcode.cpp.

◆ new_section()

static Section* new_section ( Object ob,
Symbol sym,
int  i 
)
static

Definition at line 250 of file cabcode.cpp.

◆ new_sections()

void new_sections ( Object ob,
Symbol sym,
Item **  pitm,
int  size 
)

Definition at line 280 of file cabcode.cpp.

◆ node_exact()

Node* node_exact ( Section sec,
double  x 
)

Definition at line 1956 of file cabcode.cpp.

◆ node_index()

int node_index ( Section sec,
double  x 
)

Definition at line 1470 of file cabcode.cpp.

◆ node_index_exact()

int node_index_exact ( Section sec,
double  x 
)

Definition at line 1496 of file cabcode.cpp.

◆ node_ptr()

Node* node_ptr ( Section sec,
double  x,
double *  parea 
)

Definition at line 2003 of file cabcode.cpp.

◆ nrn_add_sibling_list()

void nrn_add_sibling_list ( Section sec)

Definition at line 520 of file cabcode.cpp.

◆ nrn_arc_position()

double nrn_arc_position ( Section sec,
Node node 
)

Definition at line 1880 of file cabcode.cpp.

◆ nrn_at_beginning()

int nrn_at_beginning ( Section sec)

Definition at line 1656 of file cabcode.cpp.

◆ nrn_change_nseg()

void nrn_change_nseg ( Section sec,
int  n 
)

Definition at line 1561 of file cabcode.cpp.

◆ nrn_chk_section()

void nrn_chk_section ( Symbol s)

Definition at line 430 of file cabcode.cpp.

◆ nrn_connection_position()

double nrn_connection_position ( Section sec)

Definition at line 1645 of file cabcode.cpp.

◆ nrn_diameter()

double nrn_diameter ( Node nd)

Definition at line 423 of file cabcode.cpp.

◆ nrn_disconnect()

void nrn_disconnect ( Section sec)

Definition at line 584 of file cabcode.cpp.

◆ nrn_exists()

int nrn_exists ( Symbol s,
Node node 
)

Definition at line 1317 of file cabcode.cpp.

◆ nrn_get_mechtype()

int nrn_get_mechtype ( const char *  mechname)

Definition at line 2017 of file cabcode.cpp.

◆ nrn_initcode()

void nrn_initcode ( void  )

Definition at line 72 of file cabcode.cpp.

◆ nrn_instance_count()

int nrn_instance_count ( int  mechtype)

Definition at line 2029 of file cabcode.cpp.

◆ nrn_isecstack()

int nrn_isecstack ( void  )

Definition at line 54 of file cabcode.cpp.

◆ nrn_mechanism()

Prop* nrn_mechanism ( int  type,
Node nd 
)

Definition at line 1079 of file cabcode.cpp.

◆ nrn_mechanism_check()

Prop* nrn_mechanism_check ( int  type,
Section sec,
int  inode 
)

Definition at line 1092 of file cabcode.cpp.

◆ nrn_noerr_access()

Section* nrn_noerr_access ( void  )

Definition at line 464 of file cabcode.cpp.

◆ nrn_parent_info()

void nrn_parent_info ( Section s)

Definition at line 1689 of file cabcode.cpp.

◆ nrn_popsec()

void nrn_popsec ( void  )

Definition at line 122 of file cabcode.cpp.

◆ nrn_pushsec()

void nrn_pushsec ( Section sec)

Definition at line 97 of file cabcode.cpp.

◆ nrn_ra()

double nrn_ra ( Section sec)

Definition at line 392 of file cabcode.cpp.

◆ nrn_rangeconst()

void nrn_rangeconst ( Section sec,
Symbol s,
double *  pd,
int  op 
)

Definition at line 956 of file cabcode.cpp.

◆ nrn_rangepointer()

double* nrn_rangepointer ( Section sec,
Symbol s,
double  d 
)

Definition at line 1334 of file cabcode.cpp.

◆ nrn_remove_sibling_list()

void nrn_remove_sibling_list ( Section sec)

Definition at line 493 of file cabcode.cpp.

◆ nrn_rootnode_alloc()

static void nrn_rootnode_alloc ( Section sec)
static

Definition at line 1662 of file cabcode.cpp.

◆ nrn_sec2cell()

Object* nrn_sec2cell ( Section sec)

Definition at line 224 of file cabcode.cpp.

◆ nrn_sec2cell_equals()

int nrn_sec2cell_equals ( Section sec,
Object obj 
)

Definition at line 239 of file cabcode.cpp.

◆ nrn_sec2pysecname()

const char* nrn_sec2pysecname ( Section sec)

Definition at line 1821 of file cabcode.cpp.

◆ nrn_sec_pop()

Section* nrn_sec_pop ( void  )

Definition at line 743 of file cabcode.cpp.

◆ nrn_secstack()

void nrn_secstack ( int  i)

Definition at line 58 of file cabcode.cpp.

◆ nrn_section_exists()

Section* nrn_section_exists ( char *  name,
int  indx,
Object cell 
)

Definition at line 2409 of file cabcode.cpp.

◆ nrn_section_orientation()

double nrn_section_orientation ( Section sec)

Definition at line 1651 of file cabcode.cpp.

◆ nrn_trueparent()

Section* nrn_trueparent ( Section sec)

Definition at line 1676 of file cabcode.cpp.

◆ nrn_vext_pd()

double* nrn_vext_pd ( Symbol s,
int  indx,
Node nd 
)

Definition at line 2044 of file cabcode.cpp.

◆ nrnpy_dprop()

double* nrnpy_dprop ( Symbol s,
int  indx,
Section sec,
short  inode,
int err 
)

Definition at line 2105 of file cabcode.cpp.

◆ nrnpy_rangepointer()

double* nrnpy_rangepointer ( Section sec,
Symbol s,
double  d,
int err 
)

Definition at line 1374 of file cabcode.cpp.

◆ ob_sec_access()

void ob_sec_access ( void  )

Definition at line 827 of file cabcode.cpp.

◆ ob_sec_access_push()

void ob_sec_access_push ( Item qsec)

Definition at line 819 of file cabcode.cpp.

◆ objectname()

static char* objectname ( void  )
static

Definition at line 2139 of file cabcode.cpp.

◆ oc_restore_cabcode()

void oc_restore_cabcode ( int a1,
int a2 
)

Definition at line 88 of file cabcode.cpp.

◆ oc_save_cabcode()

void oc_save_cabcode ( int a1,
int a2 
)

Definition at line 82 of file cabcode.cpp.

◆ parent_connection()

void parent_connection ( void  )

Definition at line 2343 of file cabcode.cpp.

◆ parent_node()

void parent_node ( void  )

Definition at line 2355 of file cabcode.cpp.

◆ parent_section()

void parent_section ( void  )

Definition at line 2335 of file cabcode.cpp.

◆ pdprop()

static Datum* pdprop ( Symbol s,
int  indx,
Section sec,
short  inode 
)
static

Definition at line 1117 of file cabcode.cpp.

◆ pop_section()

void pop_section ( void  )

Definition at line 2364 of file cabcode.cpp.

◆ push_section()

void push_section ( void  )

Definition at line 2380 of file cabcode.cpp.

◆ range_const()

void range_const ( void  )

Definition at line 1052 of file cabcode.cpp.

◆ range_interpolate()

void range_interpolate ( void  )

Definition at line 1195 of file cabcode.cpp.

◆ range_interpolate_single()

void range_interpolate_single ( void  )

Definition at line 1153 of file cabcode.cpp.

◆ range_vec_indx()

static int range_vec_indx ( Symbol s)
static

Definition at line 1067 of file cabcode.cpp.

◆ rangepoint()

void rangepoint ( void  )

Definition at line 1464 of file cabcode.cpp.

◆ rangevareval()

void rangevareval ( void  )

Definition at line 1455 of file cabcode.cpp.

◆ rangevarevalpointer()

void rangevarevalpointer ( void  )

Definition at line 1410 of file cabcode.cpp.

◆ reverse_nodes()

static void reverse_nodes ( Section sec)
static

Definition at line 570 of file cabcode.cpp.

◆ reverse_sibling_list()

static void reverse_sibling_list ( Section sec)
static

Definition at line 544 of file cabcode.cpp.

◆ Sec_access()

static Section* Sec_access ( void  )
static

Definition at line 672 of file cabcode.cpp.

◆ sec_access()

void sec_access ( void  )

Definition at line 709 of file cabcode.cpp.

◆ sec_access_object()

void sec_access_object ( void  )

Definition at line 721 of file cabcode.cpp.

◆ sec_access_pop()

void sec_access_pop ( void  )

Definition at line 144 of file cabcode.cpp.

◆ sec_access_push()

void sec_access_push ( void  )

Definition at line 738 of file cabcode.cpp.

◆ sec_and_position()

const char* sec_and_position ( Section sec,
Node nd 
)

Definition at line 1922 of file cabcode.cpp.

◆ secaccessname()

const char* secaccessname ( void  )

Definition at line 2267 of file cabcode.cpp.

◆ secname()

const char* secname ( Section sec)

Definition at line 1787 of file cabcode.cpp.

◆ section_exists()

void section_exists ( void  )

Definition at line 2443 of file cabcode.cpp.

◆ section_length()

double section_length ( Section sec)

Definition at line 375 of file cabcode.cpp.

◆ section_order()

section_order ( )

Definition at line 835 of file solve.cpp.

◆ section_orientation()

void section_orientation ( void  )

Definition at line 2349 of file cabcode.cpp.

◆ section_owner()

void section_owner ( void  )

Definition at line 1837 of file cabcode.cpp.

◆ sectionname()

void sectionname ( void  )

Definition at line 2271 of file cabcode.cpp.

◆ segment_limits()

int segment_limits ( double *  pdx)

Definition at line 1934 of file cabcode.cpp.

◆ setup_topology()

void setup_topology ( void  )

Definition at line 1736 of file cabcode.cpp.

◆ simpleconnectsection()

void simpleconnectsection ( void  )

Definition at line 655 of file cabcode.cpp.

◆ this_node()

void this_node ( void  )

Definition at line 2325 of file cabcode.cpp.

◆ this_section()

void this_section ( void  )

Definition at line 2317 of file cabcode.cpp.

Variable Documentation

◆ diam_changed

diam_changed = 1

Definition at line 23 of file cabcode.cpp.

◆ else

else
Initial value:
{
execerror("Accessing a deleted section", (char*)0)
#define execerror
Definition: section.h:36

Definition at line 458 of file cabcode.cpp.

◆ hoc_execerror_messages

int hoc_execerror_messages

Definition at line 666 of file hoc.cpp.

◆ isecstack

int isecstack = 0
static

Definition at line 44 of file cabcode.cpp.

◆ keep_nseg_parm_

int keep_nseg_parm_

Definition at line 1553 of file cabcode.cpp.

◆ nrn_shape_changed_

nrn_shape_changed_

Definition at line 1784 of file cabcode.cpp.

◆ nrnpy_pysec_cell_equals_p_

int(* nrnpy_pysec_cell_equals_p_) (Section *, Object *)

Definition at line 31 of file cabcode.cpp.

◆ nrnpy_pysec_cell_p_

Object*(* nrnpy_pysec_cell_p_) (Section *)

Definition at line 30 of file cabcode.cpp.

◆ nrnpy_pysec_name_p_

char*(* nrnpy_pysec_name_p_) (Section *)

Definition at line 29 of file cabcode.cpp.

◆ NULL

return NULL

Definition at line 461 of file cabcode.cpp.

◆ secstack

Section* secstack[NSECSTACK+1]
static

Definition at line 43 of file cabcode.cpp.

◆ skip_secstack_check

int skip_secstack_check = 0
static

Definition at line 50 of file cabcode.cpp.

◆ tree_changed

tree_changed = 1

Definition at line 19 of file cabcode.cpp.

◆ v_structure_change

v_structure_change = 1

Definition at line 1783 of file cabcode.cpp.