~ubuntu-branches/ubuntu/lucid/gauche-c-wrapper/lucid

« back to all changes in this revision

Viewing changes to examples/sdl/sdl_helper.c

  • Committer: Bazaar Package Importer
  • Author(s): NIIBE Yutaka
  • Date: 2008-04-07 09:15:03 UTC
  • Revision ID: james.westby@ubuntu.com-20080407091503-wu0h414koe95kj4i
Tags: upstream-0.5.2
ImportĀ upstreamĀ versionĀ 0.5.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 *  sdl_helper.c
 
3
 *
 
4
 *   Copyright (c) 2007 KOGURO, Naoki (naoki@koguro.net)
 
5
 *   All rights reserved.
 
6
 *
 
7
 *   Redistribution and use in source and binary forms, with or without 
 
8
 *   modification, are permitted provided that the following conditions 
 
9
 *   are met:
 
10
 *
 
11
 *   1. Redistributions of source code must retain the above copyright 
 
12
 *      notice, this list of conditions and the following disclaimer.
 
13
 *   2. Redistributions in binary form must reproduce the above copyright 
 
14
 *      notice, this list of conditions and the following disclaimer in the 
 
15
 *      documentation and/or other materials provided with the distribution.
 
16
 *   3. Neither the name of the authors nor the names of its contributors 
 
17
 *      may be used to endorse or promote products derived from this 
 
18
 *      software without specific prior written permission.
 
19
 *
 
20
 *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 
21
 *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
 
22
 *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
 
23
 *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
 
24
 *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
 
25
 *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 
 
26
 *   TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
 
27
 *   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 
 
28
 *   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
 
29
 *   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
 
30
 *   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
31
 *
 
32
 *   $Id: $
 
33
 */
 
34
 
 
35
#ifdef main
 
36
static int (*main_func)(int argc, char *argv[]);
 
37
 
 
38
int main(int argc, char *argv[])
 
39
{
 
40
    return main_func(argc, argv);
 
41
}
 
42
#endif
 
43
 
 
44
int run_sdl_main(int argc, char *argv[], int (*func)(int argc, char *argv[]))
 
45
{
 
46
#ifdef main
 
47
#undef main
 
48
    main_func = func;
 
49
    return main(argc, argv);
 
50
#else
 
51
    return func(argc, argv);
 
52
#endif
 
53
}
 
54
 
 
55
/* end of file */