struct.cxx 946 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. typedef struct foo_s /* Foo structure */
  2. {
  3. float foo; /* Real number */
  4. int bar; /* Integer */
  5. foo_s(float f, int b);
  6. ~foo_s();
  7. // 'get_bar()' - Get the value of bar.
  8. int // O - Value of bar
  9. get_bar()
  10. {
  11. return (bar);
  12. }
  13. // 'get_foo()' - Get the value of foo.
  14. float // O - Value of foo
  15. get_foo()
  16. {
  17. return (foo);
  18. }
  19. // 'set_bar()' - Set the value of bar.
  20. void
  21. set_bar(int b) // I - Value of bar
  22. {
  23. bar = b;
  24. }
  25. // 'set_foo()' - Set the value of foo.
  26. void
  27. set_foo(float f) // I - Value of foo
  28. {
  29. foo = f;
  30. }
  31. } foo_t;
  32. // 'foo_s::foo_s()' - Create a foo_s structure.
  33. foo_s::foo_s(float f, // I - Value of foo
  34. int b) // I - Value of bar
  35. {
  36. foo = f;
  37. bar = b;
  38. }
  39. // 'foo_s::~foo_s()' - Destroy a foo_s structure.
  40. foo_s::~foo_s()
  41. {
  42. }
  43. typedef struct foo_private_s /* @private@ */
  44. {
  45. int a; /* Value of "a" */
  46. char b[255]; /* Value of "b" */
  47. } foo_private_t;