lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


tolua does not handle function pointers.
you have to bind the callback functions manually.

-- waldemar

At 00:43 30/3/2004 -0800, you wrote:
Dear Lua list,

I'm trying to bind the random number generation part of the GNU scientific library (GSL) to Lua using tolua. All the functions seem to wrap just fine, but tolua (v5) chokes on gsl_rng_type with a 405:parse error, associated with the pointers to functions within the struct. Any ideas on how to get round this?

Thanks!
Simon
****

typedef struct
  {
    const char *name;
    unsigned long int max;
    unsigned long int min;
    int size;
    void (*set) (void *state, unsigned long int seed);
    unsigned long int (*get) (void *state);
    double (*get_double) (void *state);
  }
gsl_rng_type;

typedef struct
  {
    const gsl_rng_type * type;
    void *state;
  }
gsl_rng;