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

« back to all changes in this revision

Viewing changes to uim/uim-sh.c

  • Committer: Bazaar Package Importer
  • Author(s): Masahito Omote
  • Date: 2006-11-23 15:10:53 UTC
  • mfrom: (3.1.8 edgy)
  • Revision ID: james.westby@ubuntu.com-20061123151053-q42sk1lvks41xpfx
Tags: 1:1.2.1-9
uim-gtk2.0.postinst: Don't call update-gtk-immodules on purge.
(closes: Bug#398530)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
  uim-sh.c: uim interactive shell for debugging, batch processing and
3
3
            serving as generic inferior process
4
4
 
5
 
  Copyright (c) 2003,2004 uim Project http://uim.freedesktop.org/
 
5
  Copyright (c) 2003-2006 uim Project http://uim.freedesktop.org/
6
6
 
7
7
  All rights reserved.
8
8
 
19
19
     may be used to endorse or promote products derived from this software
20
20
     without specific prior written permission.
21
21
 
22
 
  THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 
22
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
23
23
  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
24
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25
 
  ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 
25
  ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE
26
26
  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27
27
  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28
28
  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35
35
 
36
36
#include "uim.h"
37
37
#include "uim-scm.h"
 
38
#include "uim-compat-scm.h"
 
39
 
 
40
#ifdef LIBEDIT
 
41
#include "editline.h"
 
42
#endif
38
43
 
39
44
#ifdef UIM_SH_USE_EXIT_HOOK
40
45
extern int uim_siod_fatal;
42
47
 
43
48
int
44
49
main(int argc, char *argv[]) {
 
50
  long verbose;
45
51
  uim_lisp args, form;
46
52
 
47
53
  uim_scm_set_output(stdout);
49
55
  /* TODO: be able to suppress ordinary initialization process */
50
56
  uim_init();
51
57
 
 
58
#ifdef LIBEDIT
 
59
  editline_init();
 
60
#endif
 
61
 
 
62
  verbose = uim_scm_get_verbose_level();
52
63
  uim_scm_set_verbose_level(1);
53
 
  uim_scm_load_file("uim-sh.scm");
 
64
  uim_scm_require_file("uim-sh.scm");
54
65
#ifdef UIM_SH_USE_EXIT_HOOK
55
 
  /* is not working even if uim_siod_fatal is accessible. outermost
56
 
   * *catch affects me?
57
 
   */
 
66
  /*
 
67
     is not working even if uim_siod_fatal is accessible. outermost
 
68
     *catch affects me?
 
69
  */
58
70
  if (uim_siod_fatal)
59
71
    return 1;
60
72
#endif
61
73
 
62
 
  /* keep verbose level 1 to make (require "foo.scm") returns
63
 
   * *foo.scm-loaded* only. This is required to run uim-test-utils.scm
64
 
   * correctly.
65
 
   */
66
 
  /* uim_scm_set_verbose_level(5); */
 
74
  /*
 
75
    verbose level must be greater than or equal to 1 to print anything
 
76
  */
 
77
  if (verbose < 1)
 
78
    verbose = 1;
 
79
  uim_scm_set_verbose_level(verbose);
67
80
 
68
81
  args = uim_scm_c_strs_into_list(argc, (const char *const *)argv);
69
82
  form = uim_scm_list2(uim_scm_intern_c_str("uim-sh"),
78
91
    return 1;
79
92
#endif
80
93
 
 
94
#ifdef LIBEDIT
 
95
  editline_quit();
 
96
#endif
 
97
 
81
98
  uim_quit();
82
99
 
83
100
  return 0;