Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 485f8c30b7e261acbe76df6157207a36 > files > 54

ocaml-camlidl-devel-1.05-11.fc13.i686.rpm

/* Structs, unions and typedefs */

struct s1 {
  int x;
  double d;
  float f;
  long l[3];
};

int foo0([in] struct s1 s);

int foo1([in] struct s1 * s);

void foo2([out] struct s1 * s);

typedef struct {
  int x;
  struct { int y; int z; } t;
  double d;
} t;

int foo3([in] t * s);

struct s2 {
  int n;
  [size_is(n)] long l[];
};

int foo4([in] struct s2 * s);

void foo5([out] struct s2 * s);

struct s4 {
  float x, y, z;
};

int foo6([in] struct s4 * s);
void foo7([out] struct s4 * s);

// Forward declarations

struct s5;

struct s6 {
  int info;
  [unique] struct s5 * next;
};

struct s5 {
  int count;
  [unique] struct s6 * data;
};

// Unions

enum switchtype { FLOAT_ARRAY  = 1, DOUBLE_ARRAY = 2, OTHER = 3 };

struct su1
{
    int len;
    enum switchtype type;
    [switch_is(type)] union
    {         
    	case FLOAT_ARRAY: [size_is(len)] float* fl;
    	case DOUBLE_ARRAY: [size_is(len)] double* db;
        case OTHER: struct { int len2; [size_is(len2)] int* c; } i;
    } data;
};