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

« back to all changes in this revision

Viewing changes to sigscheme/src/gcroots/gcroots.h

  • 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 : gcroots.h
 
3
 *  About    : SigScheme-specific implementation of libgcroots API
 
4
 *
 
5
 *  Copyright (C) 2006 YAMAMOTO Kengo <yamaken AT bp.iij4u.or.jp>
 
6
 *  Copyright (c) 2007-2008 SigScheme Project <uim-en AT googlegroups.com>
 
7
 *
 
8
 *  All rights reserved.
 
9
 *
 
10
 *  Redistribution and use in source and binary forms, with or without
 
11
 *  modification, are permitted provided that the following conditions
 
12
 *  are met:
 
13
 *
 
14
 *  1. Redistributions of source code must retain the above copyright
 
15
 *     notice, this list of conditions and the following disclaimer.
 
16
 *  2. Redistributions in binary form must reproduce the above copyright
 
17
 *     notice, this list of conditions and the following disclaimer in the
 
18
 *     documentation and/or other materials provided with the distribution.
 
19
 *  3. Neither the name of authors nor the names of its contributors
 
20
 *     may be used to endorse or promote products derived from this software
 
21
 *     without specific prior written permission.
 
22
 *
 
23
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
 
24
 *  IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 
25
 *  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 
26
 *  PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
 
27
 *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 
28
 *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 
29
 *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 
30
 *  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 
31
 *  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 
32
 *  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 
33
 *  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
34
===========================================================================*/
 
35
#ifndef _GCROOTS_H
 
36
#define _GCROOTS_H
 
37
 
 
38
#include <stdlib.h>
 
39
 
 
40
#include "global.h"
 
41
 
 
42
#ifdef __cplusplus
 
43
extern "C" {
 
44
#endif
 
45
 
 
46
#define GCROOTS_VERSION_MAJOR      (0)
 
47
#define GCROOTS_VERSION_MINOR      (2)
 
48
#define GCROOTS_VERSION_PATCHLEVEL (0)
 
49
#define GCROOTS_API_REVISION       (1)
 
50
 
 
51
#define GCROOTS_VERSION_REQUIRE(major, minor, patchlevel)                    \
 
52
  ((major) < GCROOTS_VERSION_MAJOR                                           \
 
53
   || ((major) == GCROOTS_VERSION_MAJOR && (minor) < GCROOTS_VERSION_MINOR)  \
 
54
   || ((major) == GCROOTS_VERSION_MAJOR && (minor) == GCROOTS_VERSION_MINOR  \
 
55
       && (patchlevel) <= GCROOTS_VERSION_PATCHLEVEL))
 
56
 
 
57
 
 
58
typedef struct _GCROOTS_context GCROOTS_context;
 
59
 
 
60
typedef void (*GCROOTS_mark_proc)(void *start, void *end,
 
61
                                  int is_certain, int is_aligned);
 
62
typedef void *(*GCROOTS_user_proc)(void *arg);
 
63
typedef void *(*GCROOTS_context_alloc_proc)(size_t ctx_size);
 
64
 
 
65
/* may return NULL */
 
66
SCM_EXPORT GCROOTS_context *GCROOTS_init(GCROOTS_context_alloc_proc allocator,
 
67
                                         GCROOTS_mark_proc marker,
 
68
                                         int scan_entire_system_stack);
 
69
SCM_EXPORT void GCROOTS_fin(GCROOTS_context *ctx);
 
70
 
 
71
SCM_EXPORT void *GCROOTS_call_with_gc_ready_stack(GCROOTS_context *ctx,
 
72
                                                  GCROOTS_user_proc proc,
 
73
                                                  void *arg);
 
74
SCM_EXPORT void GCROOTS_mark(GCROOTS_context *ctx);
 
75
 
 
76
SCM_EXPORT int GCROOTS_is_protected_context(GCROOTS_context *ctx);
 
77
SCM_EXPORT int GCROOTS_is_protected(GCROOTS_context *ctx, void *obj);
 
78
 
 
79
#ifdef __cplusplus
 
80
}
 
81
#endif
 
82
 
 
83
#endif /* _GCROOTS_H */