From: Nobuyoshi Nakada Date: 2007-07-17T15:26:21+09:00 Subject: Re: ruby extension help Hi, At Tue, 17 Jul 2007 11:55:36 +0900, Oliver wrote in [ruby-core:11724]: > The C library I am working on has a so-called dynamic command dispatch > structure, it is basically a hook meant for accommodating a set of > user-provided call back functions. It is defined as follows: > > /* command dispatch structure */ > typedef int (*proxy_cmd)(int trans_id, int nargs, char **args); How would char **args be supplied? > === C usage > > Under normal case, a C library user will supply the following > structure and make use of above structure. > > int my_init(server,port) { ... } > int my_connect( ... ) { ...} > > /* put all function pointer into array */ > proxy_cmd cmds[] = { > my_init, > my_connect, > my_finish, > ... > }; Seems impossible to pass callback arguments per commands, right? If so, it is quite awkward. -- Nobu Nakada