~ubuntu-branches/ubuntu/oneiric/swig1.3/oneiric

« back to all changes in this revision

Viewing changes to Examples/php/enum/example.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2009-11-15 14:00:28 UTC
  • mfrom: (1.2.9 upstream) (2.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091115140028-me7amr2rie8zz1xn
Tags: 1.3.40-2ubuntu1
* Merge from Debian testing (LP: #356529), remaining changes:
  - Drop libchicken-dev from the build-depends (it's in universe)
  - Remove Pike from package description and from configure flags
  - drop "--without-mzscheme", we don't have it in our build-depends
  - use php-config5
  - Clean Runtime/ as well.
  - debian/rules (clean): Remove Lib/ocaml/swigp4.ml.
* debian/rules: Remove hardcoded python version.
* Remove upper limit for python from Build-Depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* File : example.cxx */
 
2
 
 
3
#include "example.h"
 
4
#include <stdio.h>
 
5
 
 
6
void Foo::enum_test(speed s) {
 
7
  if (s == IMPULSE) {
 
8
    printf("IMPULSE speed\n");
 
9
  } else if (s == WARP) {
 
10
    printf("WARP speed\n");
 
11
  } else if (s == LUDICROUS) {
 
12
    printf("LUDICROUS speed\n");
 
13
  } else {
 
14
    printf("Unknown speed\n");
 
15
  }
 
16
}
 
17
 
 
18
void enum_test(color c, Foo::speed s) {
 
19
  if (c == RED) {
 
20
    printf("color = RED, ");
 
21
  } else if (c == BLUE) {
 
22
    printf("color = BLUE, ");
 
23
  } else if (c == GREEN) {
 
24
    printf("color = GREEN, ");
 
25
  } else {
 
26
    printf("color = Unknown color!, ");
 
27
  }
 
28
  if (s == Foo::IMPULSE) {
 
29
    printf("speed = IMPULSE speed\n");
 
30
  } else if (s == Foo::WARP) {
 
31
    printf("speed = WARP speed\n");
 
32
  } else if (s == Foo::LUDICROUS) {
 
33
    printf("speed = LUDICROUS speed\n");
 
34
  } else {
 
35
    printf("speed = Unknown speed!\n");
 
36
  }
 
37
}