psection() { Section *sec; Prop *p, *p1; sec = chk_access(); p = sec->prop; Printf("%s {", secname(sec)); Printf(" nseg=%d L=%g Ra=%g", sec->nnode - 1, section_length(sec), nrn_ra(sec)); if (p->dparam[4].val != 1) { Printf(" rallbranch=%g", p->dparam[4].val); } Printf("\n"); if (sec->parentsec) { Printf(" %s ",secname(sec->parentsec)); Printf("connect %s (%g), %g\n", secname(sec), p->dparam[3].val, p->dparam[1].val); } else { v_setup_vectors(); /*SUPPRESS 440*/ Printf(" /*location %g attached to cell %d*/\n", p->dparam[3].val, sec->parentnode->v_node_index); } if (sec->nnode) { /*SUPPRESS 440*/ Printf(" /* First segment only */\n"); p1 = sec->pnode[0]->prop; pnode(p1); } Printf("}\n"); ret(1.); }
static void rv_noexist(Section* sec, const char* n, double x, int err) { char buf[200]; if (err == 2) { sprintf(buf, "%s was not made to point to anything at %s(%g)", n, secname(sec), x); }else if (err == 1) { sprintf(buf, "%s, the mechanism does not exist at %s(%g)", n, secname(sec), x); }else{ sprintf(buf, "%s does not exist at %s(%g)", n, secname(sec), x); } PyErr_SetString(PyExc_NameError, buf); }
void LoadSettings() { std::string ini_filename = File::GetUserPath(D_CONFIG_IDX) + WIIMOTE_INI_NAME ".ini"; IniFile inifile; inifile.Load(ini_filename); for (unsigned int i=0; i<MAX_WIIMOTES; ++i) { std::string secname("Wiimote"); secname += (char)('1' + i); IniFile::Section& sec = *inifile.GetOrCreateSection(secname); sec.Get("Source", &g_wiimote_sources[i], i ? WIIMOTE_SRC_NONE : WIIMOTE_SRC_EMU); } std::string secname("BalanceBoard"); IniFile::Section& sec = *inifile.GetOrCreateSection(secname); sec.Get("Source", &g_wiimote_sources[WIIMOTE_BALANCE_BOARD], WIIMOTE_SRC_NONE); }
print_syn() { int i; if (maxstim == 0) return; /*SUPPRESS 440*/ Printf("fsyn(%d)\n/* section fsyn( #, loc, delay(ms), tau(ms), conduct(uS), erev(mV)) */\n", maxstim); for (i=0; i<maxstim; i++) { Printf("%-15s fsyn(%2d,%4g,%10g,%8g,%14g,%9g)\n", secname(pstim[i].sec), i, pstim[i].loc, pstim[i].delay, pstim[i].duration, pstim[i].mag, pstim[i].erev); } }
void ControllerConfigDiag::Save(wxCommandEvent& event) { std::string ini_filename = File::GetUserPath(D_CONFIG_IDX) + WIIMOTE_INI_NAME ".ini"; IniFile inifile; inifile.Load(ini_filename); for (unsigned int i=0; i<MAX_WIIMOTES; ++i) { std::string secname("Wiimote"); secname += (char)('1' + i); IniFile::Section& sec = *inifile.GetOrCreateSection(secname); sec.Set("Source", (int)g_wiimote_sources[i]); } std::string secname("BalanceBoard"); IniFile::Section& sec = *inifile.GetOrCreateSection(secname); sec.Set("Source", (int)g_wiimote_sources[WIIMOTE_BALANCE_BOARD]); inifile.Save(ini_filename); event.Skip(); }
static void init_msg_ini(void) { if (!msg) { TStrings ht; spstr secname("help"); msg = new_ini(msg_name()); msg->ReadSection(secname, ht); /* merge strings, ended by backslash. ugly, but allows more friendly editing of msg.ini */ l ii=0, lp; while (ii<ht.Count()) { if (ht[ii].trim().lastchar()=='\\') { ht[ii].dellast()+=ht.MergeBackSlash(ii+1,&lp); ht.Delete(ii+1, lp-ii-1); } ii++; } msg->WriteSection(secname, ht, true); } }
static PyObject* NPySecObj_name(NPySecObj* self) { PyObject* result; result = PyString_FromString(secname(self->sec_)); return result; }