~ubuntu-branches/ubuntu/intrepid/ecl/intrepid

« back to all changes in this revision

Viewing changes to src/c/main.d

  • Committer: Bazaar Package Importer
  • Author(s): Peter Van Eynde
  • Date: 2006-07-02 00:20:00 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060702002000-8bn170vd0qpx7to8
Tags: 0.9i-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
130
130
int
131
131
cl_shutdown(void)
132
132
{
133
 
        cl_object l = SYM_VAL(@'si::*exit-hooks*');
134
 
        cl_object form = cl_list(2, @'funcall', Cnil);
135
 
        while (CONSP(l)) {
136
 
                CADR(form) = CAR(l);
137
 
                si_safe_eval(3, form, Cnil, OBJNULL);
138
 
                l = CDR(l);
139
 
        }
 
133
        if (ecl_booted > 0) {
 
134
                cl_object l = SYM_VAL(@'si::*exit-hooks*');
 
135
                cl_object form = cl_list(2, @'funcall', Cnil);
 
136
                while (CONSP(l)) {
 
137
                        CADR(form) = CAR(l);
 
138
                        si_safe_eval(3, form, Cnil, OBJNULL);
 
139
                        l = CDR(l);
 
140
                        ECL_SET(@'si::*exit-hooks*', l);
 
141
                }
140
142
#ifdef ENABLE_DLOPEN
141
 
        ecl_library_close_all();
 
143
                ecl_library_close_all();
142
144
#endif
143
145
#ifdef TCP
144
 
        ecl_tcp_close_all();
 
146
                ecl_tcp_close_all();
145
147
#endif
 
148
        }
 
149
        ecl_booted = -1;
146
150
        return 1;
147
151
}
148
152
 
153
157
        cl_object features;
154
158
        int i;
155
159
 
 
160
        if (ecl_booted) {
 
161
                if (ecl_booted < 0) {
 
162
                        /* We have called cl_shutdown and want to use ECL again. */
 
163
                        ecl_booted = 1;
 
164
                }
 
165
                return;
 
166
        }
 
167
 
156
168
#if !defined(GBC_BOEHM)
157
169
        setbuf(stdin,  stdin_buf);
158
170
        setbuf(stdout, stdout_buf);