PageRenderTime 40ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/test-suite/array_member.i

#
Swig | 74 lines | 49 code | 25 blank | 0 comment | 0 complexity | 0949878828eb63af24529db8eb7cd3fa MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module array_member
  2. %inline %{
  3. typedef struct Foo {
  4. char text[8];
  5. int data[8];
  6. } Foo;
  7. int global_data[8] = { 0,1,2,3,4,5,6,7 };
  8. void set_value(int *x, int i, int v) {
  9. x[i] = v;
  10. }
  11. int get_value(int *x, int i) {
  12. return x[i];
  13. }
  14. %}
  15. #ifdef __cplusplus
  16. %inline
  17. {
  18. struct Material
  19. {
  20. };
  21. class RayPacketData {
  22. public:
  23. enum {
  24. Size = 32
  25. };
  26. const Material * chitMat[Size];
  27. Material hitMat_val[Size];
  28. Material *hitMat[Size];
  29. const Material * chitMat2[Size][Size];
  30. Material hitMat_val2[Size][Size];
  31. Material *hitMat2[Size][Size];
  32. };
  33. }
  34. #endif
  35. %inline %{
  36. #define BUFF_LEN 12
  37. typedef unsigned char BUFF[BUFF_LEN];
  38. typedef BUFF MY_BUFF;
  39. typedef struct _m {
  40. int i;
  41. MY_BUFF x;
  42. } MyBuff;
  43. typedef char SBUFF[BUFF_LEN];
  44. typedef SBUFF MY_SBUFF;
  45. typedef struct _sm {
  46. int i;
  47. MY_SBUFF x;
  48. } MySBuff;
  49. %}