|
Teaching swig about arrays of structs within a struct?: msg#00076programming.swig
I have a swigged struct looking like: typedef struct { int i; } A; typedef struct { A *a; } B; // actually an array of (say) size 5 A *A_alloc(); B *B_alloc(); I can %extend the type B as %extend B { A *get_a(int i) { return self->a[i]; } } and (in python) talk about b = B_alloc() a = b.get_a(2) to get (in C-speak) b->a[2]. What I haven't figured out how to do is to be able to say a = b.a[2] as this merely subscripts b.a, which it thinks is a string. Ideas? This is using swig 1.3.22. While I'm writing, thanks for the updated documentation. R _______________________________________________ Swig maillist - Swig@xxxxxxxxxxxxxxx http://mailman.cs.uchicago.edu/mailman/listinfo/swig |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: how to use the autodoc feature of new swig-1.3.22?: 00076, Bo Peng |
|---|---|
| Next by Date: | problem linking python libs: 00076, roger |
| Previous by Thread: | SWIG 1.3.22 and template parameters evaluationi: 00076, Anton Deguet |
| Next by Thread: | problem linking python libs: 00076, roger |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |