Example:
class TestClass : public TclObject {
public:
TestClass(); /* must have this constructor */
virtual int init(int argc, const char * const *argv) {
int myarg;
BEGIN_PARSE_ARGS(argc, argv);
ARG(my_arg);
END_PARSE_ARGS;
/* ... use 'myarg' in the initialization of this object */
}
int func1(int argc, const char * const *argv) {
char *name;
BEGIN_PARSE_ARGS(argc, argv);
ARG(name);
END_PARSE_ARGS;
// ...
}
int func2(int argc, const char * const *argv) {
BEGIN_PARSE_ARGS(argc, argv);
END_PARSE_ARGS;
// ....
}
}
OTCL_MAPPINGS(TestClass, "TestClass") {
INSTPROC(func1, "func1");
INSTPROC(func2, "func2");
}