Imported Upstream version 2.4.2
[platform/upstream/libtool.git] / tests / mdemo / foo2.c
1 /* foo2.c -- trivial test library
2
3    Copyright (C) 1998-1999, 2007 Free Software Foundation, Inc.
4    Written by Thomas Tanner, 1998
5
6    This file is part of GNU Libtool.
7
8 GNU Libtool is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2 of
11 the License, or (at your option) any later version.
12
13 GNU Libtool is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU Libtool; see the file COPYING.  If not, a copy
20 can be downloaded from  http://www.gnu.org/licenses/gpl.html,
21 or obtained by writing to the Free Software Foundation, Inc.,
22 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 */
24
25 #include "foo.h"
26 #include <stdio.h>
27 #include <math.h>
28
29 #define nothing libfoo2_LTX_nothing
30 #define foo2    libfoo2_LTX_foo2
31 #define hello   libfoo2_LTX_hello
32
33 /* Give a global variable definition. */
34 int nothing;
35
36 /* private function */
37 int
38 _foo2_helper()
39 {
40   sub();
41   return FOO_RET;
42 }
43
44 /* exported functions */
45 __BEGIN_DECLS
46
47 int
48 foo2()
49 {
50   printf ("sin (0.0) = %g\n", (double) sin ((double) 0.0));
51   return _foo2_helper();
52 }
53
54 int
55 hello()
56 {
57   printf ("** This is foolib 2 **\n");
58   return HELLO_RET;
59 }
60
61 __END_DECLS