~ubuntu-branches/ubuntu/maverick/uim/maverick

« back to all changes in this revision

Viewing changes to sigscheme/src/module-srfi55.c

  • Committer: Bazaar Package Importer
  • Author(s): Masahito Omote
  • Date: 2008-06-25 19:56:33 UTC
  • mfrom: (3.1.18 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080625195633-8jljph4rfq00l8o7
Tags: 1:1.5.1-2
* uim-tcode: provide tutcode-custom.scm, tutcode-bushudic.scm
  and tutcode-rule.scm (Closes: #482659)
* Fix FTBFS: segv during compile (Closes: #483078).
  I personally think this bug is not specific for uim but is a optimization
  problem on gcc-4.3.1. (https://bugs.freedesktop.org/show_bug.cgi?id=16477)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*===========================================================================
 
2
 *  Filename : module-srfi55.c
 
3
 *  About    : require-extension
 
4
 *
 
5
 *  Copyright (c) 2007-2008 SigScheme Project <uim-en AT googlegroups.com>
 
6
 *
 
7
 *  All rights reserved.
 
8
 *
 
9
 *  Redistribution and use in source and binary forms, with or without
 
10
 *  modification, are permitted provided that the following conditions
 
11
 *  are met:
 
12
 *
 
13
 *  1. Redistributions of source code must retain the above copyright
 
14
 *     notice, this list of conditions and the following disclaimer.
 
15
 *  2. Redistributions in binary form must reproduce the above copyright
 
16
 *     notice, this list of conditions and the following disclaimer in the
 
17
 *     documentation and/or other materials provided with the distribution.
 
18
 *  3. Neither the name of authors nor the names of its contributors
 
19
 *     may be used to endorse or promote products derived from this software
 
20
 *     without specific prior written permission.
 
21
 *
 
22
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
 
23
 *  IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 
24
 *  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 
25
 *  PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
 
26
 *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 
27
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 
28
 *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 
29
 *  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 
30
 *  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 
31
 *  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 
32
 *  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
33
===========================================================================*/
 
34
 
 
35
#include <config.h>
 
36
 
 
37
#include "sigscheme.h"
 
38
#include "sigschemeinternal.h"
 
39
 
 
40
/*=======================================
 
41
  File Local Macro Definitions
 
42
=======================================*/
 
43
 
 
44
/*=======================================
 
45
  File Local Type Definitions
 
46
=======================================*/
 
47
 
 
48
/*=======================================
 
49
  Variable Definitions
 
50
=======================================*/
 
51
#include "functable-srfi55.c"
 
52
 
 
53
SCM_GLOBAL_VARS_BEGIN(static_srfi55);
 
54
#define static
 
55
static ScmObj l_sym_require_extension;
 
56
#undef static
 
57
SCM_GLOBAL_VARS_END(static_srfi55);
 
58
#define l_sym_require_extension SCM_GLOBAL_VAR(static_srfi55, \
 
59
                                               l_sym_require_extension)
 
60
SCM_DEFINE_STATIC_VARS(static_srfi55);
 
61
 
 
62
/*=======================================
 
63
  File Local Function Declarations
 
64
=======================================*/
 
65
 
 
66
/*=======================================
 
67
  Function Definitions
 
68
=======================================*/
 
69
SCM_EXPORT void
 
70
scm_initialize_srfi55(void)
 
71
{
 
72
    scm_register_funcs(scm_functable_srfi55);
 
73
 
 
74
    l_sym_require_extension = scm_intern("%require-extension");
 
75
 
 
76
    scm_require_module("sscm-ext");  /* for 'provided?' and 'provide' */
 
77
    scm_load_system_file("srfi-55.scm");
 
78
}
 
79
 
 
80
SCM_EXPORT ScmObj
 
81
scm_s_srfi55_require_extension(ScmObj clauses, ScmObj env)
 
82
{
 
83
    ScmObj proc;
 
84
    DECLARE_FUNCTION("require-extension", syntax_variadic_0);
 
85
 
 
86
    /*=======================================================================
 
87
      (require-extension <clause> ...)
 
88
 
 
89
      <clause> ::= (<extension-identifier>)
 
90
                   | (<extension-identifier> <extension-argument> ...)
 
91
      <extension-identifier> ::= <symbol>
 
92
      <extension-argument> ::= <any Scheme value>
 
93
    =======================================================================*/
 
94
    proc = scm_symbol_value(l_sym_require_extension, SCM_INTERACTION_ENV);
 
95
 
 
96
    return scm_call(proc, clauses);
 
97
}