1 #include <../../nrnconf.h>
19 #include "utils/logger.hpp"
28 char*
p = strstr(s1, s2);
31 return double(
p - s1);
39 return double(strlen(
gargstr(1)));
46 std::regex r(
"^(.*)(\n|$)");
48 std::regex_search(
text, sm, r);
54 std::regex r(
gargstr(2), std::regex::egrep);
55 if (std::smatch sm; std::regex_search(
text, sm, r)) {
57 result = sm.prefix().str();
59 }
catch (
const std::regex_error& e) {
60 Fprintf(stderr, fmt::format(
"{}\n", e.what()).c_str());
72 std::regex r(
"^(.*)(\n|$)");
74 std::regex_search(
text, sm, r);
80 std::regex r(
gargstr(2), std::regex::egrep);
81 if (std::smatch sm; std::regex_search(
text, sm, r)) {
82 i = sm.position() + sm.length();
83 result = sm.suffix().str();
85 }
catch (
const std::regex_error& e) {
86 Fprintf(stderr, fmt::format(
"{}\n", e.what()).c_str());
96 std::string chars =
" \r\n\t\f\v";
100 s.erase(0,
s.find_first_not_of(chars));
109 std::string chars =
" \r\n\t\f\v";
113 s.erase(
s.find_last_not_of(chars) + 1);
202 if (!st || st->
type != TEMPLATE) {
207 int id = (*po)->index;
234 if (
s->type == OBJECTVAR &&
s->cpublic < 2) {
236 for (
i = 0;
i < total; ++
i) {
258 if (
s->type == OBJECTVAR &&
s->cpublic < 2) {
260 for (
i = 0;
i < total; ++
i) {
280 if (
s->type == TEMPLATE) {
313 for (
i = 0;
i < list->
count(); ++
i) {
339 Printf(
" found %d of them\n", nr);
369 {
"references",
l_ref},
Symbol * install(const char *)
Symbol * lookup(const char *)
std::map< std::string, Symbol * > symtab_
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
double chkarg(int, double low, double high)
int hoc_is_object_arg(int narg)
void hoc_pushstr(char **d)
size_t hoc_total_array_data(const Symbol *s, Objectdata *obd)
Object ** hoc_temp_objvar(Symbol *symtemp, void *v)
void hoc_assign_str(char **cpp, const char *buf)
void hoc_obj_ref(Object *obj)
char * hoc_object_name(Object *ob)
void ivoc_free_alias(Object *ob)
double * hoc_pgetarg(int narg)
Symbol * hoc_lookup(const char *)
Symbol * ivoc_alias_lookup(const char *name, Object *ob)
char ** hoc_pgargstr(int narg)
Object ** hoc_objgetarg(int)
#define ITERATE(itm, lst)
void hoc_execerror(const char *s1, const char *s2)
static void * emalloc(size_t size)
static int l_ref2(Object *o, Object *ob, int nr)
static double l_is_artificial(void *)
static double l_tail(void *)
static double l_left(void *)
static int l_ref3(Symbol *s, Object *ob, int nr)
Symlist * hoc_top_level_symlist
static int l_ref4(Symbol *s, Object *ob, int nr)
static double l_len(void *)
void StringFunctions_reg()
static void * l_cons(Object *)
static double l_rtrim(void *)
static Object ** l_alias_list(void *)
static double l_substr(void *)
Object * hoc_newobj1(Symbol *, int)
static Member_ret_obj_func l_obj_members[]
static double l_ref(void *)
void hoc_free_symspace(Symbol *)
static double l_head(void *)
static int l_ref1(Symlist *sl, Objectdata *data, Object *ob, int nr)
static double l_right(void *)
int nrn_is_artificial(int)
static double l_is_name(void *)
Objectdata * hoc_top_level_data
static int l_ref0(Symlist *sl, Object *ob, int nr)
Symlist * hoc_built_in_symlist
static Member_func l_members[]
static double l_ltrim(void *)
static double l_is_point(void *)
static double l_alias(void *)
void *(* constructor)(struct Object *)
int Fprintf(FILE *stream, const char *fmt, Args... args)
int Printf(const char *fmt, Args... args)